New way to unload zygisk

Co-authored-by: 残页 <a1364259@163.com>
This commit is contained in:
LoveSy
2023-04-01 03:37:17 -07:00
committed by John Wu
co-authored by 残页
parent e48afff5e8
commit 3a4fe53f27
4 changed files with 48 additions and 8 deletions
+5 -1
View File
@@ -10,7 +10,7 @@
#endif
__attribute__((constructor))
static void zygisk_loader() {
static void zygisk_loader(void) {
android_dlextinfo info = {
.flags = ANDROID_DLEXT_FORCE_LOAD
};
@@ -20,5 +20,9 @@ static void zygisk_loader() {
if (entry) {
entry(handle);
}
void (*unload)(void) = dlsym(handle, "unload_first_stage");
if (unload) {
__attribute__((musttail)) return unload();
}
}
}