导航菜单

页面标题

页面副标题

泰剧兔 v1.5.7.0 - SplashActivity.java 源代码

正在查看: 泰剧兔 v1.5.7.0 应用的 SplashActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package app.video.guoguo;

import R.b;
import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.OnApplyWindowInsetsListener;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;
import app.video.guoguo.SplashActivity;
import com.windmill.meishu.R;
import f.a;
import f.e;
import io.flutter.FlutterInjector;
import java.lang.reflect.Field;
import org.json.JSONObject;

@SuppressLint({"CustomSplashScreen"})
public class SplashActivity extends AppCompatActivity {

    public TextView f321a;

    public ProgressBar f322b;

    public LinearLayout f323c;

    public EditText f324d;

    public Button f325e;

    public Button f326f;

    public static WindowInsetsCompat t(View view, WindowInsetsCompat windowInsetsCompat) {
        Insets insets = windowInsetsCompat.getInsets(WindowInsetsCompat.Type.systemBars());
        view.setPadding(insets.left, insets.top, insets.right, insets.bottom);
        return windowInsetsCompat;
    }

    public native void load(String str);

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        EdgeToEdge.enable(this);
        setContentView(2131427358);
        getWindow().setFlags(1024, 1024);
        getWindow().getDecorView().setSystemUiVisibility(4102);
        ViewCompat.setOnApplyWindowInsetsListener(findViewById(2131231826), new OnApplyWindowInsetsListener() {
            @Override
            public final WindowInsetsCompat onApplyWindowInsets(View view, WindowInsetsCompat windowInsetsCompat) {
                WindowInsetsCompat t;
                t = SplashActivity.t(view, windowInsetsCompat);
                return t;
            }
        });
        this.f321a = (TextView) findViewById(2131231129);
        this.f322b = (ProgressBar) findViewById(R.id.progressBar);
        this.f323c = (LinearLayout) findViewById(2131231821);
        this.f324d = (EditText) findViewById(2131231071);
        this.f325e = (Button) findViewById(2131230931);
        this.f326f = (Button) findViewById(2131230930);
        JSONObject jSONObject = new JSONObject();
        try {
            jSONObject.put("app_id", a.f2496a);
            jSONObject.put("client_appid", a.f2498c);
            jSONObject.put("app_name", q(this));
            jSONObject.put("code_version", a.f2497b);
            jSONObject.put("app_version", r(this));
            jSONObject.put("device_id", s());
            jSONObject.put("so_path", getApplicationInfo().nativeLibraryDir);
            jSONObject.put("file_path", getFilesDir().getAbsolutePath());
            load(jSONObject.toString());
        } catch (Exception e2) {
            Toast.makeText(this, "加载错误:" + e2, 1).show();
        }
    }

    public void onEnd(String str) {
        try {
            if (new JSONObject(str).has("libapp.so")) {
                FlutterInjector instance = FlutterInjector.instance();
                Field declaredField = FlutterInjector.class.getDeclaredField("flutterLoader");
                declaredField.setAccessible(true);
                declaredField.set(instance, e.d());
                System.out.println("FlutterInjector success");
            }
        } catch (Exception e2) {
            Log.e("Loader", e2.toString());
        }
        startActivity(new Intent(this, (Class<?>) MainActivity.class));
        overridePendingTransition(2130772028, 2130772029);
        finish();
    }

    public void onProgress(String str) {
        final String str2;
        try {
            JSONObject jSONObject = new JSONObject(str);
            int i = jSONObject.getInt("code");
            final String string = jSONObject.getString("message");
            if (i == 400403) {
                JSONObject jSONObject2 = jSONObject.getJSONObject("payload");
                if (jSONObject2.has("url")) {
                    str2 = jSONObject2.getString("url");
                    this.f325e.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public final void onClick(View view) {
                            SplashActivity.this.u(str2, view);
                        }
                    });
                    this.f326f.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public final void onClick(View view) {
                            SplashActivity.this.v(str2, view);
                        }
                    });
                } else {
                    str2 = null;
                }
                runOnUiThread(new Runnable() {
                    @Override
                    public final void run() {
                        SplashActivity.this.w(string, str2);
                    }
                });
                return;
            }
            if (i == 400404) {
                runOnUiThread(new Runnable() {
                    @Override
                    public final void run() {
                        SplashActivity.this.x(string);
                    }
                });
                new Handler(getMainLooper()).postDelayed(new Runnable() {
                    @Override
                    public final void run() {
                        SplashActivity.this.finishAffinity();
                    }
                }, 3000L);
                return;
            }
            JSONObject jSONObject3 = jSONObject.getJSONObject("payload");
            final String string2 = jSONObject3.getString("description");
            if (jSONObject3.has("now") && jSONObject3.has("total")) {
                int i2 = jSONObject3.getInt("now");
                int i3 = jSONObject3.getInt("total");
                if (i3 == -1) {
                    string2 = string2 + "(0%)";
                } else {
                    string2 = string2 + "(" + ((int) ((i2 / i3) * 100.0d)) + "%)";
                }
            }
            runOnUiThread(new Runnable() {
                @Override
                public final void run() {
                    SplashActivity.this.y(string2);
                }
            });
        } catch (Exception e2) {
            Log.e("Loader", e2.toString());
        }
    }

    public String q(Context context) {
        try {
            PackageManager packageManager = context.getPackageManager();
            return packageManager.getApplicationLabel(packageManager.getApplicationInfo(context.getPackageName(), 0)).toString();
        } catch (PackageManager.NameNotFoundException unused) {
            return null;
        }
    }

    public String r(Context context) {
        try {
            return context.getPackageManager().getPackageInfo(context.getPackageName(), 0).versionName;
        } catch (PackageManager.NameNotFoundException unused) {
            return null;
        }
    }

    public final String s() {
        String a2 = b.a(this);
        try {
            if (b.j(this)) {
                a2 = b.c();
            }
        } catch (Exception unused) {
            a2 = b.a(this);
        }
        if (a2 == null || a2.isEmpty()) {
            a2 = b.a(this);
        }
        return a2.replace("-", "");
    }

    public final void u(String str, View view) {
        Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(str));
        if (intent.resolveActivity(getPackageManager()) != null) {
            startActivity(intent);
        } else {
            Toast.makeText(this, "打开浏览器失败!", 1).show();
        }
    }

    public final void v(String str, View view) {
        ((ClipboardManager) getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("dl_url", str));
        Toast.makeText(this, "复制下载地址成功!", 0).show();
    }

    public final void w(String str, String str2) {
        this.f322b.setVisibility(8);
        this.f321a.setText(str);
        if (str2 != null) {
            this.f323c.setVisibility(0);
            this.f324d.setText(str2);
        }
    }

    public final void x(String str) {
        this.f322b.setVisibility(8);
        this.f321a.setText(str);
        Toast.makeText(this, str + " 三秒后退出...", 1).show();
    }

    public final void y(String str) {
        this.f321a.setText(str);
    }
}