星辰影院解锁vip v1.0.4版本的 MD5 值为:3d99bbcbb0d5d5e568b9f6134424c24e

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


package com.microsoft.codepush.react;

import android.content.Context;
import android.content.pm.PackageManager;
import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.uimanager.ViewManager;
import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONException;
import org.json.JSONObject;

public class a implements com.facebook.react.o {
    private static boolean a = false;

    private static boolean f8252b = false;

    private static boolean f8253c = false;

    private static String f8254d = null;

    private static String f8255e = "https://codepush.appcenter.ms/";

    private static String f8256f;

    private static o f8257g;

    private static a f8258h;

    private boolean f8259i;

    private String f8260j;

    private h f8261k;

    private f f8262l;
    private p m;
    private String n;
    private Context o;
    private final boolean p;

    public a(String str, Context context, boolean z) {
        this.f8259i = false;
        this.o = context.getApplicationContext();
        this.f8261k = new h(context.getFilesDir().getAbsolutePath());
        this.f8262l = new f(this.o);
        this.n = str;
        this.p = z;
        this.m = new p(this.o);
        if (f8254d == null) {
            try {
                f8254d = this.o.getPackageManager().getPackageInfo(this.o.getPackageName(), 0).versionName;
            } catch (PackageManager.NameNotFoundException e2) {
                throw new g("Unable to get package info for " + this.o.getPackageName(), e2);
            }
        }
        f8258h = this;
        String g2 = g("PublicKey");
        if (g2 != null) {
            f8256f = g2;
        }
        String g3 = g("ServerUrl");
        if (g3 != null) {
            f8255e = g3;
        }
        a(null);
        p();
    }

    private String g(String str) {
        String packageName = this.o.getPackageName();
        int identifier = this.o.getResources().getIdentifier("CodePush" + str, "string", packageName);
        if (identifier == 0) {
            return null;
        }
        String string = this.o.getString(identifier);
        if (!string.isEmpty()) {
            return string;
        }
        k.h("Specified " + str + " is empty");
        return null;
    }

    public static String i() {
        return j("index.android.bundle");
    }

    public static String j(String str) {
        a aVar = f8258h;
        if (aVar != null) {
            return aVar.k(str);
        }
        throw new e("A CodePush instance has not been created yet. Have you added it to your app's list of ReactPackages?");
    }

    public static com.facebook.react.k m() {
        o oVar = f8257g;
        if (oVar == null) {
            return null;
        }
        return oVar.a();
    }

    private boolean o(JSONObject jSONObject) {
        return !f8254d.equals(jSONObject.optString("appVersion", null));
    }

    private boolean s(com.facebook.react.k kVar) {
        com.facebook.react.devsupport.i.d w;
        if (kVar != null && (w = kVar.w()) != null) {
            com.facebook.react.devsupport.a aVar = (com.facebook.react.devsupport.a) w.m();
            for (Method method : aVar.getClass().getMethods()) {
                if (method.getName().equals("isReloadOnJSChangeEnabled")) {
                    try {
                        return ((Boolean) method.invoke(aVar, new Object[0])).booleanValue();
                    } catch (Exception unused) {
                        return false;
                    }
                }
            }
        }
        return false;
    }

    private boolean t(JSONObject jSONObject) {
        try {
            String optString = jSONObject.optString("binaryModifiedTime", null);
            Long valueOf = optString != null ? Long.valueOf(Long.parseLong(optString)) : null;
            String optString2 = jSONObject.optString("appVersion", null);
            long f2 = f();
            if (valueOf != null && valueOf.longValue() == f2) {
                if (!v()) {
                    if (f8254d.equals(optString2)) {
                    }
                }
                return true;
            }
            return false;
        } catch (NumberFormatException e2) {
            throw new g("Error in reading binary modified date from package metadata", e2);
        }
    }

    public static boolean v() {
        return f8253c;
    }

    private void x() {
        this.m.h(this.f8261k.e());
        this.f8261k.r();
        this.m.g();
    }

    public void a(com.facebook.react.k kVar) {
        if (this.p && this.m.e(null) && !s(kVar)) {
            File file = new File(this.o.getFilesDir(), "ReactNativeDevBundle.js");
            if (file.exists()) {
                file.delete();
            }
        }
    }

    public void b() {
        this.f8261k.a();
        this.m.g();
        this.m.f();
    }

    public boolean c() {
        return this.f8259i;
    }

    @Override
    public List<NativeModule> createNativeModules(ReactApplicationContext reactApplicationContext) {
        CodePushNativeModule codePushNativeModule = new CodePushNativeModule(reactApplicationContext, this, this.f8261k, this.f8262l, this.m);
        CodePushDialog codePushDialog = new CodePushDialog(reactApplicationContext);
        ArrayList arrayList = new ArrayList();
        arrayList.add(codePushNativeModule);
        arrayList.add(codePushDialog);
        return arrayList;
    }

    @Override
    public List<ViewManager> createViewManagers(ReactApplicationContext reactApplicationContext) {
        return new ArrayList();
    }

    public String d() {
        return f8254d;
    }

    public String e() {
        return this.f8260j;
    }

    public long f() {
        try {
            return Long.parseLong(this.o.getResources().getString(this.o.getResources().getIdentifier("CODE_PUSH_APK_BUILD_TIME", "string", this.o.getPackageName())).replaceAll("\"", ""));
        } catch (Exception e2) {
            throw new g("Error in getting binary resources modified time", e2);
        }
    }

    public String h() {
        return this.n;
    }

    public String k(String str) {
        String str2;
        this.f8260j = str;
        String str3 = "assets://" + str;
        try {
            str2 = this.f8261k.f(this.f8260j);
        } catch (d e2) {
            k.h(e2.getMessage());
            b();
            str2 = null;
        }
        if (str2 == null) {
            k.j(str3);
            a = true;
            return str3;
        }
        JSONObject e3 = this.f8261k.e();
        if (t(e3)) {
            k.j(str2);
            a = false;
            return str2;
        }
        this.f8259i = false;
        if (!this.p || o(e3)) {
            b();
        }
        k.j(str3);
        a = true;
        return str3;
    }

    public String l() {
        return f8256f;
    }

    public String n() {
        return f8255e;
    }

    public void p() {
        this.f8259i = false;
        JSONObject c2 = this.m.c();
        if (c2 != null) {
            JSONObject e2 = this.f8261k.e();
            if (e2 != null && (t(e2) || !o(e2))) {
                try {
                    if (c2.getBoolean("isLoading")) {
                        k.h("Update did not finish loading the last time, rolling back to a previous version.");
                        f8252b = true;
                        x();
                    } else {
                        this.f8259i = true;
                        this.m.i(c2.getString("hash"), true);
                    }
                    return;
                } catch (JSONException e3) {
                    throw new g("Unable to read pending update metadata stored in SharedPreferences", e3);
                }
            }
            k.h("Skipping initializeUpdateAfterRestart(), binary version is newer");
        }
    }

    public void q() {
        f8258h = null;
    }

    public boolean r() {
        return this.p;
    }

    public boolean u() {
        return a;
    }

    public boolean w() {
        return f8252b;
    }

    public void y(boolean z) {
        f8252b = z;
    }

    public a(String str, Context context, boolean z, String str2) {
        this(str, context, z);
        f8255e = str2;
    }
}