From 9215bf805bb2c7605b4435f5cb9ba67ed7cbb733 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 20 Sep 2021 16:29:59 +0200 Subject: [PATCH 01/39] add Step.java in steps package --- .../easy/installer/models/steps/Step.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/main/java/ecorp/easy/installer/models/steps/Step.java diff --git a/src/main/java/ecorp/easy/installer/models/steps/Step.java b/src/main/java/ecorp/easy/installer/models/steps/Step.java new file mode 100644 index 00000000..95dffa19 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/Step.java @@ -0,0 +1,65 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.models.steps; + +/** + * This class encapsulate basic data about a step of a process + * @idea: this class and subclass could define setters to allow to update ConfigParser + * and make it to be a builder design pattern + * @author Vincent Bourgmayer + */ +public class Step { + public final static String LAST_STEP_KEY = "L"; //When a next step key has this value, it means that this is the last step of the process + private final String type; + private final int stepNumber; //This is the number of the step in the process + private String nextStepKey; //This is the key to the next Step + + /** + * Create an instance of Step + * @param type the type of the step + * @param stepNumber the number of the step in the whole process + */ + public Step(String type, int stepNumber) { + this.type = type; + this.stepNumber = stepNumber; + } + + /** + * Get the type of the step + * @return + */ + public String getType() { + return type; + } + + /** + * Get the number of the step in the whole process + * @return e.g 1, which means 1/5 if there is 5 steps + * in the whole process + */ + public int getStepNumber() { + return stepNumber; + } + + /** + * get the key of the next step to call + * @return String + */ + public String getNextStepKey() { + return nextStepKey; + } + + /** + * Define the key of the next step to call. + * @param nextStepKey String if null, the value is then LAST_STEP_KEY's value. + */ + public void setNextStepKey(String nextStepKey) { + if( nextStepKey == null ) + this.nextStepKey = LAST_STEP_KEY; + else + this.nextStepKey = nextStepKey; + } +} -- GitLab From e879af877d0735a7f56a93166a4eb5bd962fee99 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 20 Sep 2021 16:56:35 +0200 Subject: [PATCH 02/39] add Step interfaces --- .../installer/models/steps/ICustomStep.java | 45 +++++++++++++++++++ .../models/steps/IExecutableStep.java | 32 +++++++++++++ .../easy/installer/models/steps/IStep.java | 35 +++++++++++++++ .../easy/installer/models/steps/Step.java | 5 ++- 4 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java create mode 100644 src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java create mode 100644 src/main/java/ecorp/easy/installer/models/steps/IStep.java diff --git a/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java b/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java new file mode 100644 index 00000000..69b53a48 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java @@ -0,0 +1,45 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.models.steps; + +import java.util.ArrayList; + +/** + * This interface describe a Step that could + * have UI content's define in config file: + * Title, title's icon, instructions, pictures + * + * This is basically a step where user have to + * do something on the phone + * @author vincent Bourgmayer + */ +public interface ICustomStep extends IStep{ + + /** + * Get the resources's key to get Title + * @return String + */ + public String getTitleKey(); + + /** + * Get the name of an images to use as icon + * associated with a title + * @return String + */ + public String getTitleIconName(); + + /** + * Get the keys of content (instructions and pictures) + * to load from resources + * @return ArrayList le list of keys + */ + public ArrayList getTextContentKeys(); + + @Override + default String getType(){ + return "action"; + } +} diff --git a/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java new file mode 100644 index 00000000..4644fcdb --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java @@ -0,0 +1,32 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.models.steps; + +import ecorp.easy.installer.models.Command; + +/** + * Represent a step where the computer + * has to run some command to + * interact with the phone + * + * Example is: detecting the phone, + * pushing content on the phone, ... + * @author vincent Bourgmayer + */ +public interface IExecutableStep extends IStep{ + /** + * Return the command to execute in background + * @return Command instance + */ + public Command getCommand(); + + /** + * Return the key of the next step to + * run in case of failure of the command + * @return + */ + public String getNextKoStepKey(); +} diff --git a/src/main/java/ecorp/easy/installer/models/steps/IStep.java b/src/main/java/ecorp/easy/installer/models/steps/IStep.java new file mode 100644 index 00000000..6214b9c5 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/IStep.java @@ -0,0 +1,35 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.models.steps; + +/** + * Just a trial + * Represent a basic Step type + * @author vincent + */ +public interface IStep { + public final static String LAST_STEP_KEY = "L"; //When a next step key has this value, it means that this is the last step of the process + + /** + * Get the type of the step + * @return + */ + public String getType(); + + /** + * Get the number of the step in the whole process + * @return e.g 1, which means 1/5 if there is 5 steps + * in the whole process + */ + public int getStepNumber(); + + /** + * get the key of the next step to call + * @return String + */ + public String getNextStepKey(); + +} diff --git a/src/main/java/ecorp/easy/installer/models/steps/Step.java b/src/main/java/ecorp/easy/installer/models/steps/Step.java index 95dffa19..91d86cef 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/Step.java +++ b/src/main/java/ecorp/easy/installer/models/steps/Step.java @@ -11,7 +11,7 @@ package ecorp.easy.installer.models.steps; * and make it to be a builder design pattern * @author Vincent Bourgmayer */ -public class Step { +public class Step implements IStep{ public final static String LAST_STEP_KEY = "L"; //When a next step key has this value, it means that this is the last step of the process private final String type; private final int stepNumber; //This is the number of the step in the process @@ -31,6 +31,7 @@ public class Step { * Get the type of the step * @return */ + @Override public String getType() { return type; } @@ -40,6 +41,7 @@ public class Step { * @return e.g 1, which means 1/5 if there is 5 steps * in the whole process */ + @Override public int getStepNumber() { return stepNumber; } @@ -48,6 +50,7 @@ public class Step { * get the key of the next step to call * @return String */ + @Override public String getNextStepKey() { return nextStepKey; } -- GitLab From c07fccaef267956eecf69b9376f79a578aeb923a Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 20 Sep 2021 17:15:31 +0200 Subject: [PATCH 03/39] rename steps.Step into steps.BasicStep. Implement CustomStep --- .../steps/{Step.java => BasicStep.java} | 17 +------ .../installer/models/steps/CustomStep.java | 47 +++++++++++++++++++ 2 files changed, 49 insertions(+), 15 deletions(-) rename src/main/java/ecorp/easy/installer/models/steps/{Step.java => BasicStep.java} (80%) create mode 100644 src/main/java/ecorp/easy/installer/models/steps/CustomStep.java diff --git a/src/main/java/ecorp/easy/installer/models/steps/Step.java b/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java similarity index 80% rename from src/main/java/ecorp/easy/installer/models/steps/Step.java rename to src/main/java/ecorp/easy/installer/models/steps/BasicStep.java index 91d86cef..b96f4f4e 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/Step.java +++ b/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java @@ -11,7 +11,7 @@ package ecorp.easy.installer.models.steps; * and make it to be a builder design pattern * @author Vincent Bourgmayer */ -public class Step implements IStep{ +public class BasicStep implements IStep{ public final static String LAST_STEP_KEY = "L"; //When a next step key has this value, it means that this is the last step of the process private final String type; private final int stepNumber; //This is the number of the step in the process @@ -22,34 +22,21 @@ public class Step implements IStep{ * @param type the type of the step * @param stepNumber the number of the step in the whole process */ - public Step(String type, int stepNumber) { + public BasicStep(String type, int stepNumber) { this.type = type; this.stepNumber = stepNumber; } - /** - * Get the type of the step - * @return - */ @Override public String getType() { return type; } - /** - * Get the number of the step in the whole process - * @return e.g 1, which means 1/5 if there is 5 steps - * in the whole process - */ @Override public int getStepNumber() { return stepNumber; } - /** - * get the key of the next step to call - * @return String - */ @Override public String getNextStepKey() { return nextStepKey; diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java new file mode 100644 index 00000000..d8d88edd --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java @@ -0,0 +1,47 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.models.steps; + +import java.util.ArrayList; + +/** + * This class represent a step with some instructions + * but WITHOUT script or command to run + * @author vincent Bourgmayer + */ +public class CustomStep extends BasicStep implements ICustomStep{ + + private String titleKey; + private String titleIconName; + private ArrayList textContentKeys; + + public CustomStep(String type, int stepNumber, String titleKey, String titleIconName, ArrayList contentKeys) { + super(type, stepNumber); + this.titleKey = titleKey; + this.titleIconName = titleIconName; + this.textContentKeys = contentKeys; + } + + @Override + public String getTitleKey() { + return this.titleKey; + } + + @Override + public String getTitleIconName() { + return this.titleIconName; + } + + @Override + public ArrayList getTextContentKeys() { + return this.textContentKeys; + } + + @Override + public String getType() { + return ICustomStep.super.getType(); //To change body of generated methods, choose Tools | Templates. + } +} -- GitLab From e70037a1c61e39852a8cae6ef6037212ed41d46d Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 20 Sep 2021 17:21:36 +0200 Subject: [PATCH 04/39] add ExecutableStep.java --- .../models/steps/ExecutableStep.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java diff --git a/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java new file mode 100644 index 00000000..8fd493ea --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java @@ -0,0 +1,36 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.models.steps; + +import ecorp.easy.installer.models.Command; + +/** + * This concern step with Fixed UI + * but which run command in Background + * E.g :Device detection + * @author vincent Bourgmayer + */ +public class ExecutableStep extends BasicStep implements IExecutableStep{ + + private Command command; + private String nextKoStepKey; + + public ExecutableStep(String type, int stepNumber, String nextKoStepKey, Command command) { + super(type, stepNumber); + this.command = command; + this.nextKoStepKey = nextKoStepKey; + } + + @Override + public Command getCommand() { + return command; + } + + @Override + public String getNextKoStepKey() { + return this.nextKoStepKey; + } +} -- GitLab From b9f671c109b90344556be5b889b083055e43e769 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 20 Sep 2021 17:29:18 +0200 Subject: [PATCH 05/39] add CustomExecutableStep.java --- .../models/steps/CustomExecutableStep.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java new file mode 100644 index 00000000..d7bb3690 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java @@ -0,0 +1,53 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.models.steps; + +import ecorp.easy.installer.models.Command; +import java.util.ArrayList; + +/** + * + * @author vincent + */ +public class CustomExecutableStep extends BasicStep implements ICustomStep, IExecutableStep{ + + private Command command; + private String nextKoStepKey; + private String titleKey; + private String titleIconName; + private ArrayList textContentKeys; + + public CustomExecutableStep(String type, int stepNumber, + String nextKoStepKey, String titleKey, String titleIconName, + ArrayList contentKeys, Command command) { + super(type, stepNumber); + this.nextKoStepKey = nextKoStepKey; + this.titleKey = titleKey; + this.titleIconName = titleIconName; + this.command = command; + this.textContentKeys = contentKeys; + } + + @Override + public String getType(){ + return ICustomStep.super.getType(); + } + + @Override + public String getTitleKey() { return this.titleKey; } + + @Override + public String getTitleIconName() { return this.titleIconName; } + + @Override + public ArrayList getTextContentKeys() { return this.textContentKeys; } + + @Override + public Command getCommand() { return this.command; } + + @Override + public String getNextKoStepKey() { return this.nextKoStepKey; } +} -- GitLab From a4a56b6d5936e7b1bd17e8f18f07cab8a0e35a4b Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 20 Sep 2021 17:34:52 +0200 Subject: [PATCH 06/39] add LoadStep.java --- .../easy/installer/models/steps/LoadStep.java | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/main/java/ecorp/easy/installer/models/steps/LoadStep.java diff --git a/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java new file mode 100644 index 00000000..ec9e24dd --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java @@ -0,0 +1,40 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.models.steps; + +import ecorp.easy.installer.models.Command; +import java.util.ArrayList; + +/** + * This encapsulate Step where user have to wait for + * a background job to be done, and where a ProgressIndicator + * is present + * @author vincent Bourgmayer + */ +public class LoadStep extends CustomExecutableStep{ + private int averageTime; //Used to fill the ProgressIndicator in UI + + public LoadStep(String type, int stepNumber, String nextKoStepKey, String titleKey, String titleIconName, ArrayList contentKeys, Command command) { + super(type, stepNumber, nextKoStepKey, titleKey, titleIconName, contentKeys, command); + } + + /** + * Get the average time of execution for the background task + * @return int amount in second + */ + public int getAverageTime() { + return averageTime; + } + + public void setAverageTime(int averageTime) { + this.averageTime = averageTime; + } + + @Override + public String getType(){ + return "load"; + } +} -- GitLab From 55d71c27208f61296d28cdfebd0356f01512f19c Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Mon, 20 Sep 2021 17:59:24 +0200 Subject: [PATCH 07/39] start to implement ConfigParse.java and update StepClass to add missing param in constructor --- .../installer/models/steps/BasicStep.java | 6 +- .../models/steps/CustomExecutableStep.java | 4 +- .../installer/models/steps/CustomStep.java | 9 +- .../models/steps/ExecutableStep.java | 4 +- .../easy/installer/models/steps/LoadStep.java | 5 +- .../easy/installer/utils/ConfigParser.java | 126 ++++++++++++++++++ 6 files changed, 139 insertions(+), 15 deletions(-) create mode 100644 src/main/java/ecorp/easy/installer/utils/ConfigParser.java diff --git a/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java b/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java index b96f4f4e..dbaf6768 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java @@ -15,18 +15,20 @@ public class BasicStep implements IStep{ public final static String LAST_STEP_KEY = "L"; //When a next step key has this value, it means that this is the last step of the process private final String type; private final int stepNumber; //This is the number of the step in the process - private String nextStepKey; //This is the key to the next Step + protected String nextStepKey; //This is the key to the next Step /** * Create an instance of Step * @param type the type of the step * @param stepNumber the number of the step in the whole process */ - public BasicStep(String type, int stepNumber) { + public BasicStep(String type, String nextStepKey, int stepNumber) { this.type = type; + this.nextStepKey = nextStepKey; this.stepNumber = stepNumber; } + @Override public String getType() { return type; diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java index d7bb3690..a3df005c 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java @@ -20,10 +20,10 @@ public class CustomExecutableStep extends BasicStep implements ICustomStep, IExe private String titleIconName; private ArrayList textContentKeys; - public CustomExecutableStep(String type, int stepNumber, + public CustomExecutableStep(String type, String nextStepKey, int stepNumber, String nextKoStepKey, String titleKey, String titleIconName, ArrayList contentKeys, Command command) { - super(type, stepNumber); + super(type, nextStepKey, stepNumber); this.nextKoStepKey = nextKoStepKey; this.titleKey = titleKey; this.titleIconName = titleIconName; diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java index d8d88edd..d6de5184 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java @@ -18,8 +18,8 @@ public class CustomStep extends BasicStep implements ICustomStep{ private String titleIconName; private ArrayList textContentKeys; - public CustomStep(String type, int stepNumber, String titleKey, String titleIconName, ArrayList contentKeys) { - super(type, stepNumber); + public CustomStep(String type, String nextStepKey, int stepNumber, String titleKey, String titleIconName, ArrayList contentKeys) { + super(type, nextStepKey, stepNumber); this.titleKey = titleKey; this.titleIconName = titleIconName; this.textContentKeys = contentKeys; @@ -39,9 +39,4 @@ public class CustomStep extends BasicStep implements ICustomStep{ public ArrayList getTextContentKeys() { return this.textContentKeys; } - - @Override - public String getType() { - return ICustomStep.super.getType(); //To change body of generated methods, choose Tools | Templates. - } } diff --git a/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java index 8fd493ea..dcf1134a 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java @@ -18,8 +18,8 @@ public class ExecutableStep extends BasicStep implements IExecutableStep{ private Command command; private String nextKoStepKey; - public ExecutableStep(String type, int stepNumber, String nextKoStepKey, Command command) { - super(type, stepNumber); + public ExecutableStep(String type, String nextStepKey, int stepNumber, String nextKoStepKey, Command command) { + super(type, nextStepKey, stepNumber); this.command = command; this.nextKoStepKey = nextKoStepKey; } diff --git a/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java index ec9e24dd..387e5858 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java @@ -17,8 +17,9 @@ import java.util.ArrayList; public class LoadStep extends CustomExecutableStep{ private int averageTime; //Used to fill the ProgressIndicator in UI - public LoadStep(String type, int stepNumber, String nextKoStepKey, String titleKey, String titleIconName, ArrayList contentKeys, Command command) { - super(type, stepNumber, nextKoStepKey, titleKey, titleIconName, contentKeys, command); + public LoadStep(String type, String nextStepKey, int stepNumber, String nextKoStepKey, String titleKey, String titleIconName, ArrayList contentKeys, Command command, int averageTime) { + super(type, nextStepKey, stepNumber, nextKoStepKey, titleKey, titleIconName, contentKeys, command); + this.averageTime = averageTime; } /** diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java new file mode 100644 index 00000000..05dd7ea7 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -0,0 +1,126 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.utils; + +import ecorp.easy.installer.models.Command; +import ecorp.easy.installer.models.steps.BasicStep; +import ecorp.easy.installer.models.steps.IStep; +import ecorp.easy.installer.models.steps.LoadStep; +import java.text.ParseException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Class in charge of parsing yaml config file + * into IStep's implementation + * @author vincent Bourgmayer + */ +public class ConfigParser { + private final static Logger logger = LoggerFactory.getLogger(ConfigParser.class); + + /** + * Create a single Step instance from a Map containing yaml content + * @param yaml + * @return + * @throws ParseException + * @throws NumberFormatException + */ + public static IStep parseStep(Map yaml) throws ParseException, NumberFormatException{ + logger.debug("parseStep(yaml)"); + IStep result = null; + + String type = (String) yaml.get("type"); + logger.debug("--step type:"+type); + switch(type){ + case "load": + result = parseLoadStep(yaml, type); + // example: twrp or /e/ installation + break; + case "custom": + result = parseCustomStep(yaml, type); + // Example: enable DevOption, enable ADB, enable MTP + // S9: OEM unlock + // FP3: update phone & oem unlock + // GS290 update stockrom + break; + case "custom-executable": + result = parseExecutableCustomStep(yaml, type); + //Example: reboot from download mode into twrp, etc. + break; + case "executable": + //Example: Device detection + break; + default: + result = parseBasicStep(yaml, type); + break; + } + return result; + } + + /** + * create a basic step from yaml. + * This is perfect to integrate fixed step like deviceDetection + * @param yaml the yaml input + * @param type type of the step + * @return Step object with nextStepKey, stepNumber and type + */ + private static BasicStep parseBasicStep(Map yaml, String type) throws ParseException, NumberFormatException{ + final int stepNumber = (Integer)yaml.get("stepNumber"); + final String nextStepKey = (String) yaml.get("nextStepKey"); + + return new BasicStep(type, nextStepKey, stepNumber); + } + + /** + * Parse yaml content into Command object + * @param yaml Map yaml content + * @return Command object + */ + private static Command parseCommand(Map yaml) throws ParseException, NumberFormatException{ + final String commandBase = (String) yaml.get("script"); + //@TODO: uncomment belows when Command and CommandExecution will be separated + + //final String outputKey = (String) yaml.get("outputKey"); + //final HashMap parameters = (HashMap) yaml.get("parameters"); + //final HashMap okCodes = (HashMap) yaml.get("okCodes"); + //final HashMap koCodes = (HashMap) yaml.get("koCodes"); + + final Command result = new Command(commandBase/*, parameters*/); + //result.setOkCodes(okCodes); + //result.setKoCodes(koCodes); + //if(outputKey != null) result.setOutputKey(outputKey); + + return result; + } + + + /** + * Parse yaml content into LoadStep + * example of this kind of step is /e/ or TWRP installation + * @param yaml yaml content + * @param type Type of step + * @return LoadStep the step + */ + private static LoadStep parseLoadStep(Map yaml, String type) throws ParseException, NumberFormatException{ + final int stepNumber = (Integer)yaml.get("stepNumber"); + final String nextStepKey = (String) yaml.get("succeed"); + final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); + final String titleKey = (String) yaml.get("title"); + final String titleIconName = (String) yaml.get("titleIcon"); + final ArrayList instructions = (ArrayList) yaml.get("instructions"); + final int averageTime = (Integer) yaml.get("averageTime"); + + final Command cmd = parseCommand(yaml); + LoadStep result = new LoadStep(type, nextStepKey, stepNumber , nextKoStepKey, + titleKey, titleIconName, instructions, cmd, averageTime); + return result; + } + + +} -- GitLab From e9fbdd53f362c1d858e7447ff810f62c80c78a75 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 09:52:55 +0200 Subject: [PATCH 08/39] add missing method in config parser --- .../easy/installer/utils/ConfigParser.java | 91 ++++++++++++++++--- 1 file changed, 78 insertions(+), 13 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index 05dd7ea7..cf2d8625 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -7,11 +7,15 @@ package ecorp.easy.installer.utils; import ecorp.easy.installer.models.Command; import ecorp.easy.installer.models.steps.BasicStep; +import ecorp.easy.installer.models.steps.CustomExecutableStep; +import ecorp.easy.installer.models.steps.CustomStep; +import ecorp.easy.installer.models.steps.ExecutableStep; import ecorp.easy.installer.models.steps.IStep; import ecorp.easy.installer.models.steps.LoadStep; import java.text.ParseException; import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,6 +58,7 @@ public class ConfigParser { //Example: reboot from download mode into twrp, etc. break; case "executable": + result = parseExecutableStep(yaml, type); //Example: Device detection break; default: @@ -77,6 +82,68 @@ public class ConfigParser { return new BasicStep(type, nextStepKey, stepNumber); } + + /** + * Parse yaml content into LoadStep + * example of this kind of step is /e/ or TWRP installation + * @param yaml yaml content + * @param type Type of step + * @return LoadStep the step + */ + private static LoadStep parseLoadStep(Map yaml, String type) throws ParseException, NumberFormatException{ + final int stepNumber = (Integer)yaml.get("stepNumber"); + final String nextStepKey = (String) yaml.get("succeed"); + final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); + final String titleKey = (String) yaml.get("title"); + final String titleIconName = (String) yaml.get("titleIcon"); + final ArrayList instructions = (ArrayList) yaml.get("instructions"); + final int averageTime = (Integer) yaml.get("averageTime"); + + final Command cmd = parseCommand(yaml); + LoadStep result = new LoadStep(type, nextStepKey, stepNumber , nextKoStepKey, + titleKey, titleIconName, instructions, cmd, averageTime); + return result; + } + + /** + * Parse yaml content into CustomStep object + * Example of this kind of test is when you tell + * the user to enable developer mode. + * @param yaml Map yaml content + * @param type Type of step + * @return CustomStep object + */ + private static CustomStep parseCustomStep(Map yaml, String type) throws ParseException, NumberFormatException{ + logger.debug("parseCustomStep(yaml)"); + int stepNumber = (Integer)yaml.get("stepNumber"); + String nextStepKey = (String) yaml.get("nextStepKey"); + String titleKey = (String) yaml.get("title"); + String titleIconName = (String) yaml.get("titleIcon"); + ArrayList instructions = (ArrayList) yaml.get("instructions"); + + CustomStep result = new CustomStep(type, nextStepKey, stepNumber, titleKey, titleIconName, instructions); + return result; + } + + /** + * Parse yaml content into ExecutableStep + * example of this kind of step is the step + * to detect device + * @param yaml yaml content + * @param type Type of step + * @return ExecutableStep the step + */ + private static ExecutableStep parseExecutableStep(Map yaml, String type) throws ParseException, NumberFormatException{ + final int stepNumber = (Integer)yaml.get("stepNumber"); + final String nextStepKey = (String) yaml.get("succeed"); + final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); + + final Command cmd = parseCommand(yaml); + ExecutableStep result = new ExecutableStep(type, nextStepKey, stepNumber, + nextKoStepKey, cmd); + return result; + } + /** * Parse yaml content into Command object * @param yaml Map yaml content @@ -98,29 +165,27 @@ public class ConfigParser { return result; } - - /** - * Parse yaml content into LoadStep - * example of this kind of step is /e/ or TWRP installation + /** + * Parse yaml content into ExecutableCustomStep + * example of this kind of step is the step on + * Samsung galaxy device when user must leave + * download mode to start on TWRP * @param yaml yaml content * @param type Type of step - * @return LoadStep the step + * @return ExecutableCustomStep the step */ - private static LoadStep parseLoadStep(Map yaml, String type) throws ParseException, NumberFormatException{ + private static CustomExecutableStep parseExecutableCustomStep(Map yaml, String type) throws ParseException, NumberFormatException{ final int stepNumber = (Integer)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("succeed"); final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); final String titleKey = (String) yaml.get("title"); final String titleIconName = (String) yaml.get("titleIcon"); final ArrayList instructions = (ArrayList) yaml.get("instructions"); - final int averageTime = (Integer) yaml.get("averageTime"); - + final Command cmd = parseCommand(yaml); - LoadStep result = new LoadStep(type, nextStepKey, stepNumber , nextKoStepKey, - titleKey, titleIconName, instructions, cmd, averageTime); + CustomExecutableStep result = new CustomExecutableStep(type, nextStepKey, stepNumber, + nextKoStepKey, titleKey, titleIconName, instructions, cmd); return result; - } - - + } } -- GitLab From 528ac0ba6684f3df143ceb1f29265af79e74fb7b Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 10:32:50 +0200 Subject: [PATCH 09/39] add comment, set some fields final in steps class --- .../models/steps/CustomExecutableStep.java | 10 +++++----- .../easy/installer/models/steps/CustomStep.java | 6 +++--- .../installer/models/steps/ExecutableStep.java | 4 ++-- .../ecorp/easy/installer/models/steps/IStep.java | 14 ++++++++++++-- .../ecorp/easy/installer/utils/ConfigParser.java | 8 ++++---- 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java index a3df005c..bac3a05e 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java @@ -14,11 +14,11 @@ import java.util.ArrayList; */ public class CustomExecutableStep extends BasicStep implements ICustomStep, IExecutableStep{ - private Command command; - private String nextKoStepKey; - private String titleKey; - private String titleIconName; - private ArrayList textContentKeys; + private final Command command; + private final String nextKoStepKey; + private final String titleKey; + private final String titleIconName; + private final ArrayList textContentKeys; public CustomExecutableStep(String type, String nextStepKey, int stepNumber, String nextKoStepKey, String titleKey, String titleIconName, diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java index d6de5184..d5d9631b 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java @@ -14,9 +14,9 @@ import java.util.ArrayList; */ public class CustomStep extends BasicStep implements ICustomStep{ - private String titleKey; - private String titleIconName; - private ArrayList textContentKeys; + private final String titleKey; + private final String titleIconName; + private final ArrayList textContentKeys; public CustomStep(String type, String nextStepKey, int stepNumber, String titleKey, String titleIconName, ArrayList contentKeys) { super(type, nextStepKey, stepNumber); diff --git a/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java index dcf1134a..71ed195b 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java @@ -15,8 +15,8 @@ import ecorp.easy.installer.models.Command; */ public class ExecutableStep extends BasicStep implements IExecutableStep{ - private Command command; - private String nextKoStepKey; + private final Command command; + private final String nextKoStepKey; public ExecutableStep(String type, String nextStepKey, int stepNumber, String nextKoStepKey, Command command) { super(type, nextStepKey, stepNumber); diff --git a/src/main/java/ecorp/easy/installer/models/steps/IStep.java b/src/main/java/ecorp/easy/installer/models/steps/IStep.java index 6214b9c5..0bb84a33 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/IStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/IStep.java @@ -6,8 +6,19 @@ package ecorp.easy.installer.models.steps; /** - * Just a trial * Represent a basic Step type + * + * Below comment also apply for child interface + * + * It doesn't include setter signature because + * without the only place where they could be used + * is in configParser and since we have constructor it's useless + * Moreover, it allow to set most of the implementation field "final" + * + * However, if class current implementation should evolve, it will be + * a pain to update constructor method to handle new field. + * So we could consider, if we feel the need to add those setters + * in interface definition in future. This isn't a closed Topic. * @author vincent */ public interface IStep { @@ -31,5 +42,4 @@ public interface IStep { * @return String */ public String getNextStepKey(); - } diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index cf2d8625..99a5b9c1 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -105,7 +105,7 @@ public class ConfigParser { return result; } - /** + /** * Parse yaml content into CustomStep object * Example of this kind of test is when you tell * the user to enable developer mode. @@ -125,7 +125,7 @@ public class ConfigParser { return result; } - /** + /** * Parse yaml content into ExecutableStep * example of this kind of step is the step * to detect device @@ -144,7 +144,7 @@ public class ConfigParser { return result; } - /** + /** * Parse yaml content into Command object * @param yaml Map yaml content * @return Command object @@ -166,7 +166,7 @@ public class ConfigParser { return result; } - /** + /** * Parse yaml content into ExecutableCustomStep * example of this kind of step is the step on * Samsung galaxy device when user must leave -- GitLab From 0688b068d08c4310742616c34b7abee9e9c95e32 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 10:56:45 +0200 Subject: [PATCH 10/39] add test resources for ConfigParser --- .../easy/installer/utils/ConfigParser.java | 11 +++- src/test/resources/yaml/parsingTest.yml | 64 +++++++++++++++++++ 2 files changed, 72 insertions(+), 3 deletions(-) create mode 100644 src/test/resources/yaml/parsingTest.yml diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index 99a5b9c1..6c86d255 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -23,6 +23,11 @@ import org.slf4j.LoggerFactory; /** * Class in charge of parsing yaml config file * into IStep's implementation + * + * I wonder, if I should make it a singleton... + * This class is perfect candidate for unit test + * however, since its methods are static it might + * cause a problem (I'm thinking of mocking) * @author vincent Bourgmayer */ public class ConfigParser { @@ -31,7 +36,7 @@ public class ConfigParser { /** * Create a single Step instance from a Map containing yaml content * @param yaml - * @return + * @return the IStep implementation's instance * @throws ParseException * @throws NumberFormatException */ @@ -54,7 +59,7 @@ public class ConfigParser { // GS290 update stockrom break; case "custom-executable": - result = parseExecutableCustomStep(yaml, type); + result = parseCustomExecutableStep(yaml, type); //Example: reboot from download mode into twrp, etc. break; case "executable": @@ -175,7 +180,7 @@ public class ConfigParser { * @param type Type of step * @return ExecutableCustomStep the step */ - private static CustomExecutableStep parseExecutableCustomStep(Map yaml, String type) throws ParseException, NumberFormatException{ + private static CustomExecutableStep parseCustomExecutableStep(Map yaml, String type) throws ParseException, NumberFormatException{ final int stepNumber = (Integer)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("succeed"); final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); diff --git a/src/test/resources/yaml/parsingTest.yml b/src/test/resources/yaml/parsingTest.yml new file mode 100644 index 00000000..93eb7f18 --- /dev/null +++ b/src/test/resources/yaml/parsingTest.yml @@ -0,0 +1,64 @@ +## YAML Template. +--- +stepsCount: 2 +steps: + f0: + type: basic + stepNumber: 1 + nextStepKey: f1 + f1: + type: custom + stepNumber: 2 + nextStepKey: f2 + titleKey: test_title_test1 + titleIconName: test.png + instructions: + - test_lbl_test1 + - test_lbl_test2 + - test_lbl_test3 + f3: + type: executable + stepNumber: 3 + nextStepKey: f4 + script: test + outputKey: myTestVar + nextKoStepKey: ~ + okCodes: + 0: test_lbl_cmdSuccess + koCodes: + 1: test_lbl_cmdFailure + f4: + type: custom-executable + stepNumber: 3 + nextStepKey: f4 + titleKey: test_title_test1 + titleIconName: test.png + instructions: + - test_lbl_test1 + - test_lbl_test2 + - test_lbl_test3 + script: test + outputKey: myTestVar + nextKoStepKey: ~ + okCodes: + 0: test_lbl_cmdSuccess + koCodes: + 1: test_lbl_cmdFailure + f5: + type: load + stepNumber: 3 + nextStepKey: f5 + titleKey: test_title_test1 + titleIconName: test.png + instructions: + - test_lbl_test1 + - test_lbl_test2 + - test_lbl_test3 + script: test + outputKey: myTestVar + nextKoStepKey: ~ + okCodes: + 0: test_lbl_cmdSuccess + koCodes: + 1: test_lbl_cmdFailure + averageTime: 25 \ No newline at end of file -- GitLab From 1c0557f7a767a90ec7d7328c60b00781877be1b3 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 12:02:57 +0200 Subject: [PATCH 11/39] add unit test for ConfigParser and fixed issue thanks to them --- .../easy/installer/utils/ConfigParser.java | 30 ++-- .../installer/utils/ConfigParserTest.java | 156 ++++++++++++++++++ 2 files changed, 171 insertions(+), 15 deletions(-) create mode 100644 src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index 6c86d255..0047f543 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -40,7 +40,7 @@ public class ConfigParser { * @throws ParseException * @throws NumberFormatException */ - public static IStep parseStep(Map yaml) throws ParseException, NumberFormatException{ + public static IStep parseStep(Map yaml) throws ParseException, NumberFormatException, NullPointerException{ logger.debug("parseStep(yaml)"); IStep result = null; @@ -80,8 +80,8 @@ public class ConfigParser { * @param type type of the step * @return Step object with nextStepKey, stepNumber and type */ - private static BasicStep parseBasicStep(Map yaml, String type) throws ParseException, NumberFormatException{ - final int stepNumber = (Integer)yaml.get("stepNumber"); + private static BasicStep parseBasicStep(Map yaml, String type) throws ParseException, ClassCastException{ + final int stepNumber = (int) yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("nextStepKey"); return new BasicStep(type, nextStepKey, stepNumber); @@ -95,14 +95,14 @@ public class ConfigParser { * @param type Type of step * @return LoadStep the step */ - private static LoadStep parseLoadStep(Map yaml, String type) throws ParseException, NumberFormatException{ - final int stepNumber = (Integer)yaml.get("stepNumber"); + private static LoadStep parseLoadStep(Map yaml, String type) throws ParseException, ClassCastException{ + final int stepNumber = (int)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("succeed"); final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); final String titleKey = (String) yaml.get("title"); final String titleIconName = (String) yaml.get("titleIcon"); final ArrayList instructions = (ArrayList) yaml.get("instructions"); - final int averageTime = (Integer) yaml.get("averageTime"); + final int averageTime = (int) yaml.get("averageTime"); final Command cmd = parseCommand(yaml); LoadStep result = new LoadStep(type, nextStepKey, stepNumber , nextKoStepKey, @@ -118,9 +118,9 @@ public class ConfigParser { * @param type Type of step * @return CustomStep object */ - private static CustomStep parseCustomStep(Map yaml, String type) throws ParseException, NumberFormatException{ + private static CustomStep parseCustomStep(Map yaml, String type) throws ParseException, ClassCastException{ logger.debug("parseCustomStep(yaml)"); - int stepNumber = (Integer)yaml.get("stepNumber"); + int stepNumber = (int)yaml.get("stepNumber"); String nextStepKey = (String) yaml.get("nextStepKey"); String titleKey = (String) yaml.get("title"); String titleIconName = (String) yaml.get("titleIcon"); @@ -138,8 +138,8 @@ public class ConfigParser { * @param type Type of step * @return ExecutableStep the step */ - private static ExecutableStep parseExecutableStep(Map yaml, String type) throws ParseException, NumberFormatException{ - final int stepNumber = (Integer)yaml.get("stepNumber"); + private static ExecutableStep parseExecutableStep(Map yaml, String type) throws ParseException, ClassCastException{ + final int stepNumber = (int)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("succeed"); final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); @@ -154,14 +154,14 @@ public class ConfigParser { * @param yaml Map yaml content * @return Command object */ - private static Command parseCommand(Map yaml) throws ParseException, NumberFormatException{ + private static Command parseCommand(Map yaml) throws ParseException, ClassCastException{ final String commandBase = (String) yaml.get("script"); //@TODO: uncomment belows when Command and CommandExecution will be separated //final String outputKey = (String) yaml.get("outputKey"); //final HashMap parameters = (HashMap) yaml.get("parameters"); - //final HashMap okCodes = (HashMap) yaml.get("okCodes"); - //final HashMap koCodes = (HashMap) yaml.get("koCodes"); + //final HashMap okCodes = (HashMap) yaml.get("okCodes"); + //final HashMap koCodes = (HashMap) yaml.get("koCodes"); final Command result = new Command(commandBase/*, parameters*/); //result.setOkCodes(okCodes); @@ -180,8 +180,8 @@ public class ConfigParser { * @param type Type of step * @return ExecutableCustomStep the step */ - private static CustomExecutableStep parseCustomExecutableStep(Map yaml, String type) throws ParseException, NumberFormatException{ - final int stepNumber = (Integer)yaml.get("stepNumber"); + private static CustomExecutableStep parseCustomExecutableStep(Map yaml, String type) throws ParseException, ClassCastException{ + final int stepNumber = (int)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("succeed"); final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); final String titleKey = (String) yaml.get("title"); diff --git a/src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java b/src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java new file mode 100644 index 00000000..13684ec8 --- /dev/null +++ b/src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java @@ -0,0 +1,156 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package ecorp.easy.installer.utils; + +import ecorp.easy.installer.models.steps.IStep; +import java.text.ParseException; +import java.util.HashMap; +import java.util.Map; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; +import static org.junit.Assert.*; + +/** + * What to test: Mainly parsing result + * Try to use invalid type. By example: + * Trying to parse data as String instead of int + * + * Question: Do I need to parse a real config file + * or can I just create Map instance with data ? + * @author vincent Bourgmayer + */ +public class ConfigParserTest { + + public ConfigParserTest() { + } + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + @Before + public void setUp() { + } + + @After + public void tearDown() { + } + + /** + * Test of parseStep method, of class ConfigParser. + */ + @Test + public void testParseStepWithNullYaml() throws Exception { + System.out.println("testParseStepWithNullYaml"); + Map yaml = null; + IStep result = null; + try{ + result = ConfigParser.parseStep(yaml); + }catch(Exception e){ + assertEquals("Exception isn't the one expected", NullPointerException.class, e.getClass()); + } + assertNull("No Step should be returned", result); + } + + /** + * Assert that parsing fail and return expected Exception in case of invalid + * data type + */ + @Test + public void testParseStepWithInvalidDataType() throws Exception { + System.out.println("testParseStepWithInvalidDataType"); + IStep result = null; + + Map yaml = new HashMap<>(); + yaml.put("type", "basic"); + yaml.put("nextStepKey", "f1"); + yaml.put("stepNumber", "10"); + + try{ + result = ConfigParser.parseStep(yaml); + }catch(Exception e){ + assertEquals("#1 ClassCastException was expected but got "+e.getClass().getSimpleName(), ClassCastException.class, e.getClass()); + } + + assertNull("No Step should be returned", result); + + System.out.println("parseStep"); + yaml = new HashMap<>(); + yaml.put("type", "basic"); + yaml.put("nextStepKey", 5); + yaml.put("stepNumber", 1); + + try{ + result = ConfigParser.parseStep(yaml); + }catch(Exception e){ + assertEquals("#2 ClassCastException was expected but got "+e.getClass().getSimpleName(), ClassCastException.class, e.getClass()); + } + assertNull("No Step should be returned", result); + } + + @Test + public void testParseStepWithMissingIntData() throws Exception { + System.out.println("testParseStepWithMissingIntData"); + IStep result = null; + + Map yaml = new HashMap<>(); + yaml.put("type", "basic"); + yaml.put("nextStepKey", "f1"); + + try{ + result = ConfigParser.parseStep(yaml); + }catch(Exception e){ + assertEquals("NullPointerException was expected but got "+e.getClass().getSimpleName(), NullPointerException.class, e.getClass()); + } + + assertNull("No Step should be returned", result); + } + + @Test + public void testParseStepWithMissingStringData() throws Exception { + System.out.println("testParseStepWithMissingIntData"); + IStep result = null; + + Map yaml = new HashMap<>(); + yaml.put("type", "basic"); + yaml.put("stepNumber", 1); + + try{ + result = ConfigParser.parseStep(yaml); + }catch(Exception e){ + fail("No Exception expected"); + } + + assertNotNull(" Step should be returned", result); + assertNull("IStep.getNextStepKey() should return null", result.getNextStepKey()); + } + + @Test + public void testParseStepWithMissingStepType() throws Exception { + System.out.println("testParseStepWithMissingIntData"); + IStep result = null; + + Map yaml = new HashMap<>(); + yaml.put("stepNumber", 1); + yaml.put("nextStepKey", "f1"); + + try{ + result = ConfigParser.parseStep(yaml); + }catch(Exception e){ + assertEquals("NullPointerException was expected but got "+e.getClass().getSimpleName(), NullPointerException.class, e.getClass()); + } + + assertNull(" Step should be null", result); + } +} -- GitLab From 4dd586e9c0b3e3768fef2818b79b792a6be3dc38 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 15:23:09 +0200 Subject: [PATCH 12/39] add Teracube new config file. Remove 'nextKoStepKey' feature because useless at the moment --- .../models/steps/CustomExecutableStep.java | 6 +- .../models/steps/ExecutableStep.java | 9 +- .../models/steps/IExecutableStep.java | 7 -- .../easy/installer/models/steps/LoadStep.java | 4 +- .../easy/installer/utils/ConfigParser.java | 10 +- src/main/resources/yaml/Teracube_2e_new.yml | 114 ++++++++++++++++++ src/test/resources/yaml/parsingTest.yml | 3 - 7 files changed, 121 insertions(+), 32 deletions(-) create mode 100644 src/main/resources/yaml/Teracube_2e_new.yml diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java index bac3a05e..310e5a25 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java @@ -15,16 +15,14 @@ import java.util.ArrayList; public class CustomExecutableStep extends BasicStep implements ICustomStep, IExecutableStep{ private final Command command; - private final String nextKoStepKey; private final String titleKey; private final String titleIconName; private final ArrayList textContentKeys; public CustomExecutableStep(String type, String nextStepKey, int stepNumber, - String nextKoStepKey, String titleKey, String titleIconName, + String titleKey, String titleIconName, ArrayList contentKeys, Command command) { super(type, nextStepKey, stepNumber); - this.nextKoStepKey = nextKoStepKey; this.titleKey = titleKey; this.titleIconName = titleIconName; this.command = command; @@ -48,6 +46,4 @@ public class CustomExecutableStep extends BasicStep implements ICustomStep, IExe @Override public Command getCommand() { return this.command; } - @Override - public String getNextKoStepKey() { return this.nextKoStepKey; } } diff --git a/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java index 71ed195b..3af6ef71 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java @@ -16,21 +16,14 @@ import ecorp.easy.installer.models.Command; public class ExecutableStep extends BasicStep implements IExecutableStep{ private final Command command; - private final String nextKoStepKey; - public ExecutableStep(String type, String nextStepKey, int stepNumber, String nextKoStepKey, Command command) { + public ExecutableStep(String type, String nextStepKey, int stepNumber, Command command) { super(type, nextStepKey, stepNumber); this.command = command; - this.nextKoStepKey = nextKoStepKey; } @Override public Command getCommand() { return command; } - - @Override - public String getNextKoStepKey() { - return this.nextKoStepKey; - } } diff --git a/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java index 4644fcdb..6d026547 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java @@ -22,11 +22,4 @@ public interface IExecutableStep extends IStep{ * @return Command instance */ public Command getCommand(); - - /** - * Return the key of the next step to - * run in case of failure of the command - * @return - */ - public String getNextKoStepKey(); } diff --git a/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java index 387e5858..64f4ca6a 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java @@ -17,8 +17,8 @@ import java.util.ArrayList; public class LoadStep extends CustomExecutableStep{ private int averageTime; //Used to fill the ProgressIndicator in UI - public LoadStep(String type, String nextStepKey, int stepNumber, String nextKoStepKey, String titleKey, String titleIconName, ArrayList contentKeys, Command command, int averageTime) { - super(type, nextStepKey, stepNumber, nextKoStepKey, titleKey, titleIconName, contentKeys, command); + public LoadStep(String type, String nextStepKey, int stepNumber, String titleKey, String titleIconName, ArrayList contentKeys, Command command, int averageTime) { + super(type, nextStepKey, stepNumber, titleKey, titleIconName, contentKeys, command); this.averageTime = averageTime; } diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index 0047f543..915a9403 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -98,14 +98,13 @@ public class ConfigParser { private static LoadStep parseLoadStep(Map yaml, String type) throws ParseException, ClassCastException{ final int stepNumber = (int)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("succeed"); - final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); final String titleKey = (String) yaml.get("title"); final String titleIconName = (String) yaml.get("titleIcon"); final ArrayList instructions = (ArrayList) yaml.get("instructions"); final int averageTime = (int) yaml.get("averageTime"); final Command cmd = parseCommand(yaml); - LoadStep result = new LoadStep(type, nextStepKey, stepNumber , nextKoStepKey, + LoadStep result = new LoadStep(type, nextStepKey, stepNumber , titleKey, titleIconName, instructions, cmd, averageTime); return result; } @@ -141,11 +140,9 @@ public class ConfigParser { private static ExecutableStep parseExecutableStep(Map yaml, String type) throws ParseException, ClassCastException{ final int stepNumber = (int)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("succeed"); - final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); final Command cmd = parseCommand(yaml); - ExecutableStep result = new ExecutableStep(type, nextStepKey, stepNumber, - nextKoStepKey, cmd); + ExecutableStep result = new ExecutableStep(type, nextStepKey, stepNumber, cmd); return result; } @@ -183,14 +180,13 @@ public class ConfigParser { private static CustomExecutableStep parseCustomExecutableStep(Map yaml, String type) throws ParseException, ClassCastException{ final int stepNumber = (int)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("succeed"); - final String nextKoStepKey = (String) yaml.get("nextKoStepKey"); final String titleKey = (String) yaml.get("title"); final String titleIconName = (String) yaml.get("titleIcon"); final ArrayList instructions = (ArrayList) yaml.get("instructions"); final Command cmd = parseCommand(yaml); CustomExecutableStep result = new CustomExecutableStep(type, nextStepKey, stepNumber, - nextKoStepKey, titleKey, titleIconName, instructions, cmd); + titleKey, titleIconName, instructions, cmd); return result; } } diff --git a/src/main/resources/yaml/Teracube_2e_new.yml b/src/main/resources/yaml/Teracube_2e_new.yml new file mode 100644 index 00000000..5eabadff --- /dev/null +++ b/src/main/resources/yaml/Teracube_2e_new.yml @@ -0,0 +1,114 @@ +## YAML Template. +--- +stepsCount: 6 +steps: + f0: + type: custom + stepNumber: 1 + nextStepKey: f1 + titleKey: stepTitle_enableOemUnlock + titleIconName: icon-download.png + instructions: + - install_instr_openSettings + - install_instr_searchOEM + - install_instr_enableOEMUnlocking + - install_instr_acceptOEMUnlockWarning + - install_instr_onceDoneThenContinue + f1: + type: load + stepNumber: 2 + nextStepKey: f2 + titleKey: stepTitle_rebootBootloader + titleIconName: ~ + instructions: + - install_instr_rebootingOnBootloader + averageTime: 12 + script: reboot-fastboot + parameters: + device_id: ${DEVICE_ID} + fastboot_folder_path: ${ADB_FOLDER_PATH} + outputKey: ~ + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_cantRebootBootloader + 101: script_error_deviceID_missing + 102: script_error_fastbootPath_missing + f2: + type: custom-executable + stepNumber: 3 + nextStepKey: f3 + titleKey: stepTitle_oemUnlock + titleIconName: icon-download.png + instructions: + - install_instr_pressVolUpToAcceptOEMUnlocking + - install_instr_waitInstallStartAuto + script: gs290-flashingUnlock + parameters: + device_id: ${DEVICE_ID} + fastboot_folder_path: ${ADB_FOLDER_PATH} + outputKey: ~ + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 2: script_error_flashingUnlockFailed + 101: script_error_deviceID_missing + 102: script_error_fastbootPath_missing + f3: + type: load + stepNumber: 4 + nextStepKey: f4 + titleKey: stepTitle_installOS + titleIconName: ~ + instructions: + - install_instr_eosInstall + averageTime: 200 + script: Teracube_2e-install-from-bootloader + parameters: + device_id: ${DEVICE_ID} + archive_path: ${ARCHIVE_PATH} + fastboot_folder_path: ${ADB_FOLDER_PATH} + java_folder_path: ${JAVA_FOLDER_PATH} + outputKey: ~ + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_cantUnpackSources + 11: script_error_cantWipeData + 12: script_error_cantFlashBoot + 13: script_error_cantFlashRecovery + 14: script_error_cantFlashVbmeta + 15: script_error_cantFlashVbmeta_system + 16: script_error_cantFlashVBmeta_vendor + 17: script_error_cantRebootToFastboot + 18: script_error_cantFlashSystem + 19: script_error_cantFlashproduct + 20: script_error_cantFlashVendor + 101: script_error_deviceID_missing + 102: script_error_installFromFastboot_102 + 103: script_error_fastbootPath_missing + f4: + type: askAccount + stepNumber: 5 + nextStepKey: f5 + f5: + type: custom-executable + stepNumber: 6 + nextStepKey: ~ + titleKey: stepTitle_rebootDevice + titleIconName: icon-download.png + instructions: + - install_instr_onceDeviceRebootThenContinue + script: gs290-wait-reboot-from-fastboot + parameters: + fastboot_folder_path: ${ADB_FOLDER_PATH} + outputKey: ~ + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_cantrebootFromFasboot + 101: script_error_noDeviceFoundInFastboot \ No newline at end of file diff --git a/src/test/resources/yaml/parsingTest.yml b/src/test/resources/yaml/parsingTest.yml index 93eb7f18..f45c22a1 100644 --- a/src/test/resources/yaml/parsingTest.yml +++ b/src/test/resources/yaml/parsingTest.yml @@ -22,7 +22,6 @@ steps: nextStepKey: f4 script: test outputKey: myTestVar - nextKoStepKey: ~ okCodes: 0: test_lbl_cmdSuccess koCodes: @@ -39,7 +38,6 @@ steps: - test_lbl_test3 script: test outputKey: myTestVar - nextKoStepKey: ~ okCodes: 0: test_lbl_cmdSuccess koCodes: @@ -56,7 +54,6 @@ steps: - test_lbl_test3 script: test outputKey: myTestVar - nextKoStepKey: ~ okCodes: 0: test_lbl_cmdSuccess koCodes: -- GitLab From 14afafb9c35746002c4e1bc69dff7808d937c7e0 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 15:36:32 +0200 Subject: [PATCH 13/39] add licence header to new class and resources --- .../installer/models/steps/BasicStep.java | 17 +++++++-- .../models/steps/CustomExecutableStep.java | 19 +++++++--- .../installer/models/steps/CustomStep.java | 17 +++++++-- .../models/steps/ExecutableStep.java | 17 +++++++-- .../installer/models/steps/ICustomStep.java | 17 +++++++-- .../models/steps/IExecutableStep.java | 17 +++++++-- .../easy/installer/models/steps/IStep.java | 19 +++++++--- .../easy/installer/models/steps/LoadStep.java | 17 +++++++-- .../easy/installer/utils/ConfigParser.java | 35 ++++++++++++------- src/main/resources/yaml/Teracube_2e_new.yml | 16 ++++++++- .../installer/utils/ConfigParserTest.java | 17 +++++++-- src/test/resources/yaml/parsingTest.yml | 16 ++++++++- 12 files changed, 181 insertions(+), 43 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java b/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java index dbaf6768..8bb8f03a 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.models.steps; diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java index 310e5a25..896317b3 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.models.steps; @@ -10,7 +21,7 @@ import java.util.ArrayList; /** * - * @author vincent + * @author vincent Bourgmayer */ public class CustomExecutableStep extends BasicStep implements ICustomStep, IExecutableStep{ diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java index d5d9631b..ee9f0fcd 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.models.steps; diff --git a/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java index 3af6ef71..b036f0ba 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.models.steps; diff --git a/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java b/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java index 69b53a48..acfc10df 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.models.steps; diff --git a/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java index 6d026547..aa50d188 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.models.steps; diff --git a/src/main/java/ecorp/easy/installer/models/steps/IStep.java b/src/main/java/ecorp/easy/installer/models/steps/IStep.java index 0bb84a33..61dc449f 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/IStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/IStep.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.models.steps; @@ -19,7 +30,7 @@ package ecorp.easy.installer.models.steps; * a pain to update constructor method to handle new field. * So we could consider, if we feel the need to add those setters * in interface definition in future. This isn't a closed Topic. - * @author vincent + * @author vincent Bourgmayer */ public interface IStep { public final static String LAST_STEP_KEY = "L"; //When a next step key has this value, it means that this is the last step of the process diff --git a/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java index 64f4ca6a..15cd3113 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.models.steps; diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index 915a9403..39e8c1b2 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.utils; @@ -97,9 +108,9 @@ public class ConfigParser { */ private static LoadStep parseLoadStep(Map yaml, String type) throws ParseException, ClassCastException{ final int stepNumber = (int)yaml.get("stepNumber"); - final String nextStepKey = (String) yaml.get("succeed"); - final String titleKey = (String) yaml.get("title"); - final String titleIconName = (String) yaml.get("titleIcon"); + final String nextStepKey = (String) yaml.get("nextStepKey"); + final String titleKey = (String) yaml.get("titleKey"); + final String titleIconName = (String) yaml.get("titleIconName"); final ArrayList instructions = (ArrayList) yaml.get("instructions"); final int averageTime = (int) yaml.get("averageTime"); @@ -121,8 +132,8 @@ public class ConfigParser { logger.debug("parseCustomStep(yaml)"); int stepNumber = (int)yaml.get("stepNumber"); String nextStepKey = (String) yaml.get("nextStepKey"); - String titleKey = (String) yaml.get("title"); - String titleIconName = (String) yaml.get("titleIcon"); + String titleKey = (String) yaml.get("titleKey"); + String titleIconName = (String) yaml.get("titleIconName"); ArrayList instructions = (ArrayList) yaml.get("instructions"); CustomStep result = new CustomStep(type, nextStepKey, stepNumber, titleKey, titleIconName, instructions); @@ -139,7 +150,7 @@ public class ConfigParser { */ private static ExecutableStep parseExecutableStep(Map yaml, String type) throws ParseException, ClassCastException{ final int stepNumber = (int)yaml.get("stepNumber"); - final String nextStepKey = (String) yaml.get("succeed"); + final String nextStepKey = (String) yaml.get("nextStepKey"); final Command cmd = parseCommand(yaml); ExecutableStep result = new ExecutableStep(type, nextStepKey, stepNumber, cmd); @@ -179,9 +190,9 @@ public class ConfigParser { */ private static CustomExecutableStep parseCustomExecutableStep(Map yaml, String type) throws ParseException, ClassCastException{ final int stepNumber = (int)yaml.get("stepNumber"); - final String nextStepKey = (String) yaml.get("succeed"); - final String titleKey = (String) yaml.get("title"); - final String titleIconName = (String) yaml.get("titleIcon"); + final String nextStepKey = (String) yaml.get("nextStepKey"); + final String titleKey = (String) yaml.get("titleKey"); + final String titleIconName = (String) yaml.get("titleIconName"); final ArrayList instructions = (ArrayList) yaml.get("instructions"); final Command cmd = parseCommand(yaml); diff --git a/src/main/resources/yaml/Teracube_2e_new.yml b/src/main/resources/yaml/Teracube_2e_new.yml index 5eabadff..a816489d 100644 --- a/src/main/resources/yaml/Teracube_2e_new.yml +++ b/src/main/resources/yaml/Teracube_2e_new.yml @@ -1,4 +1,18 @@ -## YAML Template. +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer --- stepsCount: 6 steps: diff --git a/src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java b/src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java index 13684ec8..e7bc4000 100644 --- a/src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java +++ b/src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java @@ -1,7 +1,18 @@ /* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. + * Copyright 2021 - ECORP SAS + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ package ecorp.easy.installer.utils; diff --git a/src/test/resources/yaml/parsingTest.yml b/src/test/resources/yaml/parsingTest.yml index f45c22a1..3990e614 100644 --- a/src/test/resources/yaml/parsingTest.yml +++ b/src/test/resources/yaml/parsingTest.yml @@ -1,4 +1,18 @@ -## YAML Template. +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer --- stepsCount: 2 steps: -- GitLab From 47fa34af204aa99fda9af1e312d361062a9267e6 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 16:11:45 +0200 Subject: [PATCH 14/39] add te new config file for FP3 --- src/main/resources/yaml/FP3_new.yml | 126 ++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 src/main/resources/yaml/FP3_new.yml diff --git a/src/main/resources/yaml/FP3_new.yml b/src/main/resources/yaml/FP3_new.yml new file mode 100644 index 00000000..3d0ff7d4 --- /dev/null +++ b/src/main/resources/yaml/FP3_new.yml @@ -0,0 +1,126 @@ +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer +--- +stepsCount: 7 +steps: + f0: + type: enableOemUnlock + stepNumber: 1 + nextStepKey: f1 + f1: + type: custom-executable + stepNumber: 2 + nextStepKey: f2 + titleKey: stepTitle_StartInFastbootFP3 + titleIcon: icon-download.png + instructions: + - install_instr_turnOff + - install_instr_startFastboot + - install_instr_waitFastbootmodeDetected + script: wait-fastboot + parameters: + fastboot_folder_path: ${ADB_FOLDER_PATH} + outputKey: ~ + codes: + ok: + 0: ~ + ko: + 1: script_error_waitFastboot_1 + f2: + type: load + stepNumber: 3 + nextStepKey: f3 + titleKey: stepTitle2On7 + instructions: + - install_instr_oemUnlock + averageTime: 12 + script: fp3_oem-unlock + parameters: + fastboot_folder_path: ${ADB_FOLDER_PATH} + outputKey: ~ + codes: + ok: + 0: ~ + ko: + 10: script_error_oemUnlock_10 + f3: + type: custom-executable + stepNumber: 4 + nextStepKey: f4 + titleKey: stepTitle3On7FP3 + titleIconName: icon-download.png + instructions: + - install_instr_readAllWarning + - install_instr_selectUnlockBootloader + - install_instr_unlockBootloader + - install_instr_bootWarning + - install_instr_startFastbootFromOptions + - install_instr_ifYouMissedTimeout + script: wait-fastboot-unlocked + parameters: + fastboot_folder_path: ${ADB_FOLDER_PATH} + outputKey: ~ + codes: + ok: + 0: ~ + ko: + 1: script_error_waitFastboot_1 + f4: + type: load + stepNumber: 5 + nextStepKey: f5 + titleKey: stepTitle6On7 + instructions: + - install_instr_eosInstall + averageTime: 200 + script: fp3_install-from-fastboot + parameters: + archive_path: ${ARCHIVE_PATH} + fastboot_folder_path: ${ADB_FOLDER_PATH} + java_folder_path: ${JAVA_FOLDER_PATH} + outputKey: ~ + codes: + ok: + 0: ~ + ko: + 1: script_error_installFromFastboot_1 + 2: script_error_installFromFastboot_2 + 3: script_error_installFromFastboot_3 + 101: script_error_installFromFastboot_101 + 102: script_error_installFromFastboot_102 + f5: + type: askAccount + stepNumber: 6 + nextStepKey: f6 + f6: + type: custom-executable + stepNumber: 7 + nextStepKey: ~ + titleKey: ~ + titleIconName: icon-download.png + instruction: + - install_instr_selectLockBootloader + - install_instr_lockBootloader + script: wait-reboot-from-fastboot + parameters: + fastboot_folder_path: ${ADB_FOLDER_PATH} + outputKey: ~ + codes: + ok: + 0: ~ + ko: + 1: script_error_unknown + 101: script_error_waitRebootFromFastboot_101 -- GitLab From 4efe6ca335570e044cf3fc83d4d57958d1a4eaef Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 16:21:37 +0200 Subject: [PATCH 15/39] add default values for some missing datas in config file --- .../ecorp/easy/installer/utils/ConfigParser.java | 13 +++++-------- src/main/resources/yaml/FP3_new.yml | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index 39e8c1b2..e383b792 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -25,8 +25,6 @@ import ecorp.easy.installer.models.steps.IStep; import ecorp.easy.installer.models.steps.LoadStep; import java.text.ParseException; import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -110,8 +108,8 @@ public class ConfigParser { final int stepNumber = (int)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("nextStepKey"); final String titleKey = (String) yaml.get("titleKey"); - final String titleIconName = (String) yaml.get("titleIconName"); - final ArrayList instructions = (ArrayList) yaml.get("instructions"); + final String titleIconName = (String) yaml.getOrDefault("titleIconName", ""); + final ArrayList instructions = (ArrayList) yaml.getOrDefault("instructions", new ArrayList()); final int averageTime = (int) yaml.get("averageTime"); final Command cmd = parseCommand(yaml); @@ -134,7 +132,7 @@ public class ConfigParser { String nextStepKey = (String) yaml.get("nextStepKey"); String titleKey = (String) yaml.get("titleKey"); String titleIconName = (String) yaml.get("titleIconName"); - ArrayList instructions = (ArrayList) yaml.get("instructions"); + ArrayList instructions = (ArrayList) yaml.getOrDefault("instructions", new ArrayList()); CustomStep result = new CustomStep(type, nextStepKey, stepNumber, titleKey, titleIconName, instructions); return result; @@ -151,7 +149,6 @@ public class ConfigParser { private static ExecutableStep parseExecutableStep(Map yaml, String type) throws ParseException, ClassCastException{ final int stepNumber = (int)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("nextStepKey"); - final Command cmd = parseCommand(yaml); ExecutableStep result = new ExecutableStep(type, nextStepKey, stepNumber, cmd); return result; @@ -192,8 +189,8 @@ public class ConfigParser { final int stepNumber = (int)yaml.get("stepNumber"); final String nextStepKey = (String) yaml.get("nextStepKey"); final String titleKey = (String) yaml.get("titleKey"); - final String titleIconName = (String) yaml.get("titleIconName"); - final ArrayList instructions = (ArrayList) yaml.get("instructions"); + final String titleIconName = (String) yaml.getOrDefault("titleIconName", ""); + final ArrayList instructions = (ArrayList) yaml.getOrDefault("instructions", new ArrayList()); final Command cmd = parseCommand(yaml); CustomExecutableStep result = new CustomExecutableStep(type, nextStepKey, stepNumber, diff --git a/src/main/resources/yaml/FP3_new.yml b/src/main/resources/yaml/FP3_new.yml index 3d0ff7d4..c4fe5270 100644 --- a/src/main/resources/yaml/FP3_new.yml +++ b/src/main/resources/yaml/FP3_new.yml @@ -123,4 +123,4 @@ steps: 0: ~ ko: 1: script_error_unknown - 101: script_error_waitRebootFromFastboot_101 + 101: script_error_waitRebootFromFastboot_101 \ No newline at end of file -- GitLab From 36c7ac1ae9ab63661d7f1c20cebefd1fbfb4559b Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 16:32:42 +0200 Subject: [PATCH 16/39] add comment, and add some getOrDdefault() in ConfigParser --- .../java/ecorp/easy/installer/models/steps/IStep.java | 2 +- .../java/ecorp/easy/installer/utils/ConfigParser.java | 10 ++++++++++ src/main/resources/yaml/FP3_new.yml | 2 +- src/main/resources/yaml/Teracube_2e_new.yml | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/models/steps/IStep.java b/src/main/java/ecorp/easy/installer/models/steps/IStep.java index 61dc449f..21bdd651 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/IStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/IStep.java @@ -33,7 +33,7 @@ package ecorp.easy.installer.models.steps; * @author vincent Bourgmayer */ public interface IStep { - public final static String LAST_STEP_KEY = "L"; //When a next step key has this value, it means that this is the last step of the process + public final static String LAST_STEP_KEY = "end"; //When a next step key has this value, it means that this is the last step of the process /** * Get the type of the step diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index e383b792..489c4a05 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -82,6 +82,16 @@ public class ConfigParser { return result; } + /* NOTE for BELOW METHODS: + * Using yaml.getOrDefault(key, defaultValue) + * does only protect from missing value in yaml + * it doesn't protect from a value willingly setted + * to null + */ + + + + /** * create a basic step from yaml. * This is perfect to integrate fixed step like deviceDetection diff --git a/src/main/resources/yaml/FP3_new.yml b/src/main/resources/yaml/FP3_new.yml index c4fe5270..63286d74 100644 --- a/src/main/resources/yaml/FP3_new.yml +++ b/src/main/resources/yaml/FP3_new.yml @@ -108,7 +108,7 @@ steps: f6: type: custom-executable stepNumber: 7 - nextStepKey: ~ + nextStepKey: end titleKey: ~ titleIconName: icon-download.png instruction: diff --git a/src/main/resources/yaml/Teracube_2e_new.yml b/src/main/resources/yaml/Teracube_2e_new.yml index a816489d..a0c599d3 100644 --- a/src/main/resources/yaml/Teracube_2e_new.yml +++ b/src/main/resources/yaml/Teracube_2e_new.yml @@ -111,7 +111,7 @@ steps: f5: type: custom-executable stepNumber: 6 - nextStepKey: ~ + nextStepKey: end titleKey: stepTitle_rebootDevice titleIconName: icon-download.png instructions: -- GitLab From 239fbf8287f016df58ada1fdd31baf623da8e5c7 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 16:57:24 +0200 Subject: [PATCH 17/39] update FlashThread to use the new steps package --- .../easy/installer/threads/FlashThread.java | 95 +++++++++++-------- 1 file changed, 57 insertions(+), 38 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/threads/FlashThread.java b/src/main/java/ecorp/easy/installer/threads/FlashThread.java index a736abd1..6b0053af 100644 --- a/src/main/java/ecorp/easy/installer/threads/FlashThread.java +++ b/src/main/java/ecorp/easy/installer/threads/FlashThread.java @@ -20,6 +20,10 @@ import ecorp.easy.installer.models.Phone; import ecorp.easy.installer.models.Command; import ecorp.easy.installer.models.DataBundle; import ecorp.easy.installer.models.StepUi; +import ecorp.easy.installer.models.steps.ICustomStep; +import ecorp.easy.installer.models.steps.IExecutableStep; +import ecorp.easy.installer.models.steps.IStep; +import ecorp.easy.installer.models.steps.LoadStep; import ecorp.easy.installer.utils.IFlashHandler; import javafx.application.Platform; import java.util.HashMap; @@ -43,7 +47,7 @@ public class FlashThread extends Thread { final Phone device; protected final Map commonParameters; // this is parameters that are define by a script output and that can be use as parameter by another script - protected final Map commands; + protected final Map steps; protected String currentStepCode = ""; protected final String firstCommandKey; @@ -55,7 +59,7 @@ public class FlashThread extends Thread { * @param device Object containing device info */ public FlashThread(IFlashHandler controller, String firstCommandKey, Object pauseLock, Phone device){ - this.commands = new HashMap<>(); + this.steps = new HashMap<>(); this.commonParameters = new HashMap<>(); this.firstCommandKey = firstCommandKey; //this is the key of the command's hashmap this.application = controller; @@ -77,11 +81,11 @@ public class FlashThread extends Thread { /** * Add a command associated to a specific key * @param key must unique or the value associated with will be replaced by new one - * @param command Command to add + * @param step IStep step to add */ - public void addCommand(String key, Command command){ - if(command != null && key!= null) - commands.put(key, command); + public void addCommand(String key, IStep step){ + if(step != null && key!= null) + steps.put(key, step); } /** @@ -140,33 +144,47 @@ public class FlashThread extends Thread { * Execute some code before to execute the current command * It is runned in the While loop which loops over commands * It's executed in a Try catch. - * @throws java.lang.Exception + * @throws java.lang.ClassCastException */ - protected void doBeforeToRunCommand() throws Exception{ + protected void doBeforeToRunCommand() throws ClassCastException{ //Update UI - final Command cmd = commands.get(currentStepCode); + final IStep step = steps.get(currentStepCode); final DataBundle bundle = new DataBundle(); //Prepare datas for UI - final String stepType = cmd.getNewUIValues().getType(); + final String stepType = step.getType(); bundle.putString("stepType", stepType); - - if( stepType.equals(AppConstants.USER_ACTION_KEY) || stepType.equals(AppConstants.LOAD_KEY)){ - //UpdateUI - final StepUi newUIValues = (StepUi) cmd.getNewUIValues(); - if(newUIValues != null) { - //@todo: Must define bundle key as a static String at a single place. - if(stepType.equals(AppConstants.USER_ACTION_KEY)){ - bundle.putString("titleIconName", newUIValues.getTitleIconName()); - }else{ - bundle.putInteger("averageTime", newUIValues.getAverageTime()); - } - bundle.putString("stepTitle", newUIValues.getTitle()); - bundle.putList("stepInstructions", String.class.getSimpleName(), newUIValues.getInstructions()); - bundle.putBoolean("hasScript", cmd.hasScript()); - } + final boolean hasScript; + switch(stepType){ + case "custom": + bundle.putString("titleIconName", ((ICustomStep) step).getTitleIconName()); + bundle.putString("stepTitle", ((ICustomStep) step).getTitleKey()); + bundle.putList("stepInstructions", String.class.getSimpleName(), ((ICustomStep) step).getTextContentKeys()); + hasScript = false; + + break; + case "custom-executable": + bundle.putString("titleIconName", ((ICustomStep) step).getTitleIconName()); + bundle.putString("stepTitle", ((ICustomStep) step).getTitleKey()); + bundle.putList("stepInstructions", String.class.getSimpleName(), ((ICustomStep) step).getTextContentKeys()); + hasScript= true; + break; + case "executable": + hasScript= true; + break; + case "load": + hasScript= true; + bundle.putString("stepTitle", ((ICustomStep) step).getTitleKey()); + bundle.putList("stepInstructions", String.class.getSimpleName(), ((ICustomStep) step).getTextContentKeys()); + bundle.putString("titleIconName", ((ICustomStep) step).getTitleIconName()); + bundle.putInteger("averageTime", ((LoadStep) step).getAverageTime()); + break; + default: + hasScript = false; + break; } + bundle.putBoolean("hasScript", hasScript); //Update UI Platform.runLater(()->{ application.onStepStart(bundle); @@ -190,25 +208,26 @@ public class FlashThread extends Thread { */ @Override public void run(){ - if(commands.isEmpty()) return; + if(steps.isEmpty()) return; try{ //execute scripts String nextCommandKey = firstCommandKey; - while(nextCommandKey != null ){ + while(nextCommandKey != null && nextCommandKey != IStep.LAST_STEP_KEY){ currentStepCode = nextCommandKey; - final Command cmd = commands.get(nextCommandKey); - final String stepType = cmd.getNewUIValues().getType(); + final IStep step = steps.get(nextCommandKey); + final String stepType = step.getType(); //UpdateUI doBeforeToRunCommand(); - if( cmd.hasScript() && - ( stepType.equals(AppConstants.USER_ACTION_KEY) || - stepType.equals(AppConstants.LOAD_KEY) ) ) + if(stepType.equals("executable") + || stepType.equals("load") + || stepType.equals("custom-executable")) { - - updateParameters(); + Command cmd = ((IExecutableStep) step).getCommand(); + updateParameters(cmd); + logger.debug("Run(), Command = "+cmd.getCommand()); cmd.execAndReadOutput(); handleResult(cmd); @@ -218,7 +237,7 @@ public class FlashThread extends Thread { synchronized(pauseLock){ pauseLock.wait(); } } - nextCommandKey = cmd.getNextCommandKey(); + nextCommandKey = step.getNextStepKey(); } }catch(Exception e){ @@ -233,16 +252,16 @@ public class FlashThread extends Thread { * @return */ public int getCommandsSize(){ - return this.commands.size(); + return this.steps.size(); } /** * Update parameters of the current command * It is called before to execute the command + * @param cmd */ - protected void updateParameters(){ - final Command cmd = commands.get(currentStepCode); + protected void updateParameters(final Command cmd){ //Update Parameters if(cmd.getParameters() != null){ //@TODO: remove functionnal and rewrite it as it was before with simple loop. cmd.getParameters().entrySet().stream().filter((param) -> (param.getValue().contains("$"))).forEachOrdered((param) -> { -- GitLab From f6ea092fe2d244c712991c6a41fde0334763d507 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 17:01:17 +0200 Subject: [PATCH 18/39] marl Step.java as depecrated and update ProcessMould.java to use IStep instead of Step --- .../java/ecorp/easy/installer/models/ProcessMould.java | 9 +++++---- src/main/java/ecorp/easy/installer/models/Step.java | 1 + .../java/ecorp/easy/installer/threads/ThreadFactory.java | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/models/ProcessMould.java b/src/main/java/ecorp/easy/installer/models/ProcessMould.java index 0ce98087..c6f76414 100644 --- a/src/main/java/ecorp/easy/installer/models/ProcessMould.java +++ b/src/main/java/ecorp/easy/installer/models/ProcessMould.java @@ -16,6 +16,7 @@ */ package ecorp.easy.installer.models; +import ecorp.easy.installer.models.steps.IStep; import java.util.HashMap; import java.util.Map; @@ -27,7 +28,7 @@ import java.util.Map; public class ProcessMould { String modelName; - Map steps; + Map steps; /** * Constructor of ProcessMould @@ -44,7 +45,7 @@ public class ProcessMould { * @param key * @param step */ - public void addStep(String key, Step step){ + public void addStep(String key, IStep step){ this.steps.put(key, step); } @@ -60,7 +61,7 @@ public class ProcessMould { * Get the list of steps in this processMould * @return */ - public Map getSteps() { + public Map getSteps() { return steps; } @@ -68,7 +69,7 @@ public class ProcessMould { * Replace current steps by the new one * @param steps the new steps */ - public void setSteps(Map steps) { + public void setSteps(Map steps) { this.steps = steps; } } diff --git a/src/main/java/ecorp/easy/installer/models/Step.java b/src/main/java/ecorp/easy/installer/models/Step.java index 2c798335..4014c0fe 100644 --- a/src/main/java/ecorp/easy/installer/models/Step.java +++ b/src/main/java/ecorp/easy/installer/models/Step.java @@ -20,6 +20,7 @@ import java.util.Map; /** * This class encapsulate data about a step in the flashing process * @author Vincent Bourgmayer + * @deprecated */ public class Step { private StepUi ui; //Datas about user interface diff --git a/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java b/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java index fed051d9..af73d0b3 100644 --- a/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java +++ b/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java @@ -77,7 +77,7 @@ public class ThreadFactory { */ private boolean loadYAMLFile(){ logger.info("loadYAMLFile()"); - final String modelName = device.getAdbDevice(); //Do not use device.getModel as it doesn't return the expected value + final String modelName = device.getAdbDevice(); if(modelName == null || modelName.isEmpty()){ return false; } -- GitLab From d5cd3fc48e09ba8db09c361492a873468b585d55 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 17:59:30 +0200 Subject: [PATCH 19/39] fix FlashThread and ThreadFactory and ProcessMould to use IStep --- .../easy/installer/models/ProcessMould.java | 2 +- .../easy/installer/threads/FlashThread.java | 2 +- .../easy/installer/threads/ThreadFactory.java | 87 +++++-------------- 3 files changed, 24 insertions(+), 67 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/models/ProcessMould.java b/src/main/java/ecorp/easy/installer/models/ProcessMould.java index c6f76414..73d79316 100644 --- a/src/main/java/ecorp/easy/installer/models/ProcessMould.java +++ b/src/main/java/ecorp/easy/installer/models/ProcessMould.java @@ -46,7 +46,7 @@ public class ProcessMould { * @param step */ public void addStep(String key, IStep step){ - this.steps.put(key, step); + this.steps.put(key, step); } /** diff --git a/src/main/java/ecorp/easy/installer/threads/FlashThread.java b/src/main/java/ecorp/easy/installer/threads/FlashThread.java index 6b0053af..7e445457 100644 --- a/src/main/java/ecorp/easy/installer/threads/FlashThread.java +++ b/src/main/java/ecorp/easy/installer/threads/FlashThread.java @@ -83,7 +83,7 @@ public class FlashThread extends Thread { * @param key must unique or the value associated with will be replaced by new one * @param step IStep step to add */ - public void addCommand(String key, IStep step){ + public void addStep(String key, IStep step){ if(step != null && key!= null) steps.put(key, step); } diff --git a/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java b/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java index af73d0b3..e681c555 100644 --- a/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java +++ b/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java @@ -21,10 +21,13 @@ import ecorp.easy.installer.models.Command; import ecorp.easy.installer.models.Phone; import ecorp.easy.installer.models.ProcessMould; import ecorp.easy.installer.models.Step; +import ecorp.easy.installer.models.steps.IStep; +import ecorp.easy.installer.utils.ConfigParser; import ecorp.easy.installer.utils.IFlashHandler; import java.io.IOException; import java.io.InputStream; import java.security.InvalidParameterException; +import java.text.ParseException; import java.util.LinkedHashMap; //used instead of HashMap to conserve order import java.util.List; import java.util.Map; @@ -86,7 +89,7 @@ public class ThreadFactory { Yaml yaml = new Yaml (); //load config file - InputStream is = getClass().getResourceAsStream(yamlFolderPath+modelName+".yml"); + InputStream is = getClass().getResourceAsStream(yamlFolderPath+modelName+"_new.yml"); Map yamlContent= (Map)yaml.load(is); is.close(); if(yamlContent == null || yamlContent.isEmpty() ) { @@ -96,7 +99,7 @@ public class ThreadFactory { flashMould = new ProcessMould(modelName); - loadFlashProcess((Map) yamlContent.get("flash")); + loadFlashProcess((Map) yamlContent.get("steps")); //Load config file specific to user interface //DO NOT USE classLoader() to load resource! @@ -109,8 +112,7 @@ public class ThreadFactory { logger.error("Parsed extra datas (UI, sources) from yaml file are empty or null"); return false; } - - loadFlashExtra((Map) yamlContent.get("flash")); + loadSourcesToDownload((Map) yamlContent.get("sources")); }catch(IOException e){ @@ -128,72 +130,26 @@ public class ThreadFactory { logger.info("loadFlashProcess( ... ) "); Set keys = steps.keySet(); - - for(String key: keys){ + try{ + + for(String key: keys){ logger.debug("Key = "+key); Map stepData = (Map) steps.get(key); //Content load from YAML file - Step step = new Step(); //Object to build - - //1. Does the step contain a script ? - if(stepData.get("script") != null){ - step.setScript(stepData.get("script")+( AppConstants.isWindowsOs() ? ".bat" : ".sh" ) ); - - //Fill the result codes fields - Map codes = (Map) stepData.get("codes"); - if(codes != null){ - step.setOkCode ( (Map) codes.get("ok") ); - step.setKoCode ( (Map) codes.get("ko") ); - } - - //Fill the parameters field - step.setParameters ((LinkedHashMap) stepData.get("parameters") ); - - //Fill the output to read - this is the name of a variable - //to create and store in CommonParams for use in another step - step.setOutput ((String) stepData.get("output") ); - }else{ //This is for step without script to run - step.setScript(null); - } - //Fill the step's key of the next step in case of success or failure - step.setAfterSuccess ((String) stepData.get("succeed") ); - step.setAfterFail ((String) stepData.get("failed") ); - + IStep step = ConfigParser.parseStep(stepData); //Object to build + //Integrate the step in the process flashMould.addStep(key, step); } - } - - /** - * Load extra element for Flash process (sources to dl and UI definition) - * @TODO: make entries's key a final static to be store only at one place - * @param steps Map Loaded from YAML - */ - protected void loadFlashExtra( Map steps){ - logger.info("loadFlashExtra(...)"); - - for(String key : (Set) steps.keySet() ){ - Map subObj = (Map) steps.get(key); - if(subObj == null) continue; - - StepUi stepUI = null; - - Map uiProperties = (Map) subObj.get("ui"); - if(uiProperties != null){ - String type = (String) uiProperties.get("type"); - List instructions = (List) uiProperties.get("instruction"); - String title = (String) uiProperties.get("title"); - String titleIconName= (String)uiProperties.get("titleIcon"); - String stepNumber = (String)uiProperties.get("stepNumber"); - Integer averageTime = (Integer) uiProperties.get("averageTime"); - stepUI = new StepUi(type, instructions, title, titleIconName, stepNumber, averageTime != null ? averageTime:-1); - } - - Step step = flashMould.getSteps().get(key); - if(step != null){ - step.setUI(stepUI ); - } + + }catch(ClassCastException e){ + logger.debug("ClassCast Exception <-> Invalid Yaml: {}", e.getMessage()); + e.printStackTrace(); + }catch(ParseException e){ + logger.debug("ParseException <-> Invalid Yaml: {}", e.getMessage()); + e.printStackTrace(); } } + /** * Load Preparation steps from yaml @@ -231,11 +187,12 @@ public class ThreadFactory { if(flashMould == null || flashMould.getSteps() == null || device == null) return null; - FlashThread result = new FlashThread(application, "f1", pauseLock, device); + FlashThread result = new FlashThread(application, "f0", pauseLock, device); flashMould.getSteps().entrySet().forEach((entry) -> { - result.addCommand(entry.getKey(), new Command(AppConstants.getScriptsFolderPath(), new Step( entry.getValue() ) ) ); + //@TODO replace the entry.getValue() by a copy by value + result.addStep(entry.getKey(), entry.getValue() ); }); return result; } -- GitLab From e683884ca0fbe942c166004e245584102a02355c Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 18:14:33 +0200 Subject: [PATCH 20/39] integrate steps usage for FlashSceneController --- .../subcontrollers/FlashSceneController.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java index ea4470ab..43142bbc 100644 --- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java +++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java @@ -173,11 +173,15 @@ public class FlashSceneController extends AbstractSubSteppedController implement logger.debug("Title: "+title); //Get Type of step ("action" or "load") - switch(db.getString("stepType")){ - case AppConstants.USER_ACTION_KEY: + final String stepType = db.getString("stepType"); + + switch (stepType) { + case AppConstants.USER_ACTION_KEY: //@deprecated + case "custom": + case "custom-executable": instructionsContainer.setOpacity(0.0); updateInstructions(title, db.getList("stepInstructions", "String") ); - displayActionStepType(db); + displayActionStepType(db); UiUtils.buildFadeTransition(instructionsContainer, false).play(); break; case AppConstants.LOAD_KEY: -- GitLab From 7f2836cc2a0b0f64a5e1726a31e76685b2d215e0 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Tue, 21 Sep 2021 18:22:57 +0200 Subject: [PATCH 21/39] remove old config file for FP3 & t2e and remove old datas in _fs.yml for those two devices --- src/main/resources/yaml/FP3.yml | 99 ------------------- src/main/resources/yaml/FP3_fs.yml | 57 +---------- src/main/resources/yaml/Teracube_2e.yml | 107 --------------------- src/main/resources/yaml/Teracube_2e_fs.yml | 49 ---------- 4 files changed, 1 insertion(+), 311 deletions(-) delete mode 100644 src/main/resources/yaml/FP3.yml delete mode 100644 src/main/resources/yaml/Teracube_2e.yml diff --git a/src/main/resources/yaml/FP3.yml b/src/main/resources/yaml/FP3.yml deleted file mode 100644 index 2a36c2ea..00000000 --- a/src/main/resources/yaml/FP3.yml +++ /dev/null @@ -1,99 +0,0 @@ -## Copyright 2019-2020 - ECORP SAS - -## This program is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program. If not, see . -## Author: Vincent Bourgmayer ---- -name: FP3 -flash: - f1: - script: enableOemUnlock - parameters: ~ - codes: ~ - output: ~ - succeed: f2 - failed: ~ - f2: - script: wait-fastboot - parameters: - fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitFastboot_1 - output: ~ - succeed: f3 - failed: ~ - f3: - script: fp3_oem-unlock - parameters: - fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 10: script_error_oemUnlock_10 - output: ~ - succeed: f4 - failed: ~ - f4: - script: wait-fastboot-unlocked - parameters: - fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitFastboot_1 - output: ~ - succeed: f5 - failed: ~ - f5: - script: fp3_install-from-fastboot - parameters: - archive_path: ${ARCHIVE_PATH} - fastboot_folder_path: ${ADB_FOLDER_PATH} - java_folder_path: ${JAVA_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromFastboot_1 - 2: script_error_installFromFastboot_2 - 3: script_error_installFromFastboot_3 - 101: script_error_installFromFastboot_101 - 102: script_error_installFromFastboot_102 - output: ~ - succeed: f6 - failed: ~ - f6: - script: askAccount - parameters: ~ - codes: ~ - output: ~ - succeed: f7 - failed: ~ - f7: - script: wait-reboot-from-fastboot - parameters: - fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 101: script_error_waitRebootFromFastboot_101 - output: ~ - succeed: ~ - failed: ~ \ No newline at end of file diff --git a/src/main/resources/yaml/FP3_fs.yml b/src/main/resources/yaml/FP3_fs.yml index ba9890b6..88ca6731 100644 --- a/src/main/resources/yaml/FP3_fs.yml +++ b/src/main/resources/yaml/FP3_fs.yml @@ -17,59 +17,4 @@ sources: rom: url: https://images.ecloud.global/stable/FP3/IMG-e-latest-FP3.zip - filePath: IMG-e-latest-FP3.zip -flash: - f1: - ui: - type: enableOemUnlock - f2: - ui: - type: action - title: stepTitle_StartInFastbootFP3 - instruction: - - install_instr_turnOff - - install_instr_startFastboot - - install_instr_waitFastbootmodeDetected - stepNumber: 1/5 - titleIcon: icon-download.png - f3: - ui: - type: load - title: stepTitle2On7 - instruction: - - install_instr_oemUnlock - stepNumber: 2/5 - averageTime: 12 - f4: - ui: - type: action - title: stepTitle3On7FP3 - instruction: - - install_instr_readAllWarning - - install_instr_selectUnlockBootloader - - install_instr_unlockBootloader - - install_instr_bootWarning - - install_instr_startFastbootFromOptions - - install_instr_ifYouMissedTimeout - stepNumber: 3/5 - titleIcon: icon-download.png - f5: - ui: - type: load - title: stepTitle6On7 - instruction: - - install_instr_eosInstall - stepNumber: 4/5 - averageTime: 200 - f6: - ui: - type: askAccount - f7: - ui: - type: action - title: - instruction: - - install_instr_selectLockBootloader - - install_instr_lockBootloader - stepNumber: 5/5 - titleIcon: icon-download.png + filePath: IMG-e-latest-FP3.zip \ No newline at end of file diff --git a/src/main/resources/yaml/Teracube_2e.yml b/src/main/resources/yaml/Teracube_2e.yml deleted file mode 100644 index d5f71fa7..00000000 --- a/src/main/resources/yaml/Teracube_2e.yml +++ /dev/null @@ -1,107 +0,0 @@ -## Copyright 2019-2020 - ECORP SAS - -## This program is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program. If not, see . -## Author: Vincent Bourgmayer ---- -name: Teracube_2e -flash: - f1: - script: ~ - parameters: ~ - codes: ~ - output: ~ - succeed: f2 - failed: ~ - f2: - script: reboot-fastboot - parameters: - device_id: ${DEVICE_ID} - fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_cantRebootBootloader - 101: script_error_deviceID_missing - 102: script_error_fastbootPath_missing - output: ~ - succeed: f3 - failed: ~ - f3: - script: gs290-flashingUnlock - parameters: - device_id: ${DEVICE_ID} - fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 2: script_error_flashingUnlockFailed - 101: script_error_deviceID_missing - 102: script_error_fastbootPath_missing - output: ~ - succeed: f4 - failed: ~ - f4: - script: Teracube_2e-install-from-bootloader - parameters: - device_id: ${DEVICE_ID} - archive_path: ${ARCHIVE_PATH} - fastboot_folder_path: ${ADB_FOLDER_PATH} - java_folder_path: ${JAVA_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_cantUnpackSources - 11: script_error_cantWipeData - 12: script_error_cantFlashBoot - 13: script_error_cantFlashRecovery - 14: script_error_cantFlashVbmeta - 15: script_error_cantFlashVbmeta_system - 16: script_error_cantFlashVBmeta_vendor - 17: script_error_cantRebootToFastboot - 18: script_error_cantFlashSystem - 19: script_error_cantFlashproduct - 20: script_error_cantFlashVendor - 101: script_error_deviceID_missing - 102: script_error_installFromFastboot_102 - 103: script_error_fastbootPath_missing - output: ~ - succeed: f5 - failed: ~ - f5: - script: askAccount - parameters: ~ - codes: ~ - output: ~ - succeed: f6 - failed: ~ - f6: - script: gs290-wait-reboot-from-fastboot - parameters: - fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_cantrebootFromFasboot - 101: script_error_noDeviceFoundInFastboot - output: ~ - succeed: ~ - failed: ~ \ No newline at end of file diff --git a/src/main/resources/yaml/Teracube_2e_fs.yml b/src/main/resources/yaml/Teracube_2e_fs.yml index b8c6ae3b..41f90507 100644 --- a/src/main/resources/yaml/Teracube_2e_fs.yml +++ b/src/main/resources/yaml/Teracube_2e_fs.yml @@ -18,52 +18,3 @@ sources: rom: url: https://images.ecloud.global/stable/2e/IMG-e-latest-2e.zip filePath: IMG-e-latest-2e.zip -flash: - f1: - ui: - type: action - title: stepTitle_enableOemUnlock - instruction: - - install_instr_openSettings - - install_instr_searchOEM - - install_instr_enableOEMUnlocking - - install_instr_acceptOEMUnlockWarning - - install_instr_onceDoneThenContinue - stepNumber: 1/5 - titleIcon: icon-download.png - f2: - ui: - type: load - title: stepTitle_rebootBootloader - instruction: - - install_instr_rebootingOnBootloader - stepNumber: 2/5 - averageTime: 12 - f3: - ui: - type: action - title: stepTitle_oemUnlock - instruction: - - install_instr_pressVolUpToAcceptOEMUnlocking - - install_instr_waitInstallStartAuto - stepNumber: 3/5 - titleIcon: icon-download.png - f4: - ui: - type: load - title: stepTitle_installOS - instruction: - - install_instr_eosInstall - stepNumber: 4/5 - averageTime: 200 - f5: - ui: - type: askAccount - f6: - ui: - type: action - title: stepTitle_rebootDevice - instruction: - - install_instr_onceDeviceRebootThenContinue - stepNumber: 5/5 - titleIcon: icon-download.png -- GitLab From 4dcc0e89ae8fcef3fabca7586d4c66fd8634f770 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 10:22:54 +0200 Subject: [PATCH 22/39] fix parseCommand() in configParser --- .../easy/installer/utils/ConfigParser.java | 30 +++++++----- src/main/resources/yaml/GS290_new.yml | 46 +++++++++++++++++++ 2 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 src/main/resources/yaml/GS290_new.yml diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index 489c4a05..20402833 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -16,7 +16,9 @@ */ package ecorp.easy.installer.utils; +import ecorp.easy.installer.AppConstants; import ecorp.easy.installer.models.Command; +import ecorp.easy.installer.models.Step; import ecorp.easy.installer.models.steps.BasicStep; import ecorp.easy.installer.models.steps.CustomExecutableStep; import ecorp.easy.installer.models.steps.CustomStep; @@ -25,6 +27,8 @@ import ecorp.easy.installer.models.steps.IStep; import ecorp.easy.installer.models.steps.LoadStep; import java.text.ParseException; import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -166,23 +170,25 @@ public class ConfigParser { /** * Parse yaml content into Command object + * @TODO rewrite when splitting command between data and job * @param yaml Map yaml content * @return Command object */ private static Command parseCommand(Map yaml) throws ParseException, ClassCastException{ - final String commandBase = (String) yaml.get("script"); - //@TODO: uncomment belows when Command and CommandExecution will be separated - - //final String outputKey = (String) yaml.get("outputKey"); - //final HashMap parameters = (HashMap) yaml.get("parameters"); - //final HashMap okCodes = (HashMap) yaml.get("okCodes"); - //final HashMap koCodes = (HashMap) yaml.get("koCodes"); - - final Command result = new Command(commandBase/*, parameters*/); - //result.setOkCodes(okCodes); - //result.setKoCodes(koCodes); - //if(outputKey != null) result.setOutputKey(outputKey); + final String commandBase = (String) yaml.get("script")+( AppConstants.isWindowsOs() ? ".bat" : ".sh" ) ; + + final String outputKey = (String) yaml.getOrDefault("outputKey", null); + final LinkedHashMap parameters = (LinkedHashMap) yaml.get("parameters"); + final HashMap okCodes = (HashMap) yaml.getOrDefault("okCodes", null); + final HashMap koCodes = (HashMap) yaml.getOrDefault("koCodes", null); + final Step cmdStep = new Step(); + cmdStep.setOutput(outputKey); + cmdStep.setKoCode(koCodes); + cmdStep.setOkCode(okCodes); + cmdStep.setParameters(parameters); + cmdStep.setScript(commandBase); + final Command result = new Command(AppConstants.getScriptsFolderPath(), cmdStep); return result; } diff --git a/src/main/resources/yaml/GS290_new.yml b/src/main/resources/yaml/GS290_new.yml new file mode 100644 index 00000000..5012c680 --- /dev/null +++ b/src/main/resources/yaml/GS290_new.yml @@ -0,0 +1,46 @@ +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer +--- +stepsCount: 7 +steps: + f0: + type: + stepNumber: 1 + nextStepKey: f1 + f1: + type: + stepNumber: 2 + nextStepKey: f2 + f2: + type: + stepNumber: 3 + nextStepKey: f3 + f3: + type: + stepNumber: 4 + nextStepKey: f4 + f4: + type: + stepNumber: 5 + nextStepKey: f5 + f5: + type: askAccount + stepNumber: 6 + nextStepKey: f6 + f6: + type: + stepNumber: 7 + nextStepKey: end \ No newline at end of file -- GitLab From ee9caf8ebf5cf400e5d35cb8ee83ed0cedabd166 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 10:43:12 +0200 Subject: [PATCH 23/39] fix device detection to use new config file --- .../controllers/subcontrollers/DeviceDetectedController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java index 44eb6a0a..e789a8f6 100644 --- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java +++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java @@ -110,7 +110,7 @@ public class DeviceDetectedController extends AbstractSubController{ if(model == null || model.isEmpty()) displayUnknowDeviceFound(); else{ //check that there is config file for this device - URL resourceUrl = getClass().getResource("/yaml/"+phone.getAdbDevice()+".yml"); + URL resourceUrl = getClass().getResource("/yaml/"+phone.getAdbDevice()+"_new.yml"); if(resourceUrl == null){ //@TODO: this can be replaced or completed with a call to DeviceHelper displayIncompatibleDeviceFound(model); -- GitLab From a4b34be01e24fdce2e974e798f5fd151418e73c0 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 14:31:14 +0200 Subject: [PATCH 24/39] increase averageTime for t2e's load step --- src/main/resources/yaml/Teracube_2e_new.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/yaml/Teracube_2e_new.yml b/src/main/resources/yaml/Teracube_2e_new.yml index a0c599d3..e26e1b28 100644 --- a/src/main/resources/yaml/Teracube_2e_new.yml +++ b/src/main/resources/yaml/Teracube_2e_new.yml @@ -36,7 +36,7 @@ steps: titleIconName: ~ instructions: - install_instr_rebootingOnBootloader - averageTime: 12 + averageTime: 15 script: reboot-fastboot parameters: device_id: ${DEVICE_ID} @@ -78,7 +78,7 @@ steps: titleIconName: ~ instructions: - install_instr_eosInstall - averageTime: 200 + averageTime: 215 script: Teracube_2e-install-from-bootloader parameters: device_id: ${DEVICE_ID} -- GitLab From d69abaa117d7a20816782384c7731f3803ef2b20 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 14:32:07 +0200 Subject: [PATCH 25/39] change logged info in FlashThread and config parser --- src/main/java/ecorp/easy/installer/threads/FlashThread.java | 5 ++++- src/main/java/ecorp/easy/installer/utils/ConfigParser.java | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/threads/FlashThread.java b/src/main/java/ecorp/easy/installer/threads/FlashThread.java index 7e445457..e16b4ed6 100644 --- a/src/main/java/ecorp/easy/installer/threads/FlashThread.java +++ b/src/main/java/ecorp/easy/installer/threads/FlashThread.java @@ -84,6 +84,7 @@ public class FlashThread extends Thread { * @param step IStep step to add */ public void addStep(String key, IStep step){ + logger.debug("FlashThread.addStep({}, ...)", key); if(step != null && key!= null) steps.put(key, step); } @@ -150,10 +151,12 @@ public class FlashThread extends Thread { //Update UI final IStep step = steps.get(currentStepCode); final DataBundle bundle = new DataBundle(); - + logger.debug("doBeforeToRunCommand(), currentStepCode: {}", currentStepCode); //Prepare datas for UI final String stepType = step.getType(); bundle.putString("stepType", stepType); + logger.debug("--stepType: {}", stepType); + final boolean hasScript; switch(stepType){ case "custom": diff --git a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java index 20402833..9eecebbb 100644 --- a/src/main/java/ecorp/easy/installer/utils/ConfigParser.java +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -54,7 +54,6 @@ public class ConfigParser { * @throws NumberFormatException */ public static IStep parseStep(Map yaml) throws ParseException, NumberFormatException, NullPointerException{ - logger.debug("parseStep(yaml)"); IStep result = null; String type = (String) yaml.get("type"); @@ -207,7 +206,6 @@ public class ConfigParser { final String titleKey = (String) yaml.get("titleKey"); final String titleIconName = (String) yaml.getOrDefault("titleIconName", ""); final ArrayList instructions = (ArrayList) yaml.getOrDefault("instructions", new ArrayList()); - final Command cmd = parseCommand(yaml); CustomExecutableStep result = new CustomExecutableStep(type, nextStepKey, stepNumber, titleKey, titleIconName, instructions, cmd); -- GitLab From 616e3c9fa61241cb0982c0fb7e3ead8225c0f034 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 14:32:44 +0200 Subject: [PATCH 26/39] fix issue due to ICustomStep.getType() --- .../easy/installer/models/steps/CustomExecutableStep.java | 2 +- .../java/ecorp/easy/installer/models/steps/ICustomStep.java | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java index 896317b3..13692a2e 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java @@ -42,7 +42,7 @@ public class CustomExecutableStep extends BasicStep implements ICustomStep, IExe @Override public String getType(){ - return ICustomStep.super.getType(); + return super.getType(); } @Override diff --git a/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java b/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java index acfc10df..05dbd41d 100644 --- a/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java +++ b/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java @@ -48,9 +48,5 @@ public interface ICustomStep extends IStep{ * @return ArrayList le list of keys */ public ArrayList getTextContentKeys(); - - @Override - default String getType(){ - return "action"; - } + } -- GitLab From 02ec2f6e85219001843148bf64d5ab7d94f1af9b Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 14:33:17 +0200 Subject: [PATCH 27/39] update logged info for FlashSceneController --- .../controllers/subcontrollers/FlashSceneController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java index 43142bbc..0e855e1d 100644 --- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java +++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java @@ -156,7 +156,6 @@ public class FlashSceneController extends AbstractSubSteppedController implement @Override public void onStepStart(DataBundle db) { logger.info("onStepStart()"); - logger.debug(" DataBundle = {}", db.toString()); if(db == null)return; //close the timer of a loadStepType @@ -170,11 +169,11 @@ public class FlashSceneController extends AbstractSubSteppedController implement //Update instruction title final String title = db.getString("stepTitle"); - logger.debug("Title: "+title); + logger.debug("--Title {}", title); //Get Type of step ("action" or "load") final String stepType = db.getString("stepType"); - + logger.debug("--Type: {}", stepType); switch (stepType) { case AppConstants.USER_ACTION_KEY: //@deprecated case "custom": -- GitLab From b4e3a9a767003e76a2f0ff6bd73ab4a79b13b2a4 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 14:59:26 +0200 Subject: [PATCH 28/39] update config file for FP3 & 2e. Add GS290 new config file and template for dreamlte --- src/main/resources/yaml/FP3_new.yml | 5 - src/main/resources/yaml/GS290.yml | 84 +--------------- src/main/resources/yaml/GS290_fs.yml | 64 +------------ src/main/resources/yaml/GS290_new.yml | 100 ++++++++++++++++++-- src/main/resources/yaml/Teracube_2e_new.yml | 4 - src/main/resources/yaml/dreamlte_new.yml | 50 ++++++++++ 6 files changed, 147 insertions(+), 160 deletions(-) create mode 100644 src/main/resources/yaml/dreamlte_new.yml diff --git a/src/main/resources/yaml/FP3_new.yml b/src/main/resources/yaml/FP3_new.yml index 63286d74..db73a76e 100644 --- a/src/main/resources/yaml/FP3_new.yml +++ b/src/main/resources/yaml/FP3_new.yml @@ -33,7 +33,6 @@ steps: script: wait-fastboot parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - outputKey: ~ codes: ok: 0: ~ @@ -50,7 +49,6 @@ steps: script: fp3_oem-unlock parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - outputKey: ~ codes: ok: 0: ~ @@ -72,7 +70,6 @@ steps: script: wait-fastboot-unlocked parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - outputKey: ~ codes: ok: 0: ~ @@ -91,7 +88,6 @@ steps: archive_path: ${ARCHIVE_PATH} fastboot_folder_path: ${ADB_FOLDER_PATH} java_folder_path: ${JAVA_FOLDER_PATH} - outputKey: ~ codes: ok: 0: ~ @@ -117,7 +113,6 @@ steps: script: wait-reboot-from-fastboot parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - outputKey: ~ codes: ok: 0: ~ diff --git a/src/main/resources/yaml/GS290.yml b/src/main/resources/yaml/GS290.yml index 9817806a..2d7b8cd6 100644 --- a/src/main/resources/yaml/GS290.yml +++ b/src/main/resources/yaml/GS290.yml @@ -16,92 +16,14 @@ --- name: GS290 flash: - f1: - script: ~ - parameters: ~ - codes: ~ - output: ~ - succeed: f2 - failed: ~ - f2: - script: ~ - parameters: ~ - codes: ~ - output: ~ - succeed: f3 - failed: ~ - f3: - script: reboot-fastboot - parameters: - device_id: ${DEVICE_ID} - fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_cantRebootBootloader - 101: script_error_deviceID_missing - 102: script_error_fastbootPath_missing - output: ~ - succeed: f4 - failed: ~ - f4: - script: gs290-flashingUnlock - parameters: - device_id: ${DEVICE_ID} - fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 2: script_error_flashingUnlockFailed - 101: script_error_deviceID_missing - 102: script_error_fastbootPath_missing - output: ~ - succeed: f5 - failed: ~ - f5: - script: gs290-install-from-bootloader - parameters: - device_id: ${DEVICE_ID} - archive_path: ${ARCHIVE_PATH} - fastboot_folder_path: ${ADB_FOLDER_PATH} - java_folder_path: ${JAVA_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_cantUnpackSources - 11: script_error_cantWipeData - 12: script_error_cantFlashBoot - 13: script_error_cantFlashRecovery - 14: script_error_cantFlashsystem - 15: script_error_cantFlashLk - 16: script_error_cantFlashLogo - 101: script_error_deviceID_missing - 102: script_error_installFromFastboot_102 - 103: script_error_fastbootPath_missing - output: ~ - succeed: f6 - failed: ~ - f6: - script: askAccount - parameters: ~ - codes: ~ - output: ~ - succeed: f7 - failed: ~ + f7: script: gs290-wait-reboot-from-fastboot parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: + okCodes: 0: ~ - ko: + koCodes: 1: script_error_unknown 10: script_error_cantrebootFromFasboot 101: script_error_noDeviceFoundInFastboot diff --git a/src/main/resources/yaml/GS290_fs.yml b/src/main/resources/yaml/GS290_fs.yml index c0e2c7f9..ecb849f0 100644 --- a/src/main/resources/yaml/GS290_fs.yml +++ b/src/main/resources/yaml/GS290_fs.yml @@ -1,4 +1,4 @@ -## Copyright 2019-2020 - ECORP SAS +## Copyright 2019-2021 - ECORP SAS ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -30,65 +30,3 @@ sources: recovery: url: https://images.ecloud.global/stable/GS290/recovery-e-latest-GS290.img filePath: recovery-e-latest-GS290.img -flash: - f1: - ui: - type: action - title: stepTitle_checkDeviceUptodate - instruction: - - install_instr_connectTowifi - - install_instr_GS290_accessSystemSettings - - install_instr_GS290_accessSystemUpdate - - install_instr_update_stockrom - - install_instr_continueIfDeviceUpToDate - stepNumber: 1/6 - titleIcon: icon-download.png - f2: - ui: - type: action - title: stepTitle_enableOemUnlock - instruction: - - install_instr_openSettings - - install_instr_searchOEM - - install_instr_enableOEMUnlocking - - install_instr_acceptOEMUnlockWarning - - install_instr_onceDoneThenContinue - stepNumber: 2/6 - titleIcon: icon-download.png - f3: - ui: - type: load - title: stepTitle_rebootBootloader - instruction: - - install_instr_rebootingOnBootloader - stepNumber: 3/6 - averageTime: 12 - f4: - ui: - type: action - title: stepTitle_oemUnlock - instruction: - - install_instr_pressVolUpToAcceptOEMUnlocking - - install_instr_unlockingOem - - install_instr_waitInstallStartAuto - stepNumber: 4/6 - titleIcon: icon-download.png - f5: - ui: - type: load - title: stepTitle_installOS - instruction: - - install_instr_eosInstall - stepNumber: 5/6 - averageTime: 200 - f6: - ui: - type: askAccount - f7: - ui: - type: action - title: stepTitle_rebootDevice - instruction: - - install_instr_onceDeviceRebootThenContinue - stepNumber: 6/6 - titleIcon: icon-download.png diff --git a/src/main/resources/yaml/GS290_new.yml b/src/main/resources/yaml/GS290_new.yml index 5012c680..112ff8d2 100644 --- a/src/main/resources/yaml/GS290_new.yml +++ b/src/main/resources/yaml/GS290_new.yml @@ -17,30 +17,116 @@ stepsCount: 7 steps: f0: - type: + type: custom stepNumber: 1 nextStepKey: f1 + titleKey: stepTitle_checkDeviceUptodate + titleIconName: icon-download.png + instructions: + - install_instr_connectTowifi + - install_instr_GS290_accessSystemSettings + - install_instr_GS290_accessSystemUpdate + - install_instr_update_stockrom + - install_instr_continueIfDeviceUpToDate f1: - type: + type: custom stepNumber: 2 nextStepKey: f2 + titleKey: stepTitle_enableOemUnlock + titleIconName: icon-download.png + instructions: + - install_instr_openSettings + - install_instr_searchOEM + - install_instr_enableOEMUnlocking + - install_instr_acceptOEMUnlockWarning + - install_instr_onceDoneThenContinue f2: - type: + type: load stepNumber: 3 nextStepKey: f3 + titleKey: stepTitle_rebootBootloader + instructions: + - install_instr_rebootingOnBootloader + averageTime: 12 + script: reboot-fastboot + parameters: + device_id: ${DEVICE_ID} + fastboot_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_cantRebootBootloader + 101: script_error_deviceID_missing + 102: script_error_fastbootPath_missing f3: - type: + type: custom-executable stepNumber: 4 nextStepKey: f4 + titleKey: stepTitle_oemUnlock + titleIconName: icon-download.png + instructions: + - install_instr_pressVolUpToAcceptOEMUnlocking + - install_instr_unlockingOem + - install_instr_waitInstallStartAuto + script: gs290-flashingUnlock + parameters: + device_id: ${DEVICE_ID} + fastboot_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 2: script_error_flashingUnlockFailed + 101: script_error_deviceID_missing + 102: script_error_fastbootPath_missing + f4: - type: + type: load stepNumber: 5 nextStepKey: f5 + titleKey: stepTitle_installOS + instructions: + - install_instr_eosInstall + averageTime: 200 + script: gs290-install-from-bootloader + parameters: + device_id: ${DEVICE_ID} + archive_path: ${ARCHIVE_PATH} + fastboot_folder_path: ${ADB_FOLDER_PATH} + java_folder_path: ${JAVA_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_cantUnpackSources + 11: script_error_cantWipeData + 12: script_error_cantFlashBoot + 13: script_error_cantFlashRecovery + 14: script_error_cantFlashsystem + 15: script_error_cantFlashLk + 16: script_error_cantFlashLogo + 101: script_error_deviceID_missing + 102: script_error_installFromFastboot_102 + 103: script_error_fastbootPath_missing f5: type: askAccount stepNumber: 6 nextStepKey: f6 f6: - type: + type: custom-executable stepNumber: 7 - nextStepKey: end \ No newline at end of file + nextStepKey: end + titleKey: stepTitle_rebootDevice + titleIconName: icon-download.png + instructions: + - install_instr_onceDeviceRebootThenContinue + script: gs290-wait-reboot-from-fastboot + parameters: + fastboot_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_cantrebootFromFasboot + 101: script_error_noDeviceFoundInFastboot \ No newline at end of file diff --git a/src/main/resources/yaml/Teracube_2e_new.yml b/src/main/resources/yaml/Teracube_2e_new.yml index e26e1b28..e244ae4e 100644 --- a/src/main/resources/yaml/Teracube_2e_new.yml +++ b/src/main/resources/yaml/Teracube_2e_new.yml @@ -41,7 +41,6 @@ steps: parameters: device_id: ${DEVICE_ID} fastboot_folder_path: ${ADB_FOLDER_PATH} - outputKey: ~ okCodes: 0: ~ koCodes: @@ -62,7 +61,6 @@ steps: parameters: device_id: ${DEVICE_ID} fastboot_folder_path: ${ADB_FOLDER_PATH} - outputKey: ~ okCodes: 0: ~ koCodes: @@ -85,7 +83,6 @@ steps: archive_path: ${ARCHIVE_PATH} fastboot_folder_path: ${ADB_FOLDER_PATH} java_folder_path: ${JAVA_FOLDER_PATH} - outputKey: ~ okCodes: 0: ~ koCodes: @@ -119,7 +116,6 @@ steps: script: gs290-wait-reboot-from-fastboot parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - outputKey: ~ okCodes: 0: ~ koCodes: diff --git a/src/main/resources/yaml/dreamlte_new.yml b/src/main/resources/yaml/dreamlte_new.yml new file mode 100644 index 00000000..4d90551b --- /dev/null +++ b/src/main/resources/yaml/dreamlte_new.yml @@ -0,0 +1,50 @@ +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer +--- +stepsCount: 7 +steps: + f0: + type: + stepNumber: 1 + nextStepKey: f1 + f1: + type: + stepNumber: 2 + nextStepKey: f2 + f2: + type: + stepNumber: 3 + nextStepKey: f3 + f3: + type: + stepNumber: 4 + nextStepKey: f4 + f4: + type: + stepNumber: 5 + nextStepKey: f5 + f5: + type: + stepNumber: 6 + nextStepKey: f6 + f6: + type: askAccount + stepNumber: 7 + nextStepKey: f6 + f7: + type: + stepNumber: 8 + nextStepKey: end \ No newline at end of file -- GitLab From 190c7229cf2cb4131f1a2a1e5f00945ddd7d1919 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 15:18:22 +0200 Subject: [PATCH 29/39] add dreamlte new config file, and remove old one. --- src/main/resources/yaml/GS290.yml | 32 ---- src/main/resources/yaml/dream2lte.yml | 129 ---------------- src/main/resources/yaml/dream2lte_fs.yml | 86 +---------- src/main/resources/yaml/dream2lte_new.yml | 170 ++++++++++++++++++++++ src/main/resources/yaml/dreamlte.yml | 129 ---------------- src/main/resources/yaml/dreamlte_fs.yml | 84 +---------- src/main/resources/yaml/dreamlte_new.yml | 136 ++++++++++++++++- 7 files changed, 301 insertions(+), 465 deletions(-) delete mode 100644 src/main/resources/yaml/GS290.yml delete mode 100644 src/main/resources/yaml/dream2lte.yml create mode 100644 src/main/resources/yaml/dream2lte_new.yml delete mode 100644 src/main/resources/yaml/dreamlte.yml diff --git a/src/main/resources/yaml/GS290.yml b/src/main/resources/yaml/GS290.yml deleted file mode 100644 index 2d7b8cd6..00000000 --- a/src/main/resources/yaml/GS290.yml +++ /dev/null @@ -1,32 +0,0 @@ -## Copyright 2019-2020 - ECORP SAS - -## This program is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program. If not, see . -## Author: Vincent Bourgmayer ---- -name: GS290 -flash: - - f7: - script: gs290-wait-reboot-from-fastboot - parameters: - fastboot_folder_path: ${ADB_FOLDER_PATH} - okCodes: - 0: ~ - koCodes: - 1: script_error_unknown - 10: script_error_cantrebootFromFasboot - 101: script_error_noDeviceFoundInFastboot - output: ~ - succeed: ~ - failed: ~ \ No newline at end of file diff --git a/src/main/resources/yaml/dream2lte.yml b/src/main/resources/yaml/dream2lte.yml deleted file mode 100644 index fac9e786..00000000 --- a/src/main/resources/yaml/dream2lte.yml +++ /dev/null @@ -1,129 +0,0 @@ -## Copyright 2019-2020 - ECORP SAS - -## This program is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program. If not, see . -## Author: Vincent Bourgmayer ---- -name: dream2lte -flash: - f1: - script: wait-download - parameters: - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitDownload_1 - output: ~ - succeed: f2 - failed: ~ - f2: - script: install-recovery - parameters: - twrp_image_path: ${TWRP_IMAGE_PATH} - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 101: script_error_installRecovery_101 - output: ~ - succeed: f3 - failed: ~ - f3: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f4 - failed: ~ - f4: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: f5 - failed: ~ - f5: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f6 - failed: ~ - f6: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${ARCHIVE_PATH} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f7 - failed: ~ - f7: - script: askAccount - parameters: ~ - codes: ~ - output: ~ - succeed: f8 - failed: ~ - f8: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: ~ - failed: ~ \ No newline at end of file diff --git a/src/main/resources/yaml/dream2lte_fs.yml b/src/main/resources/yaml/dream2lte_fs.yml index 05c7833a..81cfb3fc 100644 --- a/src/main/resources/yaml/dream2lte_fs.yml +++ b/src/main/resources/yaml/dream2lte_fs.yml @@ -1,4 +1,4 @@ -## Copyright 2019-2020 - ECORP SAS +## Copyright 2019-2021 - ECORP SAS ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -20,86 +20,4 @@ sources: filePath: e-latest-dream2lte.zip twrp: url: https://images.ecloud.global/stable/twrp/dream2lte/twrp-3.3.1-2-dream2lte.img - filePath: twrp-3.3.1-2-dream2lte.img -flash: - f1: - ui: - type: action - title: stepTitle_oemUnlock - instruction: - - install_instr_openSettings - - install_instr_openDevOptions - - install_instr_enableOEMUnlock - - install_instr_turnOff - - install_instr_startDl_pressPowerBixbyVolDown - - install_instr_acceptWarning - stepNumber: 1/7 - titleIcon: icon-download.png - f2: - ui: - type: load - title: stepTitle_installRecovery - instruction: - - install_instr_recoveryInstall - stepNumber: 2/7 - averageTime: 6 - f3: - ui: - type: action - title: stepTitle_startRecovery - instruction: - - install_instr_leaveDl_pressPowerBixbyVolDown - - install_instr_startRec_pressPowerBixbyVolUp - - install_instr_swipeTwrp - stepNumber: 3/7 - titleIcon: icon-download.png - f4: - ui: - type: action - title: stepTitle_formatDataTurnOff - instruction: - - install_instr_tapWipe - - install_instr_tapFormatData - - install_instr_writeYes - - install_instr_validate - - install_instr_backX3 - - install_instr_tapReboot - - install_instr_tapRebootPowerOff - - install_instr_doNotInstall - stepNumber: 4/7 - titleIcon: icon-search.png - f5: - ui: - type: action - title: stepTitle_restartRecovery - instruction: - - install_instr_startRec_pressPowerBixbyVolUp - - install_instr_swipeTwrp - stepNumber: 5/7 - titleIcon: icon-download.png - f6: - ui: - type: load - title: stepTitle_installOS - instruction: - - install_instr_eosInstall - stepNumber: 6/7 - averageTime: 475 - f7: - ui: - type: askAccount - f8: - ui: - type: action - title: stepTitle_resizeDataPartition - instruction: - - install_instr_tapWipe - - install_instr_tapAdvancedWipe - - install_instr_tickData - - install_instr_tapRepairChangeFs - - install_instr_resizeFs - - install_instr_swipeForOk - - install_instr_tapRebootSystem - - install_instr_doNotInstall - stepNumber: 7/7 - titleIcon: icon-search.png \ No newline at end of file + filePath: twrp-3.3.1-2-dream2lte.img \ No newline at end of file diff --git a/src/main/resources/yaml/dream2lte_new.yml b/src/main/resources/yaml/dream2lte_new.yml new file mode 100644 index 00000000..8d162221 --- /dev/null +++ b/src/main/resources/yaml/dream2lte_new.yml @@ -0,0 +1,170 @@ +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer +--- +stepsCount: 8 +steps: + f0: + type: custom-executable + stepNumber: 1 + nextStepKey: f1 + titleKey: stepTitle_oemUnlock + instructions: + - install_instr_openSettings + - install_instr_openDevOptions + - install_instr_enableOEMUnlock + - install_instr_turnOff + - install_instr_startDl_pressPowerBixbyVolDown + - install_instr_acceptWarning + titleKeyIconName: icon-download.png + script: wait-download + parameters: + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitDownload_1 + f1: + type: load + stepNumber: 2 + nextStepKey: f2 + titleKey: stepTitle_installRecovery + instructions: + - install_instr_recoveryInstall + averageTime: 6 + script: install-recovery + parameters: + twrp_image_path: ${TWRP_IMAGE_PATH} + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 101: script_error_installRecovery_101 + f2: + type: custom-executable + stepNumber: 3 + nextStepKey: f3 + titleKey: stepTitle_startRecovery + instructions: + - install_instr_leaveDl_pressPowerBixbyVolDown + - install_instr_startRec_pressPowerBixbyVolUp + - install_instr_swipeTwrp + titleKeyIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 + f3: + type: custom-executable + stepNumber: 4 + nextStepKey: f4 + titleKey: stepTitle_formatDataTurnOff + instructions: + - install_instr_tapWipe + - install_instr_tapFormatData + - install_instr_writeYes + - install_instr_validate + - install_instr_backX3 + - install_instr_tapReboot + - install_instr_tapRebootPowerOff + - install_instr_doNotInstall + titleKeyIconName: icon-search.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 + f4: + type: + stepNumber: 5 + nextStepKey: f5 + type: action + titleKey: stepTitle_restartRecovery + instructions: + - install_instr_startRec_pressPowerBixbyVolUp + - install_instr_swipeTwrp + titleKeyIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 + f5: + type: load + stepNumber: 6 + nextStepKey: f6 + titleKey: stepTitle_installOS + instructions: + - install_instr_eosInstall + averageTime: 475 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${ARCHIVE_PATH} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 + f6: + type: askAccount + stepNumber: 7 + nextStepKey: f6 + f7: + type: custom-executable + stepNumber: 8 + nextStepKey: end + titleKey: stepTitle_resizeDataPartition + instructions: + - install_instr_tapWipe + - install_instr_tapAdvancedWipe + - install_instr_tickData + - install_instr_tapRepairChangeFs + - install_instr_resizeFs + - install_instr_swipeForOk + - install_instr_tapRebootSystem + - install_instr_doNotInstall + titleKeyIconName: icon-search.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 \ No newline at end of file diff --git a/src/main/resources/yaml/dreamlte.yml b/src/main/resources/yaml/dreamlte.yml deleted file mode 100644 index dfe13b10..00000000 --- a/src/main/resources/yaml/dreamlte.yml +++ /dev/null @@ -1,129 +0,0 @@ -## Copyright 2019-2020 - ECORP SAS - -## This program is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program. If not, see . -## Author: Vincent Bourgmayer ---- -name: dreamlte -flash: - f1: - script: wait-download - parameters: - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitDownload_1 - output: ~ - succeed: f2 - failed: ~ - f2: - script: install-recovery - parameters: - twrp_image_path: ${TWRP_IMAGE_PATH} - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 101: script_error_installRecovery_101 - output: ~ - succeed: f3 - failed: ~ - f3: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f4 - failed: ~ - f4: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: f5 - failed: ~ - f5: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f6 - failed: ~ - f6: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${ARCHIVE_PATH} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f7 - failed: ~ - f7: - script: askAccount - parameters: ~ - codes: ~ - output: ~ - succeed: f8 - failed: ~ - f8: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: ~ - failed: ~ \ No newline at end of file diff --git a/src/main/resources/yaml/dreamlte_fs.yml b/src/main/resources/yaml/dreamlte_fs.yml index 8b108b5a..865c0d77 100644 --- a/src/main/resources/yaml/dreamlte_fs.yml +++ b/src/main/resources/yaml/dreamlte_fs.yml @@ -20,86 +20,4 @@ sources: filePath: e-latest-dreamlte.zip twrp: url: https://images.ecloud.global/stable/twrp/dreamlte/twrp-3.3.1-2-dreamlte.img - filePath: twrp-3.3.1-2-dreamlte.img -flash: - f1: - ui: - type: action - title: stepTitle_oemUnlock - instruction: - - install_instr_openSettings - - install_instr_openDevOptions - - install_instr_enableOEMUnlock - - install_instr_turnOff - - install_instr_startDl_pressPowerBixbyVolDown - - install_instr_acceptWarning - stepNumber: 1/7 - titleIcon: icon-download.png - f2: - ui: - type: load - title: stepTitle_installRecovery - instruction: - - install_instr_recoveryInstall - stepNumber: 2/7 - averageTime: 6 - f3: - ui: - type: action - title: stepTitle_startRecovery - instruction: - - install_instr_leaveDl_pressPowerBixbyVolDown - - install_instr_startRec_pressPowerBixbyVolUp - - install_instr_swipeTwrp - stepNumber: 3/7 - titleIcon: icon-download.png - f4: - ui: - type: action - title: stepTitle_formatDataTurnOff - instruction: - - install_instr_tapWipe - - install_instr_tapFormatData - - install_instr_writeYes - - install_instr_validate - - install_instr_backX3 - - install_instr_tapReboot - - install_instr_tapRebootPowerOff - - install_instr_doNotInstall - stepNumber: 4/7 - titleIcon: icon-search.png - f5: - ui: - type: action - title: stepTitle_restartRecovery - instruction: - - install_instr_startRec_pressPowerBixbyVolUp - - install_instr_swipeTwrp - stepNumber: 5/7 - titleIcon: icon-download.png - f6: - ui: - type: load - title: stepTitle_installOS - instruction: - - install_instr_eosInstall - stepNumber: 6/7 - averageTime: 475 - f7: - ui: - type: askAccount - f8: - ui: - type: action - title: stepTitle_resizeDataPartition - instruction: - - install_instr_tapWipe - - install_instr_tapAdvancedWipe - - install_instr_tickData - - install_instr_tapRepairChangeFs - - install_instr_resizeFs - - install_instr_swipeForOk - - install_instr_tapRebootSystem - - install_instr_doNotInstall - stepNumber: 7/7 - titleIcon: icon-search.png \ No newline at end of file + filePath: twrp-3.3.1-2-dreamlte.img \ No newline at end of file diff --git a/src/main/resources/yaml/dreamlte_new.yml b/src/main/resources/yaml/dreamlte_new.yml index 4d90551b..8d162221 100644 --- a/src/main/resources/yaml/dreamlte_new.yml +++ b/src/main/resources/yaml/dreamlte_new.yml @@ -14,37 +14,157 @@ ## along with this program. If not, see . ## Author: Vincent Bourgmayer --- -stepsCount: 7 +stepsCount: 8 steps: f0: - type: + type: custom-executable stepNumber: 1 nextStepKey: f1 + titleKey: stepTitle_oemUnlock + instructions: + - install_instr_openSettings + - install_instr_openDevOptions + - install_instr_enableOEMUnlock + - install_instr_turnOff + - install_instr_startDl_pressPowerBixbyVolDown + - install_instr_acceptWarning + titleKeyIconName: icon-download.png + script: wait-download + parameters: + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitDownload_1 f1: - type: + type: load stepNumber: 2 nextStepKey: f2 + titleKey: stepTitle_installRecovery + instructions: + - install_instr_recoveryInstall + averageTime: 6 + script: install-recovery + parameters: + twrp_image_path: ${TWRP_IMAGE_PATH} + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 101: script_error_installRecovery_101 f2: - type: + type: custom-executable stepNumber: 3 nextStepKey: f3 + titleKey: stepTitle_startRecovery + instructions: + - install_instr_leaveDl_pressPowerBixbyVolDown + - install_instr_startRec_pressPowerBixbyVolUp + - install_instr_swipeTwrp + titleKeyIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 f3: - type: + type: custom-executable stepNumber: 4 nextStepKey: f4 + titleKey: stepTitle_formatDataTurnOff + instructions: + - install_instr_tapWipe + - install_instr_tapFormatData + - install_instr_writeYes + - install_instr_validate + - install_instr_backX3 + - install_instr_tapReboot + - install_instr_tapRebootPowerOff + - install_instr_doNotInstall + titleKeyIconName: icon-search.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 f4: type: stepNumber: 5 nextStepKey: f5 + type: action + titleKey: stepTitle_restartRecovery + instructions: + - install_instr_startRec_pressPowerBixbyVolUp + - install_instr_swipeTwrp + titleKeyIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 f5: - type: + type: load stepNumber: 6 nextStepKey: f6 + titleKey: stepTitle_installOS + instructions: + - install_instr_eosInstall + averageTime: 475 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${ARCHIVE_PATH} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 f6: type: askAccount stepNumber: 7 nextStepKey: f6 f7: - type: + type: custom-executable stepNumber: 8 - nextStepKey: end \ No newline at end of file + nextStepKey: end + titleKey: stepTitle_resizeDataPartition + instructions: + - install_instr_tapWipe + - install_instr_tapAdvancedWipe + - install_instr_tickData + - install_instr_tapRepairChangeFs + - install_instr_resizeFs + - install_instr_swipeForOk + - install_instr_tapRebootSystem + - install_instr_doNotInstall + titleKeyIconName: icon-search.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 \ No newline at end of file -- GitLab From c52eb16554334d39febdd43a112c4797d3d9a2d4 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 15:32:15 +0200 Subject: [PATCH 30/39] add new config file for herolte & hero2lte --- src/main/resources/yaml/hero2lte.yml | 99 ------------------ src/main/resources/yaml/hero2lte_fs.yml | 61 +---------- src/main/resources/yaml/hero2lte_new.yml | 126 +++++++++++++++++++++++ src/main/resources/yaml/herolte.yml | 99 ------------------ src/main/resources/yaml/herolte_fs.yml | 61 +---------- src/main/resources/yaml/herolte_new.yml | 126 +++++++++++++++++++++++ 6 files changed, 254 insertions(+), 318 deletions(-) delete mode 100644 src/main/resources/yaml/hero2lte.yml create mode 100644 src/main/resources/yaml/hero2lte_new.yml delete mode 100644 src/main/resources/yaml/herolte.yml create mode 100644 src/main/resources/yaml/herolte_new.yml diff --git a/src/main/resources/yaml/hero2lte.yml b/src/main/resources/yaml/hero2lte.yml deleted file mode 100644 index 7a06b4c8..00000000 --- a/src/main/resources/yaml/hero2lte.yml +++ /dev/null @@ -1,99 +0,0 @@ -## Copyright 2019-2020 - ECORP SAS - -## This program is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program. If not, see . -## Author: Vincent Bourgmayer ---- -name: hero2lte -flash: - f1: - script: wait-download - parameters: - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitDownload_1 - output: ~ - succeed: f2 - failed: ~ - f2: - script: install-recovery - parameters: - twrp_image_path: ${TWRP_IMAGE_PATH} - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 101: script_error_installRecovery_101 - output: ~ - succeed: f3 - failed: ~ - f3: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f4 - failed: ~ - f4: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${ARCHIVE_PATH} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f5 - failed: ~ - f5: - script: askAccount - parameters: ~ - codes: ~ - output: ~ - succeed: f6 - failed: ~ - f6: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: ~ - failed: ~ \ No newline at end of file diff --git a/src/main/resources/yaml/hero2lte_fs.yml b/src/main/resources/yaml/hero2lte_fs.yml index afa1c0c2..a5bf1bba 100644 --- a/src/main/resources/yaml/hero2lte_fs.yml +++ b/src/main/resources/yaml/hero2lte_fs.yml @@ -20,63 +20,4 @@ sources: filePath: e-latest-hero2lte.zip twrp: url: https://images.ecloud.global/stable/twrp/hero2lte/twrp-3.2.3-0-hero2lte.img - filePath: twrp-3.2.3-0-hero2lte.img -flash: - f1: - ui: - type: action - title: stepTitle1On7 - instruction: - - install_instr_turnOff - - install_instr_startDownload - - install_instr_acceptWarning - stepNumber: 1/5 - titleIcon: icon-download.png - f2: - ui: - type: load - title: stepTitle4On7 - instruction: - - install_instr_recoveryInstall - stepNumber: 2/5 - averageTime: 6 - f3: - ui: - type: action - title: stepTitle5On7 - instruction: - - install_instr_leaveDownload - - install_instr_startRecovery - - install_instr_swipeTwrp - stepNumber: 3/5 - titleIcon: icon-download.png - f4: - ui: - type: load - title: stepTitle6On7 - instruction: - - install_instr_eosInstall - stepNumber: 4/5 - averageTime: 475 - f5: - ui: - type: askAccount - f6: - ui: - type: action - title: stepTitle7On7 - instruction: - - install_instr_tapWipe - - install_instr_tapAdvancedWipe - - install_instr_tickData - - install_instr_tapRepairChangeFs - - install_instr_tapChangeFs - - install_instr_tapExt3 - - install_instr_swipeForOk - - install_instr_backX2 - - install_instr_resizeFs - - install_instr_swipeForOk - - install_instr_tapRebootSystem - - install_instr_doNotInstall - stepNumber: 5/5 - titleIcon: icon-search.png \ No newline at end of file + filePath: twrp-3.2.3-0-hero2lte.img \ No newline at end of file diff --git a/src/main/resources/yaml/hero2lte_new.yml b/src/main/resources/yaml/hero2lte_new.yml new file mode 100644 index 00000000..f9d5ace4 --- /dev/null +++ b/src/main/resources/yaml/hero2lte_new.yml @@ -0,0 +1,126 @@ +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer +--- +stepsCount: 6 +steps: + f0: + type: custom-executable + stepNumber: 1 + nextStepKey: f1 + titleKey: stepTitle1On7 + instructions: + - install_instr_turnOff + - install_instr_startDownload + - install_instr_acceptWarning + titleIconName: icon-download.png + script: wait-download + parameters: + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitDownload_1 + f1: + type: load + stepNumber: 2 + nextStepKey: f2 + titleKey: stepTitle4On7 + instructions: + - install_instr_recoveryInstall + averageTime: 6 + script: install-recovery + parameters: + twrp_image_path: ${TWRP_IMAGE_PATH} + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 101: script_error_installRecovery_101 + f2: + type: custom-executable + stepNumber: 3 + nextStepKey: f3 + titleKey: stepTitle5On7 + instructions: + - install_instr_leaveDownload + - install_instr_startRecovery + - install_instr_swipeTwrp + titleIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 + f3: + type: load + stepNumber: 4 + nextStepKey: f4 + titleKey: stepTitle6On7 + instructions: + - install_instr_eosInstall + averageTime: 475 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${ARCHIVE_PATH} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 + f4: + type: askAccount + stepNumber: 5 + nextStepKey: f5 + f5: + type: custom-executable + stepNumber: 6 + nextStepKey: end + titleKey: stepTitle7On7 + instructions: + - install_instr_tapWipe + - install_instr_tapAdvancedWipe + - install_instr_tickData + - install_instr_tapRepairChangeFs + - install_instr_tapChangeFs + - install_instr_tapExt3 + - install_instr_swipeForOk + - install_instr_backX2 + - install_instr_resizeFs + - install_instr_swipeForOk + - install_instr_tapRebootSystem + - install_instr_doNotInstall + titleIconName: icon-search.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 diff --git a/src/main/resources/yaml/herolte.yml b/src/main/resources/yaml/herolte.yml deleted file mode 100644 index 8021fbca..00000000 --- a/src/main/resources/yaml/herolte.yml +++ /dev/null @@ -1,99 +0,0 @@ -## Copyright 2019-2020 - ECORP SAS - -## This program is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program. If not, see . -## Author: Vincent Bourgmayer ---- -name: herolte -flash: - f1: - script: wait-download - parameters: - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitDownload_1 - output: ~ - succeed: f2 - failed: ~ - f2: - script: install-recovery - parameters: - twrp_image_path: ${TWRP_IMAGE_PATH} - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 101: script_error_installRecovery_101 - output: ~ - succeed: f3 - failed: ~ - f3: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f4 - failed: ~ - f4: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${ARCHIVE_PATH} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f5 - failed: ~ - f5: - script: askAccount - parameters: ~ - codes: ~ - output: ~ - succeed: f6 - failed: ~ - f6: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: ~ - failed: ~ \ No newline at end of file diff --git a/src/main/resources/yaml/herolte_fs.yml b/src/main/resources/yaml/herolte_fs.yml index 36bf18af..33f682b9 100644 --- a/src/main/resources/yaml/herolte_fs.yml +++ b/src/main/resources/yaml/herolte_fs.yml @@ -20,63 +20,4 @@ sources: filePath: e-latest-herolte.zip twrp: url: https://images.ecloud.global/stable/twrp/herolte/twrp-3.2.3-0-herolte.img - filePath: twrp-3.2.3-0-herolte.img -flash: - f1: - ui: - type: action - title: stepTitle1On7 - instruction: - - install_instr_turnOff - - install_instr_startDownload - - install_instr_acceptWarning - stepNumber: 1/5 - titleIcon: icon-download.png - f2: - ui: - type: load - title: stepTitle4On7 - instruction: - - install_instr_recoveryInstall - stepNumber: 2/5 - averageTime: 6 - f3: - ui: - type: action - title: stepTitle5On7 - instruction: - - install_instr_leaveDownload - - install_instr_startRecovery - - install_instr_swipeTwrp - stepNumber: 3/5 - titleIcon: icon-download.png - f4: - ui: - type: load - title: stepTitle6On7 - instruction: - - install_instr_eosInstall - stepNumber: 4/5 - averageTime: 475 - f5: - ui: - type: askAccount - f6: - ui: - type: action - title: stepTitle7On7 - instruction: - - install_instr_tapWipe - - install_instr_tapAdvancedWipe - - install_instr_tickData - - install_instr_tapRepairChangeFs - - install_instr_tapChangeFs - - install_instr_tapExt3 - - install_instr_swipeForOk - - install_instr_backX2 - - install_instr_resizeFs - - install_instr_swipeForOk - - install_instr_tapRebootSystem - - install_instr_doNotInstall - stepNumber: 5/5 - titleIcon: icon-search.png \ No newline at end of file + filePath: twrp-3.2.3-0-herolte.img \ No newline at end of file diff --git a/src/main/resources/yaml/herolte_new.yml b/src/main/resources/yaml/herolte_new.yml new file mode 100644 index 00000000..f9d5ace4 --- /dev/null +++ b/src/main/resources/yaml/herolte_new.yml @@ -0,0 +1,126 @@ +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer +--- +stepsCount: 6 +steps: + f0: + type: custom-executable + stepNumber: 1 + nextStepKey: f1 + titleKey: stepTitle1On7 + instructions: + - install_instr_turnOff + - install_instr_startDownload + - install_instr_acceptWarning + titleIconName: icon-download.png + script: wait-download + parameters: + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitDownload_1 + f1: + type: load + stepNumber: 2 + nextStepKey: f2 + titleKey: stepTitle4On7 + instructions: + - install_instr_recoveryInstall + averageTime: 6 + script: install-recovery + parameters: + twrp_image_path: ${TWRP_IMAGE_PATH} + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 101: script_error_installRecovery_101 + f2: + type: custom-executable + stepNumber: 3 + nextStepKey: f3 + titleKey: stepTitle5On7 + instructions: + - install_instr_leaveDownload + - install_instr_startRecovery + - install_instr_swipeTwrp + titleIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 + f3: + type: load + stepNumber: 4 + nextStepKey: f4 + titleKey: stepTitle6On7 + instructions: + - install_instr_eosInstall + averageTime: 475 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${ARCHIVE_PATH} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 + f4: + type: askAccount + stepNumber: 5 + nextStepKey: f5 + f5: + type: custom-executable + stepNumber: 6 + nextStepKey: end + titleKey: stepTitle7On7 + instructions: + - install_instr_tapWipe + - install_instr_tapAdvancedWipe + - install_instr_tickData + - install_instr_tapRepairChangeFs + - install_instr_tapChangeFs + - install_instr_tapExt3 + - install_instr_swipeForOk + - install_instr_backX2 + - install_instr_resizeFs + - install_instr_swipeForOk + - install_instr_tapRebootSystem + - install_instr_doNotInstall + titleIconName: icon-search.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 -- GitLab From b0a82a20ef404342d8d7b065732061ec650821bf Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 15:56:53 +0200 Subject: [PATCH 31/39] add starlte & star2lte new config file --- src/main/resources/yaml/star2lte.yml | 172 ----------------- src/main/resources/yaml/star2lte_fs.yml | 114 +----------- src/main/resources/yaml/star2lte_new.yml | 223 +++++++++++++++++++++++ src/main/resources/yaml/starlte.yml | 173 ------------------ src/main/resources/yaml/starlte_fs.yml | 112 +----------- src/main/resources/yaml/starlte_new.yml | 223 +++++++++++++++++++++++ 6 files changed, 449 insertions(+), 568 deletions(-) delete mode 100644 src/main/resources/yaml/star2lte.yml create mode 100644 src/main/resources/yaml/star2lte_new.yml delete mode 100644 src/main/resources/yaml/starlte.yml create mode 100644 src/main/resources/yaml/starlte_new.yml diff --git a/src/main/resources/yaml/star2lte.yml b/src/main/resources/yaml/star2lte.yml deleted file mode 100644 index 2e9d41ef..00000000 --- a/src/main/resources/yaml/star2lte.yml +++ /dev/null @@ -1,172 +0,0 @@ -## Copyright 2019-2020 - ECORP SAS - -## This program is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program. If not, see . -## Author: Vincent Bourgmayer ---- -name: star2lte -flash: - f1: - script: ~ - parameters: ~ - codes: ~ - output: ~ - succeed: f2 - failed: ~ - f2: - script: wait-download - parameters: - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitDownload_1 - output: ~ - succeed: f3 - failed: ~ - f3: - script: install-recovery - parameters: - twrp_image_path: ${TWRP_IMAGE_PATH} - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 101: script_error_installRecovery_101 - output: ~ - succeed: f4 - failed: ~ - f4: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f5 - failed: ~ - f5: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: f6 - failed: ~ - f6: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f7 - failed: ~ - f7: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${SOURCES_PATH}no-verity-opt-encrypt-samsung-1.0.zip - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f8 - failed: ~ - f8: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${SOURCES_PATH}VENDOR-27_ARI9.zip - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f9 - failed: ~ - f9: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${ARCHIVE_PATH} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f10 - failed: ~ - f10: - script: askAccount - parameters: ~ - codes: ~ - output: ~ - succeed: f11 - failed: ~ - f11: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: ~ - failed: ~ \ No newline at end of file diff --git a/src/main/resources/yaml/star2lte_fs.yml b/src/main/resources/yaml/star2lte_fs.yml index cdaddcfb..e036cd17 100644 --- a/src/main/resources/yaml/star2lte_fs.yml +++ b/src/main/resources/yaml/star2lte_fs.yml @@ -1,4 +1,4 @@ -## Copyright 2019-2020 - ECORP SAS +## Copyright 2019-2021 - ECORP SAS ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -26,114 +26,4 @@ sources: filePath: VENDOR-27_ARI9.zip f3: url: https://images.ecloud.global/stable/patch/no-verity-opt-encrypt-samsung-1.0.zip - filePath: no-verity-opt-encrypt-samsung-1.0.zip -flash: - f1: - ui: - type: action - title: stepTitle_oemUnlock - instruction: - - install_instr_connectTowifi - - install_instr_openSettingsThenDevOptions - - install_instr_disableAutoUpdateSystem - - install_instr_openSoftwareUpdate - - install_instr_disableAutomaticDownload - - install_instr_clickDlAndInstall - - install_instr_rebootDeviceThenContinue - stepNumber: 1/10 - titleIcon: icon-download.png - f2: - ui: - type: action - title: stepTitle_oemUnlock - instruction: - - install_instr_openSettingsThenDevOptions - - install_instr_enableOEMUnlock - - install_instr_acceptFactoryReset - - install_instr_startDl_pressPowerBixbyVolDown - - install_instr_acceptWarning - stepNumber: 2/10 - titleIcon: icon-download.png - f3: - ui: - type: load - title: stepTitle4On7 - instruction: - - install_instr_recoveryInstall - stepNumber: 3/10 - averageTime: 6 - f4: - ui: - type: action - title: stepTitle5On7 - instruction: - - install_instr_leaveDl_pressPowerBixbyVolDown - - install_instr_startRec_pressPowerBixbyVolUp - - install_instr_keepReadOnly - stepNumber: 4/10 - titleIcon: icon-download.png - f5: - ui: - type: action - title: stepTitle5On7 - instruction: - - install_instr_tapWipe - - install_instr_tapFormatData - - install_instr_writeYes - - install_instr_validate - - install_instr_backX3 - - install_instr_tapReboot - - install_instr_tapRebootRecovery - - install_instr_doNotInstall - stepNumber: 5/10 - titleIcon: icon-download.png - f6: - ui: - type: action - title: stepTitle5On7 - instruction: - - install_instr_swipeTwrp - stepNumber: 6/10 - titleIcon: icon-download.png - f7: - ui: - type: load - title: install_instr_patchInstall - instruction: - - install_instr_patchInstall - stepNumber: 7/10 - averageTime: 55 - f8: - ui: - type: load - title: install_instr_vendorInstall - instruction: - - install_instr_vendorInstall - stepNumber: 8/10 - averageTime: 65 - f9: - ui: - type: load - title: install_instr_eosInstall - instruction: - - install_instr_eosInstall - stepNumber: 9/10 - averageTime: 440 - f10: - ui: - type: askAccount - f11: - ui: - type: action - title: stepTitle7On7 - instruction: - - install_instr_tapWipe - - install_instr_tapAdvancedWipe - - install_instr_tickData - - install_instr_tapRepairChangeFs - - install_instr_resizeFs - - install_instr_swipeForOk - - install_instr_tapRebootSystem - - install_instr_doNotInstall - stepNumber: 10/10 - titleIcon: icon-download.png \ No newline at end of file + filePath: no-verity-opt-encrypt-samsung-1.0.zip \ No newline at end of file diff --git a/src/main/resources/yaml/star2lte_new.yml b/src/main/resources/yaml/star2lte_new.yml new file mode 100644 index 00000000..291360e1 --- /dev/null +++ b/src/main/resources/yaml/star2lte_new.yml @@ -0,0 +1,223 @@ +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer +--- +stepsCount: 11 +steps: + f0: + type: custom + stepNumber: 1 + nextStepKey: f1 + titleKey: stepTitle_oemUnlock + instructions: + - install_instr_connectTowifi + - install_instr_openSettingsThenDevOptions + - install_instr_disableAutoUpdateSystem + - install_instr_openSoftwareUpdate + - install_instr_disableAutomaticDownload + - install_instr_clickDlAndInstall + - install_instr_rebootDeviceThenContinue + titleKeyIconName: icon-download.png + f1: + type: custom-executable + stepNumber: 2 + nextStepKey: f2 + titleKey: stepTitle_oemUnlock + instructions: + - install_instr_openSettingsThenDevOptions + - install_instr_enableOEMUnlock + - install_instr_acceptFactoryReset + - install_instr_startDl_pressPowerBixbyVolDown + - install_instr_acceptWarning + titleKeyIconName: icon-download.png + script: wait-download + parameters: + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitDownload_1 + f2: + type: load + stepNumber: 3 + nextStepKey: f3 + titleKey: stepTitle4On7 + instructions: + - install_instr_recoveryInstall + averageTime: 6 + script: install-recovery + parameters: + twrp_image_path: ${TWRP_IMAGE_PATH} + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 101: script_error_installRecovery_101 + f3: + type: + stepNumber: 4 + nextStepKey: f4 + titleKey: stepTitle5On7 + instructions: + - install_instr_leaveDl_pressPowerBixbyVolDown + - install_instr_startRec_pressPowerBixbyVolUp + - install_instr_keepReadOnly + titleKeyIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 + f4: + type: + stepNumber: 5 + nextStepKey: f5 + titleKey: stepTitle5On7 + instructions: + - install_instr_tapWipe + - install_instr_tapFormatData + - install_instr_writeYes + - install_instr_validate + - install_instr_backX3 + - install_instr_tapReboot + - install_instr_tapRebootRecovery + - install_instr_doNotInstall + titleKeyIconName: icon-download.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 + f5: + type: + stepNumber: 6 + nextStepKey: f6 + titleKey: stepTitle5On7 + instructions: + - install_instr_swipeTwrp + titleKeyIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 + f6: + type: load + stepNumber: 7 + nextStepKey: f7 + titleKey: install_instr_patchInstall + instructions: + - install_instr_patchInstall + averageTime: 55 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${SOURCES_PATH}no-verity-opt-encrypt-samsung-1.0.zip + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 + f7: + type: load + stepNumber: 8 + nextStepKey: f8 + titleKey: install_instr_vendorInstall + instructions: + - install_instr_vendorInstall + averageTime: 65 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${SOURCES_PATH}VENDOR-27_ARI9.zip + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 + f8: + type: load + stepNumber: 9 + nextStepKey: f9 + titleKey: install_instr_eosInstall + instructions: + - install_instr_eosInstall + averageTime: 440 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${ARCHIVE_PATH} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 + f9: + type: askAccount + stepNumber: 10 + nextStepKey: f10 + f10: + type: + stepNumber: 11 + nextStepKey: end + titleKey: stepTitle7On7 + instructions: + - install_instr_tapWipe + - install_instr_tapAdvancedWipe + - install_instr_tickData + - install_instr_tapRepairChangeFs + - install_instr_resizeFs + - install_instr_swipeForOk + - install_instr_tapRebootSystem + - install_instr_doNotInstall + titleKeyIconName: icon-download.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 diff --git a/src/main/resources/yaml/starlte.yml b/src/main/resources/yaml/starlte.yml deleted file mode 100644 index 3f9af81c..00000000 --- a/src/main/resources/yaml/starlte.yml +++ /dev/null @@ -1,173 +0,0 @@ -## Copyright 2019-2020 - ECORP SAS - -## This program is free software: you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation, either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. - -## You should have received a copy of the GNU General Public License -## along with this program. If not, see . -## Author: Vincent Bourgmayer ---- -name: starlte -flash: - f1: - script: ~ - parameters: ~ - codes: ~ - output: ~ - succeed: f2 - failed: ~ - f2: - script: wait-download - parameters: - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitDownload_1 - output: ~ - succeed: f3 - failed: ~ - f3: - script: install-recovery - parameters: - twrp_image_path: ${TWRP_IMAGE_PATH} - heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 101: script_error_installRecovery_101 - output: ~ - succeed: f4 - failed: ~ - f4: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f5 - failed: ~ - f5: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: f6 - failed: ~ - f6: - script: wait-recovery - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitRecovery_1 - 101: script_error_waitRecovery_101 - 102: script_error_waitRecovery_102 - output: ~ - succeed: f7 - failed: ~ - f7: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${SOURCES_PATH}no-verity-opt-encrypt-samsung-1.0.zip - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f8 - failed: ~ - f8: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${SOURCES_PATH}VENDOR-27_ARI9.zip - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f9 - failed: ~ - f9: - script: install-from-recovery - parameters: - device_id: ${DEVICE_ID} - archive_path: ${ARCHIVE_PATH} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromRecovery_1 - 2: script_error_installFromRecovery_2 - 3: script_error_installFromRecovery_3 - 101: script_error_installFromRecovery_101 - 102: script_error_installFromRecovery_102 - output: ~ - succeed: f10 - failed: ~ - f10: - script: askAccount - parameters: ~ - codes: ~ - output: ~ - succeed: f11 - failed: ~ - f11: - script: wait-reboot - parameters: - device_id: ${DEVICE_ID} - adb_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 10: script_error_waitReboot_10 - 101: script_error_waitReboot_101 - output: ~ - succeed: ~ - failed: ~ \ No newline at end of file diff --git a/src/main/resources/yaml/starlte_fs.yml b/src/main/resources/yaml/starlte_fs.yml index e766da83..d9a906d9 100644 --- a/src/main/resources/yaml/starlte_fs.yml +++ b/src/main/resources/yaml/starlte_fs.yml @@ -1,4 +1,4 @@ -## Copyright 2019-2020 - ECORP SAS +## Copyright 2019-2021 - ECORP SAS ## This program is free software: you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -27,113 +27,3 @@ sources: f3: url: https://images.ecloud.global/stable/patch/no-verity-opt-encrypt-samsung-1.0.zip filePath: no-verity-opt-encrypt-samsung-1.0.zip -flash: - f1: - ui: - type: action - title: stepTitle_oemUnlock - instruction: - - install_instr_connectTowifi - - install_instr_openSettingsThenDevOptions - - install_instr_disableAutoUpdateSystem - - install_instr_openSoftwareUpdate - - install_instr_disableAutomaticDownload - - install_instr_clickDlAndInstall - - install_instr_rebootDeviceThenContinue - stepNumber: 1/10 - titleIcon: icon-download.png - f2: - ui: - type: action - title: stepTitle_oemUnlock - instruction: - - install_instr_openSettingsThenDevOptions - - install_instr_enableOEMUnlock - - install_instr_acceptFactoryReset - - install_instr_startDl_pressPowerBixbyVolDown - - install_instr_acceptWarning - stepNumber: 2/10 - titleIcon: icon-download.png - f3: - ui: - type: load - title: stepTitle4On7 - instruction: - - install_instr_recoveryInstall - stepNumber: 3/10 - averageTime: 6 - f4: - ui: - type: action - title: stepTitle5On7 - instruction: - - install_instr_leaveDl_pressPowerBixbyVolDown - - install_instr_startRec_pressPowerBixbyVolUp - - install_instr_keepReadOnly - stepNumber: 4/10 - titleIcon: icon-download.png - f5: - ui: - type: action - title: stepTitle5On7 - instruction: - - install_instr_tapWipe - - install_instr_tapFormatData - - install_instr_writeYes - - install_instr_validate - - install_instr_backX3 - - install_instr_tapReboot - - install_instr_tapRebootRecovery - - install_instr_doNotInstall - stepNumber: 5/10 - titleIcon: icon-download.png - f6: - ui: - type: action - title: stepTitle5On7 - instruction: - - install_instr_swipeTwrp - stepNumber: 6/10 - titleIcon: icon-download.png - f7: - ui: - type: load - title: install_instr_patchInstall - instruction: - - install_instr_patchInstall - stepNumber: 7/10 - averageTime: 55 - f8: - ui: - type: load - title: install_instr_vendorInstall - instruction: - - install_instr_vendorInstall - stepNumber: 8/10 - averageTime: 65 - f9: - ui: - type: load - title: install_instr_eosInstall - instruction: - - install_instr_eosInstall - stepNumber: 9/10 - averageTime: 440 - f10: - ui: - type: askAccount - f11: - ui: - type: action - title: stepTitle7On7 - instruction: - - install_instr_tapWipe - - install_instr_tapAdvancedWipe - - install_instr_tickData - - install_instr_tapRepairChangeFs - - install_instr_resizeFs - - install_instr_swipeForOk - - install_instr_tapRebootSystem - - install_instr_doNotInstall - stepNumber: 10/10 - titleIcon: icon-download.png \ No newline at end of file diff --git a/src/main/resources/yaml/starlte_new.yml b/src/main/resources/yaml/starlte_new.yml new file mode 100644 index 00000000..291360e1 --- /dev/null +++ b/src/main/resources/yaml/starlte_new.yml @@ -0,0 +1,223 @@ +## Copyright 2021 - ECORP SAS + +## This program is free software: you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This program is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. + +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +## Author: Vincent Bourgmayer +--- +stepsCount: 11 +steps: + f0: + type: custom + stepNumber: 1 + nextStepKey: f1 + titleKey: stepTitle_oemUnlock + instructions: + - install_instr_connectTowifi + - install_instr_openSettingsThenDevOptions + - install_instr_disableAutoUpdateSystem + - install_instr_openSoftwareUpdate + - install_instr_disableAutomaticDownload + - install_instr_clickDlAndInstall + - install_instr_rebootDeviceThenContinue + titleKeyIconName: icon-download.png + f1: + type: custom-executable + stepNumber: 2 + nextStepKey: f2 + titleKey: stepTitle_oemUnlock + instructions: + - install_instr_openSettingsThenDevOptions + - install_instr_enableOEMUnlock + - install_instr_acceptFactoryReset + - install_instr_startDl_pressPowerBixbyVolDown + - install_instr_acceptWarning + titleKeyIconName: icon-download.png + script: wait-download + parameters: + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitDownload_1 + f2: + type: load + stepNumber: 3 + nextStepKey: f3 + titleKey: stepTitle4On7 + instructions: + - install_instr_recoveryInstall + averageTime: 6 + script: install-recovery + parameters: + twrp_image_path: ${TWRP_IMAGE_PATH} + heimdall_folder_path: ${HEIMDALL_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 101: script_error_installRecovery_101 + f3: + type: + stepNumber: 4 + nextStepKey: f4 + titleKey: stepTitle5On7 + instructions: + - install_instr_leaveDl_pressPowerBixbyVolDown + - install_instr_startRec_pressPowerBixbyVolUp + - install_instr_keepReadOnly + titleKeyIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 + f4: + type: + stepNumber: 5 + nextStepKey: f5 + titleKey: stepTitle5On7 + instructions: + - install_instr_tapWipe + - install_instr_tapFormatData + - install_instr_writeYes + - install_instr_validate + - install_instr_backX3 + - install_instr_tapReboot + - install_instr_tapRebootRecovery + - install_instr_doNotInstall + titleKeyIconName: icon-download.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 + f5: + type: + stepNumber: 6 + nextStepKey: f6 + titleKey: stepTitle5On7 + instructions: + - install_instr_swipeTwrp + titleKeyIconName: icon-download.png + script: wait-recovery + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_waitRecovery_1 + 101: script_error_waitRecovery_101 + 102: script_error_waitRecovery_102 + f6: + type: load + stepNumber: 7 + nextStepKey: f7 + titleKey: install_instr_patchInstall + instructions: + - install_instr_patchInstall + averageTime: 55 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${SOURCES_PATH}no-verity-opt-encrypt-samsung-1.0.zip + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 + f7: + type: load + stepNumber: 8 + nextStepKey: f8 + titleKey: install_instr_vendorInstall + instructions: + - install_instr_vendorInstall + averageTime: 65 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${SOURCES_PATH}VENDOR-27_ARI9.zip + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 + f8: + type: load + stepNumber: 9 + nextStepKey: f9 + titleKey: install_instr_eosInstall + instructions: + - install_instr_eosInstall + averageTime: 440 + script: install-from-recovery + parameters: + device_id: ${DEVICE_ID} + archive_path: ${ARCHIVE_PATH} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromRecovery_1 + 2: script_error_installFromRecovery_2 + 3: script_error_installFromRecovery_3 + 101: script_error_installFromRecovery_101 + 102: script_error_installFromRecovery_102 + f9: + type: askAccount + stepNumber: 10 + nextStepKey: f10 + f10: + type: + stepNumber: 11 + nextStepKey: end + titleKey: stepTitle7On7 + instructions: + - install_instr_tapWipe + - install_instr_tapAdvancedWipe + - install_instr_tickData + - install_instr_tapRepairChangeFs + - install_instr_resizeFs + - install_instr_swipeForOk + - install_instr_tapRebootSystem + - install_instr_doNotInstall + titleKeyIconName: icon-download.png + script: wait-reboot + parameters: + device_id: ${DEVICE_ID} + adb_folder_path: ${ADB_FOLDER_PATH} + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 10: script_error_waitReboot_10 + 101: script_error_waitReboot_101 -- GitLab From 7d024c2503268f94c652acc91158b1988e6cc280 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 15:59:51 +0200 Subject: [PATCH 32/39] rename all _new config file to _flash --- src/main/resources/yaml/{FP3_new.yml => FP3_flash.yml} | 0 src/main/resources/yaml/{GS290_new.yml => GS290_flash.yml} | 0 .../resources/yaml/{Teracube_2e_new.yml => Teracube_2e_flash.yml} | 0 .../resources/yaml/{dream2lte_new.yml => dream2lte_flash.yml} | 0 src/main/resources/yaml/{dreamlte_new.yml => dreamlte_flash.yml} | 0 src/main/resources/yaml/{hero2lte_new.yml => hero2lte_flash.yml} | 0 src/main/resources/yaml/{herolte_new.yml => herolte_flash.yml} | 0 src/main/resources/yaml/{star2lte_new.yml => star2lte_flash.yml} | 0 src/main/resources/yaml/{starlte_new.yml => starlte_flash.yml} | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename src/main/resources/yaml/{FP3_new.yml => FP3_flash.yml} (100%) rename src/main/resources/yaml/{GS290_new.yml => GS290_flash.yml} (100%) rename src/main/resources/yaml/{Teracube_2e_new.yml => Teracube_2e_flash.yml} (100%) rename src/main/resources/yaml/{dream2lte_new.yml => dream2lte_flash.yml} (100%) rename src/main/resources/yaml/{dreamlte_new.yml => dreamlte_flash.yml} (100%) rename src/main/resources/yaml/{hero2lte_new.yml => hero2lte_flash.yml} (100%) rename src/main/resources/yaml/{herolte_new.yml => herolte_flash.yml} (100%) rename src/main/resources/yaml/{star2lte_new.yml => star2lte_flash.yml} (100%) rename src/main/resources/yaml/{starlte_new.yml => starlte_flash.yml} (100%) diff --git a/src/main/resources/yaml/FP3_new.yml b/src/main/resources/yaml/FP3_flash.yml similarity index 100% rename from src/main/resources/yaml/FP3_new.yml rename to src/main/resources/yaml/FP3_flash.yml diff --git a/src/main/resources/yaml/GS290_new.yml b/src/main/resources/yaml/GS290_flash.yml similarity index 100% rename from src/main/resources/yaml/GS290_new.yml rename to src/main/resources/yaml/GS290_flash.yml diff --git a/src/main/resources/yaml/Teracube_2e_new.yml b/src/main/resources/yaml/Teracube_2e_flash.yml similarity index 100% rename from src/main/resources/yaml/Teracube_2e_new.yml rename to src/main/resources/yaml/Teracube_2e_flash.yml diff --git a/src/main/resources/yaml/dream2lte_new.yml b/src/main/resources/yaml/dream2lte_flash.yml similarity index 100% rename from src/main/resources/yaml/dream2lte_new.yml rename to src/main/resources/yaml/dream2lte_flash.yml diff --git a/src/main/resources/yaml/dreamlte_new.yml b/src/main/resources/yaml/dreamlte_flash.yml similarity index 100% rename from src/main/resources/yaml/dreamlte_new.yml rename to src/main/resources/yaml/dreamlte_flash.yml diff --git a/src/main/resources/yaml/hero2lte_new.yml b/src/main/resources/yaml/hero2lte_flash.yml similarity index 100% rename from src/main/resources/yaml/hero2lte_new.yml rename to src/main/resources/yaml/hero2lte_flash.yml diff --git a/src/main/resources/yaml/herolte_new.yml b/src/main/resources/yaml/herolte_flash.yml similarity index 100% rename from src/main/resources/yaml/herolte_new.yml rename to src/main/resources/yaml/herolte_flash.yml diff --git a/src/main/resources/yaml/star2lte_new.yml b/src/main/resources/yaml/star2lte_flash.yml similarity index 100% rename from src/main/resources/yaml/star2lte_new.yml rename to src/main/resources/yaml/star2lte_flash.yml diff --git a/src/main/resources/yaml/starlte_new.yml b/src/main/resources/yaml/starlte_flash.yml similarity index 100% rename from src/main/resources/yaml/starlte_new.yml rename to src/main/resources/yaml/starlte_flash.yml -- GitLab From 154cef8972949827c7e078fb752fff006b68fd21 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Wed, 22 Sep 2021 16:01:00 +0200 Subject: [PATCH 33/39] load config file with correct name --- .../controllers/subcontrollers/DeviceDetectedController.java | 2 +- src/main/java/ecorp/easy/installer/threads/ThreadFactory.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java index e789a8f6..04314110 100644 --- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java +++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java @@ -110,7 +110,7 @@ public class DeviceDetectedController extends AbstractSubController{ if(model == null || model.isEmpty()) displayUnknowDeviceFound(); else{ //check that there is config file for this device - URL resourceUrl = getClass().getResource("/yaml/"+phone.getAdbDevice()+"_new.yml"); + URL resourceUrl = getClass().getResource("/yaml/"+phone.getAdbDevice()+"_flash.yml"); if(resourceUrl == null){ //@TODO: this can be replaced or completed with a call to DeviceHelper displayIncompatibleDeviceFound(model); diff --git a/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java b/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java index e681c555..493f2064 100644 --- a/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java +++ b/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java @@ -89,7 +89,7 @@ public class ThreadFactory { Yaml yaml = new Yaml (); //load config file - InputStream is = getClass().getResourceAsStream(yamlFolderPath+modelName+"_new.yml"); + InputStream is = getClass().getResourceAsStream(yamlFolderPath+modelName+"_flash.yml"); Map yamlContent= (Map)yaml.load(is); is.close(); if(yamlContent == null || yamlContent.isEmpty() ) { -- GitLab From e16e1d4749c6ab7e1f8fa72082c7716f36f06cb7 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Fri, 1 Oct 2021 11:11:25 +0200 Subject: [PATCH 34/39] fix issue with exit code for FP3 and remove optionnal node for T2e: titleiconName --- src/main/resources/yaml/FP3_flash.yml | 55 +++++++++---------- src/main/resources/yaml/Teracube_2e_flash.yml | 2 - 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/src/main/resources/yaml/FP3_flash.yml b/src/main/resources/yaml/FP3_flash.yml index db73a76e..304a2607 100644 --- a/src/main/resources/yaml/FP3_flash.yml +++ b/src/main/resources/yaml/FP3_flash.yml @@ -33,11 +33,10 @@ steps: script: wait-fastboot parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitFastboot_1 + okCodes: + 0: ~ + koCodes: + 1: script_error_waitFastboot_1 f2: type: load stepNumber: 3 @@ -49,11 +48,10 @@ steps: script: fp3_oem-unlock parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 10: script_error_oemUnlock_10 + okCodes: + 0: ~ + koCodes: + 10: script_error_oemUnlock_10 f3: type: custom-executable stepNumber: 4 @@ -70,11 +68,10 @@ steps: script: wait-fastboot-unlocked parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_waitFastboot_1 + okCodes: + 0: ~ + koCodes: + 1: script_error_waitFastboot_1 f4: type: load stepNumber: 5 @@ -88,15 +85,14 @@ steps: archive_path: ${ARCHIVE_PATH} fastboot_folder_path: ${ADB_FOLDER_PATH} java_folder_path: ${JAVA_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_installFromFastboot_1 - 2: script_error_installFromFastboot_2 - 3: script_error_installFromFastboot_3 - 101: script_error_installFromFastboot_101 - 102: script_error_installFromFastboot_102 + okCodes: + 0: ~ + koCodes: + 1: script_error_installFromFastboot_1 + 2: script_error_installFromFastboot_2 + 3: script_error_installFromFastboot_3 + 101: script_error_installFromFastboot_101 + 102: script_error_installFromFastboot_102 f5: type: askAccount stepNumber: 6 @@ -113,9 +109,8 @@ steps: script: wait-reboot-from-fastboot parameters: fastboot_folder_path: ${ADB_FOLDER_PATH} - codes: - ok: - 0: ~ - ko: - 1: script_error_unknown - 101: script_error_waitRebootFromFastboot_101 \ No newline at end of file + okCodes: + 0: ~ + koCodes: + 1: script_error_unknown + 101: script_error_waitRebootFromFastboot_101 \ No newline at end of file diff --git a/src/main/resources/yaml/Teracube_2e_flash.yml b/src/main/resources/yaml/Teracube_2e_flash.yml index e244ae4e..f92e4103 100644 --- a/src/main/resources/yaml/Teracube_2e_flash.yml +++ b/src/main/resources/yaml/Teracube_2e_flash.yml @@ -33,7 +33,6 @@ steps: stepNumber: 2 nextStepKey: f2 titleKey: stepTitle_rebootBootloader - titleIconName: ~ instructions: - install_instr_rebootingOnBootloader averageTime: 15 @@ -73,7 +72,6 @@ steps: stepNumber: 4 nextStepKey: f4 titleKey: stepTitle_installOS - titleIconName: ~ instructions: - install_instr_eosInstall averageTime: 215 -- GitLab From 2664f16be4e05cc0552776ba2c93559a14242754 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Fri, 1 Oct 2021 11:12:53 +0200 Subject: [PATCH 35/39] fix String comparaison issue in FlashThread --- src/main/java/ecorp/easy/installer/threads/FlashThread.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/ecorp/easy/installer/threads/FlashThread.java b/src/main/java/ecorp/easy/installer/threads/FlashThread.java index e16b4ed6..3d255dd1 100644 --- a/src/main/java/ecorp/easy/installer/threads/FlashThread.java +++ b/src/main/java/ecorp/easy/installer/threads/FlashThread.java @@ -215,7 +215,7 @@ public class FlashThread extends Thread { try{ //execute scripts String nextCommandKey = firstCommandKey; - while(nextCommandKey != null && nextCommandKey != IStep.LAST_STEP_KEY){ + while(nextCommandKey != null && !nextCommandKey.equals(IStep.LAST_STEP_KEY)){ currentStepCode = nextCommandKey; final IStep step = steps.get(nextCommandKey); final String stepType = step.getType(); @@ -245,7 +245,8 @@ public class FlashThread extends Thread { }catch(Exception e){ showError("java_error_unknow"); - logger.error("Java exception: "+ e.toString()); + e.printStackTrace(); + //logger.error("Java exception: "+ e.toString()); } onRunEnd(); } -- GitLab From a9e1f94d2b073a7547d510854653dd1a9028d651 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Fri, 1 Oct 2021 11:15:18 +0200 Subject: [PATCH 36/39] prevent a NPE in command.java --- src/main/java/ecorp/easy/installer/models/Command.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ecorp/easy/installer/models/Command.java b/src/main/java/ecorp/easy/installer/models/Command.java index 096eaea6..6a24cbde 100644 --- a/src/main/java/ecorp/easy/installer/models/Command.java +++ b/src/main/java/ecorp/easy/installer/models/Command.java @@ -222,8 +222,8 @@ public class Command { * Return the message associated with the exit Value * @return String can be null if exitValue is not define for this step */ - public String getErrorMsg(){ + if(step.getKoCode() == null) return null; return this.step.getKoCode().getOrDefault(this.exitValue, null); } -- GitLab From b04382732af103a81832acad90df99411eb34fbf Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Fri, 1 Oct 2021 16:24:49 +0200 Subject: [PATCH 37/39] fix FP3 last instruction and add a missing title --- src/main/resources/lang/translation.properties | 1 + src/main/resources/yaml/FP3_flash.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/resources/lang/translation.properties b/src/main/resources/lang/translation.properties index c7169370..1d37ff51 100644 --- a/src/main/resources/lang/translation.properties +++ b/src/main/resources/lang/translation.properties @@ -115,6 +115,7 @@ download_lbl_fileAlreadyUptoDate = File is already here and up-to-date. #install ##FP3 +install_title_lockBootloader=Lock the bootloader install_instr_readAllWarning=Read all instructions before to start install_instr_followOfficialGuidanceAt=Follow official guidance at install_instr_selectUnlockBootloader=Select "UNLOCK BOOTLOADER" with "Volume" button diff --git a/src/main/resources/yaml/FP3_flash.yml b/src/main/resources/yaml/FP3_flash.yml index 304a2607..be82c380 100644 --- a/src/main/resources/yaml/FP3_flash.yml +++ b/src/main/resources/yaml/FP3_flash.yml @@ -101,9 +101,9 @@ steps: type: custom-executable stepNumber: 7 nextStepKey: end - titleKey: ~ + titleKey: install_title_lockBootloader titleIconName: icon-download.png - instruction: + instructions: - install_instr_selectLockBootloader - install_instr_lockBootloader script: wait-reboot-from-fastboot -- GitLab From 08a5022fdb1acc0e55a3276a25325f2c75addd0b Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Fri, 1 Oct 2021 16:29:55 +0200 Subject: [PATCH 38/39] fix dreamlte issue in config file --- src/main/resources/yaml/dream2lte_flash.yml | 2 +- src/main/resources/yaml/dreamlte_flash.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/yaml/dream2lte_flash.yml b/src/main/resources/yaml/dream2lte_flash.yml index 8d162221..f52364f2 100644 --- a/src/main/resources/yaml/dream2lte_flash.yml +++ b/src/main/resources/yaml/dream2lte_flash.yml @@ -142,7 +142,7 @@ steps: f6: type: askAccount stepNumber: 7 - nextStepKey: f6 + nextStepKey: f7 f7: type: custom-executable stepNumber: 8 diff --git a/src/main/resources/yaml/dreamlte_flash.yml b/src/main/resources/yaml/dreamlte_flash.yml index 8d162221..f52364f2 100644 --- a/src/main/resources/yaml/dreamlte_flash.yml +++ b/src/main/resources/yaml/dreamlte_flash.yml @@ -142,7 +142,7 @@ steps: f6: type: askAccount stepNumber: 7 - nextStepKey: f6 + nextStepKey: f7 f7: type: custom-executable stepNumber: 8 -- GitLab From ab5513601cc47cd3bc5f0b6f073756c8ee6fcea4 Mon Sep 17 00:00:00 2001 From: vincent Bourgmayer Date: Fri, 1 Oct 2021 17:08:46 +0200 Subject: [PATCH 39/39] fix S9 and S9+ config file: missing step type for many steps --- src/main/resources/yaml/star2lte_flash.yml | 8 ++++---- src/main/resources/yaml/starlte_flash.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/resources/yaml/star2lte_flash.yml b/src/main/resources/yaml/star2lte_flash.yml index 291360e1..585e873c 100644 --- a/src/main/resources/yaml/star2lte_flash.yml +++ b/src/main/resources/yaml/star2lte_flash.yml @@ -67,7 +67,7 @@ steps: 1: script_error_unknown 101: script_error_installRecovery_101 f3: - type: + type: custom-executable stepNumber: 4 nextStepKey: f4 titleKey: stepTitle5On7 @@ -87,7 +87,7 @@ steps: 101: script_error_waitRecovery_101 102: script_error_waitRecovery_102 f4: - type: + type: custom-executable stepNumber: 5 nextStepKey: f5 titleKey: stepTitle5On7 @@ -112,7 +112,7 @@ steps: 10: script_error_waitReboot_10 101: script_error_waitReboot_101 f5: - type: + type: custom-executable stepNumber: 6 nextStepKey: f6 titleKey: stepTitle5On7 @@ -197,7 +197,7 @@ steps: stepNumber: 10 nextStepKey: f10 f10: - type: + type: custom-executable stepNumber: 11 nextStepKey: end titleKey: stepTitle7On7 diff --git a/src/main/resources/yaml/starlte_flash.yml b/src/main/resources/yaml/starlte_flash.yml index 291360e1..585e873c 100644 --- a/src/main/resources/yaml/starlte_flash.yml +++ b/src/main/resources/yaml/starlte_flash.yml @@ -67,7 +67,7 @@ steps: 1: script_error_unknown 101: script_error_installRecovery_101 f3: - type: + type: custom-executable stepNumber: 4 nextStepKey: f4 titleKey: stepTitle5On7 @@ -87,7 +87,7 @@ steps: 101: script_error_waitRecovery_101 102: script_error_waitRecovery_102 f4: - type: + type: custom-executable stepNumber: 5 nextStepKey: f5 titleKey: stepTitle5On7 @@ -112,7 +112,7 @@ steps: 10: script_error_waitReboot_10 101: script_error_waitReboot_101 f5: - type: + type: custom-executable stepNumber: 6 nextStepKey: f6 titleKey: stepTitle5On7 @@ -197,7 +197,7 @@ steps: stepNumber: 10 nextStepKey: f10 f10: - type: + type: custom-executable stepNumber: 11 nextStepKey: end titleKey: stepTitle7On7 -- GitLab