-
-
Notifications
You must be signed in to change notification settings - Fork 368
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Custom ROMs signed with test keys will pass Device verdict again Co-authored-by: 4h9fbZ <7454974439@proton.me>
- Loading branch information
1 parent
5d42e12
commit 050d281
Showing
4 changed files
with
109 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
-keep class es.chiteroman.playintegrityfix.EntryPoint {*;} | ||
-keep class es.chiteroman.playintegrityfix.CustomKeyStoreSpi {*;} | ||
-keep class es.chiteroman.playintegrityfix.CustomProvider {*;} | ||
-keep class es.chiteroman.playintegrityfix.CustomProvider {*;} | ||
-keep class es.chiteroman.playintegrityfix.CustomPackageInfoCreator {*;} |
41 changes: 41 additions & 0 deletions
41
app/src/main/java/es/chiteroman/playintegrityfix/CustomPackageInfoCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package es.chiteroman.playintegrityfix; | ||
|
||
import android.content.pm.PackageInfo; | ||
import android.content.pm.Signature; | ||
import android.os.Build; | ||
import android.os.Parcel; | ||
import android.os.Parcelable; | ||
|
||
public final class CustomPackageInfoCreator implements Parcelable.Creator<PackageInfo> { | ||
private final Parcelable.Creator<PackageInfo> originalCreator; | ||
private final Signature spoofedSignature; | ||
|
||
public CustomPackageInfoCreator(Parcelable.Creator<PackageInfo> originalCreator, Signature spoofedSignature) { | ||
this.originalCreator = originalCreator; | ||
this.spoofedSignature = spoofedSignature; | ||
} | ||
|
||
@Override | ||
public PackageInfo createFromParcel(Parcel source) { | ||
PackageInfo packageInfo = originalCreator.createFromParcel(source); | ||
if (packageInfo.packageName.equals("android")) { | ||
if (packageInfo.signatures != null && packageInfo.signatures.length > 0) { | ||
packageInfo.signatures[0] = spoofedSignature; | ||
} | ||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { | ||
if (packageInfo.signingInfo != null) { | ||
Signature[] signaturesArray = packageInfo.signingInfo.getApkContentsSigners(); | ||
if (signaturesArray != null && signaturesArray.length > 0) { | ||
signaturesArray[0] = spoofedSignature; | ||
} | ||
} | ||
} | ||
} | ||
return packageInfo; | ||
} | ||
|
||
@Override | ||
public PackageInfo[] newArray(int size) { | ||
return originalCreator.newArray(size); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters