正在查看: 零界绘 v1.0.2 应用的 TTDelegateActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: 零界绘 v1.0.2 应用的 TTDelegateActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.ss.android.downloadlib.activity;
import android.app.Activity;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.Window;
import android.view.WindowManager;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.ss.android.cl.y.cl.cl;
import com.ss.android.downloadlib.addownload.cl.h;
import com.ss.android.downloadlib.addownload.jv;
import com.ss.android.downloadlib.addownload.rh;
import com.ss.android.downloadlib.addownload.y.io;
import com.ss.android.downloadlib.guide.install.y;
import com.ss.android.downloadlib.q;
import com.ss.android.downloadlib.st.da;
import com.ss.android.downloadlib.st.i;
import com.ss.android.socialbase.downloader.downloader.st;
import com.ss.android.socialbase.downloader.st.lu;
import com.ss.android.y.y.cl.g;
import com.ss.android.y.y.cl.gd;
import com.ss.android.y.y.io.lu;
import java.lang.ref.WeakReference;
import org.json.JSONObject;
public class TTDelegateActivity extends Activity {
public static y p;
public boolean cl;
public cl lu;
public Intent y = null;
public static void cl(String str, com.ss.android.cl.y.cl.y yVar) {
Intent lu = lu(yVar);
lu.addFlags(268435456);
lu.putExtra("type", 11);
lu.putExtra("package_name", str);
if (jv.getContext() != null) {
jv.getContext().startActivity(lu);
}
}
public static Intent lu(@NonNull com.ss.android.cl.y.cl.y yVar) {
return new Intent(jv.getContext(), (Class<?>) TTDelegateActivity.class);
}
public static void y(String str, String[] strArr) {
Intent intent = new Intent(jv.getContext(), (Class<?>) TTDelegateActivity.class);
intent.addFlags(268435456);
intent.putExtra("type", 1);
intent.putExtra("permission_id_key", str);
intent.putExtra("permission_content_key", strArr);
if (jv.getContext() != null) {
jv.getContext().startActivity(intent);
}
}
@Override
public void onCreate(@Nullable Bundle bundle) {
super.onCreate(bundle);
cl();
this.y = getIntent();
jv.cl(this);
y();
}
@Override
public void onNewIntent(Intent intent) {
super.onNewIntent(intent);
setIntent(intent);
this.y = intent;
jv.cl(this);
y();
}
@Override
public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
jv.io().y(this, i, strArr, iArr);
}
@Override
public void onStop() {
cl clVar;
super.onStop();
if (!this.cl || (clVar = this.lu) == null) {
return;
}
lu y = !TextUtils.isEmpty(clVar.f()) ? q.y(jv.getContext()).y(this.lu.f(), null, true) : q.y(jv.getContext()).cl(this.lu.y());
if (y == null || y.iw() < y.fz() || isFinishing()) {
return;
}
finish();
}
private void lu() {
throw new UnsupportedOperationException("Method not decompiled: com.ss.android.downloadlib.activity.TTDelegateActivity.lu():void");
}
public static void cl(String str, long j, String str2) {
Intent intent = new Intent(jv.getContext(), (Class<?>) TTDelegateActivity.class);
intent.addFlags(268435456);
intent.putExtra("type", 14);
intent.putExtra("package_name", str);
intent.putExtra("model_id", j);
intent.putExtra("market_app_id", str2);
if (jv.getContext() != null) {
jv.getContext().startActivity(intent);
}
}
public static void y(String str, com.ss.android.cl.y.cl.y yVar) {
Intent lu = lu(yVar);
lu.addFlags(268435456);
lu.putExtra("type", 2);
lu.putExtra("open_url", str);
if (jv.getContext() != null) {
jv.getContext().startActivity(lu);
}
}
public static void y(com.ss.android.cl.y.cl.y yVar) {
Intent lu = lu(yVar);
lu.addFlags(268435456);
lu.putExtra("type", 4);
lu.putExtra("model_id", yVar.cl());
if (jv.getContext() != null) {
jv.getContext().startActivity(lu);
}
}
public static void cl(@NonNull com.ss.android.cl.y.cl.y yVar) {
y(yVar, 5, "", "", "", "");
}
public static void cl(@NonNull com.ss.android.cl.y.cl.y yVar, String str, String str2, String str3) {
y(yVar, 7, str, str2, str3, "");
}
public static void cl(@NonNull com.ss.android.cl.y.cl.y yVar, String str, String str2, String str3, String str4) {
y(yVar, 20, str, str2, str3, str4);
}
private void cl() {
Window window = getWindow();
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.alpha = 0.0f;
window.setAttributes(attributes);
}
public static void y(com.ss.android.cl.y.cl.y yVar, y yVar2) {
Intent lu = lu(yVar);
lu.addFlags(268435456);
lu.putExtra("type", 9);
p = yVar2;
if (jv.getContext() != null) {
jv.getContext().startActivity(lu);
}
}
private void cl(final String str, String[] strArr) {
if (!TextUtils.isEmpty(str) && strArr != null && strArr.length > 0) {
g gVar = new g() {
public WeakReference<Activity> lu;
{
this.lu = new WeakReference<>(TTDelegateActivity.this);
}
@Override
public void y() {
com.ss.android.downloadlib.st.q.y(str);
com.ss.android.socialbase.appdownloader.lu.y(this.lu.get());
}
@Override
public void y(String str2) {
com.ss.android.downloadlib.st.q.y(str, str2);
com.ss.android.socialbase.appdownloader.lu.y(this.lu.get());
}
};
if (Build.VERSION.SDK_INT >= 23) {
try {
jv.io().y(this, strArr, gVar);
return;
} catch (Exception e) {
jv.l().y(e, "requestPermission");
}
}
gVar.y();
return;
}
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
}
public static void y(long j) {
Intent intent = new Intent(jv.getContext(), (Class<?>) TTDelegateActivity.class);
intent.addFlags(268435456);
intent.putExtra("type", 10);
intent.putExtra("app_info_id", j);
if (jv.getContext() != null) {
jv.getContext().startActivity(intent);
}
}
private void cl(String str) {
Intent st = da.st(this, str);
if (st == null) {
return;
}
try {
st.addFlags(268435456);
st.putExtra("start_only_for_android", true);
startActivity(st);
} catch (Exception e) {
com.bytedance.sdk.component.utils.jv.y(e);
} finally {
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
}
}
public static void y(String str, long j, String str2, @NonNull JSONObject jSONObject) {
Intent intent = new Intent(jv.getContext(), (Class<?>) TTDelegateActivity.class);
intent.addFlags(268435456);
intent.putExtra("type", 12);
intent.putExtra("package_name", str);
intent.putExtra("model_id", j);
intent.putExtra("param", str2);
intent.putExtra("ext_json", jSONObject.toString());
if (jv.getContext() != null) {
jv.getContext().startActivity(intent);
}
}
private void cl(long j) {
final cl p2 = h.y().p(j);
if (p2 == null) {
com.ss.android.downloadlib.io.lu.y().y("showOpenAppDialogInner nativeModel null");
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
return;
}
gd lu = jv.lu();
lu.y y = new lu.y(this).y("已安装完成");
Object[] objArr = new Object[1];
objArr[0] = TextUtils.isEmpty(p2.es()) ? "刚刚下载的应用" : p2.es();
lu.cl(y.cl(String.format("%1$s已安装完成,是否立即打开?", objArr)).lu("打开").p("取消").y(false).y(da.p(this, p2.io())).y(new lu.cl() {
@Override
public void cl(DialogInterface dialogInterface) {
com.ss.android.downloadlib.p.y.y().cl("market_openapp_cancel", p2);
TTDelegateActivity tTDelegateActivity = TTDelegateActivity.this;
if (tTDelegateActivity != null && !tTDelegateActivity.isFinishing()) {
dialogInterface.dismiss();
}
com.ss.android.socialbase.appdownloader.lu.y((Activity) TTDelegateActivity.this);
}
@Override
public void lu(DialogInterface dialogInterface) {
com.ss.android.socialbase.appdownloader.lu.y((Activity) TTDelegateActivity.this);
}
@Override
public void y(DialogInterface dialogInterface) {
com.ss.android.downloadlib.cl.y.cl(p2);
TTDelegateActivity tTDelegateActivity = TTDelegateActivity.this;
if (tTDelegateActivity != null && !tTDelegateActivity.isFinishing()) {
dialogInterface.dismiss();
}
com.ss.android.socialbase.appdownloader.lu.y((Activity) TTDelegateActivity.this);
}
}).y(2).y());
com.ss.android.downloadlib.p.y.y().cl("market_openapp_window_show", p2);
}
public static void y(String str, long j, String str2) {
Intent intent = new Intent(jv.getContext(), (Class<?>) TTDelegateActivity.class);
intent.addFlags(268435456);
intent.putExtra("type", 13);
intent.putExtra("package_name", str);
intent.putExtra("model_id", j);
intent.putExtra("need_comment", str2);
if (jv.getContext() != null) {
jv.getContext().startActivity(intent);
}
}
public static void y(String str, long j) {
Intent intent = new Intent(jv.getContext(), (Class<?>) TTDelegateActivity.class);
intent.addFlags(268435456);
intent.putExtra("type", 15);
intent.putExtra("package_name", str);
intent.putExtra("model_id", j);
if (jv.getContext() != null) {
jv.getContext().startActivity(intent);
}
}
private void lu(long j) {
new com.ss.android.downloadlib.addownload.compliance.y(this, j).show();
}
public static void y(Context context, String str, long j) {
Intent intent = new Intent(context, (Class<?>) TTDelegateActivity.class);
intent.addFlags(268435456);
intent.putExtra("type", 16);
intent.putExtra("package_name", str);
intent.putExtra("model_id", j);
if (context != null) {
context.startActivity(intent);
}
}
public static void y(@NonNull com.ss.android.cl.y.cl.y yVar, String str) {
y(yVar, 19, "", "", "", str);
}
public static void y(@NonNull com.ss.android.cl.y.cl.y yVar, String str, String str2, String str3) {
y(yVar, 8, str, str2, str3, "");
}
public static void y(@NonNull com.ss.android.cl.y.cl.y yVar, String str, String str2, String str3, String str4) {
y(yVar, 21, str, str2, str3, str4);
}
public static void y(@NonNull com.ss.android.cl.y.cl.y yVar, int i, String str, String str2, String str3, String str4) {
Intent lu = lu(yVar);
lu.addFlags(268435456);
lu.putExtra("type", i);
if (!TextUtils.isEmpty(str2)) {
lu.putExtra("positive_button_text", str2);
}
if (!TextUtils.isEmpty(str3)) {
lu.putExtra("negative_button_text", str3);
}
if (!TextUtils.isEmpty(str4)) {
lu.putExtra("delete_button_text", str4);
}
if (!TextUtils.isEmpty(str)) {
lu.putExtra("message_text", str);
}
lu.putExtra("model_id", yVar.cl());
if (jv.getContext() != null) {
jv.getContext().startActivity(lu);
}
}
public void y() {
Intent intent = this.y;
if (intent != null) {
switch (intent.getIntExtra("type", 0)) {
case 1:
cl(this.y.getStringExtra("permission_id_key"), this.y.getStringArrayExtra("permission_content_key"));
break;
case 2:
y(this.y.getStringExtra("open_url"));
break;
case 3:
case 6:
case 17:
case 18:
default:
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
break;
case 4:
cl(this.y.getLongExtra("model_id", 0L));
break;
case 5:
y(this.y.getLongExtra("model_id", 0L), "");
break;
case 7:
case 8:
case 20:
case 21:
lu();
break;
case 9:
y yVar = p;
if (yVar != null) {
yVar.y();
}
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
break;
case 10:
lu(this.y.getLongExtra("app_info_id", 0L));
break;
case 11:
cl(this.y.getStringExtra("package_name"));
break;
case 12:
i.y(this, this.y.getStringExtra("package_name"), this.y.getLongExtra("model_id", 0L), this.y.getStringExtra("param"), this.y.getStringExtra("ext_json"));
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
break;
case 13:
i.y(this, this.y.getStringExtra("package_name"), this.y.getLongExtra("model_id", 0L), this.y.getStringExtra("need_comment"));
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
break;
case 14:
i.cl(this, this.y.getStringExtra("package_name"), this.y.getLongExtra("model_id", 0L), this.y.getStringExtra("market_app_id"));
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
break;
case 15:
i.y(this, this.y.getStringExtra("package_name"), this.y.getLongExtra("model_id", 0L));
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
break;
case 16:
i.cl(this, this.y.getStringExtra("package_name"), this.y.getLongExtra("model_id", 0L));
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
break;
case 19:
y(this.y.getLongExtra("model_id", 0L), this.y.getStringExtra("delete_button_text"));
break;
}
this.y = null;
}
}
private void y(long j, String str) {
if (rh.y() == null) {
return;
}
cl p2 = h.y().p(j);
if (p2 != null) {
com.ss.android.socialbase.downloader.st.lu i = st.cl(jv.getContext()).i(p2.b());
JSONObject jSONObject = new JSONObject();
try {
jSONObject.putOpt("time_after_click", Long.valueOf(System.currentTimeMillis() - p2.yc()));
jSONObject.putOpt("click_download_size", Long.valueOf(p2.w()));
if (i != null) {
jSONObject.putOpt("download_length", Long.valueOf(i.iw()));
jSONObject.putOpt("download_percent", Long.valueOf(i.iw() / i.fz()));
jSONObject.putOpt("download_apk_size", Long.valueOf(i.fz()));
jSONObject.putOpt("download_current_bytes", Integer.valueOf((int) (i.iw() / 1048576)));
jSONObject.putOpt("download_total_bytes", Integer.valueOf((int) (i.fz() / 1048576)));
}
} catch (Exception e) {
com.bytedance.sdk.component.utils.jv.y(e);
}
if (!TextUtils.isEmpty(str)) {
com.ss.android.downloadlib.p.y.y().y("cancel_pause_reserve_wifi_dialog_show", jSONObject, p2);
} else {
com.ss.android.downloadlib.p.y.y().cl("pause_reserve_wifi_dialog_show", jSONObject, p2);
}
}
io.y y = new io.y(this).y(false).y(rh.y());
if (!TextUtils.isEmpty(str)) {
y.p(str).y(rh.cl());
}
y.y().show();
this.cl = true;
this.lu = p2;
}
private void y(String str) {
try {
if (TextUtils.isEmpty(str)) {
return;
}
Uri parse = Uri.parse(str);
Intent intent = new Intent("android.intent.action.VIEW");
intent.setData(parse);
intent.putExtra("open_url", str);
intent.addFlags(268435456);
if (com.ss.android.socialbase.downloader.da.y.lu().y("fix_app_link_flag")) {
intent.addFlags(67108864);
}
intent.putExtra("start_only_for_android", true);
startActivity(intent);
} catch (Exception e) {
com.bytedance.sdk.component.utils.jv.y(e);
} finally {
com.ss.android.socialbase.appdownloader.lu.y((Activity) this);
}
}
}