ComeetChat v1.866866806590版本的 MD5 值为:4a7461802cd62adce19de75377dd7ca7
以下内容为反编译后的 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, R.string.licence_err_contact_server, new Object[0]);
} else if (intValue != 299) {
if (intValue == 400) {
gs.b(this.f13775a, R.string.licence_err_client, new Object[0]);
} else {
if (intValue != 550) {
switch (intValue) {
case 497:
gs.b(this.f13775a, R.string.licence_err_client_rate, new Object[0]);
break;
case 498:
gs.d(this.f13775a, R.string.licence_err_already_bound, new Object[0]);
break;
case 499:
if (this.f13777c == 0) {
df.a((Activity) this.f13775a, R.string.dialog_title_not_validated, R.string.dialog_text_not_validated_direct);
break;
}
break;
case 500:
break;
default:
gs.d(this.f13775a, R.string.licence_err_server_unknown_response, new Object[0]);
break;
}
}
gs.d(this.f13775a, R.string.licence_err_server_err, new Object[0]);
}
} else if (this.f13777c == 0) {
gs.a(this.f13775a, 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, R.string.licence_msg_release_key_failed, new Object[0]);
return;
}
return;
}
if (numArr[0].intValue() == 499) {
if (this.f13777c == 2) {
gs.b(this.f13775a, 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;
HttpURLConnection httpURLConnection4 = null;
HttpURLConnection httpURLConnection5 = null;
HttpURLConnection httpURLConnection6 = null;
HttpURLConnection httpURLConnection7 = null;
HttpURLConnection httpURLConnection8 = null;
HttpURLConnection httpURLConnection9 = 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) {
httpURLConnection4 = httpURLConnection2;
bo.d("CheckerTask", "bad URL");
httpURLConnection3 = httpURLConnection4;
if (httpURLConnection4 != null) {
httpURLConnection = httpURLConnection4;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (ProtocolException e6) {
e = e6;
httpURLConnection5 = httpURLConnection2;
bo.b("CheckerTask", "protocol error: https://tasker.joaoapps.com/cgi-bin/nph-validate.cgi:" + e.toString(), false);
httpURLConnection3 = httpURLConnection5;
if (httpURLConnection5 != null) {
httpURLConnection = httpURLConnection5;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (SocketException e7) {
e = e7;
httpURLConnection6 = httpURLConnection2;
bo.b("CheckerTask", "socket error: https://tasker.joaoapps.com/cgi-bin/nph-validate.cgi: " + e.getMessage(), false);
httpURLConnection3 = httpURLConnection6;
if (httpURLConnection6 != null) {
httpURLConnection = httpURLConnection6;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (UnknownHostException unused4) {
httpURLConnection7 = httpURLConnection2;
bo.b("CheckerTask", "unknown host: https://tasker.joaoapps.com/cgi-bin/nph-validate.cgi", false);
httpURLConnection3 = httpURLConnection7;
httpURLConnection = httpURLConnection7;
} catch (IOException e8) {
e = e8;
httpURLConnection8 = httpURLConnection2;
bo.b("CheckerTask", "IO Error: https://tasker.joaoapps.com/cgi-bin/nph-validate.cgi: " + e.toString(), false);
httpURLConnection3 = httpURLConnection8;
if (httpURLConnection8 != null) {
httpURLConnection = httpURLConnection8;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (Exception e9) {
e = e9;
httpURLConnection9 = httpURLConnection2;
bo.d("CheckerTask", "Unexpected exception: " + e.toString());
httpURLConnection3 = httpURLConnection9;
if (httpURLConnection9 != null) {
httpURLConnection = httpURLConnection9;
httpURLConnection.disconnect();
httpURLConnection3 = httpURLConnection;
}
return numArr;
} catch (Throwable th2) {
th = th2;
httpURLConnection3 = httpURLConnection2;
if (httpURLConnection3 != null) {
httpURLConnection3.disconnect();
}
throw th;
}
return numArr;
}
}