Skip to content

Commit 5668fa4

Browse files
committed
woooo
1 parent 722a7cb commit 5668fa4

File tree

92 files changed

+4693
-7411
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+4693
-7411
lines changed

README.txt

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Contributors:
3030
Afffsdd
3131
Szperak
3232
Zooty
33+
samczsun
3334
If I missed you, please feel free to contact me @Konloch or [email protected]
3435

3536
Contribution Guide Lines/Coding Conventions:

src/main/java/com/jhe/hexed/JHexEditorASCII.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void paint(Graphics g) {
6969
g.setColor(Color.black);
7070
}
7171

72-
String s = "" + new Character((char) he.buff[n]);
72+
String s = String.valueOf(he.buff[n]);
7373
if ((he.buff[n] < 20) || (he.buff[n] > 126))
7474
s = "" + (char) 16;
7575
he.printString(g, s, (x++), y);

src/main/java/me/konloch/kontainer/io/DiskReader.java

-94
This file was deleted.

src/main/java/me/konloch/kontainer/io/DiskWriter.java

-200
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
package the.bytecode.club.bytecodeviewer;
22

3-
import java.io.File;
4-
53
import org.apache.commons.io.FileUtils;
4+
import org.zeroturnaround.zip.ZipUtil;
5+
6+
import java.io.File;
7+
import java.nio.file.Files;
8+
import java.nio.file.Path;
69

710
/***************************************************************************
811
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
912
* Copyright (C) 2014 Kalen 'Konloch' Kinloch - http://bytecodeviewer.com *
10-
* *
13+
* *
1114
* This program is free software: you can redistribute it and/or modify *
12-
* it under the terms of the GNU General Public License as published by *
13-
* the Free Software Foundation, either version 3 of the License, or *
14-
* (at your option) any later version. *
15-
* *
16-
* This program is distributed in the hope that it will be useful, *
17-
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
18-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19-
* GNU General Public License for more details. *
20-
* *
21-
* You should have received a copy of the GNU General Public License *
22-
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
15+
* it under the terms of the GNU General Public License as published by *
16+
* the Free Software Foundation, either version 3 of the License, or *
17+
* (at your option) any later version. *
18+
* *
19+
* This program is distributed in the hope that it will be useful, *
20+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
21+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22+
* GNU General Public License for more details. *
23+
* *
24+
* You should have received a copy of the GNU General Public License *
25+
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
2326
***************************************************************************/
2427

2528
public class APKTool {
26-
27-
public static synchronized void decodeResources(File input, File output) {
28-
try {
29-
File dir = new File(BytecodeViewer.tempDirectory+BytecodeViewer.fs+"Decoded Resources");
30-
FileUtils.deleteDirectory(dir);
31-
brut.apktool.Main.main(new String[]{"-s", "-f", "-o", dir.getAbsolutePath(), "decode", input.getAbsolutePath()});
32-
File original = new File(dir.getAbsolutePath() + BytecodeViewer.fs + "original");
33-
FileUtils.deleteDirectory(original);
34-
File classes = new File(dir.getAbsolutePath() + BytecodeViewer.fs + "classes.dex");
35-
classes.delete();
36-
File apktool = new File(dir.getAbsolutePath() + BytecodeViewer.fs + "apktool.yml");
37-
apktool.delete();
38-
File zip = new File(BytecodeViewer.tempDirectory+BytecodeViewer.fs+MiscUtils.randomString(12)+".zip");
39-
ZipUtils.zipFolder(dir.getAbsolutePath(), zip.getAbsolutePath(), null);
40-
if(zip.exists())
41-
zip.renameTo(output);
42-
FileUtils.deleteDirectory(dir);
43-
} catch(Exception e) {
44-
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
45-
}
46-
}
29+
public static synchronized void decodeResources(File input, File output) {
30+
try {
31+
Path temporaryDirectory = Files.createTempDirectory("apkresources");
32+
Files.delete(temporaryDirectory);
33+
brut.apktool.Main.main(new String[]{"-s", "-f", "-o", temporaryDirectory.toAbsolutePath().toString(), "decode", input.getAbsolutePath()});
34+
File directory = temporaryDirectory.toFile();
35+
File original = new File(directory, "original");
36+
FileUtils.deleteDirectory(original);
37+
File classes = new File(directory, "classes.dex");
38+
classes.delete();
39+
File apktool = new File(directory, "apktool.yml");
40+
apktool.delete();
41+
ZipUtil.pack(directory, output);
42+
FileUtils.deleteDirectory(directory);
43+
} catch (Exception e) {
44+
new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e);
45+
}
46+
}
4747
}

0 commit comments

Comments
 (0)