Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/hacktons/zygote
- Owner: hacktons
- License: apache-2.0
- Created: 2023-12-20T05:34:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-02T08:23:39.000Z (about 1 year ago)
- Last Synced: 2024-11-06T02:24:15.173Z (about 2 months ago)
- Language: Kotlin
- Size: 17.6 MB
- Stars: 1
- 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 |
|------------------------|------------------------|------------------------|
| ![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 worksRestart main process via sub-process instead of AlarmManager.
![zygote-flow.webp](images/zygote-flow.webp)