OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 UIWrapperProvider.java 源代码,内容仅作参考
package com.excelliance.kxqp.gs.provider;
import android.content.ComponentName;
import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
import android.os.Message;
import android.text.TextUtils;
import android.util.Log;
import com.android.spush.util.WebActionRouter;
import com.excelliance.kxqp.VersionManager;
import com.excelliance.kxqp.gs.bean.CheckObbVersionUpdateResult;
import com.excelliance.kxqp.gs.bean.JumpGpBean;
import com.excelliance.kxqp.gs.d.h;
import com.excelliance.kxqp.gs.main.MainActivity;
import com.excelliance.kxqp.gs.out.DialogActivity;
import com.excelliance.kxqp.gs.service.CustomIntentService;
import com.excelliance.kxqp.gs.ui.legalalert.LegalActivity;
import com.excelliance.kxqp.gs.util.an;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.au;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bn;
import com.excelliance.kxqp.gs.util.bs;
import com.excelliance.kxqp.gs.util.bt;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.c;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.ck;
import com.excelliance.kxqp.platforms.ExcellianceAppInfo;
import com.excelliance.kxqp.sdk.StatisticsGS;
import com.excelliance.kxqp.ui.InitialData;
import com.excelliance.kxqp.util.master.e;
import com.tencent.open.SocialConstants;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.security.MessageDigest;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class UIWrapperProvider extends ContentProvider {
private a f7981a;
@Override
public int delete(Uri uri, String str, String[] strArr) {
return 0;
}
@Override
public String getType(Uri uri) {
return null;
}
@Override
public Uri insert(Uri uri, ContentValues contentValues) {
return null;
}
@Override
public Cursor query(Uri uri, String[] strArr, String str, String[] strArr2, String str2) {
return null;
}
@Override
public int update(Uri uri, ContentValues contentValues, String str, String[] strArr) {
return 0;
}
@Override
public boolean onCreate() {
Log.d("UIWrapperProvider", String.format("UIWrapperProvider/onCreate:thread(%s)", Thread.currentThread().getName()));
HandlerThread handlerThread = new HandlerThread("splash");
handlerThread.start();
this.f7981a = new a(handlerThread.getLooper());
return true;
}
@Override
public Bundle call(String str, String str2, Bundle bundle) {
String str3;
if (bundle != null) {
bundle.size();
}
Integer num = -1;
if (bundle != null) {
num = Integer.valueOf(bundle.getInt("extra.splash.type", -1));
}
if (str.equals("method.splash.start")) {
if (num.intValue() == 0) {
this.f7981a.sendMessage(this.f7981a.obtainMessage(0, str2));
}
} else if (str.equals("method.splash.stop")) {
num.intValue();
this.f7981a.sendMessage(this.f7981a.obtainMessage(1, str2));
} else if (str.equals("method.get.autosendmsg") && bundle != null) {
String string = bundle.getString("arg.plugin");
az.d("UIWrapperProvider", "method: " + str + ", plugin " + string + ", username " + bundle.getString("arg.username"));
if (TextUtils.equals("MMAutoText", string)) {
Bundle bundle2 = new Bundle();
bundle2.putBoolean("result.needsend", true);
if (System.currentTimeMillis() % 2 == 1) {
bundle2.putString("result.message", "消息来自 <SHZM> ^_^ !");
} else {
bundle2.putString("result.message", "消息来自 <XXYY> ^_^ !");
}
return bundle2;
}
} else if (str.equals("method.get.autosendfilter") && bundle != null) {
if (TextUtils.equals("MMAutoText", bundle.getString("arg.plugin"))) {
Bundle bundle3 = new Bundle();
bundle3.putString("result.filter", "SHZM;XXYY");
return bundle3;
}
} else if (str.equals("method.uievent")) {
Bundle bundle4 = new Bundle();
long j = bundle.getLong("extra.uievent.arg.event");
Log.i("UIWrapperProvider", "uievent:" + j);
if (j == 1) {
a(str, bundle, bundle4);
} else if (j == 2) {
Object obj = bundle.get("extra.uievent.arg.1");
if (obj instanceof Intent) {
Intent intent = (Intent) obj;
String str4 = intent.getPackage();
String action = intent.getAction();
Log.i("UIWrapperProvider", "call: ---aPackage:" + str4 + "---action:" + action);
if (TextUtils.equals(action, "android.intent.action.VIEW") && TextUtils.equals(str4, "com.google.android.youtube")) {
Log.i("UIWrapperProvider", "ignore1");
bundle4.putInt("extra.uievent.result.code", 1);
} else if (TextUtils.equals(action, "android.intent.action.MAIN") && TextUtils.equals(str4, "com.google.android.youtube")) {
Log.i("UIWrapperProvider", "ignore2");
bundle4.putInt("extra.uievent.result.code", 1);
Message obtainMessage = this.f7981a.obtainMessage(2);
obtainMessage.obj = str4;
this.f7981a.sendMessage(obtainMessage);
} else {
Log.i("UIWrapperProvider", "allow1");
bundle4.putInt("extra.uievent.result.code", 0);
}
} else {
Log.i("UIWrapperProvider", "allow2");
bundle4.putInt("extra.uievent.result.code", 0);
}
Log.i("UIWrapperProvider", "o:" + obj);
} else if ((4 & j) != 0) {
String string2 = bundle.getString("extra.uievent.arg.1");
String host = Uri.parse(string2).getHost();
if (host.contains("googleapis") || host.contains("googleusercontent")) {
try {
String l = ck.l(getContext());
if (TextUtils.equals(l, by.a(getContext(), "sp_total_info").b(".downloader.manager.info", ""))) {
l = "";
}
boolean n = bx.a().n(getContext());
String encode = URLEncoder.encode(string2, "UTF-8");
StringBuilder sb = new StringBuilder();
sb.append("link=");
sb.append(encode);
if (TextUtils.isEmpty(l)) {
str3 = "";
} else {
str3 = "&devices=" + l;
}
sb.append(str3);
sb.append("&vip=");
sb.append(n);
String sb2 = sb.toString();
String str5 = a(getContext()) + "?" + sb2;
Log.e("UIWrapperProvider", "request download url = " + string2 + ", new location = " + str5);
boolean booleanValue = by.a(getContext(), ".sp.common.disposable.flag.info").b("sp_common_disposable_key_global_has_vpn_proxy", false).booleanValue();
by.a(getContext(), "sp_total_info").b("gp_and_gpgame_due_disconnection", false).booleanValue();
boolean d = bt.a().d("com.android.vending") ^ true;
boolean d2 = true ^ bt.a().d("com.google.android.play.games");
Log.e("UIWrapperProvider", " isVpn" + booleanValue + " currentClickHomeGPAndPG" + str5 + " isSpeedGP:" + d + " isSpeedPG:" + d2);
if (!booleanValue && d && d2) {
bundle4.putString("extra.uievent.result", str5);
}
Message obtainMessage2 = this.f7981a.obtainMessage(4);
Bundle bundle5 = new Bundle();
bundle5.putString(SocialConstants.PARAM_URL, string2);
bundle5.putString("devices", l);
obtainMessage2.obj = bundle5;
this.f7981a.sendMessageDelayed(obtainMessage2, 200L);
this.f7981a.post(new Runnable() {
@Override
public void run() {
h.a(UIWrapperProvider.this.getContext(), 2);
}
});
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
} else if ((j & 8) != 0) {
Log.i("UIWrapperProvider", "wangcheng");
a(bundle);
}
return bundle4;
}
return super.call(str, str2, bundle);
}
private String a(String str) {
Matcher matcher = Pattern.compile("market://details\\?id=(.*)").matcher(str);
return (matcher.find() ? matcher.group(1) : "").split(com.alipay.sdk.sys.a.f472b)[0];
}
private void a(String str, Bundle bundle, Bundle bundle2) {
boolean z;
Object obj = bundle.get("extra.uievent.arg.1");
Object obj2 = bundle.get("extra.uievent.arg.2");
Object obj3 = bundle.get("extra.uievent.arg.3");
String str2 = "";
boolean z2 = obj3 instanceof Intent;
String str3 = null;
if (z2) {
Intent intent = (Intent) obj3;
ComponentName component = intent.getComponent();
String packageName = component != null ? component.getPackageName() : null;
if (packageName == null) {
packageName = intent.getPackage();
}
str2 = (packageName == null && (obj instanceof ComponentName)) ? ((ComponentName) obj).getPackageName() : packageName;
Log.i("UIWrapperProvider", "call: ------" + str2);
}
if (getContext() != null && TextUtils.equals(str2, getContext().getPackageName())) {
bundle2.putInt("extra.uievent.result.code", 0);
return;
}
String str4 = "";
JumpGpBean jumpGpBean = new JumpGpBean();
if (obj3 == null || obj2 == null || !z2) {
z = false;
} else {
Intent intent2 = (Intent) obj3;
Uri data = intent2.getData();
Log.d("UIWrapperProvider", "call uri:" + data);
String obj4 = obj2.toString();
try {
jumpGpBean.setArea(intent2.getStringExtra("ext_limit_area"));
} catch (Exception e) {
e.printStackTrace();
}
try {
jumpGpBean.setIcon(intent2.getStringExtra("ext_game_icon"));
} catch (Exception e2) {
e2.printStackTrace();
}
try {
jumpGpBean.setName(intent2.getStringExtra("ext_game_name"));
} catch (Exception e3) {
e3.printStackTrace();
}
if (data != null && data.toString().contains("market://details?id")) {
if (!TextUtils.equals(data.toString(), "market://details?id=" + obj4)) {
z = true;
if (data != null && data.toString().contains("market://details?id")) {
str3 = a(data.toString());
}
jumpGpBean.setPkg(str3);
str4 = obj4;
}
}
z = false;
if (data != null) {
str3 = a(data.toString());
}
jumpGpBean.setPkg(str3);
str4 = obj4;
}
if (bs.n(str3)) {
bundle2.putInt("extra.uievent.result.code", 0);
return;
}
if (!z && !TextUtils.equals(str4, "com.android.vending")) {
bundle2.putInt("extra.uievent.result.code", 0);
return;
}
Log.i("UIWrapperProvider", "UIWrapperProvider/call() called with: method = 【" + str + "】, arg2 = 【" + obj2 + "】,gamePackageName = 【" + str4 + "】, jumpToGpDetail = 【" + z + "】");
if (as.b(getContext(), str2, true)) {
Context context = getContext();
Log.d("UIWrapperProvider", "call allow open");
context.sendBroadcast(new Intent(context.getPackageName() + VersionManager.q));
}
au a2 = au.a();
boolean a3 = a2.a(str2);
az.o("UIWrapperProvider", "[" + str2 + "/" + a3 + "]");
boolean a4 = com.excelliance.kxqp.bitmap.a.a.a(getContext(), str2, new CheckObbVersionUpdateResult());
boolean z3 = e.d(getContext(), str2, 0).getCpu() == 2;
if (z3) {
z3 = !e.a(InitialData.a(getContext()).a(-1, 0, str2).getPath());
}
if (TextUtils.equals(str2, "com.excean.android.vending") && TextUtils.equals(str4, "com.android.vending")) {
Log.d("UIWrapperProvider", "call: " + str2);
bundle2.putInt("extra.uievent.result.code", 1);
} else if (z) {
a(bundle2, str4, jumpGpBean);
} else {
if (TextUtils.isEmpty(str2)) {
bundle2.putInt("extra.uievent.result.code", 0);
return;
}
if (a3 || a4 || z3) {
boolean v = a2.v(str2, getContext());
az.o("UIWrapperProvider", "call: " + v);
if (a4) {
bundle2.putInt("extra.uievent.result.code", 1);
Message obtainMessage = this.f7981a.obtainMessage(5);
obtainMessage.obj = str2;
this.f7981a.sendMessage(obtainMessage);
} else if (z3) {
bundle2.putInt("extra.uievent.result.code", 1);
Message obtainMessage2 = this.f7981a.obtainMessage(6);
obtainMessage2.obj = str2;
this.f7981a.sendMessage(obtainMessage2);
} else if (v) {
a2.c(str2, getContext());
bundle2.putInt("extra.uievent.result.code", 0);
} else {
bundle2.putInt("extra.uievent.result.code", 1);
Message obtainMessage3 = this.f7981a.obtainMessage(2);
obtainMessage3.obj = str2;
this.f7981a.sendMessage(obtainMessage3);
}
} else {
bundle2.putInt("extra.uievent.result.code", 0);
Context context2 = getContext();
if (context2 != null) {
Intent intent3 = new Intent();
intent3.putExtra("pkgName", str2);
String str5 = context2.getPackageName() + ".do_search_share_info";
Log.i("UIWrapperProvider", "action:" + str5);
intent3.setAction(str5);
context2.sendBroadcast(intent3);
}
}
}
Message obtainMessage4 = this.f7981a.obtainMessage(3);
obtainMessage4.obj = str2;
this.f7981a.sendMessageDelayed(obtainMessage4, 200L);
}
private void a(Bundle bundle, String str, JumpGpBean jumpGpBean) {
az.i("UIWrapperProvider", "UIWrapperProvider/handleJumpGpDetail() called with: thread = 【" + Thread.currentThread() + "】, result = 【" + bundle + "】, gamePackageName = 【" + str + "】, jumpGpBean = 【" + jumpGpBean + "");
if (TextUtils.equals(str, "com.hotplaygames.gt")) {
ExcellianceAppInfo b2 = com.excelliance.kxqp.repository.a.a(getContext()).b(str);
if (b2 != null) {
String g = cd.g(bs.c(getContext(), b2.getPath()));
az.i("UIWrapperProvider", "UIWrapperProvider/call() : sign = 【" + g + "】");
if (TextUtils.equals("cbf09adf19bca77a4a0e5477ee21cab0", g)) {
if (as.B(getContext()) > 0) {
if (!TextUtils.isEmpty(jumpGpBean.getArea())) {
Intent intent = new Intent(getContext(), (Class<?>) DialogActivity.class);
Bundle bundle2 = new Bundle();
bundle2.putParcelable("ext_action_extras_jump_gp_bean", jumpGpBean);
bundle2.putInt("ext_action_event", 1);
intent.putExtras(bundle2);
intent.setFlags(268435456);
getContext().startActivity(intent);
bundle.putInt("extra.uievent.result.code", 1);
return;
}
bundle.putInt("extra.uievent.result.code", 0);
return;
}
Intent intent2 = new Intent(getContext(), (Class<?>) MainActivity.class);
intent2.setPackage(getContext().getPackageName());
intent2.putExtra("act", ".action_login_google_dialog");
intent2.setFlags(268435456);
getContext().startActivity(intent2);
bundle.putInt("extra.uievent.result.code", 1);
return;
}
bundle.putInt("extra.uievent.result.code", 1);
return;
}
bundle.putInt("extra.uievent.result.code", 1);
return;
}
bundle.putInt("extra.uievent.result.code", 1);
}
private void a(Bundle bundle) {
Log.d("UIWrapperProvider", String.format("UIWrapperProvider/gameInnerUpdate:thread(%s)", Thread.currentThread().getName()));
try {
Context context = getContext();
String string = bundle.getString("extra.uievent.arg.1");
String string2 = bundle.getString("extra.uievent.arg.2");
int i = bundle.getInt("extra.uievent.arg.3");
Uri parse = Uri.parse(string);
if (parse != null && (parse.getScheme().equals("file") || parse.getScheme().equals("content"))) {
Log.d("UIWrapperProvider", "install stage >> " + parse + ", callingPackage >> " + string2 + ", vuid:" + i);
File file = new File(bn.b(context, false));
if (!file.exists()) {
file.mkdirs();
} else if (file.isFile()) {
file.delete();
file.mkdirs();
}
try {
File createTempFile = File.createTempFile("vmdl", ".tmp", file);
an.c(createTempFile.getAbsolutePath());
createTempFile.mkdir();
File file2 = new File(createTempFile, "base.apk");
Log.d("UIWrapperProvider", "handleInstallPackage >> " + createTempFile.getAbsolutePath());
InputStream openInputStream = context.getContentResolver().openInputStream(parse);
String absolutePath = file2.getAbsolutePath();
an.a(openInputStream, absolutePath);
if (file2.exists()) {
String str = as.a(context, absolutePath).packageName;
Log.d("UIWrapperProvider", "target >> " + str);
by a2 = by.a(context, "SP_ALLOW_INNER_INSTALL");
if (TextUtils.equals(str, string2) || a2.b(string2, false).booleanValue()) {
String k = bn.k(context, str);
an.a(new FileInputStream(file2), k);
an.c(file2.getParent());
boolean exists = new File(k).exists();
Log.d("UIWrapperProvider", "gameInnerUpdate: " + exists);
if (exists) {
if ("com.android.vending".equals(str)) {
bs.b(str, context);
bs.a(2, context);
}
Intent intent = new Intent("com.excelliance.kxqp.action.installDownApps");
intent.setComponent(new ComponentName(context.getPackageName(), "com.excelliance.kxqp.SmtServService"));
Bundle bundle2 = new Bundle();
bundle2.putString(WebActionRouter.KEY_PKG, str);
bundle2.putString("apkPath", k);
bundle2.putInt("installType", 1);
bundle2.putInt("sourceType", 3);
intent.putExtra("bundle", bundle2);
try {
context.startService(intent);
} catch (Exception e) {
e.printStackTrace();
}
Log.d("UIWrapperProvider", String.format("UIWrapperProvider/gameInnerUpdate:thread(%s) start install", Thread.currentThread().getName()));
return;
}
return;
}
return;
}
return;
} catch (IOException unused) {
Log.e("UIWrapperProvider", "Couldn't create temp file for install package file.");
return;
}
}
if (parse != null && parse.getScheme().equals("package")) {
Log.d("UIWrapperProvider", "install package >> " + parse);
return;
}
Log.w("UIWrapperProvider", "invaild apk >> " + parse);
} catch (Exception e2) {
e2.printStackTrace();
}
}
public class a extends Handler {
a(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message message) {
Context context;
switch (message.what) {
case 1:
UIWrapperProvider.this.getContext().sendBroadcast(new Intent(UIWrapperProvider.this.getContext().getPackageName() + ".cancel_stop_app_animation"));
break;
case 2:
String str = (String) message.obj;
az.i("UIWrapperProvider", "pkg:" + str);
UIWrapperProvider.this.b(str);
break;
case 3:
String str2 = (String) message.obj;
if (str2 != null) {
StatisticsGS.getInstance().uploadUserAction(UIWrapperProvider.this.getContext(), 17, str2);
break;
}
break;
case 4:
Bundle bundle = (Bundle) message.obj;
String string = bundle.getString(SocialConstants.PARAM_URL);
if (string != null) {
String str3 = "";
try {
byte[] digest = MessageDigest.getInstance("MD5").digest(string.getBytes());
int length = digest.length;
int i = 0;
int i2 = 0;
while (true) {
if (i < length) {
String str4 = str3 + Integer.toHexString(digest[i]);
i2++;
if (i2 >= 32) {
str3 = str4;
} else {
i++;
str3 = str4;
}
}
}
} catch (Exception unused) {
}
if (str3.length() == 0) {
str3 = string.length() > 32 ? string.substring(string.length() - 32) : string;
}
try {
StatisticsGS.getInstance().uploadUserAction(UIWrapperProvider.this.getContext(), 69, URLEncoder.encode(str3, "UTF-8"));
} catch (Exception unused2) {
}
}
String string2 = bundle.getString("devices");
if (!TextUtils.isEmpty(string2) && (context = UIWrapperProvider.this.getContext()) != null) {
Intent intent = new Intent(context, (Class<?>) CustomIntentService.class);
intent.setAction(context.getPackageName() + ".report.downloadermanager.state");
intent.putExtra("devices", string2);
try {
intent.putExtra(SocialConstants.PARAM_URL, URLEncoder.encode(string, "UTF-8"));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
try {
context.startService(intent);
} catch (Exception unused3) {
break;
}
}
break;
case 5:
Intent intent2 = new Intent(UIWrapperProvider.this.getContext(), (Class<?>) MainActivity.class);
intent2.setPackage(UIWrapperProvider.this.getContext().getPackageName());
intent2.putExtra("packageName", message.obj + "");
intent2.putExtra("act", "UpdateObb");
intent2.setFlags(268435456);
UIWrapperProvider.this.getContext().startActivity(intent2);
break;
case 6:
Intent intent3 = new Intent(UIWrapperProvider.this.getContext(), (Class<?>) MainActivity.class);
intent3.setPackage(UIWrapperProvider.this.getContext().getPackageName());
intent3.putExtra("packageName", message.obj + "");
intent3.putExtra("act", "ShowIntercepterDialog");
intent3.setFlags(268435456);
UIWrapperProvider.this.getContext().startActivity(intent3);
break;
}
super.handleMessage(message);
}
}
public void b(String str) {
Intent intent = new Intent(getContext(), (Class<?>) LegalActivity.class);
intent.setPackage(getContext().getPackageName());
intent.putExtra("packageName", str);
intent.setFlags(268435456);
getContext().startActivity(intent);
}
public String a(Context context) {
String b2 = by.a(context, "sp_gp_down_address").b("sp_gp_down_address", (String) null);
return !TextUtils.isEmpty(b2) ? c.b(b2) : "http://115.239.251.228:8081/store/tunnel";
}
}