Install apps silently, with granted INSTALL_PACKAGES permission

后端 未结 16 2421
梦谈多话
梦谈多话 2020-11-22 10:32

I am trying to silently install apk into the system. My app is located in /system/app and successfully granted permission \"android.permission.INSTALL_PACKAGES\"

Ho

16条回答
  •  时光取名叫无心
    2020-11-22 10:53

    I made a test app for silent installs, using PackageManager.installPackage method.

    I get installPackage method through reflection, and made android.content.pm.IPackageInstallObserver interface in my src folder (because it's hidden in android.content.pm package).

    When i run installPackage, i got SecurityException with string indication, that my app has no android.permission.INSTALL_PACKAGES, but it defined in AndroidManifest.xml.

    So, i think, it's not possible to use this method.

    PS. I tested in on Android SDK 2.3 and 4.0. Maybe it will work with earlier versions.

提交回复
热议问题