This commit is contained in:
chiteroman 2023-12-28 12:57:03 +01:00
parent aa340e742e
commit 96e7e473cf
12 changed files with 71 additions and 70 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>

View File

@ -1,10 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>

View File

@ -2,5 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/app/src/main/cpp/Dobby" vcs="Git" />
</component>
</project>

View File

@ -28,18 +28,13 @@ android {
externalNativeBuild {
cmake {
arguments += "-DANDROID_STL=none"
arguments += "-DCMAKE_BUILD_TYPE=MinSizeRel"
cFlags += "-fvisibility=hidden"
cFlags += "-fvisibility-inlines-hidden"
cFlags += "-flto=full"
arguments += "-DCMAKE_BUILD_TYPE=Release"
cppFlags += "-std=c++20"
cppFlags += "-fno-exceptions"
cppFlags += "-fno-rtti"
cppFlags += "-fvisibility=hidden"
cppFlags += "-fvisibility-inlines-hidden"
cppFlags += "-flto=full"
}
}
}
@ -48,9 +43,7 @@ android {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
@ -74,10 +67,8 @@ dependencies {
tasks.register("copyFiles") {
doLast {
val moduleFolder = project.rootDir.resolve("module")
val dexFile =
project.layout.buildDirectory.get().asFile.resolve("intermediates/dex/release/minifyReleaseWithR8/classes.dex")
val soDir =
project.layout.buildDirectory.get().asFile.resolve("intermediates/stripped_native_libs/release/out/lib")
val dexFile = project.layout.buildDirectory.get().asFile.resolve("intermediates/dex/release/minifyReleaseWithR8/classes.dex")
val soDir = project.layout.buildDirectory.get().asFile.resolve("intermediates/stripped_native_libs/release/out/lib")
dexFile.copyTo(moduleFolder.resolve("classes.dex"), overwrite = true)

View File

@ -12,7 +12,9 @@
#define PIF_JSON "/data/adb/pif.json"
static std::string FIRST_API_LEVEL, SECURITY_PATCH, BUILD_ID;
#define PIF_JSON_2 "/data/adb/modules/playintegrityfix/pif.json"
static std::string FIRST_API_LEVEL, SECURITY_PATCH;
typedef void (*T_Callback)(void *, const char *, const char *, uint32_t);
@ -29,7 +31,6 @@ static void modify_callback(void *cookie, const char *name, const char *value, u
if (!SECURITY_PATCH.empty()) {
value = SECURITY_PATCH.c_str();
LOGD("Set '%s' to '%s'", name, value);
}
} else if (prop.ends_with("api_level")) {
@ -37,15 +38,6 @@ static void modify_callback(void *cookie, const char *name, const char *value, u
if (!FIRST_API_LEVEL.empty()) {
value = FIRST_API_LEVEL.c_str();
LOGD("Set '%s' to '%s'", name, value);
}
} else if (prop == "ro.build.id") {
if (!BUILD_ID.empty()) {
value = BUILD_ID.c_str();
LOGD("Set '%s' to '%s'", name, value);
}
} else if (prop == "sys.usb.state") {
@ -53,6 +45,11 @@ static void modify_callback(void *cookie, const char *name, const char *value, u
value = "none";
}
if (!prop.starts_with("debug") && !prop.starts_with("cache") && !prop.starts_with("persist")) {
LOGD("[%s] -> %s", name, value);
}
return o_callback(cookie, name, value, serial);
}
@ -182,18 +179,6 @@ public:
LOGD("JSON file doesn't contain SECURITY_PATCH key :(");
}
if (json.contains("ID")) {
if (json["ID"].is_string()) {
BUILD_ID = json["ID"].get<std::string>();
}
} else {
LOGD("JSON file doesn't contain BUILD_ID key :(");
}
doHook();
LOGD("get system classloader");
@ -272,6 +257,11 @@ static void companion(int fd) {
FILE *jsonFile = fopen(PIF_JSON, "r");
if (jsonFile == nullptr) {
jsonFile = fopen(PIF_JSON_2, "r");
}
if (jsonFile) {
fseek(jsonFile, 0, SEEK_END);

View File

@ -12,10 +12,10 @@ import java.security.cert.Certificate;
import java.security.cert.CertificateException;
import java.util.Date;
import java.util.Enumeration;
import java.util.Locale;
public class CustomKeyStoreSpi extends KeyStoreSpi {
public static KeyStoreSpi keyStoreSpi;
public final class CustomKeyStoreSpi extends KeyStoreSpi {
public static volatile KeyStoreSpi keyStoreSpi;
@Override
public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException {
@ -24,8 +24,13 @@ public class CustomKeyStoreSpi extends KeyStoreSpi {
@Override
public Certificate[] engineGetCertificateChain(String alias) {
EntryPoint.LOG("Tried to get certificate chain, throwing exception!");
throw new UnsupportedOperationException();
for (StackTraceElement stackTraceElement : Thread.currentThread().getStackTrace()) {
if (stackTraceElement.getClassName().toLowerCase(Locale.US).contains("droidguard")) {
EntryPoint.LOG("DroidGuard call certificate chain! Throw exception.");
throw new UnsupportedOperationException();
}
}
return keyStoreSpi.engineGetCertificateChain(alias);
}
@Override

View File

@ -7,6 +7,8 @@ import org.json.JSONException;
import org.json.JSONObject;
import java.lang.reflect.Field;
import java.security.KeyStore;
import java.security.KeyStoreSpi;
import java.security.Provider;
import java.security.Security;
@ -53,6 +55,14 @@ public final class EntryPoint {
private static void spoofProvider() {
try {
KeyStore keyStore = KeyStore.getInstance("AndroidKeyStore");
keyStore.load(null);
Field f = keyStore.getClass().getDeclaredField("keyStoreSpi");
f.setAccessible(true);
CustomKeyStoreSpi.keyStoreSpi = (KeyStoreSpi) f.get(keyStore);
f.setAccessible(false);
Provider provider = Security.getProvider("AndroidKeyStore");
Provider customProvider = new CustomProvider(provider);
@ -98,7 +108,7 @@ public final class EntryPoint {
}
} catch (IllegalAccessException e) {
LOG("Couldn't modify field :(");
LOG("Couldn't modify field: " + e);
}
field.setAccessible(false);
}

View File

@ -2,6 +2,11 @@ We have a Telegram channel!
If you want to share your knowledge join:
https://t.me/playintegrityfix
# v15.0
# v15.1
- Fix issues.
Emergency update 🚨
- Fix few bugs.
- Using v15.6 fingerprint, so you can pass DEVICE.
MODULE WON'T PROVIDE MORE FINGERPRINTS WHEN GOOGLE BAN THIS ONE.

View File

@ -52,7 +52,7 @@ if [ -d "/system/app/EliteDevelopmentModule" ]; then
ui_print "- EliteDevelopmentModule app removed."
fi
# Move empty pif.json file
if [ ! -f "/data/adb/pif.json" ]; then
mv -f $MODPATH/pif.json /data/adb/
fi
if [ -f "/data/adb/pif.json" ]; then
mv -f "/data/adb/pif.json" "/data/adb/pif.json.old"
ui_print "- Backup pif.json"
fi

View File

@ -1,7 +1,7 @@
id=playintegrityfix
name=Play Integrity Fix
version=v15.0
versionCode=15000
version=v15.1
versionCode=15100
author=chiteroman
description=Universal modular fix for Play Integrity (and SafetyNet) on devices running Android 8+.
updateJson=https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/update.json

View File

@ -1,12 +1,11 @@
{
"PRODUCT": "",
"DEVICE": "",
"MANUFACTURER": "",
"BRAND": "",
"MODEL": "",
"FINGERPRINT": "",
"SECURITY_PATCH": "",
"ID": "",
"PRODUCT": "c01_ww",
"DEVICE": "acer_c01",
"MANUFACTURER": "Acer Inc.",
"BRAND": "acer",
"MODEL": "C01",
"FINGERPRINT": "acer/c01_ww/acer_c01:7.1.1/NMF26F/1521514970:user/release-keys",
"SECURITY_PATCH": "2018-04-01",
"FIRST_API_LEVEL": 24,
"FORCE_BASIC_ATTESTATION": true
}

View File

@ -1,6 +1,6 @@
{
"version": "v15.0",
"versionCode": 15000,
"zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v15.0/PlayIntegrityFix_v15.0.zip",
"version": "v15.1",
"versionCode": 15100,
"zipUrl": "https://github.com/chiteroman/PlayIntegrityFix/releases/download/v15.1/PlayIntegrityFix.zip",
"changelog": "https://raw.githubusercontent.com/chiteroman/PlayIntegrityFix/main/changelog.md"
}