From dbc609da690688a6441cad5c8142f83788b4f24a Mon Sep 17 00:00:00 2001 From: REAndroid Date: Sun, 12 May 2024 22:57:18 +0200 Subject: [PATCH] Remove logVersion from constructor --- src/main/java/com/reandroid/apkeditor/BaseCommand.java | 5 ++--- src/main/java/com/reandroid/apkeditor/cloner/Cloner.java | 1 + src/main/java/com/reandroid/apkeditor/compile/Builder.java | 1 + .../java/com/reandroid/apkeditor/decompile/Decompiler.java | 1 + src/main/java/com/reandroid/apkeditor/info/Info.java | 1 + src/main/java/com/reandroid/apkeditor/merge/Merger.java | 1 + src/main/java/com/reandroid/apkeditor/protect/Protector.java | 1 + src/main/java/com/reandroid/apkeditor/refactor/Refactor.java | 1 + 8 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/reandroid/apkeditor/BaseCommand.java b/src/main/java/com/reandroid/apkeditor/BaseCommand.java index 9522396c..e85aa346 100644 --- a/src/main/java/com/reandroid/apkeditor/BaseCommand.java +++ b/src/main/java/com/reandroid/apkeditor/BaseCommand.java @@ -33,7 +33,6 @@ public BaseCommand(T options, String logTag){ this.options = options; this.mLogTag = logTag; this.mEnableLog = true; - logVersion(); } public void run() throws IOException{ @@ -91,8 +90,8 @@ public void logWarn(String msg) { Logger.e(mLogTag + msg); } - private void logVersion() { - Logger.i("Using: " + APKEditor.getName() + " version " + APKEditor.getVersion() + ", " + ARSCLib.getName() + " version " + ARSCLib.getVersion()); + public void logVersion() { + logMessage("Using: " + APKEditor.getName() + " version " + APKEditor.getVersion() + ", " + ARSCLib.getName() + " version " + ARSCLib.getVersion()); } protected static void clearMeta(ApkModule module){ diff --git a/src/main/java/com/reandroid/apkeditor/cloner/Cloner.java b/src/main/java/com/reandroid/apkeditor/cloner/Cloner.java index 48b3cf74..d5ccca72 100644 --- a/src/main/java/com/reandroid/apkeditor/cloner/Cloner.java +++ b/src/main/java/com/reandroid/apkeditor/cloner/Cloner.java @@ -38,6 +38,7 @@ public static void execute(String[] args) throws ARGException, IOException { ClonerOptions option = new ClonerOptions(); option.parse(args); Cloner cloner = new Cloner(option); + cloner.logVersion(); cloner.run(); } diff --git a/src/main/java/com/reandroid/apkeditor/compile/Builder.java b/src/main/java/com/reandroid/apkeditor/compile/Builder.java index 8d256bce..4c9d1607 100644 --- a/src/main/java/com/reandroid/apkeditor/compile/Builder.java +++ b/src/main/java/com/reandroid/apkeditor/compile/Builder.java @@ -169,6 +169,7 @@ public static void execute(String[] args) throws ARGException, IOException { File outDir = option.outputFile; Util.deleteEmptyDirectories(outDir); Builder builder = new Builder(option); + builder.logVersion(); builder.logMessage("Building ...\n" + option.toString()); if(outDir.exists()){ if(!option.force){ diff --git a/src/main/java/com/reandroid/apkeditor/decompile/Decompiler.java b/src/main/java/com/reandroid/apkeditor/decompile/Decompiler.java index 0b58ee64..b104efac 100644 --- a/src/main/java/com/reandroid/apkeditor/decompile/Decompiler.java +++ b/src/main/java/com/reandroid/apkeditor/decompile/Decompiler.java @@ -116,6 +116,7 @@ public static void execute(String[] args) throws ARGException, IOException { } Util.deleteEmptyDirectories(outDir); Decompiler decompiler = new Decompiler(option); + decompiler.logVersion(); decompiler.logMessage("Decompiling ...\n" + option); if(outDir.exists()){ if(!option.force){ diff --git a/src/main/java/com/reandroid/apkeditor/info/Info.java b/src/main/java/com/reandroid/apkeditor/info/Info.java index f545fd63..9f4c03d7 100644 --- a/src/main/java/com/reandroid/apkeditor/info/Info.java +++ b/src/main/java/com/reandroid/apkeditor/info/Info.java @@ -439,6 +439,7 @@ public static void execute(String[] args) throws ARGException, IOException { InfoOptions option = new InfoOptions(); option.parse(args); Info info = new Info(option); + info.logVersion(); info.run(); } diff --git a/src/main/java/com/reandroid/apkeditor/merge/Merger.java b/src/main/java/com/reandroid/apkeditor/merge/Merger.java index eb224422..2a78b0ab 100644 --- a/src/main/java/com/reandroid/apkeditor/merge/Merger.java +++ b/src/main/java/com/reandroid/apkeditor/merge/Merger.java @@ -222,6 +222,7 @@ public static void execute(String[] args) throws ARGException, IOException { } Util.deleteEmptyDirectories(outFile); Merger merger = new Merger(option); + merger.logVersion(); if(outFile.exists()){ if(!option.force){ throw new ARGException("Path already exists: " + outFile); diff --git a/src/main/java/com/reandroid/apkeditor/protect/Protector.java b/src/main/java/com/reandroid/apkeditor/protect/Protector.java index c8c6f8db..7db538a8 100644 --- a/src/main/java/com/reandroid/apkeditor/protect/Protector.java +++ b/src/main/java/com/reandroid/apkeditor/protect/Protector.java @@ -146,6 +146,7 @@ public static void execute(String[] args) throws ARGException, IOException { File outFile = option.outputFile; Util.deleteEmptyDirectories(outFile); Protector protector = new Protector(option); + protector.logVersion(); if(outFile.exists()){ if(!option.force){ throw new ARGException("Path already exists: "+outFile); diff --git a/src/main/java/com/reandroid/apkeditor/refactor/Refactor.java b/src/main/java/com/reandroid/apkeditor/refactor/Refactor.java index 4fe22275..ca4116f8 100644 --- a/src/main/java/com/reandroid/apkeditor/refactor/Refactor.java +++ b/src/main/java/com/reandroid/apkeditor/refactor/Refactor.java @@ -82,6 +82,7 @@ public static void execute(String[] args) throws ARGException, IOException { File outFile=option.outputFile; Util.deleteEmptyDirectories(outFile); Refactor refactor = new Refactor(option); + refactor.logVersion(); if(outFile.exists()){ if(!option.force){ throw new ARGException("Path already exists: "+outFile);