You've already forked TrickyStore
mirror of
https://github.com/5ec1cff/TrickyStore.git
synced 2025-09-06 06:37:07 +00:00
Identify GMS process with app data dir
Process name can never get trusted.
This commit is contained in:
@@ -20,8 +20,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void preAppSpecialize(AppSpecializeArgs *args) override {
|
void preAppSpecialize(AppSpecializeArgs *args) override {
|
||||||
int enabled = 0;
|
|
||||||
api_->setOption(zygisk::DLCLOSE_MODULE_LIBRARY);
|
api_->setOption(zygisk::DLCLOSE_MODULE_LIBRARY);
|
||||||
|
|
||||||
|
int enabled = 0;
|
||||||
{
|
{
|
||||||
auto fd = api_->connectCompanion();
|
auto fd = api_->connectCompanion();
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
@@ -30,9 +31,19 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!enabled) return;
|
if (!enabled) return;
|
||||||
const char *process = env_->GetStringUTFChars(args->nice_name, nullptr);
|
if (args->app_data_dir == nullptr) {
|
||||||
if (process == "com.google.android.gms.unstable"sv) {
|
return;
|
||||||
LOGI("spoofing build vars in %s!", process);
|
}
|
||||||
|
|
||||||
|
auto app_data_dir = env_->GetStringUTFChars(args->app_data_dir, nullptr);
|
||||||
|
auto nice_name = env_->GetStringUTFChars(args->nice_name, nullptr);
|
||||||
|
|
||||||
|
std::string_view process(nice_name);
|
||||||
|
std::string_view dir(app_data_dir);
|
||||||
|
|
||||||
|
if (dir.ends_with("/com.google.android.gms") &&
|
||||||
|
process == "com.google.android.gms.unstable") {
|
||||||
|
LOGI("spoofing build vars in GMS!");
|
||||||
auto buildClass = env_->FindClass("android/os/Build");
|
auto buildClass = env_->FindClass("android/os/Build");
|
||||||
auto buildVersionClass = env_->FindClass("android/os/Build$VERSION");
|
auto buildVersionClass = env_->FindClass("android/os/Build$VERSION");
|
||||||
|
|
||||||
@@ -43,7 +54,7 @@ public:
|
|||||||
SET_FIELD(buildClass, "MANUFACTURER", "Google");
|
SET_FIELD(buildClass, "MANUFACTURER", "Google");
|
||||||
SET_FIELD(buildClass, "MODEL", "Pixel");
|
SET_FIELD(buildClass, "MODEL", "Pixel");
|
||||||
SET_FIELD(buildClass, "FINGERPRINT",
|
SET_FIELD(buildClass, "FINGERPRINT",
|
||||||
"google/sailfish/sailfish:8.1.0/OPM1.171019.011/4448085:user/release-keys");
|
"google/sailfish/sailfish:8.1.0/OPM1.171019.011/4448085:user/release-keys");
|
||||||
SET_FIELD(buildClass, "BRAND", "google");
|
SET_FIELD(buildClass, "BRAND", "google");
|
||||||
SET_FIELD(buildClass, "PRODUCT", "sailfish");
|
SET_FIELD(buildClass, "PRODUCT", "sailfish");
|
||||||
SET_FIELD(buildClass, "DEVICE", "sailfish");
|
SET_FIELD(buildClass, "DEVICE", "sailfish");
|
||||||
@@ -54,7 +65,9 @@ public:
|
|||||||
SET_FIELD(buildClass, "TYPE", "user");
|
SET_FIELD(buildClass, "TYPE", "user");
|
||||||
SET_FIELD(buildClass, "TAGS", "release-keys");
|
SET_FIELD(buildClass, "TAGS", "release-keys");
|
||||||
}
|
}
|
||||||
env_->ReleaseStringUTFChars(args->nice_name, process);
|
|
||||||
|
env_->ReleaseStringUTFChars(args->nice_name, nice_name);
|
||||||
|
env_->ReleaseStringUTFChars(args->app_data_dir, app_data_dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
void preServerSpecialize(ServerSpecializeArgs *args) override {
|
void preServerSpecialize(ServerSpecializeArgs *args) override {
|
||||||
|
|||||||
Reference in New Issue
Block a user