Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
install_plugin
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
李增强
install_plugin
Commits
3baf0069
Commit
3baf0069
authored
Oct 08, 2021
by
汪林玲
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
7a19299e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
7 deletions
+0
-7
android/src/main/kotlin/com/zaihui/installplugin/InstallPlugin.kt
...src/main/kotlin/com/zaihui/installplugin/InstallPlugin.kt
+0
-7
No files found.
android/src/main/kotlin/com/zaihui/installplugin/InstallPlugin.kt
View file @
3baf0069
...
...
@@ -6,7 +6,6 @@ import android.content.Intent
import
android.net.Uri
import
android.os.Build
import
android.provider.Settings
import
android.util.Log
import
androidx.core.content.FileProvider
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodChannel
...
...
@@ -35,10 +34,6 @@ class InstallPlugin(private val registrar: Registrar) : MethodCallHandler {
val
installPlugin
=
InstallPlugin
(
registrar
)
channel
.
setMethodCallHandler
(
installPlugin
)
registrar
.
addActivityResultListener
{
requestCode
,
resultCode
,
intent
->
Log
.
d
(
"ActivityResultListener"
,
"requestCode=$requestCode, resultCode = $resultCode, intent = $intent"
)
if
(
resultCode
==
Activity
.
RESULT_OK
&&
requestCode
==
installRequestCode
)
{
installPlugin
.
install24
(
registrar
.
context
(),
installPlugin
.
apkFile
,
installPlugin
.
appId
)
true
...
...
@@ -57,7 +52,6 @@ class InstallPlugin(private val registrar: Registrar) : MethodCallHandler {
"installApk"
->
{
val
filePath
=
call
.
argument
<
String
>(
"filePath"
)
val
appId
=
call
.
argument
<
String
>(
"appId"
)
Log
.
d
(
"android plugin"
,
"installApk $filePath $appId"
)
try
{
installApk
(
filePath
,
appId
)
result
.
success
(
"Success"
)
...
...
@@ -86,7 +80,6 @@ class InstallPlugin(private val registrar: Registrar) : MethodCallHandler {
private
fun
showSettingPackageInstall
(
activity
:
Activity
)
{
// todo to test with android 26
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
O
)
{
Log
.
d
(
"SettingPackageInstall"
,
">= Build.VERSION_CODES.O"
)
val
intent
=
Intent
(
Settings
.
ACTION_MANAGE_UNKNOWN_APP_SOURCES
)
intent
.
data
=
Uri
.
parse
(
"package:"
+
activity
.
packageName
)
activity
.
startActivityForResult
(
intent
,
installRequestCode
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment