Skip to content

hacktons/zygote

Repository files navigation

Zygote

Restart your application programmatically, compact for Android 10(API level 29)

Sample

window background homepage restart homepage
1.png 2.png 1.png

How to use

Add maven repo and library dependency:

repositories {
    maven {
        url = uri("https://maven.pkg.github.com/hacktons/zygote")
    }
}

dependencies {
    implementation("cn.hacktons:zygote:1.0.0")
}

Kill process directly:

App.restart(context)

Kill process by yourself:

App.restart(context) {
    Log.i(tag, "do some clean task, such as flush pending log request")
    // TODO xxx
    Process.killProcess(Process.myPid())
}

How it works

Restart main process via sub-process instead of AlarmManager.

zygote-flow.webp

About

Small library used to restart android application

Resources

License

Stars

Watchers

Forks

Releases

No releases published