这是个广告 feature, 流程如下:
点击比如斗鱼后, 首先启动的是不是 app 的而是应用商店的 LauncherRouteActivity
```
D/Appstore( 4886): EVENT:PluginInstrumentation.execStartActivity:{}
D/Appstore( 4886): PROFILING:183721 | 17794ms | main | startActivity.beforeInvoke.start:{}
D/Appstore( 4886): EVENT:activitymanagerHook.isForPlugin:false:{}
I/ActivityManager( 458): START u0 {act=android.intent.action.VIEW cmp=com.xiaomi.mitv.appstore/.launcher.control.LauncherRouteActivity (has extras)} from uid 1000 on display 0
```
处理是这么一段:
```
if(!this.a(v0_2)) { //查询显示广告开关
if(com.xiaomi.mitv.appstore.launcher.control.a.a().b(v0_2)) { //查询是否在白名单, 见下面代码
v0_2 = new Intent(((Context)this), PlayAppAdActivity.class); //广告 Activity
v0_2.putExtra("intent", v1);
}
else if(com.xiaomi.mitv.appstore.launcher.control.a.a().a(v0_2)) {
String v2_1 = v0_2.getComponent().getPackageName();
v0_2 = new Intent("android.intent.action.VIEW"); //警告非官方 app
v0_2.setData(Uri.parse("market://
appstore.mitv.xiaomi.com/details?launch=dont&package=" + v2_1));
}
else {
v0_2.setFlags(268435456);
}
try {
this.startActivity(v0_2);
}
catch(Exception v0_3) {
v0_3.printStackTrace();
c.a(TrackType.ERROR, "startactivity error in LauncherRouteActivity");
this.finish();
return;
}
```
查询白名单
```
public boolean b(Intent arg4) {
boolean v0 = false;
ComponentName v1 = arg4.getComponent();
if(v1 != null) {
String v1_1 = v1.getPackageName();
if(!TextUtils.isEmpty(((CharSequence)v1_1)) && (this.b.ad_app_white_list.contains(v1_1))) {
v0 = true;
}
}
return v0;
}
```
然后呢, 争议性的"广告由 XX 提供"
```
this.a(0);
String v3 = String.format(this.getResources().getString(d.ad_provider), this.J); //ad_provider string 和 this.J 往后看
int v0 = 0;
int v2 = 0;
while(v0 < v3.length()) {
char v4 = v3.charAt(v0);
if((Character.isLowerCase(v4)) || (Character.isUpperCase(v4))) {
++v2;
}
++v0;
}
v0 = v2 / 2 + 7;
Log.d("PlayAppAdActivity", "targetLength = " + v0);
String v0_1 = v3.length() > v0 ? v3.substring(0, v0) + "..." : v3;
this.o.setText(((CharSequence)v0_1)); //显示那段"XX 提供"
```
```
<string name="ad_provider">
%s 提供</string>
```
this.J 为 app label
```
PackageManager v0_1 = this.getPackageManager();
this.J = v0_1.getApplicationLabel(v0_1.getPackageInfo(Intent.parseUri(this.v, 0).getComponent().getPackageName(), 0).applicationInfo);
```