13Poker by gametower unlimited gems v0.4版本的 MD5 值为:51324fc0f195c34821074948ab266846

以下内容为反编译后的 AppWallActivity.java 源代码,内容仅作参考


package com.startapp.android.publish;

import android.app.Activity;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.util.Base64;
import android.view.MotionEvent;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import com.adsdk.sdk.Const;
import com.startapp.android.publish.d.g;
import com.startapp.android.publish.d.k;
import java.io.UnsupportedEncodingException;
public class AppWallActivity extends Activity {
    private WebView b;
    private String d;
    private boolean[] f;
    private ProgressDialog c = null;
    private String e = null;
    boolean f155a = false;
    private boolean g = false;
    private a h = null;
    private BroadcastReceiver i = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            AppWallActivity.this.finish();
        }
    };

    public static class a extends BroadcastReceiver {
        private Activity f164a = null;

        public void a(Activity activity) {
            this.f164a = activity;
        }

        @Override
        public void onReceive(Context context, Intent intent) {
            g.a(2, "DismissActivityBroadcastReceiver::onReceive - action = [" + intent.getAction() + "]");
            if (this.f164a != null) {
                this.f164a.finish();
            }
        }
    }

    public class b extends WebViewClient {
        private b() {
        }

        @Override
        public boolean shouldOverrideUrlLoading(WebView webView, String str) {
            g.a(2, "MyWebViewClient::shouldOverrideUrlLoading - [" + str + "]");
            if (str.contains("index=")) {
                try {
                    String[] split = str.split("&");
                    if (AppWallActivity.this.f[Integer.parseInt(split[split.length - 1].split("=")[1])]) {
                        AppWallActivity.this.a(str);
                    } else {
                        AppWallActivity.this.b(str);
                    }
                } catch (Exception e) {
                    g.a(6, "StartAppWall.AppWallActivityError while trying parsing index from url");
                    return false;
                }
            } else if (AppWallActivity.this.f[0]) {
                AppWallActivity.this.a(str);
            } else {
                AppWallActivity.this.b(str);
            }
            return true;
        }
    }

    public void a(String str) {
        k.a(this, str, 5000, new Runnable() {
            @Override
            public void run() {
                if (AppWallActivity.this.b != null) {
                    AppWallActivity.this.b.destroy();
                }
                AppWallActivity.this.finish();
            }
        });
    }

    private void b() {
        Intent intent = getIntent();
        String[] stringArrayExtra = intent.getStringArrayExtra("tracking");
        if (stringArrayExtra != null) {
            for (int i = 0; i < stringArrayExtra.length; i++) {
                g.a(3, "StartAppWall.AppWallActivitySending Impression: [" + stringArrayExtra[i] + "]");
                k.b(this, stringArrayExtra[i]);
            }
        }
        this.f = intent.getBooleanArrayExtra("smartRedirect");
        if (this.f == null) {
            this.f = new boolean[1];
            this.f[0] = true;
        }
        if (intent.getBooleanExtra("offerWall", false)) {
            this.b = new WebView(this);
            this.b.getSettings().setJavaScriptEnabled(true);
            String stringExtra = intent.getStringExtra("html");
            this.b.addJavascriptInterface(new JsInterface(new Runnable() {
                @Override
                public void run() {
                    AppWallActivity.this.runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            AppWallActivity.this.finish();
                        }
                    });
                }
            }), "startappwall");
            try {
                this.b.loadData(Base64.encodeToString(stringExtra.getBytes(Const.ENCODING), 0), "text/html; charset=utf-8", "base64");
            } catch (UnsupportedEncodingException e) {
                g.a(6, "StartAppWall.AppWallActivityError converting HTML Page");
            }
        } else {
            this.b = new WebView(getApplicationContext());
            this.b.setBackgroundColor(-8947849);
            getWindow().getDecorView().findViewById(16908290).setBackgroundColor(-8947849);
            this.b.getSettings().setJavaScriptEnabled(true);
            this.b.setWebChromeClient(new WebChromeClient());
            this.b.setVerticalScrollBarEnabled(false);
            this.b.setHorizontalScrollBarEnabled(false);
            this.b.setOnTouchListener(new View.OnTouchListener() {
                @Override
                public boolean onTouch(View view, MotionEvent motionEvent) {
                    return motionEvent.getAction() == 2;
                }
            });
            this.b.addJavascriptInterface(new JsInterface(new Runnable() {
                @Override
                public void run() {
                    AppWallActivity.this.runOnUiThread(new Runnable() {
                        @Override
                        public void run() {
                            AppWallActivity.this.finish();
                        }
                    });
                }
            }), "startappwall");
            this.e = "file:///" + this.d + "/" + intent.getStringExtra("fileUrl");
            this.b.loadUrl(this.e);
        }
        this.b.setWebViewClient(new b());
        setContentView(this.b);
        this.h = null;
        if (this.g) {
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
                    if (AppWallActivity.this.h != null) {
                        try {
                            AppWallActivity.this.unregisterReceiver(AppWallActivity.this.h);
                        } catch (Exception e2) {
                            g.a(6, "AppWallActivity::onCreate::run - [" + e2.getClass() + "]");
                        }
                        AppWallActivity.this.h = null;
                    }
                    AppWallActivity.this.sendBroadcast(new Intent("com.startapp.android.publish.DISMISS_OVERLAY"));
                }
            }, 700L);
            this.h = new a();
            this.h.a(this);
            registerReceiver(this.h, new IntentFilter("com.startapp.android.publish.DISMISS_ACTIVITY"));
        }
    }

    public void b(String str) {
        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
        intent.addFlags(344457216);
        startActivity(intent);
        if (this.b != null) {
            this.b.destroy();
        }
        finish();
    }

    public void a() {
        int i = 8;
        int i2 = getResources().getConfiguration().orientation;
        int orientation = getWindowManager().getDefaultDisplay().getOrientation();
        int i3 = 9;
        if (Build.VERSION.SDK_INT <= 8) {
            i3 = 1;
            i = 0;
        }
        if (orientation == 0 || orientation == 1) {
            if (i2 == 1) {
                setRequestedOrientation(1);
            } else if (i2 == 2) {
                setRequestedOrientation(0);
            }
        } else if (orientation == 2 || orientation == 3) {
            if (i2 == 1) {
                setRequestedOrientation(i3);
            } else if (i2 == 2) {
                setRequestedOrientation(i);
            }
        }
    }

    @Override
    public void finish() {
        if (this.i != null) {
            unregisterReceiver(this.i);
        }
        super.finish();
    }

    @Override
    public void onConfigurationChanged(Configuration configuration) {
        g.a(2, "AppWallActivity::onConfigurationChanged orientation - [" + configuration.orientation + "]");
        super.onConfigurationChanged(configuration);
    }

    @Override
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        g.a(2, "AppWallActivity::onCreate");
        registerReceiver(this.i, new IntentFilter("com.startapp.android.CloseAdActivity"));
        this.g = getIntent().getBooleanExtra("overlay", false);
        if (this.g && d.f191a) {
            finish();
        }
        this.d = getFilesDir().getAbsolutePath();
        requestWindowFeature(1);
        a();
    }

    @Override
    protected void onDestroy() {
        g.a(2, "AppWallActivity::onDestroy");
        if (this.h != null) {
            try {
                unregisterReceiver(this.h);
            } catch (Exception e) {
                g.a(6, "AppWallActivity::onDestroy - [" + e.getClass() + "]");
            }
        }
        this.h = null;
        super.onDestroy();
    }

    @Override
    protected void onPause() {
        g.a(2, "AppWallActivity::onPause");
        super.onPause();
        sendBroadcast(new Intent("com.startapp.android.HideDisplayBroadcastListener"));
    }

    @Override
    protected void onRestart() {
        g.a(2, "AppWallActivity::onRestart");
        super.onRestart();
    }

    @Override
    protected void onResume() {
        g.a(2, "AppWallActivity::onResume");
        b();
        super.onResume();
    }
}