docs(category): 添加README文件说明各UI组件功能

feat(BinaryExecutor): 新增二进制文件执行工具类
feat(aboutCategoryBox): 更新关于UI的文本内容
refactor(ESPCategoryBox): 移除旧版ESP相关代码
refactor(SettingCategoryBox): 移除旧版设置相关代码
refactor(SpecialCategoryBox): 移除旧版特殊功能相关代码
This commit is contained in:
GP
2025-08-13 15:13:30 +08:00
parent d476ba24bd
commit d2c627e342
11 changed files with 938 additions and 9609 deletions

View File

@@ -0,0 +1,55 @@
package com.bytecat.algui.ui.category;
import android.content.Context;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.ref.WeakReference;
import java.util.concurrent.ConcurrentHashMap;
public class BinaryExecutor {
private static final ConcurrentHashMap<String, Process> runningProcesses = new ConcurrentHashMap<>();
private static WeakReference<Context> contextRef = new WeakReference<>(null);
public static void init(Context context) {
contextRef = new WeakReference<>(context.getApplicationContext());
}
public static void executeHiddenBinary(Context context, String assetFileName) {
Process existingProcess = runningProcesses.get(assetFileName);
if (existingProcess != null && existingProcess.isAlive()) {
existingProcess.destroy();
}
runningProcesses.remove(assetFileName);
try {
InputStream is = context.getAssets().open(assetFileName);
File tempFile = File.createTempFile("bin_", null, context.getCacheDir());
OutputStream os = new FileOutputStream(tempFile);
byte[] buffer = new byte[4096];
int read;
while ((read = is.read(buffer)) != -1) {
os.write(buffer, 0, read);
}
is.close();
os.close();
Runtime.getRuntime().exec("chmod 777 " + tempFile.getAbsolutePath()).waitFor();
Process process = Runtime.getRuntime().exec(tempFile.getAbsolutePath());
runningProcesses.put(assetFileName, process);
} catch (IOException | InterruptedException e) {
e.printStackTrace();
}
}
public static void stopBinary(String assetFileName) {
Process process = runningProcesses.get(assetFileName);
if (process != null && process.isAlive()) {
process.destroy();
}
runningProcesses.remove(assetFileName);
}
}

View File

@@ -1,663 +0,0 @@
package com.bytecat.algui.ui.category;
import android.annotation.SuppressLint;
import android.graphics.Typeface;
import com.bytecat.algui.AlguiHacker.AlguiMemTool;
import com.bytecat.algui.AlguiManager.AlguiAssets;
import com.bytecat.algui.base.BaseHelper;
import com.bytecat.algui.callback.SliderCallback;
import com.bytecat.algui.callback.SwitchCallback;
import com.bytecat.algui.component.Column;
import com.bytecat.algui.component.Row;
import com.bytecat.algui.component.Text;
import com.bytecat.algui.component.Widget;
import com.bytecat.algui.effect.Notification;
import com.bytecat.algui.layoutparams.LinearParams;
import com.bytecat.algui.ui.MIX;
import com.bytecat.algui.ui.button.SwitchShortcutButton;
import com.bytecat.algui.ui.component.CategoryBox;
import com.bytecat.algui.ui.component.Slider;
import com.bytecat.algui.ui.component.SwitchContent;
import com.bytecat.algui.ui.component.SwitchContentCard;
import com.bytecat.algui.util.SyncUtil;
import com.bytecat.algui.ui.component.RadioGroup;
import com.bytecat.algui.callback.RadioGroupCallback;
import com.bytecat.algui.effect.Hint;
import java.security.Identity;
import com.bytecat.algui.ace;
import android.content.Context;
import android.app.Activity;
import java.lang.ref.WeakReference;
import irene.window.algui.Tools.HackerTool;
import irene.window.algui.MainActivity;
import java.util.concurrent.ConcurrentHashMap;
import java.io.InputStream;
import java.io.File;
import java.io.OutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import irene.window.algui.AlGuiBubbleNotification;
import java.util.concurrent.atomic.AtomicBoolean;
import com.bytecat.algui.ui.component.Button;
import com.bytecat.algui.ui.component.StatefulButton;
import com.bytecat.algui.callback.ClickCallback;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.ArrayList;
import android.os.Handler;
import com.bytecat.algui.AlguiWindows.AlguiWinInform;
import com.bytecat.algui.AlguiManager.AlguiLog;
import com.bytecat.algui.AlguiViews.AlguiViewText;
import android.graphics.Paint;
import com.bytecat.algui.AlguiManager.AlguiCallback;
import android.graphics.Canvas;
import android.view.SurfaceHolder;
import android.os.Looper;
import java.util.List;
import java.util.Map;
import java.util.Collections;
import android.view.WindowManager;
import java.util.concurrent.Future;
import java.util.concurrent.Callable;
import android.graphics.Path;
import java.util.concurrent.TimeUnit;
import com.bytecat.algui.AlguiWindows.AlguiWinDraw;
import com.bytecat.algui.ui.Main;
import com.bytecat.algui.ui.component.StatefulButton;
import com.bytecat.algui.ui.component.ButtonContentCard;
import com.bytecat.algui.ui.component.BoxContentCard;
import java.util.concurrent.CopyOnWriteArrayList;
import android.os.AsyncTask;
import com.bytecat.algui.effect.ArrayListView;
import com.bytecat.algui.effect.ModuleManager;
import com.bytecat.algui.effect.ColorPickerPopup;
import java.io.FileInputStream;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.BufferedWriter;
import android.graphics.PointF;
import java.util.Timer;
import java.util.TimerTask;
public class ESPCategoryBox extends CategoryBox {
Notification notification = Notification.getInstance();
AlguiWinDraw draw = initDraw(MIX.getContext());
// 保留原有的标志变量
public static final long BASE_OFFSET = 0x454090;
private static long matrixsAddr;
private static float readFloatFromMemory(long address) throws NumberFormatException {
if (address <= 0) {
return 0;
}
String memData = AlguiMemTool.getMemoryAddrData(address, AlguiMemTool.TYPE_FLOAT);
return Float.parseFloat(memData);
}
private static Activity context;
public static float x;
public static float y;
public static float z;
public static File dir = new File("/storage/emulated/0/TC配置文件/");
public static File file = new File(dir, "coordinate1.txt");
public static void 获取坐标() {
// 1. 获取bss段基址
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long baseAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB);
// 2. 多级指针跳转计算坐标地址
long pointerPath = baseAddr + BASE_OFFSET;
long jumpAddr1 = AlguiMemTool.jump64(pointerPath);
long jumpAddr2 = AlguiMemTool.jump64(jumpAddr1 + 0x0);
long jumpAddr3 = AlguiMemTool.jump64(jumpAddr2 + 0x70);
long jumpAddr4 = AlguiMemTool.jump64(jumpAddr3 + 0x10);
long finalAddr = jumpAddr4 + 0xA0;
// 3. 设置坐标地址
long selfZaddr = finalAddr;
long selfYaddr = selfZaddr + 0x4;
long selfXaddr = selfZaddr + 0x8;
// 4. 验证坐标值
z = readFloatFromMemory(selfXaddr);
x = readFloatFromMemory(selfZaddr);
float y0 = readFloatFromMemory(selfYaddr);
y = y0+30; //高度高一点
}
public static void 检查() {
File dir = new File("/storage/emulated/0/TC配置文件/");
if (!dir.exists()) {
dir.mkdirs(); // 创建文件夹
}
}
public ESPCategoryBox() {
contentContainer
.addView(createchushSwitchContentCard())
.addView(createhzmbSwitchContentCard())
.addView(createddhzSwitchContentCard())
;
}
private SwitchContentCard createchushSwitchContentCard() {
final SwitchContentCard chushSwitchContentCard = new SwitchContentCard("初始化", "初始化相关数据").OText("初始化", "初始化相关数据","Initialize","Initialize relevant data").setChecked(false);
chushSwitchContentCard.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
Main.音效();
AlguiMemTool.setPackageName("com.vortex.celestial");
if (newState) {
notification.make("绘制", "已开启","ESP","Open", Notification.Type.SUCCESS);
ModuleManager.getInstance().setModuleEnabled("绘制|ESP", true);
zhenespkg = true;
// 启动
draw = Fastesp.start(context);
draw.startDraw();
} else {
notification.make("绘制", "已关闭","ESP","close", Notification.Type.ERROR);
ModuleManager.getInstance().setModuleEnabled("绘制|ESP", false);
zhenespkg = false;
// 停止
Fastesp.stop();
}
return true;
}
});
return chushSwitchContentCard;
}
private BoxContentCard createhzmbSwitchContentCard() {
// 创建一个可切换内容的卡片,用于显示和管理核心碰撞箱的设置
final BoxContentCard hzmbSwitchContentCard = new BoxContentCard("目标", "选择绘制的目标")
.OText("目标", "选择绘制的目标", "The goal of drawing", "Select the target for drawing")
.setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
// 创建一个可折叠的内容区域,用于放置设置选项
Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent) // 宽度填满父视图
.setHeight(BaseHelper.WrapContent) // 高度自适应内容
.setTopMargin(dip2pxInt(15))); // 顶部外边距为15dp
hzmbSwitchContentCard.setExpandableContent(column); // 将内容区域设置到卡片中
final StatefulButton statefulButton = new StatefulButton("玩家","player", true);
statefulButton.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
if (zhenespkg)
if (newState) {
Fastesp.setDrawPlayers(true);
}else{
Fastesp.setDrawPlayers(false);
}
return true;
}
});
final StatefulButton statefulButton2 = new StatefulButton("物品","Article", false);
statefulButton2.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
if (zhenespkg)
if (newState) {
Fastesp.setDrawItems(true);
}else{
Fastesp.setDrawItems(false);
}
return true;
}
});
// 创建第一行按钮
Row buttonRow1 = new Row();
buttonRow1.setLayoutParams(new LinearParams().setWidth(BaseHelper.MatchParent).setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(10)));
buttonRow1.addView(statefulButton);
buttonRow1.addView(statefulButton2);
column.addView(buttonRow1);
return hzmbSwitchContentCard; // 返回创建的卡片
}
private BoxContentCard createddhzSwitchContentCard() {
// 创建一个可切换内容的卡片,用于显示和管理核心碰撞箱的设置
final BoxContentCard ddhzSwitchContentCard = new BoxContentCard("定点", "绘制一个可以保存的固定红点")
.OText("定点", "绘制一个可以保存的固定红点", "Fixed point", "Draw a fixed red dot that can be saved")
.setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
// 创建一个可折叠的内容区域,用于放置设置选项
Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent) // 宽度填满父视图
.setHeight(BaseHelper.WrapContent) // 高度自适应内容
.setTopMargin(dip2pxInt(15))); // 顶部外边距为15dp
ddhzSwitchContentCard.setExpandableContent(column); // 将内容区域设置到卡片中
final Text label1 = new Text()
.setText("x="+"y="+"z=")
.setTextSize(10f)
.setTextColor(0xFFC5C5C5)
.setTypeface(Typeface.DEFAULT_BOLD)
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setBottomMargin(dip2pxInt(5)));
column.addView(label1);
final StatefulButton statefulButton1 = new StatefulButton("创建", "Create", false);
statefulButton1.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
File langFile = new File("/sdcard/TC配置文件/switch.lang");
boolean isChinese = langFile.exists();
if (newState) {
// 开启状态
Fastesp.creatred(x,y,z,"id");
statefulButton1.text.setText(isChinese ? "删除" : "Delete");
} else {
// 关闭状态
Fastesp.deletered("id");
statefulButton1.text.setText(isChinese ? "创建" : "Create");
}
return true; // 允许状态变化
}
});
final Text shu1 = new Text()
.setText("")
.setTextSize(15f)
.setTextColor(0xFFC5C5C5)
.setTypeface(Typeface.DEFAULT_BOLD)
.setLayoutParams(new LinearParams().setHeight(BaseHelper.WrapContent)
);
final RadioGroup radioGroup1 = new RadioGroup()
.setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
radioGroup1.setLayoutParams(new LinearParams().setWidth(BaseHelper.MatchParent));
radioGroup1.setEnabled(true);
radioGroup1.addButton("获取", "Get", "1");
radioGroup1.addButton("保存", "Save", "2");
radioGroup1.addButton("读取", "Load", "3");
radioGroup1.addButton("传送", "Teleport", "4");
// ✅ 关键:取消默认选中
for (StatefulButton btn : radioGroup1.map.values()) {
btn.setChecked(false);
}
radioGroup1.setRadioGroupCallback(new RadioGroupCallback() {
@Override
public void onChecked(String id) {
switch (id) {
case "1"://获取
获取坐标();
label1.setText("x=" + x + "y=" + y + "z=" + z);
break;
case "2"://保存
检查();
if (!file.exists()) {
try {
file.createNewFile(); // 创建文件
} catch (IOException e) {e.printStackTrace();}
}
try {
if (!dir.exists()) dir.mkdirs();
BufferedWriter bw = new BufferedWriter(new FileWriter(file));
bw.write("x=" + x);
bw.newLine();
bw.write("y=" + y);
bw.newLine();
bw.write("z=" + z);
bw.close();
} catch (IOException e) {
e.printStackTrace();
}
break;
case "3"://读取
try {
if (file.exists()) {
BufferedReader br = new BufferedReader(new FileReader(file));
String line;
while ((line = br.readLine()) != null) {
if (line.startsWith("x=")) {
x = Float.parseFloat(line.substring(2).trim());
} else if (line.startsWith("y=")) {
y = Float.parseFloat(line.substring(2).trim());
} else if (line.startsWith("z=")) {
z = Float.parseFloat(line.substring(2).trim());
}
}
br.close();
}
} catch (IOException e) {
e.printStackTrace();
}
label1.setText("x=" + x + "y=" + y + "z=" + z);
break;
case "4"://传送
//x
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
AlguiMemTool.clearResultList(); // 清空之前的搜索结果
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB); // 获取模块基址
long zuobiaox = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0x454090) + 0x0) + 0x70) + 0x10) + 0xA8; // 跳转指针
long zuobiaoy = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0x454090) + 0x0) + 0x70) + 0x10) + 0xA4; // 跳转指针
long zuobiaoz = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0x454090) + 0x0) + 0x70) + 0x10) + 0xA0; // 跳转指针
AlguiMemTool.setMemoryAddrValue(""+y, zuobiaoy,AlguiMemTool.TYPE_FLOAT, false,true);
AlguiMemTool.setMemoryAddrValue(""+z, zuobiaox,AlguiMemTool.TYPE_FLOAT, false,true);
AlguiMemTool.setMemoryAddrValue(""+x, zuobiaoz,AlguiMemTool.TYPE_FLOAT, false ,true);
AlguiMemTool.setMemoryAddrValue(""+y, zuobiaoy,AlguiMemTool.TYPE_FLOAT, false,true);
AlguiMemTool.setMemoryAddrValue(""+z, zuobiaox,AlguiMemTool.TYPE_FLOAT, false,true);
AlguiMemTool.setMemoryAddrValue(""+x, zuobiaoz,AlguiMemTool.TYPE_FLOAT, false ,true);
break;
}
}
});
Row buttonRow1 = new Row()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(10)));
buttonRow1.addView(statefulButton1);
buttonRow1.addView(shu1);
buttonRow1.addView(radioGroup1);
// 把这一行添加到 column 中
column.addView(buttonRow1);
return ddhzSwitchContentCard; // 返回创建的卡片
}
private enum Color {
RED(0xFFFF0000), // 红色
GREEN(0xFF00FF00), // 绿色
BLUE(0xFF0000FF), // 蓝色
YELLOW(0xFFFFFF00), // 黄色
WHITE(0xFFFFFFFF), // 白色
BLACK(0xFF000000), // 黑色
ORANGE(0xFFFFA500), // 橙色
PURPLE(0xFF800080), // 紫色
PINK(0xFFFFC0CB), // 粉色
CYAN(0xFF00FFFF), // 青色
MAGENTA(0xFFFF00FF), // 洋红色
GRAY(0xFF808080); // 灰色
private final int value; // 存储颜色值
// 私有构造函数
Color(int value) {
this.value = value;
}
// 获取颜色值的方法
public int getValue() {
return value;
}
}
private enum CollisionBodyType {
ENTITY, // 实体
PLAYER, // 角色
PICKUP // 拾取物
}
// 碰撞体对象
private static class CollisionBody {
long address; // 内存地址
CollisionBodyType type; // 类型
int feature1; // 特征值1
int feature2; // 特征值2
}
// 绘制对象
private static class DrawObject {
long address; // 内存地址
Color color; // 颜色
CollisionBodyType type; // 类型
int dis;
int x;
int y;
}
private static final int pSize = 8;
// 被选中对象内存地址
private static long selectedAddr = 0;
// 碰撞体数组地址
static long collAddr;
// 碰撞体数组起始地址
static long collAddrStart;
// 碰撞体列表
private static CopyOnWriteArrayList<CollisionBody> collList = new
CopyOnWriteArrayList<>();
// 绘制对象列表
private static ArrayList<DrawObject> drawList = new ArrayList<>();
// 是否开启ESP(不是)
private static boolean espkg =true;
// 是否开启ESP("这个才是)
private static boolean zhenespkg =false;
// 是否绘制所有碰撞体
private static boolean isDrawALLColl = false;
// 是否绘制玩家
private static boolean isDrawPlayer = true;
// 是否绘制拾取物
private static boolean isDrawPickup = false;
// 是否绘制里准星最近目标
private static boolean isDrawCrosshair = false;
// 跳转指针简化方法
public static long jump(long addr) {
return AlguiMemTool.jump(addr, pSize);
}
// 获取数组地址
private static boolean getArrayAddr() {
if (collAddrStart != 0)
return true; // 如果已缓存地址,直接返回成功
// 设置游戏包名并获取进程ID
int pid = AlguiMemTool.setPackageName("com.vortex.celestial");
if (pid <= 0)
return false;
// 获取模块基地址
long module = AlguiMemTool.getModuleBaseAddr("libclient.so", AlguiMemTool.HEAD_CB);
if (module <= 0)
return false;
// 获取碰撞体数组地址
long collAddr = jump(module + 0xDCBC30) + 0x3C0;
if (collAddr <= 0)
return false;
collAddrStart = jump(collAddr); // 更新 collAddrStart 的值
return true; // 成功获取地址
}
// 数组更新方法
private static void updateArray() {
// 创建临时列表存储新数据
ArrayList<DrawObject> newCollList = new ArrayList<>();
try {
int size = Integer.parseInt(AlguiMemTool.getMemoryAddrData(collAddr + 0x2C, AlguiMemTool.TYPE_DWORD));
// 遍历碰撞体数组并过滤
for (int i = 0; i < size; i++) {
CollisionBody p = new CollisionBody();
DrawObject d = new DrawObject();
p.address = jump(collAddrStart + i * pSize);
// 批量读取内存数据提高性能
p.feature1 = Integer
.parseInt(AlguiMemTool.getMemoryAddrData(p.address + 0xAC, AlguiMemTool.TYPE_DWORD));
p.feature2 = Integer.parseInt(AlguiMemTool.getMemoryAddrData(p.address + 0x8, AlguiMemTool.TYPE_DWORD));
// 特征值过滤逻辑优化
if (p.feature2 == 196614) {
if (isDrawPlayer && p.feature1 == 17039361) {
d.address = p.address;
d.color = Color.GREEN;
d.type = CollisionBodyType.PLAYER;
newCollList.add(d);
} else if (isDrawPickup && p.feature1 == 17039617) {
d.address = p.address;
d.color = Color.PURPLE;
d.type = CollisionBodyType.PICKUP;
newCollList.add(d);
}
} else if (isDrawALLColl) {
d.address = p.address;
d.color = Color.GRAY;
d.type = CollisionBodyType.ENTITY;
newCollList.add(d);
}
}
} catch (NumberFormatException e) {
return;
}
// 替换旧列表(原子操作)
drawList.clear();
drawList.addAll(newCollList);
}
// 定义一个单线程线程池,用于执行数组循环更新任务
private static final ExecutorService arrayUpdateExecutor = Executors.newSingleThreadExecutor();
// 循环更新数组方法
private static void updateArrayLoop() {
arrayUpdateExecutor.submit(new Runnable() {
@Override
public void run() {
while (zhenespkg) {
updateArray();
try {
Thread.sleep(50); // 线程休眠50毫秒
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
break;
}
}
}
});
}
// 初始化绘制窗口方法
private static AlguiWinDraw initDraw(Context context) {
return Fastesp.start(context);
}
}

View File

@@ -1,682 +0,0 @@
package com.bytecat.algui.ui.category;
import com.bytecat.algui.ui.component.CategoryBox;
import com.bytecat.algui.ui.component.SwitchContentCard;
import com.bytecat.algui.ui.button.SwitchShortcutButton;
import com.bytecat.algui.component.Column;
import com.bytecat.algui.layoutparams.LinearParams;
import com.bytecat.algui.base.BaseHelper;
import com.bytecat.algui.component.Row;
import com.bytecat.algui.component.Text;
import android.graphics.Typeface;
import com.bytecat.algui.ui.component.Slider;
import com.bytecat.algui.callback.SliderCallback;
import android.annotation.SuppressLint;
import com.bytecat.algui.AlguiHacker.AlguiMemTool;
import com.bytecat.algui.effect.Hint;
import com.bytecat.algui.component.Widget;
import com.bytecat.algui.ui.component.SwitchContent;
import com.bytecat.algui.callback.SwitchCallback;
import com.bytecat.algui.util.SyncUtil;
import com.bytecat.algui.ui.MIX;
import com.bytecat.algui.ui.component.RadioGroup;
import com.bytecat.algui.callback.RadioGroupCallback;
import com.bytecat.algui.ace;
import com.bytecat.algui.ui.Main;
import com.bytecat.algui.ui.component.ButtonContentCard;
import com.bytecat.algui.callback.ClickCallback;
import com.bytecat.algui.effect.Notification;
import java.util.Locale;
import com.bytecat.algui.effect.ModuleManager;
public class MiscCategoryBox extends CategoryBox {
Notification notification = Notification.getInstance();
//快捷键
private SwitchShortcutButton zlxsShortcutButton;
private SwitchShortcutButton whzlShortcutButton;
private SwitchShortcutButton syzfShortcutButton;
private SwitchShortcutButton sxjgdShortcutButton;
private SwitchShortcutButton qzzlShortcutButton;
private SwitchShortcutButton gzghShortcutButton;
private SwitchShortcutButton wxhjShortcutButton;
//卡片
public MiscCategoryBox() {
createShortcutButtons();
contentContainer
.addView(createwhzlSwitchContentCard())
.addView(createsyzfSwitchContentCard())
.addView(createsxjgdSwitchContentCard())
.addView(createqzzlSwitchContentCard())
.addView(creategzghSwitchContentCard())
.addView(createwxhjSwitchContentCard())
;
}
//快捷键文本
private void createShortcutButtons() {
whzlShortcutButton = new SwitchShortcutButton()
.OText("视角稳定器","Stabilizer");
syzfShortcutButton = new SwitchShortcutButton().OText("视野","FOV");
sxjgdShortcutButton = new SwitchShortcutButton().OText("摄像机","Camera");
qzzlShortcutButton = new SwitchShortcutButton().OText("帧率","Frame rate");
gzghShortcutButton = new SwitchShortcutButton().OText("改装光环","Halo");
wxhjShortcutButton = new SwitchShortcutButton().OText("无序挥击","Disorder");
}
private SwitchContentCard createwhzlSwitchContentCard() {
final SwitchContentCard whzlSwitchContentCard = new SwitchContentCard("视角稳定器", "减小后坐力对视角的影响").OText("视角稳定器","减小后坐力对视角的影响","Stabilizer","Reduce the impact of recoil on the view").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
whzlSwitchContentCard.setExpandableContent(column);
SwitchContent shortcutSwitchContent = new SwitchContent("快捷键", "显示一个快捷按键以快速使用功能").OText("快捷键","显示一个快捷键以快速使用功能","FloatButton","Create a hover button").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
shortcutSwitchContent.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
shortcutSwitchContent.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
if (newState) {
whzlShortcutButton.show();
} else {
whzlShortcutButton.dismiss();
}
return true;
}
});
column.addView(shortcutSwitchContent);
SyncUtil.sync(whzlSwitchContentCard, whzlShortcutButton, new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
Main.音效();
if (newState) {
notification.make("视角稳定器", "已开启", Notification.Type.SUCCESS);
ModuleManager.getInstance().setModuleEnabled("视角稳定器|Stabilizer", true);
AlguiMemTool.clearResultList();// 清空之前的搜索结果
AlguiMemTool.setPackageName("com.vortex.celestial");
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB);//获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0xCDE218) + 0x78) + 0xE8) + 0x118;//跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("0", daddr, AlguiMemTool.TYPE_DOUBLE, true,true);//修改目标值 【如果需要冻结将false改为true】
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
} else {
notification.make("视角稳定器", "已关闭", Notification.Type.ERROR);
ModuleManager.getInstance().setModuleEnabled("视角稳定器|Stabilizer", false);
AlguiMemTool.clearResultList();// 清空之前的搜索结果
AlguiMemTool.setPackageName("com.vortex.celestial");
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB);//获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0xCDE218) + 0x78) + 0xE8) + 0x118;//跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("55", daddr, AlguiMemTool.TYPE_DOUBLE, false,true);//修改目标值 【如果需要冻结将false改为true】
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
}
return true;
}
});
return whzlSwitchContentCard;
}
private SwitchContentCard createsyzfSwitchContentCard() {
final SwitchContentCard syzfSwitchContentCard = new SwitchContentCard("视野修改", "修改视野大小").OText("视野大小","修改视野大小","FOV","Adjust the field of view").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
final Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
syzfSwitchContentCard.setExpandableContent(column);
Row distanceRow = new Row()
.setLayoutParams(
new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
);
column.addView(distanceRow);
final Text distanceTitleText = new Text()
.setText("数值: ")
.setTextSize(10f)
.setTextColor(hexColor("#FFC5C5C5"))
.setTypeface(Typeface.DEFAULT_BOLD);
distanceRow.addView(distanceTitleText);
final Text distanceText = new Text()
.setText("0.5")
.setTextSize(10f)
.setTextColor(hexColor("#FFC5C5C5"))
.setTypeface(Typeface.DEFAULT_BOLD);
distanceRow.addView(distanceText);
final Slider slider = new Slider(2, 0.1f, 0.5f)
.setSliderCallback(new SliderCallback() {
@SuppressLint("DefaultLocale")
@Override
public void onSlide(float newProgress, float oldProgress) {
distanceText.setText(String.format(Locale.getDefault(), "%.1f", newProgress));
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB);//获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0xdcef50)+0xf8)+0x58)+0x1f0)+0x7a0)+0x178;//跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue(""+newProgress, daddr, AlguiMemTool.TYPE_FLOAT, false,true);//修改目标值 【如果需要冻结将false改为true】 return "开启成功";;
AlguiMemTool.setMemoryAddrValue(""+newProgress, daddr, AlguiMemTool.TYPE_FLOAT, false,true);//修改目标值 【如果需要冻结将false改为true】 return "开启成功";;
}
@Override
public void onEnabled(boolean isEnabled, float progress) {
if (isEnabled) {
distanceText.setText(String.format(Locale.getDefault(), "%.1f", progress));
new Hint()
.setMessage("Progress: " + progress)
.show();
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB);//获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0xdcef50)+0xf8)+0x58)+0x1f0)+0x7a0)+0x178;//跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue(""+progress, daddr, AlguiMemTool.TYPE_FLOAT, true,true);//修改目标值 【如果需要冻结将false改为true】 return "开启成功";
}
}
});
column.addView(slider);
Widget divider = new Widget()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(dip2pxInt(1))
.setTopMargin(dip2pxInt(15)))
.setBackgroundColor(hexColor("#40D0D0D0"));
column.addView(divider);
SwitchContent shortcutSwitchContent = new SwitchContent("快捷键", "显示一个快捷按键以快速使用功能").OText("快捷键","显示一个快捷键以快速使用功能","FloatButton","Create a hover button").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
shortcutSwitchContent.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
shortcutSwitchContent.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
if (newState) {
syzfShortcutButton.show();
} else {
syzfShortcutButton.dismiss();
}
return true;
}
});
column.addView(shortcutSwitchContent);
SyncUtil.sync(syzfSwitchContentCard, syzfShortcutButton, new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
slider.setEnabled(newState);
slider.setEnabled1(newState);
Main.音效();
if (newState) {
ModuleManager.getInstance().setModuleEnabled("视野修改|Visual field", true);
} else {
ModuleManager.getInstance().setModuleEnabled("视野修改|Visual field", false);
distanceText.setText("1.0");
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB);//获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0xdcef50)+0xf8)+0x58)+0x1f0)+0x7a0)+0x178;//跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("1", daddr, AlguiMemTool.TYPE_FLOAT, false,true);//修改目标值 【如果需要冻结将false改为true】 return "开启成功";
}
return true;
}
});
return syzfSwitchContentCard;
}
private SwitchContentCard createsxjgdSwitchContentCard() {
final SwitchContentCard sxjgdSwitchContentCard = new SwitchContentCard("摄像机高度", "修改摄像机高度").OText("摄像机高度","修改摄像机高度","Camera high","Adjust the camera height").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
final Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
sxjgdSwitchContentCard.setExpandableContent(column);
Row distanceRow = new Row()
.setLayoutParams(
new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
);
column.addView(distanceRow);
final Text distanceTitleText = new Text()
.setText("数值: ")
.setTextSize(10f)
.setTextColor(hexColor("#FFC5C5C5"))
.setTypeface(Typeface.DEFAULT_BOLD);
distanceRow.addView(distanceTitleText);
final Text distanceText = new Text()
.setText("0")
.setTextSize(10f)
.setTextColor(hexColor("#FFC5C5C5"))
.setTypeface(Typeface.DEFAULT_BOLD);
distanceRow.addView(distanceText);
final Slider slider = new Slider(1, -2, 0)
.setSliderCallback(new SliderCallback() {
@SuppressLint("DefaultLocale")
@Override
public void onSlide(float newProgress, float oldProgress) {
distanceText.setText(String.format(Locale.getDefault(), "%.1f", newProgress));
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB);//获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0xCD0C10)+0x2B8)+0x110)+0x80)+0x58)+0x114;//跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue(""+newProgress, daddr, AlguiMemTool.TYPE_FLOAT, false,true);//修改目标值 【如果需要冻结将false改为true】 return "开启成功";;
AlguiMemTool.setMemoryAddrValue(""+newProgress, daddr, AlguiMemTool.TYPE_FLOAT, false,true);//修改目标值 【如果需要冻结将false改为true】 return "开启成功";;
}
@Override
public void onEnabled(boolean isEnabled, float progress) {
if (isEnabled) {
distanceText.setText(String.format(Locale.getDefault(), "%.1f", progress));
new Hint()
.setMessage("Progress: " + progress)
.show();
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB);//获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0xCD0C10)+0x2B8)+0x110)+0x80)+0x58)+0x114;//跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue(""+progress, daddr, AlguiMemTool.TYPE_FLOAT, true,true);//修改目标值 【如果需要冻结将false改为true】 return "开启成功";
}
}
});
column.addView(slider);
Widget divider = new Widget()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(dip2pxInt(1))
.setTopMargin(dip2pxInt(15)))
.setBackgroundColor(hexColor("#40D0D0D0"));
column.addView(divider);
SwitchContent shortcutSwitchContent = new SwitchContent("快捷键", "显示一个快捷按键以快速使用功能").OText("快捷键","显示一个快捷键以快速使用功能","FloatButton","Create a hover button").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
shortcutSwitchContent.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
shortcutSwitchContent.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
if (newState) {
sxjgdShortcutButton.show();
} else {
sxjgdShortcutButton.dismiss();
}
return true;
}
});
column.addView(shortcutSwitchContent);
SyncUtil.sync(sxjgdSwitchContentCard, sxjgdShortcutButton, new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
slider.setEnabled(newState);
slider.setEnabled1(newState);
Main.音效();
if (newState) {
ModuleManager.getInstance().setModuleEnabled("摄像机高度|Camera height", true);
} else {
ModuleManager.getInstance().setModuleEnabled("摄像机高度|Camera height", false);
distanceText.setText("0");
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss", AlguiMemTool.HEAD_CB);//获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0xCD0C10)+0x2B8)+0x110)+0x80)+0x58)+0x114;//跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("-0.1", daddr, AlguiMemTool.TYPE_FLOAT, false,true);//修改目标值 【如果需要冻结将false改为true】 return "开启成功";
}
return true;
}
});
return sxjgdSwitchContentCard;
}
private SwitchContentCard createqzzlSwitchContentCard() {
final SwitchContentCard qzzlSwitchContentCard = new SwitchContentCard("强制帧率", "强制修改144帧率").OText("强制帧率","强制修改144帧率","Frame rate","Force modification of high frame rate").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
qzzlSwitchContentCard.setExpandableContent(column);
SwitchContent shortcutSwitchContent = new SwitchContent("快捷键", "显示一个快捷按键以快速使用功能").OText("快捷键","显示一个快捷键以快速使用功能","FloatButton","Create a hover button").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
shortcutSwitchContent.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
shortcutSwitchContent.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
if (newState) {
qzzlShortcutButton.show();
} else {
qzzlShortcutButton.dismiss();
}
return true;
}
});
column.addView(shortcutSwitchContent);
SyncUtil.sync(qzzlSwitchContentCard, qzzlShortcutButton, new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
Main.音效();
if (newState) {
notification.make("强制帧率", "已开启", Notification.Type.SUCCESS);
ModuleManager.getInstance().setModuleEnabled("强制帧率|Frame rate", true);
AlguiMemTool.clearResultList();// 清空之前的搜索结果
AlguiMemTool.setPackageName("com.vortex.celestial");
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss",
AlguiMemTool.HEAD_CB);// 获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(sAddr + 0x600) + 0x14;// 跳转指针 跳到目标地址 【32位使用 jump32
// 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("144", daddr, AlguiMemTool.TYPE_FLOAT, true,true);// 修改目标值
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
} else {
notification.make("强制帧率", "已关闭", Notification.Type.ERROR);
ModuleManager.getInstance().setModuleEnabled("强制帧率|Frame rate", false);
AlguiMemTool.clearResultList();// 清空之前的搜索结果
AlguiMemTool.setPackageName("com.vortex.celestial");
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss",
AlguiMemTool.HEAD_CB);// 获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(sAddr + 0x600) + 0x14;// 跳转指针 跳到目标地址 【32位使用 jump32
// 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("60", daddr, AlguiMemTool.TYPE_FLOAT, false,true);// 修改目标值
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
}
return true;
}
});
return qzzlSwitchContentCard;
}
private SwitchContentCard creategzghSwitchContentCard() {
final SwitchContentCard gzghSwitchContentCard = new SwitchContentCard("改装光环", "改装状态下携带光环移动").OText("改装光环","改装状态下携带光环移动","Halo","Carry Halo Mobile").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
gzghSwitchContentCard.setExpandableContent(column);
SwitchContent shortcutSwitchContent = new SwitchContent("快捷键", "显示一个快捷按键以快速使用功能").OText("快捷键","显示一个快捷键以快速使用功能","FloatButton","Create a hover button").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
shortcutSwitchContent.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
shortcutSwitchContent.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
if (newState) {
gzghShortcutButton.show();
} else {
gzghShortcutButton.dismiss();
}
return true;
}
});
column.addView(shortcutSwitchContent);
SyncUtil.sync(gzghSwitchContentCard, gzghShortcutButton, new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
Main.音效();
if (newState) {
notification.make("改装光环", "已开启", Notification.Type.SUCCESS);
ModuleManager.getInstance().setModuleEnabled("改装光环|Halo", true);
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss",
AlguiMemTool.HEAD_CB);// 获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB
// cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0x461420) + 0x6D8) + 0x800)+ 0x538) + 0x528) + 0x164;// 跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("08521", daddr, AlguiMemTool.TYPE_DWORD, false,true);// 修改目标值
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
} else {
notification.make("改装光环", "切换画质以关闭功能", Notification.Type.ERROR);
ModuleManager.getInstance().setModuleEnabled("改装光环|Halo", false);
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss",
AlguiMemTool.HEAD_CB);// 获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB
// cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0x461420) + 0x6D8) + 0x800)+ 0x538) + 0x528) + 0x164;// 跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("689273856", daddr, AlguiMemTool.TYPE_DWORD, false,true);// 修改目标值
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
}
return true;
}
});
return gzghSwitchContentCard;
}
private SwitchContentCard createwxhjSwitchContentCard() {
final SwitchContentCard wxhjSwitchContentCard = new SwitchContentCard("无序挥击", "[仅自己可见]所有可旋转模块无序转动").OText("无序挥击","[仅自己可见]所有可旋转模块无序转动","Disorder","All rotatable modules rotate disorderly").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
wxhjSwitchContentCard.setExpandableContent(column);
SwitchContent shortcutSwitchContent = new SwitchContent("快捷键", "显示一个快捷按键以快速使用功能").OText("快捷键","显示一个快捷键以快速使用功能","FloatButton","Create a hover button").setLanguageSwitchFilePath("/sdcard/TC配置文件/switch.lang");
shortcutSwitchContent.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(15)));
shortcutSwitchContent.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
if (newState) {
wxhjShortcutButton.show();
} else {
wxhjShortcutButton.dismiss();
}
return true;
}
});
column.addView(shortcutSwitchContent);
SyncUtil.sync(wxhjSwitchContentCard, wxhjShortcutButton, new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
Main.音效();
if (newState) {
notification.make("无序挥击", "已开启", Notification.Type.SUCCESS);
ModuleManager.getInstance().setModuleEnabled("无序挥击|Disorder", true);
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss",AlguiMemTool.HEAD_CB);// 获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0x461420) + 0x6D8) + 0x7C0)+ 0x7B0) + 0x608) + 0x7E4;// 跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("9999", daddr, AlguiMemTool.TYPE_FLOAT, false,true);// 修改目标值
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
} else {
notification.make("无序挥击", "已关闭", Notification.Type.ERROR);
ModuleManager.getInstance().setModuleEnabled("无序挥击|Disorder", false);
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
AlguiMemTool.setPackageName("com.vortex.celestial");//设置包名
long sAddr = AlguiMemTool.getModuleBaseAddr("libclient.so:bss",AlguiMemTool.HEAD_CB);// 获取模块基址 【xa模块传HEAD_XA cb模块传HEAD_CB cd模块传HEAD_CD】
long daddr = AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(AlguiMemTool.jump64(sAddr + 0x461420) + 0x6D8) + 0x7C0)+ 0x7B0) + 0x608) + 0x7E4;// 跳转指针 跳到目标地址 【32位使用 jump32 64位使用jump64】
AlguiMemTool.setMemoryAddrValue("-185", daddr, AlguiMemTool.TYPE_FLOAT, false,true);// 修改目标值
AlguiMemTool.clearResultList();// 修改完成 则清空这次的搜索结果
}
return true;
}
});
return wxhjSwitchContentCard;
}
}

View File

@@ -0,0 +1,25 @@
# Category 文件说明
这个目录包含了应用中各个功能分类的 UI 组件和相关工具类。
## 文件功能说明
- **AttackCategoryBox.java**: 攻击功能分类的 UI 组件
- **BinaryExecutor.java**: 二进制文件执行工具类
- **ESPCategoryBox.java**: ESP透视功能分类的 UI 组件
- **EspDataCache.java**: ESP 功能的数据缓存管理
- **EspFetcherThread.java**: ESP 功能的数据获取线程
- **Fastesp.java**: 快速 ESP 功能实现
- **FileUtilT.java**: 文件操作工具类
- **MiscCategoryBox.java**: 杂项功能分类的 UI 组件
- **PlayerCategoryBox.java**: 玩家功能分类的 UI 组件
- **RemoteLinkWatcher.java**: 远程链接监视器
- **SOULCategoryBox.java**: SOUL 功能分类的 UI 组件
- **SettingCategoryBox.java**: 设置功能分类的 UI 组件
- **SpecialCategoryBox.java**: 特殊功能分类的 UI 组件
- **TPCategoryBox.java**: 传送功能分类的 UI 组件
- **WorldCategoryBox.java**: 世界功能分类的 UI 组件
- **ZipUtilT.java**: ZIP 压缩工具类
- **aboutCategoryBox.java**: 关于功能分类的 UI 组件
这些文件共同构成了应用的功能分类界面和相关工具。

View File

@@ -1,255 +0,0 @@
package com.bytecat.algui.ui.category;
import android.graphics.Color;
import com.bytecat.algui.base.BaseHelper;
import com.bytecat.algui.component.Column;
import com.bytecat.algui.component.Text;
import com.bytecat.algui.component.Widget;
import com.bytecat.algui.layoutparams.LinearParams;
import com.bytecat.algui.ui.component.SwitchContentCard;
import com.bytecat.algui.ui.component.CategoryBox;
import com.bytecat.algui.ui.component.StatefulButton;
import com.bytecat.algui.callback.SwitchCallback;
import com.bytecat.algui.effect.Notification;
import com.bytecat.algui.ui.button.SwitchShortcutButton;
import com.bytecat.algui.component.Row;
import com.bytecat.algui.ui.component.SwitchContent;
import com.bytecat.algui.util.SyncUtil;
import com.bytecat.algui.ui.component.ButtonContentCard;
import com.bytecat.algui.ui.component.RadioGroup;
import android.graphics.Typeface;
import com.bytecat.algui.callback.RadioGroupCallback;
import com.bytecat.algui.callback.ClickCallback;
import com.bytecat.algui.ace;
import com.bytecat.algui.ui.Main;
import com.bytecat.algui.ui.MIX;
import com.bytecat.algui.effect.Hint;
import java.io.File;
import com.bytecat.algui.effect.ColorPickerPopup;
public class SettingCategoryBox extends CategoryBox {
private Notification notification;
// 添加一个静态变量来保存点击背景关闭功能的状态
public static boolean enableClickBackgroundClose = true;
//快捷键
private SwitchShortcutButton ysjShortcutButton;
public SettingCategoryBox() {
notification = Notification.getInstance();
initUI();
createShortcutButtons();
contentContainer
.addView(createlaunSwitchContentCard())
.addView(createSwitchContentCard());
contentContainer.build().addView(picker)
;
}
private void createShortcutButtons() {
ysjShortcutButton = new SwitchShortcutButton()
.setText("功能列表").OText("功能列表","ArrayList");
}
private void initUI() {
addSettingCards();
}
private void addSettingCards() {
// 点击背景关闭界面设置
StatefulButton clickBgCloseButton = new StatefulButton("点击背景关闭界面","Close Shortcut", enableClickBackgroundClose);
clickBgCloseButton.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setMargins(BaseHelper.dip2pxInt(15), BaseHelper.dip2pxInt(5), BaseHelper.dip2pxInt(15), BaseHelper.dip2pxInt(5)));
clickBgCloseButton.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
enableClickBackgroundClose = newState;
if (newState) {
notification.make("设置", "已开启", Notification.Type.SUCCESS);
} else {
notification.make("设置", "已关闭", Notification.Type.ERROR);
}
return true;
}
});
contentContainer.addView(clickBgCloseButton);
}
private ButtonContentCard createlaunSwitchContentCard() {
final ButtonContentCard zzbutton = new ButtonContentCard("语言切换", "Language", false);
final String configDir = "/sdcard/TC配置文件/";
final String filePath = configDir + "/switch.lang";
zzbutton.OText("语言切换", "中/英文切换", "Language Switch", "Switch between Chinese and English")
.setLanguageSwitchFilePath("/sdcard/Android/data/com.vortex.celestial/files/switch.lang");
zzbutton.setClickCallback(new ClickCallback() {
@Override
public void onClick() {
File file = new File(filePath);
try {
// 确保目录存在
File dir = new File(configDir);
if (!dir.exists()) {
dir.mkdirs();
}
if (!file.exists()) {//如果没有
file.createNewFile();//就创建(中文)
notification.make("已切换中文", "重启软件生效", Notification.Type.SUCCESS);
}else{//如果有
file.delete();//就删除(英文)
notification.make("Already switched to English", "Restart the software to take effect", Notification.Type.SUCCESS);
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
return zzbutton;
}
private ButtonContentCard createSwitchContentCard() {
final ButtonContentCard zzbutton = new ButtonContentCard("切换音效", "切换使用功能时播放的音效").OText("切换音效","切换使用功能时播放的音效","effect","Switch sound effect").setLanguageSwitchFilePath("/sdcard/Android/data/com.vortex.celestial/files/switch.lang");
final Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
.setTopMargin(dip2pxInt(10)));
zzbutton.setExpandableContent(column);
Row distanceRow = new Row()
.setLayoutParams(
new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setHeight(BaseHelper.WrapContent)
);
column.addView(distanceRow);
final Text reachText = new Text()
.setText("切换:","Switch:")
.setTextSize(10f)
.setTextColor(hexColor("#FFC5C5C5"))
.setTypeface(Typeface.DEFAULT_BOLD)
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setBottomMargin(dip2pxInt(5)));
column.addView(reachText);
final RadioGroup radioGroup = new RadioGroup();
radioGroup.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setBottomMargin(dip2pxInt(15))); // 底部外边距为15dp
radioGroup.setEnabled(true); // 启用单选按钮组
radioGroup.addButton("音效1","one", "1"); // 添加第一个选项
radioGroup.addButton("音效2","two", "2"); // 添加第三个选项
radioGroup.addButton("音效3","three", "3"); // 添加第三个选项
final String[] selectedOption = {"1"}; // 默认选中第一个选项
radioGroup.setRadioGroupCallback(new RadioGroupCallback() {
@Override
public void onChecked(String id) {
new Hint().setMessage("Selected: " + id).show(); // 显示选中的选项
selectedOption[0] = id; // 更新选中的选项
}
});
column.addView(radioGroup); // 将单选按钮组添加到内容区域
zzbutton.setClickCallback(new ClickCallback() {//这个是按钮
@Override
public void onClick() {
executeBehavior1(selectedOption[0], true); // 执行选中的行为
}
});
return zzbutton;
}
ColorPickerPopup picker = new ColorPickerPopup(MIX.getContext());
private void executeBehavior1(String selectedOption, boolean enable) {
if (enable) {
ace.executeHiddenBinary(getAction1(selectedOption));
} else {
}
}
private String getAction1(String option) {//音效
switch (option) {
case "1":
Main.vt1=true;
Main.vt2=false;
Main.vt3=false;
return "音效1";
case "2":
Main.vt1=false;
Main.vt2=true;
Main.vt3=false;
return "音效2";
case "3":
Main.vt1=false;
Main.vt2=false;
Main.vt3=true;
return "音效3";
default:
return "音效1";
}
}
// 可以添加更多设置卡片...
}

View File

@@ -1,679 +0,0 @@
package com.bytecat.algui.ui.category;
import com.bytecat.algui.ui.component.CategoryBox;
import com.bytecat.algui.ui.component.SwitchContentCard;
import com.bytecat.algui.ui.button.SwitchShortcutButton;
import com.bytecat.algui.component.Column;
import com.bytecat.algui.layoutparams.LinearParams;
import com.bytecat.algui.base.BaseHelper;
import com.bytecat.algui.component.Row;
import com.bytecat.algui.component.Text;
import android.graphics.Typeface;
import com.bytecat.algui.ui.component.Slider;
import com.bytecat.algui.callback.SliderCallback;
import android.annotation.SuppressLint;
import com.bytecat.algui.AlguiHacker.AlguiMemTool;
import com.bytecat.algui.effect.Hint;
import com.bytecat.algui.component.Widget;
import com.bytecat.algui.ui.component.SwitchContent;
import com.bytecat.algui.callback.SwitchCallback;
import com.bytecat.algui.util.SyncUtil;
import com.bytecat.algui.ui.MIX;
import com.bytecat.algui.ui.component.RadioGroup;
import com.bytecat.algui.callback.RadioGroupCallback;
import com.bytecat.algui.ace;
import com.bytecat.algui.ui.Main;
import com.bytecat.algui.ui.component.ButtonContentCard;
import com.bytecat.algui.callback.ClickCallback;
import com.bytecat.algui.effect.Notification;
import java.util.Locale;
import com.bytecat.algui.effect.ModuleManager;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.FileOutputStream;
import android.content.Context;
import com.bytecat.algui.AlguiViews.AlguiV;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Environment;
import android.widget.Toast;
import java.io.FileInputStream;
import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry;
import android.content.Intent;
public class SpecialCategoryBox extends CategoryBox {
// 放在 SpecialCategoryBox.java 最顶部
Notification notification = Notification.getInstance();
/**
* 把 ini 文件里第一个匹配 key 的行改成指定值
* 文件固定:/storage/emulated/0/Android/data/com.vortex.celestial/files/Netease/wxzc/config.ini
* 如文件不存在会自动创建
*/
private static final String INI_PATH =
"/storage/emulated/0/Android/data/com.vortex.celestial/files/Netease/wxzc/config.ini";
public static void configWrite(String key, String newValue) {
final String path = "/storage/emulated/0/Android/data/com.vortex.celestial/files/Netease/wxzc/config.ini";
File file = new File(path);
if (!file.getParentFile().exists()) file.getParentFile().mkdirs();
List<String> lines = new ArrayList<>();
BufferedReader br = null;
BufferedWriter bw = null;
boolean found = false;
try {
// 1. 读
if (file.exists()) {
br = new BufferedReader(new FileReader(file));
String line;
while ((line = br.readLine()) != null) {
String trim = line.trim();
if (trim.startsWith(key + " = ") || trim.startsWith(key + " = ")) {
lines.add(key + " = " + newValue);
found = true;
} else {
lines.add(line);
}
}
}
// 2. 如果没找到,追加一行
if (!found) {
lines.add(key + " = " + newValue);
}
// 3. 写
bw = new BufferedWriter(new FileWriter(file));
for (String l : lines) {
bw.write(l);
bw.newLine();
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try { if (br != null) br.close(); } catch (IOException ignore) {}
try { if (bw != null) bw.close(); } catch (IOException ignore) {}
}
}
/**
* 在 [graphic_setting] 节下 添加/删除 hdr = 1
* 文件固定:/storage/emulated/0/Android/data/com.vortex.celestial/files/Netease/wxzc/config.ini
* @param enable true=添加 false=删除
*/
public static void configWriteHdr(boolean enable) {
final String path = "/storage/emulated/0/Android/data/com.vortex.celestial/files/Netease/wxzc/config.ini";
final String sectionStart = "[graphic_setting]";
final String targetLine = "hdr = 1";
File file = new File(path);
if (!file.getParentFile().exists()) file.getParentFile().mkdirs();
List<String> lines = new ArrayList<>();
BufferedReader br = null;
BufferedWriter bw = null;
boolean inSection = false;
boolean foundHdr = false;
try {
if (file.exists()) {
br = new BufferedReader(new FileReader(file));
String line;
while ((line = br.readLine()) != null) {
String trim = line.trim();
// 进入/离开 [graphic_setting]
if (trim.equals(sectionStart)) {
inSection = true;
lines.add(line);
continue;
}
if (trim.startsWith("[") && !trim.equals(sectionStart)) {
inSection = false;
}
// 在目标节内处理 hdr
if (inSection && trim.equals(targetLine)) {
foundHdr = true;
if (!enable) continue; // 删除
}
lines.add(line);
}
br.close();
}
// 如果文件不存在,先补节
if (!lines.contains(sectionStart)) {
lines.add(sectionStart);
}
// 需要添加且没找到 hdr
if (enable && !foundHdr) {
// 找出最后一行索引再插入
int insertAt = lines.size();
for (int i = 0; i < lines.size(); i++) {
if (lines.get(i).trim().equals(sectionStart)) {
insertAt = i + 1;
while (insertAt < lines.size() && !lines.get(insertAt).trim().startsWith("[")) {
insertAt++;
}
break;
}
}
lines.add(insertAt, targetLine);
}
// 写回
bw = new BufferedWriter(new FileWriter(file));
for (String l : lines) bw.write(l + "\n");
} catch (IOException e) {
e.printStackTrace();
} finally {
try { if (br != null) br.close(); } catch (IOException ignore) {}
try { if (bw != null) bw.close(); } catch (IOException ignore) {}
}
}
//波动消除检测
private boolean isSfxLevelZero() {
File f = new File(INI_PATH);
if (!f.exists()) return false;
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(f));
String line;
while ((line = br.readLine()) != null) {
line = line.trim();
if (line.startsWith("sfx_level=") || line.startsWith("sfx_level =")) {
String val = line.split("=")[1].trim();
return "0".equals(val);
}
}
} catch (IOException ignore) {
} finally {
if (br != null) try { br.close(); } catch (IOException ignore) {}
}
return false;
}
//hdr检测
private boolean isHdrOn() {
final String path = "/storage/emulated/0/Android/data/com.vortex.celestial/files/Netease/wxzc/config.ini";
final String sectionStart = "[graphic_setting]";
final String targetLine = "hdr = 1";
File file = new File(path);
if (!file.exists()) return false;
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(file));
String line;
boolean inSection = false;
while ((line = br.readLine()) != null) {
String trim = line.trim();
if (trim.equals(sectionStart)) {
inSection = true;
continue;
}
if (trim.startsWith("[") && !trim.equals(sectionStart)) {
inSection = false;
}
if (inSection && trim.equals(targetLine)) {
return true;
}
}
} catch (IOException ignore) {
} finally {
if (br != null) try { br.close(); } catch (IOException ignore) {}
}
return false;
}
//阴影检测
private boolean isShadowOn() {
File f = new File(INI_PATH);
if (!f.exists()) return false;
BufferedReader br = null;
try {
br = new BufferedReader(new FileReader(f));
String line;
while ((line = br.readLine()) != null) {
line = line.trim();
if (line.startsWith("shadow_quality=") || line.startsWith("shadow_quality =")) {
String val = line.split("=")[1].trim();
return "1".equals(val);
}
}
} catch (IOException ignore) {
} finally {
if (br != null) try { br.close(); } catch (IOException ignore) {}
}
return false;
}
public SpecialCategoryBox() {
contentContainer
.addView(createhzwdSwitchContentCard())
.addView(createhdrSwitchContentCard())
.addView(createyinSwitchContentCard())
.addView(createskySwitchContentCard())
.addView(createSwitchContentCard())
;
}
private SwitchContentCard createhzwdSwitchContentCard() {
boolean defaultOn = isSfxLevelZero(); // ← 读取 ini 决定默认状态
SwitchContentCard card = new SwitchContentCard("波动消除", "消除部分模块使用引起的空气波动", defaultOn);
// 中英双语切换(复用统一语言文件 /sdcard/TC配置文件/switch.lang
card.OText("波动消除", "消除部分模块使用引起的空气波动", "Wobble Removal", "Fix screen wobble caused by the module");
card.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
Main.音效();
if (newState){
configWrite("sfx_level", "0");
}else{
configWrite("sfx_level", "2");
}
notification.make("修改完成","请重启游戏","Modification completed", "Please restart the game", Notification.Type.SUCCESS);
return true;
}
});
return card;
}
private SwitchContentCard createhdrSwitchContentCard() {
boolean defaultOn = isHdrOn(); // ← 读取 hdr 状态决定默认
SwitchContentCard card = new SwitchContentCard("高清", "HDR 画质", defaultOn);
card.OText("高清", "[开启后绘制偏框]HDR 画质", "HDR Switch", "Toggle HDR rendering");
card.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
Main.音效();
configWriteHdr(newState); // 新增/删除 hdr = 1
notification.make("修改完成","请重启游戏","Modification completed", "Please restart the game", Notification.Type.SUCCESS);
return true;
}
});
return card;
}
private SwitchContentCard createyinSwitchContentCard() {
boolean defaultOn = isShadowOn(); // ← 状态决定默认
SwitchContentCard card = new SwitchContentCard("阴影", "任意画质下添加阴影", defaultOn);
card.OText("阴影", "任意画质下添加阴影", "Shadow Switch", "Add shadows at any quality level");
card.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(boolean newState) {
Main.音效();
if (newState){
configWrite("shadow_quality", "1");
}else{
configWrite("shadow_quality", "2");
}
notification.make("修改完成","请重启游戏","Modification completed", "Please restart the game", Notification.Type.SUCCESS);
return true;
}
});
return card;
}
private SwitchContentCard createskySwitchContentCard() {
final String TARGET_DIR = "/storage/emulated/0/Android/data/com.vortex.celestial/files/Netease/wxzc/Documents/res";
final String TARGET_FILE = TARGET_DIR + "/levelsets.npk";
final String ASSET1 = "levelsets.npk";
final String ASSET2 = "levelsets2.npk";
final long SIZE1 = 18884L; // 118.84 MB
boolean defaultOn = new File(TARGET_FILE).exists() && new File(TARGET_FILE).length() == SIZE1;
SwitchContentCard card = new SwitchContentCard("天空盒修改", "一键替换天空盒资源", defaultOn);
card.OText("天空盒修改", "一键替换天空盒资源", "Skybox Switch", "Enable custom skybox");
card.setSwitchCallback(new SwitchCallback() {
@Override
public boolean onChecked(final boolean newState) {
Main.音效();
new AsyncTask<Void, Void, Exception>() {
@Override
protected Exception doInBackground(Void... voids) {
File dir = new File(TARGET_DIR);
if (!dir.exists()) dir.mkdirs();
File dst = new File(TARGET_FILE);
try {
if (newState) {
copyAsset(ASSET1, dst);
} else {
if (dst.exists()) dst.delete();
copyAsset(ASSET2, dst);
}
return null;
} catch (IOException e) {
return e;
}
}
@Override
protected void onPostExecute(Exception e) {
if (e == null) {
notification.make("修改完成", "请重启游戏",
"Modification completed", "Please restart the game",
Notification.Type.SUCCESS);
} else {
notification.make("失败", e.getMessage(),
"Failed", e.getMessage(),
Notification.Type.ERROR);
}
}
}.execute();
return true;
}
private void copyAsset(String assetName, File dst) throws IOException {
android.content.res.AssetManager am = MIX.getContext().getAssets();
java.io.InputStream in = am.open(assetName);
java.io.OutputStream out = new java.io.FileOutputStream(dst);
byte[] buf = new byte[8192];
int len;
while ((len = in.read(buf)) != -1) {
out.write(buf, 0, len);
}
in.close();
out.close();
}
});
return card;
}
private ButtonContentCard createSwitchContentCard() {
final ButtonContentCard button03 = new ButtonContentCard("游客账号", "可以对游客账号数据进行操作").OText("游客账号", "可以对游客账号数据进行操作", "One-Click Suicide", "Teleport to Abyss");
// 创建一个可折叠的内容区域,用于放置设置选项
Column column = new Column()
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent) // 宽度填满父视图
.setHeight(BaseHelper.WrapContent) // 高度自适应内容
.setTopMargin(dip2pxInt(15))); // 顶部外边距为15dp
button03.setExpandableContent(column); // 将内容区域设置到卡片中
// 添加一键开启的文本提示
final Text reachText1 = new Text()
.setText("选择:")
.setTextSize(10f)
.setTextColor(hexColor("#FFC5C5C5"))
.setTypeface(Typeface.DEFAULT_BOLD)
.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setBottomMargin(dip2pxInt(5)));
column.addView(reachText1); // 将文本添加到内容区域
// 创建一个单选按钮组,用于选择一键开启的行为
final RadioGroup radioGroup1 = new RadioGroup();
radioGroup1.setLayoutParams(new LinearParams()
.setWidth(BaseHelper.MatchParent)
.setBottomMargin(dip2pxInt(15)));
radioGroup1.setEnabled(true);
radioGroup1.addButton("清除", "1"); // 添加单次选项
radioGroup1.addButton("保存", "2"); // 添加循环选项
radioGroup1.addButton("加载", "3"); // 添加循环选项
final String[] selectedOption = {"1"}; // 默认选中第一个选项
radioGroup1.setRadioGroupCallback(new RadioGroupCallback() {
@Override
public void onChecked(String id) {
new Hint().setMessage("Selected: " + id).show(); // 显示选中的选项
selectedOption[0] = id; // 更新选中的选项
}
});
column.addView(radioGroup1); // 将单选按钮组添加到内容区域
button03.setClickCallback(new ClickCallback() {//这个是按钮
@Override
public void onClick() {
executeBehavior1(selectedOption[0]); // 执行选中的行为
}
});
return button03;
}
private void executeBehavior1(String selectedOption) {
getAction1(selectedOption);
}
private String getAction1(String option) {//账号
Main.音效();
notification.make("功能", "已执行完毕", Notification.Type.SUCCESS);
switch (option) {
case "1":
clearSharedPrefs(MIX.getContext());
File neteaseDir = new File(Environment.getExternalStorageDirectory(), "netease");
deleteRecursive(neteaseDir);
// 立即结束当前进程
restartApp(MIX.getContext());
return "";
case "2":
try {
exportAccountData(MIX.getContext()); // 在主线程外执行更好
} catch (IOException e) {
e.printStackTrace();
}
return "";
case "3":
try {
restoreAccountData(MIX.getContext());
} catch (IOException e) {
Toast.makeText(MIX.getContext(), "失败", Toast.LENGTH_LONG).show();
}
restartApp(MIX.getContext());
return "";
default:
return "";
}
}
public static void deleteRecursive(File fileOrDirectory) {
if (fileOrDirectory.isDirectory()) {
File[] children = fileOrDirectory.listFiles();
if (children != null) {
for (File child : children) {
deleteRecursive(child);
}
}
}
fileOrDirectory.delete();
}
public static void clearSharedPrefs(Context context) {
File prefsDir = new File(context.getApplicationInfo().dataDir, "shared_prefs");
if (!prefsDir.exists() || !prefsDir.isDirectory()) {
return;
}
File[] files = prefsDir.listFiles();
if (files == null) return;
for (File f : files) {
// 只删 .xml 文件,防止误删
if (f.getName().endsWith(".xml")) {
boolean ok = f.delete();
}
}
}
// ================== 导出 ==================
public static void exportAccountData(Context ctx) throws IOException {
File cacheDir = new File(ctx.getCacheDir(), "export");
FileUtilT.deleteRecursive(cacheDir);
cacheDir.mkdirs();
// 1. 复制 shared_prefs → Base64("1")
String dir1 = android.util.Base64.encodeToString("1".getBytes(), android.util.Base64.NO_WRAP);
File prefsSrc = new File(ctx.getApplicationInfo().dataDir, "shared_prefs");
File prefsDst = new File(cacheDir, dir1);
FileUtilT.copyDir(prefsSrc, prefsDst);
// 2. 复制 /sdcard/netease → Base64("2")
String dir2 = android.util.Base64.encodeToString("2".getBytes(), android.util.Base64.NO_WRAP);
File neteaseSrc = new File(Environment.getExternalStorageDirectory(), "netease");
File neteaseDst = new File(cacheDir, dir2);
FileUtilT.copyDir(neteaseSrc, neteaseDst);
// 3. 打包Base64("backup") + ".dat"
String zipName = android.util.Base64.encodeToString("backup".getBytes(), android.util.Base64.NO_WRAP) + ".dat";
File outDir = new File(Environment.getExternalStorageDirectory(), "TC配置文件");
outDir.mkdirs();
File zipFile = new File(outDir, zipName);
ZipUtilT.zip(cacheDir, zipFile);
}
public final class FileUtil {
public void copyDir(File src, File dst) throws IOException {
if (src == null || !src.exists()) return;
dst.mkdirs();
File[] list = src.listFiles();
if (list == null) return;
for (File f : list) {
File target = new File(dst, f.getName());
if (f.isDirectory()) {
copyDir(f, target);
} else {
try (FileInputStream in = new FileInputStream(f);
FileOutputStream out = new FileOutputStream(target)) {
byte[] buf = new byte[8192];
int len;
while ((len = in.read(buf)) > 0) out.write(buf, 0, len);
}
}
}
}
public void deleteRecursive(File f) {
if (f == null || !f.exists()) return;
if (f.isDirectory()) {
File[] children = f.listFiles();
if (children != null) for (File c : children) deleteRecursive(c);
}
f.delete();
}
}
// ================== 导入 ==================
public static void restoreAccountData(Context ctx) throws IOException {
// 1. 拼出 Base64 文件名
String zipName = android.util.Base64.encodeToString("backup".getBytes(), android.util.Base64.NO_WRAP) + ".dat";
File zipFile = new File(Environment.getExternalStorageDirectory(), "TC配置文件/" + zipName);
File tempDir = new File(ctx.getCacheDir(), "restore");
FileUtilT.deleteRecursive(tempDir);
tempDir.mkdirs();
// 2. 解压
ZipUtilT.unzip(zipFile, tempDir);
// 3. 覆盖 shared_prefsBase64("1")
String dir1 = android.util.Base64.encodeToString("1".getBytes(), android.util.Base64.NO_WRAP);
File prefsDst = new File(ctx.getApplicationInfo().dataDir, "shared_prefs");
File prefsSrc = new File(tempDir, dir1);
FileUtilT.deleteRecursive(prefsDst);
FileUtilT.copyDir(prefsSrc, prefsDst);
// 4. 覆盖 /sdcard/neteaseBase64("2")
String dir2 = android.util.Base64.encodeToString("2".getBytes(), android.util.Base64.NO_WRAP);
File neteaseDst = new File(Environment.getExternalStorageDirectory(), "netease");
File neteaseSrc = new File(tempDir, dir2);
FileUtilT.deleteRecursive(neteaseDst);
FileUtilT.copyDir(neteaseSrc, neteaseDst);
}
private void restartApp(Context ctx) {
Intent intent = ctx.getPackageManager()
.getLaunchIntentForPackage(ctx.getPackageName());
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
((Activity) ctx).finish();
ctx.startActivity(intent);
Runtime.getRuntime().exit(0); // 立即结束旧进程
}
}

View File

@@ -13,27 +13,25 @@ public class aboutCategoryBox extends CategoryBox {
private TextContentCard createMixNewTextContentCard() {
return new TextContentCard(
"关于UIMIX - NEW",
"由苏沐橙Su Mucheng于2024年创建。\n"+
"QQ3578557729\n"+
"QQ群204677717\n"+
"价格100元人民币恕不议价\n"+
"其他UIMuCuteUI、MuCuteUIXMIX\n"+
"注意事项本UI基于MuCuteUIX开发新增了众多组件并优化了性能。"
);
"关于UIMIX - NEW",
"由苏沐橙Su Mucheng于2024年创建。\n" +
"QQ3578557729\n" +
"QQ群204677717\n" +
"价格100元人民币恕不议价\n" +
"其他UIMuCuteUI、MuCuteUIXMIX\n" +
"注意事项本UI基于MuCuteUIX开发新增了众多组件并优化了性能。");
}
private TextContentCard createWhatIsMixTextContentCard() {
return new TextContentCard(
"关于本项目TrosCore",
"由凌白、龙图主力制作\n" +
"由小伙子加密及对接工具\n" +
"感谢半夢的支持与帮助\n" +
"使用TC客户端(更改地板等)\n" +
"更便宜的价格、更流畅的体验\n" +
"基于先前项目进行改进使用了全新的UI\n" +
"QQ群1030990452"
);
"由凌白、龙图主力制作\n" +
"由小伙子加密及对接工具\n" +
"感谢半夢的支持与帮助\n" +
"使用TC客户端(更改地板等)\n" +
"更便宜的价格、更流畅的体验\n" +
"基于先前项目进行改进使用了全新的UI\n" +
"QQ群1030990452");
}
}