Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 91598ac0 authored by Frank Preel's avatar Frank Preel
Browse files

Blacklist OnePlus devices until fingerprint issue is resolved.

parent 0f7b4c7b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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()));

+18 −1
Original line number Diff line number Diff line
@@ -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;
@@ -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");
@@ -57,6 +61,7 @@ public class DeviceHelper {
        put("flame", "0016");
        put("coral", "0017");
        put("keyword", "0018"); //OnePlus7 Pro
        put("OnePlus8Pro", "0021");
    }};

    /**
@@ -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