Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/hacktons/zygote

Small library used to restart android application
https://github.com/hacktons/zygote

Last synced: 10 days ago
JSON representation

Small library used to restart android application

Awesome Lists containing this project

README

        

# Zygote

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

## Sample

| window background | homepage | restart homepage |
|------------------------|------------------------|------------------------|
| ![1.png](images/1.png) | ![2.png](images/2.png) | ![1.png](images/3.png) |

## How to use

Add maven repo and library dependency:
```groovy
repositories {
maven {
url = uri("https://maven.pkg.github.com/hacktons/zygote")
}
}

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

Kill process directly:

```kotlin
App.restart(context)
```

Kill process by yourself:

```kotlin
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](images/zygote-flow.webp)