prerelease, last fixes

This commit is contained in:
francescotescari 2020-07-21 14:56:00 +02:00
parent d9dd017b3e
commit 9dfb16e9bc
16 changed files with 6796 additions and 6649 deletions

View File

@ -1,4 +1,4 @@
The .dll files here are distributed by Microsoft Corporation as part of the
Windows Driver Kit (available at
http://www.microsoft.com/whdc/resources/downloads.mspx) and included here as
The .dll files here are distributed by Microsoft Corporation as part of the
Windows Driver Kit (available at
http://www.microsoft.com/whdc/resources/downloads.mspx) and included here as
permitted by the Microsoft Software License Terms.

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
The .dll files here are distributed by Microsoft Corporation as part of the
Windows Driver Kit (available at
http://www.microsoft.com/whdc/resources/downloads.mspx) and included here as
The .dll files here are distributed by Microsoft Corporation as part of the
Windows Driver Kit (available at
http://www.microsoft.com/whdc/resources/downloads.mspx) and included here as
permitted by the Microsoft Software License Terms.

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
The .dll files here are distributed by Microsoft Corporation as part of the
Windows Driver Kit (available at
http://www.microsoft.com/whdc/resources/downloads.mspx) and included here as
The .dll files here are distributed by Microsoft Corporation as part of the
Windows Driver Kit (available at
http://www.microsoft.com/whdc/resources/downloads.mspx) and included here as
permitted by the Microsoft Software License Terms.

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
The .dll files here are distributed by Microsoft Corporation as part of the
Windows Driver Kit (available at
http://www.microsoft.com/whdc/resources/downloads.mspx) and included here as
The .dll files here are distributed by Microsoft Corporation as part of the
Windows Driver Kit (available at
http://www.microsoft.com/whdc/resources/downloads.mspx) and included here as
permitted by the Microsoft Software License Terms.

Binary file not shown.

View File

@ -28,7 +28,7 @@ import java.util.ArrayList;
import java.util.List;
public class ToolManager {
public static final String TOOL_VERSION = "20.3.1";
public static final String TOOL_VERSION = "20.7.21";
public static final String URL_DONATION = "https://www.xiaomitool.com/V2/donate";
public static final String TOOL_VERSION_EX = "beta";
public static final String XMT_HOST = "https://www.xiaomitool.com/V2";
@ -36,10 +36,10 @@ public class ToolManager {
public static final String URL_LATEST = XMT_HOST + "/latest";
public static final boolean DEBUG_MODE = true;
private static boolean exiting = false;
private static List<Stage> activeStages = new ArrayList<>();
private static final List<Stage> activeStages = new ArrayList<>();
private static String runningInstanceId = null;
private static RunnableMessage ON_BEFORE_CLOSE = null;
private static RunnableMessage ASK_FEEDBACK = new RunnableMessage() {
private static final RunnableMessage ASK_FEEDBACK = new RunnableMessage() {
@Override
public int run() throws InterruptedException {
ToolManager.setOnExitAskForFeedback(false);

View File

@ -78,7 +78,7 @@ public class MainWindowController extends DefaultController {
TRANSLATED_LINK.setText(LRes.TRANSLATOR.toString());
LOGIN_LINK.setText(LRes.LOGIN.toString());
GuiUtils.tooltip(IMG_SETTINGS, LRes.TIP_WINDOW_SETTINGS);
translateUrl = LRes.TRANSLATED_URL.toString();
translateUrl = LRes.TRANSLATOR_URL.toString();
}
private void initVisiblePane() {

View File

@ -21,7 +21,7 @@ public enum LRes {
LOGIN("Login"),
TRANSLATED_BY("Translated by"),
TRANSLATOR(""),
TRANSLATED_URL("https://www.xiaomitool.com"),
TRANSLATOR_URL("https://www.xiaomitool.com"),
CHOOSE_RECOVER_DEVICE("My device is bricked\nI want to unbrick it."),
CHOOSE_MOD_DEVICE("My device works normally\nI want to mod it."),
SEARCHING_CONNECTED_DEVICES("Searching connected devices"),

View File

@ -17,7 +17,7 @@ import java.util.Map;
public class UnlockCommonRequests {
private static final HashMap<Integer, LRes> UNLOCK_CODE_MEANING = buildUnlockCodeMeaning();
private static final String SID = "miui_unlocktool_client";
private static final String CLIENT_VERSION = "3.5.1128.45";
private static final String CLIENT_VERSION = "4.5.707.49";
private static final String NONCEV2 = "/api/v2/nonce";
private static final String USERINFOV3 = "/api/v3/unlock/userinfo";
private static final String DEVICECLEARV3 = "/api/v2/unlock/device/clear";

51
src/test.java Normal file
View File

@ -0,0 +1,51 @@
import com.xiaomitool.v2.adb.device.DeviceGroups;
import com.xiaomitool.v2.inet.CustomHttpException;
import com.xiaomitool.v2.utility.utils.StrUtils;
import com.xiaomitool.v2.xiaomi.XiaomiProcedureException;
import org.json.JSONObject;
import java.util.*;
import static com.xiaomitool.v2.adb.device.DeviceGroups.stripCodename;
import static com.xiaomitool.v2.xiaomi.romota.MiuiRomOta.deviceNames_request;
public class test {
public static void main(String... args) throws Exception {
JSONObject obj = deviceNames_request();
HashSet<String> devices = new HashSet<>();
Map<String, String> res = new HashMap<>();
Map<String, Integer> len = new HashMap<>();
for (String name : obj.keySet()){
String c = stripCodename(name);
String n = obj.getJSONObject(name).getString("display_name_en");
boolean chin = false;
if (StrUtils.isNullOrEmpty(n)){
n = obj.getJSONObject(name).getString("display_name");
chin = true;
}
int a = n.length();
if (chin){
a+=100;
}
Integer l = len.get(c);
if (l != null){
if (l < a){
continue;
}
}
len.put(c, a);
res.put(c, n);
}
ArrayList<Map.Entry<String, String>> so = new ArrayList<Map.Entry<String, String>>(res.entrySet());
so.sort(new Comparator<Map.Entry<String, String>>() {
@Override
public int compare(Map.Entry<String, String> o1, Map.Entry<String, String> o2) {
return o1.getValue().compareToIgnoreCase(o2.getValue());
}
});
for (Map.Entry<String, String> e : so){
System.out.println("map.put(\""+e.getKey()+"\",\""+e.getValue()+"\");");
}
}
}

37
src/test2.java Normal file
View File

@ -0,0 +1,37 @@
import com.xiaomitool.v2.adb.AdbCommunication;
import com.xiaomitool.v2.adb.AdbUtils;
import com.xiaomitool.v2.adb.device.Device;
import com.xiaomitool.v2.adb.device.DeviceManager;
import com.xiaomitool.v2.engine.ToolManager;
import com.xiaomitool.v2.engine.actions.ActionsDynamic;
import com.xiaomitool.v2.procedure.install.GenericInstall;
import com.xiaomitool.v2.utility.utils.ThreadUtils;
import javafx.application.Application;
import javafx.stage.Stage;
public class test2 extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
ToolManager.init(primaryStage, new String[]{});
ThreadUtils.sleepSilently(1000);
new Thread(new Runnable() {
@Override
public void run() {
AdbCommunication.registerAutoScanDevices();
Device device = null;
while (device == null){
device = DeviceManager.getFirstDevice();
ThreadUtils.sleepSilently(2000);
}
try {
ActionsDynamic.START_PROCEDURE(device, GenericInstall.main(), null, GenericInstall.selectRomAndGo()).run();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
}
}

24
src/test3.java Normal file
View File

@ -0,0 +1,24 @@
import com.xiaomitool.v2.adb.device.Device;
import com.xiaomitool.v2.gui.drawable.DrawableManager;
import com.xiaomitool.v2.gui.visual.InstallPane;
import com.xiaomitool.v2.language.LRes;
import com.xiaomitool.v2.language.Lang;
import com.xiaomitool.v2.procedure.RInstall;
import com.xiaomitool.v2.procedure.install.GenericInstall;
import com.xiaomitool.v2.utility.CommandClass;
import com.xiaomitool.v2.utility.utils.ThreadUtils;
import javafx.application.Application;
import javafx.stage.Stage;
import java.nio.file.Paths;
public class test3 {
public static void main(String... args) throws Exception {
Exception e = new Exception();
System.out.println(LRes.REBOOT_STATUS_FAILED.toString(Device.Status.RECOVERY.toString(), "+", Device.Status.RECOVERY.toString(), e.getMessage()));
Lang.saveToXmlFile(Paths.get("./lang.xml"));
}
}

35
src/test4.java Normal file
View File

@ -0,0 +1,35 @@
import com.xiaomitool.v2.adb.AdbCommunication;
import com.xiaomitool.v2.adb.device.Device;
import com.xiaomitool.v2.adb.device.DeviceManager;
import com.xiaomitool.v2.engine.ToolManager;
import com.xiaomitool.v2.engine.actions.ActionsDynamic;
import com.xiaomitool.v2.gui.WindowManager;
import com.xiaomitool.v2.gui.visual.InstallPane;
import com.xiaomitool.v2.procedure.install.GenericInstall;
import com.xiaomitool.v2.procedure.install.InstallException;
import com.xiaomitool.v2.utility.utils.ThreadUtils;
import javafx.application.Application;
import javafx.stage.Stage;
public class test4 extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
ToolManager.init(primaryStage, new String[]{});
ThreadUtils.sleepSilently(1000);
new Thread(new Runnable() {
@Override
public void run() {
try {
InstallPane pane = new InstallPane();
WindowManager.setMainContent(pane, true);
pane.exception(new InstallException("Test message", InstallException.Code.ROM_SELECTION_ERROR), null);
} catch (Exception e){
throw new RuntimeException(e);
}
}
}).start();
}
}