VPN Door v1.1.7版本的 MD5 值为:8e8516bf04a4da7fe0cd7c86f42cb910

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


package com.securesoft.vpndoor;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.app.Activity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import android.graphics.PorterDuff;
import android.net.ConnectivityManager;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.preference.PreferenceManager;
import android.provider.Settings;
import android.util.Base64;
import android.view.View;
import android.widget.ProgressBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import com.github.ybq.android.spinkit.style.ThreeBounce;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.LoadAdError;
import com.google.android.gms.ads.interstitial.InterstitialAd;
import com.google.android.gms.ads.interstitial.InterstitialAdLoadCallback;
import com.securesoft.vpndoor.Services.Strongswan;
import com.securesoft.vpndoor.pops.FailurePop;
import com.securesoft.vpndoor.pops.FirstPop;
import com.securesoft.vpndoor.pops.UpdatePop;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import org.json.JSONException;
import org.json.JSONObject;
import org.strongswan.android.logic.CharonVpnService;
public class Splash extends AppCompatActivity {
    static InterstitialAd mInterstitialAd;
    ProgressBar pb2;
    ProgressBar progressBar;
    static Boolean isRequest = false;
    static Boolean isLoaded = false;
    Boolean ws = false;
    Boolean timesUp = false;
    Boolean isRetry = false;
    Boolean isupdateShowing = false;
    Boolean caNotgotemp = true;
    Integer counter = 0;
    Integer internetCheckCounter = 0;
    private BroadcastReceiver VerifyApp = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            LocalBroadcastManager.getInstance(context).unregisterReceiver(Splash.this.VerifyApp);
            String stringExtra = intent.getStringExtra("isSuccess");
            if (stringExtra.equals("YES")) {
                String stringExtra2 = intent.getStringExtra("dataMain");
                try {
                    JSONObject jSONObject = new JSONObject(stringExtra2);
                    if (jSONObject.has("tktemp")) {
                        PreferenceManager.getDefaultSharedPreferences(context).edit().putString("tktemp", new JSONObject(stringExtra2).getString("tktemp").replace("\n", "")).apply();
                        return;
                    }
                    JSONObject jSONObject2 = jSONObject.getJSONObject("info");
                    Splash.this.ws = true;
                    String str = context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
                    String replace = jSONObject2.getString("block_version").replace(".", "");
                    String replace2 = str.replace(".", "");
                    if (Integer.parseInt(replace2) <= Integer.parseInt(replace)) {
                        Splash.this.showUpdatePop(jSONObject2.getString("title"), jSONObject2.getString("update_desc"), jSONObject2.getString("update_url"), true);
                        Splash.this.caNotgotemp = false;
                        return;
                    }
                    PreferenceManager.getDefaultSharedPreferences(Splash.this).edit().putString("admod", jSONObject2.getString("ads_mod")).apply();
                    PreferenceManager.getDefaultSharedPreferences(Splash.this).edit().putString("isVerified", "YES").apply();
                    PreferenceManager.getDefaultSharedPreferences(Splash.this).edit().putString("iplist", String.valueOf(jSONObject.getJSONArray("iplist"))).apply();
                    if (Integer.parseInt(replace2) >= Integer.parseInt(jSONObject2.getString("version").replace(".", "")) || !jSONObject2.getString("appstore_review").equals("0")) {
                        Splash.this.gotemp();
                        return;
                    }
                    Splash.this.showUpdatePop(jSONObject2.getString("title"), jSONObject2.getString("update_desc"), jSONObject2.getString("update_url"), false);
                    Splash.this.caNotgotemp = false;
                } catch (PackageManager.NameNotFoundException e) {
                    e.printStackTrace();
                } catch (JSONException e2) {
                    e2.printStackTrace();
                }
            } else if (stringExtra.equals("AccessFailed")) {
                PreferenceManager.getDefaultSharedPreferences(Splash.this).edit().putString("dataMain", "").apply();
                PreferenceManager.getDefaultSharedPreferences(Splash.this).edit().putString("isVerified", "").apply();
                Splash.this.caNotgotemp = false;
                final FailurePop failurePop = new FailurePop();
                failurePop.show("Welcome to VPN Door App", "Sorry , Our Servers are Updating . \n Please Try Again Later", Splash.this);
                FailurePop.submitBtn.setText("OK");
                FailurePop.submitBtn.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        FailurePop.hide();
                        Splash.this.finishAffinity();
                    }
                });
            } else if (!stringExtra.equals("TokenExpired")) {
                Splash.this.handleError();
            } else {
                Splash.this.caNotgotemp = false;
                PreferenceManager.getDefaultSharedPreferences(Splash.this).edit().putString("tktemp", "").apply();
                Splash.this.showFirstPop();
            }
        }
    };

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.activity_splash);
        if (Build.VERSION.SDK_INT >= 21) {
            getWindow().setStatusBarColor(getResources().getColor(R.color.color_background));
            getWindow().setNavigationBarColor(getResources().getColor(R.color.color_background2));
        }
        if (PreferenceManager.getDefaultSharedPreferences(this).getString("appurltemp", "").equals("")) {
            PreferenceManager.getDefaultSharedPreferences(this).edit().putString("appurltemp", "https://securesoft.pw/api.php").apply();
        }
        findViews();
        Rx8temp(StrognSwanHelper.long3(), "1", this, "0");
        starting();
    }

    public void showFirstPop() {
        PoolAppRes();
        if (isFinishing()) {
            return;
        }
        new FirstPop().show(this);
        new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
            @Override
            public void run() {
                FirstPop.hide();
                Splash.this.startHere();
            }
        }, 6000L);
    }

    public void starting() {
        if (checkInternet()) {
            if (PreferenceManager.getDefaultSharedPreferences(this).getString("tktemp", "").equals("")) {
                showFirstPop();
                return;
            } else {
                startHere();
                return;
            }
        }
        final FailurePop failurePop = new FailurePop();
        failurePop.show("Oops..", "Check Your Internet Connection and Try Again", this);
        FailurePop.submitBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                FailurePop.hide();
                if (Splash.this.internetCheckCounter.intValue() == 1) {
                    Splash splash = Splash.this;
                    splash.internetCheckCounter = Integer.valueOf(splash.internetCheckCounter.intValue() + 1);
                    Intent intent = new Intent(Splash.this, CharonVpnService.class);
                    intent.setAction(Strongswan.DISCONNECT);
                    Splash.this.startService(intent);
                } else {
                    Splash splash2 = Splash.this;
                    splash2.internetCheckCounter = Integer.valueOf(splash2.internetCheckCounter.intValue() + 1);
                }
                new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        Splash.this.starting();
                    }
                }, 700L);
            }
        });
    }

    @Override
    public void onResume() {
        super.onResume();
    }

    public void findViews() {
        if (Build.VERSION.SDK_INT >= 21) {
            getWindow().setStatusBarColor(getResources().getColor(R.color.color_background));
        }
        ProgressBar progressBar = (ProgressBar) findViewById(R.id.progressBar);
        this.progressBar = progressBar;
        progressBar.getProgressDrawable().setColorFilter(-1, PorterDuff.Mode.SRC_IN);
        this.progressBar.getProgressDrawable().setColorFilter(-1, PorterDuff.Mode.SRC_IN);
        this.pb2 = (ProgressBar) findViewById(R.id.pb2);
        this.pb2.setIndeterminateDrawable(new ThreeBounce());
        this.pb2.setVisibility(8);
    }

    private boolean checkInternet() {
        ConnectivityManager connectivityManager = (ConnectivityManager) getSystemService("connectivity");
        return connectivityManager.getActiveNetworkInfo() != null && connectivityManager.getActiveNetworkInfo().isConnected();
    }

    public void startHere() {
        this.caNotgotemp = true;
        PoolAppRes();
        ValueAnimator ofInt = ValueAnimator.ofInt(0, this.progressBar.getMax());
        ofInt.setDuration(5000L);
        ofInt.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
            @Override
            public void onAnimationUpdate(ValueAnimator valueAnimator) {
                Splash.this.progressBar.setProgress(((Integer) valueAnimator.getAnimatedValue()).intValue());
            }
        });
        ofInt.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animator) {
                super.onAnimationEnd(animator);
                Splash.this.timesUp = true;
                Splash.this.gotemp();
            }
        });
        ofInt.start();
    }

    private void startHere2() {
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Splash.this.isRetry = true;
                Splash.this.gotemp();
            }
        }, 5000L);
        this.pb2.setVisibility(0);
        PoolAppRes();
    }

    private void PoolAppRes() {
        HashMap hashMap = new HashMap();
        hashMap.put("method", "apishowapp/ApiAppTemp");
        String string = PreferenceManager.getDefaultSharedPreferences(this).getString("tktemp", "");
        if (string.equals("")) {
            hashMap.put("app_id", appIDCreation("1", string));
        } else {
            hashMap.put("app_id", appIDCreation("2", string));
        }
        LocalBroadcastManager.getInstance(this).unregisterReceiver(this.VerifyApp);
        LocalBroadcastManager.getInstance(this).registerReceiver(this.VerifyApp, new IntentFilter("apishowapp/APIAppTemp"));
        CallAPI.GetDataWithParam(hashMap, this, "apishowapp/APIAppTemp");
    }

    public void showUpdatePop(String str, String str2, final String str3, Boolean bool) {
        this.isupdateShowing = true;
        if (isFinishing()) {
            return;
        }
        final UpdatePop updatePop = new UpdatePop();
        updatePop.show(str, str2, this);
        if (bool.booleanValue()) {
            UpdatePop.update_pop_later_btn.setVisibility(8);
        } else {
            UpdatePop.update_pop_later_btn.setVisibility(0);
            UpdatePop.update_pop_later_btn.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    UpdatePop.hide();
                    Splash.this.caNotgotemp = true;
                    Splash.this.gotemp();
                }
            });
        }
        UpdatePop.submitBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Splash.this.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str3)));
            }
        });
    }

    public void handleError() {
        if (this.counter.intValue() >= 1) {
            gotemp();
            return;
        }
        this.counter = Integer.valueOf(this.counter.intValue() + 1);
        PoolAppRes();
    }

    public void gotemp() {
        if (this.caNotgotemp.booleanValue()) {
            if ((this.timesUp.booleanValue() && (this.ws.booleanValue() || this.counter.intValue() >= 1)) || this.isRetry.booleanValue()) {
                this.caNotgotemp = false;
                Intent intent = new Intent(this, MainActivity.class);
                intent.setFlags(268468224);
                startActivity(intent);
                finish();
            } else if ((!this.ws.booleanValue() || this.counter.intValue() < 1) && this.timesUp.booleanValue()) {
                startHere2();
            }
        }
    }

    public static boolean Rx8temp(String str, String str2, Activity activity, String str3) {
        String string = PreferenceManager.getDefaultSharedPreferences(activity).getString("admod", "");
        if (!string.equals("") && !string.equals("0")) {
            if (str3.equals("0")) {
                str3 = string;
            }
            if (string.equals(str3)) {
                if ((str2.equals("0") || str2.equals("1")) && !isRequest.booleanValue()) {
                    isRequest = true;
                    InterstitialAd.load(activity, str, new AdRequest.Builder().build(), new InterstitialAdLoadCallback() {
                        @Override
                        public void onAdLoaded(InterstitialAd interstitialAd) {
                            Splash.mInterstitialAd = interstitialAd;
                            Splash.isLoaded = true;
                        }

                        @Override
                        public void onAdFailedToLoad(LoadAdError loadAdError) {
                            Splash.isRequest = false;
                            Splash.mInterstitialAd = null;
                        }
                    });
                }
                if ((str2.equals("0") || str2.equals("2")) && isLoaded.booleanValue()) {
                    mInterstitialAd.show(activity);
                    isLoaded = false;
                    isRequest = false;
                    return true;
                }
            }
        }
        return false;
    }

    public String appIDCreation(String str, String str2) {
        String str3;
        String string = Settings.Secure.getString(getContentResolver(), "android_id");
        String encodeToString = Base64.encodeToString(getPackageName().getBytes(StandardCharsets.UTF_8), 0);
        if (str.equals("1")) {
            str3 = encodeToString + string + "&&17";
        } else {
            str3 = encodeToString + "TKTEMP$$" + str2 + "&&17";
        }
        return str3.replace("\n", "");
    }
}