Skip to content

Commit 9d93f1e

Browse files
committed
2.6.0 Released
01/06/2015 - Now saves if maximized or not. 01/07/2015 - For all save as functions, it will now append the correct extension if not added by the user. 01/07/2015 - You can no longer use use the save functions if no classes are loaded (fixes a crash issue). 01/07/2015 - Moved the Update Check to the Settings menu. 01/08/2015 - Added an extremely basic code sqeuence diagram plugin. 01/08/2015 - Updated CFR to CFR_0.93.jar 01/08/2015 - Threaded the Add files function. 01/08/2015 - Finally implemented Kontainer's HTTPRequest wrapper now that I've open sourced it. 01/08/2015 - Set the panes to be non-editable. 01/08/2015 - Sexified the view pane selection. 01/08/2015 - Started working on Smali Editing support, finished decompiler so far. 01/09/2015 - Fixed a bug with saving. 01/09/2015 - Added add entire directory. 01/09/2015 - Fixed import .DEX files. 01/10/2015 - Finished Smali Editing. 01/10/2015 - Fixed a class opening issue with sychronization. 01/11/2015 - Threaded all of the save functions. 01/11/2015 - Removed all instances of the setCursor to busy. 01/11/2015 - Added are you sure you wish to overwrite this existing file to all the other save functions. 01/11/2015 - All of the decompiling names are now randomly generated instead of a counting number. 01/11/2015 - Updated CFR to CFR_0.94.jar 01/11/2015 - Updated to the latest version of FernFlower. 01/11/2015 - Fixed an extension appending issue with save Java file.
1 parent 410196f commit 9d93f1e

30 files changed

+1376
-262
lines changed
40 MB
Binary file not shown.

README.txt

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Bytecode Viewer is an Advanced Lightweight Java Bytecode Viewer, GUI APK Decompiler, GUI DEX Decompiler, GUI Procyon Java Decompiler, GUI CFR Java Decompiler, GUI FernFlower Java Decompiler, GUI Jar-Jar, Hex Viewer, Code Searcher, Debugger and more.
1+
Bytecode Viewer is an Advanced Lightweight Java Bytecode Viewer, GUI APK Decompiler, GUI DEX Decompiler, GUI Procyon Java Decompiler, GUI CFR Java Decompiler, GUI FernFlower Java Decompiler, GUI DEX2Jar, GUI Jar2DEX, GUI Jar-Jar, Hex Viewer, Code Searcher, Debugger and more.
22
It's written completely in Java, and it's open sourced. It's currently being maintained and developed by Konloch.
33

44
There is also a plugin system that will allow you to interact with the loaded classfiles, for example you can write a String deobfuscator, a malicious code searcher, or something else you can think of.
@@ -236,4 +236,28 @@ Changelog:
236236
01/06/2015 - Silenced the error connecting to update server for offline mode.
237237
01/06/2015 - Fixed a search function with Android APKs.
238238
--- 2.5.2 ---:
239-
01/06/2015 - Completely fixed the search function with Android APKs.
239+
01/06/2015 - Completely fixed the search function with Android APKs.
240+
--- 2.6.0 ---:
241+
01/06/2015 - Now saves if maximized or not.
242+
01/07/2015 - For all save as functions, it will now append the correct extension if not added by the user.
243+
01/07/2015 - You can no longer use use the save functions if no classes are loaded (fixes a crash issue).
244+
01/07/2015 - Moved the Update Check to the Settings menu.
245+
01/08/2015 - Added an extremely basic code sqeuence diagram plugin.
246+
01/08/2015 - Updated CFR to CFR_0.93.jar
247+
01/08/2015 - Threaded the Add files function.
248+
01/08/2015 - Finally implemented Kontainer's HTTPRequest wrapper now that I've open sourced it.
249+
01/08/2015 - Set the panes to be non-editable.
250+
01/08/2015 - Sexified the view pane selection.
251+
01/08/2015 - Started working on Smali Editing support, finished decompiler so far.
252+
01/09/2015 - Fixed a bug with saving.
253+
01/09/2015 - Added add entire directory.
254+
01/09/2015 - Fixed import .DEX files.
255+
01/10/2015 - Finished Smali Editing.
256+
01/10/2015 - Fixed a class opening issue with sychronization.
257+
01/11/2015 - Threaded all of the save functions.
258+
01/11/2015 - Removed all instances of the setCursor to busy.
259+
01/11/2015 - Added are you sure you wish to overwrite this existing file to all the other save functions.
260+
01/11/2015 - All of the decompiling names are now randomly generated instead of a counting number.
261+
01/11/2015 - Updated CFR to CFR_0.94.jar
262+
01/11/2015 - Updated to the latest version of FernFlower.
263+
01/11/2015 - Fixed an extension appending issue with save Java file.

libs/baksmali-2.0.3.jar

998 KB
Binary file not shown.
1.31 MB
Binary file not shown.

libs/cfr_0_94.jar

1.31 MB
Binary file not shown.
604 KB
Binary file not shown.

libs/jgraphx.jar

612 KB
Binary file not shown.

libs/smali-2.0.3-obf-patched.jar

462 KB
Binary file not shown.
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
package me.konloch.kontainer.io;
2+
3+
import java.io.BufferedReader;
4+
import java.io.DataOutputStream;
5+
import java.io.InputStreamReader;
6+
import java.net.HttpURLConnection;
7+
import java.net.Proxy;
8+
import java.net.URL;
9+
import java.util.ArrayList;
10+
import java.util.List;
11+
import java.util.Map.Entry;
12+
import java.util.Set;
13+
14+
/**
15+
* A wrapper for Java SE classes to write/read an HTTP Request
16+
*
17+
* @author Konloch
18+
*
19+
*/
20+
21+
public class HTTPRequest {
22+
23+
public URL url;
24+
private int timeout = 30000;
25+
private String cookie;
26+
private String referer;
27+
private String postData;
28+
private String useragent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0";
29+
private Proxy proxy;
30+
private boolean setFollowRedirects = true;
31+
private BufferedReader reader;
32+
private DataOutputStream writer;
33+
private HttpURLConnection connection;
34+
private Set<Entry<String, List<String>>> lastConnectionHeaders;
35+
36+
/**
37+
* Creates a new HTTPRequest object
38+
* @param url
39+
*/
40+
public HTTPRequest(URL url) {
41+
this.url = url;
42+
}
43+
44+
/**
45+
* Sets a referer to send to the web server
46+
*/
47+
public void setReferer(String referer) {
48+
this.referer = referer;
49+
}
50+
51+
/**
52+
* Set a cookie string to send to the web server
53+
*/
54+
public void setCookie(String cookie) {
55+
this.cookie = cookie;
56+
}
57+
58+
/**
59+
* Sets post data to send to the web server
60+
*/
61+
public void setPostData(String postData) {
62+
this.postData = postData;
63+
}
64+
65+
/**
66+
* Sets a custom useragent, default 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0'
67+
*/
68+
public void setUseragent(String useragent) {
69+
this.useragent = useragent;
70+
}
71+
72+
/**
73+
* Sets the seconds till timeout, default 30,000 milliseconds
74+
*/
75+
public void setTimeout(int timeout) {
76+
this.timeout = timeout;
77+
}
78+
79+
/**
80+
* Sets a proxy to connect through
81+
*/
82+
public void setProxy(Proxy proxy) {
83+
this.proxy = proxy;
84+
}
85+
86+
/**
87+
* Used to get the headers the webserver sent on our last connection
88+
*/
89+
public Set<Entry<String, List<String>>> getLastConnectionHeaders() {
90+
return lastConnectionHeaders;
91+
}
92+
93+
/**
94+
* By default follow redirects are enabled
95+
*/
96+
public void setFollowRedirects(boolean setFollowRedirects) {
97+
this.setFollowRedirects = setFollowRedirects;
98+
}
99+
100+
/**
101+
* Used to set up the connection to read the content.
102+
*/
103+
private void setup() throws Exception {
104+
if(proxy != null)
105+
connection = (HttpURLConnection) url.openConnection(proxy);
106+
else
107+
connection = (HttpURLConnection) url.openConnection();
108+
109+
if(cookie != null)
110+
connection.setRequestProperty("Cookie", cookie);
111+
if(referer != null)
112+
connection.addRequestProperty("Referer", referer);
113+
114+
connection.setRequestProperty("User-Agent", useragent);
115+
connection.setReadTimeout(timeout);
116+
connection.setConnectTimeout(timeout);
117+
connection.setUseCaches(false);
118+
HttpURLConnection.setFollowRedirects(setFollowRedirects);
119+
120+
if(postData != null) {
121+
connection.setRequestMethod("POST");
122+
connection.setDoOutput(true);
123+
connection.setDoInput(true);
124+
writer = new DataOutputStream(connection.getOutputStream());
125+
writer.writeBytes(postData);
126+
writer.flush();
127+
}
128+
129+
reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
130+
}
131+
132+
/**
133+
* Reads the entire page and returns a string array
134+
* @return
135+
* @throws Exception
136+
*/
137+
public String[] read() throws Exception {
138+
ArrayList<String> st;
139+
140+
try {
141+
setup();
142+
143+
st = new ArrayList<String>();
144+
String s;
145+
while((s = reader.readLine()) != null)
146+
st.add(s);
147+
148+
lastConnectionHeaders = connection.getHeaderFields().entrySet();
149+
} catch(Exception e) {
150+
cleanup();
151+
throw e;
152+
} finally {
153+
cleanup();
154+
}
155+
156+
return st.toArray(new String[st.size()]);
157+
}
158+
159+
/**
160+
* Reads as many lines as expected unless it reaches the end.
161+
* @param linesToRead
162+
* @return
163+
* @throws Exception
164+
*/
165+
public String[] read(int linesToRead) throws Exception {
166+
ArrayList<String> st;
167+
168+
try {
169+
setup();
170+
171+
st = new ArrayList<String>();
172+
for(int i = 0; i < linesToRead; i++) {
173+
String s = reader.readLine();
174+
if(s != null)
175+
st.add(s);
176+
}
177+
178+
lastConnectionHeaders = connection.getHeaderFields().entrySet();
179+
} catch(Exception e) {
180+
cleanup();
181+
throw e;
182+
} finally {
183+
cleanup();
184+
}
185+
186+
return st.toArray(new String[st.size()]);
187+
}
188+
189+
/**
190+
* Only reads the first line
191+
* @return
192+
* @throws Exception
193+
*/
194+
public String readSingle() throws Exception {
195+
String s;
196+
197+
try {
198+
setup();
199+
200+
s = reader.readLine();
201+
202+
lastConnectionHeaders = connection.getHeaderFields().entrySet();
203+
} catch(Exception e) {
204+
cleanup();
205+
throw e;
206+
} finally {
207+
cleanup();
208+
}
209+
210+
return s;
211+
}
212+
213+
/**
214+
* Reads until it reaches the expected line then it returns it.
215+
* @param linesToRead
216+
* @return
217+
* @throws Exception
218+
*/
219+
public String readSingle(int linesToRead) throws Exception {
220+
String s;
221+
222+
try {
223+
setup();
224+
225+
for(int i = 0; i < linesToRead-1; i++)
226+
reader.readLine();
227+
228+
s = reader.readLine();
229+
230+
lastConnectionHeaders = connection.getHeaderFields().entrySet();
231+
} catch(Exception e) {
232+
cleanup();
233+
throw e;
234+
} finally {
235+
cleanup();
236+
}
237+
238+
return s;
239+
}
240+
241+
/**
242+
* Used to clean up the connection, closes the connections and nulls the objects
243+
*/
244+
private void cleanup() {
245+
try { reader.close(); } catch(Exception e) {}
246+
try { writer.close(); } catch(Exception e) {}
247+
try { connection.disconnect(); } catch(Exception e) {}
248+
reader = null;
249+
writer = null;
250+
connection = null;
251+
}
252+
253+
}

0 commit comments

Comments
 (0)