mirror of
https://github.com/kdrag0n/safetynet-fix.git
synced 2024-10-06 06:39:49 +00:00
zygisk: Inject payload after specialization
This commit is contained in:
parent
cd84bf361f
commit
69e2aae3d8
@ -26,6 +26,15 @@ public:
|
|||||||
preSpecialize(process);
|
preSpecialize(process);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void postAppSpecialize(const zygisk::AppSpecializeArgs *args) override {
|
||||||
|
// Inject if module was loaded, otherwise this would've been unloaded by now (for non-GMS)
|
||||||
|
if (!moduleDex.empty()) {
|
||||||
|
LOGD("Injecting payload...");
|
||||||
|
injectPayload();
|
||||||
|
LOGI("Payload injected");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
zygisk::Api *api;
|
zygisk::Api *api;
|
||||||
JNIEnv *env;
|
JNIEnv *env;
|
||||||
@ -81,10 +90,12 @@ private:
|
|||||||
// caused by model detection and flag provisioning, such as broken weather with the new
|
// caused by model detection and flag provisioning, such as broken weather with the new
|
||||||
// smartspace on Android 12.
|
// smartspace on Android 12.
|
||||||
if (process == "com.google.android.gms.unstable") {
|
if (process == "com.google.android.gms.unstable") {
|
||||||
// This is post-fork, so just inject the payload now
|
// Load the payload, but don't inject it yet until after specialization
|
||||||
|
// Otherwise, specialization fails if any code from the payload still happens to be
|
||||||
|
// running
|
||||||
|
LOGD("Loading payload...");
|
||||||
loadPayload();
|
loadPayload();
|
||||||
injectPayload();
|
LOGD("Payload loaded");
|
||||||
LOGI("Payload injected");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user