-
Notifications
You must be signed in to change notification settings - Fork 16
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
15dc41f
commit eb748db
Showing
7 changed files
with
159 additions
and
111 deletions.
There are no files selected for viewing
Binary file not shown.
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
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
177 changes: 104 additions & 73 deletions
177
app/src/main/java/me/bingyue/IceCore/hook_app/fake_location_vip.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 |
---|---|---|
@@ -1,112 +1,143 @@ | ||
package me.bingyue.IceCore.hook_app; | ||
|
||
import android.app.Application; | ||
import android.content.Context; | ||
import android.util.Base64; | ||
import android.util.Log; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Objects; | ||
|
||
import javax.crypto.Cipher; | ||
import javax.crypto.SecretKey; | ||
import javax.crypto.SecretKeyFactory; | ||
import javax.crypto.spec.DESKeySpec; | ||
|
||
import de.robv.android.xposed.XC_MethodHook; | ||
import me.bingyue.IceCore.config.Config; | ||
import de.robv.android.xposed.XposedHelpers; | ||
import de.robv.android.xposed.callbacks.XC_LoadPackage; | ||
|
||
|
||
public class fake_location_vip { | ||
public static void hook_init(XC_LoadPackage.LoadPackageParam lpparam) throws ClassNotFoundException { | ||
Class applicationClazz = lpparam.classLoader.loadClass("com.stub.StubApp"); | ||
XposedHelpers.findAndHookMethod( | ||
applicationClazz, | ||
"a", | ||
Context.class, | ||
new XC_MethodHook() { | ||
public static void hook_init(XC_LoadPackage.LoadPackageParam lpparam){ | ||
if(!Config.com_lerist_fakelocation__all){ | ||
return; | ||
} | ||
XposedHelpers.findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() { | ||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
super.afterHookedMethod(param); | ||
Context context = (Context) param.args[0]; | ||
ClassLoader classLoader = context.getClassLoader(); | ||
XposedHelpers.findAndHookMethod("\u0627.\u078C$\u037F", classLoader,"\u0529", java.lang.String.class, new XC_MethodHook() { | ||
@Override | ||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable { | ||
super.beforeHookedMethod(param); | ||
if(Config.com_lerist_fakelocation__verify){ | ||
param.args[0]="114.114.114.114"; | ||
} | ||
} | ||
|
||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
Context context = (Context) param.args[0]; | ||
ClassLoader finalClassLoader = context.getClassLoader(); | ||
hook_vip(finalClassLoader.loadClass("\u0D5F.\u0588")); | ||
hook_black_app(finalClassLoader.loadClass("\u0D5F.\u052C")); | ||
hook_black_app_se(finalClassLoader.loadClass("\u0CF2.\u0528")); | ||
hook_verify(finalClassLoader.loadClass("\u0828.\u052C")); | ||
super.afterHookedMethod(param); | ||
} | ||
} | ||
); | ||
} | ||
}); | ||
|
||
public static void hook_verify(Class init){ | ||
if (!Config.com_lerist_fakelocation__verify){ | ||
return; | ||
} | ||
XposedHelpers.findAndHookMethod(init, "\u052C", new XC_MethodHook() { | ||
@Override | ||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable { | ||
super.beforeHookedMethod(param); | ||
} | ||
Class<?> JSONClass =XposedHelpers.findClass("com.alibaba.fastjson.JSON",classLoader); | ||
XposedHelpers.findAndHookMethod("ၼ.Ԩ", classLoader, "Ϳ", java.lang.Class.class, java.lang.String.class, new XC_MethodHook() { | ||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
if(Objects.equals(param.args[1].toString(), "key_userinfo") && Config.com_lerist_fakelocation__vip){ | ||
long proindate=System.currentTimeMillis()+200000000; | ||
long tokenTime=System.currentTimeMillis()+500000000; | ||
String key = "1#" + Long.toString(proindate) + "#" + Long.toString(tokenTime) + "#T"; | ||
String data = "{\"key\":\"" + desEncryptECB(key, "Lerist.T") + "\",\"loginName\":\"IceCore\",\"loginTime\":0,\"loginType\":\"email\",\"proindate\":" + Long.toString(proindate) + ",\"stability\":0,\"token\":\"T\",\"type\":1}"; | ||
param.setResult(XposedHelpers.callStaticMethod(JSONClass,"parseObject", data, param.args[0])); | ||
return; | ||
} | ||
super.afterHookedMethod(param); | ||
} | ||
}); | ||
|
||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
super.afterHookedMethod(param); | ||
param.setResult(true); | ||
} | ||
}); | ||
} | ||
public static void hook_vip(Class initActivityClazz){ | ||
if(!Config.com_lerist_fakelocation__vip){ | ||
return; | ||
} | ||
XposedHelpers.findAndHookMethod( | ||
initActivityClazz, | ||
"\u052B", | ||
new XC_MethodHook() { | ||
XposedHelpers.findAndHookMethod("ၼ.Ԩ", classLoader, "Ԭ", Context.class, new XC_MethodHook() { | ||
@Override | ||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable { | ||
|
||
super.beforeHookedMethod(param); | ||
} | ||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
param.setResult(true); | ||
super.afterHookedMethod(param); | ||
} | ||
}); | ||
|
||
XposedHelpers.findAndHookMethod("\u0CF2.\u0528", classLoader, "\u052C", java.lang.String.class, new XC_MethodHook() { | ||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
param.setResult(true); | ||
} | ||
} | ||
); | ||
} | ||
}); | ||
|
||
XposedHelpers.findAndHookMethod("\u0CF2.\u0528", classLoader, "\u0529", new XC_MethodHook() { | ||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
param.setResult(null); | ||
} | ||
}); | ||
|
||
public static void hook_black_app(Class initActivityClazz){ | ||
if(!Config.com_lerist_fakelocation__black_app){ | ||
return; | ||
} | ||
XposedHelpers.findAndHookMethod( | ||
initActivityClazz, | ||
"\u037F", | ||
new XC_MethodHook() { | ||
XposedHelpers.findAndHookMethod("ൟ.ֈ", classLoader, "ԫ", new XC_MethodHook() { | ||
@Override | ||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable { | ||
super.beforeHookedMethod(param); | ||
} | ||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
param.setResult(new ArrayList<>(new ArrayList<>())); | ||
param.setResult(true); | ||
super.afterHookedMethod(param); | ||
} | ||
} | ||
); | ||
}); | ||
|
||
XposedHelpers.findAndHookMethod("ൟ.ֈ", classLoader, "Ԫ", new XC_MethodHook() { | ||
@Override | ||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable { | ||
super.beforeHookedMethod(param); | ||
} | ||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
param.setResult(false); | ||
super.afterHookedMethod(param); | ||
} | ||
}); | ||
|
||
} | ||
}); | ||
|
||
} | ||
public static void hook_black_app_se(Class init){ | ||
if(!Config.com_lerist_fakelocation__black_app){ | ||
return; | ||
|
||
|
||
public static String desEncryptECB(String content, String key) { | ||
try { | ||
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding"); | ||
DESKeySpec desKeySpec = new DESKeySpec(key.getBytes()); | ||
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); | ||
SecretKey secretKey = keyFactory.generateSecret(desKeySpec); | ||
cipher.init(Cipher.ENCRYPT_MODE, secretKey); | ||
byte[] result = cipher.doFinal(content.getBytes()); | ||
return Base64.encodeToString(result, Base64.DEFAULT); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
XposedHelpers.findAndHookMethod(init | ||
, "\u052C", new XC_MethodHook() { | ||
@Override | ||
protected void beforeHookedMethod(MethodHookParam param) throws Throwable { | ||
super.beforeHookedMethod(param); | ||
} | ||
|
||
@Override | ||
protected void afterHookedMethod(MethodHookParam param) throws Throwable { | ||
param.setResult(new ArrayList<>()); | ||
super.afterHookedMethod(param); | ||
} | ||
}); | ||
return null; | ||
} | ||
public static String desECBDecrypt(byte[] data, String key) throws Exception { | ||
Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding"); | ||
DESKeySpec desKeySpec = new DESKeySpec(key.getBytes()); | ||
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); | ||
SecretKey secretKey = keyFactory.generateSecret(desKeySpec); | ||
cipher.init(Cipher.DECRYPT_MODE, secretKey); | ||
byte[] encryptedData = Base64.decode(data, Base64.DEFAULT); | ||
byte[] decryptedData = cipher.doFinal(encryptedData); | ||
return new String(decryptedData); | ||
} | ||
|
||
} |
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