mirror of
https://github.com/pxb1988/dex2jar.git
synced 2024-11-26 22:50:42 +00:00
Fix grammar & typo
This commit is contained in:
parent
121f727d37
commit
441d045797
@ -52,7 +52,7 @@ public class Jar2JasminCmd extends BaseCmd {
|
|||||||
|
|
||||||
Path jar = new File(remainingArgs[0]).toPath().toAbsolutePath();
|
Path jar = new File(remainingArgs[0]).toPath().toAbsolutePath();
|
||||||
if (!Files.exists(jar)) {
|
if (!Files.exists(jar)) {
|
||||||
System.err.println(jar + " is not exists");
|
System.err.println(jar + " doesn't exist");
|
||||||
usage();
|
usage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ public class Jasmin2JarCmd extends BaseCmd implements Opcodes {
|
|||||||
|
|
||||||
Path jar = new File(remainingArgs[0]).toPath().toAbsolutePath();
|
Path jar = new File(remainingArgs[0]).toPath().toAbsolutePath();
|
||||||
if (!Files.exists(jar)) {
|
if (!Files.exists(jar)) {
|
||||||
System.err.println(jar + " is not exists");
|
System.err.println(jar + " doesn't exist");
|
||||||
usage();
|
usage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ public class BaksmaliCmd extends BaseCmd {
|
|||||||
|
|
||||||
File dex = new File(remainingArgs[0]);
|
File dex = new File(remainingArgs[0]);
|
||||||
if (!dex.exists()) {
|
if (!dex.exists()) {
|
||||||
System.err.println("ERROR: " + dex + " is not exists");
|
System.err.println("ERROR: " + dex + " doesn't exist");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (output == null) {
|
if (output == null) {
|
||||||
|
@ -101,7 +101,7 @@ public enum TypeClass {
|
|||||||
if ((thizCls == INT && clz == BOOLEAN) || (thizCls == BOOLEAN || clz == INT)) {
|
if ((thizCls == INT && clz == BOOLEAN) || (thizCls == BOOLEAN || clz == INT)) {
|
||||||
return INT;
|
return INT;
|
||||||
}
|
}
|
||||||
throw new RuntimeException("can not merge " + thizCls + " and " + clz);
|
throw new RuntimeException("Can't merge " + thizCls + " and " + clz);
|
||||||
} else {
|
} else {
|
||||||
return thizCls;
|
return thizCls;
|
||||||
}
|
}
|
||||||
@ -123,7 +123,7 @@ public enum TypeClass {
|
|||||||
*/
|
*/
|
||||||
private static TypeClass merge0(TypeClass a, TypeClass b) {
|
private static TypeClass merge0(TypeClass a, TypeClass b) {
|
||||||
if (a == JD || b == JD) {
|
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) {
|
switch (a) {
|
||||||
case ZIL:
|
case ZIL:
|
||||||
|
@ -281,7 +281,7 @@ public class DexFileReader implements BaseDexFileReader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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"
|
* method) means "null"
|
||||||
*
|
*
|
||||||
* @return index into file's string ids table, -1 means null
|
* @return index into file's string ids table, -1 means null
|
||||||
@ -1095,7 +1095,7 @@ public class DexFileReader implements BaseDexFileReader {
|
|||||||
read_annotation_set_item(param_annotation_offset, dpav);
|
read_annotation_set_item(param_annotation_offset, dpav);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ public class MultiDexFileReader implements BaseDexFileReader {
|
|||||||
return new MultiDexFileReader(dexFileReaders.values());
|
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() {
|
void init() {
|
||||||
|
@ -54,7 +54,7 @@ public class ApkSign extends BaseCmd {
|
|||||||
|
|
||||||
Path apkIn = new File(remainingArgs[0]).toPath();
|
Path apkIn = new File(remainingArgs[0]).toPath();
|
||||||
if (!Files.exists(apkIn)) {
|
if (!Files.exists(apkIn)) {
|
||||||
System.err.println(apkIn + " is not exists");
|
System.err.println(apkIn + " doesn't exist");
|
||||||
usage();
|
usage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,7 @@ public class AsmVerify extends BaseCmd {
|
|||||||
for (String fn : remainingArgs) {
|
for (String fn : remainingArgs) {
|
||||||
Path file = new File(fn).toPath();
|
Path file = new File(fn).toPath();
|
||||||
if (!Files.exists(file)) {
|
if (!Files.exists(file)) {
|
||||||
System.err.println(fn + " is not exists");
|
System.err.println(fn + " doesn't exist");
|
||||||
usage();
|
usage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -49,7 +49,7 @@ public class DeObfInitCmd extends BaseCmd {
|
|||||||
|
|
||||||
Path jar = new File(remainingArgs[0]).toPath();
|
Path jar = new File(remainingArgs[0]).toPath();
|
||||||
if (!Files.exists(jar)) {
|
if (!Files.exists(jar)) {
|
||||||
System.err.println(jar + " is not exists");
|
System.err.println(jar + " doesn't exist");
|
||||||
usage();
|
usage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -162,7 +162,7 @@ public class DecryptStringCmd extends BaseCmd {
|
|||||||
|
|
||||||
final Path jar = new File(remainingArgs[0]).toPath();
|
final Path jar = new File(remainingArgs[0]).toPath();
|
||||||
if (!Files.exists(jar)) {
|
if (!Files.exists(jar)) {
|
||||||
System.err.println(jar + " is not exists");
|
System.err.println(jar + " doesn't exist");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (output == null) {
|
if (output == null) {
|
||||||
|
@ -44,7 +44,7 @@ public class DexRecomputeChecksum extends BaseCmd {
|
|||||||
|
|
||||||
Path jar = new File(remainingArgs[0]).toPath();
|
Path jar = new File(remainingArgs[0]).toPath();
|
||||||
if (!Files.exists(jar)) {
|
if (!Files.exists(jar)) {
|
||||||
System.err.println(jar + " is not exists");
|
System.err.println(jar + " doesn't exist");
|
||||||
usage();
|
usage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,8 @@ import java.nio.file.FileSystem;
|
|||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
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 {
|
public class GenerateCompileStubFromOdex extends BaseCmd {
|
||||||
private static final int MAGIC_ODEX = 0x0A796564 & 0x00FFFFFF;// hex for 'dey ', ignore the 0A
|
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
|
private static final int MAGIC_DEX = 0x0A786564 & 0x00FFFFFF;// hex for 'dex ', ignore the 0A
|
||||||
@ -31,7 +32,7 @@ public class GenerateCompileStubFromOdex extends BaseCmd {
|
|||||||
@Override
|
@Override
|
||||||
protected void doCommandLine() throws Exception {
|
protected void doCommandLine() throws Exception {
|
||||||
if (remainingArgs.length == 0) {
|
if (remainingArgs.length == 0) {
|
||||||
throw new HelpException("no odex");
|
throw new HelpException("No odex");
|
||||||
}
|
}
|
||||||
if (output == null) {
|
if (output == null) {
|
||||||
output = new File("stub.jar").toPath();
|
output = new File("stub.jar").toPath();
|
||||||
@ -40,7 +41,7 @@ public class GenerateCompileStubFromOdex extends BaseCmd {
|
|||||||
try (FileSystem fs = createZip(output)) {
|
try (FileSystem fs = createZip(output)) {
|
||||||
Path out = fs.getPath("/");
|
Path out = fs.getPath("/");
|
||||||
for (String x : remainingArgs) {
|
for (String x : remainingArgs) {
|
||||||
System.err.println("process " + x + " ...");
|
System.err.println("Processing " + x + " ...");
|
||||||
ByteBuffer bs = ByteBuffer.wrap(Files.readAllBytes(new File(x).toPath()))
|
ByteBuffer bs = ByteBuffer.wrap(Files.readAllBytes(new File(x).toPath()))
|
||||||
.order(ByteOrder.LITTLE_ENDIAN);
|
.order(ByteOrder.LITTLE_ENDIAN);
|
||||||
int magic = bs.getInt(0) & 0x00FFFFFF;
|
int magic = bs.getInt(0) & 0x00FFFFFF;
|
||||||
@ -53,7 +54,7 @@ public class GenerateCompileStubFromOdex extends BaseCmd {
|
|||||||
} else if (magic == MAGIC_DEX) {
|
} else if (magic == MAGIC_DEX) {
|
||||||
doDex(bs, out);
|
doDex(bs, out);
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("file " + x + " is not an dex or odex");
|
throw new RuntimeException("File " + x + " is not an dex or odex");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -70,7 +71,7 @@ public class GenerateCompileStubFromOdex extends BaseCmd {
|
|||||||
public ClassVisitor create(final String classInternalName) {
|
public ClassVisitor create(final String classInternalName) {
|
||||||
final Path target = out.resolve(classInternalName + ".class");
|
final Path target = out.resolve(classInternalName + ".class");
|
||||||
if (Files.exists(target)) {
|
if (Files.exists(target)) {
|
||||||
System.err.println("class " + classInternalName + " is already exists, skipping.");
|
System.err.println("Class " + classInternalName + " already exists, skipping.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new ClassVisitor(Opcodes.ASM4, new ClassWriter(ClassWriter.COMPUTE_MAXS)) {
|
return new ClassVisitor(Opcodes.ASM4, new ClassWriter(ClassWriter.COMPUTE_MAXS)) {
|
||||||
|
@ -126,7 +126,7 @@ public class JarAccessCmd extends BaseCmd implements Opcodes {
|
|||||||
|
|
||||||
Path jar = new File(remainingArgs[0]).toPath();
|
Path jar = new File(remainingArgs[0]).toPath();
|
||||||
if (!Files.exists(jar)) {
|
if (!Files.exists(jar)) {
|
||||||
System.err.println(jar + " is not exists");
|
System.err.println(jar + " doesn't exist");
|
||||||
usage();
|
usage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,7 @@ public class ExDex2Asm extends Dex2Asm {
|
|||||||
super.convertCode(methodNode, mn, clzCtx);
|
super.convertCode(methodNode, mn, clzCtx);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
if (exceptionHandler == null) {
|
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 {
|
} else {
|
||||||
mn.instructions.clear();
|
mn.instructions.clear();
|
||||||
mn.tryCatchBlocks.clear();
|
mn.tryCatchBlocks.clear();
|
||||||
|
@ -308,7 +308,7 @@ public abstract class TestUtils {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
throw new DexException(ex, "fail convert code %s", methodNode.method);
|
throw new DexException(ex, "Failed to convert code for %s", methodNode.method);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user