[core] Fix ZTE devices on zygisk (#1576)

This commit is contained in:
LoveSy 2022-01-29 00:14:30 +08:00 committed by GitHub
parent ad59477953
commit 2830441fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -330,6 +330,12 @@ namespace lspd {
}
void postServerSpecialize(const zygisk::ServerSpecializeArgs *args) override {
if (__system_property_find("ro.vendor.product.ztename")) {
auto *process = env_->FindClass("android/os/Process");
auto *set_argv0 = env_->GetStaticMethodID(process, "setArgV0",
"(Ljava/lang/String;)V");
env_->CallStaticVoidMethod(process, set_argv0, env_->NewStringUTF("system_server"));
}
Context::GetInstance()->OnNativeForkSystemServerPost(env_);
}
};