正在查看: Cashalo v2.25.0.0 应用的 CustomTabActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Cashalo v2.25.0.0 应用的 CustomTabActivity.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package com.facebook;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
public class CustomTabActivity extends Activity {
public static final String CUSTOM_TAB_REDIRECT_ACTION = "CustomTabActivity.action_customTabRedirect";
private static final int CUSTOM_TAB_REDIRECT_REQUEST_CODE = 2;
public static final String DESTROY_ACTION = "CustomTabActivity.action_destroy";
private BroadcastReceiver closeReceiver;
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
Intent intent = new Intent(this, (Class<?>) CustomTabMainActivity.class);
intent.setAction(CUSTOM_TAB_REDIRECT_ACTION);
intent.putExtra(CustomTabMainActivity.EXTRA_URL, getIntent().getDataString());
intent.addFlags(603979776);
startActivityForResult(intent, 2);
}
@Override
protected void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
if (i2 == 0) {
Intent intent2 = new Intent(CUSTOM_TAB_REDIRECT_ACTION);
intent2.putExtra(CustomTabMainActivity.EXTRA_URL, getIntent().getDataString());
LocalBroadcastManager.getInstance(this).sendBroadcast(intent2);
this.closeReceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent3) {
CustomTabActivity.this.finish();
}
};
LocalBroadcastManager.getInstance(this).registerReceiver(this.closeReceiver, new IntentFilter(DESTROY_ACTION));
}
}
@Override
protected void onDestroy() {
LocalBroadcastManager.getInstance(this).unregisterReceiver(this.closeReceiver);
super.onDestroy();
}
}