style: normalize command descs and redundancy (#3188)

This commit is contained in:
Igor Eisberg 2023-07-21 13:08:30 +03:00 committed by GitHub
parent d4ec44de41
commit 79b2173b85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 20 deletions

View File

@ -307,12 +307,12 @@ public class Main {
// create options // create options
Option versionOption = Option.builder("version") Option versionOption = Option.builder("version")
.longOpt("version") .longOpt("version")
.desc("prints the version then exits") .desc("Print the version.")
.build(); .build();
Option advanceOption = Option.builder("advance") Option advanceOption = Option.builder("advance")
.longOpt("advanced") .longOpt("advanced")
.desc("prints advance information.") .desc("Print advanced information.")
.build(); .build();
Option noSrcOption = Option.builder("s") Option noSrcOption = Option.builder("s")
@ -347,7 +347,7 @@ public class Main {
Option analysisOption = Option.builder("m") Option analysisOption = Option.builder("m")
.longOpt("match-original") .longOpt("match-original")
.desc("Keeps files to closest to original as possible. Prevents rebuild.") .desc("Keep files to closest to original as possible (prevents rebuild).")
.build(); .build();
Option apiLevelOption = Option.builder("api") Option apiLevelOption = Option.builder("api")
@ -359,17 +359,17 @@ public class Main {
Option debugBuiOption = Option.builder("d") Option debugBuiOption = Option.builder("d")
.longOpt("debug") .longOpt("debug")
.desc("Sets android:debuggable to \"true\" in the APK's compiled manifest") .desc("Set android:debuggable to \"true\" in the APK's compiled manifest.")
.build(); .build();
Option netSecConfOption = Option.builder("n") Option netSecConfOption = Option.builder("n")
.longOpt("net-sec-conf") .longOpt("net-sec-conf")
.desc("Adds a generic Network Security Configuration file in the output APK") .desc("Add a generic Network Security Configuration file in the output APK")
.build(); .build();
Option noDbgOption = Option.builder("b") Option noDbgOption = Option.builder("b")
.longOpt("no-debug-info") .longOpt("no-debug-info")
.desc("don't write out debug info (.local, .param, .line, etc.)") .desc("Do not write out debug info (.local, .param, .line, etc.)")
.build(); .build();
Option forceDecOption = Option.builder("f") Option forceDecOption = Option.builder("f")
@ -379,21 +379,21 @@ public class Main {
Option frameTagOption = Option.builder("t") Option frameTagOption = Option.builder("t")
.longOpt("frame-tag") .longOpt("frame-tag")
.desc("Uses framework files tagged by <tag>.") .desc("Use framework files tagged by <tag>.")
.hasArg(true) .hasArg(true)
.argName("tag") .argName("tag")
.build(); .build();
Option frameDirOption = Option.builder("p") Option frameDirOption = Option.builder("p")
.longOpt("frame-path") .longOpt("frame-path")
.desc("Uses framework files located in <dir>.") .desc("Use framework files located in <dir>.")
.hasArg(true) .hasArg(true)
.argName("dir") .argName("dir")
.build(); .build();
Option frameIfDirOption = Option.builder("p") Option frameIfDirOption = Option.builder("p")
.longOpt("frame-path") .longOpt("frame-path")
.desc("Stores framework files into <dir>.") .desc("Store framework files into <dir>.")
.hasArg(true) .hasArg(true)
.argName("dir") .argName("dir")
.build(); .build();
@ -415,17 +415,17 @@ public class Main {
.longOpt("aapt") .longOpt("aapt")
.hasArg(true) .hasArg(true)
.argName("loc") .argName("loc")
.desc("Loads aapt from specified location.") .desc("Load aapt from specified location.")
.build(); .build();
Option aapt2Option = Option.builder() Option aapt2Option = Option.builder()
.longOpt("use-aapt2") .longOpt("use-aapt2")
.desc("Upgrades apktool to use experimental aapt2 binary.") .desc("Use aapt2 binary instead of aapt1 during the build step.")
.build(); .build();
Option originalOption = Option.builder("c") Option originalOption = Option.builder("c")
.longOpt("copy-original") .longOpt("copy-original")
.desc("Copies original AndroidManifest.xml and META-INF. See project page for more info.") .desc("Copy original AndroidManifest.xml and META-INF. See project page for more info.")
.build(); .build();
Option noCrunchOption = Option.builder("nc") Option noCrunchOption = Option.builder("nc")
@ -442,14 +442,14 @@ public class Main {
Option outputBuiOption = Option.builder("o") Option outputBuiOption = Option.builder("o")
.longOpt("output") .longOpt("output")
.desc("The name of apk that gets written. Default is dist/name.apk") .desc("The name of apk that gets written. (default: dist/name.apk)")
.hasArg(true) .hasArg(true)
.argName("dir") .argName("dir")
.build(); .build();
Option outputDecOption = Option.builder("o") Option outputDecOption = Option.builder("o")
.longOpt("output") .longOpt("output")
.desc("The name of folder that gets written. Default is apk.out") .desc("The name of folder that gets written. (default: apk.out)")
.hasArg(true) .hasArg(true)
.argName("dir") .argName("dir")
.build(); .build();

View File

@ -170,7 +170,6 @@ public class ApkBuilder {
File[] dexFiles = appDir.listFiles(); File[] dexFiles = appDir.listFiles();
if (dexFiles != null) { if (dexFiles != null) {
for (File dex : dexFiles) { for (File dex : dexFiles) {
// skip classes.dex because we have handled it in buildSources() // skip classes.dex because we have handled it in buildSources()
if (dex.getName().endsWith(".dex") && ! dex.getName().equalsIgnoreCase("classes.dex")) { if (dex.getName().endsWith(".dex") && ! dex.getName().equalsIgnoreCase("classes.dex")) {
buildSourcesRaw(appDir, dex.getName()); buildSourcesRaw(appDir, dex.getName());

View File

@ -35,9 +35,7 @@ import org.xmlpull.v1.XmlSerializer;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.Arrays; import java.util.*;
import java.util.HashMap;
import java.util.Map;
import java.util.logging.Logger; import java.util.logging.Logger;
public class ResourcesDecoder { public class ResourcesDecoder {

View File

@ -24,6 +24,7 @@ import org.antlr.runtime.RecognitionException;
import com.android.tools.smali.dexlib2.Opcodes; import com.android.tools.smali.dexlib2.Opcodes;
import com.android.tools.smali.dexlib2.writer.builder.DexBuilder; import com.android.tools.smali.dexlib2.writer.builder.DexBuilder;
import com.android.tools.smali.dexlib2.writer.io.FileDataStore; import com.android.tools.smali.dexlib2.writer.io.FileDataStore;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;

View File

@ -27,6 +27,7 @@ public class Duo<T1, T2> {
this.m2 = t2; this.m2 = t2;
} }
@SuppressWarnings("unchecked")
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) { if (obj == null) {