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 44eb6a0a52d7db845da3c5edf907ab5e951f09d4..0431411045c6628068c6966194d4cec4ece09a8e 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()+"_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/controllers/subcontrollers/FlashSceneController.java b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java index dbbf8e9ab0a8acd7dfea191ca8e4760f91aae9fc..e92f5d6ee27dd7d0af3c4e6aefaf6fd5face6234 100644 --- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java +++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java @@ -157,7 +157,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 @@ -171,14 +170,18 @@ 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") - switch(db.getString("stepType")){ - case AppConstants.USER_ACTION_KEY: + final String stepType = db.getString("stepType"); + logger.debug("--Type: {}", 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: diff --git a/src/main/java/ecorp/easy/installer/models/Command.java b/src/main/java/ecorp/easy/installer/models/Command.java index 096eaea6a7ad287d1fddad6a60b71395ed31a8d0..6a24cbde10e6222f8f618b7315bd3f9094076c27 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); } diff --git a/src/main/java/ecorp/easy/installer/models/ProcessMould.java b/src/main/java/ecorp/easy/installer/models/ProcessMould.java index 0ce980874e85073a855ca845a2fc2486ffda59d0..73d79316c405197ec84e37df2a8b0bdc760f79a1 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,8 +45,8 @@ public class ProcessMould { * @param key * @param step */ - public void addStep(String key, Step step){ - this.steps.put(key, 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 2c7983358953231f8f096a1429b04626bffa6921..4014c0fe44d72440804440f4db9f897068df4250 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/models/steps/BasicStep.java b/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java new file mode 100644 index 0000000000000000000000000000000000000000..8bb8f03a26e6e3f776f445ad027abd4dec634f20 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/BasicStep.java @@ -0,0 +1,68 @@ +/* + * 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; + +/** + * 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 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 + 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, String nextStepKey, int stepNumber) { + this.type = type; + this.nextStepKey = nextStepKey; + this.stepNumber = stepNumber; + } + + + @Override + public String getType() { + return type; + } + + @Override + public int getStepNumber() { + return stepNumber; + } + + @Override + 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; + } +} 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 0000000000000000000000000000000000000000..13692a2e0b4c76536f3960f3383202083194dcd1 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomExecutableStep.java @@ -0,0 +1,60 @@ +/* + * 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; + +import ecorp.easy.installer.models.Command; +import java.util.ArrayList; + +/** + * + * @author vincent Bourgmayer + */ +public class CustomExecutableStep extends BasicStep implements ICustomStep, IExecutableStep{ + + private final Command command; + private final String titleKey; + private final String titleIconName; + private final ArrayList textContentKeys; + + public CustomExecutableStep(String type, String nextStepKey, int stepNumber, + String titleKey, String titleIconName, + ArrayList contentKeys, Command command) { + super(type, nextStepKey, stepNumber); + this.titleKey = titleKey; + this.titleIconName = titleIconName; + this.command = command; + this.textContentKeys = contentKeys; + } + + @Override + public String getType(){ + return 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; } + +} 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 0000000000000000000000000000000000000000..ee9f0fcd9b0ac35c09fb17efd2c7cd965cba2adf --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/CustomStep.java @@ -0,0 +1,53 @@ +/* + * 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; + +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 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); + 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; + } +} 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 0000000000000000000000000000000000000000..b036f0bae2f93efea7aecde3d2b168c54c2d674f --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/ExecutableStep.java @@ -0,0 +1,40 @@ +/* + * 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; + +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 final Command command; + + public ExecutableStep(String type, String nextStepKey, int stepNumber, Command command) { + super(type, nextStepKey, stepNumber); + this.command = command; + } + + @Override + public Command getCommand() { + return command; + } +} 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 0000000000000000000000000000000000000000..05dbd41d0141f05a3eb109c7f72d94787e2381fa --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/ICustomStep.java @@ -0,0 +1,52 @@ +/* + * 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; + +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(); + +} 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 0000000000000000000000000000000000000000..aa50d1887972bfb7fc1e1a895e9d9738f5f2fe36 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/IExecutableStep.java @@ -0,0 +1,36 @@ +/* + * 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; + +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(); +} 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 0000000000000000000000000000000000000000..21bdd6513f02624fe798c71a12376c07018882df --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/IStep.java @@ -0,0 +1,56 @@ +/* + * 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; + +/** + * 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 Bourgmayer + */ +public interface IStep { + 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 + * @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/LoadStep.java b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java new file mode 100644 index 0000000000000000000000000000000000000000..15cd311347abd7c39ca80b411a03b9671c34c245 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/models/steps/LoadStep.java @@ -0,0 +1,52 @@ +/* + * 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; + +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, 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; + } + + /** + * 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"; + } +} diff --git a/src/main/java/ecorp/easy/installer/threads/FlashThread.java b/src/main/java/ecorp/easy/installer/threads/FlashThread.java index a736abd1f707ad5c70d83fd7c29155b5da0c8a4d..3d255dd15ed63dcfe05d575a8f166bf020a832c5 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,12 @@ 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 addStep(String key, IStep step){ + logger.debug("FlashThread.addStep({}, ...)", key); + if(step != null && key!= null) + steps.put(key, step); } /** @@ -140,33 +145,49 @@ 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(); - + logger.debug("doBeforeToRunCommand(), currentStepCode: {}", currentStepCode); //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()); - } + logger.debug("--stepType: {}", stepType); + + 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 +211,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.equals(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,12 +240,13 @@ public class FlashThread extends Thread { synchronized(pauseLock){ pauseLock.wait(); } } - nextCommandKey = cmd.getNextCommandKey(); + nextCommandKey = step.getNextStepKey(); } }catch(Exception e){ showError("java_error_unknow"); - logger.error("Java exception: "+ e.toString()); + e.printStackTrace(); + //logger.error("Java exception: "+ e.toString()); } onRunEnd(); } @@ -233,16 +256,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) -> { diff --git a/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java b/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java index fed051d9b13f95124f84774744eed5f41ed1bc2a..493f206489441477192c34b778f50b19d18034f2 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; @@ -77,7 +80,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; } @@ -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+"_flash.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; } 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 0000000000000000000000000000000000000000..9eecebbb92edb5f392565d2bfa16f484e29a79d1 --- /dev/null +++ b/src/main/java/ecorp/easy/installer/utils/ConfigParser.java @@ -0,0 +1,214 @@ +/* + * 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; + +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; +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.LinkedHashMap; +import java.util.Map; +import org.slf4j.Logger; +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 { + private final static Logger logger = LoggerFactory.getLogger(ConfigParser.class); + + /** + * Create a single Step instance from a Map containing yaml content + * @param yaml + * @return the IStep implementation's instance + * @throws ParseException + * @throws NumberFormatException + */ + public static IStep parseStep(Map yaml) throws ParseException, NumberFormatException, NullPointerException{ + 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 = parseCustomExecutableStep(yaml, type); + //Example: reboot from download mode into twrp, etc. + break; + case "executable": + result = parseExecutableStep(yaml, type); + //Example: Device detection + break; + default: + result = parseBasicStep(yaml, type); + break; + } + 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 + * @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, ClassCastException{ + final int stepNumber = (int) yaml.get("stepNumber"); + final String nextStepKey = (String) yaml.get("nextStepKey"); + + 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, ClassCastException{ + 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.getOrDefault("titleIconName", ""); + final ArrayList instructions = (ArrayList) yaml.getOrDefault("instructions", new ArrayList()); + final int averageTime = (int) yaml.get("averageTime"); + + final Command cmd = parseCommand(yaml); + LoadStep result = new LoadStep(type, nextStepKey, stepNumber , + 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, ClassCastException{ + logger.debug("parseCustomStep(yaml)"); + int stepNumber = (int)yaml.get("stepNumber"); + String nextStepKey = (String) yaml.get("nextStepKey"); + String titleKey = (String) yaml.get("titleKey"); + String titleIconName = (String) yaml.get("titleIconName"); + ArrayList instructions = (ArrayList) yaml.getOrDefault("instructions", new ArrayList()); + + 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, 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; + } + + /** + * 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")+( 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; + } + + /** + * 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 ExecutableCustomStep the step + */ + private static CustomExecutableStep parseCustomExecutableStep(Map yaml, String type) throws ParseException, ClassCastException{ + 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.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); + return result; + } +} diff --git a/src/main/resources/lang/translation.properties b/src/main/resources/lang/translation.properties index 6b26e9a6a564cd8a7f8a88ddca5ea3991dd19480..3bc3c07fb83317534dfaa9f1dd91f1426c7f268d 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.yml b/src/main/resources/yaml/FP3.yml deleted file mode 100644 index 2a36c2eaaa98c073f4106dd14787857af12dba7f..0000000000000000000000000000000000000000 --- 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_flash.yml b/src/main/resources/yaml/FP3_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..be82c380ec5885de9bfbcad989cf8bd3046cd2e2 --- /dev/null +++ b/src/main/resources/yaml/FP3_flash.yml @@ -0,0 +1,116 @@ +## 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} + okCodes: + 0: ~ + koCodes: + 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} + okCodes: + 0: ~ + koCodes: + 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} + okCodes: + 0: ~ + koCodes: + 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} + 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 + nextStepKey: f6 + f6: + type: custom-executable + stepNumber: 7 + nextStepKey: end + titleKey: install_title_lockBootloader + titleIconName: icon-download.png + instructions: + - install_instr_selectLockBootloader + - install_instr_lockBootloader + script: wait-reboot-from-fastboot + parameters: + fastboot_folder_path: ${ADB_FOLDER_PATH} + 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/FP3_fs.yml b/src/main/resources/yaml/FP3_fs.yml index ba9890b67aea9081ff7206e180ce5d2557c09c9b..88ca6731a38b15d8aae742d206fda80c63840203 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/GS290.yml b/src/main/resources/yaml/GS290.yml deleted file mode 100644 index 9817806aa1bfd7f35840d2c58dd9d0a290ef6469..0000000000000000000000000000000000000000 --- a/src/main/resources/yaml/GS290.yml +++ /dev/null @@ -1,110 +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: - 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: - 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/GS290_flash.yml b/src/main/resources/yaml/GS290_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..112ff8d20ec7bfee6658c123138ac7cb7722b6b1 --- /dev/null +++ b/src/main/resources/yaml/GS290_flash.yml @@ -0,0 +1,132 @@ +## 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: 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: 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: 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: 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: 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: custom-executable + stepNumber: 7 + 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/GS290_fs.yml b/src/main/resources/yaml/GS290_fs.yml index c0e2c7f976888279b2f72adcbd3082d6aef85919..ecb849f0b54eef355cda81d247cddeb73a23a946 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/Teracube_2e.yml b/src/main/resources/yaml/Teracube_2e.yml deleted file mode 100644 index d5f71fa74dbc55888ef310c1b1ec44686732aa5c..0000000000000000000000000000000000000000 --- 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_flash.yml b/src/main/resources/yaml/Teracube_2e_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..f92e4103ca901f20573286f11a2599c6fdd33b9b --- /dev/null +++ b/src/main/resources/yaml/Teracube_2e_flash.yml @@ -0,0 +1,122 @@ +## 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 + 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 + instructions: + - install_instr_rebootingOnBootloader + averageTime: 15 + 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 + 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} + 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 + instructions: + - install_instr_eosInstall + averageTime: 215 + 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} + 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: 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_fs.yml b/src/main/resources/yaml/Teracube_2e_fs.yml index b8c6ae3bbeca323850850dd3559a04603ad82f3a..41f90507df0ed62a02f693e752bfabf538048550 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 diff --git a/src/main/resources/yaml/dream2lte.yml b/src/main/resources/yaml/dream2lte.yml deleted file mode 100644 index fac9e786fe54887ae8a1897998abdc4c728e7450..0000000000000000000000000000000000000000 --- 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_flash.yml b/src/main/resources/yaml/dream2lte_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..f52364f20abc372336e71eb2f8cf2f7a8b0f6162 --- /dev/null +++ b/src/main/resources/yaml/dream2lte_flash.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: f7 + 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/dream2lte_fs.yml b/src/main/resources/yaml/dream2lte_fs.yml index 05c7833a9fc4ba82be4d16ca2563c2ee666e0a69..81cfb3fcf41c55e14d678ab75146803299b9f378 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/dreamlte.yml b/src/main/resources/yaml/dreamlte.yml deleted file mode 100644 index dfe13b104be8d44f04d72b93d2609f96fb48199b..0000000000000000000000000000000000000000 --- 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_flash.yml b/src/main/resources/yaml/dreamlte_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..f52364f20abc372336e71eb2f8cf2f7a8b0f6162 --- /dev/null +++ b/src/main/resources/yaml/dreamlte_flash.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: f7 + 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_fs.yml b/src/main/resources/yaml/dreamlte_fs.yml index 8b108b5a6518cb1ec3fdf41dd7b71c036b0eca64..865c0d77e3acfc30516e0d2eecbd7478c3d92682 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/hero2lte.yml b/src/main/resources/yaml/hero2lte.yml deleted file mode 100644 index 7a06b4c802fbf98d1b476a755b6caa53f7367a37..0000000000000000000000000000000000000000 --- 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_flash.yml b/src/main/resources/yaml/hero2lte_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..f9d5ace455c98792f172f17c3d49188f03d231c1 --- /dev/null +++ b/src/main/resources/yaml/hero2lte_flash.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/hero2lte_fs.yml b/src/main/resources/yaml/hero2lte_fs.yml index afa1c0c27a0f3d6b73bef9a0922a9617bfb24b6e..a5bf1bbad101201f89c38654c0847cd7e181754d 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/herolte.yml b/src/main/resources/yaml/herolte.yml deleted file mode 100644 index 8021fbca705165655b5b8a5e2df6679dbfda79f9..0000000000000000000000000000000000000000 --- 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_flash.yml b/src/main/resources/yaml/herolte_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..f9d5ace455c98792f172f17c3d49188f03d231c1 --- /dev/null +++ b/src/main/resources/yaml/herolte_flash.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_fs.yml b/src/main/resources/yaml/herolte_fs.yml index 36bf18af23cd39766b4b90fc77d0da0e00826f58..33f682b9a5a629c53aea78e98ca437eed6cce02f 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/star2lte.yml b/src/main/resources/yaml/star2lte.yml deleted file mode 100644 index 2e9d41ef84bcf8f1b8b5eaba1219e0969b9e4784..0000000000000000000000000000000000000000 --- 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_flash.yml b/src/main/resources/yaml/star2lte_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..585e873cd7670c8b9ff75d0c597f4dc6dbec702d --- /dev/null +++ b/src/main/resources/yaml/star2lte_flash.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: custom-executable + 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: custom-executable + 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: custom-executable + 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: custom-executable + 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/star2lte_fs.yml b/src/main/resources/yaml/star2lte_fs.yml index cdaddcfb71ebaf0d21d18f934a6ce3fb1bf043d2..e036cd171e058dc4b754f10ccdcf9d8c439a7f6e 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/starlte.yml b/src/main/resources/yaml/starlte.yml deleted file mode 100644 index 3f9af81cfdafd603e313f6680399cdc4bfed268d..0000000000000000000000000000000000000000 --- 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_flash.yml b/src/main/resources/yaml/starlte_flash.yml new file mode 100644 index 0000000000000000000000000000000000000000..585e873cd7670c8b9ff75d0c597f4dc6dbec702d --- /dev/null +++ b/src/main/resources/yaml/starlte_flash.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: custom-executable + 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: custom-executable + 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: custom-executable + 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: custom-executable + 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_fs.yml b/src/main/resources/yaml/starlte_fs.yml index e766da838f6f081ee1746a956a647aa4acc48bd3..d9a906d955cbe48b1535d840a38ab926a9d993b6 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/test/java/ecorp/easy/installer/utils/ConfigParserTest.java b/src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java new file mode 100644 index 0000000000000000000000000000000000000000..e7bc4000b1024d91a4e64fe653c787639c4856fe --- /dev/null +++ b/src/test/java/ecorp/easy/installer/utils/ConfigParserTest.java @@ -0,0 +1,167 @@ +/* + * 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; + +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); + } +} diff --git a/src/test/resources/yaml/parsingTest.yml b/src/test/resources/yaml/parsingTest.yml new file mode 100644 index 0000000000000000000000000000000000000000..3990e614fd13273545dabfb85df8d00dc719e507 --- /dev/null +++ b/src/test/resources/yaml/parsingTest.yml @@ -0,0 +1,75 @@ +## 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: + 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 + 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 + 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 + okCodes: + 0: test_lbl_cmdSuccess + koCodes: + 1: test_lbl_cmdFailure + averageTime: 25 \ No newline at end of file