act262 / ApkInstaller

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Download

Demo

./run.sh

Usage

Add dependency

Add jcenter repositories

app build.gradle

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    // Add here
    implementation 'io.zcx.apk:ApkInstaller:$latestVersion'
}

install apk

        val apks = setOf(
            File("/sdcard", "plugin_biz_feature1-debug.apk"),
            File("/sdcard", "plugin_biz_feature2-debug.apk"),
            File("/sdcard", "plugin_biz_feature3-debug.apk")
        )

        val apkInstaller = ApkInstaller(this)
        apkInstaller.install(
            InstallParams()
                .setDontKillApp(true)
                .allowTestOnly(true)
                .setInstallApks(apks),
            object : InstallerCallback {
                override fun onSuccess(p0: Bundle?) {
                    toast("Install succeed")
                }

                override fun onFailure(p0: Bundle?) {
                    toast("Install failure")
                }

                override fun onPending(p0: Bundle?) {
                }

                override fun onAborted(p0: Bundle?) {
                    toast("Install aborted")
                }
            })

About


Languages

Language:Kotlin 96.7%Language:Shell 3.3%