|
|
发表于
2023-4-23 06:14:56
来自手机
|
显示全部楼层
来自 广西
快连手动太麻烦,把这个自动换进去,每隔3600秒(1小时)就清除数据,或者点击图片位置手动清除
- XposedHelpers.findAndHookMethod(Application.class, "attach", Context.class, new XC_MethodHook() {
- @Override
- protected void afterHookedMethod(MethodHookParam param) throws Throwable {
- ClassLoader classLoader= ((Context)param.args[0]).getClassLoader();
- Application app = (Application) param.thisObject;
- final Context context=(Context) param.thisObject;
- final String fileDir = app.getFilesDir().getAbsolutePath();
- final File 路径 = new File(fileDir, ".时间戳");
- long 时间戳 = System.currentTimeMillis() / 1000;
- String 时间=Long.toString(时间戳);
- if (!路径.exists()) {
- try {
- Runtime.getRuntime().exec("touch " + 路径);
- FileOutputStream fos = new FileOutputStream(路径, false);
- fos.write(时间.getBytes(StandardCharsets.UTF_8));
- fos.flush();
- } catch (Throwable e) {}
- } else {
- try {
- Process process = Runtime.getRuntime().exec("cat " + 路径);
- InputStream inputStream = process.getInputStream();
- BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
- String line;
- while ((line = reader.readLine()) != null) {
- int t1=Integer.parseInt(line, 10);
- int t2=Integer.parseInt(时间, 10);
- int t3=t2 - t1;
- if (t3 >= 3600) {
- Toast.makeText(context, "一小时会员过期,自动清除数据", Toast.LENGTH_SHORT).show();
- //获取应用程序包管理器
- PackageManager packageManager = context.getPackageManager();
- // 获取应用程序信息
- ApplicationInfo applicationInfo = packageManager.getApplicationInfo("world.letsgo.booster.android.pro", 0);
- // 获取应用程序数据目录
- String dataDir = applicationInfo.dataDir;
- // 创建File对象
- File dataPath = new File(dataDir);
- // 清除数据
- deleteFiles(dataPath);
- // 重启app
- Intent i = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
- i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- context.startActivity(i);
- android.os.Process.killProcess(android.os.Process.myPid());
- }
- }
- } catch (IOException e) {}
- }
- XposedHelpers.findAndHookMethod("android.widget.TextView", XP.classLoader, "setText", CharSequence.class, new XC_MethodHook(){
- @Override
- protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
- super.beforeHookedMethod(param);
- if (param.args[0] != null) {
- String t= param.args[0].toString();
- if (t != null && t.equals("快连 VPN")) {
- param.args[0] = "点击重置ID";
- View a=(View) param.thisObject;
- ViewGroup b=(ViewGroup) a.getParent();
- b.setOnClickListener(new View.OnClickListener(){
- @Override
- public void onClick(View p1) {
- try {
- Toast.makeText(p1.getContext(), "开始重置", Toast.LENGTH_SHORT).show();
- //获取应用程序包管理器
- PackageManager packageManager = context.getPackageManager();
- // 获取应用程序信息
- ApplicationInfo applicationInfo = packageManager.getApplicationInfo("world.letsgo.booster.android.pro", 0);
- // 获取应用程序数据目录
- String dataDir = applicationInfo.dataDir;
- // 创建File对象
- File dataPath = new File(dataDir);
- // 清除数据
- deleteFiles(dataPath);
- // 重启app
- Intent i = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
- i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
- context.startActivity(i);
- android.os.Process.killProcess(android.os.Process.myPid());
- } catch (Throwable e) {}
- }
- }
- );
- }
- }
- }
- }
- );
- StringBuilder builder = new StringBuilder();
- Random random = new Random();
- String str1="0a1b2c3d4e5f6a7b8c9defg";
- for (int i = 0; i < 16; i++) {
- int index = random.nextInt(str1.length());
- builder.append(str1.charAt(index));
- }
- XposedHelpers.findAndHookMethod("u3.a.a.a.a1.b2", classLoader, "d", XC_MethodReplacement.returnConstant(builder.toString()));
- XposedHelpers.findAndHookMethod("u3.a.a.a.a1.c2", classLoader, "p", "u3.a.a.a.a1.c2", String.class, "world.letsgo.booster.android.data.bean.ApiResponseDialog", "l3.m0.c.a", "l3.m0.c.a", int.class, Object.class, XC_MethodReplacement.returnConstant(null));
- }
- private void deleteFiles(File file) {
- if (file.isDirectory()) {
- File[] files = file.listFiles();
- for (File subFile : files) {
- deleteFiles(subFile);
- }
- } else {
- file.delete();
- }
- }
- }
- );
复制代码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|