- Dec 12, 2022
- 357
- 2
We have a self updater. Once the APK file is downloaded from our private website we start an activity to install it.
When...
When this runs on Android 12 it works perfectly.Dim i As Intent
Dim apkPath As String = "file://" & File.Combine(File.DirDefaultExternal, APKFileName)
Log("Installing from: " & apkPath)
If phone.SdkVersion >= 24 Then
File.copy(File.DirDefaultExternal, APKFileName, Starter.Provider.SharedFolder, APKFileName)
i.Initialize("android.intent.action.INSTALL_PACKAGE", Starter.Provider.GetFileUri(APKFileName))
i.Flags = Bit.Or(i.Flags, 1) 'FLAG_GRANT_READ_URI_PERMISSION
Else
Dim out As OutputStream
out = File.OpenOutput(File.DirRootExternal,APKFileName,False)
out.WriteBytes(bts, 0, bts.length)
out.Close
i.Initialize(i.ACTION_VIEW,apkPath )
i.SetType("application/vnd.android.package-archive")
End If
StartActivity(i)
ExitApplication
Click to expand...
When...
برای دیدن لینک ها باید ثبت نام کنید
برای دیدن لینک ها باید ثبت نام کنید