From 9025772ed508fab2c3e9adcf09de4e1f973c5534 Mon Sep 17 00:00:00 2001 From: androidlover5842 Date: Sat, 21 Apr 2018 07:10:12 +0530 Subject: [PATCH] fix otg with -r command --- src/main/java/com/github/twrpbuilder/MainActivity.java | 7 ++++--- src/main/java/com/github/twrpbuilder/mkTree/MakeTree.java | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/github/twrpbuilder/MainActivity.java b/src/main/java/com/github/twrpbuilder/MainActivity.java index b779a52..6ed0fb3 100644 --- a/src/main/java/com/github/twrpbuilder/MainActivity.java +++ b/src/main/java/com/github/twrpbuilder/MainActivity.java @@ -5,7 +5,6 @@ import java.io.OutputStream; import java.io.PrintWriter; -import com.github.twrpbuilder.util.Config; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.DefaultParser; @@ -20,7 +19,9 @@ public class MainActivity { private static String applicationName = "TwrpBuilder"; public static String rName; - public static void usePosixParser(final String[] commandLineArguments) + public static boolean otg; + + public static void usePosixParser(final String[] commandLineArguments) { final CommandLineParser cmdLinePosixParser = new DefaultParser(); final Options posixOptions = constructPosixOptions(); @@ -76,7 +77,7 @@ public static void usePosixParser(final String[] commandLineArguments) if(commandLine.hasOption("otg")) { - MakeTree.otg=true; + otg=true; } if(commandLine.hasOption("r")) diff --git a/src/main/java/com/github/twrpbuilder/mkTree/MakeTree.java b/src/main/java/com/github/twrpbuilder/mkTree/MakeTree.java index 1593d98..b31afdb 100644 --- a/src/main/java/com/github/twrpbuilder/mkTree/MakeTree.java +++ b/src/main/java/com/github/twrpbuilder/mkTree/MakeTree.java @@ -5,13 +5,14 @@ import com.github.twrpbuilder.util.*; +import static com.github.twrpbuilder.MainActivity.otg; + public class MakeTree { private long l=0; private String compressionType; private boolean lz4,lzma; private ShellExecutor shell; private String copyRight=shell.CopyRight(); - public static boolean otg; private GetBuildInfo info; private Config config; private String out; @@ -186,7 +187,7 @@ private void FstablastMessage() { System.out.println("tree ready for "+ info.getCodename()); new FWriter(".travis.yml",generateTravis()); System.out.println((char)27 + "[31m" + "Warning :- Check recovery fstab before build"); - System.out.println((char)27 + "[0m"); + System.out.print("[0m"); } public void MkFstab() {