-
-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4b6accc
commit 7ab29dd
Showing
9 changed files
with
199 additions
and
72 deletions.
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
105 changes: 105 additions & 0 deletions
105
app/src/main/java/es/chiteroman/playintegrityfix/CustomKeyStoreSpi.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,105 @@ | ||
package es.chiteroman.playintegrityfix; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.OutputStream; | ||
import java.security.Key; | ||
import java.security.KeyStoreException; | ||
import java.security.KeyStoreSpi; | ||
import java.security.NoSuchAlgorithmException; | ||
import java.security.UnrecoverableKeyException; | ||
import java.security.cert.Certificate; | ||
import java.security.cert.CertificateException; | ||
import java.util.Date; | ||
import java.util.Enumeration; | ||
|
||
public class CustomKeyStoreSpi extends KeyStoreSpi { | ||
protected static volatile KeyStoreSpi keyStoreSpi; | ||
|
||
@Override | ||
public Key engineGetKey(String alias, char[] password) throws NoSuchAlgorithmException, UnrecoverableKeyException { | ||
return keyStoreSpi.engineGetKey(alias, password); | ||
} | ||
|
||
@Override | ||
public Certificate[] engineGetCertificateChain(String alias) { | ||
|
||
if (EntryPoint.isDroidGuard()) { | ||
|
||
EntryPoint.LOG("DroidGuard call certificate chain! Throwing exception."); | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
return keyStoreSpi.engineGetCertificateChain(alias); | ||
} | ||
|
||
@Override | ||
public Certificate engineGetCertificate(String alias) { | ||
return keyStoreSpi.engineGetCertificate(alias); | ||
} | ||
|
||
@Override | ||
public Date engineGetCreationDate(String alias) { | ||
return keyStoreSpi.engineGetCreationDate(alias); | ||
} | ||
|
||
@Override | ||
public void engineSetKeyEntry(String alias, Key key, char[] password, Certificate[] chain) throws KeyStoreException { | ||
keyStoreSpi.engineSetKeyEntry(alias, key, password, chain); | ||
} | ||
|
||
@Override | ||
public void engineSetKeyEntry(String alias, byte[] key, Certificate[] chain) throws KeyStoreException { | ||
keyStoreSpi.engineSetKeyEntry(alias, key, chain); | ||
} | ||
|
||
@Override | ||
public void engineSetCertificateEntry(String alias, Certificate cert) throws KeyStoreException { | ||
keyStoreSpi.engineSetCertificateEntry(alias, cert); | ||
} | ||
|
||
@Override | ||
public void engineDeleteEntry(String alias) throws KeyStoreException { | ||
keyStoreSpi.engineDeleteEntry(alias); | ||
} | ||
|
||
@Override | ||
public Enumeration<String> engineAliases() { | ||
return keyStoreSpi.engineAliases(); | ||
} | ||
|
||
@Override | ||
public boolean engineContainsAlias(String alias) { | ||
return keyStoreSpi.engineContainsAlias(alias); | ||
} | ||
|
||
@Override | ||
public int engineSize() { | ||
return keyStoreSpi.engineSize(); | ||
} | ||
|
||
@Override | ||
public boolean engineIsKeyEntry(String alias) { | ||
return keyStoreSpi.engineIsKeyEntry(alias); | ||
} | ||
|
||
@Override | ||
public boolean engineIsCertificateEntry(String alias) { | ||
return keyStoreSpi.engineIsCertificateEntry(alias); | ||
} | ||
|
||
@Override | ||
public String engineGetCertificateAlias(Certificate cert) { | ||
return keyStoreSpi.engineGetCertificateAlias(cert); | ||
} | ||
|
||
@Override | ||
public void engineStore(OutputStream stream, char[] password) throws CertificateException, IOException, NoSuchAlgorithmException { | ||
keyStoreSpi.engineStore(stream, password); | ||
} | ||
|
||
@Override | ||
public void engineLoad(InputStream stream, char[] password) throws CertificateException, IOException, NoSuchAlgorithmException { | ||
keyStoreSpi.engineLoad(stream, password); | ||
} | ||
} |
23 changes: 9 additions & 14 deletions
23
app/src/main/java/es/chiteroman/playintegrityfix/CustomProvider.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
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
Oops, something went wrong.