Commit 3baf0069 authored by 汪林玲's avatar 汪林玲

更新

parent 7a19299e
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment