Skip to content

Commit

Permalink
Fix grammar & typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx authored and pxb1988 committed Oct 30, 2021
1 parent 121f727 commit 441d045
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected void doCommandLine() throws Exception {

Path jar = new File(remainingArgs[0]).toPath().toAbsolutePath();
if (!Files.exists(jar)) {
System.err.println(jar + " is not exists");
System.err.println(jar + " doesn't exist");
usage();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected void doCommandLine() throws Exception {

Path jar = new File(remainingArgs[0]).toPath().toAbsolutePath();
if (!Files.exists(jar)) {
System.err.println(jar + " is not exists");
System.err.println(jar + " doesn't exist");
usage();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected void doCommandLine() throws Exception {

File dex = new File(remainingArgs[0]);
if (!dex.exists()) {
System.err.println("ERROR: " + dex + " is not exists");
System.err.println("ERROR: " + dex + " doesn't exist");
return;
}
if (output == null) {
Expand Down
4 changes: 2 additions & 2 deletions dex-ir/src/main/java/com/googlecode/dex2jar/ir/TypeClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public static TypeClass merge(TypeClass thizCls, TypeClass clz) {
if ((thizCls == INT && clz == BOOLEAN) || (thizCls == BOOLEAN || clz == INT)) {
return INT;
}
throw new RuntimeException("can not merge " + thizCls + " and " + clz);
throw new RuntimeException("Can't merge " + thizCls + " and " + clz);
} else {
return thizCls;
}
Expand All @@ -123,7 +123,7 @@ public static TypeClass merge(TypeClass thizCls, TypeClass clz) {
*/
private static TypeClass merge0(TypeClass a, TypeClass b) {
if (a == JD || b == JD) {
throw new RuntimeException("can not merge " + a + " and " + b);
throw new RuntimeException("Can't merge " + a + " and " + b);
}
switch (a) {
case ZIL:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public DexFileReader(InputStream is) throws IOException {
}

/**
* Reads a string index. String indicies are offset by 1, and a 0 value in the stream (-1 as returned by this
* Reads a string index. String indices are offset by 1, and a 0 value in the stream (-1 as returned by this
* method) means "null"
*
* @return index into file's string ids table, -1 means null
Expand Down Expand Up @@ -1095,7 +1095,7 @@ private void read_annotation_set_ref_list(int parameter_annotation_offset, DexMe
read_annotation_set_item(param_annotation_offset, dpav);
}
} catch (Exception e) {
throw new DexException(e, "while accept parameter annotation in parameter:[%d]", j);
throw new DexException(e, "While accepting parameter annotation in parameter: [%d]", j);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static BaseDexFileReader open(byte[] data) throws IOException {
return new MultiDexFileReader(dexFileReaders.values());
}
}
throw new IOException("the src file not a .dex or zip file");
throw new IOException("The source file is not a .dex or .zip file");
}

void init() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ protected void doCommandLine() throws Exception {

Path apkIn = new File(remainingArgs[0]).toPath();
if (!Files.exists(apkIn)) {
System.err.println(apkIn + " is not exists");
System.err.println(apkIn + " doesn't exist");
usage();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ protected void doCommandLine() throws Exception {
for (String fn : remainingArgs) {
Path file = new File(fn).toPath();
if (!Files.exists(file)) {
System.err.println(fn + " is not exists");
System.err.println(fn + " doesn't exist");
usage();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected void doCommandLine() throws Exception {

Path jar = new File(remainingArgs[0]).toPath();
if (!Files.exists(jar)) {
System.err.println(jar + " is not exists");
System.err.println(jar + " doesn't exist");
usage();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ protected void doCommandLine() throws Exception {

final Path jar = new File(remainingArgs[0]).toPath();
if (!Files.exists(jar)) {
System.err.println(jar + " is not exists");
System.err.println(jar + " doesn't exist");
return;
}
if (output == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected void doCommandLine() throws Exception {

Path jar = new File(remainingArgs[0]).toPath();
if (!Files.exists(jar)) {
System.err.println(jar + " is not exists");
System.err.println(jar + " doesn't exist");
usage();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
import java.nio.file.Files;
import java.nio.file.Path;

@BaseCmd.Syntax(cmd = "d2j-generate-stub-from-odex", syntax = "[options] <odex0> [odex1 ... odexN]", desc = "Genenerate no-code jar from odex")
@BaseCmd.Syntax(cmd = "d2j-generate-stub-from-odex", syntax = "[options] <odex0> [odex1 ... odexN]", desc =
"Generate no-code jar from odex")
public class GenerateCompileStubFromOdex extends BaseCmd {
private static final int MAGIC_ODEX = 0x0A796564 & 0x00FFFFFF;// hex for 'dey ', ignore the 0A
private static final int MAGIC_DEX = 0x0A786564 & 0x00FFFFFF;// hex for 'dex ', ignore the 0A
Expand All @@ -31,7 +32,7 @@ public static void main(String... args) {
@Override
protected void doCommandLine() throws Exception {
if (remainingArgs.length == 0) {
throw new HelpException("no odex");
throw new HelpException("No odex");
}
if (output == null) {
output = new File("stub.jar").toPath();
Expand All @@ -40,7 +41,7 @@ protected void doCommandLine() throws Exception {
try (FileSystem fs = createZip(output)) {
Path out = fs.getPath("/");
for (String x : remainingArgs) {
System.err.println("process " + x + " ...");
System.err.println("Processing " + x + " ...");
ByteBuffer bs = ByteBuffer.wrap(Files.readAllBytes(new File(x).toPath()))
.order(ByteOrder.LITTLE_ENDIAN);
int magic = bs.getInt(0) & 0x00FFFFFF;
Expand All @@ -53,7 +54,7 @@ protected void doCommandLine() throws Exception {
} else if (magic == MAGIC_DEX) {
doDex(bs, out);
} else {
throw new RuntimeException("file " + x + " is not an dex or odex");
throw new RuntimeException("File " + x + " is not an dex or odex");
}

}
Expand All @@ -70,7 +71,7 @@ private void doDex(ByteBuffer bs, final Path out) {
public ClassVisitor create(final String classInternalName) {
final Path target = out.resolve(classInternalName + ".class");
if (Files.exists(target)) {
System.err.println("class " + classInternalName + " is already exists, skipping.");
System.err.println("Class " + classInternalName + " already exists, skipping.");
return null;
}
return new ClassVisitor(Opcodes.ASM4, new ClassWriter(ClassWriter.COMPUTE_MAXS)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ protected void doCommandLine() throws Exception {

Path jar = new File(remainingArgs[0]).toPath();
if (!Files.exists(jar)) {
System.err.println(jar + " is not exists");
System.err.println(jar + " doesn't exist");
usage();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void convertCode(DexMethodNode methodNode, MethodVisitor mv, ClzCtx clzCt
super.convertCode(methodNode, mn, clzCtx);
} catch (Exception ex) {
if (exceptionHandler == null) {
throw new DexException(ex, "fail convert code for %s", methodNode.method);
throw new DexException(ex, "Failed to convert code for %s", methodNode.method);
} else {
mn.instructions.clear();
mn.tryCatchBlocks.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ public void convertCode(DexMethodNode methodNode, MethodVisitor mv, ClzCtx clzCt
} catch (IOException e) {
e.printStackTrace();
}
throw new DexException(ex, "fail convert code %s", methodNode.method);
throw new DexException(ex, "Failed to convert code for %s", methodNode.method);
}
}
};
Expand Down

0 comments on commit 441d045

Please sign in to comment.