花瓣 v4.6.12版本的 MD5 值为:6a3515d4d16d98931f1b3d25a91b257e
以下内容为反编译后的 AppPrivacyPolicyActivity.java 源代码,内容仅作参考
package com.ss.android.downloadlib.addownload.compliance;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.RenderProcessGoneDetail;
import android.webkit.WebResourceRequest;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ImageView;
import com.bytedance.sdk.openadsdk.R;
import com.ss.android.downloadlib.constants.EventConstants;
import com.ss.android.downloadlib.utils.j;
public class AppPrivacyPolicyActivity extends Activity {
private ImageView a;
private WebView b;
private long c;
private long f11749d;
private String f11750e;
private void b() {
this.a = (ImageView) findViewById(R.id.iv_privacy_back);
this.b = (WebView) findViewById(R.id.privacy_webview);
this.a.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
e.a(EventConstants.Refer.LP_APP_PRIVACY_CLICK_CLOSE, AppPrivacyPolicyActivity.this.f11749d);
AppPrivacyPolicyActivity.this.finish();
}
});
WebSettings settings = this.b.getSettings();
settings.setDefaultFontSize(16);
settings.setCacheMode(-1);
settings.setJavaScriptEnabled(true);
settings.setDomStorageEnabled(true);
if (Build.VERSION.SDK_INT >= 21) {
settings.setMixedContentMode(0);
}
settings.setLoadWithOverviewMode(true);
settings.setUseWideViewPort(true);
settings.setSupportZoom(true);
settings.setBuiltInZoomControls(true);
settings.setDisplayZoomControls(false);
settings.setSavePassword(false);
settings.setAllowFileAccess(false);
this.b.setWebViewClient(new WebViewClient() {
private boolean a(Uri uri) {
String scheme = uri.getScheme();
return ("http".equals(scheme) || "https".equals(scheme)) ? false : true;
}
@Override
public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail renderProcessGoneDetail) {
if (Build.VERSION.SDK_INT < 26) {
return super.onRenderProcessGone(webView, renderProcessGoneDetail);
}
if (!renderProcessGoneDetail.didCrash()) {
j.a("System killed the WebView rendering process to reclaim memory. Recreating...");
if (webView != null) {
((ViewGroup) webView.getParent()).removeView(webView);
webView.destroy();
}
return true;
}
j.a("The WebView rendering process crashed!");
if (webView != null) {
((ViewGroup) webView.getParent()).removeView(webView);
webView.destroy();
}
return true;
}
@Override
@TargetApi(21)
public boolean shouldOverrideUrlLoading(WebView webView, WebResourceRequest webResourceRequest) {
return a(webResourceRequest.getUrl());
}
@Override
public boolean shouldOverrideUrlLoading(WebView webView, String str) {
return a(Uri.parse(str));
}
});
a(this.b);
this.b.setScrollBarStyle(0);
this.b.loadUrl(this.f11750e);
}
@Override
public void onBackPressed() {
e.a(EventConstants.Refer.LP_APP_PRIVACY_CLICK_CLOSE, this.f11749d);
super.onBackPressed();
}
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
setContentView(R.layout.ttdownloader_activity_app_privacy_policy);
if (a()) {
b();
} else {
com.ss.android.socialbase.appdownloader.c.a((Activity) this);
}
}
public static void a(Activity activity, long j) {
Intent intent = new Intent(activity, AppPrivacyPolicyActivity.class);
intent.putExtra("app_info_id", j);
activity.startActivity(intent);
}
private boolean a() {
this.c = getIntent().getLongExtra("app_info_id", 0L);
com.ss.android.downloadlib.addownload.model.b a = c.a().a(this.c);
if (a == null) {
return false;
}
this.f11749d = a.b;
String str = a.f11793i;
this.f11750e = str;
if (TextUtils.isEmpty(str)) {
this.f11750e = com.ss.android.downloadlib.addownload.j.i().optString("ad_privacy_backup_url", "https://sf6-ttcdn-tos.pstatp.com/obj/ad-tetris-site/personal-privacy-page.html");
return true;
}
return true;
}
private void a(WebView webView) {
try {
webView.removeJavascriptInterface("searchBoxJavaBridge_");
webView.removeJavascriptInterface("accessibility");
webView.removeJavascriptInterface("accessibilityTraversal");
} catch (Throwable unused) {
}
}
}