TopTV v3.0.1版本的 MD5 值为:0fc1b9ce94885bc92edd11a6ee3e5932
以下内容为反编译后的 s.java 源代码,内容仅作参考
package d.a.a.d;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.ResolveInfo;
import android.text.TextUtils;
import de.blinkt.openvpn.core.OpenVPNService;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class s {
public static s f29614a;
public Context f29617d;
public String f29615b = "org.torproject.android.intent.extra.SOCKS_PROXY_HOST";
public String f29616c = "org.torproject.android.intent.extra.SOCKS_PROXY_PORT";
public Set<b> f29618e = new HashSet();
public BroadcastReceiver f29619f = new a();
public class a extends BroadcastReceiver {
public a() {
}
@Override
public void onReceive(Context context, Intent intent) {
if (TextUtils.equals(intent.getAction(), "org.torproject.android.intent.action.STATUS")) {
for (b bVar : s.this.f29618e) {
bVar.d(intent);
}
String stringExtra = intent.getStringExtra("org.torproject.android.intent.extra.STATUS");
if (!TextUtils.equals(stringExtra, "ON")) {
if (TextUtils.equals(stringExtra, "STARTS_DISABLED")) {
for (b bVar2 : s.this.f29618e) {
bVar2.c(intent);
}
return;
}
return;
}
int intExtra = intent.getIntExtra(s.this.f29616c, 9050);
String stringExtra2 = intent.getStringExtra(s.this.f29615b);
if (TextUtils.isEmpty(stringExtra2)) {
stringExtra2 = "127.0.0.1";
}
for (b bVar3 : s.this.f29618e) {
bVar3.a(intent, stringExtra2, intExtra);
}
}
}
}
public interface b {
void a(Intent intent, String str, int i2);
void b();
void c(Intent intent);
void d(Intent intent);
}
public static boolean c(Context context) {
List<ResolveInfo> queryBroadcastReceivers = context.getPackageManager().queryBroadcastReceivers(e(context), 0);
return queryBroadcastReceivers != null && queryBroadcastReceivers.size() > 0;
}
public static s d(OpenVPNService openVPNService) {
if (f29614a == null) {
f29614a = new s();
}
return f29614a;
}
public static Intent e(Context context) {
Intent intent = new Intent("org.torproject.android.intent.action.START");
intent.setPackage("org.torproject.android");
intent.putExtra("org.torproject.android.intent.extra.PACKAGE_NAME", context.getPackageName());
return intent;
}
public synchronized s b(Context context, b bVar) {
if (this.f29618e.size() == 0) {
context.getApplicationContext().registerReceiver(this.f29619f, new IntentFilter("org.torproject.android.intent.action.STATUS"));
this.f29617d = context.getApplicationContext();
}
if (!c(context)) {
bVar.b();
}
this.f29618e.add(bVar);
return this;
}
public synchronized void f(b bVar) {
this.f29618e.remove(bVar);
if (this.f29618e.size() == 0) {
this.f29617d.unregisterReceiver(this.f29619f);
}
}
public void g() {
Context context = this.f29617d;
context.sendBroadcast(e(context));
}
}