ComeetChat v1.866866806590版本的 MD5 值为:4a7461802cd62adce19de75377dd7ca7
以下内容为反编译后的 Kid.java 源代码,内容仅作参考
package net.dinglisch.android.taskerm;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.net.Uri;
import android.os.Bundle;
import android.text.Spanned;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import net.danlew.android.joda.R;
import net.dinglisch.android.taskerm.bh;
public class Kid extends Activity {
private static boolean f11223a = false;
private static int[] f11224b = {446, 428, 427, 444, 445, 447, 426};
private static String[] f11225c = {"com.mobitobi.android.gentlealarm", "org.kaloersoftware.kaloerclock", "com.smartmadsoft.openwatch", "net.artifix.pomodroido", "com.ventel.android.radardroid2", "com.gray101.redditnotify", "com.teslacoilsw.widgetlocker"};
private static int[] f11226d = {R.string.en_gentlealarm, R.string.en_kaloer_clock, R.string.en_openwatch, R.string.en_pomodroido, R.string.en_radardroid, R.string.en_redditnotify, R.string.en_widgetlocker};
private static int[] f11227e = {450, 112, 558, 371, 555, 568, 599, 911, 456, 395, 556, 643, 442, 553, 444, 458};
private static String[] f11228f = {com.google.a.a.a.class.getPackage().getName(), "com.googlecode.android_scripting", "org.damazio.notifier", "com.timsu.astrid", "mobi.beyondpod", "com.dailyroads.v", "com.lakeridge.DueToday", "com.mobitobi.android.gentlealarm", "com.latedroid.juicedefender", "com.latedroid.juicedefender", "com.grazerss", "ocs.android.pro", "com.lslk.sleepbot", "com.zegoggles.smssync", "com.teslacoilsw.flashlight", "com.teslacoilsw.widgetlocker"};
private static int[] g = {R.string.apndroid_label, R.string.sl4a_label, R.string.an_android_notifier, R.string.an_astrid, R.string.an_beyondpod, R.string.an_dailyroads, R.string.an_duetoday, R.string.an_gentlealarm, R.string.jd_label, R.string.jd_label, R.string.an_newsrob, R.string.an_officetalk, R.string.an_sleepbot, R.string.an_smsbackup, R.string.an_teslaled, R.string.an_widgetlocker};
private static String[] h = {"https://play.google.com/store/apps/details?id=com.codecarpet.apndroid.pro", "https://code.google.com/p/android-scripting/downloads/list", null, null, null, null, null, null, null, null, null, null, null, null, null, null};
private static Boolean i = null;
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
ba.a(this, "Kid.onCreate");
cy.a(this, "Kid");
fy e2 = fy.e(this);
if (e2 == null) {
finish();
return;
}
e2.l();
bi C = e2.z(0).C();
if (a(e2, C) && a(e2) && c(e2)) {
MonitorService.d((Context) this, true);
gs.c((Context) this, true);
b();
int l = C.l();
if (e2.i(l)) {
ft j = e2.j(l);
Bundle bundle2 = null;
Intent intent = getIntent();
if (intent != null) {
bundle2 = new Bundle();
Uri data = intent.getData();
if (data != null) {
bundle2.putString("%launch_data", data.toString());
}
}
ExecuteService.a(this, j, 1, -1, -1, -1, (String) null, (List<String>) null, "launch", bundle2);
} else {
bo.c("Kid", "unknown launch task ID " + l);
}
finish();
}
}
public static boolean a() {
if (i == null) {
return false;
}
return i.booleanValue();
}
public static boolean a(Context context) {
if (i == null) {
i = Boolean.valueOf(!context.getPackageName().startsWith("net.dinglisch.android.tasker"));
}
return i.booleanValue();
}
public static void b(Context context) {
boolean b2;
if (f11223a) {
return;
}
if (a(context)) {
SharedPreferences h2 = gs.h(context);
boolean z = !h2.contains("dscl");
if (z) {
SharedPreferences.Editor edit = h2.edit();
edit.putLong(bh.o.f12241a, System.currentTimeMillis());
edit.putLong(bh.o.f12242b, System.currentTimeMillis());
edit.putBoolean("dscl", true);
edit.commit();
}
SharedPreferences g2 = gs.g(context);
SharedPreferences.Editor edit2 = g2.edit();
if (z) {
edit2.putBoolean("mFn", false);
b2 = false;
} else {
b2 = Settings.b(context, g2);
}
if (Settings.d(g2) != b2) {
edit2.putBoolean("mSi", b2);
}
fy e2 = fy.e(context);
if (e2 != null) {
boolean i2 = e2.z(0).C().i();
if (i2 != g2.getBoolean("lEnable", !i2)) {
edit2.putBoolean("leEnle", i2);
edit2.putBoolean("dsd", i2);
edit2.putBoolean("lEnable", i2);
edit2.putBoolean("tEnable", i2);
edit2.putBoolean("lpa", i2);
}
edit2.commit();
}
c(context);
}
f11223a = true;
}
private void a(Dialog dialog) {
dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
Kid.this.finish();
}
});
dialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
@Override
public void onCancel(DialogInterface dialogInterface) {
Kid.this.finish();
}
});
}
private boolean a(fy fyVar) {
boolean z;
PackageManager packageManager = getPackageManager();
int i2 = 0;
while (true) {
if (i2 >= f11228f.length) {
z = true;
break;
}
if (fyVar.e(f11227e[i2])) {
boolean g2 = cr.g(packageManager, f11228f[i2]);
bo.b("Kid", "checkApp: code: " + f11227e[i2] + " pkg: " + f11228f[i2] + " have: " + g2);
if (!g2) {
a(ct.a(this, g[i2], new Object[0]), h[i2]);
z = false;
break;
}
}
i2++;
}
if (z && ((fyVar.F() || fyVar.g(3071)) && !cr.g(packageManager, "net.dinglisch.android.zoom"))) {
a(ct.a(this, R.string.cn_zoom, new Object[0]), cr.b(packageManager) ? "market://details?id=net.dinglisch.android.zoom" : "http://zoom.dinglisch.net/Zoom.apk");
z = false;
}
if (z) {
int i3 = 0;
while (true) {
if (i3 < f11225c.length) {
if (fyVar.g(f11224b[i3]) && !cr.g(packageManager, f11225c[i3])) {
a(ct.a(this, f11226d[i3], new Object[0]), (String) null);
z = false;
break;
}
i3++;
} else {
break;
}
}
}
if (fyVar.g(425) && !cr.b(packageManager, bh.c.f12220a)) {
a(ct.a(this, R.string.en_email_received, new Object[0]), (String) null);
z = false;
}
if (!fyVar.g(424) || cr.b(packageManager, bh.c.f12220a)) {
return z;
}
a(ct.a(this, R.string.en_screebl, new Object[0]), (String) null);
return false;
}
private void a(String str, final String str2) {
Spanned b2;
AlertDialog.Builder builder = new AlertDialog.Builder(this);
boolean z = str2 != null;
if (z) {
b2 = ct.b(this, R.string.dc_kid_missing_component_can_download, ct.a(this, R.string.word_application, new Object[0]).toLowerCase(), str);
} else {
b2 = ct.b(this, R.string.dc_kid_missing_component, ct.a(this, R.string.word_application, new Object[0]).toLowerCase(), str);
}
builder.setMessage(b2);
if (z) {
builder.setNegativeButton(R.string.button_label_no, (DialogInterface.OnClickListener) null);
}
builder.setPositiveButton(R.string.button_label_ok, z ? new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
gs.a((Context) Kid.this, new Intent("android.intent.action.VIEW", Uri.parse(str2)));
Kid.this.finish();
}
} : null);
AlertDialog create = builder.create();
a(create);
create.show();
}
private HashMap<String, String> b(fy fyVar) {
HashMap<String, String> hashMap = new HashMap<>();
if (fyVar.e(559) || fyVar.e(699)) {
Iterator<ft> it = fyVar.r(0).iterator();
while (it.hasNext()) {
for (c cVar : it.next().A()) {
int i2 = cVar.i();
if ((i2 == 559) || i2 == 699) {
String c2 = cVar.j(1).c();
int indexOf = c2.indexOf(58);
if (indexOf != -1) {
c2 = c2.substring(0, indexOf);
}
if (!c2.equals("default") && !gx.h(c2)) {
hashMap.put(c2, c2);
}
}
}
}
}
return hashMap;
}
private boolean a(fy fyVar, bi biVar) {
HashMap<String, String> a2 = fyVar.a(getPackageManager(), false);
HashMap<String, String> hashMap = new HashMap<>();
for (Map.Entry<String, String> entry : a2.entrySet()) {
if (!biVar.a(entry.getKey())) {
hashMap.put(entry.getKey(), entry.getValue());
}
}
return a(hashMap, ct.a(this, R.string.cn_plugin, new Object[0]).toLowerCase());
}
private boolean c(fy fyVar) {
return a(b(fyVar), ct.a(this, R.string.ttsengineselect_title, new Object[0]).toLowerCase());
}
private boolean a(HashMap<String, String> hashMap, String str) {
PackageManager packageManager = getPackageManager();
for (Map.Entry<String, String> entry : hashMap.entrySet()) {
final String key = entry.getKey();
if (!cr.g(packageManager, key)) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
final boolean b2 = cr.b(packageManager);
builder.setMessage(ct.b(this, b2 ? R.string.dc_kid_missing_component_can_download : R.string.dc_kid_missing_component, str, entry.getValue()));
builder.setNegativeButton(R.string.button_label_no, (DialogInterface.OnClickListener) null).setPositiveButton(R.string.button_label_ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i2) {
if (b2) {
Intent intent = new Intent();
intent.setData(Uri.parse("market://details?id=" + key));
Kid.this.startActivity(intent);
}
Kid.this.finish();
}
});
AlertDialog create = builder.create();
a(create);
create.show();
return false;
}
}
return true;
}
public static boolean c(Context context) {
File h2 = gs.h();
if (h2 == null) {
bo.b("Kid", "not unpacking scripts, no external storage");
return false;
}
AssetManager assets = context.getAssets();
if (assets == null) {
bo.b("Kid", "init: no assets");
return false;
}
try {
String[] list = assets.list("kid/sl4a");
if (gs.a((Object[]) list)) {
return false;
}
File file = new File(h2, "sl4a/scripts");
if (!gs.e(file)) {
return false;
}
int length = ".mp3".length();
boolean z = true;
for (String str : list) {
String str2 = "kid/sl4a" + File.separator + str;
File file2 = new File(file, str.substring(0, str.length() - length));
long length2 = file2.exists() ? file2.length() : -66L;
bo.b("Kid", str2 + " -> " + file2);
AssetFileDescriptor openFd = assets.openFd(str2);
long length3 = openFd.getLength();
openFd.close();
if (length2 != length3) {
try {
if (gs.a(assets.open(str2), (OutputStream) new FileOutputStream(file2))) {
z = false;
}
} catch (FileNotFoundException e2) {
bo.d("Kid", "unpackScripts: " + e2.getMessage());
}
}
}
return z;
} catch (IOException e3) {
bo.a("Kid", "unpackScripts: ", (Exception) e3);
return false;
}
}
private void b() {
boolean a2 = MonitorService.a((Context) this);
boolean d2 = gs.d(this, MonitorService.class.getName());
bo.b("Kid", "enabled: " + a2 + " running: " + d2);
if (!a2 || d2) {
return;
}
Intent intent = new Intent(this, (Class<?>) MonitorService.class);
intent.putExtra("eventType", 9995);
MonitorService.b(this, intent);
}
public static String a(String str) {
return gs.h(str.replace(File.separatorChar, '.'));
}
public static String b(String str) {
return gs.h(str.replace(File.separatorChar, '.'));
}
public static boolean d(Context context) {
return go.b() && go.b(cr.a(context));
}
}