Loading src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java +7 −0 Original line number Diff line number Diff line Loading @@ -125,12 +125,19 @@ public class DeviceDetectedController extends AbstractSubController{ return; } if (DeviceHelper.isDeviceBlacklisted(phone.getAdbDevice())) { displayIncompatibleDeviceFound(phone.getAdbModel()); return; } final String model = phone.getAdbModel(); if(model == null || model.isEmpty()) displayUnknowDeviceFound(); else{ //check that there is config file for this device detectionMsg.setText(String.format(i18n.getString("detect_lbl_compatibleDeviceFound"), model)); if(parentController != null){ // Fill last property of Phone object phone.setInternalCode(DeviceHelper.getDeviceInternalcode(phone.getAdbDevice())); Loading src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java +18 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.text.ParseException; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; Loading @@ -40,6 +42,8 @@ public class DeviceHelper { private final static String YAML_FOLDER_PATH = "/yaml/"; private static final HashMap<String, String> map = new HashMap<String, String>() {{ // Format e95acf4b device usb:3-1.4 product:OnePlus8Pro_EEA model:IN2023 device:OnePlus8Pro transport_id:5 // Keep model as identifier -> getDeviceInternalcode put("hero2lte", "0001"); put("herolte", "0002"); put("star2lte", "0003"); Loading @@ -57,6 +61,7 @@ public class DeviceHelper { put("flame", "0016"); put("coral", "0017"); put("keyword", "0018"); //OnePlus7 Pro put("OnePlus8Pro", "0021"); }}; /** Loading @@ -68,6 +73,18 @@ public class DeviceHelper { return map.get(key); } /** * Returns true if the device is blacklisted. A blaclisted device embeds flashs scripts but * is not detected by the Easy installer (use case Murena ROM has an issue we nned to wait for the next ROM release * but developping procces is allowed). * @param key the ADB device code's name (example: Samsung galaxy S7 => herolte) * @return can return null if no key matches */ public static boolean isDeviceBlacklisted(String key){ List<String> blaclisted = Arrays.asList("OnePlus8Pro", "OnePlus8"); return blaclisted.contains(key); } /** * Get data relatives to sources to download from config file Loading Loading
src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java +7 −0 Original line number Diff line number Diff line Loading @@ -125,12 +125,19 @@ public class DeviceDetectedController extends AbstractSubController{ return; } if (DeviceHelper.isDeviceBlacklisted(phone.getAdbDevice())) { displayIncompatibleDeviceFound(phone.getAdbModel()); return; } final String model = phone.getAdbModel(); if(model == null || model.isEmpty()) displayUnknowDeviceFound(); else{ //check that there is config file for this device detectionMsg.setText(String.format(i18n.getString("detect_lbl_compatibleDeviceFound"), model)); if(parentController != null){ // Fill last property of Phone object phone.setInternalCode(DeviceHelper.getDeviceInternalcode(phone.getAdbDevice())); Loading
src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java +18 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.text.ParseException; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; Loading @@ -40,6 +42,8 @@ public class DeviceHelper { private final static String YAML_FOLDER_PATH = "/yaml/"; private static final HashMap<String, String> map = new HashMap<String, String>() {{ // Format e95acf4b device usb:3-1.4 product:OnePlus8Pro_EEA model:IN2023 device:OnePlus8Pro transport_id:5 // Keep model as identifier -> getDeviceInternalcode put("hero2lte", "0001"); put("herolte", "0002"); put("star2lte", "0003"); Loading @@ -57,6 +61,7 @@ public class DeviceHelper { put("flame", "0016"); put("coral", "0017"); put("keyword", "0018"); //OnePlus7 Pro put("OnePlus8Pro", "0021"); }}; /** Loading @@ -68,6 +73,18 @@ public class DeviceHelper { return map.get(key); } /** * Returns true if the device is blacklisted. A blaclisted device embeds flashs scripts but * is not detected by the Easy installer (use case Murena ROM has an issue we nned to wait for the next ROM release * but developping procces is allowed). * @param key the ADB device code's name (example: Samsung galaxy S7 => herolte) * @return can return null if no key matches */ public static boolean isDeviceBlacklisted(String key){ List<String> blaclisted = Arrays.asList("OnePlus8Pro", "OnePlus8"); return blaclisted.contains(key); } /** * Get data relatives to sources to download from config file Loading