Skip to content
This repository has been archived by the owner on Dec 26, 2017. It is now read-only.

Commit

Permalink
improving comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rastapasta authored Aug 1, 2016
1 parent a0c4af4 commit 64aaaaa
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package de.rastapasta.android.xposed.pokemongo;


import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XposedBridge;
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam;
Expand All @@ -11,8 +10,8 @@
import org.apache.commons.lang3.SerializationUtils;
import android.util.Base64;


public class PokemonGo implements IXposedHookLoadPackage {
// Contains the original certificate chain, serialized and Base64 encoded
private static String originalChain =
"rO0ABXVyACVbTGphdmEuc2VjdXJpdHkuY2VydC5YNTA5Q2VydGlmaWNhdGU7V79uQD0B25oCAAB4"+
"cAAAAAJzcgAtamF2YS5zZWN1cml0eS5jZXJ0LkNlcnRpZmljYXRlJENlcnRpZmljYXRlUmVwiSdq"+
Expand Down Expand Up @@ -78,12 +77,12 @@ public void handleLoadPackage(final LoadPackageParam lpparam) throws Throwable {
findAndHookMethod("com.nianticlabs.nia.network.NianticTrustManager", lpparam.classLoader, "checkServerTrusted", cert.getClass(), String.class, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedBridge.log("Replacing Pokemon Go chain of trust");
XposedBridge.log("Replacing Pokemon Go's chain of trust");

// Decoding old chain
byte[] buffer= Base64.decode(originalChain, Base64.DEFAULT);
// Decode the stored original chain
byte[] buffer = Base64.decode(originalChain, Base64.DEFAULT);

// Restoring the original chain and replacing it in the call arguments
// Restore the original chain object and inject it into the call arguments
param.args[0] = (X509Certificate[])SerializationUtils.deserialize(buffer);
}
});
Expand Down

0 comments on commit 64aaaaa

Please sign in to comment.