Wallkin v1.86859532693版本的 MD5 值为:c3099a56aae2c3706b2239994117cc3a
以下内容为反编译后的 w.java 源代码,内容仅作参考
package net.dinglisch.android.taskerm;
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.AsyncTask;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.SocketException;
import java.net.URL;
import java.net.UnknownHostException;
import net.danlew.android.joda.R;
import net.dinglisch.android.taskerm.bh;
public class w extends AsyncTask<String, Integer, Integer[]> {
private Context f13775a;
private boolean f13776b;
private int f13777c;
private a f13778d;
public interface a {
void a(int i, int i2, int i3);
}
protected void a(int i, int i2, int i3) {
Licence.a();
if (this.f13778d != null) {
this.f13778d.a(i, i2, i3);
}
}
@Override
public Integer[] doInBackground(String... strArr) {
return a(strArr[0]);
}
@Override
public void onPostExecute(Integer[] numArr) {
b(numArr);
a(this.f13777c, numArr[0].intValue(), numArr[1].intValue());
}
private void b(Integer[] numArr) {
if (this.f13776b) {
int intValue = numArr[0].intValue();
if (intValue == -1) {
gs.d(this.f13775a, (int) R.string.licence_err_contact_server, new Object[0]);
} else if (intValue != 299) {
if (intValue == 400) {
gs.b(this.f13775a, (int) R.string.licence_err_client, new Object[0]);
} else {
if (intValue != 550) {
switch (intValue) {
case 497:
gs.b(this.f13775a, (int) R.string.licence_err_client_rate, new Object[0]);
break;
case 498:
gs.d(this.f13775a, (int) R.string.licence_err_already_bound, new Object[0]);
break;
case 499:
if (this.f13777c == 0) {
df.a((Activity) this.f13775a, (int) R.string.dialog_title_not_validated, (int) R.string.dialog_text_not_validated_direct);
break;
}
break;
case 500:
break;
default:
gs.d(this.f13775a, (int) R.string.licence_err_server_unknown_response, new Object[0]);
break;
}
}
gs.d(this.f13775a, (int) R.string.licence_err_server_err, new Object[0]);
}
} else if (this.f13777c == 0) {
gs.a(this.f13775a, (int) R.string.licence_validated, new Object[0]);
}
}
SharedPreferences sharedPreferences = this.f13775a.getSharedPreferences(bh.j, 0);
if (numArr[0].intValue() == 299) {
if (!sharedPreferences.contains(bh.o.f12241a)) {
sharedPreferences.edit().putLong(bh.o.f12241a, System.currentTimeMillis()).commit();
Licence.c(this.f13775a);
}
int i = this.f13777c;
if (this.f13777c == 2) {
gs.c(this.f13775a, (int) R.string.licence_msg_release_key_failed, new Object[0]);
}
} else if (numArr[0].intValue() == 499) {
if (this.f13777c == 2) {
gs.b(this.f13775a, (int) R.string.licence_msg_release_key_ok, new Object[0]);
sharedPreferences.edit().remove(bh.o.f12241a).commit();
} else if (sharedPreferences.contains(bh.o.f12241a)) {
bo.d("CheckerTask", "server reports key no longer valid");
}
}
}
private Integer[] a(String str) {
HttpURLConnection httpURLConnection;
HttpURLConnection httpURLConnection2;
Integer[] numArr = {-1, -1};
HttpURLConnection httpURLConnection3 = null;
try {
try {
httpURLConnection2 = (HttpURLConnection) new URL(str).openConnection();
} catch (Throwable th) {
th = th;
}
} catch (MalformedURLException unused) {
} catch (ProtocolException e2) {
e = e2;
} catch (SocketException e3) {
e = e3;
} catch (UnknownHostException unused2) {
} catch (IOException e4) {
e = e4;
} catch (Exception e5) {
e = e5;
}
try {
httpURLConnection2.setRequestProperty("User-Agent", gs.a(false));
httpURLConnection2.setRequestMethod("GET");
httpURLConnection2.setDoOutput(false);
httpURLConnection2.setDoInput(false);
httpURLConnection2.setReadTimeout(15000);
httpURLConnection2.connect();
numArr[0] = Integer.valueOf(httpURLConnection2.getResponseCode());
if (this.f13777c == 1) {
numArr[1] = Integer.valueOf(httpURLConnection2.getHeaderFieldInt("Tvl", -1));
}
String str2 = "response: " + numArr[0] + " / " + numArr[1];
bo.b("CheckerTask", str2);
httpURLConnection3 = str2;
if (httpURLConnection2 != null) {
httpURLConnection2.disconnect();
httpURLConnection3 = str2;
}
} catch (MalformedURLException unused3) {
httpURLConnection3 = httpURLConnection2;
bo.d("CheckerTask", "bad URL");
httpURLConnection3 = httpURLConnection3;
if (httpURLConnection3 != null) {
httpURLConnection = httpURLConnection3;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (ProtocolException e6) {
e = e6;
httpURLConnection3 = httpURLConnection2;
bo.b("CheckerTask", "protocol error: https://tasker.joaoapps.com/cgi-bin/nph-validate.cgi:" + e.toString(), false);
httpURLConnection3 = httpURLConnection3;
if (httpURLConnection3 != null) {
httpURLConnection = httpURLConnection3;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (SocketException e7) {
e = e7;
httpURLConnection3 = httpURLConnection2;
bo.b("CheckerTask", "socket error: https://tasker.joaoapps.com/cgi-bin/nph-validate.cgi: " + e.getMessage(), false);
httpURLConnection3 = httpURLConnection3;
if (httpURLConnection3 != null) {
httpURLConnection = httpURLConnection3;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (UnknownHostException unused4) {
httpURLConnection3 = httpURLConnection2;
bo.b("CheckerTask", "unknown host: https://tasker.joaoapps.com/cgi-bin/nph-validate.cgi", false);
httpURLConnection3 = httpURLConnection3;
httpURLConnection = httpURLConnection3;
} catch (IOException e8) {
e = e8;
httpURLConnection3 = httpURLConnection2;
bo.b("CheckerTask", "IO Error: https://tasker.joaoapps.com/cgi-bin/nph-validate.cgi: " + e.toString(), false);
httpURLConnection3 = httpURLConnection3;
if (httpURLConnection3 != null) {
httpURLConnection = httpURLConnection3;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (Exception e9) {
e = e9;
httpURLConnection3 = httpURLConnection2;
bo.d("CheckerTask", "Unexpected exception: " + e.toString());
httpURLConnection3 = httpURLConnection3;
if (httpURLConnection3 != null) {
httpURLConnection = httpURLConnection3;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (Throwable th2) {
th = th2;
httpURLConnection3 = httpURLConnection2;
if (httpURLConnection3 != null) {
httpURLConnection3.disconnect();
}
throw th;
}
return numArr;
}
}