OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

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


package com.excelliance.kxqp.helper;

import android.app.Application;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.util.Log;
import com.excelliance.kxqp.GameUtilBuild;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.medal.a.d;
import com.excelliance.kxqp.gs.util.ViewSwitcher;
import com.excelliance.kxqp.info.DataInfo;
import com.excelliance.kxqp.process.e;
import com.excelliance.kxqp.utils.CKService;

public class InitHelper {
    private static final String TAG = "InitHelper";
    private static int mDefBannerStyle = -1;
    private static boolean mPrivacyAgreed;
    private static boolean mPrivacySet;

    public static void init3rdSdk(Context context) {
        if (context instanceof Application) {
            new e((Application) context).d(context);
        } else {
            new e((Application) context.getApplicationContext()).d(context.getApplicationContext());
        }
    }

    public static void initSelf(final Context context) {
        tp.f(new Runnable() {
            @Override
            public void run() {
                com.excean.ab_builder.manager.a.a().a(context);
                ViewSwitcher.a(context).a(GameUtilBuild.getSwitchParams(context), "https://api.ourplay.com.cn/switch/marketcheck");
            }
        });
        mDefBannerStyle = context.getSharedPreferences("global_config", Build.VERSION.SDK_INT < 11 ? 0 : 4).getInt("defDisplayStyle", 62);
        Intent intent = new Intent("com.excelliance.kxqp.action.init");
        intent.setComponent(new ComponentName(context.getPackageName(), "com.excelliance.kxqp.SmtServService"));
        intent.putExtra("defDisplayStyle", mDefBannerStyle);
        context.startService(intent);
        try {
            Intent intent2 = new Intent("com.excelliance.kxqp.action.launcher");
            intent2.setComponent(new ComponentName(context.getPackageName(), "com.excelliance.kxqp.SmtServService"));
            context.startService(intent2);
        } catch (Exception unused) {
        }
        startServiceForCheckNewVersion(context);
    }

    public static boolean getPrivacyAgreed(Context context) {
        boolean z = true;
        if (context == null) {
            return true;
        }
        if (!mPrivacySet) {
            SharedPreferences sharedPreferences = d.a(context).getSharedPreferences("hello", 0);
            if (!sharedPreferences.getBoolean("nav", false) && !sharedPreferences.getBoolean("privacy_agreed", false)) {
                z = false;
            }
            mPrivacyAgreed = z;
        }
        return mPrivacyAgreed;
    }

    public static void putPrivacyAgreed(Context context, boolean z) {
        if (context == null) {
            return;
        }
        mPrivacySet = true;
        mPrivacyAgreed = z;
        context.getSharedPreferences("hello", 0).edit().putBoolean("privacy_agreed", z).apply();
        DataInfo.setAgreePrivacy(z);
    }

    private static void startServiceForCheckNewVersion(Context context) {
        try {
            Intent intent = new Intent(context, (Class<?>) CKService.class);
            intent.setAction(context.getPackageName() + ".action_check_new_version");
            context.startService(intent);
        } catch (Exception e) {
            Log.e(TAG, "startServiceForCheckNewVersion: " + e.getMessage());
        }
    }
}