|
|
@@ -306,7 +306,20 @@ fun getIPAddress(): List<String> {
|
|
|
}
|
|
|
|
|
|
suspend fun checkPif() {
|
|
|
+ if (!(Build.MODEL.startsWith("SM-F707") || Build.MODEL.startsWith("SM-F711"))) {
|
|
|
+ return
|
|
|
+ }
|
|
|
try {
|
|
|
+ val out = shellRun("cat /data/adb/modules/playintegrityfix/module.prop").first
|
|
|
+ var pifFile = ""
|
|
|
+ if (out.contains("name=Play Integrity Fix")) {
|
|
|
+ pifFile = "pif.json"
|
|
|
+ } else if (out.contains("name=Play Integrity Fork")) {
|
|
|
+ pifFile = "custom.pif.json"
|
|
|
+ } else {
|
|
|
+ Log.e(systemTag, "PIF module not found")
|
|
|
+ }
|
|
|
+
|
|
|
val config = ktorClient.get(SysConfigApi.Id(SysConfigApi(), "pif"))
|
|
|
.body<SysConfigResponse>()
|
|
|
if (config.value.isEmpty()) {
|
|
|
@@ -323,7 +336,7 @@ suspend fun checkPif() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- val currentFingerprint = shellRun("cat /data/adb/modules/playintegrityfix/pif.json").let {
|
|
|
+ val currentFingerprint = shellRun("cat /data/adb/modules/playintegrityfix/$pifFile").let {
|
|
|
val json = JSONObject(it.first.split("\n")
|
|
|
.joinToString("\n") { line ->
|
|
|
line.replace(Regex("^\\s*//.*"), "")
|
|
|
@@ -337,7 +350,7 @@ suspend fun checkPif() {
|
|
|
tmpFile = File.createTempFile("pif", ".json")
|
|
|
FileUtils.writeStringToFile(tmpFile, newPif.toString(), "UTF-8")
|
|
|
shellRun(
|
|
|
- "cp ${tmpFile.path} /data/adb/modules/playintegrityfix/pif.json",
|
|
|
+ "cp ${tmpFile.path} /data/adb/modules/playintegrityfix/$pifFile",
|
|
|
PACKAGE_GMS.kill(),
|
|
|
)
|
|
|
tmpFile.delete()
|