https://github.com/hacktons/zygote
Small library used to restart android application
https://github.com/hacktons/zygote
Last synced: 5 months ago
JSON representation
Small library used to restart android application
- Host: GitHub
- URL: https://github.com/hacktons/zygote
- Owner: hacktons
- License: apache-2.0
- Created: 2023-12-20T05:34:35.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-02T08:23:39.000Z (about 2 years ago)
- Last Synced: 2025-04-12T16:15:45.547Z (11 months ago)
- Language: Kotlin
- Size: 17.6 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Zygote
Restart your application programmatically, compact for Android 10(API level 29)
## Sample
| window background | homepage | restart homepage |
|------------------------|------------------------|------------------------|
|  |  |  |
## 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.
