Some small changes

This commit is contained in:
khanhduytran0 2020-03-19 17:07:50 +07:00
parent e1ce65eb29
commit 32b121cbd2
34 changed files with 27 additions and 40 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/build

Binary file not shown.

View File

@ -735,47 +735,32 @@ public class MainActivity extends Activity implements OnTouchListener
appendToLog(text + "\n"); appendToLog(text + "\n");
} }
private boolean isLogAllowed = false;
private boolean isFirstLog = true;
private void appendToLog(final String text) { private void appendToLog(final String text) {
new Thread(new Runnable(){ // test skip
if (true) return;
@Override
public void run()
{
while (!isLogAllowed) {
try { textLog.post(new Runnable(){
if (isFirstLog) { private String allText;
isFirstLog = false; @Override
Thread.sleep(5000); public void run()
isLogAllowed = true; {
} textLog.append(text);
if (toggleScrollLog.isChecked()) {
Thread.sleep(100); contentScroll.fullScroll(ScrollView.FOCUS_DOWN);
} catch (InterruptedException e) {} }
} }
});
textLog.post(new Runnable(){ textLogBehindGL.post(new Runnable(){
private String allText;
@Override
public void run()
{
textLog.append(text);
if (toggleScrollLog.isChecked()) {
contentScroll.fullScroll(ScrollView.FOCUS_DOWN);
}
}
});
textLogBehindGL.post(new Runnable(){
@Override @Override
public void run() public void run()
{ {
textLogBehindGL.append(text); textLogBehindGL.append(text);
} }
}); });
}
}, "PojavLoggerThread").start();
} }
public void handleMessage(Message msg) { public void handleMessage(Message msg) {

View File

@ -292,7 +292,7 @@ public final class Tools
mainLoader.loadClass("com.android.dx.observer.ObserverStatus").getMethod("setReceiver", String.class).invoke(null, receiveMethod); mainLoader.loadClass("com.android.dx.observer.ObserverStatus").getMethod("setReceiver", String.class).invoke(null, receiveMethod);
Class mainClass = mainLoader.loadClass("com.android.dx.command.Main"); Class mainClass = mainLoader.loadClass("com.android.dx.command.Main");
Method mainMethod = mainClass.getMethod("main", new String[]{}.getClass()); Method mainMethod = mainClass.getMethod("main", new String[]{}.getClass());
mainMethod.invoke(null, new Object[]{new String[]{"--dex", "--output", newFileOut.getAbsolutePath(), fileIn}}); mainMethod.invoke(null, new Object[]{new String[]{"--dex", "--no-optimize", "--min-sdk-version=" + Build.VERSION.SDK_INT, "--output", newFileOut.getAbsolutePath(), fileIn}});
//com.android.dx.mod.Main.dexTheJar(fileIn, fileOut, ctx.getCacheDir().getAbsolutePath(), listener); //com.android.dx.mod.Main.dexTheJar(fileIn, fileOut, ctx.getCacheDir().getAbsolutePath(), listener);

View File

@ -22,9 +22,10 @@ public class DownloadUtils {
InputStream is = null; InputStream is = null;
byte[] buf; // 16384 byte[] buf; // 16384
try { try {
// System.out.println("Connecting: " + url.toString());
HttpURLConnection conn = (HttpURLConnection) url.openConnection(); HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestProperty("User-Agent", USER_AGENT); conn.setRequestProperty("User-Agent", USER_AGENT);
conn.setConnectTimeout(2000); conn.setConnectTimeout(10000);
conn.setDoInput(true); conn.setDoInput(true);
conn.connect(); conn.connect();
if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) { if (conn.getResponseCode() != HttpURLConnection.HTTP_OK) {