diff --git a/flash-scripts/linux/fp2_install-from-recovery.sh b/flash-scripts/linux/fp2_install-from-recovery.sh
new file mode 100755
index 0000000000000000000000000000000000000000..32b9f95ccff0548fb3ee67353d5e66982c1cab27
--- /dev/null
+++ b/flash-scripts/linux/fp2_install-from-recovery.sh
@@ -0,0 +1,97 @@
+#!/bin/bash
+
+# Copyright (C) 2021 Author: Ingo
+# Copyright (C) 2021 ECORP SAS - Author: Vincent Bourgmayer
+#
+# 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 .
+
+# Parameter
+# $1: DEVICE_ID device identifier
+# $2: ARCHIVE_PATH path to the /e/ archive to flash
+# $3: ADB_FOLDER_PATH: the path where runnable adb is stored
+
+# Exit status
+# - 0 : /e/ installed
+# - 1 : Problems occurred (adb returns only 1 if an error occurs)
+# - 2 : Problems occurred during file transfer
+# - 3 : Problems occurred /e/ installation
+# - 101 : DEVICE_ID missing
+# - 102 : ARCHIVE_PATH missing
+# - 103 : ADB_FOLDER_PATH missing
+
+DEVICE_ID=$1
+ARCHIVE_PATH=$2
+ARCHIVE_NAME=$(basename "$2")
+ADB_FOLDER_PATH=$3
+ADB_PATH=${ADB_FOLDER_PATH}"adb"
+
+echo "adb path : $ADB_PATH"
+
+if [ -z "$DEVICE_ID" ]
+then
+ exit 101
+fi
+
+if [ -z "$ARCHIVE_PATH" ]
+then
+ exit 102
+fi
+
+if [ -z "$ADB_FOLDER_PATH" ]
+then
+ exit 103
+fi
+
+sleep 10
+
+"$ADB_PATH" -s "$DEVICE_ID" shell "twrp wipe system" ;
+
+echo "system wiped"
+
+sleep 10
+
+"$ADB_PATH" -s "$DEVICE_ID" shell "twrp wipe cache" ;
+
+echo "cache wiped"
+
+sleep 10
+"$ADB_PATH" -s "$DEVICE_ID" shell "twrp wipe data" ;
+
+echo "data wiped"
+
+sleep 10
+
+echo "start installing ZIP archive"
+
+"$ADB_PATH" -s "$DEVICE_ID" shell "mkdir /cache/recovery" ;
+
+echo "created /cache/recovery"
+
+if ! "$ADB_PATH" -s "$DEVICE_ID" push "$ARCHIVE_PATH" /sdcard ;
+then exit 2 ; fi
+
+echo "pushed ZIP archive"
+
+if ! "$ADB_PATH" -s "$DEVICE_ID" shell twrp install /sdcard/"$ARCHIVE_NAME" ;
+then exit 3 ; fi
+
+echo "installed ZIP archive"
+
+sleep 1
+
+"$ADB_PATH" -s "$DEVICE_ID" shell rm /sdcard/"$ARCHIVE_NAME" ;
+
+echo "removed ZIP archive"
+
+sleep 1
\ No newline at end of file
diff --git a/flash-scripts/linux/fp2_install-twrp-from-fastboot.sh b/flash-scripts/linux/fp2_install-twrp-from-fastboot.sh
new file mode 100755
index 0000000000000000000000000000000000000000..e9f085a0f914c1226a5072f62cda3bd4bd6478d1
--- /dev/null
+++ b/flash-scripts/linux/fp2_install-twrp-from-fastboot.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+# Copyright (C) 2021 Author: Ingo
+# Copyright (C) 2021 ECORP SAS - Author: Vincent Bourgmayer
+#
+# 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 .
+
+# Parameter
+# $1: TWRP_IMAGE_PATH need twrp path (${TWRP_FOLDER}/${TWRP})
+# $2: The folder where fastboot runnable is stored
+
+# Exit status
+# - 0 : Recovery installed
+# - 1 : No problems occurred
+# - 101 : TWRP_IMAGE_PATH missing
+# - 102 : FASTBOOT_FOLDER_PATH missing
+
+TWRP_IMAGE_PATH=$1
+FASTBOOT_FOLDER_PATH=$2
+FASTBOOT_PATH=${FASTBOOT_FOLDER_PATH}"fastboot"
+
+echo "fastboot path: $FASTBOOT_PATH"
+
+if [ -z "$TWRP_IMAGE_PATH" ]
+then
+ echo "TWRP Image path is empty"
+ exit 101
+fi
+
+if [ -z "$FASTBOOT_FOLDER_PATH" ]
+then
+ exit 102
+fi
+
+
+if ! "$FASTBOOT_PATH" flash recovery "$TWRP_IMAGE_PATH"
+then
+ exit 2
+fi
+echo "flashed recovery"
\ No newline at end of file
diff --git a/flash-scripts/windows/fp2_install-from-recovery.bat b/flash-scripts/windows/fp2_install-from-recovery.bat
new file mode 100644
index 0000000000000000000000000000000000000000..3b14459d7a8a2c06848bebd11202b3146236f6d3
--- /dev/null
+++ b/flash-scripts/windows/fp2_install-from-recovery.bat
@@ -0,0 +1,78 @@
+:: Copyright (C) 2021 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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 .
+
+:: Parameter
+:: $1: DEVICE_ID device identifier
+:: $2: ARCHIVE_PATH path to the /e/ archive to flash
+:: $3: ADB_FOLDER_PATH: the path where runnable adb is stored
+:: Exit status
+:: - 0 : /e/ installed
+:: - 1 : Problems occurred (adb returns only 1 if an error occurs)
+:: - 2 : Problems occurred during file transfer
+:: - 3 : Problems occurred /e/ installation
+:: - 101 : DEVICE_ID missing
+:: - 102 : ARCHIVE_PATH missing
+
+set DEVICE_ID="%1"
+set ARCHIVE_PATH="%~2"
+set ADB_FOLDER_PATH=%~3
+set ADB_PATH="%ADB_FOLDER_PATH%adb"
+:: get basename of archive
+for %%a in ("%ARCHIVE_PATH%") do (
+ set "ARCHIVE_NAME=%%~nxa"
+ echo %ARCHIVE_NAME%
+)
+
+if not defined %DEVICE_ID (
+ exit /b 101
+)
+
+if not defined %ARCHIVE_PATH (
+ exit /b 102
+)
+
+%ADB_PATH% -s %DEVICE_ID% shell "twrp wipe system"
+echo "system wiped"
+ping 127.0.0.1 -n 10 -w 1000 >NUL
+
+%ADB_PATH% -s %DEVICE_ID% shell "twrp wipe cache"
+echo "cache wiped"
+ping 127.0.0.1 -n 10 -w 1000 >NUL
+
+%ADB_PATH% -s %DEVICE_ID% shell "twrp wipe data"
+echo "data wiped"
+ping 127.0.0.1 -n 10 -w 1000 >NUL
+
+echo "start installing ZIP archive"
+
+%ADB_PATH% -s %DEVICE_ID% shell "mkdir /cache/recovery" ;
+
+echo "created /cache/recovery"
+
+%ADB_PATH% -s %DEVICE_ID% push %ARCHIVE_PATH% /sdcard
+if errorLevel 1 ( exit /b 2 )
+echo "pushed ZIP archive"
+
+%ADB_PATH% -s %DEVICE_ID% shell twrp install /sdcard/%ARCHIVE_NAME%
+if errorLevel 1 ( exit /b 3 )
+echo "installed ZIP archive"
+::Timeout 1
+ping 127.0.0.1 -n 2 -w 1000 >NUL
+
+%ADB_PATH% -s %DEVICE_ID% shell rm /sdcard/%ARCHIVE_NAME%
+echo "removed ZIP archive"
+ping 127.0.0.1 -n 2 -w 1000 >NUL
+
+exit /b 0
\ No newline at end of file
diff --git a/flash-scripts/windows/fp2_install-twrp-from-fastboot.bat b/flash-scripts/windows/fp2_install-twrp-from-fastboot.bat
new file mode 100644
index 0000000000000000000000000000000000000000..02869649678c754dc498b0a8b670087a94233e3e
--- /dev/null
+++ b/flash-scripts/windows/fp2_install-twrp-from-fastboot.bat
@@ -0,0 +1,39 @@
+:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
+::
+:: 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 .
+
+:: Parameter
+:: $1: TWRP_IMAGE_PATH need twrp path (${TWRP_FOLDER}/${TWRP})
+:: $2: The folder where heimdall runnable is stored
+:: Exit status
+:: - 0 : Recovery installed
+:: - 1 : No problems occurred (heimdall returns only 1 if an error occurs)
+:: - 101 : TWRP_IMAGE_PATH missing
+
+set TWRP_IMAGE_PATH=%1
+set FASTBOOT_FOLDER_PATH=%~2
+set FASTBOOT_PATH="%FASTBOOT_FOLDER_PATH%fastboot"
+
+echo "fastboot path: $FASTBOOT_PATH"
+
+if not defined %TWRP_IMAGE_PATH (
+ echo "TWRP Image path is empty"
+ exit /b 101
+)
+
+%FASTBOOT_PATH% flash recovery %TWRP_IMAGE_PATH%
+if errorLevel 1 ( exit /b 2 )
+echo "flashed recovery"
+
+exit /b 0
\ No newline at end of file
diff --git a/flash-scripts/windows/wait-fastboot.bat b/flash-scripts/windows/wait-fastboot.bat
index 769a8ad5b59d50ab5718a609c373ce772e83c42a..9f67ad672313f1eeaa8a2d91741341efaa37b28c 100755
--- a/flash-scripts/windows/wait-fastboot.bat
+++ b/flash-scripts/windows/wait-fastboot.bat
@@ -1,4 +1,4 @@
-:: Copyright (C) 2020 - Author: Ingo
+:: Copyright (C) 2020 - Author: Ingo
:: Copyright (C) 2020 ECORP SAS - Author: Vincent Bourgmayer
::
:: This program is free software: you can redistribute it and/or modify
diff --git a/src/main/java/ecorp/easy/installer/AppConstants.java b/src/main/java/ecorp/easy/installer/AppConstants.java
index 69dce99edd8ce213a4a26c4f346e6253a4a26397..fc7713570d409f0f863812b03dbad882428c3dfa 100644
--- a/src/main/java/ecorp/easy/installer/AppConstants.java
+++ b/src/main/java/ecorp/easy/installer/AppConstants.java
@@ -15,8 +15,9 @@
* along with this program. If not, see .
*/
package ecorp.easy.installer;
-import java.nio.file.FileSystems;
+
import java.io.File;
+import java.nio.file.FileSystems;
import java.nio.file.Paths;
/**
diff --git a/src/main/java/ecorp/easy/installer/controllers/MainWindowController.java b/src/main/java/ecorp/easy/installer/controllers/MainWindowController.java
index 6259a3421ac5a7dc31f940b66c185f9ab53467f8..47f6b49933b9c2322bb285776491db55bfe79b9c 100644
--- a/src/main/java/ecorp/easy/installer/controllers/MainWindowController.java
+++ b/src/main/java/ecorp/easy/installer/controllers/MainWindowController.java
@@ -17,33 +17,32 @@
package ecorp.easy.installer.controllers;
import ecorp.easy.installer.AppConstants;
-import ecorp.easy.installer.controllers.subcontrollers.AbstractSubController;
import ecorp.easy.installer.EasyInstaller;
+import ecorp.easy.installer.controllers.subcontrollers.AbstractSubController;
import ecorp.easy.installer.models.Phone;
import ecorp.easy.installer.threads.ThreadFactory;
import ecorp.easy.installer.utils.UiUtils;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.ResourceBundle;
import javafx.animation.FadeTransition;
-
-import javafx.fxml.Initializable;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.event.EventHandler;
-import javafx.scene.control.Label;
-import javafx.scene.input.MouseEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
+import javafx.fxml.Initializable;
import javafx.scene.Node;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.input.MouseEvent;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.Pane;
-import javafx.scene.control.Button;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.ResourceBundle;
/**
* Main window Controller class
*
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..8180c36dfdb75f92874b0cffe4c01a1b275c137d 100644
--- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java
+++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java
@@ -21,9 +21,6 @@ import ecorp.easy.installer.AppConstants;
import ecorp.easy.installer.models.Phone;
import ecorp.easy.installer.tasks.DeviceDetectionTask;
import ecorp.easy.installer.utils.UiUtils;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.ResourceBundle;
import javafx.concurrent.WorkerStateEvent;
import javafx.fxml.FXML;
import javafx.geometry.Pos;
@@ -34,6 +31,9 @@ import javafx.scene.layout.VBox;
import javafx.scene.text.TextAlignment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+
+import java.net.URL;
+import java.util.ResourceBundle;
/**
*
* @author Vincent Bourgmayer
diff --git a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DownloadSrcController.java b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DownloadSrcController.java
index d801afb079cdedf1b6a862ea63c4404c9820420a..6c996346e946826a83525abd709430ae5b541a5c 100644
--- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DownloadSrcController.java
+++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/DownloadSrcController.java
@@ -18,13 +18,15 @@ package ecorp.easy.installer.controllers.subcontrollers;
import ecorp.easy.installer.controllers.MainWindowController;
+import ecorp.easy.installer.models.SourceToDownload;
import ecorp.easy.installer.tasks.DownloadTask;
import ecorp.easy.installer.utils.UiUtils;
import java.net.URL;
import java.util.Arrays;
import java.util.Iterator;
-import java.util.Map;
+import java.util.List;
import java.util.ResourceBundle;
+
import javafx.concurrent.Service;
import javafx.concurrent.Task;
import javafx.concurrent.Worker.State;
@@ -46,9 +48,8 @@ public class DownloadSrcController extends AbstractSubController {
private @FXML Label progressLabel;
private @FXML Label progressTitle;
private @FXML Button restartDownloadBtn;
-
- private Map sourcesToDownload;
- private Iterator> taskIterator;
+
+ private Iterator taskIterator;
private DownloadService currentService;
@Override
@@ -60,18 +61,18 @@ public class DownloadSrcController extends AbstractSubController {
@Override
public void setParentController(MainWindowController parentController){
super.setParentController(parentController);
- sourcesToDownload = parentController.getThreadFactory().getSourcesToDownload();
- taskIterator = sourcesToDownload.entrySet().iterator();
+ List sourcesToDownload = parentController.getThreadFactory().getSourcesToDownload();
+ taskIterator = sourcesToDownload.iterator();
startNextDownload();
}
private boolean startNextDownload(){
logger.info("startNextDownload()");
- logger.debug("taskIterator has next ? {} "+taskIterator.hasNext());
+ logger.debug("taskIterator has next ? {} ", taskIterator.hasNext());
if(taskIterator.hasNext()){
- Map.Entry source = taskIterator.next();
+ SourceToDownload sourceToDownload = taskIterator.next();
- currentService = new DownloadService(source.getKey(), source.getValue());
+ currentService = new DownloadService(sourceToDownload);
bindProgressUIToService(currentService);
currentService.start();
return true;
@@ -100,7 +101,7 @@ public class DownloadSrcController extends AbstractSubController {
/**
* Bind UI properties to Service, and start the download Service
- * @param DownloadService
+ * @param service
*/
private void bindProgressUIToService(DownloadService service){
logger.info("bindProgressUIToService()");
@@ -151,18 +152,16 @@ public class DownloadSrcController extends AbstractSubController {
*/
private class DownloadService extends Service{
- private final String url;
- private final String fileName;
-
- public DownloadService(String url, String fileName){
- this.url = url;
- this.fileName = fileName;
+ private final SourceToDownload sourceToDownload;
+
+ public DownloadService(SourceToDownload sourceToDownload) {
+ this.sourceToDownload = sourceToDownload;
}
@Override
protected Task createTask() {
- logger.info("DownloadService.createTask({},{})", url, fileName);
- return new DownloadTask(url, fileName, i18n);
+ logger.info("DownloadService.createTask({},{},{})", sourceToDownload.getUrl(), sourceToDownload.getFilePath(), sourceToDownload.getCheckSumExt());
+ return new DownloadTask(sourceToDownload, i18n);
}
@Override
diff --git a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FeedbackController.java b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FeedbackController.java
index 9a55904305246cbe0fb73f0ed7dd106b33af6472..49e5dfa5cd7416b7130ef138a9f45bb45680e7a4 100644
--- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FeedbackController.java
+++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FeedbackController.java
@@ -21,13 +21,6 @@ import ecorp.easy.installer.controllers.MainWindowController;
import ecorp.easy.installer.models.Phone;
import ecorp.easy.installer.tasks.UploadToEcloudTask;
import ecorp.easy.installer.utils.UiUtils;
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.time.LocalDateTime;
-import java.util.UUID;
-import java.util.regex.Pattern;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
@@ -36,6 +29,14 @@ import javafx.scene.input.MouseEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.BufferedWriter;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.time.LocalDateTime;
+import java.util.UUID;
+import java.util.regex.Pattern;
+
/**
* FXML Controller class
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 ea4470ab834921f6ed7b4fabc3653cfa862d715a..a113a3bdbc865398244bb25b92c502d77df3c0f7 100644
--- a/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java
+++ b/src/main/java/ecorp/easy/installer/controllers/subcontrollers/FlashSceneController.java
@@ -16,7 +16,6 @@
*/
package ecorp.easy.installer.controllers.subcontrollers;
-import ch.qos.logback.classic.LoggerContext;
import ecorp.easy.installer.AppConstants;
import ecorp.easy.installer.controllers.MainWindowController;
import ecorp.easy.installer.graphics.FlashGlobalProgressManager;
@@ -24,15 +23,10 @@ import ecorp.easy.installer.helpers.DeviceHelper;
import ecorp.easy.installer.logger.GUIAppender;
import ecorp.easy.installer.logger.LogPathPropertyDefiner;
import ecorp.easy.installer.models.DataBundle;
-import ecorp.easy.installer.threads.FlashThread;
import ecorp.easy.installer.tasks.UploadToEcloudTask;
+import ecorp.easy.installer.threads.FlashThread;
import ecorp.easy.installer.utils.IFlashHandler;
import ecorp.easy.installer.utils.UiUtils;
-
-import java.net.URL;
-import java.util.List;
-import java.util.Locale;
-import java.util.ResourceBundle;
import javafx.animation.FadeTransition;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
@@ -41,11 +35,7 @@ import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.geometry.Pos;
import javafx.scene.Node;
-import javafx.scene.control.Button;
-import javafx.scene.control.ContentDisplay;
-import javafx.scene.control.Label;
-import javafx.scene.control.ProgressBar;
-import javafx.scene.control.ScrollPane;
+import javafx.scene.control.*;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.MouseEvent;
@@ -56,6 +46,11 @@ import javafx.util.Duration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.net.URL;
+import java.util.List;
+import java.util.Locale;
+import java.util.ResourceBundle;
+
/**
* FXML Controller class
*
diff --git a/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java b/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java
index af576980fb310caa82f6ba4de238bc32a9c11c5f..4d47d42a19555fb87cca1ced3990b897d9a8eb35 100644
--- a/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java
+++ b/src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java
@@ -33,6 +33,7 @@ public class DeviceHelper {
put("dreamlte", "0007");
put("FP3", "0008");
put("GS290", "0009");
+ put("FP2", "0010");
put("Teracube_2e", "0011");
}};
diff --git a/src/main/java/ecorp/easy/installer/models/SourceToDownload.java b/src/main/java/ecorp/easy/installer/models/SourceToDownload.java
new file mode 100644
index 0000000000000000000000000000000000000000..3321092df8345a456591fca68133af783c54b4d7
--- /dev/null
+++ b/src/main/java/ecorp/easy/installer/models/SourceToDownload.java
@@ -0,0 +1,29 @@
+package ecorp.easy.installer.models;
+
+/**
+ *
+ * @author Ingo
+ */
+public class SourceToDownload {
+ private final String url;
+ private final String filePath;
+ private final String checkSumExt;
+
+ public SourceToDownload(String url, String filePath, String checkSumExt) {
+ this.url = url;
+ this.filePath = filePath;
+ this.checkSumExt = checkSumExt;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getFilePath() {
+ return filePath;
+ }
+
+ public String getCheckSumExt() {
+ return checkSumExt;
+ }
+}
diff --git a/src/main/java/ecorp/easy/installer/tasks/DeviceDetectionTask.java b/src/main/java/ecorp/easy/installer/tasks/DeviceDetectionTask.java
index 6fa747b2b8c2eb2b03680e8390f0be592a60c25c..d6283b172bac2422ce3b948ccb5e417176470301 100644
--- a/src/main/java/ecorp/easy/installer/tasks/DeviceDetectionTask.java
+++ b/src/main/java/ecorp/easy/installer/tasks/DeviceDetectionTask.java
@@ -20,11 +20,12 @@ import ecorp.easy.installer.AppConstants;
import ecorp.easy.installer.exceptions.TooManyDevicesException;
import ecorp.easy.installer.models.Command;
import ecorp.easy.installer.models.Phone;
-import java.util.regex.Pattern;
import javafx.concurrent.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.util.regex.Pattern;
+
/**
* This class provide task which run ADB command in background to detect that a device is reachable
* @author vincent Bourgmayer
diff --git a/src/main/java/ecorp/easy/installer/tasks/DownloadTask.java b/src/main/java/ecorp/easy/installer/tasks/DownloadTask.java
index eaa4a5e822967fd3327e30765a0a4986b3a89827..7408bb1ae1c3f0600557c86f017db44c3eeb8598 100644
--- a/src/main/java/ecorp/easy/installer/tasks/DownloadTask.java
+++ b/src/main/java/ecorp/easy/installer/tasks/DownloadTask.java
@@ -17,6 +17,7 @@
package ecorp.easy.installer.tasks;
import ecorp.easy.installer.AppConstants;
+import ecorp.easy.installer.models.SourceToDownload;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
@@ -41,6 +42,7 @@ import java.util.Date;
import java.util.Locale;
import java.util.ResourceBundle;
import java.util.Scanner;
+
import javafx.concurrent.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -51,7 +53,6 @@ import org.slf4j.LoggerFactory;
* @author Ingo
*/
public class DownloadTask extends Task{
- private final static String checkSumExtension = ".sha256sum";
private final static Logger logger = LoggerFactory.getLogger(DownloadTask.class);
/**
* Constant size
@@ -63,19 +64,16 @@ public class DownloadTask extends Task{
private static final String[] CST_UNITS = {"KB", "MB", "GB", "TB"};
final private ResourceBundle i18n;
- final private String targetUrl;
- final private String fileName;
-
+ private final SourceToDownload sourceToDownload;
+
/**
- * COnstruction of the download task
- * @param targetUrl the web path to the resource
- * @param fileName name of the file
+ * Construction of the download task
+ * @param sourceToDownload url to download, target filename, extension of the checksum file
* @param resources used to send already translated message
*/
- public DownloadTask(String targetUrl, String fileName, ResourceBundle resources){
- this.targetUrl = targetUrl;
- this.fileName = fileName;
+ public DownloadTask(SourceToDownload sourceToDownload, ResourceBundle resources){
this.i18n = resources;
+ this.sourceToDownload = sourceToDownload;
}
/**
* @inheritDoc
@@ -86,21 +84,21 @@ public class DownloadTask extends Task{
protected Boolean call() throws Exception {
//build local filePath
- final String localFilePath = AppConstants.getSourcesFolderPath()+fileName;
+ final String localFilePath = AppConstants.getSourcesFolderPath() + sourceToDownload.getFilePath();
//Check if already exist and integrity
- final String checksumFilePath = localFilePath+checkSumExtension;
+ final String checksumFilePath = localFilePath + sourceToDownload.getCheckSumExt();
if(isCancelled()) return false;
- this.updateTitle("Downloading "+fileName+checkSumExtension);
+ this.updateTitle("Downloading " + sourceToDownload.getFilePath() + sourceToDownload.getCheckSumExt());
- File checksumLmdFile = new File(AppConstants.getSourcesFolderPath()+"lmd."+fileName+checkSumExtension);
+ File checksumLmdFile = new File(AppConstants.getSourcesFolderPath() + "lmd." + sourceToDownload.getFilePath() + sourceToDownload.getCheckSumExt());
checksumLmdFile.createNewFile();
// Download checksum. If file not downloaded return false and stop downloadin because integrity isn't guaranteed
- if( !downloadFile(targetUrl+checkSumExtension, checksumFilePath,checksumLmdFile) ){
+ if(!downloadFile(sourceToDownload.getUrl() + sourceToDownload.getCheckSumExt(), checksumFilePath, checksumLmdFile)) {
updateMessage(i18n.getString("download_lbl_cantcheckIntegrity"));
return false;
}
@@ -114,14 +112,14 @@ public class DownloadTask extends Task{
if(isCancelled()) return false;
- this.updateTitle("Downloading "+fileName);
+ this.updateTitle("Downloading " + sourceToDownload.getFilePath());
- final String tmpFilePath = AppConstants.getSourcesFolderPath()+"tmp."+fileName;
+ final String tmpFilePath = AppConstants.getSourcesFolderPath()+"tmp." + sourceToDownload.getFilePath();
- File lmdFile = new File(AppConstants.getSourcesFolderPath()+"lmd."+fileName); //used to Store last modified Date of remote content
+ File lmdFile = new File(AppConstants.getSourcesFolderPath() + "lmd." + sourceToDownload.getFilePath()); //used to Store last modified Date of remote content
lmdFile.createNewFile();
- if ( downloadFile(targetUrl, tmpFilePath, lmdFile) )//Download file
+ if (downloadFile(sourceToDownload.getUrl(), tmpFilePath, lmdFile))//Download file
{
logger.debug("Downloaded succeed. Rename temp file to right fileName");
File tmpFile = new File(tmpFilePath);
@@ -183,7 +181,11 @@ public class DownloadTask extends Task{
HttpURLConnection connect = (HttpURLConnection) new URL(fileURL).openConnection();
connect.setReadTimeout(30000);
connect.setConnectTimeout(30000);
-
+ if (fileURL.contains("dl.twrp.me")) {
+ // direct download from official TWRP site just redirects to itself
+ connect.setRequestProperty("Referer", fileURL + ".html");
+ }
+
File localFile = new File(localFilePath);
if(localFile.exists()){
previouslyDownloadedAmount = localFile.length();
diff --git a/src/main/java/ecorp/easy/installer/threads/FlashThread.java b/src/main/java/ecorp/easy/installer/threads/FlashThread.java
index a736abd1f707ad5c70d83fd7c29155b5da0c8a4d..a0ee98b3dc32b9e12b3036e5550c3b1e0eb94fa4 100644
--- a/src/main/java/ecorp/easy/installer/threads/FlashThread.java
+++ b/src/main/java/ecorp/easy/installer/threads/FlashThread.java
@@ -16,18 +16,19 @@
package ecorp.easy.installer.threads;
import ecorp.easy.installer.AppConstants;
-import ecorp.easy.installer.models.Phone;
import ecorp.easy.installer.models.Command;
import ecorp.easy.installer.models.DataBundle;
+import ecorp.easy.installer.models.Phone;
import ecorp.easy.installer.models.StepUi;
import ecorp.easy.installer.utils.IFlashHandler;
import javafx.application.Platform;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
/**
* This class handle the background process of flashing a device
diff --git a/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java b/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java
index fed051d9b13f95124f84774744eed5f41ed1bc2a..311a6c406eb2d81cd3e108058dc51033b8aa94bc 100644
--- a/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java
+++ b/src/main/java/ecorp/easy/installer/threads/ThreadFactory.java
@@ -5,7 +5,7 @@
* 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
@@ -15,25 +15,19 @@
* along with this program. If not, see .
*/
package ecorp.easy.installer.threads;
-import ecorp.easy.installer.models.StepUi;
+
import ecorp.easy.installer.AppConstants;
-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.*;
import ecorp.easy.installer.utils.IFlashHandler;
-import java.io.IOException;
-import java.io.InputStream;
-import java.security.InvalidParameterException;
-import java.util.LinkedHashMap; //used instead of HashMap to conserve order
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.HashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.yaml.snakeyaml.Yaml;
+import java.io.IOException;
+import java.io.InputStream;
+import java.security.InvalidParameterException;
+import java.util.*;
+
/**
* This is the class in charge of Thread's creation
* @TODO: in BuildFlashThread Method, let the Steps load from yaml to be a kind of static ressource used as mould.
@@ -44,19 +38,19 @@ import org.yaml.snakeyaml.Yaml;
public class ThreadFactory {
private final static Logger logger = LoggerFactory.getLogger(ThreadFactory.class);
private ProcessMould flashMould;
- private final HashMap sourcesToDownload;
+ private final List sourcesToDownload;
private Phone device;
private final String yamlFolderPath;
-
+
/**
* Constructor of the ThreadFactory object
- * @param yamlFolderPath
+ * @param yamlFolderPath
*/
public ThreadFactory(String yamlFolderPath){
this.yamlFolderPath = yamlFolderPath;
- this.sourcesToDownload = new HashMap<>();
+ this.sourcesToDownload = new ArrayList<>();
}
-
+
/**
* Prepare the Factory to build thread for another model
* @param device Device object that encapsulate data about the device to flash
@@ -65,12 +59,12 @@ public class ThreadFactory {
*/
public boolean changeMould(Phone device){
if(device == null) return false;
-
+
this.device = device;
-
+
return loadYAMLFile();
}
-
+
/**
* Load the YAMLFile for the device's model to flash
* @return false if there is an issue or if no flashMould is built
@@ -81,10 +75,10 @@ public class ThreadFactory {
if(modelName == null || modelName.isEmpty()){
return false;
}
-
+
try{
Yaml yaml = new Yaml ();
-
+
//load config file
InputStream is = getClass().getResourceAsStream(yamlFolderPath+modelName+".yml");
Map yamlContent= (Map)yaml.load(is);
@@ -93,9 +87,9 @@ public class ThreadFactory {
logger.error("Parsed step list from yaml file is empty or null");
return false;
}
-
+
flashMould = new ProcessMould(modelName);
-
+
loadFlashProcess((Map) yamlContent.get("flash"));
//Load config file specific to user interface
@@ -109,10 +103,10 @@ 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"));
-
+ loadSourcesToDownload((Map) yamlContent.get("sources"));
+
}catch(IOException e){
logger.error("modelName = {}, error= {}", modelName, e.toString());
return false;
@@ -126,28 +120,28 @@ public class ThreadFactory {
*/
protected void loadFlashProcess( Map steps){
logger.info("loadFlashProcess( ... ) ");
-
+
Set keys = steps.keySet();
-
+
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") );
@@ -157,7 +151,7 @@ public class ThreadFactory {
//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") );
-
+
//Integrate the step in the process
flashMould.addStep(key, step);
}
@@ -184,7 +178,7 @@ public class ThreadFactory {
String title = (String) uiProperties.get("title");
String titleIconName= (String)uiProperties.get("titleIcon");
String stepNumber = (String)uiProperties.get("stepNumber");
- Integer averageTime = (Integer) uiProperties.get("averageTime");
+ Integer averageTime = (Integer) uiProperties.get("averageTime");
stepUI = new StepUi(type, instructions, title, titleIconName, stepNumber, averageTime != null ? averageTime:-1);
}
@@ -212,11 +206,17 @@ public class ThreadFactory {
if(key.equals("twrp")){
AppConstants.setTwrpImgPath((String) source.get("filePath"));
}
- sourcesToDownload.put((String) source.get("url"), (String) source.get("filePath"));
+ sourcesToDownload.add(
+ new SourceToDownload(
+ (String) source.get("url"),
+ (String) source.get("filePath"),
+ source.containsKey("checkSumExt") ? "." + source.get("checkSumExt") : ".sha256sum"
+ )
+ );
}
}
-
- public HashMap getSourcesToDownload(){
+
+ public List getSourcesToDownload(){
return sourcesToDownload;
}
diff --git a/src/main/resources/fxml/6-flashScene.fxml b/src/main/resources/fxml/6-flashScene.fxml
index 1bb09a6cca75f490da6edd19930e64fc1559b1b7..4e9c25b3c078e9247d7dc7c013a9bb6d2e1ef7b3 100644
--- a/src/main/resources/fxml/6-flashScene.fxml
+++ b/src/main/resources/fxml/6-flashScene.fxml
@@ -17,15 +17,6 @@
* along with this program. If not, see .
*/
-->
-
-
-
-
-
-
-
-
-
.
+
+install_instr_startFastbootFP2=FP2_fastboot_mode_400px.png
+install_instr_startRecoveryFP2=FP2_recovery_mode_400px.png
+install_instr_doNotInstall=TWRP_doNotInstall.png
\ No newline at end of file
diff --git a/src/main/resources/lang/translation.properties b/src/main/resources/lang/translation.properties
index c71693707a40a9bfbb7a437686a9b5c53e4aaa35..4a81d2fc098bc1e1804d58e4f5e3d6c0bb9a42f6 100644
--- a/src/main/resources/lang/translation.properties
+++ b/src/main/resources/lang/translation.properties
@@ -133,12 +133,14 @@ install_instr_turnOffAgain=Turn off the phone again
install_instr_startDownload=Keep pressing simultaneously "Power" & "Home" & "Volume Down" until a blue screen appear to access Download Mode
install_instr_startFastboot=Keep pressing simultaneously "Power" & "Volume Down" until a screen with green "START" appears to access Fastboot Mode
install_instr_startFastbootFromOptions=From options menu use "Volume Up/Down" to select "Fastboot" and "Power" to confirm
+install_instr_startFastbootFP2=Keep pressing simultaneously "Power" & "Volume Down" until a screen with the "Powered by Android" boot logo appears
install_instr_acceptWarning=Accept warning by pressing on "Volume Up"
install_instr_verifyHeimdall=Verify Heimdall
install_instr_oemUnlock=OEM Unlocking
install_instr_recoveryInstall=Recovery installation
install_instr_leaveDownload=Keep pressing simultaneously "Power" & "Home" & "Volume Down" until device turns off
install_instr_startRecovery=Keep pressing simultaneously "Power" & "Home" & "Volume Up" until 'teamwin' screen appears
+install_instr_startRecoveryFP2=Keep pressing simultaneously "Power" & "Volume Up" until 'teamwin' screen appears. It can take more 20 seconds.
install_instr_keepReadOnly=Tap on 'Keep Read Only'
install_instr_tapWipe=Tap on 'Wipe'
install_instr_tapFormatData=Tap on 'Format Data'
@@ -146,6 +148,7 @@ install_instr_writeYes=Write 'yes'
install_instr_validate=Validate
install_instr_backX3=Tap 'Back' 3 times
install_instr_tapReboot=Tap on 'Reboot'
+install_instr_tapSystem=Tap on 'System'
install_instr_tapRebootRecovery=Tap on 'Recovery'
install_instr_doNotInstall=Tap on 'Do not install'
install_instr_swipeTwrp=If asked, swipe the arrowed bar at the bottom of the screen from left to right
@@ -158,6 +161,7 @@ install_instr_tapRepairChangeFs=Tap on 'Repair or Change File System'
install_instr_tapChangeFs=Tap on 'Change File System'
install_instr_tapExt3=Tap on 'EXT3'
install_instr_swipeForOk=Swipe the arrowed bar at the bottom of the screen from left to right to confirm
+install_instr_swipeForUnlock=Swipe the arrowed bar at the bottom of the screen from left to right to unlock
install_instr_backX2=Tap on 'Back' 2 times
install_instr_resizeFs=Tap on 'Resize file System'
install_instr_tapRebootSystem=Tap on 'Reboot System'
@@ -221,7 +225,8 @@ script_error_waitReboot_10 = No device's serial number provided
script_error_waitReboot_101 = Can't run instruction on the device
script_error_waitRebootFromFastboot_101 = Can't run instruction on the device
script_error_serialNumber_missing=No device's serial number provided
-script_error_fastboot_path_missing= No fastboot tool path provided
+script_error_adb_path_missing=No adb tool path provided
+script_error_fastboot_path_missing=No fastboot tool path provided
script_error_fastboot_flashingUnlock_failed=Could not unlock flashing
script_error_unknown= The installation encounter an error
java_error_unknow= The installation encounter an internal error
@@ -279,6 +284,7 @@ installationTitle = Installation
# Title
stepTitle1On7 = Connect device and start Download mode
+stepTitle11n7 = Connect device and start Fastboot mode
stepTitle2On7 = Unlock OEM
stepTitle3On7 = Restart device in Download mode
stepTitle3On7FP3 = Unlock Bootloader and restart device in Fastboot mode
diff --git a/src/main/resources/lang/translation_de.properties b/src/main/resources/lang/translation_de.properties
index a1317161191c85df5b96fe5cc4e2186b20fae80f..04f424bae59771d8faf1b3e019b6a454cdd2c075 100644
--- a/src/main/resources/lang/translation_de.properties
+++ b/src/main/resources/lang/translation_de.properties
@@ -28,6 +28,7 @@ install_instr_tapRebootSystem=Tippe auf „Reboot System“ (System neustarten)
install_instr_resizeFs=Tippe auf „Resize File System“ (Dateisystemgröße ändern)
install_instr_backX2=Tippe zweimal auf „Back“ (Zurück)
install_instr_swipeForOk=Wische den blauen Pfeil-Schalter am unteren Bildschirmrand von links nach rechts
+install_instr_swipeForUnlock=Wische den blauen Pfeil-Schalter am unteren Bildschirmrand von links nach rechts (wenn nötig)
install_instr_tapExt3=Tippe auf „EXT3“
install_instr_tapChangeFs=Tippe auf „Change File System“ (Dateisystem ändern)
install_instr_tapRepairChangeFs=Tippe auf „Repair or Change File System“ (Dateisystem reparieren oder ändern)
@@ -40,6 +41,7 @@ install_instr_swipeTwrp=Falls du gefragt wirst, wische den blauen Pfeil-Schalter
install_instr_doNotInstall=Tippe auf „Do not install“ (Nicht Installieren)
install_instr_tapRebootRecovery=Tippe auf „Recovery“ (Wiederherstellen)
install_instr_tapReboot=Tippe auf „Reboot“ (Neustart)
+install_instr_tapSystemTippe auf „System“
install_instr_backX3=Tippe dreimal auf „Zurück“
install_instr_validate=Bestätige
install_instr_writeYes=Schreibe „Yes“ (Ja)
@@ -47,10 +49,12 @@ install_instr_tapFormatData=Tippe auf „Format Data“ (Daten formatieren)
install_instr_tapWipe=Tippe auf „Wipe“ (Löschen)
install_instr_keepReadOnly=Tippe auf „Keep Read Only“ (Nur Lesezugriff)
install_instr_startRecovery=Drücke gleichzeitig „An“, „Home“ und „Lautstärke lauter“, bis das „Teamwin“-Symbol erscheint
+install_instr_startRecoveryFP2=Drücke gleichzeitig „An“ und „Lautstärke lauter“, bis das „Teamwin“-Symbol erscheint
install_instr_leaveDownload=Drücke gleichzeitig „An“, „Home“ und „Lautstärke leiser“, bis sich das Gerät ausschaltet
install_instr_recoveryInstall=Installation des Wiederherstellungs-Modus
install_instr_acceptWarning=Akzeptiere die Warnung, indem du „Lautstärke lauter“ drückst
install_instr_startFastboot=Drücke gleichzeitig „An“ und „Lautstärke leiser“, bis ein grünes „START“ erscheint, um in den Fastboot-Modus zu gelangen
+install_instr_startFastbootFP2=Drücke gleichzeitig „An“ und „Lautstärke leiser“, bis das "Powered by Android" Boot-Logo erscheint
install_instr_turnOffAgain=Telefon nochmals ausschalten
install_instr_turnOff=Telefon ausschalten
install_btn_sendLogSuccess=Protokoll gesendet
@@ -160,7 +164,8 @@ stepTitle6On7=/e/-Installation
stepTitle5On7=Starte das Gerät neu in den Wiederstellungs-Modus
stepTitle4On7=Installation des Wiederherstellungs-Programms
stepTitle3On7FP3=Entsperre den Bootloader und starte das Gerät neu in den Fastboot-Modus
-### Flash
+stepTitle11n7 = Verbinde das Gerät und starte es neu in den Fastboot-Modus
+### Flash
installationTitle=Installation
feedback_btn_sendTryAgain=Fehler. Bitte sende die Rückmeldung nochmals.
feedback_btn_leave=Verlassen
@@ -213,6 +218,7 @@ eAccount_lbl_dontuseEmail=Keine „@e.email“-Adresse benutzen
eAccount_lbl_alreadyAccount=Tippe auf „Weiter“
script_error_fastboot_flashingUnlock_failed=Die „OEM-Entsperrung“ ist fehlgeschlagen
script_error_fastboot_path_missing=Der Pfad zu „fastboot“ wurde nicht angegeben
+script_error_adb_path_missing=Der Pfad zu „adb“ wurde nicht angegeben
stepTitle_verifyHeimdall=Überprüfung von Heimdall
stepTitle_installRecovery=Installation des Wiederherstellungs-Programms
stepTitle_oemUnlock=OEM-Entsperrung
diff --git a/src/main/resources/yaml/FP2.yml b/src/main/resources/yaml/FP2.yml
new file mode 100644
index 0000000000000000000000000000000000000000..d1b7c36e86b46d1fa3225f78dad9f96cc6d6929a
--- /dev/null
+++ b/src/main/resources/yaml/FP2.yml
@@ -0,0 +1,101 @@
+## 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: FP2
+flash:
+ f1:
+ script: wait-fastboot
+ parameters:
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ codes:
+ ok:
+ 0: ~
+ ko:
+ 1: script_error_waitDownload_1
+ output: ~
+ succeed: f2
+ failed: ~
+ f2:
+ script: fp2_install-twrp-from-fastboot
+ parameters:
+ twrp_image_path: ${TWRP_IMAGE_PATH}
+ fastboot_folder_path: ${ADB_FOLDER_PATH}
+ codes:
+ ok:
+ 0: ~
+ ko:
+ 1: script_error_unknown
+ 101: script_error_installRecovery_101
+ 102: script_error_fastboot_path_missing
+ 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: fp2_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
+ 103: script_error_adb_path_missing
+ 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/FP2_fs.yml b/src/main/resources/yaml/FP2_fs.yml
new file mode 100644
index 0000000000000000000000000000000000000000..a29fc5c7ce92fdb2ee53f54787824e8e094229a9
--- /dev/null
+++ b/src/main/resources/yaml/FP2_fs.yml
@@ -0,0 +1,72 @@
+## 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
+---
+sources:
+ rom:
+ url: https://images.ecloud.global/stable/FP2/e-latest-FP2.zip
+ filePath: e-latest-FP2.zip
+ twrp:
+ url: https://images.ecloud.global/stable/FP2/recovery-e-latest-FP2.img
+ filePath: recovery-e-latest-FP2.img
+flash:
+ f1:
+ ui:
+ type: action
+ title: stepTitle11n7
+ instruction:
+ - install_instr_turnOff
+ - install_instr_startFastbootFP2
+ 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_startRecoveryFP2
+ - 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: stepTitle_rebootDevice
+ instruction:
+ - install_instr_swipeForUnlock
+ - install_instr_tapReboot
+ - install_instr_tapSystem
+ - install_instr_doNotInstall
+ stepNumber: 5/5
+ titleIcon: icon-search.png
\ No newline at end of file