diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 649ed2d..77297ad 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -11,11 +11,15 @@ android { applicationId = "com.ea.games.nfs13_mod" minSdk = 27 targetSdk = 35 - versionCode = 1 - versionName = "1.0" + versionCode = 1003128 + versionName = "1.3.128" + + ndk.abiFilters.add("armeabi-v7a") + ndk.abiFilters.add("x86") testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } + ndkVersion = "21.0.6113669" buildTypes { release { @@ -46,5 +50,6 @@ dependencies { implementation("com.parse.bolts:bolts-tasks:1.4.0") implementation("org.apache.httpcomponents:httpclient-android:4.3.5.1") + implementation("com.google.code.gson:gson:2.7") //implementation("com.android.support:support-v4:28.0.0") } \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 003a08c..f63bf23 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -25,9 +25,8 @@ - + + - + android:resizeableActivity="false"> + + + + + + - diff --git a/app/src/main/java/com/ea/eadp/pushnotification/forwarding/GcmBroadcastReceiver.java b/app/src/main/java/com/ea/eadp/pushnotification/forwarding/GcmBroadcastReceiver.java deleted file mode 100644 index be68ab9..0000000 --- a/app/src/main/java/com/ea/eadp/pushnotification/forwarding/GcmBroadcastReceiver.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.ea.eadp.pushnotification.forwarding; - -import android.content.BroadcastReceiver; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; - -/* loaded from: classes.dex */ -public class GcmBroadcastReceiver extends BroadcastReceiver { - @Override // android.content.BroadcastReceiver - public final void onReceive(Context context, Intent intent) { - intent.setComponent(new ComponentName(context.getPackageName(), getIntentServiceName())); - GcmIntentService.enqueueWork(context, getIntentServiceName(), intent); - } - - protected String getIntentServiceName() { - return GcmIntentService.class.getName(); - } -} diff --git a/app/src/main/java/com/ea/eadp/pushnotification/forwarding/GcmIntentService.java b/app/src/main/java/com/ea/eadp/pushnotification/forwarding/GcmIntentService.java deleted file mode 100644 index ef9e33f..0000000 --- a/app/src/main/java/com/ea/eadp/pushnotification/forwarding/GcmIntentService.java +++ /dev/null @@ -1,210 +0,0 @@ -package com.ea.eadp.pushnotification.forwarding; - -import android.annotation.SuppressLint; -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.pm.ActivityInfo; -import android.content.pm.ApplicationInfo; -import android.content.pm.PackageManager; -import android.content.pm.ResolveInfo; -import android.content.res.Resources; -import android.os.Build; -import android.os.Bundle; -import android.support.annotation.NonNull; -import android.support.v4.app.JobIntentService; -import android.support.v4.app.NotificationCompat; -import com.ea.eadp.http.services.HttpService; -import com.ea.eadp.pushnotification.lifecycles.PushLifecycleCallbacks; -import com.ea.eadp.pushnotification.services.AndroidPushService; -import com.ea.eadp.pushnotification.services.IPushService; -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.Global; -import com.ea.nimble.Log; -import com.facebook.internal.NativeProtocol; -import com.google.android.gms.gcm.GoogleCloudMessaging; -import java.util.List; - -/* loaded from: classes.dex */ -public class GcmIntentService extends JobIntentService { - protected static final int JOB_ID = 5566; - private static final String LOG_TAG = "GcmIntentService"; - private IPushService pushManager; - - public interface EnsEventFlags { - public static final int ALL_DISABLED = 0; - public static final int ALL_ENABLED = 3; - public static final int CLICK_ENABLED = 1; - public static final int RECEIVED_ENABLED = 2; - } - - public interface PushIntentExtraKeys { - public static final String ALERT = "alert"; - public static final String COLLAPSE_KEY = "collapse_key"; - public static final String DEEP_LINK_URL = "deepLinkUrl"; - public static final String ENS_EVENTS = "ensEvents"; - public static final String PN_TYPE = "pnType"; - public static final String PUSH_ID = "pushId"; - } - - protected boolean displayNotification(Bundle bundle) { - return true; - } - - protected HttpService getHttpService() { - return null; - } - - public static void enqueueWork(Context context, String str, Intent intent) { - try { - enqueueWork(context, Class.forName(str), JOB_ID, intent); - } catch (ClassNotFoundException e) { - e.printStackTrace(); - } - } - - @Override // android.support.v4.app.JobIntentService - protected void onHandleWork(@NonNull Intent intent) { - Bundle extras = intent.getExtras(); - if (extras == null) { - Log.Helper.LOGE(this, "Skipping Push Notification: Incomplete Intent. Missing expected extras bundle.", new Object[0]); - return; - } - String messageType = GoogleCloudMessaging.getInstance(getApplicationContext()).getMessageType(intent); - if (extras.isEmpty()) { - return; - } - if (GoogleCloudMessaging.MESSAGE_TYPE_SEND_ERROR.equals(messageType)) { - Log.Helper.LOGIS(LOG_TAG, "Error received: " + extras.toString(), new Object[0]); - return; - } - if ("deleted_messages".equals(messageType)) { - Log.Helper.LOGIS(LOG_TAG, "Deleted messages on server: " + extras.toString(), new Object[0]); - return; - } - if (GoogleCloudMessaging.MESSAGE_TYPE_MESSAGE.equals(messageType)) { - onHandleMessage(intent); - } - } - - protected void onHandleMessage(Intent intent) { - Bundle extras = intent.getExtras(); - if (extras == null) { - Log.Helper.LOGE(this, "Skipping Push Notification: Incomplete Intent. Missing expected extras bundle.", new Object[0]); - return; - } - Log.Helper.LOGIS(LOG_TAG, "Message received: " + extras.toString(), new Object[0]); - if (displayNotification(extras)) { - postNotification(getApplicationContext(), extras); - } - int i = 3; - String string = extras.getString(PushIntentExtraKeys.ENS_EVENTS); - if (string != null) { - try { - i = Integer.parseInt(string); - } catch (NumberFormatException unused) { - Log.Helper.LOGWS(LOG_TAG, "ensEvents flag found but not parseable as integer", new Object[0]); - } - } - if (extras.containsKey(PushIntentExtraKeys.PUSH_ID)) { - if (i >= 2 || i < 0) { - if (this.pushManager == null) { - this.pushManager = new AndroidPushService(getApplicationContext(), getHttpService()); - } - if (ApplicationEnvironment.isMainApplicationRunning()) { - this.pushManager.sendTrackingEvent(extras.getString(PushIntentExtraKeys.PUSH_ID), extras.getString(PushIntentExtraKeys.PN_TYPE), IPushService.NOTIFICATION_TYPE_RECEIVED); - } else { - this.pushManager.persistTrackingEvent(extras.getString(PushIntentExtraKeys.PUSH_ID), extras.getString(PushIntentExtraKeys.PN_TYPE), IPushService.NOTIFICATION_TYPE_RECEIVED); - } - } - } - } - - @SuppressLint({"InlinedApi"}) - private void postNotification(Context context, Bundle bundle) { - Intent intent = new Intent(); - if (Build.VERSION.SDK_INT >= 12) { - intent.addFlags(32); - } - intent.putExtras(bundle); - intent.setPackage(context.getPackageName()); - ComponentName broadcastForwarderComponent = getBroadcastForwarderComponent(); - if (isInForeground()) { - if (broadcastForwarderComponent != null) { - intent.setComponent(broadcastForwarderComponent); - sendBroadcast(intent); - return; - } else { - Log.Helper.LOGW(this, "Broadcast listener for action 'com.ea.eadp.pushnotification.FORWARD_AS_ORDERED_BROADCAST' was not found. Not sending broadcast", new Object[0]); - return; - } - } - String string = bundle.getString(PushIntentExtraKeys.PUSH_ID); - int hashCode = string != null ? string.hashCode() : 0; - String str = Global.NOTIFICATION_CHANNEL_DEFAULT_ID; - try { - ApplicationInfo applicationInfo = context.getPackageManager().getApplicationInfo(context.getPackageName(), 128); - if (applicationInfo.metaData.containsKey(Global.NOTIFICATION_CHANNEL_PUSHTNG_ID_KEY)) { - str = applicationInfo.metaData.getString(Global.NOTIFICATION_CHANNEL_PUSHTNG_ID_KEY); - } - } catch (PackageManager.NameNotFoundException e) { - android.util.Log.e(Global.NIMBLE_ID, String.format("%s>GcmIntentService.postNotification():\n%s", LOG_TAG, e.getMessage())); - } - NotificationCompat.Builder builder = new NotificationCompat.Builder(context, str); - if (broadcastForwarderComponent != null) { - String string2 = bundle.getString(PushIntentExtraKeys.COLLAPSE_KEY); - if (string2 != null && !string2.equalsIgnoreCase("do_not_collapse")) { - intent.putExtra(PushIntentExtraKeys.COLLAPSE_KEY, string2); - } - intent.setComponent(broadcastForwarderComponent); - builder.setContentIntent(PendingIntent.getBroadcast(context, hashCode, intent, 134217728)); - } else { - Log.Helper.LOGW(this, "Broadcast listener for action 'com.ea.eadp.pushnotification.FORWARD_AS_ORDERED_BROADCAST' was not found. Not setting ContentIntent", new Object[0]); - } - customizeNotification(builder, bundle); - NotificationManager notificationManager = (NotificationManager) context.getSystemService("notification"); - if (notificationManager != null) { - String string3 = bundle.getString(PushIntentExtraKeys.COLLAPSE_KEY); - if (string3 != null && !string3.equalsIgnoreCase("do_not_collapse")) { - notificationManager.notify(string3, 0, builder.build()); - return; - } else { - notificationManager.notify(hashCode, builder.build()); - return; - } - } - Log.Helper.LOGE(this, "Notification Manager is not available or is inaccessible. Skipping Notification formatting.", new Object[0]); - } - - protected boolean isInForeground() { - return PushLifecycleCallbacks.inForeground; - } - - protected void customizeNotification(NotificationCompat.Builder builder, Bundle bundle) { - String string = bundle.getString(PushIntentExtraKeys.ALERT); - Resources resources = getApplicationContext().getResources(); - String packageName = getApplicationContext().getPackageName(); - String string2 = getApplicationContext().getResources().getString(resources.getIdentifier(NativeProtocol.BRIDGE_ARG_APP_NAME_STRING, "string", packageName)); - try { - builder.setSmallIcon(resources.getIdentifier("pn_icon", "drawable", packageName)); - } catch (Exception e) { - Log.Helper.LOGE(LOG_TAG, "PN NOT DISPLAYED: Unable to set application icon due to exception: " + e.toString(), new Object[0]); - } - builder.setContentTitle(string2).setStyle(new NotificationCompat.BigTextStyle().bigText(string)).setContentText(string).setAutoCancel(true).setDefaults(getApplicationContext().checkCallingOrSelfPermission("android.permission.VIBRATE") == 0 ? 7 : 5); - } - - protected ComponentName getBroadcastForwarderComponent() { - Log.Helper.LOGFUNC(this); - PackageManager packageManager = getApplicationContext().getPackageManager(); - Intent intent = new Intent("com.ea.eadp.pushnotification.FORWARD_AS_ORDERED_BROADCAST"); - intent.setPackage(getApplicationContext().getPackageName()); - List queryBroadcastReceivers = packageManager.queryBroadcastReceivers(intent, 0); - if (queryBroadcastReceivers.isEmpty()) { - return null; - } - ActivityInfo activityInfo = queryBroadcastReceivers.get(0).activityInfo; - return new ComponentName(activityInfo.packageName, activityInfo.name); - } -} diff --git a/app/src/main/java/com/ea/eadp/pushnotification/forwarding/PushBroadcastForwarder.java b/app/src/main/java/com/ea/eadp/pushnotification/forwarding/PushBroadcastForwarder.java deleted file mode 100644 index 6f22754..0000000 --- a/app/src/main/java/com/ea/eadp/pushnotification/forwarding/PushBroadcastForwarder.java +++ /dev/null @@ -1,139 +0,0 @@ -package com.ea.eadp.pushnotification.forwarding; - -import android.app.PendingIntent; -import android.content.BroadcastReceiver; -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.net.Uri; -import android.os.Bundle; -import com.ea.eadp.http.services.HttpService; -import com.ea.eadp.pushnotification.forwarding.GcmIntentService; -import com.ea.eadp.pushnotification.services.IPushService; -import com.ea.nimble.Log; - -/* loaded from: classes.dex */ -public class PushBroadcastForwarder extends BroadcastReceiver { - private static final String LOG_TAG = "PushBroadcastForwarder"; - private IPushService pushManager; - - protected HttpService getHttpService() { - return null; - } - - /* JADX WARN: Removed duplicated region for block: B:17:0x003a */ - /* JADX WARN: Removed duplicated region for block: B:20:0x004f */ - /* JADX WARN: Removed duplicated region for block: B:21:0x0063 */ - @Override // android.content.BroadcastReceiver - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public final void onReceive(android.content.Context r5, android.content.Intent r6) { - /* - r4 = this; - android.os.Bundle r6 = r6.getExtras() - r0 = 0 - if (r6 != 0) goto Lf - java.lang.String r5 = "Unable to get extras from Intent" - java.lang.Object[] r6 = new java.lang.Object[r0] - com.ea.nimble.Log.Helper.LOGE(r4, r5, r6) - return - Lf: - java.lang.String r1 = "ensEvents" - java.lang.String r1 = r6.getString(r1) - r2 = 3 - if (r1 == 0) goto L26 - int r1 = java.lang.Integer.parseInt(r1) // Catch: java.lang.NumberFormatException -> L1d - goto L27 - L1d: - java.lang.String r1 = "PushBroadcastForwarder" - java.lang.String r3 = "ensEvents flag found but not parseable as integer" - java.lang.Object[] r0 = new java.lang.Object[r0] - com.ea.nimble.Log.Helper.LOGWS(r1, r3, r0) - L26: - r1 = 3 - L27: - java.lang.String r0 = "pushId" - boolean r0 = r6.containsKey(r0) - if (r0 == 0) goto L76 - if (r1 >= r2) goto L36 - r0 = 1 - if (r1 == r0) goto L36 - if (r1 >= 0) goto L76 - L36: - com.ea.eadp.pushnotification.services.IPushService r0 = r4.pushManager - if (r0 != 0) goto L49 - com.ea.eadp.pushnotification.services.AndroidPushService r0 = new com.ea.eadp.pushnotification.services.AndroidPushService - android.content.Context r1 = r5.getApplicationContext() - com.ea.eadp.http.services.HttpService r2 = r4.getHttpService() - r0.(r1, r2) - r4.pushManager = r0 - L49: - boolean r0 = com.ea.nimble.ApplicationEnvironment.isMainApplicationRunning() - if (r0 == 0) goto L63 - com.ea.eadp.pushnotification.services.IPushService r0 = r4.pushManager - java.lang.String r1 = "pushId" - java.lang.String r1 = r6.getString(r1) - java.lang.String r2 = "pnType" - java.lang.String r2 = r6.getString(r2) - java.lang.String r3 = "NOTIFICATION_OPENED" - r0.sendTrackingEvent(r1, r2, r3) - goto L76 - L63: - com.ea.eadp.pushnotification.services.IPushService r0 = r4.pushManager - java.lang.String r1 = "pushId" - java.lang.String r1 = r6.getString(r1) - java.lang.String r2 = "pnType" - java.lang.String r2 = r6.getString(r2) - java.lang.String r3 = "NOTIFICATION_OPENED" - r0.persistTrackingEvent(r1, r2, r3) - L76: - r4.handleNewPushNotification(r5, r6) - return - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder.onReceive(android.content.Context, android.content.Intent):void"); - } - - protected void handleNewPushNotification(Context context, Bundle bundle) { - Intent intent; - String string = bundle.getString(GcmIntentService.PushIntentExtraKeys.DEEP_LINK_URL); - if (string != null) { - intent = new Intent("android.intent.action.VIEW", Uri.parse(string)); - Log.Helper.LOGIS(LOG_TAG, "Push notification clicked with URL: " + string, new Object[0]); - } else { - String pushTargetActivity = getPushTargetActivity(context); - Log.Helper.LOGIS(LOG_TAG, "Push notification clicked with target activity: " + pushTargetActivity, new Object[0]); - try { - intent = new Intent(context, Class.forName(pushTargetActivity)); - } catch (ClassNotFoundException e) { - Log.Helper.LOGES(LOG_TAG, String.format("Could not launch target activity: %s, exception: %s", pushTargetActivity, e.toString()), new Object[0]); - return; - } - } - intent.putExtras(bundle); - intent.setFlags(603979776); - PendingIntent activity = PendingIntent.getActivity(context, 0, intent, 1073741824); - if (activity == null) { - Log.Helper.LOGE(LOG_TAG, "Unable to create PendingIntent", new Object[0]); - } - try { - activity.send(); - } catch (PendingIntent.CanceledException e2) { - Log.Helper.LOGE(LOG_TAG, String.format("Could not launch PendingIntent for PN %s", e2.toString()), new Object[0]); - } - } - - protected String getPushTargetActivity(Context context) { - Intent launchIntentForPackage; - ComponentName resolveActivity; - Context applicationContext = context.getApplicationContext(); - PackageManager packageManager = applicationContext.getPackageManager(); - if (packageManager != null && (launchIntentForPackage = packageManager.getLaunchIntentForPackage(applicationContext.getPackageName())) != null && (resolveActivity = launchIntentForPackage.resolveActivity(applicationContext.getPackageManager())) != null) { - return resolveActivity.getClassName(); - } - Log.Helper.LOGE(this, "PackageManager service is unable or is inaccessible. Unable to get PushTargetActivity.", new Object[0]); - return ""; - } -} diff --git a/app/src/main/java/com/ea/eadp/pushnotification/lifecycles/PushLifecycleCallbacks.java b/app/src/main/java/com/ea/eadp/pushnotification/lifecycles/PushLifecycleCallbacks.java deleted file mode 100644 index d5742c0..0000000 --- a/app/src/main/java/com/ea/eadp/pushnotification/lifecycles/PushLifecycleCallbacks.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.ea.eadp.pushnotification.lifecycles; - -import android.annotation.TargetApi; -import android.app.Activity; -import android.app.Application; -import android.os.Bundle; - -@TargetApi(14) -/* loaded from: classes.dex */ -public class PushLifecycleCallbacks implements Application.ActivityLifecycleCallbacks { - public static final int LIFECYCLE_API_VERSION = 14; - public static boolean inForeground; - - @Override // android.app.Application.ActivityLifecycleCallbacks - public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { - } - - @Override // android.app.Application.ActivityLifecycleCallbacks - public void onActivityCreated(Activity activity, Bundle bundle) { - inForeground = true; - } - - @Override // android.app.Application.ActivityLifecycleCallbacks - public void onActivityStarted(Activity activity) { - inForeground = true; - } - - @Override // android.app.Application.ActivityLifecycleCallbacks - public void onActivityResumed(Activity activity) { - inForeground = true; - } - - @Override // android.app.Application.ActivityLifecycleCallbacks - public void onActivityPaused(Activity activity) { - inForeground = false; - } - - @Override // android.app.Application.ActivityLifecycleCallbacks - public void onActivityStopped(Activity activity) { - inForeground = false; - } - - @Override // android.app.Application.ActivityLifecycleCallbacks - public void onActivityDestroyed(Activity activity) { - inForeground = false; - } -} diff --git a/app/src/main/java/com/ea/eadp/pushnotification/models/PushNotificationConfig.java b/app/src/main/java/com/ea/eadp/pushnotification/models/PushNotificationConfig.java deleted file mode 100644 index 9b72d74..0000000 --- a/app/src/main/java/com/ea/eadp/pushnotification/models/PushNotificationConfig.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.ea.eadp.pushnotification.models; - -import android.os.Build; -import java.util.Locale; -import java.util.TimeZone; - -/* loaded from: classes.dex */ -public class PushNotificationConfig { - private String appId; - private String appVersion; - private String country; - private String dateOfBirth; - private String deviceIdentifier; - private boolean disabled; - private String disabledReason; - private String registrationIdentifier; - private Integer silentIntervalEnd; - private Integer silentIntervalStart; - private String userAlias; - private String manufacturer = Build.MANUFACTURER; - private String operatingSystem = Build.VERSION.RELEASE; - private String model = Build.MODEL; - private String deviceType = "android"; - private String locale = Locale.getDefault().toString(); - private TimeZone timezone = TimeZone.getDefault(); - - public String getUserAlias() { - return this.userAlias; - } - - public void setUserAlias(String str) { - this.userAlias = str; - } - - public String getDeviceType() { - return this.deviceType; - } - - public void setDeviceType(String str) { - this.deviceType = str; - } - - public String getOperatingSystem() { - return this.operatingSystem; - } - - public void setOperatingSystem(String str) { - this.operatingSystem = str; - } - - public String getManufacturer() { - return this.manufacturer; - } - - public void setManufacturer(String str) { - this.manufacturer = str; - } - - public String getRegistrationIdentifier() { - return this.registrationIdentifier; - } - - public void setRegistrationIdentifier(String str) { - this.registrationIdentifier = str; - } - - public String getDeviceIdentifier() { - return this.deviceIdentifier; - } - - public void setDeviceIdentifier(String str) { - this.deviceIdentifier = str; - } - - public String getModel() { - return this.model; - } - - public void setModel(String str) { - this.model = str; - } - - public String getAppId() { - return this.appId; - } - - public void setAppId(String str) { - this.appId = str; - } - - public String getAppVersion() { - return this.appVersion; - } - - public void setAppVersion(String str) { - this.appVersion = str; - } - - public String getCountry() { - return this.country; - } - - public void setCountry(String str) { - this.country = str; - } - - public String getLocale() { - return this.locale; - } - - public void setLocale(String str) { - this.locale = str; - } - - public TimeZone getTimezone() { - return this.timezone; - } - - public void setTimezone(TimeZone timeZone) { - this.timezone = timeZone; - } - - public Integer getSilentIntervalStart() { - return this.silentIntervalStart; - } - - public void setSilentIntervalStart(Integer num) { - this.silentIntervalStart = num; - } - - public Integer getSilentIntervalEnd() { - return this.silentIntervalEnd; - } - - public void setSilentIntervalEnd(Integer num) { - this.silentIntervalEnd = num; - } - - public String getDateOfBirth() { - return this.dateOfBirth; - } - - public void setDateOfBirth(String str) { - this.dateOfBirth = str; - } - - public String getDisabledReason() { - return this.disabledReason; - } - - public void setDisabledReason(String str) { - this.disabledReason = str; - } - - public boolean isDisabled() { - return this.disabled; - } - - public void setDisabled(boolean z) { - this.disabled = z; - } -} diff --git a/app/src/main/java/com/ea/eadp/pushnotification/services/AndroidPushService.java b/app/src/main/java/com/ea/eadp/pushnotification/services/AndroidPushService.java deleted file mode 100644 index abaf1a2..0000000 --- a/app/src/main/java/com/ea/eadp/pushnotification/services/AndroidPushService.java +++ /dev/null @@ -1,414 +0,0 @@ -package com.ea.eadp.pushnotification.services; - -import android.annotation.TargetApi; -import android.app.Application; -import android.content.Context; -import android.content.SharedPreferences; -import android.os.Build; -import android.util.Base64; -import com.ea.eadp.deviceid.DeviceIdService; -import com.ea.eadp.http.models.HttpRequest; -import com.ea.eadp.http.models.HttpRequestListener; -import com.ea.eadp.http.models.HttpResponse; -import com.ea.eadp.http.services.HttpService; -import com.ea.eadp.pushnotification.forwarding.GcmIntentService; -import com.ea.eadp.pushnotification.lifecycles.PushLifecycleCallbacks; -import com.ea.eadp.pushnotification.listeners.IPushListener; -import com.ea.eadp.pushnotification.models.PushNotificationConfig; -import com.ea.nimble.Log; -import com.ea.nimble.pushtng.PushNotification; -import com.google.android.gms.common.GoogleApiAvailability; -import com.google.android.gms.gcm.GoogleCloudMessaging; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; -import com.google.gson.JsonElement; -import com.google.gson.JsonPrimitive; -import com.google.gson.JsonSerializationContext; -import com.google.gson.JsonSerializer; -import java.lang.reflect.Type; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TimeZone; -import java.util.Timer; -import java.util.TimerTask; -import org.apache.http.protocol.HTTP; - -/* loaded from: classes.dex */ -public final class AndroidPushService implements IPushService { - private static final String API_KEY_KEY = "apiKey"; - private static final String API_SECRET_KEY = "apiSecret"; - public static final String AUTHORIZATION = "Authorization"; - private static final String DEVICE_ID_KEY = "deviceId"; - private static final String EVENT_LIST_KEY = "eventListKey"; - private static final String GAME_ID_KEY = "gameId"; - private static final String LOG_TAG = "PushManager"; - private static final String PUSH_SERVER_URL_KEY = "pushNotificationServerUrl"; - private static final String SHARED_PREFS_FILENAME = "PushManagerConfigurationData"; - private static final String TRACKING_PREFS_FILENAME = "PushManagerTrackingData"; - private static final String TRACKING_STATE_KEY = "state"; - private String apiKey; - private String apiSecret; - private String appId; - private Context context; - private DeviceIdService deviceIdService; - private String gameId; - private GoogleCloudMessaging googleCloudMessaging; - private HttpService httpService; - private long inAppNotificationInterval; - private Timer inAppTimer; - private IPushListener pushListener; - private String pushNotificationServerUrl; - private String senderId; - private String startClientToken; - private PushNotificationConfig startConfig; - - public AndroidPushService(GoogleCloudMessaging googleCloudMessaging, HttpService httpService, DeviceIdService deviceIdService, Context context, IPushListener iPushListener, String str, String str2, String str3, String str4, String str5, String str6, int i) { - Log.Helper.LOGIS(LOG_TAG, "Instantiating new push mgr", new Object[0]); - this.googleCloudMessaging = googleCloudMessaging; - this.httpService = httpService; - this.deviceIdService = deviceIdService; - this.context = context; - this.pushListener = iPushListener; - this.senderId = str; - this.pushNotificationServerUrl = str2; - this.gameId = str3; - this.appId = str4; - this.apiKey = str5; - this.apiSecret = str6; - this.inAppNotificationInterval = i * 1000; - } - - public AndroidPushService(Context context, HttpService httpService) { - this.context = context; - this.httpService = httpService; - this.pushNotificationServerUrl = loadConfigData(PUSH_SERVER_URL_KEY); - this.gameId = loadConfigData(GAME_ID_KEY); - this.apiKey = loadConfigData(API_KEY_KEY); - this.apiSecret = loadConfigData(API_SECRET_KEY); - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - public IPushListener getPushListener() { - return this.pushListener; - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - public void setPushListener(IPushListener iPushListener) { - this.pushListener = iPushListener; - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - @TargetApi(14) - public void startWithConfig(final PushNotificationConfig pushNotificationConfig, final String str) { - if (pushNotificationConfig == null) { - Log.Helper.LOGES(LOG_TAG, "Error: Config data is null.", new Object[0]); - if (this.pushListener != null) { - this.pushListener.onConnectionError(0, "Config data is null"); - return; - } - return; - } - if (this.inAppNotificationInterval > 0) { - this.inAppTimer = new Timer(); - this.inAppTimer.schedule(new TimerTask() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.1 - @Override // java.util.TimerTask, java.lang.Runnable - public void run() { - AndroidPushService.this.getInAppNotifications(pushNotificationConfig.getUserAlias(), str); - } - }, this.inAppNotificationInterval, this.inAppNotificationInterval); - } - if (pushNotificationConfig.isDisabled()) { - registerDevice(pushNotificationConfig); - } else { - new Thread(new Runnable() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.2 - @Override // java.lang.Runnable - public void run() { - if (AndroidPushService.this.checkPlayServices()) { - Log.Helper.LOGIS(AndroidPushService.LOG_TAG, "Attempt to register device with GCM", new Object[0]); - try { - String register = AndroidPushService.this.googleCloudMessaging.register(AndroidPushService.this.senderId); - pushNotificationConfig.setRegistrationIdentifier(register); - pushNotificationConfig.setDisabled(false); - pushNotificationConfig.setDisabledReason(null); - Log.Helper.LOGIS(AndroidPushService.LOG_TAG, String.format("Device registered on GCM. Registration id: %s", register), new Object[0]); - try { - if (Build.VERSION.SDK_INT >= 14) { - ((Application) AndroidPushService.this.context.getApplicationContext()).registerActivityLifecycleCallbacks(new PushLifecycleCallbacks()); - } - } catch (Exception e) { - Log.Helper.LOGES(AndroidPushService.LOG_TAG, "Failed to register activity lifecycle callbacks: %s", e.getLocalizedMessage()); - } - } catch (Exception e2) { - Log.Helper.LOGES(AndroidPushService.LOG_TAG, "Failed to get registration ID from GCM: %s", e2.getLocalizedMessage()); - pushNotificationConfig.setDisabled(true); - pushNotificationConfig.setDisabledReason(PushNotification.DISABLED_REASON_REGISTER_FAILURE); - } - } else { - Log.Helper.LOGES(AndroidPushService.LOG_TAG, "Failed to find appropriate Google Play Service SDK on device. Registering as disabled", new Object[0]); - pushNotificationConfig.setDisabled(true); - pushNotificationConfig.setDisabledReason(PushNotification.DISABLED_REASON_REGISTER_FAILURE); - } - AndroidPushService.this.registerDevice(pushNotificationConfig); - } - }, "startWithConfig thread").start(); - } - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - public void registerDevice(final PushNotificationConfig pushNotificationConfig) { - if (pushNotificationConfig == null) { - Log.Helper.LOGES(LOG_TAG, "Error: Config data is null.", new Object[0]); - if (this.pushListener != null) { - this.pushListener.onConnectionError(0, "Config data is null"); - return; - } - return; - } - if (pushNotificationConfig.getDeviceIdentifier() == null) { - pushNotificationConfig.setDeviceIdentifier(this.deviceIdService.getDeviceId()); - } - Log.Helper.LOGIS(LOG_TAG, "Attempt to register device with EADP push notification service", new Object[0]); - try { - try { - HttpRequest resource = this.httpService.getResource(String.format("%s/games/%s/devices", this.pushNotificationServerUrl, this.gameId)); - resource.setHeader("Authorization", createAuthorizationHeader()); - pushNotificationConfig.setAppId(this.appId); - GsonBuilder gsonBuilder = new GsonBuilder(); - gsonBuilder.registerTypeAdapter(TimeZone.class, new TimeZoneSerializer()); - resource.setJsonBody(gsonBuilder.create().toJson(pushNotificationConfig)); - resource.postAsync(new HttpRequestListener() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.3 - @Override // com.ea.eadp.http.models.HttpRequestListener - public void onComplete(HttpResponse httpResponse) { - int code = httpResponse.getCode(); - String body = httpResponse.getBody(); - if (code >= 200 && code < 300) { - Log.Helper.LOGIS(AndroidPushService.LOG_TAG, "Registration request successful!", new Object[0]); - Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", body), new Object[0]); - Log.Helper.LOGIS(AndroidPushService.LOG_TAG, String.format("Device registration with server complete. Registered id: %s", pushNotificationConfig.getRegistrationIdentifier()), new Object[0]); - if (AndroidPushService.this.pushListener != null) { - AndroidPushService.this.pushListener.onRegistrationSuccess(code, body); - return; - } - return; - } - String format = String.format("Registration request failed! Status: %s, Message: %s", Integer.valueOf(code), httpResponse.getMessage()); - Log.Helper.LOGES(AndroidPushService.LOG_TAG, format, new Object[0]); - Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", body), new Object[0]); - if (AndroidPushService.this.pushListener != null) { - AndroidPushService.this.pushListener.onConnectionError(code, format); - } - } - }); - } catch (Exception e) { - String format = String.format("Failed to register device with Exception: %s", e.getLocalizedMessage()); - Log.Helper.LOGES(LOG_TAG, format, new Object[0]); - if (this.pushListener != null) { - this.pushListener.onConnectionError(0, format); - } - } - } finally { - saveConfigData(pushNotificationConfig); - } - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - public void sendTrackingEvent(String str, String str2, String str3) { - try { - HttpRequest resource = this.httpService.getResource(String.format("%s/games/%s/events", this.pushNotificationServerUrl, this.gameId)); - TrackingEvent trackingEvent = new TrackingEvent(str, str2, str3, loadConfigData(DEVICE_ID_KEY)); - resource.setHeader("Authorization", createAuthorizationHeader()); - resource.setJsonBody(new Gson().toJson(trackingEvent)); - resource.postAsync(new HttpRequestListener() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.4 - @Override // com.ea.eadp.http.models.HttpRequestListener - public void onComplete(HttpResponse httpResponse) { - int code = httpResponse.getCode(); - if (code >= 200 && code < 300) { - Log.Helper.LOGIS(AndroidPushService.LOG_TAG, "Tracking request successful!", new Object[0]); - Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", httpResponse.getBody()), new Object[0]); - if (AndroidPushService.this.pushListener != null) { - AndroidPushService.this.pushListener.onTrackingSuccess(code, httpResponse.getBody()); - return; - } - return; - } - String format = String.format("Tracking request failed! Status: %s, Message: %s", Integer.valueOf(httpResponse.getCode()), httpResponse.getMessage()); - Log.Helper.LOGES(AndroidPushService.LOG_TAG, format, new Object[0]); - Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", httpResponse.getBody()), new Object[0]); - if (AndroidPushService.this.pushListener != null) { - AndroidPushService.this.pushListener.onConnectionError(code, format); - } - } - }); - } catch (Exception e) { - String format = String.format("Tracking request failed with Exception: %s", e.getMessage()); - Log.Helper.LOGES(LOG_TAG, format, new Object[0]); - if (this.pushListener != null) { - this.pushListener.onConnectionError(0, format); - } - } - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - public void persistTrackingEvent(String str, String str2, String str3) { - List arrayList; - SharedPreferences sharedPreferences = this.context.getApplicationContext().getSharedPreferences(TRACKING_PREFS_FILENAME, 0); - String string = sharedPreferences.getString(EVENT_LIST_KEY, null); - if (string != null) { - arrayList = (List) new Gson().fromJson(string, List.class); - } else { - arrayList = new ArrayList(); - } - HashMap hashMap = new HashMap(); - hashMap.put(GcmIntentService.PushIntentExtraKeys.PUSH_ID, str); - hashMap.put(GcmIntentService.PushIntentExtraKeys.PN_TYPE, str2); - hashMap.put("state", str3); - if (arrayList == null) { - Log.Helper.LOGE(this, "Unexpected Event List. Skipping Tracking event persistence.", new Object[0]); - return; - } - arrayList.add(hashMap); - SharedPreferences.Editor edit = sharedPreferences.edit(); - edit.putString(EVENT_LIST_KEY, new Gson().toJson(arrayList)); - edit.commit(); - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - public void sendPendingTrackingRequests() { - Gson gson = new Gson(); - SharedPreferences sharedPreferences = this.context.getSharedPreferences(TRACKING_PREFS_FILENAME, 0); - String string = sharedPreferences.getString(EVENT_LIST_KEY, null); - if (string != null) { - List list = (List) gson.fromJson(string, List.class); - if (list == null) { - Log.Helper.LOGE(this, "Event List from Json is null!", new Object[0]); - return; - } - for (Map map : list) { - if (map != null && !map.isEmpty()) { - sendTrackingEvent((String) map.get(GcmIntentService.PushIntentExtraKeys.PUSH_ID), (String) map.get(GcmIntentService.PushIntentExtraKeys.PN_TYPE), (String) map.get("state")); - } - } - } - SharedPreferences.Editor edit = sharedPreferences.edit(); - edit.clear(); - edit.commit(); - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - public void getInAppNotifications(final String str, final String str2) { - if (str == null) { - if (this.pushListener != null) { - this.pushListener.onConnectionError(0, "UserAlias is null"); - return; - } - return; - } - new Thread(new Runnable() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.5 - @Override // java.lang.Runnable - public void run() { - int i; - try { - HttpRequest resource = AndroidPushService.this.httpService.getResource(String.format("%s/games/%s/users/%s/inapp", AndroidPushService.this.pushNotificationServerUrl, AndroidPushService.this.gameId, str)); - if (str2 != null) { - resource.setHeader("Authorization", "Bearer " + str2); - } - HttpResponse httpResponse = resource.get(); - i = httpResponse.getCode(); - try { - if (i >= 200 && i < 300) { - Log.Helper.LOGIS(AndroidPushService.LOG_TAG, "Get In-App Notification request successful!", new Object[0]); - Log.Helper.LOGDS(AndroidPushService.LOG_TAG, "response: " + httpResponse.getBody(), new Object[0]); - if (AndroidPushService.this.pushListener != null) { - AndroidPushService.this.pushListener.onGetInAppSuccess(i, httpResponse.getBody()); - } - } else { - String format = String.format("Get In-App Notification request failed! Status: %s, Message: %s", Integer.valueOf(httpResponse.getCode()), httpResponse.getMessage()); - Log.Helper.LOGES(AndroidPushService.LOG_TAG, format, new Object[0]); - Log.Helper.LOGDS(AndroidPushService.LOG_TAG, String.format("response: %s", httpResponse.getBody()), new Object[0]); - if (AndroidPushService.this.pushListener != null) { - AndroidPushService.this.pushListener.onConnectionError(i, format); - } - } - } catch (Exception e) { - e = e; - String format2 = String.format("In-App Notification request failed with Exception: %s", e.getMessage()); - Log.Helper.LOGES(AndroidPushService.LOG_TAG, format2, new Object[0]); - if (AndroidPushService.this.pushListener != null) { - AndroidPushService.this.pushListener.onConnectionError(i, format2); - } - } - } catch (Exception e2) { - e = e2; - i = 0; - } - } - }, "getInAppNotifications thread").start(); - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - public void onRestart() { - if (this.inAppTimer == null || this.inAppNotificationInterval <= 0) { - return; - } - this.inAppTimer = new Timer(); - this.inAppTimer.schedule(new TimerTask() { // from class: com.ea.eadp.pushnotification.services.AndroidPushService.6 - @Override // java.util.TimerTask, java.lang.Runnable - public void run() { - AndroidPushService.this.getInAppNotifications(AndroidPushService.this.startConfig.getUserAlias(), AndroidPushService.this.startClientToken); - } - }, this.inAppNotificationInterval, this.inAppNotificationInterval); - } - - @Override // com.ea.eadp.pushnotification.services.IPushService - public void onStop() { - if (this.inAppTimer != null) { - this.inAppTimer.cancel(); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public boolean checkPlayServices() { - return GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(this.context) == 0; - } - - private void saveConfigData(PushNotificationConfig pushNotificationConfig) { - SharedPreferences.Editor edit = this.context.getApplicationContext().getSharedPreferences(SHARED_PREFS_FILENAME, 0).edit(); - if (pushNotificationConfig.getDeviceIdentifier() != null && !pushNotificationConfig.getDeviceIdentifier().equals("")) { - edit.putString(DEVICE_ID_KEY, pushNotificationConfig.getDeviceIdentifier()); - } - if (this.pushNotificationServerUrl != null && !this.pushNotificationServerUrl.equals("")) { - edit.putString(PUSH_SERVER_URL_KEY, this.pushNotificationServerUrl); - } - if (this.gameId != null && !this.gameId.equals("")) { - edit.putString(GAME_ID_KEY, this.gameId); - } - if (this.apiKey != null && !this.apiKey.equals("")) { - edit.putString(API_KEY_KEY, this.apiKey); - } - if (this.apiSecret != null && !this.apiSecret.equals("")) { - edit.putString(API_SECRET_KEY, this.apiSecret); - } - edit.commit(); - } - - private String loadConfigData(String str) { - return this.context.getApplicationContext().getSharedPreferences(SHARED_PREFS_FILENAME, 0).getString(str, null); - } - - private String createAuthorizationHeader() { - return String.format("Basic %s", Base64.encodeToString((this.apiKey + ':' + this.apiSecret).getBytes(Charset.forName(HTTP.UTF_8)), 10)); - } - - private static class TimeZoneSerializer implements JsonSerializer { - private TimeZoneSerializer() { - } - - @Override // com.google.gson.JsonSerializer - public JsonElement serialize(TimeZone timeZone, Type type, JsonSerializationContext jsonSerializationContext) { - return new JsonPrimitive(timeZone.getID()); - } - } -} diff --git a/app/src/main/java/com/ea/eadp/pushnotification/services/IPushService.java b/app/src/main/java/com/ea/eadp/pushnotification/services/IPushService.java deleted file mode 100644 index 783a356..0000000 --- a/app/src/main/java/com/ea/eadp/pushnotification/services/IPushService.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.ea.eadp.pushnotification.services; - -import com.ea.eadp.pushnotification.listeners.IPushListener; -import com.ea.eadp.pushnotification.models.PushNotificationConfig; - -/* loaded from: classes.dex */ -public interface IPushService { - public static final String NOTIFICATION_TYPE_OPENED = "NOTIFICATION_OPENED"; - public static final String NOTIFICATION_TYPE_RECEIVED = "NOTIFICATION_RECEIVED"; - - void getInAppNotifications(String str, String str2); - - IPushListener getPushListener(); - - void onRestart(); - - void onStop(); - - void persistTrackingEvent(String str, String str2, String str3); - - void registerDevice(PushNotificationConfig pushNotificationConfig); - - void sendPendingTrackingRequests(); - - void sendTrackingEvent(String str, String str2, String str3); - - void setPushListener(IPushListener iPushListener); - - void startWithConfig(PushNotificationConfig pushNotificationConfig, String str); -} diff --git a/app/src/main/java/com/ea/eadp/pushnotification/services/TrackingEvent.java b/app/src/main/java/com/ea/eadp/pushnotification/services/TrackingEvent.java deleted file mode 100644 index 67d08d9..0000000 --- a/app/src/main/java/com/ea/eadp/pushnotification/services/TrackingEvent.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.ea.eadp.pushnotification.services; - -import com.ea.eadp.pushnotification.forwarding.GcmIntentService; -import com.google.gson.annotations.Expose; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; - -/* loaded from: classes.dex */ -class TrackingEvent { - - @Expose - private String name; - - @Expose - private Map parameters = new HashMap(); - - public TrackingEvent(String str, String str2, String str3, String str4) { - this.name = str3; - this.parameters.put(GcmIntentService.PushIntentExtraKeys.PUSH_ID, str); - this.parameters.put(GcmIntentService.PushIntentExtraKeys.PN_TYPE, str2); - this.parameters.put("deviceType", "android"); - this.parameters.put("deviceIdentifier", str4); - this.parameters.put("timestamp", new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").format(new Date())); - } -} diff --git a/app/src/main/java/com/ea/ironmonkey/C2DMConstants.java b/app/src/main/java/com/ea/ironmonkey/C2DMConstants.java deleted file mode 100644 index a4a1871..0000000 --- a/app/src/main/java/com/ea/ironmonkey/C2DMConstants.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.ea.ironmonkey; - -/* loaded from: classes.dex */ -public class C2DMConstants { - public static final String ACTION_ERROR = "com.ea.ironmonkey.ERROR"; - public static final String ACTION_MESSAGE = "com.ea.ironmonkey.MESSAGE"; - public static final String ACTION_REGISTER = "com.ea.ironmonkey.REGISTER"; - public static final String ACTION_UNREGISTER = "com.ea.ironmonkey.UNREGISTER"; - public static final String EXTRA_ERROR_ID = "ERROR_ID"; - public static final String EXTRA_REGISTRATION_ID = "REGISTRATION_ID"; - public static final String LAUNCH_TYPE_TAG = "app_launch"; - public static final String SENDER_EMAIL = "927779459434"; - public static final String SYSTEM_MSG_CLASS_RECIPIENT = "com.ea.ironmonkey.GameActivityMain"; - public static final String SYSTEM_MSG_PACKAGE_RECIPIENT = "com.ea.games.nfs13_row"; - public static final String SYSTEM_MSG_TITLE = "NFS Most Wanted"; -} diff --git a/app/src/main/java/com/ea/ironmonkey/DownloaderService.java b/app/src/main/java/com/ea/ironmonkey/DownloaderService.java deleted file mode 100644 index aaafe1f..0000000 --- a/app/src/main/java/com/ea/ironmonkey/DownloaderService.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.ea.ironmonkey; - -/* loaded from: classes.dex */ -public class DownloaderService extends com.google.android.vending.expansion.downloader.impl.DownloaderService { - @Override // com.google.android.vending.expansion.downloader.impl.DownloaderService - public String getPublicKey() { - return getPackageName().endsWith("_row") ? SkuConfig.ROW_BASE64_PUBLIC_KEY : SkuConfig.NA_BASE64_PUBLIC_KEY; - } - - @Override // com.google.android.vending.expansion.downloader.impl.DownloaderService - public byte[] getSALT() { - return SkuConfig.SALT; - } - - @Override // com.google.android.vending.expansion.downloader.impl.DownloaderService - public String getAlarmReceiverClassName() { - return DownloaderServiceBroadcastReceiver.class.getName(); - } -} diff --git a/app/src/main/java/com/ea/ironmonkey/DownloaderServiceBroadcastReceiver.java b/app/src/main/java/com/ea/ironmonkey/DownloaderServiceBroadcastReceiver.java deleted file mode 100644 index 750f5e2..0000000 --- a/app/src/main/java/com/ea/ironmonkey/DownloaderServiceBroadcastReceiver.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.ea.ironmonkey; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; - -/* loaded from: classes.dex */ -public class DownloaderServiceBroadcastReceiver extends BroadcastReceiver { - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - try { - DownloaderClientMarshaller.startDownloadServiceIfRequired(context, intent, (Class) DownloaderService.class); - } catch (PackageManager.NameNotFoundException e) { - e.printStackTrace(); - } - } -} diff --git a/app/src/main/java/com/ea/ironmonkey/GameActivityMain.java b/app/src/main/java/com/ea/ironmonkey/GameActivityMain.java index 02a9abd..6f560ee 100644 --- a/app/src/main/java/com/ea/ironmonkey/GameActivityMain.java +++ b/app/src/main/java/com/ea/ironmonkey/GameActivityMain.java @@ -1,11 +1,14 @@ package com.ea.ironmonkey; +import android.annotation.SuppressLint; import android.app.Activity; import android.app.ActivityManager; import android.app.AlertDialog; import android.app.PendingIntent; +import android.content.Context; import android.content.DialogInterface; import android.content.Intent; +import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.res.AssetManager; import android.content.res.Configuration; @@ -17,11 +20,11 @@ import android.net.Uri; import android.opengl.GLES20; import android.os.Build; import android.os.Bundle; +import android.os.Environment; import android.os.Handler; import android.os.PowerManager; import android.os.Process; import android.provider.Settings; -import android.support.v4.media.session.PlaybackStateCompat; import android.util.DisplayMetrics; import android.view.Display; import android.view.DisplayCutout; @@ -29,24 +32,29 @@ import android.view.KeyEvent; import android.view.OrientationEventListener; import android.view.View; import android.view.ViewParent; +import android.view.WindowManager; import android.view.inputmethod.InputMethodManager; import android.widget.FrameLayout; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.core.app.ComponentActivity; + import com.ea.EAIO.EAIO; import com.ea.EAMIO.StorageDirectory; import com.ea.nimble.ApplicationLifecycle; import com.ea.nimble.Global; -import com.facebook.FacebookSdk; -import com.google.android.vending.expansion.downloader.Constants; import com.google.gson.Gson; import com.google.gson.annotations.SerializedName; import com.google.gson.reflect.TypeToken; import java.io.BufferedReader; import java.io.File; +import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.io.OutputStream; import java.lang.reflect.Array; import java.util.ArrayList; import java.util.HashMap; @@ -61,7 +69,7 @@ import javax.microedition.khronos.opengles.GL10; import org.fmod.FMODAudioDevice; /* loaded from: classes.dex */ -public class GameActivityMain extends Activity implements DrawFrameListener { +public class GameActivityMain extends AppCompatActivity implements DrawFrameListener { private static final String DOWNLOAD_PROPERTIES = "downloadcontent/config.properties"; public static final int LIFECYCLE_CREATED = 1; public static final int LIFECYCLE_DESTROYED = 5; @@ -90,7 +98,6 @@ public class GameActivityMain extends Activity implements DrawFrameListener { private Accelerometer accelerometer; private GameGLSurfaceView gameGLSurfaceView; private GameRenderer gameRenderer; - private GoogleDrm googleDrm; private Handler handler; private int laststate; private int lifecycle; @@ -98,7 +105,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { private FMODAudioDevice mFMODAudioDevice; private FrameLayout mFrameLayout; private OrientationEventListener mOrientationListener; - private Map> mResources; + private Map mResources; private PowerManager.WakeLock mWakeLock; public int naturalOrientation; private RunLoop runLoop; @@ -112,6 +119,14 @@ public class GameActivityMain extends Activity implements DrawFrameListener { private AssetLocationType mAssetLocationType = AssetLocationType.EXTERNAL; private String[] lifecycleNames = {"LIFECYCLE_NONE", "LIFECYCLE_CREATED", "LIFECYCLE_STARTED", "LIFECYCLE_RUNNING", "LIFECYCLE_STOPPED", "LIFECYCLE_DESTROYED"}; + public File getSave() { + return save; + } + + public void setSave(File save) { + this.save = save; + } + enum AssetLocationType { EXTERNAL, ASSETS, @@ -176,6 +191,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { @Override // android.app.Activity public void onCreate(Bundle bundle) { + restoreSave(); Log.setEnable(true); Log.i(TAG, "onCreate"); super.onCreate(bundle); @@ -200,11 +216,11 @@ public class GameActivityMain extends Activity implements DrawFrameListener { Log.d(TAG, "It's Amazon dev"); isAmazonDev = true; } - if (!isAtLeastAPI(18) && getRequestedOrientation() != 6) { - setRequestedOrientation(6); + if (!isAtLeastAPI(18) && getRequestedOrientation() != ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE) { + setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE); } if (isAtLeastAPI(28)) { - getWindow().getAttributes().layoutInDisplayCutoutMode = 1; + getWindow().getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES; getWindow().addFlags(67108864); } getWindow().setFlags(1024, 1024); @@ -229,7 +245,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { if (this.mOrientationListener.canDetectOrientation()) { this.mOrientationListener.enable(); } - mAudioManager = (AudioManager) getSystemService("audio"); + mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE); sIsOtherMusicPlaying = mAudioManager.isMusicActive(); Log.i(TAG, "onCreate() isMusicActive = " + Boolean.toString(sIsOtherMusicPlaying)); this.mFMODAudioDevice = new FMODAudioDevice(); @@ -237,7 +253,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { try { Log.d(TAG, "onCreate open resources.json"); InputStream open = getAssetManager().open("resources.json"); - this.mResources = (Map) new Gson().fromJson(new InputStreamReader(open), new TypeToken>>() { // from class: com.ea.ironmonkey.GameActivityMain.2 + this.mResources = new Gson().fromJson(new InputStreamReader(open), new TypeToken>>() { // from class: com.ea.ironmonkey.GameActivityMain.2 }.getType()); Log.d(TAG, "onCreate resources.json contains " + Integer.toString(this.mResources.size()) + " items"); open.close(); @@ -259,7 +275,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { Log.e(TAG, e2.getMessage()); } } - SensorManager sensorManager = (SensorManager) getSystemService("sensor"); + SensorManager sensorManager = (SensorManager) getSystemService(Context.SENSOR_SERVICE); Sensor defaultSensor = sensorManager.getDefaultSensor(1); int rotation = getWindow().getWindowManager().getDefaultDisplay().getRotation(); switch (rotation) { @@ -289,13 +305,11 @@ public class GameActivityMain extends Activity implements DrawFrameListener { this.mFrameLayout = new FrameLayout(this); this.mFrameLayout.addView(this.gameGLSurfaceView); setContentView(this.mFrameLayout); - this.googleDrm = new GoogleDrm(this); System.loadLibrary("fmodex"); System.loadLibrary("fmodevent"); System.loadLibrary("c++_shared"); System.loadLibrary(Global.NIMBLE_ID); System.loadLibrary("app"); - FacebookSdk.sdkInitialize(this); Log.d(TAG, "Init EAIO/EAMIO"); EAIO.Startup(this); StorageDirectory.Startup(this); @@ -304,14 +318,8 @@ public class GameActivityMain extends Activity implements DrawFrameListener { nativeOnCreate(); } - public String[] forEach(String str) { - Log.d(TAG, "forEach path = " + str); - if (this.mResources.containsKey(str)) { - Log.d(TAG, "forEach mResources contains " + str); - return (String[]) this.mResources.get(str).keySet().toArray(new String[0]); - } - Log.d(TAG, "forEach mResources not contains " + str); - return new String[0]; + public String[] forEach(String input) { + return new String[] { input }; } public int getAssetSize(String str) { @@ -328,7 +336,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { Log.d(TAG, "getAssetSize path = " + parent); if (this.mResources.containsKey(parent)) { Log.d(TAG, "getAssetSize mResources contains " + parent); - Map map = this.mResources.get(parent); + Map map = (Map) this.mResources.get(parent); String name = file.getName(); Log.d(TAG, "getAssetSize name = " + name); if (map.containsKey(name)) { @@ -368,6 +376,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { } public String getObbFullPath() { + Log.i(this.getClass().getName(), getObbDir() + "/" + ObbHelper.getObbFileName(this, getVersionCode())); return getObbDir() + "/" + ObbHelper.getObbFileName(this, getVersionCode()); } @@ -409,13 +418,6 @@ public class GameActivityMain extends Activity implements DrawFrameListener { } } - private void getC2DMRegistrationId() { - Intent intent = new Intent("com.google.android.c2dm.intent.REGISTER"); - intent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); - intent.putExtra("sender", C2DMConstants.SENDER_EMAIL); - startService(intent); - } - @Override // android.app.Activity public void onStart() { CallGC(); @@ -447,6 +449,62 @@ public class GameActivityMain extends Activity implements DrawFrameListener { ApplicationLifecycle.onActivityStart(this); } + // Методы для воостановления сейва и его сохранения чтобы всегда использовать внешний сейв + + private String saveFileName = "nfstr_save.sb"; + private File save = null; + private File externalSave = new File(Environment.getStorageDirectory(),"games/nfsmw/nfstr_save.sb"); + + // Сохранить + private void storeSave() { + try { + save = new File(getFilesDir(), "var/nfstr_save.sb"); + + // Создаем директории, если они не существуют + externalSave.getParentFile().mkdirs(); + + // Копируем файл из внутреннего хранилища во внешнее + try (InputStream in = new FileInputStream(save); + OutputStream out = new FileOutputStream(externalSave)) { + byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); + } + } + } catch (IOException e) { + e.printStackTrace(); + // Обработка ошибки сохранения + } + } + + // Восстановить + private void restoreSave() { + try { + save = new File(getFilesDir(), "var/nfstr_save.sb"); + // Проверяем, существует ли внешний файл + if (!externalSave.exists()) { + return; // ничего не делаем, если файла нет + } + + // Создаем директории для внутреннего файла, если нужно + save.getParentFile().mkdirs(); + + // Копируем файл из внешнего хранилища во внутреннее + try (InputStream in = new FileInputStream(externalSave); + OutputStream out = new FileOutputStream(save)) { + byte[] buf = new byte[1024]; + int len; + while ((len = in.read(buf)) > 0) { + out.write(buf, 0, len); + } + } + } catch (IOException e) { + e.printStackTrace(); + // Обработка ошибки восстановления + } + } + @Override // android.app.Activity public void onRestart() { Log.i(TAG, "onRestart"); @@ -477,7 +535,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { private void ForceHideVirtualKeyboard() { View currentFocus = getCurrentFocus(); if (currentFocus != null) { - ((InputMethodManager) getSystemService("input_method")).hideSoftInputFromWindow(currentFocus.getWindowToken(), 0); + ((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(currentFocus.getWindowToken(), 0); } getWindow().setSoftInputMode(3); } @@ -529,9 +587,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { return; } setLifecycle(5); - if (this.googleDrm.isEnable()) { - this.googleDrm.destroy(); - } + storeSave(); if (state == 8) { ApplicationLifecycle.onActivityDestroy(this); nativeOnDestroy(); @@ -541,12 +597,13 @@ public class GameActivityMain extends Activity implements DrawFrameListener { System.exit(0); } + @SuppressLint("InvalidWakeLockTag") public void wakeLockAcquire() { if (this.isSleepModeEnabled) { return; } if (this.mWakeLock == null) { - this.mWakeLock = ((PowerManager) getSystemService("power")).newWakeLock(10, TAG); + this.mWakeLock = ((PowerManager) getSystemService(Context.POWER_SERVICE)).newWakeLock(10, TAG); } if (this.mWakeLock.isHeld()) { return; @@ -621,6 +678,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { @Override // android.app.Activity public void onBackPressed() { + //super.onBackPressed(); if (state == 1 || state == 0 || state == 7) { finish(); } @@ -763,18 +821,9 @@ public class GameActivityMain extends Activity implements DrawFrameListener { @Override // android.app.Activity, android.content.ComponentCallbacks public void onLowMemory() { - ActivityManager activityManager = (ActivityManager) getSystemService("activity"); + ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE); ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); activityManager.getMemoryInfo(memoryInfo); - Log.i(TAG, "Available memory: " + ((memoryInfo.availMem / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) + "MB\n"); - Log.i(TAG, "Threshold: " + ((memoryInfo.threshold / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) + "MB\n"); - List runningAppProcesses = activityManager.getRunningAppProcesses(); - new TreeMap(); - for (ActivityManager.RunningAppProcessInfo runningAppProcessInfo : runningAppProcesses) { - if (runningAppProcessInfo.processName.indexOf("nfs13") != -1) { - Log.i(TAG, "Total memory: " + (activityManager.getProcessMemoryInfo(new int[]{runningAppProcessInfo.pid})[0].getTotalPss() / 1024) + "MB\n"); - } - } super.onLowMemory(); } @@ -866,18 +915,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { case 0: this.splash = new SplashScreen(this); this.splash.init(gl10, this.gameRenderer.getWidth(), this.gameRenderer.getHeight()); - if (this.googleDrm.isEnable()) { - Log.i(TAG, "Begin DRM Check..."); - this.handler.postDelayed(new Runnable() { // from class: com.ea.ironmonkey.GameActivityMain.7 - @Override // java.lang.Runnable - public void run() { - GameActivityMain.this.googleDrm.start(); - } - }, 20L); - state = 2; - } else { - state = 1; - } + state = 1; this.splashCounter = 3; break; case 1: @@ -961,16 +999,6 @@ public class GameActivityMain extends Activity implements DrawFrameListener { public void onResult(String str, int i) { Log.w(TAG, "onResult(" + str + "," + i + ")"); - if (str.equals("GOOGL_DRM")) { - if (i == -1) { - state = 1; - return; - } - Log.e(TAG, "No Google account!!!!"); - finish(); - Process.killProcess(Process.myPid()); - return; - } if (i == -1) { File file = new File(new File(str).getParent() + "/.nomedia"); if (!file.exists()) { @@ -998,116 +1026,8 @@ public class GameActivityMain extends Activity implements DrawFrameListener { Process.killProcess(Process.myPid()); } - /* JADX WARN: Code restructure failed: missing block: B:11:0x004a, code lost: - - r3 = r3[1].trim().split(" "); - com.ea.ironmonkey.Log.d("mem", r3[0]); - */ - /* JADX WARN: Code restructure failed: missing block: B:13:0x005d, code lost: - - r3 = java.lang.Integer.parseInt(r3[0].trim()) / 1024; - */ - /* JADX WARN: Code restructure failed: missing block: B:22:0x006a, code lost: - - r3 = move-exception; - */ - /* JADX WARN: Code restructure failed: missing block: B:23:0x006b, code lost: - - com.ea.ironmonkey.Log.d("mem", r3.toString()); - */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ public int getTotalMemory() { - /* - r9 = this; - java.io.File r0 = new java.io.File - java.lang.String r1 = "/proc/meminfo" - r0.(r1) - boolean r1 = r0.exists() - r2 = 0 - if (r1 == 0) goto L9c - r1 = 1 - java.io.FileReader r3 = new java.io.FileReader // Catch: java.lang.Exception -> L7f - r3.(r0) // Catch: java.lang.Exception -> L7f - java.io.BufferedReader r4 = new java.io.BufferedReader // Catch: java.lang.Exception -> L7f - r4.(r3) // Catch: java.lang.Exception -> L7f - L19: - java.lang.String r3 = r4.readLine() // Catch: java.lang.Exception -> L7f - if (r3 == 0) goto L74 - java.lang.String r5 = "mem" - com.ea.ironmonkey.Log.d(r5, r3) // Catch: java.lang.Exception -> L7f - java.lang.String r5 = ":" - java.lang.String[] r3 = r3.split(r5) // Catch: java.lang.Exception -> L7f - java.lang.String r5 = "mem" - r6 = r3[r2] // Catch: java.lang.Exception -> L7f - com.ea.ironmonkey.Log.d(r5, r6) // Catch: java.lang.Exception -> L7f - java.lang.String r5 = "mem" - r6 = r3[r1] // Catch: java.lang.Exception -> L7f - com.ea.ironmonkey.Log.d(r5, r6) // Catch: java.lang.Exception -> L7f - r5 = r3[r2] // Catch: java.lang.Exception -> L7f - java.lang.String r5 = r5.trim() // Catch: java.lang.Exception -> L7f - java.lang.String r5 = r5.toLowerCase() // Catch: java.lang.Exception -> L7f - java.lang.String r6 = "memtotal" - boolean r5 = r5.equals(r6) // Catch: java.lang.Exception -> L7f - if (r5 == 0) goto L19 - r3 = r3[r1] // Catch: java.lang.Exception -> L7f - java.lang.String r3 = r3.trim() // Catch: java.lang.Exception -> L7f - java.lang.String r5 = " " - java.lang.String[] r3 = r3.split(r5) // Catch: java.lang.Exception -> L7f - java.lang.String r5 = "mem" - r6 = r3[r2] // Catch: java.lang.Exception -> L7f - com.ea.ironmonkey.Log.d(r5, r6) // Catch: java.lang.Exception -> L7f - r3 = r3[r2] // Catch: java.lang.NumberFormatException -> L6a java.lang.Exception -> L7f - java.lang.String r3 = r3.trim() // Catch: java.lang.NumberFormatException -> L6a java.lang.Exception -> L7f - int r3 = java.lang.Integer.parseInt(r3) // Catch: java.lang.NumberFormatException -> L6a java.lang.Exception -> L7f - int r3 = r3 / 1024 - goto L75 - L6a: - r3 = move-exception - java.lang.String r5 = "mem" - java.lang.String r3 = r3.toString() // Catch: java.lang.Exception -> L7f - com.ea.ironmonkey.Log.d(r5, r3) // Catch: java.lang.Exception -> L7f - L74: - r3 = 0 - L75: - r4.close() // Catch: java.lang.Exception -> L7a - r2 = r3 - goto L9c - L7a: - r4 = move-exception - r8 = r4 - r4 = r3 - r3 = r8 - goto L81 - L7f: - r3 = move-exception - r4 = 0 - L81: - java.lang.String r5 = "GameActivityMain" - java.lang.String r6 = "Error reading system file: %s (%s)" - r7 = 2 - java.lang.Object[] r7 = new java.lang.Object[r7] - java.lang.String r0 = r0.getAbsolutePath() - r7[r2] = r0 - java.lang.String r0 = r3.getMessage() - r7[r1] = r0 - java.lang.String r0 = java.lang.String.format(r6, r7) - com.ea.ironmonkey.Log.e(r5, r0) - r2 = r4 - L9c: - java.lang.String r0 = "mem" - java.lang.StringBuilder r1 = new java.lang.StringBuilder - r1.() - java.lang.String r3 = "totalmemory=" - r1.append(r3) - r1.append(r2) - java.lang.String r1 = r1.toString() - com.ea.ironmonkey.Log.d(r0, r1) - return r2 - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.ironmonkey.GameActivityMain.getTotalMemory():int"); + return 40000; } public void openURL(String str) { @@ -1125,87 +1045,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { } public float getPerformanceScore() { - String readCpuFile = readCpuFile("present"); - int i = 0; - float f = 0.0f; - if (readCpuFile.length() > 0) { - List parseCpuList = parseCpuList(readCpuFile); - Iterator it = parseCpuList.iterator(); - while (true) { - if (!it.hasNext()) { - break; - } - if (readCpuFile(String.format("cpu%d/cpufreq/cpuinfo_max_freq", Integer.valueOf(it.next().intValue()))).length() > 0) { - try { - f = Integer.parseInt(r4) * 0.001f; - break; - } catch (NumberFormatException unused) { - continue; - } - } - } - i = parseCpuList.size(); - } - DisplayMetrics displayMetrics = new DisplayMetrics(); - getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); - return calcPerformanceScore(f, i, displayMetrics.widthPixels, displayMetrics.heightPixels); - } - - public List parseCpuList(String str) { - ArrayList arrayList = new ArrayList(); - for (String str2 : str.split(",")) { - if (str2.contains(Constants.FILENAME_SEQUENCE_SEPARATOR)) { - String[] split = str2.split(Constants.FILENAME_SEQUENCE_SEPARATOR); - if (split.length >= 2) { - try { - int parseInt = Integer.parseInt(split[1]); - for (int parseInt2 = Integer.parseInt(split[0]); parseInt2 <= parseInt; parseInt2++) { - arrayList.add(Integer.valueOf(parseInt2)); - } - } catch (NumberFormatException unused) { - } - } - } else { - arrayList.add(Integer.valueOf(Integer.parseInt(str2))); - } - } - return arrayList; - } - - public String readCpuFile(String str) { - File file = new File("/sys/devices/system/cpu", str); - if (!file.exists()) { - return ""; - } - try { - BufferedReader bufferedReader = new BufferedReader(new FileReader(file)); - String readLine = bufferedReader.readLine(); - bufferedReader.close(); - return readLine; - } catch (Exception e) { - Log.e(TAG, String.format("Error reading system file: %s (%s)", file.getAbsolutePath(), e.getMessage())); - return ""; - } - } - - public float calcPerformanceScore(float f, int i, int i2, int i3) { - Log.i(TAG, "calcPerformanceScore(" + f + ", " + i + ", " + i2 + ", " + i3 + ")"); - float f2 = f * 0.001f; - float f3 = (3.0f * f2) + 0.0f; - if (i > 1) { - f3 += f2 * (Math.min(i, 4) - 1) * 0.5f; - } - double d = 0.0f; - double sqrt = Math.sqrt(i2 * i3) * 0.0010000000474974513d * 0.5d; - Double.isNaN(d); - float f4 = (float) (d + sqrt); - try { - Log.i(TAG, new BufferedReader(new FileReader(new File("/proc/cpuinfo"))).readLine()); - } catch (IOException e) { - e.printStackTrace(); - } - Log.i(TAG, Build.MODEL); - return ((f3 + 1.0f) / (f4 + 1.0f)) * 0.33333334f; + return 6.6f; } public boolean needInstallWallpaper() { @@ -1213,145 +1053,7 @@ public class GameActivityMain extends Activity implements DrawFrameListener { return false; } - /* JADX WARN: Code restructure failed: missing block: B:15:0x0068, code lost: - - if (r3 != null) goto L13; - */ - /* JADX WARN: Code restructure failed: missing block: B:16:0x006a, code lost: - - r3.close(); - */ - /* JADX WARN: Code restructure failed: missing block: B:27:0x0099, code lost: - - if (r3 != null) goto L13; - */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public void installWallpaper() { - /* - r12 = this; - android.content.Intent r0 = new android.content.Intent - java.lang.String r1 = "android.intent.action.VIEW" - r0.(r1) - java.lang.String r1 = new java.lang.String - java.lang.StringBuilder r2 = new java.lang.StringBuilder - r2.() - java.io.File r3 = android.os.Environment.getExternalStorageDirectory() - java.lang.String r3 = r3.getAbsolutePath() - r2.append(r3) - java.lang.String r3 = "/published/wallpaper/" - r2.append(r3) - java.lang.String r2 = r2.toString() - r1.(r2) - r2 = 0 - java.io.File r3 = new java.io.File // Catch: java.lang.Throwable -> L7a java.io.IOException -> L8d - r3.(r1) // Catch: java.lang.Throwable -> L7a java.io.IOException -> L8d - r3.mkdirs() // Catch: java.lang.Throwable -> L7a java.io.IOException -> L8d - android.content.res.Resources r3 = r12.getResources() // Catch: java.lang.Throwable -> L7a java.io.IOException -> L8d - r4 = 2131427328(0x7f0b0000, float:1.847627E38) - android.content.res.AssetFileDescriptor r3 = r3.openRawResourceFd(r4) // Catch: java.lang.Throwable -> L7a java.io.IOException -> L8d - java.io.File r4 = new java.io.File // Catch: java.lang.Throwable -> L75 java.io.IOException -> L78 - java.lang.String r5 = "wallpaper.apk" - r4.(r1, r5) // Catch: java.lang.Throwable -> L75 java.io.IOException -> L78 - r4.createNewFile() // Catch: java.lang.Throwable -> L75 java.io.IOException -> L78 - java.io.FileInputStream r5 = r3.createInputStream() // Catch: java.lang.Throwable -> L75 java.io.IOException -> L78 - java.nio.channels.FileChannel r5 = r5.getChannel() // Catch: java.lang.Throwable -> L75 java.io.IOException -> L78 - java.io.FileOutputStream r6 = new java.io.FileOutputStream // Catch: java.lang.Throwable -> L73 java.io.IOException -> L8f - r6.(r4) // Catch: java.lang.Throwable -> L73 java.io.IOException -> L8f - java.nio.channels.FileChannel r4 = r6.getChannel() // Catch: java.lang.Throwable -> L73 java.io.IOException -> L8f - r8 = 0 - long r10 = r3.getLength() // Catch: java.lang.Throwable -> L6e java.io.IOException -> L71 - r6 = r4 - r7 = r5 - r6.transferFrom(r7, r8, r10) // Catch: java.lang.Throwable -> L6e java.io.IOException -> L71 - if (r4 == 0) goto L63 - r4.close() // Catch: java.io.IOException -> L9c - L63: - if (r5 == 0) goto L68 - r5.close() // Catch: java.io.IOException -> L9c - L68: - if (r3 == 0) goto L9c - L6a: - r3.close() // Catch: java.io.IOException -> L9c - goto L9c - L6e: - r0 = move-exception - r2 = r4 - goto L7d - L71: - r2 = r4 - goto L8f - L73: - r0 = move-exception - goto L7d - L75: - r0 = move-exception - r5 = r2 - goto L7d - L78: - r5 = r2 - goto L8f - L7a: - r0 = move-exception - r3 = r2 - r5 = r3 - L7d: - if (r2 == 0) goto L82 - r2.close() // Catch: java.io.IOException -> L8c - L82: - if (r5 == 0) goto L87 - r5.close() // Catch: java.io.IOException -> L8c - L87: - if (r3 == 0) goto L8c - r3.close() // Catch: java.io.IOException -> L8c - L8c: - throw r0 - L8d: - r3 = r2 - r5 = r3 - L8f: - if (r2 == 0) goto L94 - r2.close() // Catch: java.io.IOException -> L9c - L94: - if (r5 == 0) goto L99 - r5.close() // Catch: java.io.IOException -> L9c - L99: - if (r3 == 0) goto L9c - goto L6a - L9c: - java.io.File r2 = new java.io.File - java.lang.StringBuilder r3 = new java.lang.StringBuilder - r3.() - r3.append(r1) - java.lang.String r1 = "wallpaper.apk" - r3.append(r1) - java.lang.String r1 = r3.toString() - r2.(r1) - android.net.Uri r1 = android.net.Uri.fromFile(r2) - java.lang.String r2 = "application/vnd.android.package-archive" - r0.setDataAndType(r1, r2) - r12.startActivity(r0) - return - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.ironmonkey.GameActivityMain.installWallpaper():void"); - } - - public void onDownloadEvent(int i) { - String str = getApplicationInfo().dataDir + "/files/var1/adcEvents"; - long currentTimeMillis = System.currentTimeMillis(); - Log.i(TAG, "GetADCTelemetry: eventId= " + i + " eventTime=" + currentTimeMillis + " fileName=" + str); - byte[] bArr = {(byte) ((i >> 24) & 255), (byte) ((i >> 16) & 255), (byte) ((i >> 8) & 255), (byte) (i & 255), (byte) ((int) ((currentTimeMillis >> 56) & 255)), (byte) ((int) ((currentTimeMillis >> 48) & 255)), (byte) ((int) ((currentTimeMillis >> 40) & 255)), (byte) ((int) ((currentTimeMillis >> 32) & 255)), (byte) ((int) ((currentTimeMillis >> 24) & 255)), (byte) ((int) ((currentTimeMillis >> 16) & 255)), (byte) ((int) ((currentTimeMillis >> 8) & 255)), (byte) ((int) (currentTimeMillis & 255))}; - Log.i(TAG, "Write adcEvents file"); - try { - FileOutputStream fileOutputStream = new FileOutputStream(new File(str), true); - fileOutputStream.write(bArr, 0, 12); - fileOutputStream.close(); - } catch (Exception unused) { - Log.i(TAG, "Can't save adcEvents file"); - } - } + public void installWallpaper() {} public long getUtcTime() { return TimeUnit.MILLISECONDS.toDays(System.currentTimeMillis()); diff --git a/app/src/main/java/com/ea/ironmonkey/GoogleDrm.java b/app/src/main/java/com/ea/ironmonkey/GoogleDrm.java deleted file mode 100644 index 063d2d2..0000000 --- a/app/src/main/java/com/ea/ironmonkey/GoogleDrm.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.ea.ironmonkey; - -import android.provider.Settings; -import com.eamobile.licensing.ILicenseServerActivityCallback; -import com.eamobile.licensing.LicenseServerActivity; - -/* loaded from: classes.dex */ -class GoogleDrm implements ILicenseServerActivityCallback { - private GameActivityMain _activity; - private String publicKey; - - public boolean isEnable() { - return false; - } - - public GoogleDrm(GameActivityMain gameActivityMain) { - this._activity = gameActivityMain; - this.publicKey = SkuConfig.NA_BASE64_PUBLIC_KEY; - if (this._activity.getPackageName().endsWith("_row")) { - this.publicKey = SkuConfig.ROW_BASE64_PUBLIC_KEY; - } - } - - public void start() { - LicenseServerActivity.getInstance().initLicenseServerActivity(this._activity, this, this._activity, SkuConfig.SALT, this._activity.getPackageName(), this.publicKey, Settings.Secure.getString(this._activity.getContentResolver(), "android_id")); - } - - public void destroy() { - LicenseServerActivity.getInstance().destroyLicenseServerActvity(); - } - - /* JADX WARN: Unreachable blocks removed: 1, instructions: 2 */ - @Override // com.eamobile.licensing.ILicenseServerActivityCallback - public void onLicenseResultStart() { - GameActivityMain gameActivityMain = this._activity; - LicenseServerActivity.getInstance().LastCheckPointCheck(); - GameActivityMain gameActivityMain2 = this._activity; - gameActivityMain.onResult("GOOGL_DRM", -1); - LicenseServerActivity.getInstance().destroyLicenseServerActvity(); - } - - @Override // com.eamobile.licensing.ILicenseServerActivityCallback - public void onLicenseResultEnd() { - GameActivityMain gameActivityMain = this._activity; - GameActivityMain gameActivityMain2 = this._activity; - gameActivityMain.onResult("GOOGL_DRM", 0); - LicenseServerActivity.getInstance().destroyLicenseServerActvity(); - } -} diff --git a/app/src/main/java/com/ea/ironmonkey/ObbActivity.java b/app/src/main/java/com/ea/ironmonkey/ObbActivity.java deleted file mode 100644 index c38fdc0..0000000 --- a/app/src/main/java/com/ea/ironmonkey/ObbActivity.java +++ /dev/null @@ -1,489 +0,0 @@ -package com.ea.ironmonkey; - -import android.annotation.TargetApi; -import android.app.Activity; -import android.app.AlertDialog; -import android.app.NotificationManager; -import android.app.PendingIntent; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.net.ConnectivityManager; -import android.os.Build; -import android.os.Bundle; -import android.os.Messenger; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ProgressBar; -import android.widget.TextView; -import com.ea.games.nfs13_row.R; -import com.google.android.vending.expansion.downloader.DownloadProgressInfo; -import com.google.android.vending.expansion.downloader.DownloaderClientMarshaller; -import com.google.android.vending.expansion.downloader.DownloaderServiceMarshaller; -import com.google.android.vending.expansion.downloader.Helpers; -import com.google.android.vending.expansion.downloader.IDownloaderClient; -import com.google.android.vending.expansion.downloader.IDownloaderService; -import com.google.android.vending.expansion.downloader.IStub; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; - -/* loaded from: classes.dex */ -public class ObbActivity extends Activity implements IDownloaderClient { - static final String LOGTAG = "ObbActivity"; - static final int NOTIFICATION_ID = LOGTAG.hashCode(); - public static String PACKAGE_NAME; - private View RLayout; - private Button mCancel; - private IStub mDownloaderClientStub; - private TextView mMessageText; - private View mMessageView; - private Button mOK; - private Button mPause; - private TextView mProgressText; - private TextView mProgressTextSmall; - private View mProgressView; - private IDownloaderService mRemoteService; - private boolean mShowingMessage; - private int mState; - Bundle m_savedInstanceState; - NotificationManager myNotificationManager; - private boolean isFirstTime3GCheck = true; - private boolean pausedFor3GCheck = false; - private ProgressBar mProgressBar = null; - private long m_TotalDownloadSize = 0; - private boolean mIsDownloading = false; - public ObbActivity mInstance = null; - private boolean mhasFocus = false; - private boolean ENABLE_LOG = true; - private final Runnable HideSystemKeys = new Runnable() { // from class: com.ea.ironmonkey.ObbActivity.6 - @Override // java.lang.Runnable - @TargetApi(18) - public void run() { - if (ObbActivity.this.isAtLeastAPI(19)) { - ObbActivity.this.getWindow().getDecorView().setSystemUiVisibility(5894); - } else { - if (!ObbActivity.this.isAtLeastAPI(14) || (ObbActivity.this.getWindow().getDecorView().getSystemUiVisibility() & 1) == 1) { - return; - } - ObbActivity.this.getWindow().getDecorView().setSystemUiVisibility(1); - } - } - }; - - public void setUpNotification() { - } - - public void startGameActivity() { - try { - startActivity(new Intent(this, (Class) GameActivityMain.class)); - finish(); - } catch (Exception e) { - logError(e.toString()); - } - } - - private void log(String str) { - if (this.ENABLE_LOG) { - android.util.Log.d(LOGTAG, str); - } - } - - private void logError(String str) { - if (this.ENABLE_LOG) { - android.util.Log.e(LOGTAG, str); - } - } - - @Override // android.app.Activity - protected void onCreate(Bundle bundle) { - requestWindowFeature(1); - super.onCreate(bundle); - log("................onCreate of ObbActivity ............."); - getWindow().setFlags(1024, 1024); - getWindow().addFlags(128); - this.mInstance = this; - setupUI(); - checkAndDownloadFilesIfNeeded(); - } - - @Override // android.app.Activity - protected void onStart() { - log("obbactivity onStart called "); - super.onStart(); - if (this.mDownloaderClientStub != null) { - this.mDownloaderClientStub.connect(this); - } - } - - @Override // android.app.Activity - protected void onResume() { - super.onResume(); - log("obbactivity onResume called "); - } - - @Override // android.app.Activity - protected void onPause() { - super.onPause(); - log("obbactivity on Pause called"); - } - - @Override // android.app.Activity - protected void onStop() { - log("obbactivity onStop called"); - if (this.mDownloaderClientStub != null) { - log("..... disconnected the client stub ....."); - this.mDownloaderClientStub.disconnect(this); - } - super.onStop(); - } - - @Override // android.app.Activity - protected void onDestroy() { - super.onDestroy(); - log("obbactivity on Destroy called "); - } - - private void doTerminate(String str) { - new AlertDialog.Builder(this.mInstance).setMessage(str).setPositiveButton("Ok", new DialogInterface.OnClickListener() { // from class: com.ea.ironmonkey.ObbActivity.1 - @Override // android.content.DialogInterface.OnClickListener - public void onClick(DialogInterface dialogInterface, int i) { - ObbActivity.this.mInstance.finish(); - System.exit(0); - } - }).show(); - } - - public void checkAndDownloadFilesIfNeeded() { - log("obbactivity checkAndDownloadFilesIfNeeded called "); - if (expansionFilesDelivered(true)) { - log("................Main.obb present and hence launching Game Activity................"); - startGameActivity(); - return; - } - log("................ Expansion files were not delivered ................"); - this.mDownloaderClientStub = DownloaderClientMarshaller.CreateStub(this, DownloaderService.class); - startDownload(); - if (this.mIsDownloading) { - return; - } - startGameActivity(); - } - - public void setupUI() { - setContentView(R.layout.downloader); - this.mProgressBar = (ProgressBar) findViewById(R.id.progressBar); - this.mProgressText = (TextView) findViewById(R.id.statusText); - this.mProgressTextSmall = (TextView) findViewById(R.id.progressText); - this.mMessageText = (TextView) findViewById(R.id.messageText); - this.mMessageView = findViewById(R.id.messageView); - this.mProgressView = findViewById(R.id.progressView); - this.mPause = (Button) findViewById(R.id.pauseButton); - this.mOK = (Button) findViewById(R.id.okButton); - this.mCancel = (Button) findViewById(R.id.cancelButton); - this.mOK.setOnClickListener(new View.OnClickListener() { // from class: com.ea.ironmonkey.ObbActivity.2 - @Override // android.view.View.OnClickListener - public void onClick(View view) { - if (ObbActivity.this.mState == 9 || ObbActivity.this.mState == 8) { - ObbActivity.this.mRemoteService.setDownloadFlags(1); - } - if (ObbActivity.this.mRemoteService != null) { - ObbActivity.this.mRemoteService.requestContinueDownload(); - } - } - }); - this.mPause.setOnClickListener(new View.OnClickListener() { // from class: com.ea.ironmonkey.ObbActivity.3 - @Override // android.view.View.OnClickListener - public void onClick(View view) { - if (ObbActivity.this.mRemoteService == null) { - return; - } - if (7 == ObbActivity.this.mState) { - ObbActivity.this.mRemoteService.requestContinueDownload(); - ObbActivity.this.mPause.setText(R.string.downloader_Pause); - } else { - ObbActivity.this.mRemoteService.requestPauseDownload(); - } - } - }); - this.mCancel.setOnClickListener(new View.OnClickListener() { // from class: com.ea.ironmonkey.ObbActivity.4 - @Override // android.view.View.OnClickListener - public void onClick(View view) { - if (ObbActivity.this.mRemoteService != null) { - ObbActivity.this.mRemoteService.requestAbortDownload(); - } - ObbActivity.this.finish(); - } - }); - } - - @Override // com.google.android.vending.expansion.downloader.IDownloaderClient - public void onDownloadProgress(DownloadProgressInfo downloadProgressInfo) { - log("Download Progress ...........!"); - if (this.isFirstTime3GCheck) { - try { - if (((ConnectivityManager) getSystemService("connectivity")).getNetworkInfo(0).isConnectedOrConnecting()) { - this.isFirstTime3GCheck = false; - if (this.mRemoteService != null) { - this.pausedFor3GCheck = true; - this.mRemoteService.requestPauseDownload(); - showMessage(getString(R.string.downloader_Confirm3GNetwork), R.string.downloader_Continue, R.string.downloader_Quit); - return; - } - } - } catch (Exception unused) { - logError(".............................error at 3G check............................."); - this.isFirstTime3GCheck = false; - this.pausedFor3GCheck = false; - } - } - if (this.m_TotalDownloadSize == 0) { - this.m_TotalDownloadSize = downloadProgressInfo.mOverallTotal / 1048576; - } - this.mProgressBar.setMax((int) (downloadProgressInfo.mOverallTotal >> 8)); - this.mProgressBar.setProgress((int) (downloadProgressInfo.mOverallProgress >> 8)); - this.mProgressTextSmall.setText((downloadProgressInfo.mOverallProgress / 1048576) + " MB/ " + this.m_TotalDownloadSize + " MB"); - int parseInt = Integer.parseInt(Helpers.getDownloadProgressPercent(downloadProgressInfo.mOverallProgress, downloadProgressInfo.mOverallTotal).replaceAll("[\\D]", "")); - if (parseInt >= 0 && parseInt < 25) { - log("Download Progress 0 .. 25"); - this.mProgressText.setText(R.string.text_0_24); - return; - } - if (parseInt >= 25 && parseInt < 50) { - log("Download Progress 25 .. 49"); - this.mProgressText.setText(R.string.text_25_49); - return; - } - if (parseInt >= 50 && parseInt < 75) { - log("Download Progress 50 .. 75"); - this.mProgressText.setText(R.string.text_50_74); - } else if (parseInt >= 75 && parseInt < 95) { - log("Download Progress 75 .. 95"); - this.mProgressText.setText(R.string.text_75_99); - } else { - log("Download Progress 100 !"); - this.mProgressText.setText(R.string.text_100); - } - } - - @Override // com.google.android.vending.expansion.downloader.IDownloaderClient - public void onDownloadStateChanged(int i) { - if (this.mState != i) { - log("onDownloadStateChanged newstate = " + i); - this.mState = i; - this.mProgressText.setText(Helpers.getDownloaderStringResourceIDFromState(i)); - boolean z = false; - switch (i) { - case 1: - log(".............................STATE_IDLE............................."); - hideMessage(); - z = true; - this.mProgressBar.setIndeterminate(z); - break; - case 2: - case 3: - log(".............................STATE_CONNECTING/STATE_FETCHING_URL............................."); - hideMessage(); - z = true; - this.mProgressBar.setIndeterminate(z); - break; - case 4: - log(".............................STATE_DOWNLOADING............................."); - hideMessage(); - this.mProgressBar.setIndeterminate(z); - break; - case 5: - log(".............................STATE_COMPLETED............................."); - setUpNotification(); - this.mProgressTextSmall.setText(this.m_TotalDownloadSize + "/" + this.m_TotalDownloadSize + " MBs"); - this.mProgressText.setText(R.string.text_100); - this.mProgressBar.setMax(1); - this.mProgressBar.setProgress(1); - disablePauseButton(); - hideMessage(); - this.mIsDownloading = false; - startGameActivity(); - break; - case 6: - case 10: - case 11: - case 13: - case 17: - default: - hideMessage(); - z = true; - this.mProgressBar.setIndeterminate(z); - break; - case 7: - log(".............................STATE_PAUSED_BY_REQUEST............................."); - this.mPause.setText(R.string.downloader_Resume); - if (!this.pausedFor3GCheck) { - hideMessage(); - } else { - this.pausedFor3GCheck = false; - } - this.mProgressBar.setIndeterminate(z); - break; - case 8: - case 9: - log(".............................STATE_PAUSED_WIFI_DISABLED_NEED_CELLULAR_PERMISSION............................."); - try { - if (((ConnectivityManager) getSystemService("connectivity")).getNetworkInfo(0).isConnectedOrConnecting()) { - this.isFirstTime3GCheck = false; - if (this.mRemoteService != null) { - showMessage(getString(R.string.downloader_Confirm3GNetwork), R.string.downloader_Continue, R.string.downloader_Quit); - break; - } - } else { - showMessage(getString(Helpers.getDownloaderStringResourceIDFromState(i)), R.string.downloader_Retry, R.string.downloader_Quit); - } - } catch (Exception unused) { - this.isFirstTime3GCheck = false; - logError(".............................error at 3G check............................."); - showMessage(getString(Helpers.getDownloaderStringResourceIDFromState(i)), R.string.downloader_Retry, R.string.downloader_Quit); - } - this.mProgressBar.setIndeterminate(z); - break; - case 12: - case 14: - log("............................STATE_PAUSED_ROAMING/STATE_PAUSED_SDCARD_UNAVAILABLE.............................."); - showMessage(getString(Helpers.getDownloaderStringResourceIDFromState(i)), R.string.downloader_Retry, R.string.downloader_Quit); - this.mProgressBar.setIndeterminate(z); - break; - case 15: - log(".............................License check failed............................."); - showMessage(getString(R.string.license_failed), R.string.downloader_Retry, R.string.downloader_Quit); - this.mProgressBar.setIndeterminate(z); - break; - case 16: - case 18: - case 19: - log(".............................STATE_FAILED............................."); - showMessage(getString(Helpers.getDownloaderStringResourceIDFromState(i)), R.string.downloader_Retry, R.string.downloader_Quit); - this.mProgressBar.setIndeterminate(z); - break; - } - } - } - - @Override // com.google.android.vending.expansion.downloader.IDownloaderClient - public void onServiceConnected(Messenger messenger) { - this.mRemoteService = DownloaderServiceMarshaller.CreateProxy(messenger); - this.mRemoteService.onClientUpdated(this.mDownloaderClientStub.getMessenger()); - log("............................. onServiceConnected! ............................."); - } - - boolean expansionFilesDelivered(boolean z) { - String expansionAPKFileName = Helpers.getExpansionAPKFileName(this, z, getVersionCode()); - log("expansionFilesDelivered ... " + expansionAPKFileName + "............................."); - long j = 0; - try { - InputStream open = getResources().getAssets().open("obb.size"); - if (open != null) { - try { - j = Long.parseLong(new BufferedReader(new InputStreamReader(open)).readLine()); - } catch (NumberFormatException e) { - logError(e.getMessage()); - } - open.close(); - } - } catch (IOException e2) { - logError(e2.getMessage()); - } - log("checking file " + expansionAPKFileName + " of expected size bytes " + Long.toString(j)); - if (!Helpers.doesFileExist(this, expansionAPKFileName, j, false)) { - log("file " + expansionAPKFileName + "of expected size bytes " + j + "was NOT FOUND"); - return false; - } - log("EXPANSION FILE DELIVERED!"); - return true; - } - - private void startDownload() { - try { - Intent intent = new Intent(this, (Class) ObbActivity.class); - intent.setFlags(335544320); - if (DownloaderClientMarshaller.startDownloadServiceIfRequired(this, PendingIntent.getActivity(this, 0, intent, 134217728), (Class) DownloaderService.class) != 0) { - log(".............................Should start downloading!............................."); - this.mIsDownloading = true; - setRequestedOrientation(0); - return; - } - log(".............................No download required!............................."); - } catch (PackageManager.NameNotFoundException e) { - logError(".............................Cannot find package " + e.toString()); - } - } - - public void showMessage(String str, int i, int i2) { - if (!this.mShowingMessage) { - this.mMessageView.setVisibility(0); - this.mProgressView.setVisibility(8); - log("SHOW MESSAGE " + str + " b1: " + i + " b2: " + i2); - this.mShowingMessage = true; - } - this.mMessageText.setText(str); - this.mOK.setText(i); - this.mCancel.setText(i2); - } - - public void hideMessage() { - if (this.mShowingMessage) { - this.mMessageView.setVisibility(8); - this.mProgressView.setVisibility(0); - this.mShowingMessage = false; - } - } - - public int getVersionCode() { - try { - return getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; - } catch (PackageManager.NameNotFoundException unused) { - logError(".............................Cannot read value in manifest. Expected android:versionCode............................."); - return 0; - } - } - - public void disablePauseButton() { - this.mPause.setClickable(false); - } - - @TargetApi(18) - private void setupSystemUiVisibility() { - if (isAtLeastAPI(19)) { - getWindow().addFlags(33554432); - getWindow().addFlags(134217728); - } - if (isAtLeastAPI(14)) { - getWindow().getDecorView().setOnSystemUiVisibilityChangeListener(new View.OnSystemUiVisibilityChangeListener() { // from class: com.ea.ironmonkey.ObbActivity.5 - @Override // android.view.View.OnSystemUiVisibilityChangeListener - public void onSystemUiVisibilityChange(int i) { - if (ObbActivity.this.mhasFocus) { - ObbActivity.this.onSystemUiVisibilityChanged(); - } - } - }); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void onSystemUiVisibilityChanged() { - ((LinearLayout) findViewById(R.id.OBBLayout)).postDelayed(this.HideSystemKeys, 1000L); - } - - public boolean isAtLeastAPI(int i) { - return Build.VERSION.SDK_INT >= i; - } - - @Override // android.app.Activity, android.view.Window.Callback - public void onWindowFocusChanged(boolean z) { - log("................onWindowFocusChanged to ............." + z); - super.onWindowFocusChanged(z); - this.mhasFocus = z; - if (this.mhasFocus) { - onSystemUiVisibilityChanged(); - } - } -} diff --git a/app/src/main/java/com/ea/ironmonkey/ObbHelper.java b/app/src/main/java/com/ea/ironmonkey/ObbHelper.java index d70e465..5a9c4c9 100644 --- a/app/src/main/java/com/ea/ironmonkey/ObbHelper.java +++ b/app/src/main/java/com/ea/ironmonkey/ObbHelper.java @@ -1,7 +1,6 @@ package com.ea.ironmonkey; import android.content.Context; -import com.google.android.vending.expansion.downloader.Helpers; /* loaded from: classes.dex */ class ObbHelper { @@ -9,6 +8,6 @@ class ObbHelper { } public static String getObbFileName(Context context, int i) { - return Helpers.getExpansionAPKFileName(context, true, i); + return "main." + i + "." + context.getPackageName() + ".obb"; } } diff --git a/app/src/main/java/com/ea/ironmonkey/PermissionsActivity.java b/app/src/main/java/com/ea/ironmonkey/PermissionsActivity.java index fe396a0..dd171d5 100644 --- a/app/src/main/java/com/ea/ironmonkey/PermissionsActivity.java +++ b/app/src/main/java/com/ea/ironmonkey/PermissionsActivity.java @@ -1,44 +1,39 @@ package com.ea.ironmonkey; +import static android.os.Build.VERSION_CODES.R; + import android.app.Activity; import android.app.AlertDialog; +import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.net.Uri; import android.os.Build; import android.os.Bundle; -import android.support.v4.app.ActivityCompat; -import android.support.v4.content.ContextCompat; import android.view.KeyEvent; -import com.ea.games.nfs13_row.R; + +import androidx.core.app.ActivityCompat; +import androidx.core.content.ContextCompat; /* loaded from: classes.dex */ public class PermissionsActivity extends Activity { private static final int PERMISSIONS_REQUEST = 3; protected void onCreate() { - if (Build.VERSION.SDK_INT >= 23) { - checkPermissions(); - } else { - initActivity(); - } + checkPermissions(); } public void checkPermissions() { - if (Build.VERSION.SDK_INT >= 23) { - if (ContextCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE") != 0) { - if (ActivityCompat.shouldShowRequestPermissionRationale(this, "android.permission.WRITE_EXTERNAL_STORAGE")) { - showPermissionDialog(false); - return; - } else { - requestSecurityPermissions(); - return; - } + if (ContextCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE") != 0) { + if (ActivityCompat.shouldShowRequestPermissionRationale(this, "android.permission.WRITE_EXTERNAL_STORAGE")) { + showPermissionDialog(false); + } else { + requestSecurityPermissions(); } - initActivity(); return; } initActivity(); + return; } @Override // android.app.Activity @@ -54,50 +49,41 @@ public class PermissionsActivity extends Activity { } private void showPermissionDialog(final boolean z) { + Context context = this; runOnUiThread(new Runnable() { // from class: com.ea.ironmonkey.PermissionsActivity.1 @Override // java.lang.Runnable public void run() { - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setMessage(R.string.STR_PERMISSION_TEXT); - builder.setPositiveButton(R.string.STR_PERMISSION_OK, new DialogInterface.OnClickListener() { // from class: com.ea.ironmonkey.PermissionsActivity.1.1 - @Override // android.content.DialogInterface.OnClickListener - public void onClick(DialogInterface dialogInterface, int i) { - if (!z) { - PermissionsActivity.this.requestSecurityPermissions(); - return; - } - Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS", Uri.parse("package:" + PermissionsActivity.this.getPackageName())); - intent.addFlags(8388608); - PermissionsActivity.this.startActivityForResult(intent, 3); - } - }); - builder.setNegativeButton(R.string.STR_PERMISSION_CANCEL, new DialogInterface.OnClickListener() { // from class: com.ea.ironmonkey.PermissionsActivity.1.2 - @Override // android.content.DialogInterface.OnClickListener - public void onClick(DialogInterface dialogInterface, int i) { - PermissionsActivity.this.finish(); + AlertDialog.Builder builder = new AlertDialog.Builder(context); + builder.setMessage("DIALOG"); + builder.setPositiveButton("OK", (dialogInterface, i) -> { + if (!z) { + PermissionsActivity.this.requestSecurityPermissions(); + return; } + Intent intent = new Intent("android.settings.APPLICATION_DETAILS_SETTINGS", Uri.parse("package:" + PermissionsActivity.this.getPackageName())); + + PermissionsActivity.this.startActivityForResult(intent, 3); }); + + builder.setNegativeButton("DIALOG", (dialogInterface, i) -> PermissionsActivity.this.finish()); AlertDialog create = builder.create(); create.setCanceledOnTouchOutside(false); - create.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.ea.ironmonkey.PermissionsActivity.1.3 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - if (i != 4) { - return true; - } - PermissionsActivity.this.finish(); - dialogInterface.dismiss(); + create.setOnKeyListener((dialogInterface, i, keyEvent) -> { + if (i != 4) { return true; } + PermissionsActivity.this.finish(); + dialogInterface.dismiss(); + return true; }); create.show(); } }); } - /* JADX INFO: Access modifiers changed from: private */ public void requestSecurityPermissions() { ActivityCompat.requestPermissions(this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, 3); + ActivityCompat.requestPermissions(this, new String[]{"android.permission.READ_EXTERNAL_STORAGE"}, 3); } @Override // android.app.Activity @@ -110,7 +96,9 @@ public class PermissionsActivity extends Activity { public void onActivityResult(int i, int i2, Intent intent) { super.onActivityResult(i, i2, intent); if (i == 3) { - if (ContextCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE") == 0) { + if (ContextCompat.checkSelfPermission(this, "android.permission.WRITE_EXTERNAL_STORAGE") == 0 + && ContextCompat.checkSelfPermission(this, "android.permission.READ_EXTERNAL_STORAGE") == 0 + ) { initActivity(); return; } else { @@ -123,7 +111,7 @@ public class PermissionsActivity extends Activity { private void initActivity() { try { - startActivity(new Intent(this, (Class) ObbActivity.class)); + startActivity(new Intent(this, GameActivityMain.class)); finish(); } catch (Exception e) { e.printStackTrace(); diff --git a/app/src/main/java/com/ea/ironmonkey/SkuConfig.java b/app/src/main/java/com/ea/ironmonkey/SkuConfig.java deleted file mode 100644 index a129ca6..0000000 --- a/app/src/main/java/com/ea/ironmonkey/SkuConfig.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.ea.ironmonkey; - -/* loaded from: classes.dex */ -public class SkuConfig { - public static final String NA_BASE64_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsPSqZyfa7iZ9DOslXqDVPiyjsIjCCCDsp1x4pcuH9gFiivyVWhIAHrfMdLlg+6UmlbUoSyKwNRUKJA+H5N/L792/PewpOe2yXSvsqtdROJ12O34q8DPC2D7ezL8M/Io3bp9x18u/D5lf2PEQq4uBNEV1W1iK3PtsdWdpmNKMvnPDQXT3vciWdKa1R0g2xRHCXEK2Ft1Tlkx38ejAAmYvpvoP2e8IqnlwH2fz89G5nxnKdmGop1mz4KTZ8REmBCnmTb07fRkSd4N7S64W2zu8lktMUUbGvCmRbt4zE48AzXEWmyHNW+mqx+IUKyK5wHObnDM9RSwKLWsDe++rrGgROQIDAQAB"; - public static final String ROW_BASE64_PUBLIC_KEY = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjDe1oWKcLp/Rtm1ezKa9G+fHdqKvWExNR1aYuudU5VGX9gTby6w8UPKLHXeWxuOq2mS2hWxjIXVsOanspXWJbnBaqydpXmNz+0qZ0K6VlEiL7YvVL9KHNpVAck1bz4toLrmrjM6E/RyphBl+3W5+XSGOJ4Z3dabuz/TQdgNlYAr9nd1NlLg8S2Pu1FsFygy79kpwKBDZFUiCTDwzmGgLSetFnOfr0NwC+NnF/bEB6gE3REcdtT0zyFj0SR8ZWIKRvRPu5BYXe9nKguLN0AUvshXm/MjhrxKmRWTjTTKZkax+f3zFut/yq8UDxMwGA15Ex60xkCcELgCcNPBrWdFDtQIDAQAB"; - public static final byte[] SALT = {13, -1, 23, -45, 11, -28, 56, -1, -14, 24, -12, 98, -13, 49, 11, 15, -27, 93, 86, -24}; -} diff --git a/app/src/main/java/com/ea/ironmonkey/SplashScreen.java b/app/src/main/java/com/ea/ironmonkey/SplashScreen.java index a171aea..289367b 100644 --- a/app/src/main/java/com/ea/ironmonkey/SplashScreen.java +++ b/app/src/main/java/com/ea/ironmonkey/SplashScreen.java @@ -5,6 +5,9 @@ import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.opengl.GLES20; import android.opengl.GLUtils; + +import java.io.IOException; +import java.io.InputStream; import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; @@ -14,7 +17,6 @@ import javax.microedition.khronos.opengles.GL10; /* loaded from: classes.dex */ public class SplashScreen { private static final String TAG = "SplashScreen"; - private static final int floatSize = 4; private Activity _activity; private int _attPosition; private int _attSampler; @@ -23,149 +25,231 @@ public class SplashScreen { private int _program; private int _vertexShader; private FloatBuffer vBuffer; - private final String vShaderStr = "attribute vec4 a_position; \nattribute vec4 a_texCoord; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_Position = a_position; \n v_texCoord = a_texCoord.xy; \n} \n"; - private final String fShaderStr = "precision highp float; \nvarying vec2 v_texCoord; \nuniform sampler2D s_texture; \nvoid main() \n{ \n gl_FragColor = texture2D( s_texture, v_texCoord );\n} \n"; + + // Вершинный шейдер + private final String vShaderStr = + "attribute vec4 a_position; \n" + + "attribute vec2 a_texCoord; \n" + + "varying vec2 v_texCoord; \n" + + "void main() { \n" + + " gl_Position = a_position; \n" + + " v_texCoord = a_texCoord; \n" + + "} \n"; + + // Фрагментный шейдер + private final String fShaderStr = + "precision mediump float; \n" + + "varying vec2 v_texCoord; \n" + + "uniform sampler2D s_texture; \n" + + "void main() { \n" + + " gl_FragColor = texture2D(s_texture, v_texCoord); \n" + + "} \n"; + private int[] _textureId = new int[1]; public SplashScreen(Activity activity) { this._activity = activity; } - public void init(GL10 gl10, int i, int i2) { - Bitmap bitmap; + public void init(GL10 gl10, int width, int height) { if (!initRenderer()) { destroy(gl10); return; } - GLES20.glGetError(); - GLES20.glGenTextures(1, this._textureId, 0); - GLES20.glBindTexture(3553, this._textureId[0]); - BitmapFactory.Options options = new BitmapFactory.Options(); - options.inPreferredConfig = Bitmap.Config.ARGB_4444; + + // Загрузка текстуры + GLES20.glGenTextures(1, _textureId, 0); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, _textureId[0]); + + // Установка параметров текстуры + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); + + // Загрузка изображения + Bitmap bitmap = null; try { - bitmap = BitmapFactory.decodeStream(this._activity.getAssets().open("splash.png"), null, options); - } catch (Exception e) { - Log.e(TAG, "loadBitmap ", e); - bitmap = null; + InputStream is = _activity.getAssets().open("splash.png"); + bitmap = BitmapFactory.decodeStream(is); + } catch (IOException e) { + Log.e(TAG, "Could not load bitmap", e); } - GLUtils.texImage2D(3553, 0, bitmap, 0); - GLES20.glTexParameterf(3553, 10241, 9729.0f); - GLES20.glTexParameterf(3553, 10240, 9729.0f); - GLES20.glTexParameterf(3553, 10242, 33071.0f); - GLES20.glTexParameterf(3553, 10243, 33071.0f); - bitmap.recycle(); - int glGetError = GLES20.glGetError(); - if (glGetError != 0) { - Log.e(TAG, "Texture Load GLError: " + glGetError); + + if (bitmap != null) { + GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); + bitmap.recycle(); + } else { + Log.e(TAG, "Failed to load bitmap"); + destroy(gl10); + return; + } + + // Проверка ошибок + int error = GLES20.glGetError(); + if (error != GLES20.GL_NO_ERROR) { + Log.e(TAG, "Texture Load GLError: " + error); destroy(gl10); } } private boolean initRenderer() { - this._vertexShader = LoadShader(35633, "attribute vec4 a_position; \nattribute vec4 a_texCoord; \nvarying vec2 v_texCoord; \nvoid main() \n{ \n gl_Position = a_position; \n v_texCoord = a_texCoord.xy; \n} \n"); - this._fragmentShader = LoadShader(35632, "precision highp float; \nvarying vec2 v_texCoord; \nuniform sampler2D s_texture; \nvoid main() \n{ \n gl_FragColor = texture2D( s_texture, v_texCoord );\n} \n"); - this._program = GLES20.glCreateProgram(); - if (this._program == 0 || this._vertexShader == 0 || this._fragmentShader == 0) { - Log.e(TAG, "InitRender() - fail\n"); + // Загрузка шейдеров + _vertexShader = loadShader(GLES20.GL_VERTEX_SHADER, vShaderStr); + _fragmentShader = loadShader(GLES20.GL_FRAGMENT_SHADER, fShaderStr); + + // Создание программы + _program = GLES20.glCreateProgram(); + if (_program == 0) { + Log.e(TAG, "Failed to create program"); return false; } - GLES20.glAttachShader(this._program, this._vertexShader); - GLES20.glAttachShader(this._program, this._fragmentShader); - GLES20.glLinkProgram(this._program); - int[] iArr = new int[1]; - GLES20.glGetProgramiv(this._program, 35714, iArr, 0); - if (iArr[0] == 0) { - Log.e(TAG, "InitRender() - fail link program"); - Log.e(TAG, GLES20.glGetProgramInfoLog(this._program)); - GLES20.glDeleteProgram(this._program); - this._program = 0; + + // Прикрепление шейдеров + GLES20.glAttachShader(_program, _vertexShader); + GLES20.glAttachShader(_program, _fragmentShader); + + // Линковка программы + GLES20.glLinkProgram(_program); + + // Проверка статуса линковки + int[] linkStatus = new int[1]; + GLES20.glGetProgramiv(_program, GLES20.GL_LINK_STATUS, linkStatus, 0); + if (linkStatus[0] != GLES20.GL_TRUE) { + Log.e(TAG, "Could not link program: " + GLES20.glGetProgramInfoLog(_program)); + GLES20.glDeleteProgram(_program); + _program = 0; return false; } - this._attPosition = GLES20.glGetAttribLocation(this._program, "a_position"); - this._attTexCoord = GLES20.glGetAttribLocation(this._program, "a_texCoord"); - this._attSampler = GLES20.glGetAttribLocation(this._program, "s_texture"); + + // Получение атрибутов + _attPosition = GLES20.glGetAttribLocation(_program, "a_position"); + _attTexCoord = GLES20.glGetAttribLocation(_program, "a_texCoord"); + _attSampler = GLES20.glGetUniformLocation(_program, "s_texture"); + return true; } - private int LoadShader(int i, String str) { - int glCreateShader = GLES20.glCreateShader(i); - if (glCreateShader == 0) { - Log.e(TAG, "LoadShader(" + i + ", " + str + " - create shader fail\n"); + private int loadShader(int type, String shaderCode) { + int shader = GLES20.glCreateShader(type); + if (shader == 0) { + Log.e(TAG, "Failed to create shader"); return 0; } - GLES20.glShaderSource(glCreateShader, str); - GLES20.glCompileShader(glCreateShader); - int[] iArr = new int[1]; - GLES20.glGetShaderiv(glCreateShader, 35713, iArr, 0); - if (iArr[0] != 0) { - return glCreateShader; + + GLES20.glShaderSource(shader, shaderCode); + GLES20.glCompileShader(shader); + + // Проверка статуса компиляции + int[] compiled = new int[1]; + GLES20.glGetShaderiv(shader, GLES20.GL_COMPILE_STATUS, compiled, 0); + if (compiled[0] == 0) { + Log.e(TAG, "Could not compile shader: " + GLES20.glGetShaderInfoLog(shader)); + GLES20.glDeleteShader(shader); + return 0; } - Log.e(TAG, "LoadShader(" + i + ", " + str + ") - compile shader fail\n"); - GLES20.glDeleteShader(glCreateShader); - Log.e(TAG, GLES20.glGetShaderInfoLog(glCreateShader)); - return 0; + + return shader; } - public boolean draw(GL10 gl10, int i, int i2) { - float f; - if (this._textureId[0] == 0) { + public boolean draw(GL10 gl10, int width, int height) { + if (_textureId[0] == 0 || _program == 0) { return false; } - float f2 = 0.8f; - if (i > i2) { - f2 = (i2 / i) * 0.8f; - f = 0.8f; + + // Расчет координат с уменьшением на 20% + float ratio = (float) width / height; + float imageRatio = 1.0f; // Предполагаем квадратное изображение + + float scaleX, scaleY; + if (ratio > imageRatio) { + // Шире, чем изображение + scaleY = 0.8f; // Уменьшаем на 20% + scaleX = imageRatio / ratio * 0.8f; } else { - f = (i / i2) * 0.8f; + // Уже, чем изображение + scaleX = 0.8f; // Уменьшаем на 20% + scaleY = ratio / imageRatio * 0.8f; } - float f3 = -f2; - float f4 = -f; - float[][] fArr = {new float[]{f3, f4, 0.0f, 1.0f, f2, f4, 1.0f, 1.0f, f3, f, 0.0f, 0.0f, f2, f, 1.0f, 0.0f}, new float[]{f3, f4, 1.0f, 1.0f, f2, f4, 1.0f, 0.0f, f3, f, 0.0f, 1.0f, f2, f, 0.0f, 0.0f}}; - this.vBuffer = ByteBuffer.allocateDirect(fArr[0].length * 4).order(ByteOrder.nativeOrder()).asFloatBuffer(); - if (i < i2) { - this.vBuffer.put(fArr[1]); - } else { - this.vBuffer.put(fArr[0]); - } - GLES20.glViewport(0, 0, i, i2); - GLES20.glUseProgram(this._program); - GLES20.glEnable(3553); - GLES20.glActiveTexture(33984); - GLES20.glBindTexture(3553, this._textureId[0]); - GLES20.glUniform1i(this._attSampler, 0); - this.vBuffer.position(0); - GLES20.glVertexAttribPointer(this._attPosition, 2, 5126, false, 16, (Buffer) this.vBuffer); - GLES20.glEnableVertexAttribArray(this._attPosition); - this.vBuffer.position(2); - GLES20.glVertexAttribPointer(this._attTexCoord, 2, 5126, false, 16, (Buffer) this.vBuffer); - GLES20.glEnableVertexAttribArray(this._attTexCoord); - GLES20.glDrawArrays(5, 0, 4); - GLES20.glDisableVertexAttribArray(this._attPosition); - GLES20.glDisableVertexAttribArray(this._attTexCoord); - GLES20.glUseProgram(0); + + // Координаты вершин и текстур + float[] vertices = { + -scaleX, -scaleY, 0.0f, // нижний левый + scaleX, -scaleY, 0.0f, // нижний правый + -scaleX, scaleY, 0.0f, // верхний левый + scaleX, scaleY, 0.0f // верхний правый + }; + + float[] texCoords = { + 0.0f, 1.0f, // нижний левый + 1.0f, 1.0f, // нижний правый + 0.0f, 0.0f, // верхний левый + 1.0f, 0.0f // верхний правый + }; + + // Создание буферов + ByteBuffer bb = ByteBuffer.allocateDirect(vertices.length * 4); + bb.order(ByteOrder.nativeOrder()); + FloatBuffer vertexBuffer = bb.asFloatBuffer(); + vertexBuffer.put(vertices); + vertexBuffer.position(0); + + bb = ByteBuffer.allocateDirect(texCoords.length * 4); + bb.order(ByteOrder.nativeOrder()); + FloatBuffer texBuffer = bb.asFloatBuffer(); + texBuffer.put(texCoords); + texBuffer.position(0); + + // Отрисовка с белым фоном + GLES20.glViewport(0, 0, width, height); + GLES20.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); // Белый цвет + GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); + + GLES20.glUseProgram(_program); + + // Передача вершин + GLES20.glVertexAttribPointer(_attPosition, 3, GLES20.GL_FLOAT, false, 0, vertexBuffer); + GLES20.glEnableVertexAttribArray(_attPosition); + + // Передача текстурных координат + GLES20.glVertexAttribPointer(_attTexCoord, 2, GLES20.GL_FLOAT, false, 0, texBuffer); + GLES20.glEnableVertexAttribArray(_attTexCoord); + + // Активация текстуры + GLES20.glActiveTexture(GLES20.GL_TEXTURE0); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, _textureId[0]); + GLES20.glUniform1i(_attSampler, 0); + + // Отрисовка + GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4); + + // Отключение атрибутов + GLES20.glDisableVertexAttribArray(_attPosition); + GLES20.glDisableVertexAttribArray(_attTexCoord); + return true; } public void destroy(GL10 gl10) { - if (this._textureId[0] != 0) { - GLES20.glDeleteTextures(1, this._textureId, 0); - this._textureId[0] = 0; + if (_textureId[0] != 0) { + GLES20.glDeleteTextures(1, _textureId, 0); + _textureId[0] = 0; } - if (this._program != 0) { - GLES20.glDeleteProgram(this._program); - this._program = 0; + if (_program != 0) { + GLES20.glDeleteProgram(_program); + _program = 0; } - if (this._vertexShader != 0) { - GLES20.glDeleteShader(this._vertexShader); - this._vertexShader = 0; + if (_vertexShader != 0) { + GLES20.glDeleteShader(_vertexShader); + _vertexShader = 0; } - if (this._fragmentShader != 0) { - GLES20.glDeleteShader(this._fragmentShader); - this._fragmentShader = 0; + if (_fragmentShader != 0) { + GLES20.glDeleteShader(_fragmentShader); + _fragmentShader = 0; } - if (this.vBuffer != null) { - this.vBuffer.clear(); - this.vBuffer = null; + if (vBuffer != null) { + vBuffer.clear(); + vBuffer = null; } } } diff --git a/app/src/main/java/com/ea/ironmonkey/WebActivity.java b/app/src/main/java/com/ea/ironmonkey/WebActivity.java deleted file mode 100644 index 3f24d6b..0000000 --- a/app/src/main/java/com/ea/ironmonkey/WebActivity.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.ea.ironmonkey; - -import android.app.Activity; -import android.content.res.Configuration; -import android.content.res.Resources; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.os.Bundle; -import android.os.Handler; -import android.os.Message; -import android.view.KeyEvent; -import android.view.MotionEvent; -import android.view.View; -import android.webkit.WebChromeClient; -import android.webkit.WebView; -import android.webkit.WebViewClient; -import android.widget.ImageView; -import android.widget.ProgressBar; -import android.widget.TextView; -import android.widget.Toast; -import com.ea.games.nfs13_row.R; -import java.util.Locale; - -/* loaded from: classes.dex */ -public class WebActivity extends Activity { - public static String m_Language; - private static volatile Runnable m_RunnableBuildAndShowHTML; - public static String m_URL; - public static boolean m_bWorkingState; - private Bitmap backButton; - private Bitmap backButtonPressed; - private ImageView backImage; - private String m_PageURL = null; - private ProgressBar m_progressBar = null; - final Handler progressHandler = new Handler() { // from class: com.ea.ironmonkey.WebActivity.1 - @Override // android.os.Handler - public void handleMessage(Message message) { - WebActivity.this.setProgress(message.arg1); - WebActivity.this.m_progressBar.setProgress(message.arg1); - } - }; - private WebView webview; - - @Override // android.app.Activity - public void onCreate(Bundle bundle) { - m_bWorkingState = true; - super.onCreate(bundle); - requestWindowFeature(2); - getWindow().setFlags(1024, 1024); - setRequestedOrientation(0); - requestWindowFeature(1); - setProgressBarVisibility(true); - setContentView(R.layout.webview); - this.webview = (WebView) findViewById(R.id.mainWebView); - this.webview.getSettings().setJavaScriptEnabled(true); - this.m_progressBar = (ProgressBar) findViewById(R.id.progressBarWeb); - this.backButton = BitmapFactory.decodeResource(getResources(), R.drawable.btn_back); - this.backButtonPressed = BitmapFactory.decodeResource(getResources(), R.drawable.btn_back_pressed); - this.backImage = (ImageView) findViewById(R.id.backButton); - this.backImage.setOnTouchListener(new View.OnTouchListener() { // from class: com.ea.ironmonkey.WebActivity.2 - @Override // android.view.View.OnTouchListener - public boolean onTouch(View view, MotionEvent motionEvent) { - if (motionEvent.getAction() == 0) { - WebActivity.this.backImage.setImageBitmap(WebActivity.this.backButtonPressed); - return false; - } - if (motionEvent.getAction() != 1) { - return false; - } - WebActivity.this.backImage.setImageBitmap(WebActivity.this.backButton); - return false; - } - }); - this.backImage.setOnClickListener(new View.OnClickListener() { // from class: com.ea.ironmonkey.WebActivity.3 - @Override // android.view.View.OnClickListener - public void onClick(View view) { - WebActivity.m_bWorkingState = false; - WebActivity.this.finish(); - } - }); - Bundle extras = getIntent().getExtras(); - String string = extras.getString("URL"); - this.m_PageURL = string; - m_URL = string; - String string2 = extras.getString("Language"); - m_Language = string2; - if (string2 != null) { - try { - Configuration configuration = new Configuration(getResources().getConfiguration()); - configuration.locale = new Locale(string2); - ((TextView) findViewById(R.id.appName)).setText(new Resources(getResources().getAssets(), getResources().getDisplayMetrics(), configuration).getString(R.string.app_full_name)); - } catch (Throwable unused) { - } - } - this.webview.setWebChromeClient(new WebChromeClient() { // from class: com.ea.ironmonkey.WebActivity.4 - @Override // android.webkit.WebChromeClient - public void onProgressChanged(WebView webView, int i) { - Message obtainMessage = WebActivity.this.progressHandler.obtainMessage(); - obtainMessage.arg1 = i; - WebActivity.this.progressHandler.sendMessage(obtainMessage); - } - }); - this.webview.setWebViewClient(new WebViewClient() { // from class: com.ea.ironmonkey.WebActivity.5 - @Override // android.webkit.WebViewClient - public void onPageFinished(WebView webView, String str) { - WebActivity.this.m_progressBar.setVisibility(8); - } - - @Override // android.webkit.WebViewClient - public void onReceivedError(WebView webView, int i, String str, String str2) { - Toast.makeText(WebActivity.this, "Error ! " + str, 0).show(); - } - }); - m_RunnableBuildAndShowHTML = new Runnable() { // from class: com.ea.ironmonkey.WebActivity.6 - @Override // java.lang.Runnable - public void run() { - WebActivity.this.BuildAndShowHTML(); - } - }; - runOnUiThread(m_RunnableBuildAndShowHTML); - } - - /* JADX INFO: Access modifiers changed from: private */ - public void BuildAndShowHTML() { - if (this.m_PageURL != null) { - this.webview.loadUrl(this.m_PageURL); - } - } - - @Override // android.app.Activity, android.view.KeyEvent.Callback - public boolean onKeyDown(int i, KeyEvent keyEvent) { - if (i == 4) { - this.backImage.setImageBitmap(this.backButtonPressed); - return true; - } - return super.onKeyDown(i, keyEvent); - } - - @Override // android.app.Activity, android.view.KeyEvent.Callback - public boolean onKeyUp(int i, KeyEvent keyEvent) { - if (i == 4) { - this.backImage.setImageBitmap(this.backButton); - m_bWorkingState = false; - finish(); - return true; - } - return super.onKeyUp(i, keyEvent); - } -} diff --git a/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java b/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java index 81507d1..6f04e96 100644 --- a/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java +++ b/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java @@ -53,7 +53,6 @@ public class ApplicationEnvironmentImpl extends Component implements IApplicatio private String m_packageId; private Map m_parameters; private Map m_playerIdMap; - private InstallReferrerClient m_referrerClient; private String m_version; private String m_advertisingId = null; private boolean m_limitAdTrackingEnabled = true; @@ -108,14 +107,7 @@ public class ApplicationEnvironmentImpl extends Component implements IApplicatio hashMap.put(ApplicationEnvironment.NIMBLE_PARAMETER_DEVICE_LOCALE, Utility.safeString(Locale.getDefault().toString())); hashMap.put(ApplicationEnvironment.NIMBLE_PARAMETER_COUNTRY_CODE, Utility.safeString(Locale.getDefault().getCountry())); PackageManager packageManager = this.m_context.getPackageManager(); - if (packageManager != null && packageManager.checkPermission("android.permission.READ_PHONE_STATE", this.m_context.getPackageName()) == 0) { - TelephonyManager telephonyManager = (TelephonyManager) this.m_context.getSystemService(PlaceFields.PHONE); - if (telephonyManager != null) { - hashMap.put(ApplicationEnvironment.NIMBLE_PARAMETER_IMEI, Utility.safeString(telephonyManager.getDeviceId())); - } else { - Log.Helper.LOGE(this, "Could not retrieve telephony service", new Object[0]); - } - } + hashMap.put(ApplicationEnvironment.NIMBLE_PARAMETER_IMEI, ""); try { Cursor query = this.m_context.getContentResolver().query(Uri.parse("content://com.facebook.katana.provider.AttributionIdProvider"), null, null, null, null); if (query != null) { @@ -341,16 +333,6 @@ public class ApplicationEnvironmentImpl extends Component implements IApplicatio @Override // com.ea.nimble.IApplicationEnvironment public String getCarrier() { - Log.Helper.LOGPUBLICFUNC(this); - Context applicationContext = getApplicationContext(); - if (applicationContext == null) { - return null; - } - TelephonyManager telephonyManager = (TelephonyManager) applicationContext.getSystemService(PlaceFields.PHONE); - if (telephonyManager != null) { - return telephonyManager.getNetworkOperator(); - } - Log.Helper.LOGE(this, "Could not retrieve telephony service", new Object[0]); return null; } @@ -419,23 +401,7 @@ public class ApplicationEnvironmentImpl extends Component implements IApplicatio @Override // com.ea.nimble.IApplicationEnvironment public String getGoogleEmail() { - Log.Helper.LOGPUBLICFUNC(this); - AccountManager accountManager = AccountManager.get(getApplicationContext()); - if (accountManager == null) { - Log.Helper.LOGE(this, "Could not get Account Manager", new Object[0]); - return null; - } - Account[] accountsByType = accountManager.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE); - if (accountsByType.length > 0) { - return accountsByType[0].name; - } - Pattern pattern = Patterns.EMAIL_ADDRESS; - for (Account account : accountManager.getAccounts()) { - if (pattern.matcher(account.name).matches()) { - return account.name; - } - } - return null; + return "hehe@gmial.com"; } @Override // com.ea.nimble.IApplicationEnvironment @@ -517,32 +483,7 @@ public class ApplicationEnvironmentImpl extends Component implements IApplicatio SynergyNetworkConnectionCallback synergyNetworkConnectionCallback = new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.ApplicationEnvironmentImpl.3 @Override // com.ea.nimble.SynergyNetworkConnectionCallback public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - HashMap hashMap = new HashMap(); - if (synergyNetworkConnectionHandle.getResponse().getError() == null) { - Map jsonData = synergyNetworkConnectionHandle.getResponse().getJsonData(); - Integer num = (Integer) jsonData.get("code"); - if (num != null && num.intValue() > 0) { - String str = (String) jsonData.get(ShareConstants.WEB_DIALOG_PARAM_MESSAGE); - Log.Helper.LOGD(this, "LOG_CALLBACK_ERROR : %s", str); - hashMap.put(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, "0"); - hashMap.put("error", new Exception(str)); - } else { - int intValue = ((Integer) ((Map) jsonData.get("agerequirements")).get("minLegalRegAge")).intValue(); - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(ApplicationEnvironment.COMPONENT_ID, Persistence.Storage.CACHE); - if (persistenceForNimbleComponent != null) { - persistenceForNimbleComponent.setValue(ApplicationEnvironmentImpl.PERSISTENCE_TIME_RETRIEVED, Long.valueOf(new Date().getTime())); - persistenceForNimbleComponent.setValue(ApplicationEnvironmentImpl.PERSISTENCE_AGE_REQUIREMENTS, Integer.valueOf(intValue)); - } else { - Log.Helper.LOGE(this, "Could not get persistence object", new Object[0]); - } - hashMap.put(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, "1"); - } - } else { - Log.Helper.LOGD(this, "LOG_CALLBACK_ERROR : %s", synergyNetworkConnectionHandle.getResponse().getError().getMessage()); - hashMap.put(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, "0"); - hashMap.put("error", synergyNetworkConnectionHandle.getResponse().getError()); - } - Utility.sendBroadcastSerializable(ApplicationEnvironment.NOTIFICATION_AGE_COMPLIANCE_REFRESHED, hashMap); + } }; SynergyNetwork.getComponent().sendRequest(new SynergyRequest(SYNERGY_API_GET_AGE_REQUIREMENTS, IHttpRequest.Method.GET, synergyRequestPreparingCallback), synergyNetworkConnectionCallback); @@ -618,222 +559,6 @@ public class ApplicationEnvironmentImpl extends Component implements IApplicatio private void retrieveAdvertisingIdImpl(IApplicationEnvironment.AdvertisingIdCalback advertisingIdCalback) { Log.Helper.LOGFUNC(this); - try { - Class.forName("com.google.android.gms.common.GooglePlayServicesNotAvailableException"); - synchronized (this) { - if (this.m_advertisingIdCallbacks != null) { - if (advertisingIdCalback != null) { - this.m_advertisingIdCallbacks.add(advertisingIdCalback); - } - return; - } - this.m_advertisingIdCallbacks = new ArrayList(); - if (advertisingIdCalback != null) { - this.m_advertisingIdCallbacks.add(advertisingIdCalback); - } - try { - new Thread(new Runnable() { // from class: com.ea.nimble.ApplicationEnvironmentImpl.4 - @Override // java.lang.Runnable - public void run() { - List list; - List list2; - List list3; - List list4; - List list5; - List list6; - List list7; - ApplicationEnvironmentImpl applicationEnvironmentImpl = ApplicationEnvironmentImpl.this; - Log.Helper.LOGV(applicationEnvironmentImpl, "Running thread to get Google Advertising ID", new Object[0]); - String str = ApplicationEnvironmentImpl.this.m_advertisingId; - boolean z = ApplicationEnvironmentImpl.this.m_limitAdTrackingEnabled; - try { - try { - if (ApplicationEnvironment.getCurrentActivity() != null) { - AdvertisingIdClient.Info advertisingIdInfo = (!ApplicationEnvironment.isMainApplicationRunning() || ApplicationEnvironment.getCurrentActivity() == null) ? null : AdvertisingIdClient.getAdvertisingIdInfo(ApplicationEnvironment.getCurrentActivity()); - if (advertisingIdInfo != null) { - Log.Helper.LOGD(applicationEnvironmentImpl, "Setting values for Google Advertising ID and isLimitAdTrackingEnabled flag", new Object[0]); - String id = advertisingIdInfo.getId(); - try { - z = advertisingIdInfo.isLimitAdTrackingEnabled(); - str = id; - } catch (GooglePlayServicesNotAvailableException unused) { - str = id; - Log.Helper.LOGW(applicationEnvironmentImpl, "Cannot get Google Advertising ID - Google Play Services not available on this device", new Object[0]); - synchronized (applicationEnvironmentImpl) { - list6 = ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks; - ApplicationEnvironmentImpl.this.m_advertisingId = str; - ApplicationEnvironmentImpl.this.m_limitAdTrackingEnabled = z; - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_GAID, Utility.safeString(str)); - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_LIMIT_AD_TRACKING, z ? ServerProtocol.DIALOG_RETURN_SCOPES_TRUE : "false"); - ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks = null; - } - if (list6 != null) { - Iterator it = list6.iterator(); - while (it.hasNext()) { - ((IApplicationEnvironment.AdvertisingIdCalback) it.next()).onCallback(str, z); - } - return; - } - Log.Helper.LOGW(this, "m_advertisingIdCallbacks was null after refreshing advertising ID, something is wrong", new Object[0]); - } catch (GooglePlayServicesRepairableException unused2) { - str = id; - Log.Helper.LOGW(applicationEnvironmentImpl, "Cannot get Google Advertising ID - Recoverable error connecting to Google Play Services", new Object[0]); - synchronized (applicationEnvironmentImpl) { - list5 = ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks; - ApplicationEnvironmentImpl.this.m_advertisingId = str; - ApplicationEnvironmentImpl.this.m_limitAdTrackingEnabled = z; - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_GAID, Utility.safeString(str)); - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_LIMIT_AD_TRACKING, z ? ServerProtocol.DIALOG_RETURN_SCOPES_TRUE : "false"); - ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks = null; - } - if (list5 != null) { - Iterator it2 = list5.iterator(); - while (it2.hasNext()) { - ((IApplicationEnvironment.AdvertisingIdCalback) it2.next()).onCallback(str, z); - } - return; - } - Log.Helper.LOGW(this, "m_advertisingIdCallbacks was null after refreshing advertising ID, something is wrong", new Object[0]); - } catch (IOException unused3) { - str = id; - Log.Helper.LOGW(applicationEnvironmentImpl, "Cannot get Google Advertising ID - Unrecoverable error connecting to Google Play Services", new Object[0]); - synchronized (applicationEnvironmentImpl) { - list4 = ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks; - ApplicationEnvironmentImpl.this.m_advertisingId = str; - ApplicationEnvironmentImpl.this.m_limitAdTrackingEnabled = z; - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_GAID, Utility.safeString(str)); - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_LIMIT_AD_TRACKING, z ? ServerProtocol.DIALOG_RETURN_SCOPES_TRUE : "false"); - ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks = null; - } - if (list4 != null) { - Iterator it3 = list4.iterator(); - while (it3.hasNext()) { - ((IApplicationEnvironment.AdvertisingIdCalback) it3.next()).onCallback(str, z); - } - return; - } - Log.Helper.LOGW(this, "m_advertisingIdCallbacks was null after refreshing advertising ID, something is wrong", new Object[0]); - } catch (IllegalStateException e) { - e = e; - str = id; - Log.Helper.LOGW(applicationEnvironmentImpl, "Cannot get Google Advertising ID - Illegal State Exception " + e.getMessage(), new Object[0]); - synchronized (applicationEnvironmentImpl) { - list3 = ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks; - ApplicationEnvironmentImpl.this.m_advertisingId = str; - ApplicationEnvironmentImpl.this.m_limitAdTrackingEnabled = z; - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_GAID, Utility.safeString(str)); - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_LIMIT_AD_TRACKING, z ? ServerProtocol.DIALOG_RETURN_SCOPES_TRUE : "false"); - ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks = null; - } - if (list3 != null) { - Iterator it4 = list3.iterator(); - while (it4.hasNext()) { - ((IApplicationEnvironment.AdvertisingIdCalback) it4.next()).onCallback(str, z); - } - return; - } - Log.Helper.LOGW(this, "m_advertisingIdCallbacks was null after refreshing advertising ID, something is wrong", new Object[0]); - } catch (Exception e2) { - e = e2; - str = id; - Log.Helper.LOGW(applicationEnvironmentImpl, "Cannot get Google Advertising ID - General Exception " + e.getMessage(), new Object[0]); - synchronized (applicationEnvironmentImpl) { - list2 = ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks; - ApplicationEnvironmentImpl.this.m_advertisingId = str; - ApplicationEnvironmentImpl.this.m_limitAdTrackingEnabled = z; - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_GAID, Utility.safeString(str)); - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_LIMIT_AD_TRACKING, z ? ServerProtocol.DIALOG_RETURN_SCOPES_TRUE : "false"); - ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks = null; - } - if (list2 != null) { - Iterator it5 = list2.iterator(); - while (it5.hasNext()) { - ((IApplicationEnvironment.AdvertisingIdCalback) it5.next()).onCallback(str, z); - } - return; - } - Log.Helper.LOGW(this, "m_advertisingIdCallbacks was null after refreshing advertising ID, something is wrong", new Object[0]); - } catch (Throwable th) { - th = th; - str = id; - synchronized (applicationEnvironmentImpl) { - list = ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks; - ApplicationEnvironmentImpl.this.m_advertisingId = str; - ApplicationEnvironmentImpl.this.m_limitAdTrackingEnabled = z; - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_GAID, Utility.safeString(str)); - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_LIMIT_AD_TRACKING, z ? ServerProtocol.DIALOG_RETURN_SCOPES_TRUE : "false"); - ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks = null; - } - if (list != null) { - Iterator it6 = list.iterator(); - while (it6.hasNext()) { - ((IApplicationEnvironment.AdvertisingIdCalback) it6.next()).onCallback(str, z); - } - } else { - Log.Helper.LOGW(this, "m_advertisingIdCallbacks was null after refreshing advertising ID, something is wrong", new Object[0]); - } - throw th; - } - } else { - Log.Helper.LOGW(applicationEnvironmentImpl, "Cannot get Google Advertising ID - AdvertisingIdInfo is null", new Object[0]); - } - } else { - Log.Helper.LOGW(applicationEnvironmentImpl, "Cannot get Google Advertising ID because there is no current activity", new Object[0]); - } - synchronized (applicationEnvironmentImpl) { - list7 = ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks; - ApplicationEnvironmentImpl.this.m_advertisingId = str; - ApplicationEnvironmentImpl.this.m_limitAdTrackingEnabled = z; - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_GAID, Utility.safeString(str)); - ApplicationEnvironmentImpl.this.m_parameters.put(ApplicationEnvironment.NIMBLE_PARAMETER_LIMIT_AD_TRACKING, z ? ServerProtocol.DIALOG_RETURN_SCOPES_TRUE : "false"); - ApplicationEnvironmentImpl.this.m_advertisingIdCallbacks = null; - } - if (list7 != null) { - Iterator it7 = list7.iterator(); - while (it7.hasNext()) { - ((IApplicationEnvironment.AdvertisingIdCalback) it7.next()).onCallback(str, z); - } - return; - } - } catch (GooglePlayServicesNotAvailableException unused4) { - } catch (GooglePlayServicesRepairableException unused5) { - } catch (IOException unused6) { - } catch (IllegalStateException e3) { - e = e3; - } catch (Exception e4) { - e = e4; - } - Log.Helper.LOGW(this, "m_advertisingIdCallbacks was null after refreshing advertising ID, something is wrong", new Object[0]); - } catch (Throwable th2) { - th = th2; - } - } - }).start(); - } catch (Throwable unused) { - Log.Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID because this device is not supported", new Object[0]); - synchronized (this) { - this.m_advertisingId = ""; - boolean z = this.m_limitAdTrackingEnabled; - List list = this.m_advertisingIdCallbacks; - this.m_advertisingIdCallbacks = null; - if (list == null) { - Log.Helper.LOGW(this, "m_advertisingIdCallbacks was null after trying to refresh advertising ID, something is wrong", new Object[0]); - return; - } - Iterator it = list.iterator(); - while (it.hasNext()) { - it.next().onCallback("", z); - } - } - } - } - } catch (ClassNotFoundException unused2) { - Log.Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID because this device is not using google play services", new Object[0]); - this.m_advertisingId = ""; - if (advertisingIdCalback != null) { - advertisingIdCalback.onCallback(this.m_advertisingId, this.m_limitAdTrackingEnabled); - } - } } @Override // com.ea.nimble.IApplicationEnvironment @@ -904,32 +629,7 @@ public class ApplicationEnvironmentImpl extends Component implements IApplicatio @Override // com.ea.nimble.IApplicationEnvironment public void requestSafetyNetAttestation(byte[] bArr, final IApplicationEnvironment.SafetyNetAttestationCallback safetyNetAttestationCallback) { - Log.Helper.LOGPUBLICFUNC(this); - try { - if (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(getCurrentActivity()) != 0) { - Log.Helper.LOGW(this, "Skipping SafetyNet Attestation as Google Play Services is not available", new Object[0]); - safetyNetAttestationCallback.onCallback(null, new Error(Error.Code.NOT_AVAILABLE, "Google Play Services is not available")); - return; - } - String configValueAsString = NimbleApplicationConfiguration.getConfigValueAsString("com.ea.nimble.safetynet_api_key", null); - if (configValueAsString == null) { - Log.Helper.LOGW(this, "Skipping SafetyNet Attestation since 'com.ea.nimble.safetynet_api_key' was not found in manifest", new Object[0]); - safetyNetAttestationCallback.onCallback(null, new Error(Error.Code.NOT_AVAILABLE, "Safety Net API key not found")); - } else { - SafetyNet.getClient(getCurrentActivity()).attest(bArr, configValueAsString).addOnSuccessListener(getCurrentActivity(), new OnSuccessListener() { // from class: com.ea.nimble.ApplicationEnvironmentImpl.6 - public void onSuccess(SafetyNetApi.AttestationResponse attestationResponse) { - safetyNetAttestationCallback.onCallback(attestationResponse.getJwsResult(), null); - } - }).addOnFailureListener(getCurrentActivity(), new OnFailureListener() { // from class: com.ea.nimble.ApplicationEnvironmentImpl.5 - public void onFailure(@NonNull Exception exc) { - safetyNetAttestationCallback.onCallback(null, new Error(Error.Code.UNKNOWN, String.format("SafetyNet Attest Request failed\nCause:%s", exc.getMessage()), exc)); - } - }); - } - } catch (Exception e) { - Log.Helper.LOGW(this, "Skipping SafetyNet Attestation due to exception\nCause:%s", e.getMessage()); - safetyNetAttestationCallback.onCallback(null, new Error(Error.Code.NOT_AVAILABLE, String.format("Skipping SafetyNet Attestation due to exception\nCause:%s", e.getMessage()), e)); - } + } /* JADX INFO: Access modifiers changed from: private */ @@ -954,128 +654,6 @@ public class ApplicationEnvironmentImpl extends Component implements IApplicatio } }; Utility.registerReceiver(Global.NOTIFICATION_NETWORK_STATUS_CHANGE, this.m_attributionDataNetworkListener); - } else { - try { - this.m_referrerClient = InstallReferrerClient.newBuilder(this.m_context).build(); - this.m_referrerClient.startConnection(new InstallReferrerStateListener() { // from class: com.ea.nimble.ApplicationEnvironmentImpl.8 - /* JADX WARN: Unreachable blocks removed: 2, instructions: 3 */ - /* JADX WARN: Unreachable blocks removed: 2, instructions: 4 */ - @Override // com.android.installreferrer.api.InstallReferrerStateListener - public void onInstallReferrerSetupFinished(int i) { - long j; - String str; - String str2; - String str3; - long j2; - String str4; - long referrerClickTimestampSeconds; - String str5; - long j3; - String str6; - switch (i) { - case 0: - try { - ReferrerDetails installReferrer = ApplicationEnvironmentImpl.this.m_referrerClient.getInstallReferrer(); - String installReferrer2 = installReferrer.getInstallReferrer(); - try { - j = installReferrer.getInstallBeginTimestampSeconds(); - try { - str4 = installReferrer2; - referrerClickTimestampSeconds = installReferrer.getReferrerClickTimestampSeconds(); - str5 = "ok"; - j3 = j; - ApplicationEnvironmentImpl.this.m_referrerClient.endConnection(); - ApplicationEnvironmentImpl.this.m_referrerClient = null; - ApplicationEnvironmentImpl.this.setAttributionData(str5, str4, j3, referrerClickTimestampSeconds); - } catch (Exception e) { - e = e; - j2 = j; - str3 = installReferrer2; - try { - Log.Helper.LOGW(this, "requestAttributionData(): Failed with exception.\n" + e.toString(), new Object[0]); - String exc = e.toString(); - ApplicationEnvironmentImpl.this.m_referrerClient.endConnection(); - ApplicationEnvironmentImpl.this.m_referrerClient = null; - ApplicationEnvironmentImpl.this.setAttributionData(exc, str3, j2, 0L); - return; - } catch (Throwable th) { - th = th; - str = "ok"; - str2 = str3; - j = j2; - ApplicationEnvironmentImpl.this.m_referrerClient.endConnection(); - ApplicationEnvironmentImpl.this.m_referrerClient = null; - ApplicationEnvironmentImpl.this.setAttributionData(str, str2, j, 0L); - throw th; - } - } catch (Throwable th2) { - th = th2; - str = "ok"; - str2 = installReferrer2; - ApplicationEnvironmentImpl.this.m_referrerClient.endConnection(); - ApplicationEnvironmentImpl.this.m_referrerClient = null; - ApplicationEnvironmentImpl.this.setAttributionData(str, str2, j, 0L); - throw th; - } - } catch (Exception e2) { - e = e2; - str3 = installReferrer2; - j2 = 0; - Log.Helper.LOGW(this, "requestAttributionData(): Failed with exception.\n" + e.toString(), new Object[0]); - String exc2 = e.toString(); - ApplicationEnvironmentImpl.this.m_referrerClient.endConnection(); - ApplicationEnvironmentImpl.this.m_referrerClient = null; - ApplicationEnvironmentImpl.this.setAttributionData(exc2, str3, j2, 0L); - return; - } catch (Throwable th3) { - th = th3; - j = 0; - } - } catch (Exception e3) { - e = e3; - str3 = ""; - } catch (Throwable th4) { - th = th4; - j = 0; - str = "ok"; - str2 = ""; - } - case 1: - str6 = "SERVICE_UNAVAILABLE"; - break; - case 2: - str6 = "FEATURE_NOT_SUPPORTED"; - break; - case 3: - str6 = "DEVELOPER_ERROR"; - break; - default: - str4 = ""; - j3 = 0; - referrerClickTimestampSeconds = 0; - str5 = ""; - ApplicationEnvironmentImpl.this.m_referrerClient.endConnection(); - ApplicationEnvironmentImpl.this.m_referrerClient = null; - ApplicationEnvironmentImpl.this.setAttributionData(str5, str4, j3, referrerClickTimestampSeconds); - } - str4 = ""; - j3 = 0; - referrerClickTimestampSeconds = 0; - str5 = str6; - ApplicationEnvironmentImpl.this.m_referrerClient.endConnection(); - ApplicationEnvironmentImpl.this.m_referrerClient = null; - ApplicationEnvironmentImpl.this.setAttributionData(str5, str4, j3, referrerClickTimestampSeconds); - } - - @Override // com.android.installreferrer.api.InstallReferrerStateListener - public void onInstallReferrerServiceDisconnected() { - Log.Helper.LOGV(this, "requestAttributionData(): Google Play Install Referrer client disconnected.", new Object[0]); - } - }); - } catch (Exception e) { - Log.Helper.LOGW(this, "requestAttributionData(): Failed to start Install Referrer connection.\n", e.toString()); - setAttributionData(e.getMessage(), "", 0L, 0L); - } } } diff --git a/app/src/main/java/com/ea/nimble/BaseCore.java b/app/src/main/java/com/ea/nimble/BaseCore.java index 2be2707..d9f2447 100644 --- a/app/src/main/java/com/ea/nimble/BaseCore.java +++ b/app/src/main/java/com/ea/nimble/BaseCore.java @@ -9,6 +9,7 @@ import com.ea.nimble.bridge.NimbleCppApplicationLifeCycle; import com.ea.nimble.bridge.NimbleCppComponentRegistrar; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.util.HashMap; import java.util.Map; /* loaded from: classes.dex */ @@ -108,7 +109,7 @@ class BaseCore implements IApplicationLifecycle.ApplicationLifecycleCallbacks { if (identifier == 0) { return null; } - return Utility.parseXmlFile(identifier); + return new HashMap<>(); } public ComponentManager getComponentManager() { @@ -220,31 +221,7 @@ class BaseCore implements IApplicationLifecycle.ApplicationLifecycleCallbacks { if (nimbleConfiguration == NimbleConfiguration.UNKNOWN) { Log.Helper.LOGE(this, "Cannot restart nimble with unknown configuration", new Object[0]); } else { - new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: com.ea.nimble.BaseCore.1 - @Override // java.lang.Runnable - public void run() { - switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[BaseCore.this.m_state.ordinal()]) { - case 1: - case 2: - case 3: - Log.Helper.LOGF(this, "Should not happen, getInstance should ensure active instance", new Object[0]); - break; - case 4: - case 5: - BaseCore.this.m_componentManager.cleanup(); - BaseCore.this.m_componentManager.teardown(); - BaseCore.this.m_configuration = nimbleConfiguration; - BaseCore.this.m_componentManager.setup(); - Utility.sendBroadcast(Global.NOTIFICATION_COMPONENT_INDEPENDENT_SETUP_FINISHED); - BaseCore.this.m_componentManager.restore(); - break; - case 6: - case 7: - Log.Helper.LOGF(this, "Cannot restart Nimble when app is quiting", new Object[0]); - break; - } - } - }); + new Handler(Looper.getMainLooper()).post(() -> {}); } } @@ -341,82 +318,10 @@ class BaseCore implements IApplicationLifecycle.ApplicationLifecycleCallbacks { To view partially-correct code enable 'Show inconsistent code' option in preferences */ private boolean isAppSigned(android.content.Context r9) { - /* - r8 = this; - javax.security.auth.x500.X500Principal r0 = new javax.security.auth.x500.X500Principal - java.lang.String r1 = "CN=Android Debug,O=Android,C=US" - r0.(r1) - r1 = 0 - android.content.pm.PackageManager r2 = r9.getPackageManager() // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60 - if (r2 != 0) goto L16 - java.lang.String r9 = "Could not get Package Manager" - java.lang.Object[] r0 = new java.lang.Object[r1] // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60 - com.ea.nimble.Log.Helper.LOGE(r8, r9, r0) // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60 - return r1 - L16: - java.lang.String r9 = r9.getPackageName() // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60 - r3 = 64 - android.content.pm.PackageInfo r9 = r2.getPackageInfo(r9, r3) // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60 - android.content.pm.Signature[] r9 = r9.signatures // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60 - int r2 = r9.length // Catch: java.lang.Exception -> L54 java.security.cert.CertificateException -> L5a android.content.pm.PackageManager.NameNotFoundException -> L60 - r3 = 0 - r4 = 0 - L25: - if (r3 >= r2) goto L65 - r5 = r9[r3] // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52 - java.lang.String r6 = "X.509" - java.security.cert.CertificateFactory r6 = java.security.cert.CertificateFactory.getInstance(r6) // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52 - java.io.ByteArrayInputStream r7 = new java.io.ByteArrayInputStream // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52 - byte[] r5 = r5.toByteArray() // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52 - r7.(r5) // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52 - java.security.cert.Certificate r5 = r6.generateCertificate(r7) // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52 - java.security.cert.X509Certificate r5 = (java.security.cert.X509Certificate) r5 // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52 - javax.security.auth.x500.X500Principal r5 = r5.getSubjectX500Principal() // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52 - boolean r5 = r5.equals(r0) // Catch: java.lang.Exception -> L4e java.security.cert.CertificateException -> L50 android.content.pm.PackageManager.NameNotFoundException -> L52 - if (r5 == 0) goto L4a - r4 = r5 - goto L65 - L4a: - int r3 = r3 + 1 - r4 = r5 - goto L25 - L4e: - r9 = move-exception - goto L56 - L50: - r9 = move-exception - goto L5c - L52: - r9 = move-exception - goto L62 - L54: - r9 = move-exception - r4 = 0 - L56: - r9.printStackTrace() - goto L65 - L5a: - r9 = move-exception - r4 = 0 - L5c: - r9.printStackTrace() - goto L65 - L60: - r9 = move-exception - r4 = 0 - L62: - r9.printStackTrace() - L65: - if (r4 != 0) goto L68 - r1 = 1 - L68: - return r1 - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.BaseCore.isAppSigned(android.content.Context):boolean"); + return true; } public boolean isActive() { - Log.Helper.LOGPUBLICFUNCS("BaseCore"); - return this.m_state == State.AUTO_SETUP || this.m_state == State.MANUAL_SETUP; + return false; } } diff --git a/app/src/main/java/com/ea/nimble/EASPDataLoader.java b/app/src/main/java/com/ea/nimble/EASPDataLoader.java index 7471ef9..18d4353 100644 --- a/app/src/main/java/com/ea/nimble/EASPDataLoader.java +++ b/app/src/main/java/com/ea/nimble/EASPDataLoader.java @@ -1,12 +1,11 @@ package com.ea.nimble; import android.content.Context; -import com.ea.nimble.Log; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.ByteBuffer; -import org.apache.http.protocol.HTTP; + /* loaded from: classes.dex */ public class EASPDataLoader { @@ -50,7 +49,7 @@ public class EASPDataLoader { byte[] bArr = new byte[i]; byteBuffer.get(bArr, 0, i); try { - str = new String(bArr, HTTP.UTF_8); + str = new String(bArr); try { Log.Helper.LOGDS("Legacy", "Read string (%s)", str); } catch (Exception e) { @@ -59,7 +58,6 @@ public class EASPDataLoader { return str; } } catch (Exception e2) { - e = e2; str = null; } return str; diff --git a/app/src/main/java/com/ea/nimble/FacebookImpl.java b/app/src/main/java/com/ea/nimble/FacebookImpl.java index eecc6ed..f25d377 100644 --- a/app/src/main/java/com/ea/nimble/FacebookImpl.java +++ b/app/src/main/java/com/ea/nimble/FacebookImpl.java @@ -3,384 +3,137 @@ package com.ea.nimble; import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import android.os.Handler; -import android.os.Looper; -import com.ea.nimble.Error; -import com.ea.nimble.IApplicationLifecycle; -import com.ea.nimble.IFacebook; -import com.ea.nimble.Log; -import com.ea.nimble.NimbleFacebookError; -import com.facebook.AccessToken; -import com.facebook.CallbackManager; -import com.facebook.FacebookException; -import com.facebook.FacebookSdk; -import com.facebook.GraphRequest; -import com.facebook.HttpMethod; -import com.facebook.Profile; -import com.facebook.login.LoginManager; -import com.facebook.login.LoginResult; -import com.facebook.share.internal.ShareConstants; -import java.util.ArrayList; +import java.util.Collections; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.http.client.methods.HttpGet; -import org.json.JSONArray; -import org.json.JSONException; -import org.json.JSONObject; /* loaded from: classes.dex */ class FacebookImpl extends Component implements IFacebook, LogSource, IApplicationLifecycle.ActivityLifecycleCallbacks, IApplicationLifecycle.ActivityEventCallbacks { - private CallbackManager m_callbackManager = null; - private IFacebook.RequestCallback m_loginCallback = null; - @Override // com.ea.nimble.Component + @Override public String getComponentId() { - return "com.ea.nimble.facebook"; + return ""; } - @Override // com.ea.nimble.LogSource - public String getLogSourceTitle() { - return "FB-Android"; - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks - public void onActivityDestroyed(Activity activity) { - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks - public void onActivityPaused(Activity activity) { - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks - public void onActivityResumed(Activity activity) { - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks - public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks - public void onActivityStarted(Activity activity) { - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks - public void onActivityStopped(Activity activity) { - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks - public boolean onBackPressed() { - return true; - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks - public void onNewIntent(Activity activity, Intent intent) { - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks - public void onWindowFocusChanged(boolean z) { - } - - FacebookImpl() { - } - - @Override // com.ea.nimble.Component - protected void setup() { - Log.Helper.LOGV(this, "Using Facebook SDK version " + FacebookSdk.getSdkVersion() + ".", new Object[0]); - } - - @Override // com.ea.nimble.Component - public void restore() { - ApplicationLifecycle.getComponent().registerActivityEventCallbacks(this); - ApplicationLifecycle.getComponent().registerActivityLifecycleCallbacks(this); - } - - @Override // com.ea.nimble.Component - protected void cleanup() { - ApplicationLifecycle.getComponent().unregisterActivityLifecycleCallbacks(this); - ApplicationLifecycle.getComponent().unregisterActivityEventCallbacks(this); - } - - @Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks + @Override public void onActivityResult(Activity activity, int i, int i2, Intent intent) { - if (this.m_callbackManager != null) { - this.m_callbackManager.onActivityResult(i, i2, intent); - } + } - @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks + @Override + public boolean onBackPressed() { + return false; + } + + @Override + public void onNewIntent(Activity activity, Intent intent) { + + } + + @Override + public void onWindowFocusChanged(boolean z) { + + } + + @Override public void onActivityCreated(Activity activity, Bundle bundle) { - this.m_callbackManager = CallbackManager.Factory.create(); - LoginManager.getInstance().registerCallback(this.m_callbackManager, new com.facebook.FacebookCallback() { // from class: com.ea.nimble.FacebookImpl.1 - @Override // com.facebook.FacebookCallback - public void onSuccess(LoginResult loginResult) { - Log.Helper.LOGV(this, "Login success", new Object[0]); - synchronized (this) { - HashMap hashMap = new HashMap(); - hashMap.put("status", "loggedIn"); - Utility.sendBroadcast(IFacebook.NIMBLE_NOTIFICATION_FACEBOOK_STATUS_CHANGED, hashMap); - if (FacebookImpl.this.m_loginCallback != null) { - FacebookImpl.this.m_loginCallback.callback(null, null); - FacebookImpl.this.m_loginCallback = null; - } - } - } - @Override // com.facebook.FacebookCallback - public void onCancel() { - synchronized (this) { - Log.Helper.LOGV(this, "Login canceled", new Object[0]); - if (FacebookImpl.this.m_loginCallback != null) { - FacebookImpl.this.m_loginCallback.callback(null, new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "User canceled", (Throwable) null)); - FacebookImpl.this.m_loginCallback = null; - } - } - } - - @Override // com.facebook.FacebookCallback - public void onError(FacebookException facebookException) { - Log.Helper.LOGE(this, "Login failed\nError: %s", facebookException.toString()); - synchronized (this) { - if (FacebookImpl.this.m_loginCallback != null) { - FacebookImpl.this.m_loginCallback.callback(null, new Error(Error.Code.UNKNOWN, "Login failed", facebookException)); - FacebookImpl.this.m_loginCallback = null; - } - } - } - }); } - @Override // com.ea.nimble.IFacebook - public void login(List list, IFacebook.RequestCallback requestCallback) { - Log.Helper.LOGPUBLICFUNC(this); - this.m_loginCallback = requestCallback; - while (!FacebookSdk.isInitialized()) { - try { - Thread.sleep(10L); - } catch (InterruptedException unused) { - } - } - synchronized (this) { - LoginManager.getInstance().logInWithReadPermissions(ApplicationEnvironment.getCurrentActivity(), list); - } + @Override + public void onActivityDestroyed(Activity activity) { + } - @Override // com.ea.nimble.IFacebook - public void logout() { - Log.Helper.LOGPUBLICFUNC(this); - synchronized (this) { - LoginManager.getInstance().logOut(); - AccessToken.setCurrentAccessToken(null); - Profile.setCurrentProfile(null); - HashMap hashMap = new HashMap(); - hashMap.put("status", "loggedOut"); - Utility.sendBroadcast(IFacebook.NIMBLE_NOTIFICATION_FACEBOOK_STATUS_CHANGED, hashMap); - } + @Override + public void onActivityPaused(Activity activity) { + } - private void sendGraphRequest(final String str, final HashMap hashMap, String str2, final IFacebook.RequestCallback requestCallback) { - Log.Helper.LOGFUNC(this); - if (!hasOpenSession()) { - Log.Helper.LOGD(this, "Unable to send FB Graph request to " + str + " as there is no currently active session.", new Object[0]); - if (requestCallback != null) { - requestCallback.callback(null, new Error(Error.Code.UNKNOWN, "Request failed as there is no active session.")); - return; - } - return; - } - new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: com.ea.nimble.FacebookImpl.2 - @Override // java.lang.Runnable - public void run() { - Bundle bundle = new Bundle(); - if (hashMap != null) { - for (Map.Entry entry : hashMap.entrySet()) { - bundle.putString((String) entry.getKey(), (String) entry.getValue()); - } - } - new GraphRequest(AccessToken.getCurrentAccessToken(), str, bundle, HttpMethod.GET, new GraphRequest.Callback() { // from class: com.ea.nimble.FacebookImpl.2.1 - /* JADX WARN: Removed duplicated region for block: B:10:? A[RETURN, SYNTHETIC] */ - /* JADX WARN: Removed duplicated region for block: B:7:0x0072 */ - @Override // com.facebook.GraphRequest.Callback - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public void onCompleted(com.facebook.GraphResponse r6) { - /* - r5 = this; - if (r6 == 0) goto L6b - com.facebook.FacebookRequestError r0 = r6.getError() - r1 = 0 - if (r0 == 0) goto L43 - com.ea.nimble.Error r0 = new com.ea.nimble.Error - com.ea.nimble.Error$Code r2 = com.ea.nimble.Error.Code.UNKNOWN - java.lang.String r3 = "Request failed." - com.facebook.FacebookRequestError r4 = r6.getError() - com.facebook.FacebookException r4 = r4.getException() - r0.(r2, r3, r4) - java.lang.String r2 = "Facebook" - java.lang.StringBuilder r3 = new java.lang.StringBuilder - r3.() - java.lang.String r4 = "Response of FB Graph request to " - r3.append(r4) - com.ea.nimble.FacebookImpl$2 r4 = com.ea.nimble.FacebookImpl.AnonymousClass2.this - java.lang.String r4 = r3 - r3.append(r4) - java.lang.String r4 = " failed due to error: " - r3.append(r4) - java.lang.String r4 = r0.getMessage() - r3.append(r4) - java.lang.String r3 = r3.toString() - java.lang.Object[] r1 = new java.lang.Object[r1] - com.ea.nimble.Log.Helper.LOGDS(r2, r3, r1) - goto L6c - L43: - java.lang.String r0 = "Facebook" - java.lang.StringBuilder r2 = new java.lang.StringBuilder - r2.() - java.lang.String r3 = "Response of FB Graph request " - r2.append(r3) - com.ea.nimble.FacebookImpl$2 r3 = com.ea.nimble.FacebookImpl.AnonymousClass2.this - java.lang.String r3 = r3 - r2.append(r3) - java.lang.String r3 = " returned with data: " - r2.append(r3) - org.json.JSONObject r3 = r6.getJSONObject() - r2.append(r3) - java.lang.String r2 = r2.toString() - java.lang.Object[] r1 = new java.lang.Object[r1] - com.ea.nimble.Log.Helper.LOGDS(r0, r2, r1) - L6b: - r0 = 0 - L6c: - com.ea.nimble.FacebookImpl$2 r1 = com.ea.nimble.FacebookImpl.AnonymousClass2.this - com.ea.nimble.IFacebook$RequestCallback r1 = r4 - if (r1 == 0) goto L7d - com.ea.nimble.FacebookImpl$2 r1 = com.ea.nimble.FacebookImpl.AnonymousClass2.this - com.ea.nimble.IFacebook$RequestCallback r1 = r4 - java.lang.String r6 = r6.getRawResponse() - r1.callback(r6, r0) - L7d: - return - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.FacebookImpl.AnonymousClass2.AnonymousClass1.onCompleted(com.facebook.GraphResponse):void"); - } - }).executeAsync(); - } - }); + @Override + public void onActivityResumed(Activity activity) { + } - @Override // com.ea.nimble.IFacebook - public void requestUserInfo(HashMap hashMap, IFacebook.RequestCallback requestCallback) { - Log.Helper.LOGPUBLICFUNC(this); - if (hashMap == null || !hashMap.containsKey(GraphRequest.FIELDS_PARAM)) { - hashMap = new HashMap<>(); - hashMap.put(GraphRequest.FIELDS_PARAM, "id, email, name, first_name, last_name, gender, link, locale, timezone, updated_time, verified"); - } - sendGraphRequest("/me", hashMap, HttpGet.METHOD_NAME, requestCallback); + @Override + public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { + } - @Override // com.ea.nimble.IFacebook - public void requestFriends(HashMap hashMap, IFacebook.RequestCallback requestCallback) { - Log.Helper.LOGPUBLICFUNC(this); - sendGraphRequest("/me/friends", hashMap, HttpGet.METHOD_NAME, requestCallback); + @Override + public void onActivityStarted(Activity activity) { + } - @Override // com.ea.nimble.IFacebook - public boolean hasOpenSession() { - Log.Helper.LOGPUBLICFUNC(this); - AccessToken currentAccessToken = AccessToken.getCurrentAccessToken(); - return (currentAccessToken == null || currentAccessToken.isExpired()) ? false : true; + @Override + public void onActivityStopped(Activity activity) { + } - @Override // com.ea.nimble.IFacebook + @Override public String getAccessToken() { - Log.Helper.LOGPUBLICFUNC(this); - AccessToken currentAccessToken = AccessToken.getCurrentAccessToken(); - if (currentAccessToken != null) { - return currentAccessToken.getToken(); - } - return null; + return ""; } - @Override // com.ea.nimble.IFacebook - public List getPermissions() { - Log.Helper.LOGPUBLICFUNC(this); - AccessToken currentAccessToken = AccessToken.getCurrentAccessToken(); - if (currentAccessToken != null) { - return new ArrayList(currentAccessToken.getPermissions()); - } - return null; - } - - @Override // com.ea.nimble.IFacebook - public Date getTokenExpirationDate() { - Log.Helper.LOGPUBLICFUNC(this); - AccessToken currentAccessToken = AccessToken.getCurrentAccessToken(); - if (currentAccessToken != null) { - return currentAccessToken.getExpires(); - } - return null; - } - - @Override // com.ea.nimble.IFacebook + @Override public String getApplicationId() { - Log.Helper.LOGPUBLICFUNC(this); - AccessToken currentAccessToken = AccessToken.getCurrentAccessToken(); - if (currentAccessToken != null) { - return currentAccessToken.getApplicationId(); - } + return ""; + } + + @Override + public Map getGraphUser() { + return Collections.emptyMap(); + } + + @Override + public List getPermissions() { + return Collections.emptyList(); + } + + @Override + public Date getTokenExpirationDate() { return null; } - @Override // com.ea.nimble.IFacebook + @Override + public boolean hasOpenSession() { + return false; + } + + @Override + public void login(List list, RequestCallback requestCallback) { + + } + + @Override + public void logout() { + + } + + @Override public void refreshToken() { - Log.Helper.LOGPUBLICFUNC(this); - AccessToken.refreshCurrentAccessTokenAsync(); + } - @Override // com.ea.nimble.IFacebook - public Map getGraphUser() { - Log.Helper.LOGPUBLICFUNC(this); - Profile currentProfile = Profile.getCurrentProfile(); - if (currentProfile == null) { - return null; - } - HashMap hashMap = new HashMap(); - hashMap.put("first_name", currentProfile.getFirstName()); - hashMap.put("last_name", currentProfile.getLastName()); - hashMap.put("link", currentProfile.getLinkUri()); - hashMap.put("avatar", "https://graph.facebook.com/" + currentProfile.getId() + "/picture"); - hashMap.put("id", currentProfile.getId()); - return hashMap; + @Override + public void requestFriends(HashMap hashMap, RequestCallback requestCallback) { + } - @Override // com.ea.nimble.IFacebook - public void retrieveFriends(int i, int i2, final IFacebook.FacebookFriendsCallback facebookFriendsCallback) { - Log.Helper.LOGPUBLICFUNC(this); - HashMap hashMap = new HashMap<>(); - hashMap.put("offset", "" + i); - hashMap.put("limit", "" + i2); - hashMap.put(GraphRequest.FIELDS_PARAM, "name, id, picture.type(normal)"); - sendGraphRequest("/me/friends", hashMap, HttpGet.METHOD_NAME, new IFacebook.RequestCallback() { // from class: com.ea.nimble.FacebookImpl.3 - @Override // com.ea.nimble.IFacebook.RequestCallback - public void callback(String str, Error error) { - NimbleFacebookError nimbleFacebookError; - JSONArray jSONArray = null; - if (error != null) { - nimbleFacebookError = new NimbleFacebookError(NimbleFacebookError.Code.FBSERVER_ERROR, error.toString()); - } else { - try { - jSONArray = new JSONObject(str).getJSONArray(ShareConstants.WEB_DIALOG_PARAM_DATA); - nimbleFacebookError = null; - } catch (JSONException e) { - Log.Helper.LOGE(this, "JSON Exception encountered when parsing the facebook FQL query", new Object[0]); - nimbleFacebookError = new NimbleFacebookError(NimbleFacebookError.Code.RESPONSE_PARSE_ERROR, e.toString()); - } - } - facebookFriendsCallback.callback(Facebook.getComponent(), jSONArray, nimbleFacebookError); - } - }); + @Override + public void requestUserInfo(HashMap hashMap, RequestCallback requestCallback) { + + } + + @Override + public void retrieveFriends(int i, int i2, FacebookFriendsCallback facebookFriendsCallback) { + + } + + @Override + public String getLogSourceTitle() { + return ""; } } diff --git a/app/src/main/java/com/ea/nimble/HttpRequest.java b/app/src/main/java/com/ea/nimble/HttpRequest.java index a0ac49f..0c31f56 100644 --- a/app/src/main/java/com/ea/nimble/HttpRequest.java +++ b/app/src/main/java/com/ea/nimble/HttpRequest.java @@ -4,6 +4,7 @@ import com.ea.nimble.IHttpRequest; import com.ea.nimble.Log; import java.io.ByteArrayOutputStream; import java.net.URL; +import java.util.EnumSet; import java.util.HashMap; /* loaded from: classes.dex */ @@ -43,6 +44,11 @@ public class HttpRequest implements IHttpRequest { return this.method; } + @Override + public EnumSet getOverwritePolicy() { + return null; + } + @Override // com.ea.nimble.IHttpRequest public byte[] getData() { Log.Helper.LOGPUBLICFUNC(this); diff --git a/app/src/main/java/com/ea/nimble/LogImpl.java b/app/src/main/java/com/ea/nimble/LogImpl.java index 3b64f77..48483a5 100644 --- a/app/src/main/java/com/ea/nimble/LogImpl.java +++ b/app/src/main/java/com/ea/nimble/LogImpl.java @@ -2,8 +2,6 @@ package com.ea.nimble; import android.content.pm.PackageManager; import android.os.Environment; -import android.support.v4.media.session.PlaybackStateCompat; -import com.ea.nimble.ILog; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; @@ -17,7 +15,8 @@ import java.util.Iterator; import java.util.Locale; import java.util.Map; import org.apache.http.HttpHeaders; -import org.apache.http.protocol.HTTP; + +import kotlin.text.Charsets; /* loaded from: classes.dex */ public class LogImpl extends Component implements ILog { @@ -48,7 +47,7 @@ public class LogImpl extends Component implements ILog { @Override // java.lang.Runnable public void run() { - if (LogImpl.this.m_filePath == null || LogImpl.this.m_filePath.length() <= LogImpl.this.m_sizeLimit * PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) { + if (LogImpl.this.m_filePath == null || LogImpl.this.m_filePath.length() <= LogImpl.this.m_sizeLimit) { return; } LogImpl.this.clearLog(); @@ -451,10 +450,10 @@ public class LogImpl extends Component implements ILog { String property = System.getProperty("line.separator"); if (this.m_logFileStream != null) { try { - this.m_logFileStream.write((this.m_format.format(new Date()) + " " + str + property).getBytes(Charset.forName(HTTP.UTF_8))); + this.m_logFileStream.write((this.m_format.format(new Date()) + " " + str + property).getBytes()); this.m_logFileStream.flush(); } catch (IOException e) { - android.util.Log.e(Global.NIMBLE_ID, "Error writing to log file: " + e.toString()); + android.util.Log.e(Global.NIMBLE_ID, "Error writing to log file: " + e); } } } diff --git a/app/src/main/java/com/ea/nimble/Network.java b/app/src/main/java/com/ea/nimble/Network.java index 6abe9a5..2ff7cce 100644 --- a/app/src/main/java/com/ea/nimble/Network.java +++ b/app/src/main/java/com/ea/nimble/Network.java @@ -6,7 +6,6 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLEncoder; import java.util.Map; -import org.apache.http.protocol.HTTP; /* loaded from: classes.dex */ public class Network { @@ -38,37 +37,8 @@ public class Network { } public static String generateParameterString(Map map) { - Log.Helper.LOGPUBLICFUNCS("NimbleNetwork"); - if (map == null || map.size() == 0) { - return null; - } - String str = ""; - for (Map.Entry entry : map.entrySet()) { - String key = entry.getKey(); - String value = entry.getValue(); - if ("".equals(key)) { - Log.Helper.LOGWS("Network", "URL parameters map contains invalid key", new Object[0]); - } else { - try { - String encode = URLEncoder.encode(key, HTTP.UTF_8); - if ("".equals(value)) { - Log.Helper.LOGWS("Network", "URL parameters map contains invalid value", new Object[0]); - } else { - try { - str = (((str + encode) + "=") + URLEncoder.encode(value, HTTP.UTF_8)) + "&"; - } catch (UnsupportedEncodingException unused) { - Log.Helper.LOGWS("Network", "URL parameters map contains invalid value", new Object[0]); - } - } - } catch (UnsupportedEncodingException unused2) { - Log.Helper.LOGWS("Network", "URL parameters map contains invalid key", new Object[0]); - } - } - } - if (str.length() == 0) { - return null; - } - return str.substring(0, str.length() - 1); + + return null; } public static URL generateURL(String str, Map map) { diff --git a/app/src/main/java/com/ea/nimble/NetworkConnection.java b/app/src/main/java/com/ea/nimble/NetworkConnection.java index 2c6e6a0..6fec5db 100644 --- a/app/src/main/java/com/ea/nimble/NetworkConnection.java +++ b/app/src/main/java/com/ea/nimble/NetworkConnection.java @@ -16,8 +16,6 @@ import java.net.SocketTimeoutException; import java.net.UnknownHostException; import java.util.Date; import java.util.Map; -import org.apache.http.message.TokenParser; -import org.apache.http.protocol.HTTP; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -145,219 +143,6 @@ class NetworkConnection implements NetworkConnectionHandle, Runnable, LogSource public void run() { Log.Helper.LOGPUBLICFUNCS("NetworkConnection"); - try { - try { - try { - try { - try { - try { - if (this.m_response.isCompleted) { - synchronized (this) { - this.m_thread = null; - } - return; - } - if (Thread.interrupted()) { - throw new InterruptedIOException(); - } - synchronized (this) { - this.m_thread = Thread.currentThread(); - } - HttpURLConnection httpURLConnection = (HttpURLConnection) this.m_request.getUrl().openConnection(); - httpURLConnection.setRequestMethod(this.m_request.method.toString()); - httpURLConnection.setConnectTimeout((int) (this.m_request.timeout * 1000.0d)); - httpURLConnection.setReadTimeout((int) (this.m_request.timeout * 1000.0d)); - httpURLConnection.setRequestProperty("Connection", "close"); - this.m_requestDataForLog = null; - this.m_responseDataForLog = null; - if (Thread.interrupted()) { - throw new InterruptedIOException(); - } - httpSend(httpURLConnection); - if (Thread.interrupted()) { - throw new InterruptedIOException(); - } - httpRecv(httpURLConnection); - finish(); - synchronized (this) { - this.m_thread = null; - } - } catch (SocketTimeoutException e) { - finishWithError(new Error(Error.Code.NETWORK_TIMEOUT, "Connection " + toString() + " timed out", e)); - synchronized (this) { - this.m_thread = null; - } - } catch (Exception e2) { - finishWithError(new Error(Error.Code.SYSTEM_UNEXPECTED, "Unexpected error.", e2)); - synchronized (this) { - this.m_thread = null; - } - } - } catch (IOException e3) { - finishWithError(new Error(Error.Code.NETWORK_CONNECTION_ERROR, "Connection " + toString() + " failed with I/O exception", e3)); - synchronized (this) { - this.m_thread = null; - } - } catch (ClassCastException e4) { - finishWithError(new Error(Error.Code.NETWORK_UNSUPPORTED_CONNECTION_TYPE, "Request " + toString() + " failed for unsupported connection type" + this.m_request.getUrl().getProtocol(), e4)); - synchronized (this) { - this.m_thread = null; - } - } - } catch (UnknownHostException e5) { - Network.Status status = this.m_manager.getStatus(); - if (status != Network.Status.OK) { - finishWithError(new Error(Error.Code.NETWORK_NO_CONNECTION, "No network connection, network status " + status.toString(), e5)); - } else { - finishWithError(new Error(Error.Code.NETWORK_UNREACHABLE, "Request " + toString() + " failed for unreachable host", e5)); - } - synchronized (this) { - this.m_thread = null; - } - } - } catch (InterruptedIOException e6) { - finishWithError(new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "Connection " + toString() + " is cancelled", e6)); - synchronized (this) { - this.m_thread = null; - } - } - } catch (Error e7) { - finishWithError(e7); - synchronized (this) { - this.m_thread = null; - } - } - } catch (Throwable th) { - synchronized (this) { - this.m_thread = null; - throw th; - } - } - } - - private void httpSend(HttpURLConnection httpURLConnection) throws IOException { - Log.Helper.LOGFUNCS("NetworkConnection"); - this.m_connectionStartTimestamp = new Date(); - if (this.m_request.headers != null) { - for (String str : this.m_request.headers.keySet()) { - httpURLConnection.setRequestProperty(str, this.m_request.headers.get(str)); - } - } - logRequest(); - byte[] byteArray = this.m_request.data.toByteArray(); - if (byteArray == null || byteArray.length <= 0) { - return; - } - httpURLConnection.setDoOutput(true); - httpURLConnection.setFixedLengthStreamingMode(byteArray.length); - OutputStream outputStream = null; - try { - try { - OutputStream outputStream2 = httpURLConnection.getOutputStream(); - try { - outputStream2.write(byteArray); - if (outputStream2 != null) { - outputStream2.close(); - } - } catch (Exception e) { - e = e; - outputStream = outputStream2; - StringWriter stringWriter = new StringWriter(); - e.printStackTrace(new PrintWriter(stringWriter)); - Log.Helper.LOGE(this, "Exception in network connection:" + stringWriter.toString(), new Object[0]); - if (outputStream != null) { - outputStream.close(); - } - } catch (Throwable th) { - th = th; - outputStream = outputStream2; - if (outputStream != null) { - outputStream.close(); - } - throw th; - } - } catch (Exception e2) { - e = e2; - } - } catch (Throwable th2) { - th = th2; - } - } - - /* JADX WARN: Removed duplicated region for block: B:30:0x00a8 */ - /* JADX WARN: Removed duplicated region for block: B:35:0x00b5 A[Catch: all -> 0x01b5, TryCatch #2 {all -> 0x01b5, blocks: (B:6:0x0012, B:7:0x003f, B:9:0x0045, B:11:0x0063, B:14:0x0071, B:17:0x0086, B:19:0x008e, B:32:0x00ab, B:33:0x00b4, B:35:0x00b5, B:36:0x00d2, B:37:0x00d3, B:39:0x00dd, B:49:0x00ea, B:50:0x00ef, B:52:0x00f7, B:54:0x00fd, B:56:0x0115, B:57:0x011a, B:58:0x0137, B:59:0x010c, B:62:0x0145, B:63:0x0172, B:65:0x0175, B:66:0x0194, B:67:0x0195, B:68:0x01b4), top: B:5:0x0012 }] */ - /* JADX WARN: Removed duplicated region for block: B:39:0x00dd A[Catch: all -> 0x01b5, TryCatch #2 {all -> 0x01b5, blocks: (B:6:0x0012, B:7:0x003f, B:9:0x0045, B:11:0x0063, B:14:0x0071, B:17:0x0086, B:19:0x008e, B:32:0x00ab, B:33:0x00b4, B:35:0x00b5, B:36:0x00d2, B:37:0x00d3, B:39:0x00dd, B:49:0x00ea, B:50:0x00ef, B:52:0x00f7, B:54:0x00fd, B:56:0x0115, B:57:0x011a, B:58:0x0137, B:59:0x010c, B:62:0x0145, B:63:0x0172, B:65:0x0175, B:66:0x0194, B:67:0x0195, B:68:0x01b4), top: B:5:0x0012 }] */ - /* JADX WARN: Removed duplicated region for block: B:42:0x00e5 */ - /* JADX WARN: Removed duplicated region for block: B:44:0x013e A[DONT_GENERATE] */ - /* JADX WARN: Removed duplicated region for block: B:47:0x00e6 */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - private void httpRecv(java.net.HttpURLConnection r10) throws java.io.IOException, com.ea.nimble.Error { - /* - Method dump skipped, instructions count: 458 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.NetworkConnection.httpRecv(java.net.HttpURLConnection):void"); - } - - /* JADX WARN: Removed duplicated region for block: B:75:0x01ab */ - /* JADX WARN: Removed duplicated region for block: B:77:0x01b0 */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - private void downloadToFile(java.io.InputStream r14) throws java.io.IOException { - /* - Method dump skipped, instructions count: 483 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.NetworkConnection.downloadToFile(java.io.InputStream):void"); - } - - private void downloadToBuffer(InputStream inputStream) throws IOException { - int read; - Log.Helper.LOGFUNCS("NetworkConnection"); - prepareResponseLog(); - int i = 0; - while (true) { - if (i < 0) { - break; - } - try { - byte[] prepareSegment = this.m_response.data.prepareSegment(); - if (prepareSegment == null) { - Log.Helper.LOGE(this, "Error preparing segment", new Object[0]); - break; - } - int i2 = 0; - do { - read = inputStream.read(prepareSegment, i2, prepareSegment.length - i2); - if (!Thread.interrupted()) { - if (read < 0) { - break; - } - if (read == 0) { - Thread.yield(); - } else { - prepareResponseLog(prepareSegment, i2, read); - i2 += read; - this.m_response.downloadedContentLength += read; - } - } else { - throw new InterruptedIOException(); - } - } while (i2 < prepareSegment.length); - this.m_response.data.appendSegmentToBuffer(prepareSegment, i2); - if (this.m_progressCallback != null) { - this.m_progressCallback.callback(this); - } - i = read; - } finally { - inputStream.close(); - } - } } private void finish() { @@ -390,18 +175,13 @@ class NetworkConnection implements NetworkConnectionHandle, Runnable, LogSource int i = 2048; if (this.m_request.data != null && this.m_request.data.size() > 0) { i = 2048 + this.m_request.data.size(); - try { - str = this.m_request.data.toString(HTTP.UTF_8); - } catch (UnsupportedEncodingException unused) { - str = "<-- UNREADABLE -->"; - } + str = this.m_request.data.toString(); } else { str = (this.m_request.getMethod() == IHttpRequest.Method.POST || this.m_request.getMethod() == IHttpRequest.Method.PUT) ? "<-- EMPTY -->" : null; } StringBuilder sb = new StringBuilder(i); sb.append("REQUEST: "); sb.append(this.m_request.method.toString()); - sb.append(TokenParser.SP); sb.append(this.m_request.url.toString()); sb.append('\n'); generateHttpHeaderAndBodyLogString(sb, false, this.m_request.headers, str); @@ -421,11 +201,7 @@ class NetworkConnection implements NetworkConnectionHandle, Runnable, LogSource if (Log.getComponent().getThresholdLevel() > 100 || this.m_responseDataForLog == null) { return; } - try { - this.m_responseDataForLog.append(new String(bArr, i, i2, HTTP.UTF_8)); - } catch (UnsupportedEncodingException unused) { - this.m_responseDataForLog = null; - } + this.m_responseDataForLog.append(new String(bArr, i, i2)); } private String multiplyStringNTimes(String str, int i) { diff --git a/app/src/main/java/com/ea/nimble/NetworkImpl.java b/app/src/main/java/com/ea/nimble/NetworkImpl.java index dd787dd..437afb6 100644 --- a/app/src/main/java/com/ea/nimble/NetworkImpl.java +++ b/app/src/main/java/com/ea/nimble/NetworkImpl.java @@ -65,9 +65,6 @@ public class NetworkImpl extends Component implements INetwork, LogSource { @Override // android.content.BroadcastReceiver public void onReceive(Context context, Intent intent) { Log.Helper.LOGD(this, "Network reachability changed!", new Object[0]); - synchronized (NetworkImpl.this) { - NetworkImpl.this.detect(true); - } } } diff --git a/app/src/main/java/com/ea/nimble/NimbleConfiguration.java b/app/src/main/java/com/ea/nimble/NimbleConfiguration.java index 9855b88..0677301 100644 --- a/app/src/main/java/com/ea/nimble/NimbleConfiguration.java +++ b/app/src/main/java/com/ea/nimble/NimbleConfiguration.java @@ -2,6 +2,8 @@ package com.ea.nimble; import com.ea.nimble.Log; +import org.apache.http.BuildConfig; + /* loaded from: classes.dex */ public enum NimbleConfiguration { UNKNOWN, @@ -22,7 +24,7 @@ public enum NimbleConfiguration { if (str.equals("live")) { return LIVE; } - if (str.equals(com.ea.games.nfs13.BuildConfig.FLAVOR)) { + if (str.equals(BuildConfig.FLAVOR)) { return CUSTOMIZED; } if (str.equals("manual")) { @@ -41,7 +43,7 @@ public enum NimbleConfiguration { case LIVE: return "live"; case CUSTOMIZED: - return com.ea.games.nfs13.BuildConfig.FLAVOR; + return BuildConfig.FLAVOR; case MANUAL: return "manual"; default: diff --git a/app/src/main/java/com/ea/nimble/NimbleLocalNotificationReceiver.java b/app/src/main/java/com/ea/nimble/NimbleLocalNotificationReceiver.java index dff7b4f..9a4fde0 100644 --- a/app/src/main/java/com/ea/nimble/NimbleLocalNotificationReceiver.java +++ b/app/src/main/java/com/ea/nimble/NimbleLocalNotificationReceiver.java @@ -1,19 +1,9 @@ package com.ea.nimble; -import android.app.Notification; -import android.app.NotificationManager; -import android.app.PendingIntent; + import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import android.os.Bundle; -import android.support.v4.app.NotificationCompat; -import android.support.v4.content.LocalBroadcastManager; -import com.ea.eadp.pushnotification.forwarding.GcmIntentService; -import com.ea.nimble.Log; -import com.facebook.internal.ServerProtocol; -import com.facebook.share.internal.ShareConstants; -import java.util.HashMap; /* loaded from: classes.dex */ public class NimbleLocalNotificationReceiver extends BroadcastReceiver { @@ -22,42 +12,7 @@ public class NimbleLocalNotificationReceiver extends BroadcastReceiver { @Override // android.content.BroadcastReceiver public final void onReceive(Context context, Intent intent) { - handleNewLocalNotification(context, intent.getExtras()); - } - protected void handleNewLocalNotification(Context context, Bundle bundle) { - String string = bundle.getString(GcmIntentService.PushIntentExtraKeys.PUSH_ID, ""); - String pushTargetActivity = getPushTargetActivity(context); - Log.Helper.LOGD(this, "[handleNewLocalNotification]: Local notification received with target activity: " + pushTargetActivity, new Object[0]); - try { - Intent intent = new Intent(context, Class.forName(pushTargetActivity)); - intent.putExtras(bundle); - intent.putExtra("PushNotification", ServerProtocol.DIALOG_RETURN_SCOPES_TRUE); - intent.setFlags(603979776); - PendingIntent activity = PendingIntent.getActivity(context, 0, intent, 1073741824); - if (ApplicationEnvironment.isMainApplicationActive()) { - HashMap hashMap = new HashMap(); - hashMap.put("en", ShareConstants.WEB_DIALOG_PARAM_MESSAGE); - Bundle bundle2 = new Bundle(); - bundle2.putSerializable("core", hashMap); - bundle2.putString("msg_id", string); - bundle2.putString("type", "pn"); - bundle2.putString(NotificationCompat.CATEGORY_SERVICE, "local"); - bundle2.putString("status", "received"); - bundle2.putString("format", "pn"); - Intent intent2 = new Intent(); - intent2.setAction(NOTIFICATION_TRACKING2_LOG_EVENT); - intent2.putExtras(bundle2); - LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).sendBroadcast(intent2); - Utility.sendBroadcast(NIMBLE_LOCAL_NOTIFICATION_RECEIVED, bundle); - return; - } - Notification notification = (Notification) bundle.getParcelable("notification"); - notification.contentIntent = activity; - ((NotificationManager) context.getSystemService("notification")).notify(string.hashCode(), notification); - } catch (ClassNotFoundException e) { - Log.Helper.LOGD(this, String.format("[handleNewLocalNotification]: Could not launch target activity: %s, exception: %s", pushTargetActivity, e.toString()), new Object[0]); - } } protected String getPushTargetActivity(Context context) { diff --git a/app/src/main/java/com/ea/nimble/NimbleLocalNotificationsImpl.java b/app/src/main/java/com/ea/nimble/NimbleLocalNotificationsImpl.java index c4ef5b2..847d525 100644 --- a/app/src/main/java/com/ea/nimble/NimbleLocalNotificationsImpl.java +++ b/app/src/main/java/com/ea/nimble/NimbleLocalNotificationsImpl.java @@ -1,24 +1,9 @@ package com.ea.nimble; -import android.app.AlarmManager; -import android.app.Notification; import android.app.NotificationChannel; import android.app.NotificationManager; -import android.app.PendingIntent; import android.content.Context; -import android.content.Intent; -import android.content.res.Resources; import android.os.Build; -import android.os.Bundle; -import android.service.notification.StatusBarNotification; -import android.support.v4.app.NotificationCompat; -import android.support.v4.content.LocalBroadcastManager; -import com.ea.eadp.pushnotification.forwarding.GcmIntentService; -import com.ea.nimble.Error; -import com.ea.nimble.Log; -import com.ea.nimble.Persistence; -import com.facebook.share.internal.ShareConstants; -import com.google.android.gms.drive.DriveFile; import java.util.Date; import java.util.HashMap; import java.util.Iterator; @@ -65,7 +50,7 @@ public class NimbleLocalNotificationsImpl extends Component implements INimbleLo } Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); if (Build.VERSION.SDK_INT >= 26) { - NotificationManager notificationManager = (NotificationManager) applicationContext.getSystemService("notification"); + NotificationManager notificationManager = (NotificationManager) applicationContext.getSystemService(Context.NOTIFICATION_SERVICE); if (NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_LOCAL_NOTIFICATION_ID_KEY)) { return; } @@ -73,7 +58,7 @@ public class NimbleLocalNotificationsImpl extends Component implements INimbleLo if (NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_DEFAULT_NAME_KEY)) { str = applicationContext.getResources().getString(NimbleApplicationConfiguration.getConfigValueAsInt(Global.NOTIFICATION_CHANNEL_DEFAULT_NAME_KEY)); } - NotificationChannel notificationChannel = new NotificationChannel(Global.NOTIFICATION_CHANNEL_DEFAULT_ID, str, 3); + NotificationChannel notificationChannel = new NotificationChannel(Global.NOTIFICATION_CHANNEL_DEFAULT_ID, str, NotificationManager.IMPORTANCE_DEFAULT); if (NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_DEFAULT_DESCRIPTION_KEY)) { notificationChannel.setDescription(applicationContext.getResources().getString(NimbleApplicationConfiguration.getConfigValueAsInt(Global.NOTIFICATION_CHANNEL_DEFAULT_DESCRIPTION_KEY))); } @@ -83,71 +68,7 @@ public class NimbleLocalNotificationsImpl extends Component implements INimbleLo @Override // com.ea.nimble.INimbleLocalNotifications public Error scheduleNotification(String str, String str2, String str3, Date date) { - Notification build; - Log.Helper.LOGPUBLICFUNC(this); - Date date2 = new Date(); - if (!this.m_enabled) { - Log.Helper.LOGD(this, "scheduleNotification(): Local Notifications are not enabled!", new Object[0]); - return null; - } - Log.Helper.LOGD(this, "[scheduleNotification] Notification requested with: \n - Title : %s\n - Message : %s\n - ID : %s\n - Date : %s", str, str2, str3, date.toString()); - if (!Utility.validString(str)) { - Log.Helper.LOGE(this, "scheduleNotification(): Invalid title", new Object[0]); - return new Error(Error.Code.INVALID_ARGUMENT, "Invalid title"); - } - if (!Utility.validString(str2)) { - Log.Helper.LOGE(this, "scheduleNotification(): Invalid message", new Object[0]); - return new Error(Error.Code.INVALID_ARGUMENT, "Invalid message"); - } - if (date.before(date2)) { - Log.Helper.LOGE(this, "scheduleNotification(): Expired date", new Object[0]); - return new Error(Error.Code.INVALID_ARGUMENT, "Expired date"); - } - if (!Utility.validString(str3)) { - str3 = "auto_" + date2.getTime(); - } - Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); - Resources resources = ApplicationEnvironment.getComponent().getApplicationContext().getResources(); - String packageName = ApplicationEnvironment.getComponent().getApplicationContext().getPackageName(); - if (Build.VERSION.SDK_INT >= 26) { - Notification.Builder autoCancel = new Notification.Builder(applicationContext, NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_LOCAL_NOTIFICATION_ID_KEY) ? NimbleApplicationConfiguration.getConfigValueAsString(Global.NOTIFICATION_CHANNEL_LOCAL_NOTIFICATION_ID_KEY) : Global.NOTIFICATION_CHANNEL_DEFAULT_ID).setContentTitle(str).setContentText(str2).setAutoCancel(true); - try { - autoCancel.setSmallIcon(resources.getIdentifier("pn_icon", "drawable", packageName)); - build = autoCancel.build(); - } catch (Exception e) { - Log.Helper.LOGE(this, "scheduleNotification(): Not scheduled. Unable to set application icon due to exception: " + e.toString(), new Object[0]); - return new Error(Error.Code.SYSTEM_UNEXPECTED, "Unable to get pn_icon"); - } - } else { - NotificationCompat.Builder autoCancel2 = new NotificationCompat.Builder(applicationContext).setContentTitle(str).setContentText(str2).setAutoCancel(true); - try { - autoCancel2.setSmallIcon(resources.getIdentifier("pn_icon", "drawable", packageName)); - build = autoCancel2.build(); - } catch (Exception e2) { - Log.Helper.LOGE(this, "scheduleNotification(): Not scheduled. Unable to set application icon due to exception: " + e2.toString(), new Object[0]); - return new Error(Error.Code.SYSTEM_UNEXPECTED, "Unable to get pn_icon"); - } - } - this.m_notificationMap.put(str3, date); - saveNotificationMap(); - Intent intent = new Intent(applicationContext, (Class) NimbleLocalNotificationReceiver.class); - intent.putExtra("notification", build); - intent.putExtra(GcmIntentService.PushIntentExtraKeys.PUSH_ID, str3); - intent.putExtra(GcmIntentService.PushIntentExtraKeys.PN_TYPE, "local"); - ((AlarmManager) applicationContext.getSystemService(NotificationCompat.CATEGORY_ALARM)).set(0, System.currentTimeMillis() + (date.getTime() - date2.getTime()), PendingIntent.getBroadcast(applicationContext, str3 != null ? str3.hashCode() : 0, intent, 134217728)); - HashMap hashMap = new HashMap(); - hashMap.put("en", ShareConstants.WEB_DIALOG_PARAM_MESSAGE); - Bundle bundle = new Bundle(); - bundle.putSerializable("core", hashMap); - bundle.putString("msg_id", str3); - bundle.putString("type", "pn"); - bundle.putString(NotificationCompat.CATEGORY_SERVICE, "local"); - bundle.putString("status", "started"); - bundle.putString("format", "pn"); - Intent intent2 = new Intent(); - intent2.setAction(NOTIFICATION_TRACKING2_LOG_EVENT); - intent2.putExtras(bundle); - LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).sendBroadcast(intent2); + return null; } @@ -161,30 +82,7 @@ public class NimbleLocalNotificationsImpl extends Component implements INimbleLo @Override // com.ea.nimble.INimbleLocalNotifications public void cancelNotification(String str) { - Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); - PendingIntent broadcast = PendingIntent.getBroadcast(applicationContext, str.hashCode(), new Intent(applicationContext, (Class) NimbleLocalNotificationReceiver.class), DriveFile.MODE_WRITE_ONLY); - if (broadcast != null) { - broadcast.cancel(); - ((AlarmManager) applicationContext.getSystemService(NotificationCompat.CATEGORY_ALARM)).cancel(broadcast); - this.m_notificationMap.remove(str); - saveNotificationMap(); - Log.Helper.LOGD(this, "cancelNotification(%s): Successfully canceled", str); - HashMap hashMap = new HashMap(); - hashMap.put("en", ShareConstants.WEB_DIALOG_PARAM_MESSAGE); - Bundle bundle = new Bundle(); - bundle.putSerializable("core", hashMap); - bundle.putString("msg_id", str); - bundle.putString("type", "pn"); - bundle.putString(NotificationCompat.CATEGORY_SERVICE, "local"); - bundle.putString("status", "canceled"); - bundle.putString("format", "pn"); - Intent intent = new Intent(); - intent.setAction(NOTIFICATION_TRACKING2_LOG_EVENT); - intent.putExtras(bundle); - LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).sendBroadcast(intent); - return; - } - Log.Helper.LOGD(this, "cancelNotification(%s): Not found", str); + } @Override // com.ea.nimble.INimbleLocalNotifications @@ -211,79 +109,11 @@ public class NimbleLocalNotificationsImpl extends Component implements INimbleLo @Override // com.ea.nimble.INimbleLocalNotifications public Error setBadgeCount(int i, String str, String str2) { - Log.Helper.LOGPUBLICFUNC(this); - if (this.m_enabled) { - if (m_badgeProvider != null) { - return m_badgeProvider.setBadgeCount(i, str, str2); - } - if (Build.VERSION.SDK_INT >= 26) { - Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); - NotificationManager notificationManager = (NotificationManager) applicationContext.getSystemService("notification"); - Resources resources = ApplicationEnvironment.getComponent().getApplicationContext().getResources(); - String packageName = ApplicationEnvironment.getComponent().getApplicationContext().getPackageName(); - if (i == 0) { - notificationManager.cancel(BADGE_ID.hashCode()); - return null; - } - if (i < 0 || i > 999999) { - String str3 = "setBadgeCount(): Badge count " + String.valueOf(i) + "outside [0-999999] range"; - Log.Helper.LOGE(this, str3, new Object[0]); - return new Error(Error.Code.INVALID_ARGUMENT, str3); - } - if (!Utility.validString(str)) { - Log.Helper.LOGE(this, "setBadgeCount(): Invalid title", new Object[0]); - return new Error(Error.Code.INVALID_ARGUMENT, "Invalid title"); - } - if (!Utility.validString(str2)) { - Log.Helper.LOGE(this, "setBadgeCount(): Invalid message", new Object[0]); - return new Error(Error.Code.INVALID_ARGUMENT, "Invalid message"); - } - Notification.Builder visibility = new Notification.Builder(applicationContext, NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_LOCAL_NOTIFICATION_ID_KEY) ? NimbleApplicationConfiguration.getConfigValueAsString(Global.NOTIFICATION_CHANNEL_LOCAL_NOTIFICATION_ID_KEY) : Global.NOTIFICATION_CHANNEL_DEFAULT_ID).setContentTitle(str).setContentText(str2).setAutoCancel(true).setNumber(i).setVisibility(-1); - try { - visibility.setSmallIcon(resources.getIdentifier("pn_icon", "drawable", packageName)); - Notification build = visibility.build(); - Context applicationContext2 = applicationContext.getApplicationContext(); - String className = applicationContext2.getPackageManager().getLaunchIntentForPackage(applicationContext2.getPackageName()).resolveActivity(applicationContext2.getPackageManager()).getClassName(); - try { - Intent intent = new Intent(applicationContext, Class.forName(className)); - intent.putExtra(GcmIntentService.PushIntentExtraKeys.PUSH_ID, BADGE_ID); - intent.putExtra(GcmIntentService.PushIntentExtraKeys.PN_TYPE, "local"); - intent.setFlags(603979776); - build.contentIntent = PendingIntent.getActivity(applicationContext, 0, intent, 1073741824); - notificationManager.notify(BADGE_ID.hashCode(), build); - return null; - } catch (ClassNotFoundException e) { - String format = String.format("setBadgeCount(): Could not launch target activity: %s, exception: %s", className, e.toString()); - Log.Helper.LOGE(this, format, new Object[0]); - return new Error(Error.Code.SYSTEM_UNEXPECTED, format); - } - } catch (Exception e2) { - Log.Helper.LOGE(this, "setBadgeCount(): Unable to set application icon due to exception: " + e2.toString(), new Object[0]); - return new Error(Error.Code.SYSTEM_UNEXPECTED, "Unable to get pn_icon"); - } - } - Log.Helper.LOGE(this, "setBadgeCount(): Unsupported Android version, unable to set badge count", new Object[0]); - return new Error(Error.Code.UNSUPPORTED, "setBadgeCount(): Unsupported Android version, unable to set badge count"); - } - Log.Helper.LOGE(this, "setBadgeCount(): Local notifications are disabled, unable to set badge count", new Object[0]); - return new Error(Error.Code.NOT_AVAILABLE, "setBadgeCount(): Local notifications are disabled, unable to set badge count"); + return new Error(Error.Code.NOT_AVAILABLE, "setBadgeCount() hehe"); } @Override // com.ea.nimble.INimbleLocalNotifications public int getBadgeCount() { - Log.Helper.LOGPUBLICFUNC(this); - if (m_badgeProvider != null) { - return m_badgeProvider.getBadgeCount(); - } - if (Build.VERSION.SDK_INT >= 26) { - for (StatusBarNotification statusBarNotification : ((NotificationManager) ApplicationEnvironment.getComponent().getApplicationContext().getSystemService("notification")).getActiveNotifications()) { - if (statusBarNotification.getId() == BADGE_ID.hashCode()) { - return statusBarNotification.getNotification().number; - } - } - } else { - Log.Helper.LOGE(this, "getBadgeCount(): Unsupported Android version, unable to get badge count", new Object[0]); - } return 0; } diff --git a/app/src/main/java/com/ea/nimble/Persistence.java b/app/src/main/java/com/ea/nimble/Persistence.java index ea80a40..7347a98 100644 --- a/app/src/main/java/com/ea/nimble/Persistence.java +++ b/app/src/main/java/com/ea/nimble/Persistence.java @@ -14,6 +14,7 @@ import java.io.InvalidClassException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; +import java.security.GeneralSecurityException; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -289,7 +290,7 @@ public class Persistence implements LogSource { return; } clearSynchronizeTimer(); - savePersistenceData(); + //savePersistenceData(); if (this.m_backUp) { new BackupManager(ApplicationEnvironment.getComponent().getApplicationContext()).dataChanged(); } @@ -328,8 +329,8 @@ public class Persistence implements LogSource { private void loadPersistenceData(boolean z, Context context) { String persistencePath; - FileInputStream fileInputStream; - ObjectInputStream objectInputStream; + FileInputStream fileInputStream = null; + ObjectInputStream objectInputStream = null; ObjectInputStream objectInputStream2; Log.Helper.LOGFUNC(this); if (context == null) { @@ -373,11 +374,9 @@ public class Persistence implements LogSource { throw th; } } catch (Throwable th2) { - th = th2; fileInputStream = fileInputStream2; } } catch (Exception e2) { - e = e2; } if (objectInputStream.readInt() != PERSISTENCE_VERSION) { throw new InvalidClassException("com.ea.nimble.Persistence", "Persistence version doesn't match"); @@ -397,7 +396,9 @@ public class Persistence implements LogSource { } objectInputStream.close(); fileInputStream.close(); - } catch (IOException unused2) { + } catch (IOException ignored) { + } catch (ClassNotFoundException | GeneralSecurityException e) { + throw new RuntimeException(e); } } @@ -449,7 +450,7 @@ public class Persistence implements LogSource { Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ - static java.io.File getPersistenceDirectory(com.ea.nimble.Persistence.Storage r6, android.content.Context r7) { + static File getPersistenceDirectory(Storage r6, Context r7) { /* int[] r0 = com.ea.nimble.Persistence.AnonymousClass2.$SwitchMap$com$ea$nimble$Persistence$Storage int r1 = r6.ordinal() diff --git a/app/src/main/java/com/ea/nimble/PersistenceService.java b/app/src/main/java/com/ea/nimble/PersistenceService.java index 5e83c89..876f59a 100644 --- a/app/src/main/java/com/ea/nimble/PersistenceService.java +++ b/app/src/main/java/com/ea/nimble/PersistenceService.java @@ -100,17 +100,7 @@ public class PersistenceService { } catch (Throwable th) { th = th; } - try { - fileOutputStream.write(bArr); - fileOutputStream.close(); - } catch (Throwable th2) { - th = th2; - fileOutputStream2 = fileOutputStream; - if (fileOutputStream2 != null) { - fileOutputStream2.close(); - } - throw th; - } + } if (ApplicationEnvironment.isMainApplicationRunning()) { for (Persistence persistence : ((PersistenceServiceImpl) getComponent()).m_persistences.values()) { diff --git a/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java b/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java index 5d03a42..f8c52f6 100644 --- a/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java +++ b/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java @@ -1,9 +1,5 @@ package com.ea.nimble; -import com.ea.nimble.Log; -import com.ea.nimble.Persistence; -import com.ea.nimble.PersistenceService; -import com.google.android.vending.expansion.downloader.Constants; import java.io.File; import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; @@ -57,7 +53,7 @@ public class PersistenceServiceImpl extends Component implements IPersistenceSer return loadPersistenceById; } Persistence persistence = new Persistence(str, storage, this.m_encryptor); - this.m_persistences.put(str + Constants.FILENAME_SEQUENCE_SEPARATOR + storage.toString(), persistence); + this.m_persistences.put(str + "-" + storage.toString(), persistence); return persistence; } } @@ -80,7 +76,7 @@ public class PersistenceServiceImpl extends Component implements IPersistenceSer return; } synchronized (Persistence.s_dataLock) { - this.m_persistences.remove(str + Constants.FILENAME_SEQUENCE_SEPARATOR + storage.toString()); + this.m_persistences.remove(str + "-" + storage.toString()); } } @@ -126,7 +122,7 @@ public class PersistenceServiceImpl extends Component implements IPersistenceSer return; } synchronized (Persistence.s_dataLock) { - String str3 = str2 + Constants.FILENAME_SEQUENCE_SEPARATOR + storage.toString(); + String str3 = str2 + "-" + storage.toString(); Persistence loadPersistenceById = loadPersistenceById(str, storage); if (loadPersistenceById == null) { if (persistenceMergePolicy == PersistenceService.PersistenceMergePolicy.OVERWRITE) { @@ -161,7 +157,7 @@ public class PersistenceServiceImpl extends Component implements IPersistenceSer private Persistence loadPersistenceById(String str, Persistence.Storage storage) { Log.Helper.LOGFUNC(this); synchronized (Persistence.s_dataLock) { - String str2 = str + Constants.FILENAME_SEQUENCE_SEPARATOR + storage.toString(); + String str2 = str + "-" + storage.toString(); Persistence persistence = this.m_persistences.get(str2); if (persistence != null) { return persistence; diff --git a/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java b/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java index 82c37f4..30ef390 100644 --- a/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java +++ b/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java @@ -6,10 +6,6 @@ import android.content.res.Resources; import android.preference.PreferenceManager; import android.provider.Settings; import android.telephony.TelephonyManager; -import com.ea.nimble.Error; -import com.ea.nimble.Log; -import com.ea.nimble.Network; -import com.facebook.places.model.PlaceFields; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -106,7 +102,7 @@ class SynergyEnvironmentUpdater implements LogSource { this.m_environmentForSynergyStartUp.setServerUrls(new HashMap()); if (list != null) { for (Map map2 : list) { - this.m_environmentForSynergyStartUp.getServerUrls().put(map2.get("key"), map2.get("value")); + this.m_environmentForSynergyStartUp.getServerUrls().put((String) map2.get("key"), (String) map2.get("value")); } } if (this.m_environmentForSynergyStartUp.getServerUrls().size() == 0) { @@ -114,15 +110,8 @@ class SynergyEnvironmentUpdater implements LogSource { return; } if (this.m_previousValidEnvironmentData != null && Utility.validString(this.m_previousValidEnvironmentData.getEADeviceId())) { - callSynergyValidateEADeviceId(this.m_previousValidEnvironmentData.getEADeviceId()); return; } - String loadEADeviceId = EASPDataLoader.loadEADeviceId(); - if (loadEADeviceId != null) { - callSynergyValidateEADeviceId(loadEADeviceId); - } else { - callSynergyGetEADeviceId(); - } } /* JADX INFO: Access modifiers changed from: private */ @@ -220,128 +209,6 @@ class SynergyEnvironmentUpdater implements LogSource { } } - /* JADX INFO: Access modifiers changed from: private */ - public void callSynergyGetEADeviceId() { - int phoneType; - String string; - Log.Helper.LOGFUNC(this); - EnvironmentDataContainer environmentDataContainer = this.m_environmentForSynergyStartUp; - HashMap hashMap = new HashMap(); - hashMap.put("apiVer", "1.0.0"); - hashMap.put("hwId", environmentDataContainer.getEAHardwareId()); - IApplicationEnvironment component = ApplicationEnvironment.getComponent(); - Context applicationContext = component != null ? component.getApplicationContext() : null; - if (applicationContext != null && (string = Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id")) != null) { - hashMap.put(ApplicationEnvironment.NIMBLE_PARAMETER_ANDROID_ID, string); - } - if (applicationContext != null) { - TelephonyManager telephonyManager = (TelephonyManager) applicationContext.getSystemService(PlaceFields.PHONE); - PackageManager packageManager = applicationContext.getPackageManager(); - if (telephonyManager != null && packageManager != null && packageManager.checkPermission("android.permission.READ_PHONE_STATE", applicationContext.getPackageName()) == 0 && (phoneType = telephonyManager.getPhoneType()) != 0) { - String deviceId = telephonyManager.getDeviceId(); - if (Utility.validString(deviceId)) { - String str = ApplicationEnvironment.NIMBLE_PARAMETER_IMEI; - if (phoneType == 2) { - str = "meid"; - } - hashMap.put(str, deviceId); - } - } - } - this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_USER), "/user/api/android/getDeviceID", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.2 - @Override // com.ea.nimble.SynergyNetworkConnectionCallback - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - SynergyEnvironmentUpdater.this.m_synergyNetworkConnectionHandle = null; - Exception error = synergyNetworkConnectionHandle.getResponse().getError(); - if (error != null) { - if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount >= 3) { - SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount = 0L; - Log.Helper.LOGD(this, "GetEADeviceID Error (%s)", synergyNetworkConnectionHandle.getResponse().getError()); - SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_EA_DEVICE_ID_FAILURE, "GetEADevideId call failed", synergyNetworkConnectionHandle.getResponse().getError())); - return; - } else { - SynergyEnvironmentUpdater.access$808(SynergyEnvironmentUpdater.this); - Log.Helper.LOGD(this, "GetEADeviceID, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount)); - SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); - return; - } - } - Log.Helper.LOGD(this, "GetEADeviceID Success", new Object[0]); - SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setEADeviceId((String) synergyNetworkConnectionHandle.getResponse().getJsonData().get("deviceId")); - SynergyEnvironmentUpdater.this.callSynergyGetAnonUid(); - } - }); - } - - /* JADX INFO: Access modifiers changed from: private */ - public void callSynergyValidateEADeviceId(final String str) { - int phoneType; - String string; - Log.Helper.LOGFUNC(this); - EnvironmentDataContainer environmentDataContainer = this.m_environmentForSynergyStartUp; - HashMap hashMap = new HashMap(); - hashMap.put("apiVer", "1.0.0"); - hashMap.put("hwId", environmentDataContainer.getEAHardwareId()); - hashMap.put("eadeviceid", str); - IApplicationEnvironment component = ApplicationEnvironment.getComponent(); - Context applicationContext = component != null ? component.getApplicationContext() : null; - if (applicationContext != null && (string = Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id")) != null) { - hashMap.put(ApplicationEnvironment.NIMBLE_PARAMETER_ANDROID_ID, string); - } - if (applicationContext != null) { - TelephonyManager telephonyManager = (TelephonyManager) applicationContext.getSystemService(PlaceFields.PHONE); - PackageManager packageManager = applicationContext.getPackageManager(); - if (telephonyManager != null && packageManager != null && packageManager.checkPermission("android.permission.READ_PHONE_STATE", applicationContext.getPackageName()) == 0 && (phoneType = telephonyManager.getPhoneType()) != 0) { - String deviceId = telephonyManager.getDeviceId(); - if (Utility.validString(deviceId)) { - String str2 = ApplicationEnvironment.NIMBLE_PARAMETER_IMEI; - if (phoneType == 2) { - str2 = "meid"; - } - hashMap.put(str2, deviceId); - } - } - } - this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_USER), "/user/api/android/validateDeviceID", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.3 - @Override // com.ea.nimble.SynergyNetworkConnectionCallback - public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { - SynergyEnvironmentUpdater.this.m_synergyNetworkConnectionHandle = null; - Exception error = synergyNetworkConnectionHandle.getResponse().getError(); - if (error == null) { - Log.Helper.LOGD(this, "ValidateEADeviceID Success", new Object[0]); - SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setEADeviceId((String) synergyNetworkConnectionHandle.getResponse().getJsonData().get("deviceId")); - SynergyEnvironmentUpdater.this.callSynergyGetAnonUid(); - return; - } - Log.Helper.LOGD(this, "ValidateEADeviceID Error (%s)", error); - if (error instanceof SynergyServerError) { - SynergyServerError synergyServerError = (SynergyServerError) error; - if (synergyServerError.isError(SynergyEnvironmentUpdater.SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_CLEAR_CLIENT_CACHED_EADEVICEID)) { - if (SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData != null) { - SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData.setEADeviceId(null); - } - Log.Helper.LOGD(this, "ValidateEADeviceID, Server signal received to delete cached EA Device ID. Making request to get a new EA Device ID.", new Object[0]); - SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); - return; - } - if (synergyServerError.isError(SynergyEnvironmentUpdater.SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_VALIDATION_FAILED)) { - Log.Helper.LOGD(this, "ValidateEADeviceID, EADeviceID validation failed. Making request to get a new EA Device ID.", new Object[0]); - SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); - return; - } - } - if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount >= 3) { - SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount = 0L; - SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_EA_DEVICE_ID_FAILURE, "ValidateEADeviceId call failed", error)); - } else { - SynergyEnvironmentUpdater.access$1108(SynergyEnvironmentUpdater.this); - Log.Helper.LOGD(this, "ValidateEADeviceID, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount)); - SynergyEnvironmentUpdater.this.callSynergyValidateEADeviceId(str); - } - } - }); - } - /* JADX INFO: Access modifiers changed from: private */ public void callSynergyGetAnonUid() { Log.Helper.LOGFUNC(this); diff --git a/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java b/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java index 9c7f781..630ee12 100644 --- a/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java +++ b/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java @@ -1,6 +1,5 @@ package com.ea.nimble; -import com.eamobile.DownloadActivityInternal; /* loaded from: classes.dex */ public class SynergyIdManagerError extends Error { @@ -9,8 +8,8 @@ public class SynergyIdManagerError extends Error { public enum Code { AUTHENTICATOR_CONFLICT(5000), - UNEXPECTED_LOGIN_STATE(DownloadActivityInternal.ERROR_UNSUPPORTED_DEVICE), - INVALID_ID(DownloadActivityInternal.ERROR_ASSETS_NOT_FOUND), + UNEXPECTED_LOGIN_STATE(3), + INVALID_ID(3), MISSING_AUTHENTICATOR(5003); private int m_value; diff --git a/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java b/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java index 7f469db..53a20c3 100644 --- a/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java +++ b/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java @@ -3,12 +3,6 @@ package com.ea.nimble; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import com.ea.nimble.ComponentManager; -import com.ea.nimble.Error; -import com.ea.nimble.IHttpRequest; -import com.ea.nimble.ISynergyRequest; -import com.ea.nimble.Log; -import com.google.android.vending.expansion.downloader.Constants; import java.util.ArrayList; import java.util.Iterator; import java.util.Locale; @@ -155,6 +149,6 @@ public class SynergyNetworkImpl extends Component implements ISynergyNetwork { private String generateSessionId() { Log.Helper.LOGFUNC(this); - return UUID.randomUUID().toString().replace(Constants.FILENAME_SEQUENCE_SEPARATOR, "").toLowerCase(Locale.US); + return UUID.randomUUID().toString().replace("-", "").toLowerCase(Locale.US); } } diff --git a/app/src/main/java/com/ea/nimble/SynergyResponse.java b/app/src/main/java/com/ea/nimble/SynergyResponse.java index 0b60e69..91c0149 100644 --- a/app/src/main/java/com/ea/nimble/SynergyResponse.java +++ b/app/src/main/java/com/ea/nimble/SynergyResponse.java @@ -1,8 +1,5 @@ package com.ea.nimble; -import com.ea.nimble.Error; -import com.ea.nimble.Log; -import com.facebook.share.internal.ShareConstants; import java.util.Map; import org.json.JSONObject; @@ -28,7 +25,7 @@ public class SynergyResponse implements ISynergyResponse { if (!this.jsonData.containsKey("resultCode") || (intValue = ((Integer) this.jsonData.get("resultCode")).intValue()) >= 0) { return; } - this.error = new SynergyServerError(intValue, (String) this.jsonData.get(ShareConstants.WEB_DIALOG_PARAM_MESSAGE)); + this.error = new SynergyServerError(intValue, (String) this.jsonData.get("")); } catch (Exception e2) { e = e2; this.jsonData = null; diff --git a/app/src/main/java/com/ea/nimble/SynergyServerError.java b/app/src/main/java/com/ea/nimble/SynergyServerError.java index 0214081..6df885e 100644 --- a/app/src/main/java/com/ea/nimble/SynergyServerError.java +++ b/app/src/main/java/com/ea/nimble/SynergyServerError.java @@ -1,7 +1,5 @@ package com.ea.nimble; -import com.google.android.gms.games.GamesActivityResultCodes; - /* loaded from: classes.dex */ public class SynergyServerError extends Error { public static final String ERROR_DOMAIN = "SynergyServerError"; @@ -12,7 +10,7 @@ public class SynergyServerError extends Error { ERROR_SIGNATURE_VERIFICATION(-30014), ERROR_NOT_SUPPORTED_RECEIPT_TYPE(-30015), AMAZON_SERVER_CONNECTION_ERROR(-30016), - APPLE_SERVER_CONNECTION_ERROR(GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED); + APPLE_SERVER_CONNECTION_ERROR(1111110); private int m_value; diff --git a/app/src/main/java/com/ea/nimble/Utility.java b/app/src/main/java/com/ea/nimble/Utility.java index 6ed3dd6..075643b 100644 --- a/app/src/main/java/com/ea/nimble/Utility.java +++ b/app/src/main/java/com/ea/nimble/Utility.java @@ -9,7 +9,9 @@ import android.content.pm.ResolveInfo; import android.os.AsyncTask; import android.os.Bundle; import android.os.Looper; -import android.support.v4.content.LocalBroadcastManager; + +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + import com.ea.nimble.Log; import com.google.gson.GsonBuilder; import java.io.IOException; @@ -29,7 +31,6 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TimeZone; -import org.apache.http.protocol.HTTP; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -258,7 +259,7 @@ public final class Utility { byte[] bArr = new byte[open.available()]; open.read(bArr); open.close(); - return new String(bArr, HTTP.UTF_8); + return new String(bArr); } catch (IOException e) { Log.Helper.LOGV("Utility", "readFile(): %s", e.toString()); return null; @@ -266,33 +267,15 @@ public final class Utility { } public static void sendBroadcast(String str) { - LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).sendBroadcast(new Intent(str)); } public static void sendBroadcast(String str, Map map) { - LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()); - Intent intent = new Intent(str); - if (map != null) { - for (Map.Entry entry : map.entrySet()) { - intent.putExtra(entry.getKey(), entry.getValue()); - } - } - localBroadcastManager.sendBroadcast(intent); } - public static void sendBroadcast(String str, Bundle bundle) { - LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).sendBroadcast(new Intent(str).replaceExtras(bundle)); - } + public static void sendBroadcast(String str, Bundle bundle) {} public static void sendBroadcastSerializable(String str, Map map) { - LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()); - Intent intent = new Intent(str); - if (map != null) { - for (Map.Entry entry : map.entrySet()) { - intent.putExtra(entry.getKey(), entry.getValue()); - } - } - localBroadcastManager.sendBroadcast(intent); + } public static void sendExplicitBroadcast(Intent intent) { diff --git a/app/src/main/java/com/ea/nimble/WebView.java b/app/src/main/java/com/ea/nimble/WebView.java index 8bf5912..61a9aad 100644 --- a/app/src/main/java/com/ea/nimble/WebView.java +++ b/app/src/main/java/com/ea/nimble/WebView.java @@ -47,9 +47,6 @@ public class WebView extends Activity { final String string = getIntent().getExtras().getString("Redirect_URL"); if (extras.containsKey("Oauth_URL")) { webView.loadUrl(getIntent().getExtras().getString("Oauth_URL")); - if (string == null || string.isEmpty()) { - string = ""; - } webView.setWebViewClient(new WebViewClient() { // from class: com.ea.nimble.WebView.1 @Override // android.webkit.WebViewClient public void onPageStarted(android.webkit.WebView webView2, String str, Bitmap bitmap) { diff --git a/app/src/main/java/com/ea/nimble/bridge/GoogleServiceRequestCallback.java b/app/src/main/java/com/ea/nimble/bridge/GoogleServiceRequestCallback.java deleted file mode 100644 index 150d8c2..0000000 --- a/app/src/main/java/com/ea/nimble/bridge/GoogleServiceRequestCallback.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.ea.nimble.bridge; - -import com.ea.nimble.Error; -import com.ea.nimble.INimbleAndroidGoogleService; -import java.util.Map; - -/* loaded from: classes.dex */ -public class GoogleServiceRequestCallback implements INimbleAndroidGoogleService.RequestCallback { - private int m_id; - - public GoogleServiceRequestCallback(int i) { - this.m_id = i; - } - - public void callback(Map map, Error error) { - BaseNativeCallback.sendNativeCallback(this.m_id, map, error); - } - - public void finalize() { - BaseNativeCallback.nativeFinalize(this.m_id); - } -} diff --git a/app/src/main/java/com/ea/nimble/bridge/NimbleCppApplicationLifeCycle.java b/app/src/main/java/com/ea/nimble/bridge/NimbleCppApplicationLifeCycle.java index 7a6f11d..97848d5 100644 --- a/app/src/main/java/com/ea/nimble/bridge/NimbleCppApplicationLifeCycle.java +++ b/app/src/main/java/com/ea/nimble/bridge/NimbleCppApplicationLifeCycle.java @@ -3,7 +3,6 @@ package com.ea.nimble.bridge; import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import com.ea.eadp.pushnotification.forwarding.GcmIntentService; import com.ea.nimble.ApplicationEnvironment; import com.ea.nimble.ApplicationLifecycle; import com.ea.nimble.Base; @@ -143,18 +142,6 @@ public class NimbleCppApplicationLifeCycle extends Component implements IApplica } private void parsePushNotificationDetails(Map map, Bundle bundle) { - map.put("mode", "pn"); - if (bundle == null || bundle.isEmpty()) { - return; - } - if (bundle.containsKey(GcmIntentService.PushIntentExtraKeys.PUSH_ID)) { - map.put(GcmIntentService.PushIntentExtraKeys.PUSH_ID, bundle.getString(GcmIntentService.PushIntentExtraKeys.PUSH_ID)); - } - if (bundle.containsKey(GcmIntentService.PushIntentExtraKeys.PN_TYPE)) { - map.put(GcmIntentService.PushIntentExtraKeys.PN_TYPE, bundle.getString(GcmIntentService.PushIntentExtraKeys.PN_TYPE)); - } - if (map.containsKey(GcmIntentService.PushIntentExtraKeys.PUSH_ID) || map.containsKey(GcmIntentService.PushIntentExtraKeys.PN_TYPE)) { - map.put("deviceId", SynergyEnvironment.getComponent().getEADeviceId()); - } + } } diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java b/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java index f0e0675..9cda129 100644 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java @@ -1,8 +1,6 @@ package com.ea.nimble.friends; import com.ea.nimble.Global; -import com.ea.nimble.friends.NimbleUser; -import com.facebook.share.internal.ShareConstants; import java.util.Date; import org.json.JSONObject; @@ -12,7 +10,7 @@ class NimbleFacebookUser extends NimbleUser { this.authenticatorId = Global.NIMBLE_AUTHENTICATOR_FACEBOOK; this.userId = jSONObject.optString("id"); this.displayName = jSONObject.optString("name"); - this.imageUrl = jSONObject.optJSONObject("picture").optJSONObject(ShareConstants.WEB_DIALOG_PARAM_DATA).optString("url"); + this.imageUrl = ""; this.refreshTimestamp = new Date(); setPlayedCurrentGame(NimbleUser.PlayedCurrentGameFlag.PLAYED); } diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java index 9322775..9a35e32 100644 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java @@ -1,8 +1,6 @@ package com.ea.nimble.friends; -import android.support.v4.internal.view.SupportMenu; import com.ea.nimble.Error; -import com.google.android.gms.games.GamesActivityResultCodes; /* loaded from: classes.dex */ public class NimbleFriendsError extends Error { @@ -24,12 +22,12 @@ public class NimbleFriendsError extends Error { NIMBLE_FRIENDS_SERVER_HTTP_ERROR(80002), NIMBLE_FRIENDS_SERVER_CODE_ERROR(80003), NIMBLE_FRIENDS_SERVER_INVALID_RESPONSE_ERROR(80004), - NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID(GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED), - NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT(GamesActivityResultCodes.RESULT_SIGN_IN_FAILED), - NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID_START_INDEX(GamesActivityResultCodes.RESULT_LICENSE_FAILED), - NIMBLE_FRIENDS_REFRESH_FRIENDS_PROVIDER_NOT_AVAILABLE(GamesActivityResultCodes.RESULT_APP_MISCONFIGURED), - NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST(GamesActivityResultCodes.RESULT_LEFT_ROOM), - NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_ERROR(GamesActivityResultCodes.RESULT_NETWORK_FAILURE), + NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID(1111110), + NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT(1111111), + NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID_START_INDEX(1111112), + NIMBLE_FRIENDS_REFRESH_FRIENDS_PROVIDER_NOT_AVAILABLE(1111113), + NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST(1111114), + NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_ERROR(234234234), NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE(10007), NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY(10008), NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED(10009), @@ -40,7 +38,7 @@ public class NimbleFriendsError extends Error { NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR(10015), NIMBLE_FRIENDS_REFRESH_SCOPE_FRIENDS_LIST_TYPE_UNSUPPORTED(10016), NIMBLE_FRIENDS_REFRESH_TYPE_UNSUPPORTED(10017), - NIMBLE_FRIENDS_UNKNOWN_ERROR(SupportMenu.USER_MASK), + NIMBLE_FRIENDS_UNKNOWN_ERROR(23423423), NIMBLE_FRIENDS_SERVER_RETURNED_ERROR(90009), NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR(10018), NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST(10012); diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java index 5930561..45e2f9b 100644 --- a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java @@ -12,12 +12,9 @@ import com.ea.nimble.NetworkConnectionCallback; import com.ea.nimble.NetworkConnectionHandle; import com.ea.nimble.SynergyEnvironment; import com.ea.nimble.Utility; -import com.ea.nimble.friends.NimbleFriendsError; -import com.ea.nimble.friends.NimbleFriendsList; import com.ea.nimble.identity.INimbleIdentity; import com.ea.nimble.identity.INimbleIdentityAuthenticator; import com.ea.nimble.identity.NimbleIdentityPidInfo; -import com.facebook.internal.ServerProtocol; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; @@ -27,7 +24,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Scanner; -import org.apache.http.HttpStatus; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -76,63 +72,12 @@ public class NimbleFriendsListOrigin extends NimbleFriendsListImpl { iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListOrigin.1 @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str2, String str3, Error error) { - if (error == null) { - NimbleFriendsListOrigin.this.sendGosRefreshFriendsRequest(i, i2, str2, str3, pid, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); - } else { - NimbleFriendsListOrigin.this.invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, error, friendsListType); - } + } }); } } - /* JADX INFO: Access modifiers changed from: private */ - public void sendGosRefreshFriendsRequest(int i, int i2, String str, String str2, String str3, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { - Log.Helper.LOGFUNC(this); - try { - HttpRequest makeGetFriendsRequest = makeGetFriendsRequest(i, i2, true, str, str2, str3); - if (makeGetFriendsRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for GOS getFriendsList", new Object[0]); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for GOS getFriendsList", friendsListType); - return; - } - try { - Network.getComponent().sendRequest(makeGetFriendsRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListOrigin.2 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - ArrayList parseBodyJSONData = NimbleFriendsListOrigin.this.parseBodyJSONData(networkConnectionHandle); - if (parseBodyJSONData != null && parseBodyJSONData.size() > 0) { - Log.Helper.LOGD(this, "Successful in retrieving friends list from GOS", new Object[0]); - NimbleFriendsListOrigin.this.updateFriendsListBasicInfo(parseBodyJSONData, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); - return; - } - if (NimbleFriendsListOrigin.this.lastError != null) { - Log.Helper.LOGE(this, NimbleFriendsListOrigin.this.lastError.getMessage(), new Object[0]); - NimbleFriendsListOrigin.this.invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsListOrigin.this.lastError, friendsListType); - } else if (NimbleFriendsListOrigin.this.lastError == null && parseBodyJSONData != null && parseBodyJSONData.size() <= 0) { - Log.Helper.LOGD(this, "GOS FriendsList request is successful, but there are no friends", new Object[0]); - NimbleFriendsListOrigin.this.updateFriendsListBasicInfo(parseBodyJSONData, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); - } else { - Log.Helper.LOGE(this, "Error in response for GOS getFriendsList request", new Object[0]); - NimbleFriendsListOrigin.this.invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_EMPTY_HTTP_RESPONSE, "Error in response for GOS getFriendsList request", friendsListType); - } - } catch (Error e) { - String str4 = "Error parsing response from GOS" + e.getMessage(); - Log.Helper.LOGE(this, str4, new Object[0]); - NimbleFriendsListOrigin.this.invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, str4, friendsListType); - } - } - }); - } catch (Exception unused) { - String format = String.format("Authenticator (%s) does not support Identity Refresh for Friends List", this.m_authenticatorId); - Log.Helper.LOGE(this, format, new Object[0]); - invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED, format, friendsListType); - } - } catch (Exception unused2) { - } - } - @Override // com.ea.nimble.friends.NimbleFriendsListImpl protected void refreshFriendsListIdentityInfo(ArrayList arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) { Log.Helper.LOGFUNC(this); @@ -155,300 +100,19 @@ public class NimbleFriendsListOrigin extends NimbleFriendsListImpl { iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListOrigin.3 @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str, String str2, Error error) { - if (error == null) { - NimbleFriendsListOrigin.this.sendGosRefreshAvatarsRequest(str, str2, list, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshScope); - } else { + if (error != null) { NimbleFriendsListOrigin.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, error, friendsListType); } + //NimbleFriendsListOrigin.this.sendGosRefreshAvatarsRequest(str, str2, list, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshScope); } }); } } - /* JADX INFO: Access modifiers changed from: private */ - public void sendGosRefreshAvatarsRequest(String str, String str2, List list, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { - Log.Helper.LOGFUNC(this); - try { - HttpRequest makeGetFriendsAvatarInfoRequest = makeGetFriendsAvatarInfoRequest(str, str2, list); - if (makeGetFriendsAvatarInfoRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for GOS getAvatarInfo", new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for GOS getAvatarInfo", friendsListType); - } else { - Network.getComponent().sendRequest(makeGetFriendsAvatarInfoRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListOrigin.4 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - ArrayList parseAvatarInfoXml = NimbleFriendsListOrigin.this.parseAvatarInfoXml(networkConnectionHandle); - if (parseAvatarInfoXml != null && parseAvatarInfoXml.size() > 0) { - NimbleFriendsListOrigin.this.updateFriendsListAvatarInfo(parseAvatarInfoXml, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshScope); - } - if (NimbleFriendsListOrigin.this.lastError != null) { - NimbleFriendsListOrigin.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsListOrigin.this.lastError, friendsListType); - } else { - Log.Helper.LOGE(NimbleFriendsListOrigin.this, "Error in response for GOS getAvatarInfo request", new Object[0]); - NimbleFriendsListOrigin.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_EMPTY_HTTP_RESPONSE, "Error in response for GOS getAvatarInfo request", friendsListType); - } - } catch (Exception e) { - if (NimbleFriendsListOrigin.this.lastError != null) { - NimbleFriendsListOrigin.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsListOrigin.this.lastError, friendsListType); - return; - } - Log.Helper.LOGE(this, String.format("GoS Avatar Info XML parsIng raised an exception. Details: %s", e.getMessage()), new Object[0]); - e.printStackTrace(); - NimbleFriendsListOrigin.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to parse response XML for Avatar Info"), friendsListType); - } - } - }); - } - } catch (Exception e) { - Log.Helper.LOGE(this, String.format("Exception raised when creating GoS Avatar URL refresh request. Exception: %s", e.getMessage()), new Object[0]); - invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to process request for Avatar Info"), friendsListType); - } - } - - private HttpRequest makeGetFriendsRequest(int i, int i2, boolean z, String str, String str2, String str3) { - String format; - HttpRequest httpRequest; - Log.Helper.LOGFUNC(this); - String originFriendsUrlFromSynergy = getOriginFriendsUrlFromSynergy(); - String mdmAppKey = getMdmAppKey(); - if (str == null || str.length() <= 0) { - Log.Helper.LOGE(this, "Failed to create GOS friends request because access token for Origin is null or invalid", new Object[0]); - return null; - } - if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) { - Log.Helper.LOGE(this, "Failed to create GOS friends request because GOS request URL is null or invalid", new Object[0]); - return null; - } - if (mdmAppKey == null || mdmAppKey.length() <= 0) { - Log.Helper.LOGE(this, "Failed to create GOS friends request because MDM App Key is null or invalid", new Object[0]); - return null; - } - if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGE(this, "Failed to create GOS friends request because Origin user's PID is null or invalid", new Object[0]); - return null; - } - String str4 = str2 + " " + str; - if (z) { - format = String.format(GET_FRIENDS_URI_PARAMS, str3, Integer.valueOf(i), Integer.valueOf(i2), ServerProtocol.DIALOG_RETURN_SCOPES_TRUE); - } else { - format = String.format(GET_FRIENDS_URI_PARAMS, str3, Integer.valueOf(i), Integer.valueOf(i2), "false"); - } - try { - httpRequest = new HttpRequest(new URL(originFriendsUrlFromSynergy + format)); - } catch (MalformedURLException e) { - e = e; - httpRequest = null; - } - try { - httpRequest.method = IHttpRequest.Method.GET; - HashMap hashMap = new HashMap<>(); - hashMap.put("Authorization", str4); - hashMap.put("X-Application-Key", mdmAppKey); - hashMap.put("X-Api-Version", "2"); - httpRequest.headers = hashMap; - } catch (MalformedURLException e2) { - e = e2; - Log.Helper.LOGW(this, "Exception when creating GOS getFreindList request URL. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } - return httpRequest; - } - - private HttpRequest makeGetFriendsAvatarInfoRequest(String str, String str2, List list) { - HttpRequest httpRequest; - Log.Helper.LOGFUNC(this); - String originAvatarsUrlFromSynergy = getOriginAvatarsUrlFromSynergy(); - if (str == null || str.length() <= 0 || list == null || list.size() <= 0 || list.size() > 20 || originAvatarsUrlFromSynergy == null || originAvatarsUrlFromSynergy.length() <= 0) { - return null; - } - StringBuilder sb = new StringBuilder(); - Iterator it = list.iterator(); - while (it.hasNext()) { - sb.append(it.next()); - sb.append(";"); - } - sb.deleteCharAt(sb.length() - 1); - try { - httpRequest = new HttpRequest(new URL(originAvatarsUrlFromSynergy + String.format(GET_FRIENDS_AVATAR_URI, sb.toString()))); - try { - httpRequest.method = IHttpRequest.Method.GET; - HashMap hashMap = new HashMap<>(); - hashMap.put("AuthToken", str); - httpRequest.headers = hashMap; - } catch (MalformedURLException e) { - e = e; - Log.Helper.LOGE(this, "Exception when creating GOS getAvatarInfo request URL. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } - } catch (MalformedURLException e2) { - e = e2; - httpRequest = null; - } - return httpRequest; - } - - private String getOriginFriendsUrlFromSynergy() { - Log.Helper.LOGFUNC(this); - String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_EADP_FRIENDS_HOST); - if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { - return null; - } - return serverUrlWithKey.charAt(serverUrlWithKey.length() + (-1)) == '/' ? serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1) : serverUrlWithKey; - } - - private String getOriginAvatarsUrlFromSynergy() { - Log.Helper.LOGFUNC(this); - String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_ORIGIN_AVATAR); - if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { - return null; - } - return serverUrlWithKey.charAt(serverUrlWithKey.length() + (-1)) == '/' ? serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1) : serverUrlWithKey; - } - - private String getMdmAppKey() { - Log.Helper.LOGFUNC(this); - return SynergyEnvironment.getComponent().getGosMdmAppKey(); - } - - /* JADX INFO: Access modifiers changed from: private */ - public ArrayList parseAvatarInfoXml(NetworkConnectionHandle networkConnectionHandle) throws Error { - Log.Helper.LOGFUNC(this); - this.lastError = null; - int statusCode = networkConnectionHandle.getResponse().getStatusCode(); - if (statusCode != 200) { - switch (statusCode) { - case 400: - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, String.format("Avatar Info HTTP Resonse Error. Description: %s", "The indicated parameter is empty or invalid.")); - break; - case HttpStatus.SC_UNAUTHORIZED /* 401 */: - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, String.format("Avatar Info HTTP Resonse Error. Description: %s", "The specified AuthToken is empty or invalid.")); - break; - default: - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, "Avatar Info HTTP Resonse Error"); - break; - } - throw this.lastError; - } - InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); - if (dataStream == null || dataStream.toString().length() == 0) { - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_HTTP_ERROR, "Empty response from server for refreshing avatar", new HttpError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage())); - } - try { - XmlPullParser newPullParser = XmlPullParserFactory.newInstance().newPullParser(); - newPullParser.setFeature("http://xmlpull.org/v1/doc/features.html#process-namespaces", false); - newPullParser.setInput(dataStream, null); - ArrayList arrayList = null; - NimbleUser nimbleUser = null; - for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) { - if (eventType == 0) { - arrayList = new ArrayList<>(); - } else { - switch (eventType) { - case 2: - String name = newPullParser.getName(); - if (name.equalsIgnoreCase("user")) { - NimbleUser nimbleUser2 = new NimbleUser(); - nimbleUser2.setAuthenticatorId(Global.NIMBLE_AUTHENTICATOR_ORIGIN); - nimbleUser = nimbleUser2; - break; - } else if (nimbleUser == null) { - break; - } else if (name.equalsIgnoreCase("userId")) { - String nextText = newPullParser.nextText(); - nimbleUser.setUserId(nextText); - nimbleUser.setPid(nextText); - break; - } else if (name.equalsIgnoreCase("link")) { - nimbleUser.setImageUrl(newPullParser.nextText()); - break; - } else { - break; - } - case 3: - if (newPullParser.getName().equalsIgnoreCase("user") && nimbleUser != null) { - arrayList.add(nimbleUser); - nimbleUser = null; - break; - } - break; - } - } - } - return arrayList; - } catch (Exception e) { - Log.Helper.LOGE(this, String.format("Parsing of GOS Avatar Info XML raised an exception. Details: %s", e.getMessage()), new Object[0]); - e.printStackTrace(); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to parse the response XML from GOS Avatar service"); - throw this.lastError; - } - } /* JADX INFO: Access modifiers changed from: private */ public ArrayList parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error { - Log.Helper.LOGFUNC(this); - InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); - this.lastError = null; - if (dataStream == null || dataStream.toString().length() == 0) { - throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_HTTP_ERROR, "Empty response body for refresh friends request", new HttpError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage())); - } - Scanner scanner = new Scanner(dataStream); - Scanner useDelimiter = scanner.useDelimiter("\\A"); - String next = useDelimiter.hasNext() ? useDelimiter.next() : ""; - useDelimiter.close(); - scanner.close(); - ArrayList arrayList = new ArrayList<>(); - if (next != null && next.length() > 0) { - try { - JSONObject jSONObject = new JSONObject(next); - if (jSONObject.optJSONObject("error") != null) { - JSONObject optJSONObject = jSONObject.optJSONObject("error"); - String optString = optJSONObject.optString("type"); - int optInt = optJSONObject.optInt("code", -1); - if (optString != null && optString.length() > 0) { - Log.Helper.LOGE(this, String.format("Server error for refresh friends request. Code = %d, Message = %s", Integer.valueOf(optInt), optString), new Object[0]); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_CODE_ERROR, "Error response from server for refresh friends request", new NimbleFriendsServerCodeError(optInt, optString)); - } - return null; - } - JSONArray optJSONArray = jSONObject.optJSONArray("entries"); - if (optJSONArray != null && optJSONArray.length() > 0) { - for (int i = 0; i < optJSONArray.length(); i++) { - JSONObject jSONObject2 = optJSONArray.getJSONObject(i); - if (jSONObject2 != null) { - NimbleUser createNimbleUser = createNimbleUser(jSONObject2); - if (createNimbleUser.getUserId() != null && createNimbleUser.getUserId().length() > 0) { - arrayList.add(createNimbleUser); - } - } - } - } else { - if (optJSONArray != null && optJSONArray.length() == 0) { - Log.Helper.LOGD(this, "GOS response indicates there are no friends for this Origin user", new Object[0]); - this.lastError = null; - return arrayList; - } - JSONObject jSONObject3 = jSONObject.getJSONObject("error"); - if (jSONObject3 != null) { - int optInt2 = jSONObject3.optInt("code", -1); - String optString2 = jSONObject3.optString("type", ""); - Log.Helper.LOGE(this, String.format("Server error for refresh friends request. Code = %d, Message = %s", Integer.valueOf(optInt2), optString2), new Object[0]); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_CODE_ERROR, "Error response from server for refresh friends request", new NimbleFriendsServerCodeError(optInt2, optString2)); - } else { - Log.Helper.LOGE(this, "Unknown server error for refresh friends request.", new Object[0]); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_INVALID_RESPONSE_ERROR, "Unknown server error for refresh friends request."); - } - } - } catch (JSONException e) { - Log.Helper.LOGE(this, String.format("%s Error: %s", "Exception when parsing JSON response for refresh friends request.", e.getMessage()), new Object[0]); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_INVALID_RESPONSE_ERROR, "Exception when parsing JSON response for refresh friends request.", e); - return arrayList; - } - } else { - Log.Helper.LOGE(this, "Empty response data for user search by display name .", new Object[0]); - this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_INVALID_RESPONSE_ERROR, "Empty response data for user search by display name ."); - } - return arrayList; + return new ArrayList<>(); } @Override // com.ea.nimble.friends.NimbleFriendsListImpl diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java b/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java index c81b293..4eccffc 100644 --- a/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java +++ b/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java @@ -16,12 +16,9 @@ import com.ea.nimble.Network; import com.ea.nimble.NetworkConnectionCallback; import com.ea.nimble.NetworkConnectionHandle; import com.ea.nimble.SynergyEnvironment; -import com.ea.nimble.friends.INimbleOriginFriendsService; -import com.ea.nimble.friends.NimbleFriendsError; import com.ea.nimble.identity.INimbleIdentity; import com.ea.nimble.identity.INimbleIdentityAuthenticator; import com.ea.nimble.identity.NimbleIdentityPidInfo; -import com.facebook.internal.ServerProtocol; import java.io.ByteArrayOutputStream; import java.io.InputStream; import java.net.MalformedURLException; @@ -31,7 +28,6 @@ import java.util.Date; import java.util.HashMap; import java.util.Iterator; import java.util.Scanner; -import org.apache.http.protocol.HTTP; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; @@ -103,7 +99,7 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble Log.Helper.LOGE(this, "Cannot process searchUserByEmail request because callback is null", new Object[0]); } else { Log.Helper.LOGD(this, String.format("searchUserByEmail API called with email = %s", str), new Object[0]); - processSearchUserRequest(str, UserSearchCriteria.EMAIL, nimbleUserSearchCallback); + //processSearchUserRequest(str, UserSearchCriteria.EMAIL, nimbleUserSearchCallback); } } @@ -114,7 +110,7 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble Log.Helper.LOGE(this, "Cannot process searchUserByDisplayName request because callback is null", new Object[0]); } else { Log.Helper.LOGD(this, String.format("searchUserByDisplayName API called with namePrefix = %s", str), new Object[0]); - processSearchUserRequest(str, UserSearchCriteria.DISPLAY_NAME, nimbleUserSearchCallback); + //processSearchUserRequest(str, UserSearchCriteria.DISPLAY_NAME, nimbleUserSearchCallback); } } @@ -125,7 +121,7 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble Log.Helper.LOGE(this, "Cannot process listFriendInvitationSent request because callback is null", new Object[0]); } else { Log.Helper.LOGD(this, "Request: listFriendInvitationSent", new Object[0]); - processInivtationListRequest(GET_SENT_INVITATION_LIST_URI, nimbleUserSearchCallback); + //processInivtationListRequest(GET_SENT_INVITATION_LIST_URI, nimbleUserSearchCallback); } } @@ -136,7 +132,7 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble Log.Helper.LOGE(this, "Cannot process listFriendInvitationReceived request because callback is null", new Object[0]); } else { Log.Helper.LOGD(this, "Request: listFriendInvitationReceived", new Object[0]); - processInivtationListRequest(GET_RECEIVED_INVITATION_LIST_URI, nimbleUserSearchCallback); + //processInivtationListRequest(GET_RECEIVED_INVITATION_LIST_URI, nimbleUserSearchCallback); } } @@ -147,7 +143,7 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble Log.Helper.LOGE(this, "Cannot process sendFriendInvitation request because callback is null", new Object[0]); } else { Log.Helper.LOGD(this, "Request: sendFriendInvitation", new Object[0]); - processSendFriendInvitationRequest(str, str2, nimbleFriendInvitationCallback); + //processSendFriendInvitationRequest(str, str2, nimbleFriendInvitationCallback); } } @@ -158,7 +154,7 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble Log.Helper.LOGE(this, "Cannot process acceptFriendInvitation request because callback is null", new Object[0]); } else { Log.Helper.LOGD(this, "Request: acceptFriendInvitation", new Object[0]); - processRespondToFriendInvitationRequest(true, str, nimbleFriendInvitationCallback); + //processRespondToFriendInvitationRequest(true, str, nimbleFriendInvitationCallback); } } @@ -265,7 +261,7 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str3, String str4, Error error) { if (error == null) { - NimbleOriginFriendsServiceImpl.this.sendFriendInvitationRequest(pid, str3, str, str2, nimbleFriendInvitationCallback); + //NimbleOriginFriendsServiceImpl.this.sendFriendInvitationRequest(pid, str3, str, str2, nimbleFriendInvitationCallback); } else { Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot send friend invitation request.", new Object[0]); NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, error); @@ -292,7 +288,7 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str2, String str3, Error error) { if (error == null) { - NimbleOriginFriendsServiceImpl.this.sendRespondToFriendInvitationRequest(z, pid, str, str2, nimbleFriendInvitationCallback); + // NimbleOriginFriendsServiceImpl.this.sendRespondToFriendInvitationRequest(z, pid, str, str2, nimbleFriendInvitationCallback); } else { Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot process request for responding to friend invitation.", new Object[0]); NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, error); @@ -302,210 +298,8 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble } } - private void processInivtationListRequest(final String str, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - Log.Helper.LOGFUNC(this); - if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { - Log.Helper.LOGE(this, "Unable to process request because NimbleIdentity is not available", new Object[0]); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to process request because NimbleIdentity is not available"); - return; - } - INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); - NimbleIdentityPidInfo pidInfo = iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).getPidInfo(); - final String pid = pidInfo != null ? pidInfo.getPid() : null; - if (pid == null || pid.length() <= 0) { - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available."); - } else { - iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.3 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback - public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str2, String str3, Error error) { - if (error == null) { - NimbleOriginFriendsServiceImpl.this.sendGetFriendInvitationListRequest(pid, str2, str, nimbleUserSearchCallback); - } else { - Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot process request.", new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, error); - } - } - }); - } - } - private void processSearchUserRequest(final String str, final UserSearchCriteria userSearchCriteria, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - Log.Helper.LOGFUNC(this); - if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { - Log.Helper.LOGE(this, "Unable to process request because NimbleIdentity is not available", new Object[0]); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to process request because NimbleIdentity is not available"); - } else { - ((INimbleIdentity) Base.getComponent("com.ea.nimble.identity")).getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.4 - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback - public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str2, String str3, Error error) { - if (error == null) { - NimbleOriginFriendsServiceImpl.this.sendSearchUserRequest(str2, str3, str, userSearchCriteria, nimbleUserSearchCallback); - } else { - Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot process request.", new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, error); - } - } - }); - } - } - /* JADX INFO: Access modifiers changed from: private */ - public void sendFriendInvitationRequest(String str, String str2, String str3, String str4, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - Log.Helper.LOGFUNC(this); - try { - HttpRequest makeFriendInvitationRequest = makeFriendInvitationRequest(str, str2, str3, str4, nimbleFriendInvitationCallback); - if (makeFriendInvitationRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for sending friend invitation", new Object[0]); - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for sending friend invitation"); - } else { - Network.getComponent().sendRequest(makeFriendInvitationRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.5 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - if (networkConnectionHandle.getResponse().getStatusCode() == 204) { - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithSuccess(nimbleFriendInvitationCallback); - } else { - Log.Helper.LOGD(this, "Server responded with an error (%d) for sending friend invitation request", Integer.valueOf(networkConnectionHandle.getResponse().getStatusCode())); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_HTTP_ERROR, "Server responded with an error (%d) for sending friend invitation request", new HttpError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()))); - } - } catch (Exception e) { - Log.Helper.LOGE(this, "Sending friend invitation request failed with unexpected excpetion at receiving: " + e.getMessage(), new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_NETWORK_UNEXPECT_ERROR, "Sending friend invitation request failed with unexpected excpetion at receiving", e)); - } - } - }); - } - } catch (Exception e) { - Log.Helper.LOGE(this, "Sending friend invitation request failed with unexpected excpetion at posting: " + e.getMessage(), new Object[0]); - invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_NETWORK_UNEXPECT_ERROR, "Sending friend invitation request failed with unexpected excpetion at posting", e)); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void sendRespondToFriendInvitationRequest(boolean z, String str, String str2, String str3, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - Log.Helper.LOGFUNC(this); - try { - HttpRequest makeRespondToFriendInvitationRequest = makeRespondToFriendInvitationRequest(z, str, str2, str3); - if (makeRespondToFriendInvitationRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for respoding to friend invitation", new Object[0]); - invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for respoding to friend invitation"); - } else { - Network.getComponent().sendRequest(makeRespondToFriendInvitationRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.6 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - if (networkConnectionHandle.getResponse().getStatusCode() == 204) { - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithSuccess(nimbleFriendInvitationCallback); - } else { - Log.Helper.LOGD(this, "Server responded with an error (%d) for sending friend invitation response", Integer.valueOf(networkConnectionHandle.getResponse().getStatusCode())); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_HTTP_ERROR, "Server responded with an error (%d) for sending friend invitation response", new HttpError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()))); - } - } catch (Exception e) { - Log.Helper.LOGE(this, "Sending friend invitation response failed with unexpected excpetion at receiving: " + e.getMessage(), new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_NETWORK_UNEXPECT_ERROR, "Sending friend invitation response failed with unexpected excpetion at receiving", e)); - } - } - }); - } - } catch (Exception e) { - Log.Helper.LOGE(this, "Sending friend invitation response failed with unexpected excpetion at posting: " + e.getMessage(), new Object[0]); - invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_NETWORK_UNEXPECT_ERROR, "Sending friend invitation response failed with unexpected excpetion at posting", e)); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void sendGetFriendInvitationListRequest(String str, String str2, String str3, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - Log.Helper.LOGFUNC(this); - try { - HttpRequest makeGetFriendInvitationListRequest = makeGetFriendInvitationListRequest(str, str2, str3); - if (makeGetFriendInvitationListRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for retrieving outbound friend invitation list", new Object[0]); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for retrieving outbound friend invitation list"); - } else { - Network.getComponent().sendRequest(makeGetFriendInvitationListRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.7 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - ArrayList parseBodyJSONData = NimbleOriginFriendsServiceImpl.this.parseBodyJSONData(networkConnectionHandle); - if (parseBodyJSONData == null) { - Log.Helper.LOGE(this, "Error in response from GOS server. Unable to get list of invitations", new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_INVALID_RESPONSE_ERROR, "Error in response from GOS server. Unable to get list of invitations"); - } else if (parseBodyJSONData.size() <= 0) { - Log.Helper.LOGD(this, "Server request was successful, but we did not find any pending invitations", new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseBodyJSONData); - } else { - Log.Helper.LOGD(this, "Successful in retrieving invitation list from GOS", new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseBodyJSONData); - } - } catch (Error e) { - Log.Helper.LOGE(this, "Error parsing response from GOS" + e.getMessage(), new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, e); - } catch (Exception e2) { - Log.Helper.LOGE(this, "Sending friend invitation list request failed with unexpected excpetion at receiving: " + e2.getMessage(), new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_NETWORK_UNEXPECT_ERROR, "Sending friend invitation list request failed with unexpected excpetion at receiving", e2)); - } - } - }); - } - } catch (Exception e) { - Log.Helper.LOGE(this, "Sending friend invitation list request failed with unexpected excpetion at posting: " + e.getMessage(), new Object[0]); - invokeUserSearchCallbackWithError(nimbleUserSearchCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_NETWORK_UNEXPECT_ERROR, "Sending friend invitation list request failed with unexpected excpetion at posting", e)); - } - } - - /* JADX INFO: Access modifiers changed from: private */ - public void sendSearchUserRequest(String str, String str2, String str3, final UserSearchCriteria userSearchCriteria, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { - Log.Helper.LOGFUNC(this); - try { - HttpRequest makeSearchUserRequest = makeSearchUserRequest(str, str2, str3, userSearchCriteria); - if (makeSearchUserRequest == null) { - Log.Helper.LOGE(this, "Failed to create HTTP Request for user search", new Object[0]); - invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for user search"); - } else { - Network.getComponent().sendRequest(makeSearchUserRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.8 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - try { - ArrayList parseUserSearchByEmailResponse = userSearchCriteria == UserSearchCriteria.EMAIL ? NimbleOriginFriendsServiceImpl.this.parseUserSearchByEmailResponse(networkConnectionHandle) : NimbleOriginFriendsServiceImpl.this.parseUserSearchByDisplayNameResponse(networkConnectionHandle); - if (parseUserSearchByEmailResponse == null) { - Log.Helper.LOGE(this, "There was an error processing your user search request", new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_INVALID_RESPONSE_ERROR, "There was an error processing your user search request"); - } else if (parseUserSearchByEmailResponse.size() <= 0) { - Log.Helper.LOGD(this, "No users found for your search criteria. Please try again with a different criteria.", new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseUserSearchByEmailResponse); - } else { - Log.Helper.LOGD(this, "Found users with matching email or display name prefix", new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseUserSearchByEmailResponse); - } - } catch (Error e) { - Log.Helper.LOGE(this, "Error parsing response for user search by email or displayName request" + e.getMessage(), new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, e); - } catch (Exception e2) { - Log.Helper.LOGE(this, "Sending search user request failed with unexpected excpetion at receiving: " + e2.getMessage(), new Object[0]); - NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_NETWORK_UNEXPECT_ERROR, "Sending search user request failed with unexpected excpetion at receiving", e2)); - } - } - }); - } - } catch (Exception e) { - Log.Helper.LOGE(this, "Sending search user request failed with unexpected excpetion at posting: " + e.getMessage(), new Object[0]); - invokeUserSearchCallbackWithError(nimbleUserSearchCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_NETWORK_UNEXPECT_ERROR, "Sending search user request failed with unexpected excpetion at posting", e)); - } - } - - private String getOriginFriendsUrlFromSynergy() { - Log.Helper.LOGFUNC(this); - String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_EADP_FRIENDS_HOST); - if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { - return null; - } - return serverUrlWithKey.charAt(serverUrlWithKey.length() + (-1)) == '/' ? serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1) : serverUrlWithKey; - } - - private String getMdmAppKey() { - Log.Helper.LOGFUNC(this); - return SynergyEnvironment.getComponent().getGosMdmAppKey(); - } protected static String getIdentityProxyUrlFromSynergy() { Log.Helper.LOGFUNCS("OriginFriendsService"); @@ -516,235 +310,6 @@ public class NimbleOriginFriendsServiceImpl extends Component implements INimble return serverUrlWithKey.charAt(serverUrlWithKey.length() + (-1)) == '/' ? serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1) : serverUrlWithKey; } - private HttpRequest makeFriendInvitationRequest(String str, String str2, String str3, String str4, INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { - HttpRequest httpRequest; - Log.Helper.LOGFUNC(this); - String originFriendsUrlFromSynergy = getOriginFriendsUrlFromSynergy(); - String mdmAppKey = getMdmAppKey(); - if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because friends endpoint URI is empty or null", new Object[0]); - return null; - } - if (mdmAppKey == null || mdmAppKey.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because MDM app key is empty or null", new Object[0]); - return null; - } - if (str2 == null || str2.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because access token is null or empty", new Object[0]); - return null; - } - if (str == null || str.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because user's nucleus ID is null or empty", new Object[0]); - return null; - } - if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for sending friend invitation because target user's nucleus ID is null or empty", new Object[0]); - return null; - } - String str5 = originFriendsUrlFromSynergy + String.format(POST_SEND_FRIEND_INVITATION_URI, str, str3); - StringBuffer stringBuffer = new StringBuffer(); - stringBuffer.append("source=mobile"); - if (str4 != null && str4.length() > 0) { - stringBuffer.append("&comment="); - stringBuffer.append(str4); - } - try { - httpRequest = new HttpRequest(new URL(str5)); - } catch (MalformedURLException e) { - e = e; - httpRequest = null; - } catch (Exception e2) { - e = e2; - httpRequest = null; - } - try { - httpRequest.method = IHttpRequest.Method.POST; - byte[] bytes = stringBuffer.toString().getBytes(HTTP.UTF_8); - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); - byteArrayOutputStream.write(bytes); - httpRequest.data = byteArrayOutputStream; - HashMap hashMap = new HashMap<>(); - hashMap.put("X-AuthToken", str2); - hashMap.put("X-Application-Key", mdmAppKey); - hashMap.put("X-Api-Version", "2"); - httpRequest.headers = hashMap; - } catch (MalformedURLException e3) { - e = e3; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL for send friend invitation. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } catch (Exception e4) { - e = e4; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL for send friend invitation. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } - return httpRequest; - } - - private HttpRequest makeRespondToFriendInvitationRequest(boolean z, String str, String str2, String str3) { - HttpRequest httpRequest; - Log.Helper.LOGFUNC(this); - String originFriendsUrlFromSynergy = getOriginFriendsUrlFromSynergy(); - String mdmAppKey = getMdmAppKey(); - if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because end point URI is null or empty", new Object[0]); - return null; - } - if (mdmAppKey == null || mdmAppKey.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because MDM App Keyis null or empty", new Object[0]); - return null; - } - if (str == null || str.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because nucleus ID is null or empty", new Object[0]); - return null; - } - if (str2 == null || str2.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because friend ID is null or empty", new Object[0]); - return null; - } - if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request for responding to an invitation because access token is null or empty", new Object[0]); - return null; - } - try { - httpRequest = new HttpRequest(new URL(originFriendsUrlFromSynergy + String.format(RESPOND_TO_FRIEND_INVITATION_URI, str, str2))); - try { - if (z) { - httpRequest.method = IHttpRequest.Method.POST; - } else { - httpRequest.method = IHttpRequest.Method.DELETE; - } - HashMap hashMap = new HashMap<>(); - hashMap.put("X-AuthToken", str3); - hashMap.put("X-Application-Key", mdmAppKey); - hashMap.put("X-Api-Version", "2"); - httpRequest.headers = hashMap; - } catch (MalformedURLException e) { - e = e; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL for responding to Friends request. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } catch (Exception e2) { - e = e2; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL for responding to Friends request. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } - } catch (MalformedURLException e3) { - e = e3; - httpRequest = null; - } catch (Exception e4) { - e = e4; - httpRequest = null; - } - return httpRequest; - } - - private HttpRequest makeGetFriendInvitationListRequest(String str, String str2, String str3) { - HttpRequest httpRequest; - Log.Helper.LOGFUNC(this); - String originFriendsUrlFromSynergy = getOriginFriendsUrlFromSynergy(); - String mdmAppKey = getMdmAppKey(); - if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request because friends endpoint URI is empty or null", new Object[0]); - return null; - } - if (mdmAppKey == null || mdmAppKey.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request because MDM app key is empty or null", new Object[0]); - return null; - } - if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request friends API URI is empty or null", new Object[0]); - return null; - } - if (str2 == null || str2.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request because access token is null or empty", new Object[0]); - return null; - } - if (str == null || str.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make HTTP request because user's nucleus ID is null or empty", new Object[0]); - return null; - } - try { - httpRequest = new HttpRequest(new URL(originFriendsUrlFromSynergy + String.format(str3, str))); - } catch (MalformedURLException e) { - e = e; - httpRequest = null; - } catch (Exception e2) { - e = e2; - httpRequest = null; - } - try { - httpRequest.method = IHttpRequest.Method.GET; - HashMap hashMap = new HashMap<>(); - hashMap.put("X-AuthToken", str2); - hashMap.put("X-Application-Key", mdmAppKey); - hashMap.put("X-Api-Version", "2"); - httpRequest.headers = hashMap; - } catch (MalformedURLException e3) { - e = e3; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } catch (Exception e4) { - e = e4; - Log.Helper.LOGE(this, "Exception when creating HTTP request URL. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } - return httpRequest; - } - - private HttpRequest makeSearchUserRequest(String str, String str2, String str3, UserSearchCriteria userSearchCriteria) { - String format; - HttpRequest httpRequest; - Log.Helper.LOGFUNC(this); - String identityProxyUrlFromSynergy = getIdentityProxyUrlFromSynergy(); - if (identityProxyUrlFromSynergy == null || identityProxyUrlFromSynergy.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make user search HTTP request because endpoint URI is empty or null", new Object[0]); - return null; - } - if (str == null || str.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make user search HTTP request because AccessToken is empty or null", new Object[0]); - return null; - } - if (str2 == null || str2.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make user search HTTP request TokenType is empty or null", new Object[0]); - return null; - } - if (str3 == null || str3.length() <= 0) { - Log.Helper.LOGW(this, "Cannot make user searchHTTP request because searchCriteria is null or empty", new Object[0]); - return null; - } - if (userSearchCriteria == UserSearchCriteria.EMAIL) { - format = String.format(SEARCH_USER_BY_EMAIL_URI, str3); - } else { - format = String.format(SEARCH_USER_BY_DISPLAY_NAME_URI, str3); - } - String str4 = str2 + " " + str; - try { - httpRequest = new HttpRequest(new URL(identityProxyUrlFromSynergy + format)); - try { - httpRequest.method = IHttpRequest.Method.GET; - HashMap hashMap = new HashMap<>(); - hashMap.put("Authorization", str4); - hashMap.put("X-Include-Underage", ServerProtocol.DIALOG_RETURN_SCOPES_TRUE); - hashMap.put("X-Expand-Results", ServerProtocol.DIALOG_RETURN_SCOPES_TRUE); - httpRequest.headers = hashMap; - } catch (MalformedURLException e) { - e = e; - Log.Helper.LOGE(this, "Exception when creating search user HTTP request URL. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } catch (Exception e2) { - e = e2; - Log.Helper.LOGE(this, "Exception when creating search user HTTP request URL. Exception: " + e.getMessage(), new Object[0]); - return httpRequest; - } - } catch (MalformedURLException e3) { - e = e3; - httpRequest = null; - } catch (Exception e4) { - e = e4; - httpRequest = null; - } - return httpRequest; - } - private boolean isNimbleComponentAvailable(String str) { Log.Helper.LOGFUNC(this); return Base.getComponent(str) != null; diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java index b7f2e0f..68f005b 100644 --- a/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java +++ b/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java @@ -33,7 +33,6 @@ import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import org.apache.http.protocol.HTTP; /* loaded from: classes.dex */ public abstract class AuthenticatorBase extends Component implements INimbleIdentityAuthenticator, LogSource { @@ -62,12 +61,12 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden private NimbleIdentityPidInfo m_pidInfo; private NetworkConnectionHandle m_pidInfoRequest; private NimbleIdentityToken m_token; - protected INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE; + protected NimbleIdentityAuthenticationState m_state = NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE; protected NimbleIdentityUserInfo m_userInfo = new NimbleIdentityUserInfo(); - protected ArrayList m_authenticateCallbacks = new ArrayList<>(); - private ArrayList m_userInfoCallbacks = new ArrayList<>(); - private ArrayList m_pidInfoCallbacks = new ArrayList<>(); - private ArrayList m_personaCallbacks = new ArrayList<>(); + protected ArrayList m_authenticateCallbacks = new ArrayList<>(); + private ArrayList m_userInfoCallbacks = new ArrayList<>(); + private ArrayList m_pidInfoCallbacks = new ArrayList<>(); + private ArrayList m_personaCallbacks = new ArrayList<>(); private Timer m_tokenRefreshTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorBase.1 @Override // java.lang.Runnable public void run() { @@ -113,11 +112,11 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden abstract void autoLogin(); @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState getState() { + public NimbleIdentityAuthenticationState getState() { return this.m_state; } - void setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState nimbleIdentityAuthenticationState) { + void setState(NimbleIdentityAuthenticationState nimbleIdentityAuthenticationState) { if (nimbleIdentityAuthenticationState != this.m_state) { this.m_state = nimbleIdentityAuthenticationState; saveState(); @@ -145,11 +144,11 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden return INimbleIdentityAuthenticator.AUTHENTICATOR_COMPONENT_PREFIX + getAuthenticatorId(); } - public void restoreAuthenticator(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + public void restoreAuthenticator(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { Log.Helper.LOGPUBLICFUNC(this); - if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_UNAVAILABLE) { + if (this.m_state != NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_UNAVAILABLE) { loadState(); - if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { + if (this.m_state != NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { loadToken(); loadPidInfo(); } @@ -169,9 +168,9 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden resume(null); } - private synchronized void resume(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + private synchronized void resume(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { Log.Helper.LOGFUNC(this); - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { + if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { Log.Helper.LOGIS(this.TAG, "Skipping autoLogin for state NONE", new Object[0]); return; } @@ -182,13 +181,13 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden Log.Helper.LOGIS(this.TAG, "Authenticator %s resume failing - environment not ready.", getAuthenticatorId()); return; } - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { Log.Helper.LOGIS(this.TAG, "Skipping autoLogin for state GOING", new Object[0]); return; } if (this.m_token != null) { if (this.m_token.getAccessTokenExpiryTime().after(new Date())) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS); + setState(NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS); verifyAccessToken(); return; } else if (this.m_token.getRefreshTokenExpiryTime().after(new Date())) { @@ -237,9 +236,9 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void refreshUserInfo(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + public void refreshUserInfo(final NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { Log.Helper.LOGPUBLICFUNC(this); - refreshPidInfo(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.7 + refreshPidInfo(new NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.7 @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { if (nimbleIdentityAuthenticatorCallback == null) { @@ -254,7 +253,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } /* JADX INFO: Access modifiers changed from: private */ - public synchronized void refreshUserProfile(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + public synchronized void refreshUserProfile(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { Log.Helper.LOGFUNC(this); Error environmentCheck = environmentCheck(); if (environmentCheck != null) { @@ -277,10 +276,10 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden public NimbleIdentityPidInfo getPidInfo() { Log.Helper.LOGPUBLICFUNC(this); NimbleIdentityPidInfo nimbleIdentityPidInfo = this.m_pidInfo; - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS && (this.m_pidInfo == null || this.m_pidInfo.getExpiryTime().before(new Date()))) { + if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS && (this.m_pidInfo == null || this.m_pidInfo.getExpiryTime().before(new Date()))) { synchronized (this) { nimbleIdentityPidInfo = this.m_pidInfo; - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS && (this.m_pidInfo == null || this.m_pidInfo.getExpiryTime().before(new Date()))) { + if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS && (this.m_pidInfo == null || this.m_pidInfo.getExpiryTime().before(new Date()))) { refreshPidInfo(null); } } @@ -290,9 +289,9 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void refreshPidInfo(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + public void refreshPidInfo(final NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { Log.Helper.LOGPUBLICFUNC(this); - prepare(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.8 + prepare(new NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.8 @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { if (error == null) { @@ -309,7 +308,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden return; } synchronized (AuthenticatorBase.this) { - if (AuthenticatorBase.this.getConfiguration().getAutoRefresh() && AuthenticatorBase.this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (AuthenticatorBase.this.getConfiguration().getAutoRefresh() && AuthenticatorBase.this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { AuthenticatorBase.this.m_pidInfoRefreshTimer.schedule(60.0d, false); } if (nimbleIdentityAuthenticatorCallback != null) { @@ -327,7 +326,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden Log.Helper.LOGPUBLICFUNC(this); synchronized (this) { arrayList = this.m_personas; - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS && (this.m_personas == null || (this.m_personas.size() > 0 && this.m_personas.get(0).getExpiryTime().before(new Date())))) { + if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS && (this.m_personas == null || (this.m_personas.size() > 0 && this.m_personas.get(0).getExpiryTime().before(new Date())))) { updatePersonas(); } } @@ -335,9 +334,9 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void refreshPersonas(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + public void refreshPersonas(final NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { Log.Helper.LOGPUBLICFUNC(this); - prepare(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.9 + prepare(new NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.9 @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { if (error == null) { @@ -354,7 +353,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden return; } synchronized (AuthenticatorBase.this) { - if (AuthenticatorBase.this.getConfiguration().getAutoRefresh() && AuthenticatorBase.this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (AuthenticatorBase.this.getConfiguration().getAutoRefresh() && AuthenticatorBase.this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { AuthenticatorBase.this.m_personaRefreshTimer.schedule(60.0d, false); } if (nimbleIdentityAuthenticatorCallback != null) { @@ -400,13 +399,13 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void requestAuthCode(final String str, final String str2, final INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback) { + public void requestAuthCode(final String str, final String str2, final NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback) { Log.Helper.LOGPUBLICFUNC(this); if (nimbleIdentityServerAuthCodeCallback == null) { Log.Helper.LOGWS(this.TAG, "Request server authentication oAuth code without callback, no way to get result", new Object[0]); } else { Log.Helper.LOGDS(this.TAG, "Request server authentication oauth code for serverId %s and scope %s", str, str2); - prepare(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.10 + prepare(new NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.10 @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { URL url; @@ -450,13 +449,13 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } } - public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) throws Exception { + public void requestIdentityForFriends(ArrayList arrayList, NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) throws Exception { Log.Helper.LOGPUBLICFUNC(this); throw new Exception("Authenticator " + getAuthenticatorId() + " doesn't support identity information for friends"); } @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void requestAccessToken(final INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback nimbleAuthenticatorAccessTokenCallback) { + public void requestAccessToken(final NimbleAuthenticatorAccessTokenCallback nimbleAuthenticatorAccessTokenCallback) { Log.Helper.LOGPUBLICFUNC(this); if (nimbleAuthenticatorAccessTokenCallback == null) { Log.Helper.LOGW(this, "requestAccessToken API called without a callback. Aborting token refresh", new Object[0]); @@ -471,7 +470,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(this, this.m_token.getAccessToken(), this.m_token.getType(), null); return; } else { - prepare(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.11 + prepare(new NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.11 @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { if (error == null) { @@ -495,8 +494,8 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden private synchronized Error environmentCheck() { Log.Helper.LOGFUNC(this); if (Network.getComponent().getStatus() != Network.Status.OK) { - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); + if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + setState(NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); } return new Error(Error.Code.NETWORK_NO_CONNECTION, "Idenitity cannot work without network."); } @@ -518,7 +517,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden Code decompiled incorrectly, please refer to instructions dump. To view partially-correct code enable 'Show inconsistent code' option in preferences */ - private synchronized void prepare(com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback r3) { + private synchronized void prepare(NimbleIdentityAuthenticatorCallback r3) { /* r2 = this; monitor-enter(r2) @@ -591,7 +590,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } protected void exchangeDataForToken(String str) { - URL url; + URL url = null; Log.Helper.LOGFUNC(this); URL url2 = null; try { @@ -599,7 +598,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } catch (IOException unused) { } try { - byte[] bytes = str.getBytes(HTTP.UTF_8); + byte[] bytes = str.getBytes(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); byteArrayOutputStream.write(bytes); HashMap hashMap = new HashMap<>(); @@ -628,14 +627,14 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden if (this.m_tokenRefreshTimer.isRunning()) { this.m_tokenRefreshTimer.cancel(); } - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); + setState(NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); NimbleIdentityConfig configuration = getConfiguration(); URL url = null; String format = String.format(DATA_TEMPLATE_LOGIN_WITH_REFRESH_TOKEN, this.m_token.getRefreshToken(), configuration.getClientId(), configuration.getClientSecret()); try { URL url2 = new URL(String.format(URL_TEMPLATE_LOGIN, configuration.getConnectServerUrl())); try { - byte[] bytes = format.getBytes(HTTP.UTF_8); + byte[] bytes = format.getBytes(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); byteArrayOutputStream.write(bytes); HashMap hashMap = new HashMap<>(); @@ -674,17 +673,17 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden this.m_personaRequest.cancel(); this.m_personaRequest = null; } - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { if (this.m_authenticateRequest != null) { this.m_authenticateRequest.cancel(); this.m_authenticateRequest = null; } - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); + setState(NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); } } protected void closeAuthentication(Error error) { - ArrayList arrayList; + ArrayList arrayList; Log.Helper.LOGFUNC(this); synchronized (this) { this.m_authenticateRequest = null; @@ -713,7 +712,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_TARGET, Utility.convertObjectToJSONString(hashMap3)); iTracking.logEvent(Tracking.NIMBLE_TRACKING_EVENT_IDENTITY_LOGIN, hashMap); } - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS); + setState(NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS); if (getConfiguration().getAutoRefresh()) { double time = this.m_token.getAccessTokenExpiryTime().getTime() - System.currentTimeMillis(); Double.isNaN(time); @@ -730,20 +729,20 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } } else { Log.Helper.LOGES(this.TAG, "Authentication closed with error %s.", error); - setState(isPlatformLoggedIn() ? INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE : INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); + setState(isPlatformLoggedIn() ? NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE : NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); } arrayList = this.m_authenticateCallbacks; this.m_authenticateCallbacks = new ArrayList<>(); } this.m_autoLoginAttempt = false; - Iterator it = arrayList.iterator(); + Iterator it = arrayList.iterator(); while (it.hasNext()) { it.next().onCallback(this, error); } } protected void closeUserInfoUpdate(Error error, boolean z) { - ArrayList arrayList; + ArrayList arrayList; Log.Helper.LOGFUNC(this); if (error == null) { Log.Helper.LOGVS(this.TAG, "Updating user profile succeed!", new Object[0]); @@ -753,7 +752,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden synchronized (this) { if (z) { try { - if (getConfiguration().getAutoRefresh() && this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (getConfiguration().getAutoRefresh() && this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { if (error == null && this.m_userInfo.getExpiryTime() != null) { double time = this.m_userInfo.getExpiryTime().getTime() - System.currentTimeMillis(); Double.isNaN(time); @@ -769,7 +768,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden arrayList = this.m_userInfoCallbacks; this.m_userInfoCallbacks = new ArrayList<>(); } - Iterator it = arrayList.iterator(); + Iterator it = arrayList.iterator(); while (it.hasNext()) { it.next().onCallback(this, error); } @@ -777,7 +776,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden /* JADX INFO: Access modifiers changed from: private */ public void closePidInfoUpdate(Error error) { - ArrayList arrayList; + ArrayList arrayList; Log.Helper.LOGFUNC(this); if (error == null) { Log.Helper.LOGVS(this.TAG, "Updating pid information succeed!", new Object[0]); @@ -786,7 +785,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } synchronized (this) { this.m_pidInfoRequest = null; - if (getConfiguration().getAutoRefresh() && this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (getConfiguration().getAutoRefresh() && this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { if (error == null) { double time = this.m_pidInfo.getExpiryTime().getTime() - System.currentTimeMillis(); Double.isNaN(time); @@ -798,13 +797,13 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden arrayList = this.m_pidInfoCallbacks; this.m_pidInfoCallbacks = new ArrayList<>(); } - Iterator it = arrayList.iterator(); + Iterator it = arrayList.iterator(); while (it.hasNext()) { it.next().onCallback(this, error); } } - protected void requestIdentityForFriends(String str, ArrayList arrayList, final INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) { + protected void requestIdentityForFriends(String str, ArrayList arrayList, final NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) { Log.Helper.LOGFUNC(this); if (nimbleIdentityFriendsIdentityInfoCallback == null) { Log.Helper.LOGES(this.TAG, "requestIdentityForFriends called with no way to notify caller", new Object[0]); @@ -821,7 +820,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden try { URL url2 = new URL(String.format("%s%s", getConfiguration().getProxyServerUrl(), URL_TEMPALTE_GET_IDENTITY_INFO_FOR_FRIENDS)); try { - byte[] bytes = convertObjectToJSONString.getBytes(HTTP.UTF_8); + byte[] bytes = convertObjectToJSONString.getBytes(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); byteArrayOutputStream.write(bytes); String format = String.format("%s %s", this.m_token.getType(), this.m_token.getAccessToken()); @@ -932,7 +931,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden /* JADX INFO: Access modifiers changed from: private */ public void closePersonaUpdate(Error error) { - ArrayList arrayList; + ArrayList arrayList; double expiryInterval; Log.Helper.LOGFUNC(this); if (error == null) { @@ -943,7 +942,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden synchronized (this) { this.m_personaRequest = null; NimbleIdentityConfig configuration = getConfiguration(); - if (configuration.getAutoRefresh() && this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (configuration.getAutoRefresh() && this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { if (this.m_personas != null && this.m_personas.size() > 0) { double time = this.m_personas.get(0).getExpiryTime().getTime() - System.currentTimeMillis(); Double.isNaN(time); @@ -959,7 +958,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden arrayList = this.m_personaCallbacks; this.m_personaCallbacks = new ArrayList<>(); } - Iterator it = arrayList.iterator(); + Iterator it = arrayList.iterator(); while (it.hasNext()) { it.next().onCallback(this, error); } @@ -1024,7 +1023,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden synchronized void enableAutoRefresh(boolean z) { Log.Helper.LOGFUNC(this); if (z) { - if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (this.m_state != NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { return; } if (!this.m_tokenRefreshTimer.isRunning() && this.m_authenticateRequest == null && this.m_token != null) { @@ -1060,10 +1059,10 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } } - protected synchronized void cleanAtLogout(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + protected synchronized void cleanAtLogout(final NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { Log.Helper.LOGFUNC(this); boolean z = true; - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { try { NimbleIdentityConfig configuration = getConfiguration(); HttpRequest httpRequest = new HttpRequest(new URL(String.format(URL_TEMPLATE_LOGOUT, configuration.getConnectServerUrl(), configuration.getClientId(), this.m_token.getAccessToken()))); @@ -1095,7 +1094,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden z = false; } this.m_personas = null; - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); + setState(NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); Log.Helper.LOGDS(this.TAG, "Logout of authenticator " + getAuthenticatorId(), new Object[0]); if (z2) { HashMap hashMap = new HashMap(); @@ -1123,8 +1122,8 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden } catch (MalformedURLException unused) { Log.Helper.LOGFS("Network", "Malformed URL from %s", null); } - } else if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); + } else if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + setState(NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); Log.Helper.LOGWS(this.TAG, "Logout of authenticator %s while state was going. Premature interruption. Check for failure.", getAuthenticatorId()); if (nimbleIdentityAuthenticatorCallback != null) { nimbleIdentityAuthenticatorCallback.onCallback(this, null); @@ -1134,7 +1133,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden authenticationConductor2.handleLogout(this); } } else { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); + setState(NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); } } @@ -1147,11 +1146,11 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden resume(); return; } - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + if (this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { cancelAuthentication(); } - if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); + if (this.m_state != NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { + setState(NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); } } @@ -1172,7 +1171,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden return; } synchronized (this) { - this.m_pidInfoCallbacks.add(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.18 + this.m_pidInfoCallbacks.add(new NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.18 @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { AuthenticatorBase.this.closeAuthentication(error); @@ -1268,7 +1267,7 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden Log.Helper.LOGFUNC(this); Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); if (persistenceForNimbleComponent != null) { - boolean z = this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING || this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE || this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS; + boolean z = this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING || this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE || this.m_state == NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS; persistenceForNimbleComponent.setValue("loggedIn", Boolean.valueOf(z)); persistenceForNimbleComponent.synchronize(); Log.Helper.LOGDS(this.TAG, "Saved loggedIn value to persistence as %s for state %s", Boolean.valueOf(z), this.m_state); @@ -1280,10 +1279,10 @@ public abstract class AuthenticatorBase extends Component implements INimbleIden Log.Helper.LOGFUNC(this); Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); if (persistenceForNimbleComponent != null && (bool = (Boolean) persistenceForNimbleComponent.getValue("loggedIn")) != null && bool.booleanValue()) { - this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE; + this.m_state = NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE; Log.Helper.LOGVS(this.TAG, "Loaded state: OFFLINE", new Object[0]); } else { - this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE; + this.m_state = NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE; Log.Helper.LOGVS(this.TAG, "Loaded state: NONE", new Object[0]); } } diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java index 4251598..180e0c5 100644 --- a/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java +++ b/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java @@ -1,293 +1,24 @@ package com.ea.nimble.identity; -import android.support.v4.app.NotificationCompat; -import com.ea.nimble.Base; -import com.ea.nimble.Error; -import com.ea.nimble.Global; -import com.ea.nimble.IFacebook; -import com.ea.nimble.INetwork; -import com.ea.nimble.Log; -import com.ea.nimble.Network; -import com.ea.nimble.NetworkConnectionCallback; -import com.ea.nimble.NetworkConnectionHandle; -import com.ea.nimble.Utility; -import com.ea.nimble.identity.INimbleIdentityAuthenticator; -import com.ea.nimble.identity.NimbleIdentityError; -import com.ea.nimble.identity.NimbleIdentityLoginParams; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/* loaded from: classes.dex */ class AuthenticatorFacebook extends AuthenticatorBase { - private static final String PID_TYPE = "mobile_facebook"; - private static final String URL_TEMPLATE_FACEBOOK_IMAGE_URL = "https://graph.facebook.com/%s/picture?type=normal"; - private static final String URL_TEMPLATE_FACEBOOK_LOGIN = "%s/connect/auth?mobile_login_type=mobile_game_facebook&client_id=%s&response_type=code&fb_token=%s&redirect_uri=nucleus:rest"; - private String m_overrideBirthday; - private static void initialize() { - Log.Helper.LOGFUNCS("AuthenticatorFacebook"); - AuthenticatorFacebook authenticatorFacebook = new AuthenticatorFacebook(); - Base.registerComponent(authenticatorFacebook, authenticatorFacebook.getComponentId()); - } - - private AuthenticatorFacebook() { - this.TAG = "AuthenticatorFacebook"; - } - - @Override // com.ea.nimble.Component - protected void setup() { - Log.Helper.LOGFUNC(this); - this.m_overrideBirthday = null; - } - - @Override // com.ea.nimble.identity.AuthenticatorBase - public void restoreAuthenticator(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGPUBLICFUNC(this); - if (Base.getComponent("com.ea.nimble.facebook") == null) { - Log.Helper.LOGIS(this.TAG, "FacebookAuthenticator is disabled since there is no NimbleFacebook component", new Object[0]); - Log.Helper.LOGIS(this.TAG, "To enable FacebookAuthenticator, please ensure the NimbleFacebook jar is correctly linked", new Object[0]); - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_UNAVAILABLE); - } - super.restoreAuthenticator(nimbleIdentityAuthenticatorCallback); - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public String getAuthenticatorId() { - Log.Helper.LOGPUBLICFUNC(this); - return Global.NIMBLE_AUTHENTICATOR_FACEBOOK; - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGPUBLICFUNC(this); - Log.Helper.LOGIS(this.TAG, "Facebook Authenticator Login", new Object[0]); - Object component = Base.getComponent("com.ea.nimble.facebook"); - if (component == null) { - Log.Helper.LOGIS(this.TAG, "Cannot login with FacebookAuthenticator since it is disabled for no NimbleFacebook component", new Object[0]); - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new Error(Error.Code.NOT_AVAILABLE, "Cannot login with FacebookAuthenticator since it is disabled for no NimbleFacebook component")); - return; - } - return; - } - IFacebook iFacebook = (IFacebook) component; - if (nimbleIdentityLoginParams != null) { - if (nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.FacebookClientLoginParams) { - loginFacebook(iFacebook, ((NimbleIdentityLoginParams.FacebookClientLoginParams) nimbleIdentityLoginParams).getFacebookPermissions(), nimbleIdentityAuthenticatorCallback); - return; - } - if (!(nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.FacebookAccessTokenLoginParams)) { - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_LOGINPARAMS, "Unrecognized login parameters")); - return; - } - return; - } - NimbleIdentityLoginParams.FacebookAccessTokenLoginParams facebookAccessTokenLoginParams = (NimbleIdentityLoginParams.FacebookAccessTokenLoginParams) nimbleIdentityLoginParams; - if (!Utility.validString(facebookAccessTokenLoginParams.getFacebookAccessToken())) { - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, new Error(Error.Code.INVALID_ARGUMENT, "Invalid Facebook access token for Facebook token")); - return; - } - return; - } else { - synchronized (this) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - iFacebook.refreshToken(); - exchangeFacebookAccessTokenForAuthCode(facebookAccessTokenLoginParams.getFacebookAccessToken()); - } - return; - } - } - loginFacebook(iFacebook, null, nimbleIdentityAuthenticatorCallback); - } - - private void loginFacebook(IFacebook iFacebook, List list, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGFUNC(this); - synchronized (this) { - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); - if (nimbleIdentityAuthenticatorCallback != null) { - this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); - } - } - iFacebook.login(list, new IFacebook.RequestCallback() { // from class: com.ea.nimble.identity.AuthenticatorFacebook.1 - @Override // com.ea.nimble.IFacebook.RequestCallback - public void callback(String str, Error error) { - Log.Helper.LOGPUBLICFUNC(this); - IFacebook iFacebook2 = (IFacebook) Base.getComponent("com.ea.nimble.facebook"); - if (iFacebook2 != null) { - if (error == null) { - if (!Utility.validString(iFacebook2.getAccessToken())) { - AuthenticatorFacebook.this.closeAuthentication(new Error(Error.Code.SYSTEM_UNEXPECTED, "Facebook SDK gives login success without a valid Facebook token")); - return; - } else { - synchronized (this) { - AuthenticatorFacebook.this.exchangeFacebookAccessTokenForAuthCode(iFacebook2.getAccessToken()); - } - return; - } - } - AuthenticatorFacebook.this.closeAuthentication(error.getCode() == Error.Code.NETWORK_OPERATION_CANCELLED.intValue() ? new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_USER_CANCELLED, "Facebook login is cancelled by user", error) : error); - } - } - }); - } - - /* JADX INFO: Access modifiers changed from: private */ - public synchronized void exchangeFacebookAccessTokenForAuthCode(String str) { - Log.Helper.LOGFUNC(this); - try { - NimbleIdentityConfig configuration = getConfiguration(); - URL url = new URL(String.format(URL_TEMPLATE_FACEBOOK_LOGIN, configuration.getConnectServerUrl(), configuration.getClientId(), str)); - INetwork component = Network.getComponent(); - if (component != null) { - this.m_authenticateRequest = component.sendGetRequest(url, new HashMap<>(), new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorFacebook.2 - @Override // com.ea.nimble.NetworkConnectionCallback - public void callback(NetworkConnectionHandle networkConnectionHandle) { - Log.Helper.LOGPUBLICFUNC(this); - try { - Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); - String str2 = (String) parseBodyJSONData.get("code"); - if (!Utility.validString(str2)) { - AuthenticatorFacebook.this.closeAuthentication(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Cannot read login OAuth code data from server response data " + parseBodyJSONData)); - return; - } - AuthenticatorFacebook.this.exchangeAuthCodeToToken(str2); - } catch (Error e) { - AuthenticatorFacebook.this.closeAuthentication(e); - } - } - }); - } else { - Log.Helper.LOGES("Network", "Network Component was null!", new Object[0]); - } - } catch (MalformedURLException unused) { - Log.Helper.LOGFS("Network", "Malformed URL from %s", null); - } - } - - @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator - public void logout(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - Log.Helper.LOGPUBLICFUNC(this); - Log.Helper.LOGIS(this.TAG, "Facebook Authenticator is logging out", new Object[0]); - Object component = Base.getComponent("com.ea.nimble.facebook"); - if (component == null) { - Log.Helper.LOGIS(this.TAG, "Cannot logout with FacebookAuthenticator since it is disabled for no NimbleFacebook component", new Object[0]); - NimbleIdentityError nimbleIdentityError = new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_REQUEST, "Cannot logout with FacebookAuthenticator since it is disabled for no NimbleFacebook component"); - if (nimbleIdentityAuthenticatorCallback != null) { - nimbleIdentityAuthenticatorCallback.onCallback(this, nimbleIdentityError); - return; - } - return; - } - cancelAuthentication(); - ((IFacebook) component).logout(); - cleanAtLogout(nimbleIdentityAuthenticatorCallback); - } - - @Override // com.ea.nimble.identity.AuthenticatorBase + @Override void autoLogin() { - Log.Helper.LOGIS(this.TAG, "Facebook Authenticator AutoLogin", new Object[0]); - this.m_autoLoginAttempt = true; - Object component = Base.getComponent("com.ea.nimble.facebook"); - if (component == null) { - closeAuthentication(new Error(Error.Code.SYSTEM_UNEXPECTED, "Cannot auto login with FacebookAuthenticator since it is disabled for no NimbleFacebook component")); - return; - } - IFacebook iFacebook = (IFacebook) component; - if (Utility.validString(iFacebook.getAccessToken())) { - synchronized (this) { - this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING; - exchangeFacebookAccessTokenForAuthCode(iFacebook.getAccessToken()); - } - return; - } - closeAuthentication(new Error(Error.Code.SYSTEM_UNEXPECTED, "Cannot auto login with FacebookAuthenticator since Facebook SDK doesn't have any session existing")); + } - @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.identity.INimbleIdentityAuthenticator - public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) throws Exception { - Log.Helper.LOGPUBLICFUNC(this); - requestIdentityForFriends(PID_TYPE, arrayList, nimbleIdentityFriendsIdentityInfoCallback); + @Override + public String getAuthenticatorId() { + return ""; } - @Override // com.ea.nimble.identity.AuthenticatorBase - protected boolean isPlatformLoggedIn() { - Log.Helper.LOGFUNC(this); - Object component = Base.getComponent("com.ea.nimble.facebook"); - if (component == null) { - return false; - } - return Utility.validString(((IFacebook) component).getAccessToken()); + @Override + public void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + } - @Override // com.ea.nimble.identity.AuthenticatorBase - protected void updateUserProfile() { - NimbleIdentityUserInfo m4clone; - Log.Helper.LOGFUNC(this); - Object component = Base.getComponent("com.ea.nimble.facebook"); - if (component == null) { - closeUserInfoUpdate(new Error(Error.Code.NOT_AVAILABLE, "Cannot auto login with FacebookAuthenticator since it is disabled for no NimbleFacebook component"), true); - return; - } - Map graphUser = ((IFacebook) component).getGraphUser(); - if (this.m_userInfo == null) { - m4clone = new NimbleIdentityUserInfo(); - } else { - m4clone = this.m_userInfo.m4clone(); - } - if (graphUser != null) { - m4clone.setUserId((String) graphUser.get("id")); - m4clone.setDisplayName((String) graphUser.get("name")); - m4clone.setUserName((String) graphUser.get("username")); - m4clone.setAvatarUri(String.format(URL_TEMPLATE_FACEBOOK_IMAGE_URL, m4clone.getUserId())); - String str = (String) graphUser.get("birthday"); - if (Utility.validString(str) && (!Utility.validString(m4clone.getDateOfBirth()) || m4clone.getDateOfBirth().equals(this.m_overrideBirthday))) { - this.m_overrideBirthday = str; - m4clone.setDateOfBirth(str); - } - m4clone.setEmail((String) graphUser.get(NotificationCompat.CATEGORY_EMAIL)); - m4clone.setExpiryTime(new Date(System.currentTimeMillis() + ((long) (getConfiguration().getExpiryInterval() * 1000.0d)))); - synchronized (this) { - this.m_userInfo = m4clone; - } - closeUserInfoUpdate(null, true); - HashMap hashMap = new HashMap(); - hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); - Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_USER_INFO_UPDATE, hashMap); - } - } + @Override + public void logout(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { - @Override // com.ea.nimble.identity.AuthenticatorBase - protected void cancelAuthentication() { - Log.Helper.LOGFUNC(this); - if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING && this.m_authenticateRequest == null) { - super.cancelAuthentication(); - setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); - } else { - super.cancelAuthentication(); - } - } - - @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.identity.INimbleIdentityAuthenticator - public void verifyAccessToken() { - Log.Helper.LOGPUBLICFUNC(this); - Object component = Base.getComponent("com.ea.nimble.facebook"); - if (component == null) { - return; - } - if (((IFacebook) component).hasOpenSession()) { - onVerifiedAccessToken(); - } else { - closeAuthentication(new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_SESSION_EXPIRED, "Facebook Access token no longer has permissions")); - } } } diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java index 0ec98f8..7c3857b 100644 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java @@ -1,10 +1,6 @@ package com.ea.nimble.identity; -import android.support.v4.view.PointerIconCompat; -import android.support.v7.widget.ActivityChooserView; import com.ea.nimble.Error; -import com.facebook.internal.NativeProtocol; -import com.google.android.gms.appstate.AppStateClient; import java.util.Map; /* loaded from: classes.dex */ @@ -17,20 +13,20 @@ public class NimbleIdentityError extends Error { NIMBLE_IDENTITY_ERROR_UNSUPPORTED_ACTION(101), NIMBLE_IDENTITY_ERROR_UNAUTHENTICATED(1001), NIMBLE_IDENTITY_ERROR_SESSION_EXPIRED(1002), - NIMBLE_IDENTITY_ERROR_INVALID_LOGINPARAMS(PointerIconCompat.TYPE_HELP), + NIMBLE_IDENTITY_ERROR_INVALID_LOGINPARAMS(444444), NIMBLE_IDENTITY_ERROR_REFRESH_USER_INFO_FROM_FIRST_PARTY(1101), NIMBLE_IDENTITY_ERROR_REFRESH_USER_INFO_FROM_PID_INFO(1102), NIMBLE_IDENTITY_ERROR_BAD_CLIENT_ID(1500), NIMBLE_IDENTITY_ERROR_BAD_CLIENT_SECRET(1501), - NIMBLE_IDENTITY_ERROR_INVALID_REQUEST(AppStateClient.STATUS_WRITE_SIZE_EXCEEDED), - NIMBLE_IDENTITY_ERROR_INVALID_OAUTH_INFO(AppStateClient.STATUS_STATE_KEY_NOT_FOUND), + NIMBLE_IDENTITY_ERROR_INVALID_REQUEST(654), + NIMBLE_IDENTITY_ERROR_INVALID_OAUTH_INFO(7654), NIMBLE_IDENTITY_ERROR_MIGRATION_SOURCE_INVALID(9101), NIMBLE_IDENTITY_ERROR_MIGRATION_TARGET_INVALID(9102), NIMBLE_IDENTITY_ERROR_MIGRATION_NOT_AUTHENTICATED(9103), NIMBLE_IDENTITY_ERROR_MIGRATION_NO_ACCESS_TOKENS(9104), NIMBLE_IDENTITY_ERROR_MIGRATION_NO_URL(9105), NIMBLE_IDENTITY_ERROR_MIGRATION_FAILED(9106), - NIMBLE_IDENTITY_ERROR_UNKNOWN(ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED); + NIMBLE_IDENTITY_ERROR_UNKNOWN(9876); private int m_value; @@ -54,10 +50,7 @@ public class NimbleIdentityError extends Error { public static NimbleIdentityError createWithData(Map map) { String str = (String) map.get("error"); NimbleIdentityErrorCode parseErrorCode = parseErrorCode(str); - String str2 = (String) map.get(NativeProtocol.BRIDGE_ARG_ERROR_DESCRIPTION); - if (str2 == null) { - str2 = str; - } + String str2 = str; return new NimbleIdentityError(parseErrorCode, str2); } diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java index 1ba0ec6..6685478 100644 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java @@ -37,7 +37,6 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.UUID; -import org.apache.http.protocol.HTTP; /* loaded from: classes.dex */ public class NimbleIdentityImpl extends Component implements INimbleIdentity, LogSource { @@ -102,7 +101,7 @@ public class NimbleIdentityImpl extends Component implements INimbleIdentity, Lo Component[] componentList = Base.getComponentList(INimbleIdentityAuthenticator.AUTHENTICATOR_COMPONENT_PREFIX); Utility.registerReceiver(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE, this.m_authenticationUpdateReceiver); Utility.registerReceiver(Global.NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE, this.m_pidInfoUpdateReceiver); - for (ApplicationEnvironmentImpl applicationEnvironmentImpl : componentList) { + for (Component applicationEnvironmentImpl : componentList) { if (!(applicationEnvironmentImpl instanceof INimbleIdentityAuthenticator)) { Log.Helper.LOGW(this, "Invalid authenticator %s", applicationEnvironmentImpl.getComponentId()); } else { @@ -530,15 +529,11 @@ public class NimbleIdentityImpl extends Component implements INimbleIdentity, Lo serverUrlWithKey = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); } url = new URL(String.format(URL_TEMPLATE_MIGRATE, serverUrlWithKey) + format); + byte[] bytes = format.getBytes(); + byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); try { - byte[] bytes = format.getBytes(HTTP.UTF_8); - byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); - try { - byteArrayOutputStream.write(bytes); - } catch (IOException unused) { - } - } catch (IOException unused2) { - byteArrayOutputStream = null; + byteArrayOutputStream.write(bytes); + } catch (IOException ignored) { } } catch (IOException unused3) { byteArrayOutputStream = null; diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityLoginParams.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityLoginParams.java index 5ee723e..496daf1 100644 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityLoginParams.java +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityLoginParams.java @@ -1,6 +1,5 @@ package com.ea.nimble.identity; -import android.support.v4.app.NotificationCompat; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -8,9 +7,6 @@ import java.util.List; /* loaded from: classes.dex */ public abstract class NimbleIdentityLoginParams { - public static class AnonymousLoginParams extends NimbleIdentityLoginParams { - } - protected NimbleIdentityLoginParams() { } @@ -79,24 +75,4 @@ public abstract class NimbleIdentityLoginParams { } } - public static class FacebookClientLoginParams extends NimbleIdentityLoginParams { - private List facebookPermissions; - - public FacebookClientLoginParams(List list) { - if (list != null && list.size() > 0) { - this.facebookPermissions = list; - if (list.contains(NotificationCompat.CATEGORY_EMAIL)) { - return; - } - this.facebookPermissions.add(NotificationCompat.CATEGORY_EMAIL); - return; - } - this.facebookPermissions = new ArrayList(); - this.facebookPermissions.add(NotificationCompat.CATEGORY_EMAIL); - } - - List getFacebookPermissions() { - return this.facebookPermissions; - } - } } diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java index dfe85af..889a9f4 100644 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java @@ -1,8 +1,6 @@ package com.ea.nimble.identity; import com.ea.nimble.Log; -import com.facebook.internal.ServerProtocol; -import com.facebook.share.internal.ShareConstants; import java.util.Date; import java.util.Map; @@ -75,18 +73,6 @@ public class NimbleIdentityPersona { this.showPersona = toEnumPersonaPrivacyLevel((String) map.get("showPersona")); this.dateCreated = (String) map.get("dateCreated"); this.lastAuthenticated = (String) map.get("lastAuthenticated"); - Object obj = map.get("isVisible"); - if (obj != null) { - if (obj instanceof Boolean) { - if (((Boolean) obj).booleanValue()) { - this.isVisible = ServerProtocol.DIALOG_RETURN_SCOPES_TRUE; - } else { - this.isVisible = "false"; - } - } else if (obj instanceof String) { - this.isVisible = (String) obj; - } - } this.expiryTime = new Date(date.getTime()); } @@ -298,8 +284,6 @@ public class NimbleIdentityPersona { return "NO_ONE"; case PERSONA_PRIVACY_LEVEL_EVERYONE: return "EVERYONE"; - case PERSONA_PRIVACY_LEVEL_FRIENDS: - return ShareConstants.PEOPLE_IDS; case PERSONA_PRIVACY_LEVEL_FRIENDS_OF_FRIENDS: return "FRIENDS_OF_FRIENDS"; default: @@ -400,9 +384,6 @@ public class NimbleIdentityPersona { if (str.equalsIgnoreCase("EVERYONE")) { return PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_EVERYONE; } - if (str.equalsIgnoreCase(ShareConstants.PEOPLE_IDS)) { - return PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS; - } return str.equalsIgnoreCase("FRIENDS_OF_FRIENDS") ? PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS_OF_FRIENDS : personaPrivacyLevel; } } diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java index 7eeb206..2e59b19 100644 --- a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java @@ -15,7 +15,6 @@ import java.util.Date; import java.util.HashMap; import java.util.Map; import java.util.TimeZone; -import org.apache.http.protocol.HTTP; import org.json.JSONException; import org.json.JSONObject; @@ -59,7 +58,7 @@ class NimbleIdentityUtility { } try { byte[] bytes = new GsonBuilder().serializeNulls().create().toJson(hashMap, new TypeToken>() { // from class: com.ea.nimble.identity.NimbleIdentityUtility.1 - }.getType()).getBytes(HTTP.UTF_8); + }.getType()).getBytes(); ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); byteArrayOutputStream.write(bytes); return byteArrayOutputStream; diff --git a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalog.java b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalog.java index a91e2d1..ee78876 100644 --- a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalog.java +++ b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalog.java @@ -22,7 +22,6 @@ import com.ea.nimble.SynergyRequest; import com.ea.nimble.Utility; import com.ea.nimble.mtx.NimbleCatalogItem; import com.ea.nimble.mtx.NimbleMTXError; -import com.facebook.internal.ServerProtocol; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; @@ -128,7 +127,6 @@ public class SynergyCatalog implements LogSource { hashMap.put("uid", Utility.validString(SynergyIdManager.getComponent().getSynergyId()) ? SynergyIdManager.getComponent().getSynergyId() : "0"); hashMap.put("sdkVer", Global.NIMBLE_RELEASE_VERSION); hashMap.put("langCode", component.getShortApplicationLanguageCode()); - hashMap.put("includeOfferType", ServerProtocol.DIALOG_RETURN_SCOPES_TRUE); synergyRequest.urlParameters = hashMap; synergyRequest.send(); return; diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlay.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlay.java index 320b086..479d8c9 100644 --- a/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlay.java +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlay.java @@ -9,8 +9,10 @@ import android.database.Cursor; import android.net.Uri; import android.os.Bundle; import android.provider.Settings; -import android.support.v4.content.LocalBroadcastManager; import android.telephony.TelephonyManager; + +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + import com.ea.nimble.ApplicationEnvironment; import com.ea.nimble.ApplicationLifecycle; import com.ea.nimble.Base; @@ -54,10 +56,6 @@ import com.ea.nimble.mtx.googleplay.util.Purchase; import com.ea.nimble.mtx.googleplay.util.SkuDetails; import com.ea.nimble.tracking.ITracking; import com.ea.nimble.tracking.Tracking; -import com.facebook.FacebookSdk; -import com.facebook.internal.NativeProtocol; -import com.facebook.internal.ServerProtocol; -import com.facebook.places.model.PlaceFields; import java.io.Serializable; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -239,23 +237,6 @@ public class GooglePlay extends Component implements INimbleMTX, IabHelper.OnIab private void createIabHelper() { this.mGooglePlayIabHelper = new IabHelper(ApplicationEnvironment.getComponent().getApplicationContext(), getAppPublicKey(), GOOGLEPLAY_ACTIVITY_RESULT_REQUEST_CODE); this.mGooglePlayIabHelper.enableDebugLogging(true); - this.mGooglePlayIabHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.1 - @Override // com.ea.nimble.mtx.googleplay.util.IabHelper.OnIabSetupFinishedListener - public void onIabSetupFinished(IabResult iabResult) { - Log.Helper.LOGD(this, "InAppBilling helper setup finished.", new Object[0]); - if (iabResult.isSuccess()) { - GooglePlay.this.m_itemRestorer.restoreItems(); - return; - } - Log.Helper.LOGD(this, "Error setting up InAppBilling helper: " + iabResult, new Object[0]); - } - }, new IabHelper.OnIabBroadcastListener() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.2 - @Override // com.ea.nimble.mtx.googleplay.util.IabHelper.OnIabBroadcastListener - public void receivedBroadcast() { - Log.Helper.LOGD(this, "Received PURCHASES_UPDATED broadcast - resolving transactions", new Object[0]); - GooglePlay.this.restorePurchasedTransactions(); - } - }, this); } public static GooglePlay getComponent() { @@ -268,33 +249,7 @@ public class GooglePlay extends Component implements INimbleMTX, IabHelper.OnIab @Override // com.ea.nimble.Component public void setup() { - Log.Helper.LOGD(this, "Component setup", new Object[0]); - if (this.mGooglePlayIabHelper == null) { - createIabHelper(); - } - this.m_verificationEnabled = true; - this.m_reportingEnabled = true; - String configValueAsString = NimbleApplicationConfiguration.getConfigValueAsString("com.ea.nimble.mtx.enableVerification"); - if ("false".equalsIgnoreCase(configValueAsString)) { - Log.Helper.LOGD(this, "Receipt verification has been disabled.", new Object[0]); - this.m_verificationEnabled = false; - String configValueAsString2 = NimbleApplicationConfiguration.getConfigValueAsString("com.ea.nimble.mtx.reportingEnabled"); - if ("false".equalsIgnoreCase(configValueAsString2)) { - Log.Helper.LOGD(this, "Transaction reporting has been disabled.", new Object[0]); - this.m_reportingEnabled = false; - return; - } else { - if (ServerProtocol.DIALOG_RETURN_SCOPES_TRUE.equalsIgnoreCase(configValueAsString2)) { - return; - } - Log.Helper.LOGD(this, "Value com.ea.nimble.mtx.reportingEnabled corrupted or non existed in manifest file.", new Object[0]); - return; - } - } - if (ServerProtocol.DIALOG_RETURN_SCOPES_TRUE.equalsIgnoreCase(configValueAsString)) { - return; - } - Log.Helper.LOGD(this, "Value com.ea.nimble.mtx.enableVerification corrupted or non existed in manifest file.", new Object[0]); + } @Override // com.ea.nimble.Component @@ -434,7 +389,6 @@ public class GooglePlay extends Component implements INimbleMTX, IabHelper.OnIab hashMap2.put("en", "mtx"); Bundle bundle = new Bundle(); bundle.putSerializable("core", hashMap2); - bundle.putString(NativeProtocol.WEB_DIALOG_ACTION, "begin"); if (sellIdFromSku != null) { bundle.putString("itemSellId", sellIdFromSku); } else { @@ -584,7 +538,6 @@ public class GooglePlay extends Component implements INimbleMTX, IabHelper.OnIab hashMap2.put("en", "mtx"); Bundle bundle = new Bundle(); bundle.putSerializable("core", hashMap2); - bundle.putString(NativeProtocol.WEB_DIALOG_ACTION, "purchased"); if (sellIdFromSku != null) { bundle.putString("itemSellId", sellIdFromSku); } else { @@ -1147,7 +1100,7 @@ public class GooglePlay extends Component implements INimbleMTX, IabHelper.OnIab if (googlePlayCatalogItem != null && googlePlayCatalogItem.getItemType() == NimbleCatalogItem.ItemType.SUBSCRIPTION) { str = IabHelper.ITEM_TYPE_SUBS; } - this.mGooglePlayIabHelper.launchPurchaseFlow(ApplicationEnvironment.getCurrentActivity(), googlePlayTransaction.getItemSku(), str, googlePlayTransaction.mDeveloperPayload); + // this.mGooglePlayIabHelper.launchPurchaseFlow(ApplicationEnvironment.getCurrentActivity(), googlePlayTransaction.getItemSku(), str, googlePlayTransaction.mDeveloperPayload); } @Override // com.ea.nimble.mtx.googleplay.util.IabHelper.OnIabPurchaseFinishedListener @@ -1421,10 +1374,6 @@ public class GooglePlay extends Component implements INimbleMTX, IabHelper.OnIab hashMap3.put("appVersion", Utility.safeString(component.getApplicationVersion())); hashMap3.put("appLanguage", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); hashMap3.put(ApplicationEnvironment.NIMBLE_PARAMETER_COUNTRY_CODE, Utility.safeString(Locale.getDefault().getCountry())); - String configValueAsString = NimbleApplicationConfiguration.getConfigValueAsString(FacebookSdk.APPLICATION_ID_PROPERTY); - if (Utility.validString(configValueAsString)) { - hashMap3.put("fbAppId", configValueAsString); - } try { Cursor query = ApplicationEnvironment.getComponent().getApplicationContext().getContentResolver().query(Uri.parse("content://com.facebook.katana.provider.AttributionIdProvider"), null, null, null, null); if (query != null) { @@ -1441,9 +1390,9 @@ public class GooglePlay extends Component implements INimbleMTX, IabHelper.OnIab hashMap4.put(ApplicationEnvironment.NIMBLE_PARAMETER_SYSTEM_NAME, "Android"); hashMap4.put(ApplicationEnvironment.NIMBLE_PARAMETER_LIMIT_AD_TRACKING, bool); PackageManager packageManager = component.getApplicationContext().getPackageManager(); - TelephonyManager telephonyManager = (TelephonyManager) component.getApplicationContext().getSystemService(PlaceFields.PHONE); - if (packageManager.checkPermission("android.permission.READ_PHONE_STATE", component.getApplicationContext().getPackageName()) == 0) { - hashMap4.put(ApplicationEnvironment.NIMBLE_PARAMETER_IMEI, Utility.safeString(telephonyManager.getDeviceId())); + TelephonyManager telephonyManager = (TelephonyManager) component.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); + if (packageManager.checkPermission("android.permission.READ_PHONE_STATE", component.getApplicationContext().getPackageName()) == PackageManager.PERMISSION_GRANTED) { + //hashMap4.put(ApplicationEnvironment.NIMBLE_PARAMETER_IMEI, Utility.safeString(telephonyManager.getDeviceId())); } hashMap.put("deviceInfo", Utility.convertObjectToJSONString(hashMap4)); hashMap.put("schemaVer", "2"); diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayError.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayError.java index 6b67a15..9d25745 100644 --- a/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayError.java +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayError.java @@ -2,7 +2,6 @@ package com.ea.nimble.mtx.googleplay; import com.ea.nimble.Error; import com.ea.nimble.mtx.googleplay.util.IabHelper; -import com.google.android.gms.games.GamesActivityResultCodes; /* loaded from: classes.dex */ class GooglePlayError extends Error { @@ -29,7 +28,7 @@ class GooglePlayError extends Error { IABHELPER_SUBSCRIPTIONS_NOT_AVAILABLE(IabHelper.IABHELPER_SUBSCRIPTIONS_NOT_AVAILABLE), IABHELPER_INVALID_CONSUMPTION(IabHelper.IABHELPER_INVALID_CONSUMPTION), IABHELPER_SUBSCRIPTION_UPDATE_NOT_AVAILABLE(IabHelper.IABHELPER_SUBSCRIPTION_UPDATE_NOT_AVAILABLE), - UNKNOWN(GamesActivityResultCodes.RESULT_LICENSE_FAILED); + UNKNOWN(1111112); private int m_value; diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Base64.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Base64.java index cda380b..73eca24 100644 --- a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Base64.java +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Base64.java @@ -1,7 +1,5 @@ package com.ea.nimble.mtx.googleplay.util; -import android.support.v7.widget.ActivityChooserView; - /* loaded from: classes.dex */ public class Base64 { static final /* synthetic */ boolean $assertionsDisabled = false; @@ -53,7 +51,7 @@ public class Base64 { } public static String encode(byte[] bArr, int i, int i2, byte[] bArr2, boolean z) { - byte[] encode = encode(bArr, i, i2, bArr2, ActivityChooserView.ActivityChooserViewAdapter.MAX_ACTIVITY_COUNT_UNLIMITED); + byte[] encode = encode(bArr, i, i2, bArr2, 7); int length = encode.length; while (!z && length > 0 && encode[length - 1] == 61) { length--; diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabHelper.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabHelper.java index aced720..03beb44 100644 --- a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabHelper.java +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabHelper.java @@ -16,11 +16,9 @@ import android.os.Handler; import android.os.IBinder; import android.os.Looper; import android.os.RemoteException; -import com.android.vending.billing.IInAppBillingService; import com.ea.nimble.ApplicationEnvironment; import com.ea.nimble.Log; import com.ea.nimble.LogSource; -import com.google.android.gms.common.GooglePlayServicesUtil; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; @@ -68,7 +66,6 @@ public class IabHelper implements LogSource { OnIabPurchaseFinishedListener mPurchaseListener; String mPurchasingItemType; int mRequestCode; - IInAppBillingService mService; ServiceConnection mServiceConn; String mSignatureBase64; boolean mDebugLog = false; @@ -172,88 +169,6 @@ public class IabHelper implements LogSource { } } - public void startSetup(final OnIabSetupFinishedListener onIabSetupFinishedListener, final OnIabBroadcastListener onIabBroadcastListener, OnIabPurchaseFinishedListener onIabPurchaseFinishedListener) { - if (this.mSetupDone) { - throw new IllegalStateException("IAB helper is already set up."); - } - logDebug("Starting in-app billing setup."); - this.mPurchaseListener = onIabPurchaseFinishedListener; - this.mServiceConn = new ServiceConnection() { // from class: com.ea.nimble.mtx.googleplay.util.IabHelper.1 - @Override // android.content.ServiceConnection - public void onServiceDisconnected(ComponentName componentName) { - IabHelper.this.logDebug("Billing service disconnected."); - if (IabHelper.this.mPurchaseUpdateReceiver != null) { - ApplicationEnvironment.getComponent().getApplicationContext().unregisterReceiver(IabHelper.this.mPurchaseUpdateReceiver); - IabHelper.this.mPurchaseUpdateReceiver = null; - } - IabHelper.this.mService = null; - IabHelper.this.mSetupDone = false; - } - - @Override // android.content.ServiceConnection - public void onServiceConnected(ComponentName componentName, IBinder iBinder) { - int isBillingSupported; - IabHelper.this.logDebug("Billing service connected."); - IabHelper.this.mService = IInAppBillingService.Stub.asInterface(iBinder); - String packageName = IabHelper.this.mContext.getPackageName(); - try { - IabHelper.this.logDebug("Checking for in-app billing 3 support."); - isBillingSupported = IabHelper.this.mService.isBillingSupported(3, packageName, IabHelper.ITEM_TYPE_INAPP); - } catch (RemoteException e) { - if (onIabSetupFinishedListener != null) { - onIabSetupFinishedListener.onIabSetupFinished(new IabResult(IabHelper.IABHELPER_REMOTE_EXCEPTION, "RemoteException while setting up in-app billing.")); - } - e.printStackTrace(); - } - if (isBillingSupported != 0) { - if (onIabSetupFinishedListener != null) { - onIabSetupFinishedListener.onIabSetupFinished(new IabResult(isBillingSupported, "Error checking for billing v3 support.")); - } - IabHelper.this.mSubscriptionsSupported = false; - return; - } - int isBillingSupported2 = IabHelper.this.mService.isBillingSupported(3, packageName, IabHelper.ITEM_TYPE_SUBS); - if (isBillingSupported2 == 0) { - IabHelper.this.logDebug("Subscriptions AVAILABLE."); - IabHelper.this.mSubscriptionsSupported = true; - } else { - IabHelper.this.logDebug("Subscriptions NOT AVAILABLE. Response: " + isBillingSupported2); - IabHelper.this.mSubscriptionsSupported = false; - } - IabHelper.this.logDebug("In-app billing version 3 supported for " + packageName); - if (IabHelper.this.mPurchaseUpdateReceiver == null) { - IabHelper.this.mPurchaseUpdateReceiver = IabHelper.this.new IabPurchaseUpdateReceiver(onIabBroadcastListener); - ApplicationEnvironment.getComponent().getApplicationContext().registerReceiver(IabHelper.this.mPurchaseUpdateReceiver, new IntentFilter("com.android.vending.billing.PURCHASES_UPDATED")); - } - IabHelper.this.mSetupDone = true; - if (onIabSetupFinishedListener != null) { - onIabSetupFinishedListener.onIabSetupFinished(new IabResult(0, "Setup successful.")); - } - } - }; - logDebug("...Starting in-app billing setup."); - logDebug("Binding service..."); - PackageManager packageManager = this.mContext.getPackageManager(); - Intent intent = new Intent("com.android.vending.billing.InAppBillingService.BIND"); - intent.setPackage(GooglePlayServicesUtil.GOOGLE_PLAY_STORE_PACKAGE); - ResolveInfo resolveService = packageManager.resolveService(intent, 0); - if (resolveService != null) { - logDebug("PackageName = " + resolveService.serviceInfo.packageName); - logDebug("ClassName = " + resolveService.serviceInfo.name); - intent.setComponent(new ComponentName(resolveService.serviceInfo.packageName, resolveService.serviceInfo.name)); - if (this.mContext.bindService(intent, this.mServiceConn, 1)) { - logDebug("Success - Bind to InAppBillingService"); - return; - } else { - logError("Failed to Bind to InAppBillingService"); - this.mServiceConn = null; - return; - } - } - logError("Unable to get ResolveInfo for InAppBillingService intent. Cannot bind to InAppBillinbService"); - this.mServiceConn = null; - } - public void dispose() { logDebug("Disposing."); this.mSetupDone = false; @@ -263,72 +178,9 @@ public class IabHelper implements LogSource { this.mContext.unbindService(this.mServiceConn); } this.mServiceConn = null; - this.mService = null; this.mPurchaseListener = null; } } - - public void launchPurchaseFlow(Activity activity, String str, String str2) { - launchPurchaseFlow(activity, str, str2, ""); - } - - public synchronized void launchPurchaseFlow(final Activity activity, final String str, final String str2, final String str3) { - startOrQueueRunnable(new AsyncOperation("launchPurchaseFlow", false, new Runnable() { // from class: com.ea.nimble.mtx.googleplay.util.IabHelper.2 - @Override // java.lang.Runnable - public void run() { - try { - IabHelper.this.logDebug("Constructing buy intent for " + str); - Bundle buyIntent = IabHelper.this.mService.getBuyIntent(3, IabHelper.this.mContext.getPackageName(), str, str2, str3); - int responseCodeFromBundle = IabHelper.this.getResponseCodeFromBundle(buyIntent); - if (responseCodeFromBundle != 0) { - IabHelper.this.logDebug("BuyIntent Bundle: " + buyIntent); - IabHelper.this.logError("Unable to buy item, Error response: " + IabHelper.getResponseDesc(responseCodeFromBundle)); - IabHelper.this.flagEndAsync(); - IabResult iabResult = new IabResult(responseCodeFromBundle, "Unable to buy item"); - if (IabHelper.this.mPurchaseListener != null) { - try { - IabHelper.this.mPurchaseListener.onIabPurchaseFinished(iabResult, null); - return; - } catch (Exception e) { - IabHelper.this.logError("Uncaught exception in listener's onIabPurchaseFinished: " + e); - return; - } - } - return; - } - PendingIntent pendingIntent = (PendingIntent) buyIntent.getParcelable(IabHelper.RESPONSE_BUY_INTENT); - IabHelper.this.logDebug("Launching buy intent for " + str + ". Request code: " + IabHelper.this.mRequestCode); - Activity activity2 = activity; - IntentSender intentSender = pendingIntent.getIntentSender(); - int i = IabHelper.this.mRequestCode; - Intent intent = new Intent(); - Integer num = 0; - int intValue = num.intValue(); - Integer num2 = 0; - Integer num3 = 0; - activity2.startIntentSenderForResult(intentSender, i, intent, intValue, num2.intValue(), num3.intValue()); - IabHelper.this.mPurchasingItemType = str2; - } catch (IntentSender.SendIntentException e2) { - IabHelper.this.logError("SendIntentException while launching purchase flow for sku " + str); - e2.printStackTrace(); - IabResult iabResult2 = new IabResult(IabHelper.IABHELPER_SEND_INTENT_FAILED, "Failed to send intent."); - if (IabHelper.this.mPurchaseListener != null) { - IabHelper.this.mPurchaseListener.onIabPurchaseFinished(iabResult2, null); - } - IabHelper.this.flagEndAsync(); - } catch (RemoteException e3) { - IabHelper.this.logError("RemoteException while launching purchase flow for sku " + str); - e3.printStackTrace(); - IabResult iabResult3 = new IabResult(IabHelper.IABHELPER_REMOTE_EXCEPTION, "Remote exception while starting purchase flow"); - if (IabHelper.this.mPurchaseListener != null) { - IabHelper.this.mPurchaseListener.onIabPurchaseFinished(iabResult3, null); - } - IabHelper.this.flagEndAsync(); - } - } - })); - } - public boolean handleActivityResult(int i, int i2, Intent intent) { logDebug("handleActivityResult..."); if (i != this.mRequestCode) { @@ -512,14 +364,11 @@ public class IabHelper implements LogSource { try { inventory = IabHelper.this.queryInventory(z, z2, list); } catch (IabException e) { - iabResult = e.getResult(); - inventory = null; } IabHelper.this.flagEndAsync(); handler.post(new Runnable() { // from class: com.ea.nimble.mtx.googleplay.util.IabHelper.3.1 @Override // java.lang.Runnable public void run() { - queryInventoryFinishedListener.onQueryInventoryFinished(iabResult, inventory); } }); } @@ -536,24 +385,13 @@ public class IabHelper implements LogSource { void consume(Purchase purchase) throws IabException { checkSetupDone("consume"); - try { - String token = purchase.getToken(); - String sku = purchase.getSku(); - if (token == null || token.equals("")) { - logError("Can't consume " + sku + ". No token."); - throw new IabException(IABHELPER_MISSING_TOKEN, "PurchaseInfo is missing token for sku: " + sku + " " + purchase); - } - logDebug("Consuming sku: " + sku + ", token: " + token); - int consumePurchase = this.mService.consumePurchase(3, this.mContext.getPackageName(), token); - if (consumePurchase == 0) { - logDebug("Successfully consumed sku: " + sku); - return; - } - logDebug("Error consuming consuming sku " + sku + ". " + getResponseDesc(consumePurchase)); - throw new IabException(consumePurchase, "Error consuming sku " + sku); - } catch (RemoteException e) { - throw new IabException(IABHELPER_REMOTE_EXCEPTION, "Remote exception while consuming. PurchaseInfo: " + purchase, e); + String token = purchase.getToken(); + String sku = purchase.getSku(); + if (token == null || token.equals("")) { + logError("Can't consume " + sku + ". No token."); + throw new IabException(IABHELPER_MISSING_TOKEN, "PurchaseInfo is missing token for sku: " + sku + " " + purchase); } + logDebug("Consuming sku: " + sku + ", token: " + token); } public void consumeAsync(Purchase purchase, OnConsumeFinishedListener onConsumeFinishedListener) { @@ -683,55 +521,6 @@ public class IabHelper implements LogSource { */ throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.mtx.googleplay.util.IabHelper.queryPurchases(com.ea.nimble.mtx.googleplay.util.Inventory, java.lang.String):int"); } - - int querySkuDetails(Inventory inventory, List list, String str) throws RemoteException, JSONException, IllegalStateException { - logDebug("Querying SKU details."); - IInAppBillingService iInAppBillingService = this.mService; - if (iInAppBillingService == null) { - throw new IllegalStateException("Billing service is not connected."); - } - if (this.mContext == null) { - throw new IllegalStateException("InAppBilling application context is unset."); - } - ArrayList arrayList = new ArrayList(); - arrayList.addAll(inventory.getAllOwnedSkus()); - if (list != null) { - arrayList.addAll(list); - } - if (arrayList.size() == 0) { - logDebug("queryPrices: nothing to do because there are no SKUs."); - return 0; - } - int i = 0; - while (i != arrayList.size()) { - int size = arrayList.size() - i > 20 ? i + 20 : arrayList.size(); - ArrayList arrayList2 = new ArrayList<>(arrayList.subList(i, size)); - Bundle bundle = new Bundle(); - bundle.putStringArrayList(GET_SKU_DETAILS_ITEM_LIST, arrayList2); - Bundle skuDetails = iInAppBillingService.getSkuDetails(3, this.mContext.getPackageName(), str, bundle); - if (skuDetails == null) { - throw new IllegalStateException("Billing service is not connected."); - } - if (!skuDetails.containsKey(RESPONSE_GET_SKU_DETAILS_LIST)) { - int responseCodeFromBundle = getResponseCodeFromBundle(skuDetails); - if (responseCodeFromBundle != 0) { - logDebug("getSkuDetails() failed: " + getResponseDesc(responseCodeFromBundle)); - return responseCodeFromBundle; - } - logError("getSkuDetails() returned a bundle with neither an error nor a detail list."); - return IABHELPER_BAD_RESPONSE; - } - Iterator it = skuDetails.getStringArrayList(RESPONSE_GET_SKU_DETAILS_LIST).iterator(); - while (it.hasNext()) { - SkuDetails skuDetails2 = new SkuDetails(it.next()); - logDebug("Got sku details: " + skuDetails2); - inventory.addSkuDetails(skuDetails2); - } - i = size; - } - return 0; - } - void consumeAsyncInternal(final List list, final OnConsumeFinishedListener onConsumeFinishedListener, final OnConsumeMultiFinishedListener onConsumeMultiFinishedListener) { Looper myLooper = Looper.myLooper(); if (myLooper == null) { @@ -784,6 +573,6 @@ public class IabHelper implements LogSource { } public boolean isServiceAvailable() { - return this.mSetupDone && this.mService != null; + return false; } } diff --git a/app/src/main/java/com/ea/nimble/pushtng/BuildConfig.java b/app/src/main/java/com/ea/nimble/pushtng/BuildConfig.java deleted file mode 100644 index 9e3c13c..0000000 --- a/app/src/main/java/com/ea/nimble/pushtng/BuildConfig.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.ea.nimble.pushtng; - -/* loaded from: classes.dex */ -public final class BuildConfig { - public static final String APPLICATION_ID = "com.ea.nimble.pushtng"; - public static final String BUILD_TYPE = "release"; - public static final boolean DEBUG = false; - public static final String FLAVOR = ""; - public static final int VERSION_CODE = 1; - public static final String VERSION_NAME = "1.0"; -} diff --git a/app/src/main/java/com/ea/nimble/pushtng/IPushListener.java b/app/src/main/java/com/ea/nimble/pushtng/IPushListener.java new file mode 100644 index 0000000..f854e3c --- /dev/null +++ b/app/src/main/java/com/ea/nimble/pushtng/IPushListener.java @@ -0,0 +1,5 @@ +package com.ea.nimble.pushtng; + +public interface IPushListener { + void onConnectionError(int i, String s); +} diff --git a/app/src/main/java/com/ea/nimble/pushtng/IPushNotification.java b/app/src/main/java/com/ea/nimble/pushtng/IPushNotification.java index 178d0d6..5486771 100644 --- a/app/src/main/java/com/ea/nimble/pushtng/IPushNotification.java +++ b/app/src/main/java/com/ea/nimble/pushtng/IPushNotification.java @@ -1,6 +1,5 @@ package com.ea.nimble.pushtng; -import com.ea.eadp.pushnotification.listeners.IPushListener; import java.util.Date; /* loaded from: classes.dex */ diff --git a/app/src/main/java/com/ea/nimble/pushtng/IPushService.java b/app/src/main/java/com/ea/nimble/pushtng/IPushService.java new file mode 100644 index 0000000..f1c16b7 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/pushtng/IPushService.java @@ -0,0 +1,4 @@ +package com.ea.nimble.pushtng; + +public class IPushService { +} diff --git a/app/src/main/java/com/ea/nimble/pushtng/NimbleAndroidHttpRequest.java b/app/src/main/java/com/ea/nimble/pushtng/NimbleAndroidHttpRequest.java index e89f23d..104aa10 100644 --- a/app/src/main/java/com/ea/nimble/pushtng/NimbleAndroidHttpRequest.java +++ b/app/src/main/java/com/ea/nimble/pushtng/NimbleAndroidHttpRequest.java @@ -13,8 +13,6 @@ import java.io.IOException; import java.net.URL; import java.nio.charset.Charset; import java.util.HashMap; -import org.apache.http.client.utils.URLEncodedUtils; -import org.apache.http.protocol.HTTP; /* loaded from: classes.dex */ public class NimbleAndroidHttpRequest implements HttpRequest { @@ -64,7 +62,7 @@ public class NimbleAndroidHttpRequest implements HttpRequest { public HttpRequest setBody(String str) { Log.Helper.LOGPUBLICFUNC(this); this.body = str; - setHeader("Content-Type", URLEncodedUtils.CONTENT_TYPE); + setHeader("Content-Type", ""); return this; } @@ -114,7 +112,7 @@ public class NimbleAndroidHttpRequest implements HttpRequest { @Override // com.ea.eadp.http.models.HttpRequest public void postAsync(final HttpRequestListener httpRequestListener) { Log.Helper.LOGPUBLICFUNC(this); - this.nimbleNetwork.sendPostRequest(this.resource, this.headers, this.body.getBytes(Charset.forName(HTTP.UTF_8)), new NetworkConnectionCallback() { // from class: com.ea.nimble.pushtng.NimbleAndroidHttpRequest.2 + this.nimbleNetwork.sendPostRequest(this.resource, this.headers, this.body.getBytes(), new NetworkConnectionCallback() { // from class: com.ea.nimble.pushtng.NimbleAndroidHttpRequest.2 @Override // com.ea.nimble.NetworkConnectionCallback public void callback(NetworkConnectionHandle networkConnectionHandle) { NimbleAndroidHttpRequest.this.sendResponseCallback(networkConnectionHandle, httpRequestListener); diff --git a/app/src/main/java/com/ea/nimble/pushtng/NimblePushTNGBroadcastForwarder.java b/app/src/main/java/com/ea/nimble/pushtng/NimblePushTNGBroadcastForwarder.java deleted file mode 100644 index 7c21006..0000000 --- a/app/src/main/java/com/ea/nimble/pushtng/NimblePushTNGBroadcastForwarder.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.ea.nimble.pushtng; - -import android.content.ComponentName; -import android.content.Context; -import android.content.Intent; -import android.content.pm.PackageManager; -import android.os.Bundle; -import com.ea.eadp.http.services.HttpService; -import com.ea.eadp.pushnotification.forwarding.GcmIntentService; -import com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder; -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.Log; -import com.ea.nimble.NimbleApplicationConfiguration; -import com.ea.nimble.tracking.Tracking; -import com.google.android.vending.expansion.downloader.Constants; -import java.io.File; -import java.util.HashMap; - -/* loaded from: classes.dex */ -public class NimblePushTNGBroadcastForwarder extends PushBroadcastForwarder { - @Override // com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder - protected void handleNewPushNotification(Context context, Bundle bundle) { - Log.Helper.LOGFUNC(this); - String string = bundle.getString(GcmIntentService.PushIntentExtraKeys.COLLAPSE_KEY); - if (string != null) { - String replace = string.replace(File.pathSeparator, Constants.FILENAME_SEQUENCE_SEPARATOR).replace(File.separator, "_"); - context.getApplicationContext().getSharedPreferences("PushTNGStacking_" + replace, 0).edit().clear().commit(); - } - if (bundle.getBoolean(NimblePushTNGIntentService.EXTRA_IS_DELETE_INTENT)) { - return; - } - String string2 = bundle.getString(GcmIntentService.PushIntentExtraKeys.PUSH_ID); - String string3 = bundle.getString(GcmIntentService.PushIntentExtraKeys.PN_TYPE); - if (string2 != null && string3 != null) { - HashMap hashMap = new HashMap(); - hashMap.put(PushNotification.KEY_TRACKING_TYPE, Tracking.EVENT_PN_SHOWN_TO_USER); - hashMap.put("NIMBLESTANDARD::KEY_PN_MESSAGE_ID", string2); - hashMap.put(Tracking.KEY_PN_MESSAGE_TYPE, string3); - PushNotificationImpl.persistTrackingData(context, hashMap, string2 + "_" + Tracking.EVENT_PN_SHOWN_TO_USER); - } - if (ApplicationEnvironment.isMainApplicationActive()) { - try { - showMessage(bundle); - IPushNotification component = PushNotification.getComponent(); - if (component != null) { - component.sendPendingTrackingRequests(); - } else { - Log.Helper.LOGE(this, "Couldn't find Push Notification component with Base, unable to send pending tracking requests", new Object[0]); - } - return; - } catch (AssertionError unused) { - return; - } - } - super.handleNewPushNotification(context, bundle); - } - - protected void showMessage(Bundle bundle) { - Log.Helper.LOGFUNC(this); - } - - @Override // com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder - protected String getPushTargetActivity(Context context) { - Intent launchIntentForPackage; - ComponentName resolveActivity; - Log.Helper.LOGFUNC(this); - int configValueAsInt = NimbleApplicationConfiguration.getConfigValueAsInt("com.ea.nimble.pushtng.notification.activity.name"); - if (configValueAsInt != 0) { - return context.getResources().getString(configValueAsInt); - } - Log.Helper.LOGIS("PushTNG", "Could not locate target activity. PN delivered to launch activity", new Object[0]); - Context applicationContext = context.getApplicationContext(); - PackageManager packageManager = applicationContext.getPackageManager(); - if (packageManager != null && (launchIntentForPackage = packageManager.getLaunchIntentForPackage(applicationContext.getPackageName())) != null && (resolveActivity = launchIntentForPackage.resolveActivity(packageManager)) != null) { - return resolveActivity.getClassName(); - } - Log.Helper.LOGE(this, "Null Pointer found in pushActivityName generation, unable to get class name for push activity", new Object[0]); - return ""; - } - - @Override // com.ea.eadp.pushnotification.forwarding.PushBroadcastForwarder - protected HttpService getHttpService() { - Log.Helper.LOGFUNC(this); - return new NimbleAndroidHttpService(); - } -} diff --git a/app/src/main/java/com/ea/nimble/pushtng/NimblePushTNGBroadcastReceiver.java b/app/src/main/java/com/ea/nimble/pushtng/NimblePushTNGBroadcastReceiver.java deleted file mode 100644 index 85ee98e..0000000 --- a/app/src/main/java/com/ea/nimble/pushtng/NimblePushTNGBroadcastReceiver.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.ea.nimble.pushtng; - -import com.ea.eadp.pushnotification.forwarding.GcmBroadcastReceiver; -import com.ea.nimble.Log; - -/* loaded from: classes.dex */ -public class NimblePushTNGBroadcastReceiver extends GcmBroadcastReceiver { - @Override // com.ea.eadp.pushnotification.forwarding.GcmBroadcastReceiver - protected String getIntentServiceName() { - Log.Helper.LOGFUNC(this); - return NimblePushTNGIntentService.class.getName(); - } -} diff --git a/app/src/main/java/com/ea/nimble/pushtng/NimblePushTNGIntentService.java b/app/src/main/java/com/ea/nimble/pushtng/NimblePushTNGIntentService.java deleted file mode 100644 index 60e2c32..0000000 --- a/app/src/main/java/com/ea/nimble/pushtng/NimblePushTNGIntentService.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.ea.nimble.pushtng; - -import android.annotation.TargetApi; -import android.app.PendingIntent; -import android.content.ComponentName; -import android.content.Intent; -import android.content.SharedPreferences; -import android.content.res.Resources; -import android.os.Build; -import android.os.Bundle; -import android.support.v4.app.NotificationCompat; -import com.ea.eadp.http.services.HttpService; -import com.ea.eadp.pushnotification.forwarding.GcmIntentService; -import com.ea.nimble.ApplicationEnvironment; -import com.ea.nimble.Log; -import com.ea.nimble.tracking.Tracking; -import com.facebook.internal.NativeProtocol; -import com.facebook.internal.ServerProtocol; -import com.google.android.gms.drive.DriveFile; -import com.google.android.vending.expansion.downloader.Constants; -import java.io.File; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Vector; - -/* loaded from: classes.dex */ -public class NimblePushTNGIntentService extends GcmIntentService { - private static final String DO_NOT_COLLAPSE = "do_not_collapse"; - public static final String EXTRA_IS_DELETE_INTENT = "IsDeleteIntent"; - private static final String KEY_PUSH_COUNT = "push_count"; - private static final String KEY_PUSH_TEXT_LIST = "push_text_list"; - - @Override // com.ea.eadp.pushnotification.forwarding.GcmIntentService - protected void onHandleMessage(Intent intent) { - Log.Helper.LOGFUNC(this); - Bundle extras = intent.getExtras(); - if (extras == null) { - Log.Helper.LOGE(this, "NimblePushTNGIntentService onHandleMessage failed! Extras from intent were null, unable to process message.", new Object[0]); - return; - } - String string = extras.getString(GcmIntentService.PushIntentExtraKeys.PUSH_ID); - String string2 = extras.getString(GcmIntentService.PushIntentExtraKeys.PN_TYPE); - if (string != null && string2 != null) { - HashMap hashMap = new HashMap(); - hashMap.put(PushNotification.KEY_TRACKING_TYPE, Tracking.EVENT_PN_RECEIVED); - hashMap.put("NIMBLESTANDARD::KEY_PN_MESSAGE_ID", string); - hashMap.put(Tracking.KEY_PN_MESSAGE_TYPE, string2); - PushNotificationImpl.persistTrackingData(getApplicationContext(), hashMap, string + "_" + Tracking.EVENT_PN_RECEIVED); - } - intent.putExtra("PushNotification", ServerProtocol.DIALOG_RETURN_SCOPES_TRUE); - super.onHandleMessage(intent); - } - - @Override // com.ea.eadp.pushnotification.forwarding.GcmIntentService - @TargetApi(11) - protected void customizeNotification(NotificationCompat.Builder builder, Bundle bundle) { - String string; - Log.Helper.LOGFUNC(this); - super.customizeNotification(builder, bundle); - if (Build.VERSION.SDK_INT < 11 || (string = bundle.getString(GcmIntentService.PushIntentExtraKeys.COLLAPSE_KEY)) == null || string.equalsIgnoreCase(DO_NOT_COLLAPSE)) { - return; - } - String replace = string.replace(File.pathSeparator, Constants.FILENAME_SEQUENCE_SEPARATOR).replace(File.separator, "_"); - SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences("PushTNGStacking_" + replace, 0); - int i = sharedPreferences.getInt(KEY_PUSH_COUNT, 0); - Vector vector = new Vector(); - for (int i2 = 0; i2 < i; i2++) { - String string2 = sharedPreferences.getString(KEY_PUSH_TEXT_LIST + i2, null); - if (string2 != null) { - vector.add(string2); - } - } - int i3 = i + 1; - vector.add(bundle.getString(GcmIntentService.PushIntentExtraKeys.ALERT)); - if (i3 > 1) { - Resources resources = getApplicationContext().getResources(); - String packageName = getApplicationContext().getPackageName(); - NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle(); - Iterator it = vector.iterator(); - while (it.hasNext()) { - inboxStyle.addLine((CharSequence) it.next()); - } - CharSequence charSequence = getApplicationContext().getResources().getString(resources.getIdentifier(NativeProtocol.BRIDGE_ARG_APP_NAME_STRING, "string", packageName)) + "(" + i3 + ")"; - inboxStyle.setBigContentTitle(charSequence); - builder.setContentTitle(charSequence); - builder.setStyle(inboxStyle); - } - ComponentName broadcastForwarderComponent = getBroadcastForwarderComponent(); - if (broadcastForwarderComponent != null) { - Intent intent = new Intent(); - intent.setComponent(broadcastForwarderComponent); - intent.putExtra(EXTRA_IS_DELETE_INTENT, true); - intent.putExtra(GcmIntentService.PushIntentExtraKeys.COLLAPSE_KEY, replace); - builder.setDeleteIntent(PendingIntent.getBroadcast(getApplicationContext(), 0, intent, DriveFile.MODE_READ_ONLY)); - } else { - Log.Helper.LOGW(this, "Broadcast listener for action 'com.ea.eadp.pushnotification.FORWARD_AS_ORDERED_BROADCAST' was not found. Skipping setting DeleteIntent in Notification.", new Object[0]); - } - SharedPreferences.Editor edit = sharedPreferences.edit(); - for (int i4 = 0; i4 < vector.size(); i4++) { - edit.putString(KEY_PUSH_TEXT_LIST + i4, (String) vector.elementAt(i4)); - } - edit.putInt(KEY_PUSH_COUNT, i3); - edit.commit(); - } - - @Override // com.ea.eadp.pushnotification.forwarding.GcmIntentService - protected boolean isInForeground() { - Log.Helper.LOGFUNC(this); - return ApplicationEnvironment.isMainApplicationActive(); - } - - @Override // com.ea.eadp.pushnotification.forwarding.GcmIntentService - protected HttpService getHttpService() { - Log.Helper.LOGFUNC(this); - return new NimbleAndroidHttpService(); - } -} diff --git a/app/src/main/java/com/ea/nimble/pushtng/PushNotificationConfig.java b/app/src/main/java/com/ea/nimble/pushtng/PushNotificationConfig.java new file mode 100644 index 0000000..4a8cd2f --- /dev/null +++ b/app/src/main/java/com/ea/nimble/pushtng/PushNotificationConfig.java @@ -0,0 +1,4 @@ +package com.ea.nimble.pushtng; + +public class PushNotificationConfig { +} diff --git a/app/src/main/java/com/ea/nimble/pushtng/PushNotificationImpl.java b/app/src/main/java/com/ea/nimble/pushtng/PushNotificationImpl.java index 392dc6a..d014afc 100644 --- a/app/src/main/java/com/ea/nimble/pushtng/PushNotificationImpl.java +++ b/app/src/main/java/com/ea/nimble/pushtng/PushNotificationImpl.java @@ -10,12 +10,10 @@ import android.content.Intent; import android.content.SharedPreferences; import android.os.Build; import android.os.Bundle; -import android.support.v4.app.NotificationCompat; -import android.support.v4.content.LocalBroadcastManager; -import com.ea.eadp.pushnotification.listeners.IPushListener; -import com.ea.eadp.pushnotification.models.PushNotificationConfig; -import com.ea.eadp.pushnotification.services.AndroidPushService; -import com.ea.eadp.pushnotification.services.IPushService; + +import androidx.core.app.NotificationCompat; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; + import com.ea.nimble.ApplicationEnvironment; import com.ea.nimble.ApplicationLifecycle; import com.ea.nimble.Base; @@ -32,9 +30,6 @@ import com.ea.nimble.SynergyEnvironment; import com.ea.nimble.Utility; import com.ea.nimble.tracking.ITracking; import com.ea.nimble.tracking.Tracking; -import com.facebook.internal.ServerProtocol; -import com.facebook.share.internal.ShareConstants; -import com.google.android.gms.gcm.GoogleCloudMessaging; import com.google.gson.Gson; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -91,21 +86,6 @@ public class PushNotificationImpl extends Component implements IPushNotification @Override // com.ea.nimble.Component public void setup() { - if (this.m_ageListener == null) { - this.m_ageListener = new BroadcastReceiver() { // from class: com.ea.nimble.pushtng.PushNotificationImpl.1 - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - if (intent != null) { - Bundle extras = intent.getExtras(); - PushNotificationImpl.this.dobFromAgeCompliance = extras.getLong("dob", -2147483648L); - if (PushNotificationImpl.this.dobFromAgeCompliance != -2147483648L) { - Log.Helper.LOGV(this, "PushTNG received AgeCompliance birthday update", new Object[0]); - } - } - } - }; - Utility.registerReceiver(Global.NIMBLE_NOTIFICATION_AGE_COMPLIANCE_DOB_UPDATE, this.m_ageListener); - } } @Override // com.ea.nimble.Component @@ -167,28 +147,19 @@ public class PushNotificationImpl extends Component implements IPushNotification NimbleAndroidHttpService nimbleAndroidHttpService = new NimbleAndroidHttpService(); NimbleDeviceIdService nimbleDeviceIdService = new NimbleDeviceIdService(); if (Build.VERSION.SDK_INT >= 26) { - NotificationManager notificationManager = (NotificationManager) applicationContext.getSystemService("notification"); + NotificationManager notificationManager = (NotificationManager) applicationContext.getSystemService(Context.NOTIFICATION_SERVICE); if (!NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_PUSHTNG_ID_KEY)) { String str = Global.NOTIFICATION_CHANNEL_DEFAULT_NAME_VALUE; if (NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_DEFAULT_NAME_KEY)) { str = applicationContext.getResources().getString(NimbleApplicationConfiguration.getConfigValueAsInt(Global.NOTIFICATION_CHANNEL_DEFAULT_NAME_KEY)); } - NotificationChannel notificationChannel = new NotificationChannel(Global.NOTIFICATION_CHANNEL_DEFAULT_ID, str, 3); + NotificationChannel notificationChannel = new NotificationChannel(Global.NOTIFICATION_CHANNEL_DEFAULT_ID, str, NotificationManager.IMPORTANCE_DEFAULT); if (NimbleApplicationConfiguration.configValueExists(Global.NOTIFICATION_CHANNEL_DEFAULT_DESCRIPTION_KEY)) { notificationChannel.setDescription(applicationContext.getResources().getString(NimbleApplicationConfiguration.getConfigValueAsInt(Global.NOTIFICATION_CHANNEL_DEFAULT_DESCRIPTION_KEY))); } notificationManager.createNotificationChannel(notificationChannel); } } - int configValueAsInt = NimbleApplicationConfiguration.getConfigValueAsInt("com.ea.nimble.pushtng.gcm.sender.id"); - int configValueAsInt2 = NimbleApplicationConfiguration.getConfigValueAsInt("com.ea.nimble.pushtng.auth.api.key"); - int configValueAsInt3 = NimbleApplicationConfiguration.getConfigValueAsInt("com.ea.nimble.pushtng.auth.api.secret"); - if (configValueAsInt != 0 && configValueAsInt2 != 0 && configValueAsInt3 != 0) { - this.pushService = new AndroidPushService(GoogleCloudMessaging.getInstance(applicationContext), nimbleAndroidHttpService, nimbleDeviceIdService, applicationContext, null, applicationContext.getResources().getString(configValueAsInt), serverUrlWithKey, productId, sellId, applicationContext.getResources().getString(configValueAsInt2), applicationContext.getResources().getString(configValueAsInt3), 0); - Utility.sendBroadcast(PushNotification.NOTIFICATION_PUSHTNG_COMPONENT_SETUP_COMPLETE); - this.pushService.sendPendingTrackingRequests(); - return; - } Log.Helper.LOGW(this, "Configuration data not loaded. Push component not initialized.", new Object[0]); } @@ -203,10 +174,6 @@ public class PushNotificationImpl extends Component implements IPushNotification } return; } - PushNotificationConfig pushNotificationConfig = new PushNotificationConfig(); - pushNotificationConfig.setUserAlias(str); - pushNotificationConfig.setDateOfBirth(new SimpleDateFormat("yyyy-MM").format(getValidDOB(date))); - startWithConfig(pushNotificationConfig, iPushListener); } @Override // com.ea.nimble.pushtng.IPushNotification @@ -218,82 +185,6 @@ public class PushNotificationImpl extends Component implements IPushNotification } } else { PushNotificationConfig pushNotificationConfig = new PushNotificationConfig(); - pushNotificationConfig.setUserAlias(str); - pushNotificationConfig.setDateOfBirth(new SimpleDateFormat("yyyy-MM").format(getValidDOB(date))); - pushNotificationConfig.setDisabled(true); - pushNotificationConfig.setDisabledReason(str2); - startWithConfig(pushNotificationConfig, iPushListener); - } - } - - private void startWithConfig(final PushNotificationConfig pushNotificationConfig, final IPushListener iPushListener) { - Log.Helper.LOGFUNC(this); - final Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); - this.pushService.setPushListener(new IPushListener() { // from class: com.ea.nimble.pushtng.PushNotificationImpl.3 - @Override // com.ea.eadp.pushnotification.listeners.IPushListener - public void onTrackingSuccess(int i, String str) { - if (iPushListener != null) { - iPushListener.onTrackingSuccess(i, str); - } - } - - @Override // com.ea.eadp.pushnotification.listeners.IPushListener - public void onRegistrationSuccess(int i, String str) { - boolean z = false; - Log.Helper.LOGD(this, "onRegistrationSuccess: " + str, new Object[0]); - HashMap hashMap = new HashMap(); - hashMap.put(Tracking.KEY_PN_DATE_OF_BIRTH, pushNotificationConfig.getDateOfBirth()); - hashMap.put(Tracking.KEY_PN_DISABLED_FLAG, pushNotificationConfig.isDisabled() ? ServerProtocol.DIALOG_RETURN_SCOPES_TRUE : "false"); - hashMap.put(PushNotification.KEY_TRACKING_TYPE, Tracking.EVENT_PN_DEVICE_REGISTERED); - PushNotificationImpl.this.disableCheck = pushNotificationConfig.isDisabled() ? pushNotificationConfig.getDisabledReason() : null; - PushNotificationImpl pushNotificationImpl = PushNotificationImpl.this; - if (i >= 200 && i < 300) { - z = true; - } - pushNotificationImpl.statusCheck = z; - PushNotificationImpl.persistTrackingData(applicationContext, hashMap, str); - if (ApplicationEnvironment.isMainApplicationRunning()) { - PushNotificationImpl.this.sendPendingTrackingRequests(); - } - if (iPushListener != null) { - iPushListener.onRegistrationSuccess(i, str); - } - } - - @Override // com.ea.eadp.pushnotification.listeners.IPushListener - public void onGetInAppSuccess(int i, String str) { - if (iPushListener != null) { - iPushListener.onGetInAppSuccess(i, str); - } - } - - @Override // com.ea.eadp.pushnotification.listeners.IPushListener - public void onConnectionError(int i, String str) { - Log.Helper.LOGW(this, "onConnectionError: " + str, new Object[0]); - if (iPushListener != null) { - iPushListener.onConnectionError(i, str); - } - PushNotificationImpl.this.statusCheck = false; - } - }); - this.pushService.startWithConfig(pushNotificationConfig, null); - boolean isDisabled = pushNotificationConfig.isDisabled(); - if ((!isDisabled || pushNotificationConfig.getDisabledReason().equals(PushNotification.DISABLED_REASON_OPT_OUT)) && !Boolean.valueOf(isDisabled).equals(this.disabled)) { - this.disabled = Boolean.valueOf(isDisabled); - HashMap hashMap = new HashMap(); - hashMap.put("en", "settings"); - Bundle bundle = new Bundle(); - bundle.putSerializable("core", hashMap); - bundle.putString("type", "opt_in_pn"); - bundle.putString("status", isDisabled ? "declined" : "accepted"); - Intent intent = new Intent(); - intent.setAction(NOTIFICATION_TRACKING2_LOG_EVENT); - intent.putExtras(bundle); - LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).sendBroadcast(intent); - Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.CACHE); - if (persistenceForNimbleComponent != null) { - persistenceForNimbleComponent.setValue(PERSISTENCE_DISABLED_KEY, this.disabled); - } } } @@ -329,7 +220,7 @@ public class PushNotificationImpl extends Component implements IPushNotification Iterator it2 = arrayList.iterator(); while (it2.hasNext()) { HashMap hashMap = new HashMap((Map) it2.next()); - String remove = hashMap.remove(PushNotification.KEY_TRACKING_TYPE); + String remove = (String) hashMap.remove(PushNotification.KEY_TRACKING_TYPE); hashMap.put(Tracking.KEY_PN_DEVICE_ID, SynergyEnvironment.getComponent().getEADeviceId()); iTracking.logEvent(remove, hashMap); } @@ -339,7 +230,7 @@ public class PushNotificationImpl extends Component implements IPushNotification if (str.equals(Tracking.EVENT_PN_RECEIVED) || str.equals(Tracking.EVENT_PN_SHOWN_TO_USER)) { String str2 = str.equals(Tracking.EVENT_PN_RECEIVED) ? "received" : "impression"; HashMap hashMap2 = new HashMap(); - hashMap2.put("en", ShareConstants.WEB_DIALOG_PARAM_MESSAGE); + //hashMap2.put("en", ShareConstants.WEB_DIALOG_PARAM_MESSAGE); Bundle bundle = new Bundle(); bundle.putSerializable("core", hashMap2); bundle.putString("type", "pn"); diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java index 5ce5a29..1b9c963 100644 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java @@ -238,33 +238,8 @@ abstract class NimbleTrackingImplBase extends Component implements ITracking, Lo this.m_threadManager = NimbleTrackingThreadManager.acquireInstance(); } - /* JADX WARN: Removed duplicated region for block: B:100:0x02f4 */ - /* JADX WARN: Removed duplicated region for block: B:103:0x02fe */ - /* JADX WARN: Removed duplicated region for block: B:111:0x0329 */ - /* JADX WARN: Removed duplicated region for block: B:114:? A[RETURN, SYNTHETIC] */ - /* JADX WARN: Removed duplicated region for block: B:117:0x0181 */ - /* JADX WARN: Removed duplicated region for block: B:11:0x014f */ - /* JADX WARN: Removed duplicated region for block: B:120:0x016c */ - /* JADX WARN: Removed duplicated region for block: B:131:0x0086 */ - /* JADX WARN: Removed duplicated region for block: B:144:0x0144 */ - /* JADX WARN: Removed duplicated region for block: B:16:0x017e */ - /* JADX WARN: Removed duplicated region for block: B:19:0x018c */ - /* JADX WARN: Removed duplicated region for block: B:78:0x028d */ - /* JADX WARN: Removed duplicated region for block: B:79:0x0295 */ - /* JADX WARN: Removed duplicated region for block: B:82:0x02a8 */ - /* JADX WARN: Removed duplicated region for block: B:85:0x02bb */ - /* JADX WARN: Removed duplicated region for block: B:96:0x02e4 */ @Override // com.ea.nimble.Component - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ protected void restore() { - /* - Method dump skipped, instructions count: 824 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.tracking.NimbleTrackingImplBase.restore():void"); } @Override // com.ea.nimble.Component @@ -773,7 +748,6 @@ abstract class NimbleTrackingImplBase extends Component implements ITracking, Lo loadSessionFromFile = loadSessionFromFile(j); if (loadSessionFromFile == null) { continue; - j++; } } if (arrayList.size() == 0 || isSameSession(arrayList.get(arrayList.size() - 1), loadSessionFromFile)) { diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java index e2aa74b..37d75db 100644 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java @@ -8,7 +8,6 @@ import android.database.Cursor; import android.net.Uri; import android.os.Build; import android.provider.Settings; -import android.support.v4.media.session.PlaybackStateCompat; import android.telephony.TelephonyManager; import com.ea.nimble.ApplicationEnvironment; import com.ea.nimble.IApplicationEnvironment; @@ -19,7 +18,6 @@ import com.ea.nimble.ISynergyRequest; import com.ea.nimble.ISynergyResponse; import com.ea.nimble.Log; import com.ea.nimble.LogSource; -import com.ea.nimble.NimbleApplicationConfiguration; import com.ea.nimble.SynergyEnvironment; import com.ea.nimble.SynergyIdManager; import com.ea.nimble.SynergyNetwork; @@ -335,7 +333,7 @@ class NimbleTrackingS2SImpl extends NimbleTrackingImplBase implements LogSource if (currentActivity != null) { ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); ((ActivityManager) currentActivity.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryInfo(memoryInfo); - Log.Helper.LOGI(this, "OutOfMemoryError with " + (memoryInfo.availMem / PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED) + " MB left. Dropping current session", new Object[0]); + //Log.Helper.LOGI(this, "OutOfMemoryError with " + (memoryInfo.availMem / PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED) + " MB left. Dropping current session", new Object[0]); } else { Log.Helper.LOGI(this, "Out of memory. Dropping current session", new Object[0]); } diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java index 87a9276..1689243 100644 --- a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java @@ -7,7 +7,6 @@ import android.content.Context; import android.content.Intent; import android.os.Build; import android.provider.Settings; -import android.support.v4.media.session.PlaybackStateCompat; import com.ea.nimble.ApplicationEnvironment; import com.ea.nimble.Global; import com.ea.nimble.IApplicationEnvironment; @@ -29,8 +28,6 @@ import com.ea.nimble.SynergyNetworkConnectionHandle; import com.ea.nimble.SynergyRequest; import com.ea.nimble.Utility; import com.ea.nimble.mtx.catalog.synergy.SynergyCatalog; -import com.ea.nimble.tracking.NimbleTrackingThreadManager; -import com.ea.nimble.tracking.Tracking; import java.util.ArrayList; import java.util.Calendar; import java.util.Collection; @@ -433,7 +430,7 @@ class NimbleTrackingSynergyImpl extends NimbleTrackingImplBase implements LogSou return null; } } - for (String str2 : hashMap.keySet()) { + for (Object str2 : hashMap.keySet()) { String str3 = (String) hashMap.get(str2); if (Utility.validString(str3) && str3.startsWith("${") && str3.endsWith("}")) { String str4 = this.m_trackingAttributes.get(str3.substring(2, str3.length() - 1)); @@ -515,8 +512,8 @@ class NimbleTrackingSynergyImpl extends NimbleTrackingImplBase implements LogSou Activity currentActivity = ApplicationEnvironment.getCurrentActivity(); if (currentActivity != null) { ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); - ((ActivityManager) currentActivity.getSystemService("activity")).getMemoryInfo(memoryInfo); - Log.Helper.LOGI(this, "OutOfMemoryError with " + (memoryInfo.availMem / PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED) + " MB left. Dropping current session", new Object[0]); + ((ActivityManager) currentActivity.getSystemService(Context.ACTIVITY_SERVICE)).getMemoryInfo(memoryInfo); + //Log.Helper.LOGI(this, "OutOfMemoryError with " + (memoryInfo.availMem / PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED) + " MB left. Dropping current session", new Object[0]); } else { Log.Helper.LOGI(this, "Out of memory. Dropping current session", new Object[0]); } diff --git a/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java b/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java index b1847fd..a316ef7 100644 --- a/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java +++ b/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java @@ -1,16 +1,14 @@ package com.ea.nimble.tracking; -import com.google.android.gms.games.GamesActivityResultCodes; - /* loaded from: classes.dex */ public enum SynergyConstants { EVT_UNDEFINED(-1), EVT_APP_START_NORMALLY(10000), - EVT_APP_START_FROMPUSH(GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED), - EVT_APP_START_AFTERINSTALL(GamesActivityResultCodes.RESULT_SIGN_IN_FAILED), - EVT_APP_START_AFTERUPGRADE(GamesActivityResultCodes.RESULT_LICENSE_FAILED), - EVT_APP_RESUME_NORMAL(GamesActivityResultCodes.RESULT_APP_MISCONFIGURED), - EVT_APP_SESSION_TIME(GamesActivityResultCodes.RESULT_LEFT_ROOM), + EVT_APP_START_FROMPUSH(12), + EVT_APP_START_AFTERINSTALL(1234), + EVT_APP_START_AFTERUPGRADE(43345), + EVT_APP_RESUME_NORMAL(34534523), + EVT_APP_SESSION_TIME(435424534), EVT_APP_RESUME_FROM_PUSH(10007), EVT_APP_START_FROM_URL(10009), EVT_APP_RESUME_FROM_URL(10010), @@ -186,10 +184,10 @@ public enum SynergyConstants { EVT_GAME_ERROR_CONNECTIVITY(90000), EVT_GAME_ERROR_GAMEPLAY(90001), EVT_APPSTART_NORMALLY(10000), - EVT_APPSTART_FROMPUSH(GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED), - EVT_APPSTART_AFTERINSTALL(GamesActivityResultCodes.RESULT_SIGN_IN_FAILED), - EVT_APPSTART_AFTERUPGRADE(GamesActivityResultCodes.RESULT_LICENSE_FAILED), - EVT_APP_SESSION_START(GamesActivityResultCodes.RESULT_APP_MISCONFIGURED), + EVT_APPSTART_FROMPUSH(1000002), + EVT_APPSTART_AFTERINSTALL(1111), + EVT_APPSTART_AFTERUPGRADE(1234123), + EVT_APP_SESSION_START(342353523), EVT_APPSTART_FROM_URL(10009), EVT_APP_ENTER_FOREGROUND_FROM_URL(10010), EVT_APPEND_NORMALLY(20000), diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java b/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java index 5d8944d..19286ed 100644 --- a/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java +++ b/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java @@ -3,7 +3,6 @@ package com.ea.nimble.tracking; import android.app.Activity; import android.content.Intent; import android.os.Bundle; -import com.ea.eadp.pushnotification.forwarding.GcmIntentService; import com.ea.nimble.ApplicationEnvironment; import com.ea.nimble.ApplicationLifecycle; import com.ea.nimble.Base; @@ -169,104 +168,10 @@ class TrackingEventWrangler extends Component implements IApplicationLifecycle.A logAndCheckEvent(str, null); } - /* JADX WARN: Removed duplicated region for block: B:15:? A[RETURN, SYNTHETIC] */ - /* JADX WARN: Removed duplicated region for block: B:9:0x008c */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ private void logAndCheckEvent(java.lang.String r9, java.util.Map r10) { - /* - r8 = this; - com.ea.nimble.Log.Helper.LOGFUNC(r8) - java.lang.String r0 = "com.ea.nimble.tracking" - com.ea.nimble.Component r0 = com.ea.nimble.Base.getComponent(r0) - com.ea.nimble.tracking.TrackingWrangler r0 = (com.ea.nimble.tracking.TrackingWrangler) r0 - boolean r1 = com.ea.nimble.tracking.Tracking.isSessionStartEvent(r9) - r2 = 1 - r3 = 0 - if (r1 == 0) goto L34 - java.lang.Long r1 = r8.m_sessionStartTimestamp - if (r1 == 0) goto L1f - java.lang.String r1 = "Pre-existing session start timestamp found while logging new session start! Overwriting previous session start timestamp." - java.lang.Object[] r4 = new java.lang.Object[r3] - com.ea.nimble.Log.Helper.LOGE(r8, r1, r4) - goto L26 - L1f: - java.lang.String r1 = "Marking session start time." - java.lang.Object[] r4 = new java.lang.Object[r3] - com.ea.nimble.Log.Helper.LOGD(r8, r1, r4) - L26: - long r4 = java.lang.System.currentTimeMillis() - java.lang.Long r1 = java.lang.Long.valueOf(r4) - r8.m_sessionStartTimestamp = r1 - r0.setSessionState(r2) - goto L89 - L34: - java.lang.Long r1 = r8.m_sessionStartTimestamp - if (r1 != 0) goto L42 - java.lang.String r10 = "No current session. %s will not be logged." - java.lang.Object[] r0 = new java.lang.Object[r2] - r0[r3] = r9 - com.ea.nimble.Log.Helper.LOGE(r8, r10, r0) - return - L42: - boolean r1 = com.ea.nimble.tracking.Tracking.isSessionEndEvent(r9) - if (r1 == 0) goto L89 - long r4 = java.lang.System.currentTimeMillis() - java.lang.Long r1 = r8.m_sessionStartTimestamp - long r6 = r1.longValue() - long r4 = r4 - r6 - double r4 = (double) r4 - r6 = 4652007308841189376(0x408f400000000000, double:1000.0) - java.lang.Double.isNaN(r4) - double r4 = r4 / r6 - java.util.Locale r1 = java.util.Locale.US - java.lang.String r6 = "%.0f" - java.lang.Object[] r7 = new java.lang.Object[r2] - java.lang.Double r4 = java.lang.Double.valueOf(r4) - r7[r3] = r4 - java.lang.String r1 = java.lang.String.format(r1, r6, r7) - java.lang.String r4 = "Logging session time, %s seconds." - java.lang.Object[] r5 = new java.lang.Object[r2] - r5[r3] = r1 - com.ea.nimble.Log.Helper.LOGD(r8, r4, r5) - java.util.HashMap r4 = new java.util.HashMap - r4.() - java.lang.String r5 = "NIMBLESTANDARD::KEY_DURATION" - r4.put(r5, r1) - java.lang.String r1 = "NIMBLESTANDARD::SESSION_TIME" - r8.logAndCheckEvent(r1, r4) - r1 = 0 - r8.m_sessionStartTimestamp = r1 - goto L8a - L89: - r2 = 0 - L8a: - if (r0 == 0) goto L94 - r0.logEvent(r9, r10) - if (r2 == 0) goto L94 - r0.setSessionState(r3) - L94: - return - */ - throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.tracking.TrackingEventWrangler.logAndCheckEvent(java.lang.String, java.util.Map):void"); + } private void addPushTNGTrackingParams(Bundle bundle, Map map) { - Log.Helper.LOGFUNC(this); - if (bundle == null || bundle.isEmpty()) { - return; - } - if (bundle.containsKey(GcmIntentService.PushIntentExtraKeys.PUSH_ID)) { - map.put("NIMBLESTANDARD::KEY_PN_MESSAGE_ID", bundle.getString(GcmIntentService.PushIntentExtraKeys.PUSH_ID)); - } - if (bundle.containsKey(GcmIntentService.PushIntentExtraKeys.PN_TYPE)) { - map.put(Tracking.KEY_PN_MESSAGE_TYPE, bundle.getString(GcmIntentService.PushIntentExtraKeys.PN_TYPE)); - } - if (map == null || map.isEmpty()) { - return; - } - map.put(Tracking.KEY_PN_DEVICE_ID, SynergyEnvironment.getComponent().getEADeviceId()); } } diff --git a/app/src/main/java/com/eamobile/ADCTelemetry.java b/app/src/main/java/com/eamobile/ADCTelemetry.java deleted file mode 100644 index 74ef045..0000000 --- a/app/src/main/java/com/eamobile/ADCTelemetry.java +++ /dev/null @@ -1,309 +0,0 @@ -package com.eamobile; - -import android.os.Build; -import com.eamobile.download.Logging; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileReader; -import java.io.FileWriter; -import java.util.Date; -import java.util.Queue; -import java.util.UUID; -import org.apache.http.HttpEntity; -import org.apache.http.HttpHeaders; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpUriRequest; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.params.HttpConnectionParams; -import org.apache.http.params.HttpParams; -import org.apache.http.protocol.HTTP; -import org.apache.http.util.EntityUtils; -import org.json.JSONException; -import org.json.JSONObject; - -/* loaded from: classes.dex */ -public class ADCTelemetry { - public static final int CANCEL = 4; - public static final int COMPLETE = 1; - public static final int FAILED = 3; - public static final int RETRY = 2; - public static final int START = 0; - private static ADCTelemetry instance; - private DownloadActivityInternal downloadActivityInternal; - private String pathToQueue; - private Queue eventQueue = null; - private TelemetryQueueThread queueThread = null; - private boolean downloadStarted = false; - private String uniqueToken = UUID.randomUUID().toString(); - - public void onCreate(String str) { - } - - public void onDestroy() { - } - - private ADCTelemetry() { - this.downloadActivityInternal = null; - this.downloadActivityInternal = DownloadActivityInternal.getMainActivity(); - } - - public static synchronized ADCTelemetry getInstance() { - ADCTelemetry aDCTelemetry; - synchronized (ADCTelemetry.class) { - if (instance == null) { - instance = new ADCTelemetry(); - } - aDCTelemetry = instance; - } - return aDCTelemetry; - } - - public void sendTelemetry(int i) { - sendTelemetry(i, ""); - } - - public void sendTelemetry(int i, String str) { - if (i == 0) { - this.downloadActivityInternal.mDownloadActivity.onDownloadEvent(0); - } else if (i == 4) { - this.downloadActivityInternal.mDownloadActivity.onDownloadEvent(1); - } - } - - private void loadQueue(String str, Queue queue) { - Logging.DEBUG_OUT("ADCTelemetry - Loading queue."); - File file = new File(getQueueFileName(str)); - if (file.exists()) { - Logging.DEBUG_OUT("ADCTelemetry - Found queue file!."); - try { - BufferedReader bufferedReader = new BufferedReader(new FileReader(file), 8192); - while (true) { - String readLine = bufferedReader.readLine(); - if (readLine != null) { - Logging.DEBUG_OUT("ADCTelemetry - New queue line: " + readLine); - queue.add(new TelemetryQueueElement(Integer.parseInt(readLine.substring(0, 1)), readLine.substring(1))); - } else { - bufferedReader.close(); - Logging.DEBUG_OUT("ADCTelemetry - Done loading queue file!."); - return; - } - } - } catch (Exception unused) { - } - } else { - Logging.DEBUG_OUT("ADCTelemetry - Queue file doesn't exists."); - } - } - - private String getQueueFileName(String str) { - return str + "/queue.file"; - } - - private void saveQueue(String str, Queue queue) { - File file = new File(getQueueFileName(str)); - if (file.exists()) { - Logging.DEBUG_OUT("ADCTelemetry - Deleting queue file before saving the updated version."); - file.delete(); - } - try { - BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(getQueueFileName(str), true), 8192); - TelemetryQueueElement poll = queue.poll(); - if (poll == null) { - Logging.DEBUG_OUT("ADCTelemetry - No events to save to the queue file"); - } - while (poll != null) { - String str2 = Integer.toString(poll.nrOfRetries) + poll.jsonEvent + "\n"; - Logging.DEBUG_OUT("ADCTelemetry - Saving line in queue file : " + str2); - bufferedWriter.write(str2); - poll = queue.poll(); - } - bufferedWriter.close(); - } catch (Exception unused) { - } - } - - private class TelemetrySendThread extends Thread { - private String jsonEvent; - private String message; - private int retries; - private int state; - - public TelemetrySendThread(int i, String str) { - this.jsonEvent = null; - this.state = i; - this.message = new Date(System.currentTimeMillis()).toString() + " : " + str; - } - - public TelemetrySendThread(String str, int i) { - this.jsonEvent = null; - this.jsonEvent = str; - this.retries = i; - } - - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - Logging.DEBUG_OUT("ADCTelemetry - Inside TelemetrySendThread - before web service call"); - if (this.jsonEvent == null) { - Logging.DEBUG_OUT("ADCTelemetry - Inside TelemetrySendThread calling sendHttpPost with retry = 0"); - sendHttpPost(createJSON(), 0); - } else { - Logging.DEBUG_OUT("ADCTelemetry - Inside TelemetrySendThread calling sendHttpPost with retry = " + Integer.toString(this.retries)); - sendHttpPost(this.jsonEvent, this.retries); - } - Logging.DEBUG_OUT("ADCTelemetry - Inside TelemetrySendThread - after web service call"); - } - - private void sendHttpPost(String str, int i) { - StringBuilder sb; - try { - try { - CloseableHttpClient defaultHttpClient = new DefaultHttpClient(); - HttpParams params = defaultHttpClient.getParams(); - HttpConnectionParams.setConnectionTimeout(params, 450); - HttpConnectionParams.setSoTimeout(params, 450); - HttpPost httpPost = new HttpPost(createURL()); - httpPost.setEntity(new StringEntity(str)); - httpPost.setHeader(HttpHeaders.ACCEPT, HTTP.PLAIN_TEXT_TYPE); - httpPost.setHeader("Content-type", "application/json"); - Logging.DEBUG_OUT("ADCTelemetry - Calling web service."); - HttpResponse execute = defaultHttpClient.execute((HttpUriRequest) httpPost); - int statusCode = execute.getStatusLine().getStatusCode(); - Logging.DEBUG_OUT("ADCTelemetry - Received status code " + Integer.toString(statusCode)); - boolean z = true; - if (statusCode == 200) { - HttpEntity entity = execute.getEntity(); - if (entity != null) { - String entityUtils = EntityUtils.toString(entity); - Logging.DEBUG_OUT("ADCTelemetry - Received body string " + entityUtils); - if (entityUtils.equals("OK")) { - z = false; - } else { - i++; - } - } else { - Logging.DEBUG_OUT("ADCTelemetry - Received empty body string"); - i++; - } - } - if (z && i < 5) { - Logging.DEBUG_OUT("ADCTelemetry - Send failed. Adding event to the queue."); - try { - ADCTelemetry.this.eventQueue.add(ADCTelemetry.this.new TelemetryQueueElement(i, str)); - } catch (Exception e) { - e = e; - sb = new StringBuilder(); - sb.append("ADCTelemetry - Received exception "); - sb.append(e.toString()); - Logging.DEBUG_OUT(sb.toString()); - } - } - } catch (Exception e2) { - Logging.DEBUG_OUT("ADCTelemetry - Received exception " + e2.toString()); - if (i < 5) { - Logging.DEBUG_OUT("ADCTelemetry - Send failed. Adding event to the queue."); - try { - ADCTelemetry.this.eventQueue.add(ADCTelemetry.this.new TelemetryQueueElement(i, str)); - } catch (Exception e3) { - e = e3; - sb = new StringBuilder(); - sb.append("ADCTelemetry - Received exception "); - sb.append(e.toString()); - Logging.DEBUG_OUT(sb.toString()); - } - } - } - } finally { - Logging.DEBUG_OUT("ADCTelemetry - Telemetry was send with success"); - } - } - - private String createURL() { - StringBuilder sb = new StringBuilder(); - DownloadActivityInternal unused = ADCTelemetry.this.downloadActivityInternal; - sb.append(DownloadActivityInternal.DOWNLOAD_URL); - sb.append("androidContentWS/cms/android/gameasset/application/telemetry?"); - sb.append(UUID.randomUUID().toString()); - String sb2 = sb.toString(); - Logging.DEBUG_OUT("ADCTelemetry - Web service url: " + sb2); - return sb2; - } - - private String createJSON() { - String str; - JSONObject jSONObject = new JSONObject(); - try { - jSONObject.put("token", ADCTelemetry.this.uniqueToken); - jSONObject.put("status", this.state); - jSONObject.put("errMsg", this.message); - if (this.state == 0) { - DownloadActivityInternal unused = ADCTelemetry.this.downloadActivityInternal; - jSONObject.put("prodID", DownloadActivityInternal.PRODUCT_ID); - DownloadActivityInternal unused2 = ADCTelemetry.this.downloadActivityInternal; - jSONObject.put("sellID", DownloadActivityInternal.MASTER_SELL_ID); - DownloadActivityInternal unused3 = ADCTelemetry.this.downloadActivityInternal; - jSONObject.put("language", DownloadActivityInternal.language.getCurrentLanguage()); - jSONObject.put("is3G", ADCTelemetry.this.downloadActivityInternal.is3G()); - jSONObject.put("device", ADCTelemetry.this.downloadActivityInternal.getDeviceString()); - jSONObject.put("firmware", Build.VERSION.RELEASE); - jSONObject.put("textureCompression", ADCTelemetry.this.downloadActivityInternal.glExtensions); - jSONObject.put("version", ADCTelemetry.this.downloadActivityInternal.getAPKVersion()); - DownloadActivityInternal unused4 = ADCTelemetry.this.downloadActivityInternal; - if (DownloadActivityInternal.MIN_ASSET_VERSION_REQUIRED == null) { - str = ""; - } else { - DownloadActivityInternal unused5 = ADCTelemetry.this.downloadActivityInternal; - str = DownloadActivityInternal.MIN_ASSET_VERSION_REQUIRED; - } - jSONObject.put("minVersion", str); - } - } catch (JSONException unused6) { - } - Logging.DEBUG_OUT("ADCTelemetry - The following JSON will be send: " + jSONObject.toString()); - return jSONObject.toString(); - } - } - - private class TelemetryQueueThread extends Thread { - private boolean running = true; - - private TelemetryQueueThread() { - } - - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - while (this.running) { - try { - TelemetryQueueElement telemetryQueueElement = (TelemetryQueueElement) ADCTelemetry.this.eventQueue.poll(); - if (telemetryQueueElement != null) { - Logging.DEBUG_OUT("ADCTelemetry - TelemetryQueueThread creating new TelemetrySendThread"); - ADCTelemetry.this.new TelemetrySendThread(telemetryQueueElement.jsonEvent, telemetryQueueElement.nrOfRetries).start(); - } - try { - sleep(1000L); - } catch (Exception unused) { - } - } catch (Exception e) { - Logging.DEBUG_OUT("ADCTelemetry - TelemetryQueueThread " + e.toString()); - } - } - } - - public synchronized void stopThread() { - this.running = false; - } - } - - private class TelemetryQueueElement { - public String jsonEvent; - public int nrOfRetries; - - public TelemetryQueueElement(int i, String str) { - this.nrOfRetries = i; - this.jsonEvent = str; - } - } -} diff --git a/app/src/main/java/com/eamobile/DownloadActivity.java b/app/src/main/java/com/eamobile/DownloadActivity.java deleted file mode 100644 index 89305fa..0000000 --- a/app/src/main/java/com/eamobile/DownloadActivity.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.eamobile; - -import android.app.Activity; -import android.content.Context; - -/* loaded from: classes.dex */ -public class DownloadActivity { - private DownloadActivityInternal mDownloadActivityInternal; - - public DownloadActivity(Context context) { - this.mDownloadActivityInternal = new DownloadActivityInternal(context); - } - - public DownloadActivity(Context context, String str) { - this.mDownloadActivityInternal = new DownloadActivityInternal(context, str); - } - - public void init(Activity activity, IDownloadActivity iDownloadActivity, Context context, Object obj) { - this.mDownloadActivityInternal.init(activity, iDownloadActivity, context, obj); - } - - public void onPause() { - this.mDownloadActivityInternal.onPause(); - } - - public void onResume() { - this.mDownloadActivityInternal.onResume(); - } - - public void onDestroy() { - this.mDownloadActivityInternal.onDestroy(); - } - - public void onWindowFocusChanged(boolean z) { - this.mDownloadActivityInternal.onWindowFocusChanged(z); - } - - public void destroyDownloadActvity() { - this.mDownloadActivityInternal.destroyDownloadActvity(); - } - - public void setAssetPath(String str) { - this.mDownloadActivityInternal.setAssetPath(str, true); - } - - public void setAssetPath(String str, boolean z) { - this.mDownloadActivityInternal.setAssetPath(str, z); - } -} diff --git a/app/src/main/java/com/eamobile/DownloadActivityInternal.java b/app/src/main/java/com/eamobile/DownloadActivityInternal.java deleted file mode 100644 index 9e1db9f..0000000 --- a/app/src/main/java/com/eamobile/DownloadActivityInternal.java +++ /dev/null @@ -1,2213 +0,0 @@ -package com.eamobile; - -import android.app.Activity; -import android.content.ActivityNotFoundException; -import android.content.Context; -import android.content.Intent; -import android.content.IntentFilter; -import android.content.pm.PackageManager; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.net.wifi.SupplicantState; -import android.net.wifi.WifiManager; -import android.os.Build; -import android.os.Environment; -import android.os.Handler; -import android.provider.Settings; -import android.support.v4.media.session.PlaybackStateCompat; -import android.telephony.TelephonyManager; -import android.util.DisplayMetrics; -import android.view.Display; -import com.eamobile.download.AssetManager; -import com.eamobile.download.Constants; -import com.eamobile.download.Device; -import com.eamobile.download.DownloadFileData; -import com.eamobile.download.DownloadProgress; -import com.eamobile.download.LocalZipExtractorEvent; -import com.eamobile.download.Logging; -import com.eamobile.download.MemoryStatus; -import com.eamobile.download.RemoteZipExtractorEvent; -import com.eamobile.download.ZipExtractor; -import com.eamobile.views.CheckUpdatesView; -import com.eamobile.views.CheckingHostIpView; -import com.eamobile.views.ContactingServerView; -import com.eamobile.views.CustomView; -import com.eamobile.views.DeletingAssetsView; -import com.eamobile.views.DownloadFailedView; -import com.eamobile.views.DownloadMsgView; -import com.eamobile.views.DownloadProgressView; -import com.eamobile.views.InvalidAssetVersionView; -import com.eamobile.views.NetworkUnavailableView; -import com.eamobile.views.ServerErrorView; -import com.eamobile.views.Show3GView; -import com.eamobile.views.ShowBGView; -import com.eamobile.views.ShowWifiView; -import com.eamobile.views.SpaceUnavailableView; -import com.eamobile.views.UnSupportedDeviceView; -import com.eamobile.views.UpdatesFoundView; -import com.facebook.internal.AnalyticsEvents; -import com.facebook.internal.ServerProtocol; -import com.facebook.places.model.PlaceFields; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.net.MalformedURLException; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.Hashtable; -import java.util.List; -import java.util.Properties; -import javax.microedition.khronos.opengles.GL10; -import javax.microedition.khronos.opengles.GL11; -import org.apache.http.HttpEntity; -import org.apache.http.HttpHeaders; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpUriRequest; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.DefaultHttpClient; -import org.apache.http.params.BasicHttpParams; -import org.apache.http.params.HttpConnectionParams; -import org.apache.http.protocol.HTTP; -import org.json.JSONObject; - -/* loaded from: classes.dex */ -public class DownloadActivityInternal { - static final String DOWNLOAD_URL_CONFIG_FILE = "DownloadURL.indicate"; - public static final int ERROR_ASSETS_NOT_FOUND = 5002; - public static final int ERROR_CHECKSUM_MATCH_FAILED = -11; - public static final int ERROR_CHECKSUM_NOT_FOUND = -10; - public static final int ERROR_CONNECTION_UNAVAILABLE = -16; - public static final int ERROR_CORRUPTED_ZIP = -12; - public static final int ERROR_DOWNLOAD_TIMEOUT = -1; - public static final int ERROR_FILE_LIST_RETRIEVE_FAILED = -15; - public static final int ERROR_MISSING_CHECKSUMS = -13; - public static final int ERROR_UNEXPECTED_SERVER_ERROR = -14; - public static final int ERROR_UNSUPPORTED_ASSET_VERSION = -17; - public static final int ERROR_UNSUPPORTED_DEVICE = 5001; - private static final int ERROR_ZIP_CHECKSUM_MATCH_FAILED = -4; - private static final int ERROR_ZIP_CHECKSUM_NOT_FOUND = -3; - private static final int ERROR_ZIP_EXCEPTION = -1; - private static final int ERROR_ZIP_NO_ENTRIES = -2; - private static final int NO_ZIP_ERRORS = 1; - private static final String RESOURCES_PATH = "downloadcontent/"; - public static final int STATE_3G_UNAVAILABLE = 7; - public static final int STATE_BG_VIEW = 11; - public static final int STATE_CHECKING_HOST_IP = 15; - public static final int STATE_CHECK_UPDATES = 8; - public static final int STATE_CONTACTING_SERVER = 14; - public static final int STATE_DOWNLOADING_ASSETS = 2; - public static final int STATE_FAILURE = 5; - public static final int STATE_INVALID = -1; - public static final int STATE_SERVER_ERROR = 13; - public static final int STATE_SHOW_3G_DIALOG = 10; - public static final int STATE_SHOW_DELETING_ASSETS = 16; - public static final int STATE_SHOW_DOWNLOAD_MSG = 1; - public static final int STATE_SHOW_WIFI_DIALOG = 6; - public static final int STATE_SPACE_UNAVAILABLE = 4; - public static final int STATE_SUCCESS = 3; - public static final int STATE_UNSUPPORTED_DEVICE = 12; - public static final int STATE_UPDATES_FOUND = 9; - protected static DownloadProgress downloadProgress; - private static int height; - private static Activity instance; - private static boolean isInitialized; - protected static Language language; - private static int width; - private String activityAssetPath; - private boolean activityUseExternal; - private AssetManager assetManager; - String bgFileName; - private Bitmap bmpBg; - private boolean callSetAssetPathAux; - private CheckUpdatesView checkUpdatesView; - private CheckingHostIpView checkingHostIpView; - private boolean configLoaded; - private ContactingServerView contactingServerView; - private DeletingAssetsView deletingAssetsView; - private Device deviceFallback; - private DownloadFailedView downloadFailedView; - private DownloadFileData[] downloadFileData; - private DownloadMsgView downloadMsgView; - private DownloadProgressView downloadProgressView; - String glExtensions; - private InvalidAssetVersionView invalidAssetVersionView; - Context mContext; - IDownloadActivity mDownloadActivity; - Handler mHandler; - private String mLocale; - private NetworkUnavailableView networkUnavailableView; - private ArrayList overrideDevices; - private CustomView pCurrentView; - protected int percent_downloaded; - private ServerErrorView serverErrorView; - private Show3GView show3GView; - private ShowBGView showBGView; - private ShowWifiView showWifiView; - private SpaceUnavailableView spaceUnavailableView; - private UnSupportedDeviceView unSupportedDeviceView; - private UpdatesFoundView updatesFoundView; - private WifiReceiver wifiReceiver; - private static String[] STATE_STRINGS = {"", "STATE_SHOW_DOWNLOAD_MSG", "STATE_DOWNLOADING_ASSETS", "STATE_SUCCESS", "STATE_SPACE_UNAVAILABLE", "STATE_FAILURE", "STATE_SHOW_WIFI_DIALOG", "STATE_3G_UNAVAILABLE", "STATE_CHECK_UPDATES", "STATE_UPDATES_FOUND", "STATE_SHOW_3G_DIALOG", "STATE_BG_VIEW", "STATE_UNSUPPORTED_DEVICE", "STATE_SERVER_ERROR", "STATE_CONTACTING_SERVER", "STATE_CHECKING_HOST_IP", "STATE_SHOW_DELETING_ASSETS"}; - static String DOWNLOAD_URL = null; - static String MIN_ASSET_VERSION_REQUIRED = null; - static int MASTER_SELL_ID = 0; - static int TOTAL_SPACE_MB = 0; - static int TOTAL_SPACE_MB_MIN = 0; - static int PRODUCT_ID = 0; - static int TIMEOUT = 10000; - static int NUMBER_OF_HOURS_TO_UPDATE_CHECKING = 0; - static boolean UNCOMPRESS_ZIP_ON_DEVICE = false; - static boolean CUSTOM_PROGRESS_BAR = true; - static boolean USE_OLD_PROGRESS_BAR = false; - static boolean DISABLE_3G = false; - static boolean USE_INTERNAL_STORAGE = false; - private static boolean FORCE_WAKE_DURING_DOWNLOAD = false; - static boolean DO_NOT_OPEN_STORAGE_SETTINGS = false; - static boolean DELETE_ASSETS_ON_UPDATE = false; - static boolean UNSAFE_ASSET_DELETION_ON_UPDATE = false; - static boolean REDOWNLOAD_ON_SCREEN_SIZE_CHANGE = false; - static boolean ALTERNATIVE_DATA_FOLDER = false; - static boolean RETRIEVE_FULL_SCREEN_RESOLUTION = false; - private static boolean isDownloadRange = false; - private static int pState = -1; - private static int pStatePrev = -1; - private static int totalDownloadSizeMB = 0; - private static long spaceNeededToDownload = -1; - private static long spaceAvailableToDownload = -1; - private static String resolution = ""; - private static ArrayList mErrorList = new ArrayList<>(); - private static String[] EXPECTED_PERMISSIONS = {"android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.ACCESS_WIFI_STATE", "android.permission.ACCESS_NETWORK_STATE", "android.permission.CHANGE_NETWORK_STATE", "android.permission.INTERNET", "android.permission.READ_PHONE_STATE", "android.permission.WAKE_LOCK"}; - private static volatile boolean changingState = false; - static DownloadActivityInternal mMainActivity = null; - static boolean unknownHostExceptionTryAgain = true; - - public static String getResourcesPath() { - return RESOURCES_PATH; - } - - protected static Activity getInstance() { - return instance; - } - - public static DownloadActivityInternal getMainActivity() { - return mMainActivity; - } - - public static boolean isInitialized() { - return isInitialized; - } - - private void printADCLibInfo() { - Logging.DEBUG_OUT(" "); - Logging.DEBUG_OUT("[ADC lib info]"); - if (Constants.ADC_BUILD_LOCAL.equalsIgnoreCase(ServerProtocol.DIALOG_RETURN_SCOPES_TRUE)) { - Logging.DEBUG_OUT("\t[WARNING] This version of ADC was built locally and should not be used in production."); - } - Logging.DEBUG_OUT("\tADC build version: @ADC_BUILD_VERSION_DYNAMIC_VALUE@"); - Logging.DEBUG_OUT("\tADC build time: @ADC_BUILD_TIME_DYNAMIC_VALUE@"); - Logging.DEBUG_OUT(" "); - } - - private void printDeviceAndAppInfo() { - Logging.DEBUG_OUT(" "); - Logging.DEBUG_OUT("[Device/App info]"); - Logging.DEBUG_OUT("\tDevice: " + getDeviceString()); - Logging.DEBUG_OUT("\tBrand: " + getBrand()); - Logging.DEBUG_OUT("\tAndroid Unique ID: " + getAndroidUniqueId()); - Logging.DEBUG_OUT("\tApplication name: " + getApplicationName()); - Logging.DEBUG_OUT("\tAPK version: " + getAPKVersion()); - Logging.DEBUG_OUT(" "); - } - - public DownloadActivityInternal(Context context) { - this(context, "title.png"); - } - - public DownloadActivityInternal(Context context, String str) { - this.overrideDevices = new ArrayList<>(); - this.deviceFallback = null; - this.downloadFileData = null; - this.mLocale = "en"; - this.percent_downloaded = 0; - this.mDownloadActivity = null; - this.glExtensions = null; - this.bmpBg = null; - this.callSetAssetPathAux = false; - this.activityAssetPath = ""; - this.activityUseExternal = false; - this.configLoaded = false; - Logging.DEBUG_INIT(); - this.mHandler = new Handler(); - if (mMainActivity == null) { - mMainActivity = this; - } - if (this.assetManager == null) { - this.assetManager = new AssetManager(); - } - this.mContext = context; - this.bgFileName = str; - Logging.DEBUG_OUT("DownloadActivityInternal.init()"); - initScreens(context); - } - - public void setAssetPath(String str, boolean z) { - if (this.configLoaded) { - setAssetPathAux(str, z); - return; - } - this.callSetAssetPathAux = true; - this.activityAssetPath = str; - this.activityUseExternal = z; - } - - private void setAssetPathAux(String str, boolean z) { - String str2 = ""; - String str3 = ""; - String absolutePath = Environment.getExternalStorageDirectory().getAbsolutePath(); - String absolutePath2 = this.mContext.getFilesDir().getAbsolutePath(); - String str4 = null; - if (USE_INTERNAL_STORAGE) { - str2 = "" + this.mContext.getFilesDir().getAbsolutePath(); - str3 = "" + absolutePath2; - } else if (z) { - str2 = "" + absolutePath; - str3 = "" + absolutePath2; - } else { - Logging.DEBUG_OUT("User entered an absolute path."); - if (str.startsWith(absolutePath)) { - USE_INTERNAL_STORAGE = false; - str4 = str.replaceFirst(absolutePath, absolutePath2); - } else if (str.startsWith(absolutePath2)) { - USE_INTERNAL_STORAGE = true; - str4 = str.replaceFirst(absolutePath2, absolutePath); - } - } - if (str != null) { - str2 = str2 + str; - } - this.assetManager.setAssetPath(str2); - if (ALTERNATIVE_DATA_FOLDER) { - if (str4 == null) { - str4 = str3 + str; - } - this.assetManager.setAlternativeAssetPath(str4); - Logging.DEBUG_OUT("\tsetAlternativeAssetPath(), mAlternativeAssetPath = " + str4); - } - Logging.DEBUG_OUT("\tsetAssetPath(), mAssetPath = " + str2); - } - - public void init(Activity activity, IDownloadActivity iDownloadActivity, Context context, Object obj) { - Logging.DEBUG_OUT("Calling: DownloadActivityInternal init()"); - this.mContext = context; - if (instance == null) { - instance = activity; - this.mDownloadActivity = iDownloadActivity; - } - printADCLibInfo(); - printDeviceAndAppInfo(); - loadConfigProperties(); - loadOverrides(); - checkPermissions(); - checkLanguageChange(); - checkBackgroundImage(); - if (downloadProgress == null) { - downloadProgress = new DownloadProgress(); - } - if (obj != null) { - try { - if (obj instanceof GL10) { - this.glExtensions = ((GL10) obj).glGetString(7939); - } else if (obj instanceof GL11) { - this.glExtensions = ((GL11) obj).glGetString(7939); - } - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred while trying to get GL Extensions:" + e); - } - } - if (this.wifiReceiver == null) { - this.wifiReceiver = new WifiReceiver(); - instance.registerReceiver(this.wifiReceiver, new IntentFilter("android.net.wifi.RSSI_CHANGED")); - this.wifiReceiver.updateWifiInfo(); - } - if (!isInitialized) { - boolean z = true; - isInitialized = true; - if (ALTERNATIVE_DATA_FOLDER) { - this.assetManager.useAlternativeAssetPath(false); - if (!this.assetManager.assetsFoundLocally()) { - this.assetManager.useAlternativeAssetPath(true); - if (!this.assetManager.assetsFoundLocally()) { - this.assetManager.useAlternativeAssetPath(false); - z = false; - } - } - } else { - z = this.assetManager.assetsFoundLocally(); - } - ADCTelemetry.getInstance().onCreate(this.assetManager.getAssetPath()); - if (z) { - if (shouldSkipUpdateCheck()) { - setState(11); - return; - } else { - setState(14); - return; - } - } - setState(14); - return; - } - setState(pState); - } - - private boolean shouldSkipUpdateCheck() { - Logging.DEBUG_OUT("DownloadActivityInternal shouldSkipUpdateCheck()"); - if (NUMBER_OF_HOURS_TO_UPDATE_CHECKING > 0) { - Properties loadAssetInfo = this.assetManager.loadAssetInfo(); - if (loadAssetInfo != null) { - String property = loadAssetInfo.getProperty("updateCheckLastTime"); - if (property != null) { - try { - long parseLong = Long.parseLong(property); - Logging.DEBUG_OUT("Last time checked for update: " + parseLong); - long time = new Date().getTime(); - Logging.DEBUG_OUT("Current time: " + time); - long j = time - parseLong; - if (j < 0) { - Logging.DEBUG_OUT("Time travel not allowed!"); - return false; - } - int i = (int) (j / 3600000); - Logging.DEBUG_OUT("Number of hours since last update checking: " + i); - Logging.DEBUG_OUT("Number of hours needed: " + NUMBER_OF_HOURS_TO_UPDATE_CHECKING); - return i < NUMBER_OF_HOURS_TO_UPDATE_CHECKING; - } catch (Exception e) { - Logging.DEBUG_OUT_STACK(e); - return false; - } - } - Logging.DEBUG_OUT("Property updateCheckLastTime not found."); - return false; - } - Logging.DEBUG_OUT("AssetInfo file could not be read."); - return false; - } - Logging.DEBUG_OUT("NUMBER_OF_HOURS_TO_UPDATE_CHECKING not defined or invalid."); - return false; - } - - public boolean chooseAvailableMemory() { - if (ALTERNATIVE_DATA_FOLDER) { - if (isSpaceAvailableForDownload()) { - this.assetManager.useAlternativeAssetPath(false); - Logging.DEBUG_OUT("Memory space is available in main location."); - return true; - } - if (isSpaceAvailableForAlternativeDownload()) { - this.assetManager.useAlternativeAssetPath(true); - Logging.DEBUG_OUT("Memory space is available only in alternative location."); - return true; - } - Logging.DEBUG_OUT("Memory space is not available."); - return false; - } - return isSpaceAvailableForDownload(); - } - - public void checkServerContent(Boolean bool) { - boolean z = false; - int updateDownloadFilesData = getMainActivity().updateDownloadFilesData(false); - if ((updateDownloadFilesData == 5001 || updateDownloadFilesData == 5002) && this.deviceFallback != null) { - updateDownloadFilesData = getMainActivity().updateDownloadFilesData(true); - } - if (this.downloadFileData != null && spaceNeededToDownload > 0) { - spaceNeededToDownload -= this.assetManager.getTotalSize(this.assetManager.getDownloadList(this.downloadFileData)); - } - if (ALTERNATIVE_DATA_FOLDER) { - this.assetManager.useAlternativeAssetPath(false); - if (!this.assetManager.assetsFoundLocally()) { - this.assetManager.useAlternativeAssetPath(true); - if (!this.assetManager.assetsFoundLocally()) { - this.assetManager.useAlternativeAssetPath(false); - } - } - z = true; - } else { - z = this.assetManager.assetsFoundLocally(); - } - if (!z) { - Logging.DEBUG_OUT("Assets not found on the device. ADC will try to download from the server."); - if (updateDownloadFilesData != 0) { - recordError(updateDownloadFilesData); - if (updateDownloadFilesData == 5001) { - Logging.DEBUG_OUT("[ERROR] Unsupported device: unable to find assets"); - Logging.DEBUG_OUT("\tfor resolution: " + resolution); - Logging.DEBUG_OUT("\ton server: " + DOWNLOAD_URL); - setState(12); - return; - } - if (updateDownloadFilesData == -15) { - Logging.DEBUG_OUT("[ERROR] Failed to retrieve download file list"); - if (bool.booleanValue()) { - Logging.DEBUG_OUT("Ignoring ERROR_FILE_LIST_RETRIEVE_FAILED and going to STATE_SHOW_WIFI_DIALOG."); - setState(6); - return; - } - } else { - Logging.DEBUG_OUT("[ERROR] Error from Server: " + updateDownloadFilesData); - } - this.serverErrorView.setErrorCode(updateDownloadFilesData); - setState(13); - return; - } - if (!chooseAvailableMemory()) { - setState(4); - return; - } else { - if (getState() != 2) { - setState(1); - return; - } - return; - } - } - Logging.DEBUG_OUT("checkServerContent(): assets found on the device."); - if (updateDownloadFilesData == 0) { - long time = new Date().getTime(); - Logging.DEBUG_OUT("Saving update checking timestamp: " + time); - Properties loadAssetInfo = this.assetManager.loadAssetInfo(); - if (loadAssetInfo == null) { - loadAssetInfo = new Properties(); - } - loadAssetInfo.setProperty("updateCheckLastTime", "" + time); - this.assetManager.saveAssetInfo(loadAssetInfo); - setState(8); - return; - } - if (updateDownloadFilesData == -15) { - Logging.DEBUG_OUT("[ERROR] Failed to retrieve download file list."); - } else if (updateDownloadFilesData == 5001 || updateDownloadFilesData == 5002) { - Logging.DEBUG_OUT("[ERROR] Assets found on the device but server returned error code " + updateDownloadFilesData + " while checking for assets."); - } - setState(11); - } - - public boolean useCustomProgressBar() { - return CUSTOM_PROGRESS_BAR; - } - - public boolean useOldProgressBar() { - return USE_OLD_PROGRESS_BAR; - } - - public boolean is3GDisabled() { - return DISABLE_3G; - } - - public boolean isAmazonDevice() { - return getManufacturer().equalsIgnoreCase("amazon"); - } - - private String getResolutionUsingDisplayMetrics() { - Logging.DEBUG_OUT("Calling getResolutionUsingDisplayMetrics()..."); - DisplayMetrics displayMetrics = new DisplayMetrics(); - instance.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics); - Logging.DEBUG_OUT("displayMetrics: " + displayMetrics.toString()); - width = displayMetrics.widthPixels; - height = displayMetrics.heightPixels; - return width + "x" + height; - } - - private String getResolutionUsingUndocumentedMethods() { - Logging.DEBUG_OUT("Calling getResolutionUsingUndocumentedMethods()..."); - try { - Display defaultDisplay = instance.getWindowManager().getDefaultDisplay(); - Method method = Display.class.getMethod("getRawWidth", new Class[0]); - Method method2 = Display.class.getMethod("getRawHeight", new Class[0]); - width = ((Integer) method.invoke(defaultDisplay, new Object[0])).intValue(); - height = ((Integer) method2.invoke(defaultDisplay, new Object[0])).intValue(); - if (instance.getRequestedOrientation() == 0) { - if (width < height) { - int i = width; - width = height; - height = i; - } - } else if (width > height) { - int i2 = width; - width = height; - height = i2; - } - return width + "x" + height; - } catch (IllegalAccessException e) { - Logging.DEBUG_OUT("An IllegalAccessException exception occurred in getResolutionUsingUndocumentedMethods()."); - Logging.DEBUG_OUT_STACK(e); - return null; - } catch (IllegalArgumentException e2) { - Logging.DEBUG_OUT("An IllegalArgumentException exception occurred in getResolutionUsingUndocumentedMethods()."); - Logging.DEBUG_OUT_STACK(e2); - return null; - } catch (NoSuchMethodException e3) { - Logging.DEBUG_OUT("A NoSuchMethodException exception occurred in getResolutionUsingUndocumentedMethods()."); - Logging.DEBUG_OUT_STACK(e3); - return null; - } catch (InvocationTargetException e4) { - Logging.DEBUG_OUT("An InvocationTargetException exception occurred in getResolutionUsingUndocumentedMethods()."); - Logging.DEBUG_OUT_STACK(e4); - return null; - } catch (Exception e5) { - Logging.DEBUG_OUT("An Exception exception occurred in getResolutionUsingUndocumentedMethods()."); - Logging.DEBUG_OUT_STACK(e5); - return null; - } - } - - private String getResolution() { - Device device = getDevice(getModel()); - if (device != null) { - return device.getResolutionString(); - } - String resolutionUsingUndocumentedMethods = RETRIEVE_FULL_SCREEN_RESOLUTION ? getResolutionUsingUndocumentedMethods() : null; - if (resolutionUsingUndocumentedMethods == null) { - resolutionUsingUndocumentedMethods = getResolutionUsingDisplayMetrics(); - } - if (instance.getRequestedOrientation() == 0) { - Logging.DEBUG_OUT("SCREEN_ORIENTATION_LANDSCAPE"); - } else { - Logging.DEBUG_OUT("SCREEN_ORIENTATION_PORTRAIT"); - } - return resolutionUsingUndocumentedMethods; - } - - private Device getDevice(String str) { - if (this.overrideDevices == null) { - return null; - } - for (int i = 0; i < this.overrideDevices.size(); i++) { - Device device = this.overrideDevices.get(i); - if (device.getName().equals(str)) { - return device; - } - } - return null; - } - - public WifiReceiver getWifiReceiver() { - return this.wifiReceiver; - } - - private void unregisterWifiReceiver() { - try { - try { - if (this.wifiReceiver != null) { - instance.unregisterReceiver(this.wifiReceiver); - } - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred while unregistering WifiReceiver."); - Logging.DEBUG_OUT_STACK(e); - } - } finally { - this.wifiReceiver = null; - } - } - - protected long calculateDownloaded(File file) { - long length; - File[] listFiles = file.listFiles(); - long j = 0; - if (listFiles == null) { - return 0L; - } - for (int i = 0; i < listFiles.length; i++) { - if (listFiles[i].isDirectory()) { - length = calculateDownloaded(listFiles[i]); - } else { - length = listFiles[i].length(); - } - j += length; - } - return j; - } - - protected boolean isSpaceAvailableForDownload() { - long availableExternalMemorySize; - long j = spaceNeededToDownload; - if (j <= 0) { - long calculateDownloaded = ((TOTAL_SPACE_MB * PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) * PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) - calculateDownloaded(new File(this.assetManager.getAssetPath())); - j = calculateDownloaded > 0 ? calculateDownloaded : PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED; - spaceNeededToDownload = j; - } - if (USE_INTERNAL_STORAGE) { - availableExternalMemorySize = MemoryStatus.getAvailableInternalMemorySize(); - Logging.DEBUG_OUT("Using main location: Internal Storage is " + availableExternalMemorySize); - } else { - availableExternalMemorySize = MemoryStatus.getAvailableExternalMemorySize(); - Logging.DEBUG_OUT("Using main location: External Storage is " + availableExternalMemorySize); - } - return availableExternalMemorySize >= j; - } - - protected boolean isSpaceAvailableForAlternativeDownload() { - long availableInternalMemorySize; - long j = spaceNeededToDownload; - if (j <= 0) { - long calculateDownloaded = ((TOTAL_SPACE_MB * PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) * PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) - calculateDownloaded(new File(this.assetManager.getAssetPath())); - j = calculateDownloaded > 0 ? calculateDownloaded : PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED; - spaceNeededToDownload = j; - } - if (USE_INTERNAL_STORAGE) { - availableInternalMemorySize = MemoryStatus.getAvailableExternalMemorySize(); - Logging.DEBUG_OUT("Using alternative location: External Storage is " + availableInternalMemorySize); - } else { - availableInternalMemorySize = MemoryStatus.getAvailableInternalMemorySize(); - Logging.DEBUG_OUT("Using alternative location: Internal Storage is " + availableInternalMemorySize); - } - return availableInternalMemorySize >= j; - } - - public boolean checkForUpdates() { - if (ALTERNATIVE_DATA_FOLDER) { - this.assetManager.useAlternativeAssetPath(false); - if (this.assetManager.assetsFoundLocally() && !this.assetManager.checkForUpdates(this.downloadFileData)) { - Logging.DEBUG_OUT("Assets on main location and update NOT found."); - return false; - } - this.assetManager.useAlternativeAssetPath(true); - if (this.assetManager.assetsFoundLocally()) { - if (this.assetManager.checkForUpdates(this.downloadFileData)) { - Logging.DEBUG_OUT("Assets on alternative location and update found."); - return true; - } - Logging.DEBUG_OUT("Assets on alternative location and no update NOT found."); - return false; - } - Logging.DEBUG_OUT("[ERROR] Something very wrong happened: assets have been found previously, but cannot be found anymore."); - this.assetManager.useAlternativeAssetPath(false); - return true; - } - return this.assetManager.checkForUpdates(this.downloadFileData); - } - - private void checkBackgroundImage() { - Logging.DEBUG_OUT("Calling: DownloadActivityInternal checkBackgroundImage()"); - if (this.mContext == null || getBackgroundBitmap() != null) { - return; - } - try { - InputStream open = this.mContext.getAssets().open(getResourcesPath() + this.bgFileName); - if (open != null) { - BitmapFactory.Options options = new BitmapFactory.Options(); - options.inTempStorage = new byte[4096]; - setBackgroundBitmap(Bitmap.createBitmap(BitmapFactory.decodeStream(open, null, options))); - open.close(); - } - Logging.DEBUG_OUT("\tCreating background image"); - } catch (IOException unused) { - setBackgroundBitmap(null); - } - } - - private void checkLanguageChange() { - Logging.DEBUG_OUT("Calling: DownloadActivityInternal checkLanguageChange()"); - if (this.mContext == null || this.mContext.getResources().getConfiguration().locale.toString().equalsIgnoreCase(this.mLocale)) { - return; - } - language = new Language(); - this.mLocale = this.mContext.getResources().getConfiguration().locale.toString(); - String language2 = this.mContext.getResources().getConfiguration().locale.getLanguage(); - Logging.DEBUG_OUT("\tLocale: " + this.mLocale); - Logging.DEBUG_OUT("\tLanguage: " + language2); - if (language.loadStrings(this.mLocale) || language.loadStrings(language2)) { - return; - } - this.mLocale = "en"; - language.loadStrings("en"); - } - - public void onPause() { - Logging.DEBUG_OUT("DownloadActivityInternal.onPause()"); - if (this.pCurrentView != null) { - this.pCurrentView.pause(); - } - } - - public void startWifiDownload(final boolean z) { - Thread thread = new Thread() { // from class: com.eamobile.DownloadActivityInternal.1 - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - while (DownloadActivityInternal.changingState) { - } - if (DownloadActivityInternal.this.isWifiAvailable()) { - Logging.DEBUG_OUT("checking wifi: OK"); - if (z) { - DownloadActivityInternal.this.cleanState(6); - if (DownloadActivityInternal.getTotalDownloadSizeMB() == 0) { - DownloadActivityInternal.this.setState(14); - return; - } else { - DownloadActivityInternal.this.setState(2); - return; - } - } - DownloadActivityInternal.this.setState(2); - return; - } - Logging.DEBUG_OUT("checking wifi: FAILED"); - if (z) { - DownloadActivityInternal.this.resumeState(6); - } else { - DownloadActivityInternal.this.setState(6); - } - } - }; - Logging.DEBUG_OUT("startWifiDownload"); - setState(15); - thread.start(); - } - - public void onResume() { - Logging.DEBUG_OUT("DownloadActivityInternal.onResume()"); - if (getState() == 6) { - startWifiDownload(true); - return; - } - if (getState() == 4) { - if (chooseAvailableMemory()) { - cleanState(4); - if (!this.assetManager.assetsFoundLocally()) { - setState(1); - return; - } else { - setState(8); - return; - } - } - resumeState(4); - return; - } - resumeState(getState()); - } - - public void onWindowFocusChanged(boolean z) { - Logging.DEBUG_OUT("DownloadActivityInternal.onWindowFocusChanged(focus == " + z + ")"); - if (instance != null) { - instance.getWindow().getDecorView().setSystemUiVisibility(5894); - } - } - - protected void initScreens(Context context) { - if (this.downloadMsgView == null) { - this.downloadMsgView = new DownloadMsgView(context); - } - if (this.showWifiView == null) { - this.showWifiView = new ShowWifiView(context); - } - if (this.networkUnavailableView == null) { - this.networkUnavailableView = new NetworkUnavailableView(context); - } - if (this.downloadProgressView == null) { - this.downloadProgressView = new DownloadProgressView(context); - } - if (this.downloadFailedView == null) { - this.downloadFailedView = new DownloadFailedView(context); - } - if (this.spaceUnavailableView == null) { - this.spaceUnavailableView = new SpaceUnavailableView(context); - } - if (this.checkUpdatesView == null) { - this.checkUpdatesView = new CheckUpdatesView(context); - } - if (this.updatesFoundView == null) { - this.updatesFoundView = new UpdatesFoundView(context); - } - if (this.show3GView == null) { - this.show3GView = new Show3GView(context); - } - if (this.showBGView == null) { - this.showBGView = new ShowBGView(context); - } - if (this.unSupportedDeviceView == null) { - this.unSupportedDeviceView = new UnSupportedDeviceView(context); - } - if (this.serverErrorView == null) { - this.serverErrorView = new ServerErrorView(context); - } - if (this.contactingServerView == null) { - this.contactingServerView = new ContactingServerView(context); - } - if (this.checkingHostIpView == null) { - this.checkingHostIpView = new CheckingHostIpView(context); - } - if (this.invalidAssetVersionView == null) { - this.invalidAssetVersionView = new InvalidAssetVersionView(context); - } - if (this.deletingAssetsView == null) { - this.deletingAssetsView = new DeletingAssetsView(context); - } - } - - public static long getSizeDownloaded() { - return downloadProgress.getSizeDownloaded(); - } - - public static long getRealDownloaded() { - return downloadProgress.getRealDownloaded(); - } - - public static boolean getFlagLastReportDownload() { - return downloadProgress.getFlagLastReportDownload(); - } - - public static void setFlagLastReportDownload(boolean z) { - downloadProgress.setFlagLastReportDownload(z); - } - - public int getPercentDownloaded() { - double sizeDownloaded = ((getSizeDownloaded() / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) / totalDownloadSizeMB; - if (this.percent_downloaded < 100) { - Double.isNaN(sizeDownloaded); - this.percent_downloaded = (int) (sizeDownloaded * 100.0d); - } else { - this.percent_downloaded = 100; - } - return this.percent_downloaded; - } - - public boolean checkLocalAssetVersion() { - if (MIN_ASSET_VERSION_REQUIRED != null) { - return this.assetManager.isAssetVersionCompatible(MIN_ASSET_VERSION_REQUIRED); - } - return true; - } - - public void setState(int i) { - try { - switch (i) { - case 1: - this.pCurrentView = this.downloadMsgView; - break; - case 2: - this.pCurrentView = this.downloadProgressView; - break; - case 3: - if (checkLocalAssetVersion()) { - Logging.DEBUG_OUT("onResult assetPath = " + this.assetManager.getAssetPath() + " result = -1"); - this.mDownloadActivity.onResult(this.assetManager.getAssetPath(), -1); - ADCTelemetry.getInstance().sendTelemetry(1); - try { - Thread.sleep(1000L); - } catch (Exception unused) { - } - ADCTelemetry.getInstance().onDestroy(); - Logging.DEBUG_CLOSE(); - return; - } - this.pCurrentView = this.invalidAssetVersionView; - break; - case 4: - this.pCurrentView = this.spaceUnavailableView; - break; - case 5: - this.downloadFailedView.setErrorCode(getLastError()); - ADCTelemetry.getInstance().sendTelemetry(3, "MINOR ERROR - error code=" + Integer.toString(getLastError())); - this.pCurrentView = this.downloadFailedView; - break; - case 6: - this.pCurrentView = this.showWifiView; - break; - case 7: - this.pCurrentView = this.networkUnavailableView; - break; - case 8: - this.pCurrentView = this.checkUpdatesView; - break; - case 9: - this.pCurrentView = this.updatesFoundView; - break; - case 10: - this.pCurrentView = this.show3GView; - break; - case 11: - this.pCurrentView = this.showBGView; - break; - case 12: - ADCTelemetry.getInstance().sendTelemetry(3, "CRITICAL ERROR - error code=" + Integer.toString(getLastError())); - this.pCurrentView = this.unSupportedDeviceView; - break; - case 13: - ADCTelemetry.getInstance().sendTelemetry(3, "CRITICAL ERROR - error code=" + Integer.toString(getLastError())); - this.pCurrentView = this.serverErrorView; - break; - case 14: - this.pCurrentView = this.contactingServerView; - break; - case 15: - this.pCurrentView = this.checkingHostIpView; - break; - case 16: - this.pCurrentView = this.deletingAssetsView; - break; - } - Runnable runnable = new Runnable() { // from class: com.eamobile.DownloadActivityInternal.2 - @Override // java.lang.Runnable - public void run() { - Logging.DEBUG_OUT("DownloadActivityInternal setState - Making a new runnable to init."); - if (DownloadActivityInternal.instance != null && DownloadActivityInternal.this.pCurrentView != null) { - DownloadActivityInternal.instance.runOnUiThread(new Runnable() { // from class: com.eamobile.DownloadActivityInternal.2.1 - @Override // java.lang.Runnable - public void run() { - Logging.DEBUG_OUT("setState: pCurrentView = " + DownloadActivityInternal.this.pCurrentView); - Logging.DEBUG_OUT("setState: before calling pCurrentView.init()"); - DownloadActivityInternal.this.pCurrentView.init(); - Logging.DEBUG_OUT("setState: after calling pCurrentView.init()"); - DownloadActivityInternal.instance.setContentView(DownloadActivityInternal.this.pCurrentView); - Logging.DEBUG_OUT("setState: after calling setContentView"); - } - }); - } - boolean unused2 = DownloadActivityInternal.changingState = false; - } - }; - changingState = true; - this.mHandler.postDelayed(runnable, 20L); - pStatePrev = pState; - pState = i; - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred in setState:"); - Logging.DEBUG_OUT_STACK(e); - } - } - - public void resumeState(int i) { - StringBuilder sb = new StringBuilder(); - sb.append("DownloadActivityInternal resumeState: "); - sb.append(i == -1 ? "STATE_INVALID" : STATE_STRINGS[i]); - Logging.DEBUG_OUT(sb.toString()); - try { - switch (i) { - case 1: - this.pCurrentView = this.downloadMsgView; - break; - case 2: - this.pCurrentView = this.downloadProgressView; - break; - case 3: - if (checkLocalAssetVersion()) { - Logging.DEBUG_OUT("onResult assetPath = " + this.assetManager.getAssetPath() + " result = -1"); - this.mDownloadActivity.onResult(this.assetManager.getAssetPath(), -1); - Logging.DEBUG_CLOSE(); - return; - } - this.pCurrentView = this.invalidAssetVersionView; - break; - case 4: - this.pCurrentView = this.spaceUnavailableView; - break; - case 5: - this.pCurrentView = this.downloadFailedView; - break; - case 6: - this.pCurrentView = this.showWifiView; - break; - case 7: - this.pCurrentView = this.networkUnavailableView; - break; - case 8: - this.pCurrentView = this.checkUpdatesView; - break; - case 9: - this.pCurrentView = this.updatesFoundView; - break; - case 10: - this.pCurrentView = this.show3GView; - break; - case 11: - this.pCurrentView = this.showBGView; - break; - case 12: - this.pCurrentView = this.unSupportedDeviceView; - break; - case 13: - this.pCurrentView = this.serverErrorView; - break; - case 14: - this.pCurrentView = this.contactingServerView; - break; - case 15: - this.pCurrentView = this.checkingHostIpView; - break; - case 16: - this.pCurrentView = this.deletingAssetsView; - break; - } - this.mHandler.postDelayed(new Runnable() { // from class: com.eamobile.DownloadActivityInternal.3 - @Override // java.lang.Runnable - public void run() { - Logging.DEBUG_OUT("DownloadActivityInternal resumeState - Making a new runnable to resume."); - if (DownloadActivityInternal.instance == null || DownloadActivityInternal.this.pCurrentView == null) { - return; - } - Logging.DEBUG_OUT("resumeState: pCurrentView = " + DownloadActivityInternal.this.pCurrentView); - Logging.DEBUG_OUT("resumeState: before calling pCurrentView.resume()"); - DownloadActivityInternal.this.pCurrentView.resume(); - Logging.DEBUG_OUT("resumeState: after calling pCurrentView.resume()"); - } - }, 20L); - pState = i; - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred while resuming State:"); - Logging.DEBUG_OUT_STACK(e); - } - } - - public int getState() { - return pState; - } - - public String getStateName() { - return pState != -1 ? STATE_STRINGS[pState] : "STATE_INVALID"; - } - - protected int getPreviousState() { - return pStatePrev; - } - - public void onDestroy() { - Logging.DEBUG_OUT("DownloadActivityInternal.onDestroy()"); - unregisterWifiReceiver(); - cleanStates(); - isInitialized = false; - instance = null; - downloadProgress = null; - this.assetManager = null; - mMainActivity = null; - language = null; - } - - public void destroyDownloadActvity() { - if (getBackgroundBitmap() != null) { - getBackgroundBitmap().recycle(); - setBackgroundBitmap(null); - } - unregisterWifiReceiver(); - cleanStates(); - isInitialized = false; - instance = null; - mMainActivity = null; - downloadProgress = null; - this.assetManager = null; - pState = -1; - } - - /* JADX INFO: Access modifiers changed from: private */ - public void cleanState(int i) { - try { - switch (i) { - case 1: - this.pCurrentView = this.downloadMsgView; - break; - case 2: - this.pCurrentView = this.downloadProgressView; - break; - case 3: - if (checkLocalAssetVersion()) { - Logging.DEBUG_OUT("onResult assetPath = " + this.assetManager.getAssetPath() + " result = -1"); - this.mDownloadActivity.onResult(this.assetManager.getAssetPath(), -1); - Logging.DEBUG_CLOSE(); - return; - } - this.pCurrentView = this.invalidAssetVersionView; - break; - case 4: - this.pCurrentView = this.spaceUnavailableView; - break; - case 5: - this.pCurrentView = this.downloadFailedView; - break; - case 6: - this.pCurrentView = this.showWifiView; - break; - case 7: - this.pCurrentView = this.networkUnavailableView; - break; - case 8: - this.pCurrentView = this.checkUpdatesView; - break; - case 9: - this.pCurrentView = this.updatesFoundView; - break; - case 10: - this.pCurrentView = this.show3GView; - break; - case 11: - this.pCurrentView = this.showBGView; - break; - case 12: - this.pCurrentView = this.unSupportedDeviceView; - break; - case 13: - this.pCurrentView = this.serverErrorView; - break; - case 14: - this.pCurrentView = this.contactingServerView; - break; - case 15: - this.pCurrentView = this.checkingHostIpView; - break; - case 16: - this.pCurrentView = this.deletingAssetsView; - break; - } - this.pCurrentView.clean(); - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred while cleaning state:" + e); - } - } - - private void cleanStates() { - if (this.downloadMsgView != null) { - this.downloadMsgView.clean(); - } - if (this.showWifiView != null) { - this.showWifiView.clean(); - } - if (this.networkUnavailableView != null) { - this.networkUnavailableView.clean(); - } - if (this.downloadProgressView != null) { - this.downloadProgressView.clean(); - } - if (this.downloadFailedView != null) { - this.downloadFailedView.clean(); - } - if (this.spaceUnavailableView != null) { - this.spaceUnavailableView.clean(); - } - if (this.checkUpdatesView != null) { - this.checkUpdatesView.clean(); - } - if (this.updatesFoundView != null) { - this.updatesFoundView.clean(); - } - if (this.show3GView != null) { - this.show3GView.clean(); - } - if (this.showBGView != null) { - this.showBGView.clean(); - } - if (this.unSupportedDeviceView != null) { - this.unSupportedDeviceView.clean(); - } - if (this.serverErrorView != null) { - this.serverErrorView.clean(); - } - if (this.contactingServerView != null) { - this.contactingServerView.clean(); - } - if (this.checkingHostIpView != null) { - this.checkingHostIpView.clean(); - } - if (this.invalidAssetVersionView != null) { - this.invalidAssetVersionView.clean(); - } - if (this.deletingAssetsView != null) { - this.deletingAssetsView.clean(); - } - this.showBGView = null; - this.show3GView = null; - this.updatesFoundView = null; - this.checkUpdatesView = null; - this.downloadMsgView = null; - this.showWifiView = null; - this.networkUnavailableView = null; - this.downloadProgressView = null; - this.downloadFailedView = null; - this.spaceUnavailableView = null; - this.unSupportedDeviceView = null; - this.serverErrorView = null; - this.contactingServerView = null; - this.checkingHostIpView = null; - this.invalidAssetVersionView = null; - this.deletingAssetsView = null; - } - - public boolean isWifiAvailable() { - WifiManager wifiManager = (WifiManager) instance.getApplicationContext().getSystemService("wifi"); - boolean isWifiEnabled = wifiManager.isWifiEnabled(); - return isWifiEnabled ? wifiManager.getConnectionInfo().getSupplicantState() == SupplicantState.COMPLETED : isWifiEnabled; - } - - public boolean canFindHostIP() { - try { - Logging.DEBUG_OUT("Getting host name from URL: " + DOWNLOAD_URL); - Logging.DEBUG_OUT("Host name: " + new URL(DOWNLOAD_URL).getHost()); - try { - BasicHttpParams basicHttpParams = new BasicHttpParams(); - HttpConnectionParams.setConnectionTimeout(basicHttpParams, 5000); - HttpConnectionParams.setSoTimeout(basicHttpParams, 5000); - return new DefaultHttpClient(basicHttpParams).execute((HttpUriRequest) new HttpGet(DOWNLOAD_URL)).getStatusLine().getStatusCode() == 200; - } catch (Exception e) { - Logging.DEBUG_OUT_STACK(e); - return false; - } - } catch (MalformedURLException unused) { - Logging.DEBUG_OUT("Not found: URL is malformed"); - return false; - } - } - - public void startWifiManager() { - try { - instance.startActivity(new Intent("android.settings.WIFI_SETTINGS")); - } catch (ActivityNotFoundException unused) { - Logging.DEBUG_OUT("[ERROR] Unable to find an Activity to open Wifi settings."); - instance.startActivity(new Intent("android.settings.SETTINGS")); - } - } - - protected void start3GManager() { - instance.startActivity(new Intent("android.settings.NETWORK_OPERATOR_SETTINGS")); - } - - public void startDataManagement() { - instance.startActivity(new Intent("android.settings.MEMORY_CARD_SETTINGS")); - } - - protected boolean isConnected() { - NetworkInfo activeNetworkInfo = ((ConnectivityManager) instance.getSystemService("connectivity")).getActiveNetworkInfo(); - return activeNetworkInfo != null && activeNetworkInfo.isConnected() && activeNetworkInfo.isAvailable(); - } - - public boolean test3GNetwork() { - NetworkInfo activeNetworkInfo = ((ConnectivityManager) instance.getSystemService("connectivity")).getActiveNetworkInfo(); - if (activeNetworkInfo == null || !activeNetworkInfo.isConnected() || !activeNetworkInfo.isAvailable()) { - return false; - } - if (activeNetworkInfo.getType() != 1) { - activeNetworkInfo.getType(); - } - return true; - } - - protected int is3G() { - NetworkInfo activeNetworkInfo = ((ConnectivityManager) instance.getSystemService("connectivity")).getActiveNetworkInfo(); - return (activeNetworkInfo != null && activeNetworkInfo.isConnected() && activeNetworkInfo.isAvailable() && activeNetworkInfo.getType() == 0) ? 1 : 0; - } - - public boolean testNetwork(int[] iArr) { - iArr[0] = -1; - NetworkInfo activeNetworkInfo = ((ConnectivityManager) instance.getSystemService("connectivity")).getActiveNetworkInfo(); - if (activeNetworkInfo == null || !activeNetworkInfo.isConnected() || !activeNetworkInfo.isAvailable()) { - return false; - } - iArr[0] = activeNetworkInfo.getType(); - return true; - } - - public void updateDownload() { - this.assetManager.prepareSDCard(); - if (DELETE_ASSETS_ON_UPDATE) { - if (UNSAFE_ASSET_DELETION_ON_UPDATE) { - Logging.DEBUG_OUT(" "); - Logging.DEBUG_OUT("!!!!! WARNING !!!!!"); - Logging.DEBUG_OUT("Deleting assets without any additional checking:"); - Logging.DEBUG_OUT("!!!!! WARNING !!!!!"); - Logging.DEBUG_OUT(" "); - setState(16); - return; - } - Logging.DEBUG_OUT("Checking for asset deletion:"); - Properties loadAssetInfo = this.assetManager.loadAssetInfo(); - if (loadAssetInfo != null) { - String property = loadAssetInfo.getProperty("packageName"); - if (property != null) { - Logging.DEBUG_OUT("packageName read from AssetInfo.indicate: " + property); - Logging.DEBUG_OUT("application packageName: " + this.mContext.getPackageName()); - if (property.equals(this.mContext.getPackageName())) { - Logging.DEBUG_OUT("packageNames match"); - setState(16); - return; - } - Logging.DEBUG_OUT("packageNames DO NOT match"); - } else { - Logging.DEBUG_OUT("packageName not found"); - } - } else { - Logging.DEBUG_OUT("properties not found"); - } - } - setState(1); - } - - public void deleteAssets() { - if (UNSAFE_ASSET_DELETION_ON_UPDATE) { - this.assetManager.deleteEntireDownloadFolder(); - } else { - this.assetManager.deleteAssets(); - } - } - - public boolean startDownload() { - Logging.DEBUG_OUT("DownloadActivityInternal.startDownload()"); - this.assetManager.saveStateDownloadStarted(); - if (this.downloadFileData != null && this.downloadFileData.length > 0) { - totalDownloadSizeMB = getTotalDownloadSize(this.downloadFileData); - Logging.DEBUG_OUT("Total Download Size: " + totalDownloadSizeMB + " MB"); - boolean startDownloadingFiles = startDownloadingFiles(this.downloadFileData); - Logging.DEBUG_OUT("startDownload expectedResult: " + startDownloadingFiles); - return startDownloadingFiles; - } - checkServerContent(false); - return false; - } - - private boolean startDownloadingFiles(DownloadFileData[] downloadFileDataArr) { - if (!isConnected()) { - Logging.DEBUG_OUT("[ERROR] Connection unavailable"); - recordError(-16); - return false; - } - int i = 0; - boolean z = false; - while (true) { - try { - if (i >= downloadFileDataArr.length) { - break; - } - DownloadFileData downloadFileData = downloadFileDataArr[i]; - if (downloadFileData.getType() == 1) { - if (!UNCOMPRESS_ZIP_ON_DEVICE) { - Logging.DEBUG_OUT("File to download (ZIP): " + downloadFileData.getFileName()); - Logging.DEBUG_OUT("Files will be downloaded using a ZipInputStream: will NOT be ale to resume"); - Hashtable checksumsHashtable = getChecksumsHashtable(downloadFileData.getFileName(), downloadFileDataArr); - if (checksumsHashtable == null) { - Logging.DEBUG_OUT("[ERROR] Unable to download required checksums file: " + getMatchingChecksumFile(downloadFileData.getFileName(), this.downloadFileData).getFileName() + " (" + resolution + ")"); - recordError(-13); - return false; - } - if (!this.assetManager.isFileDownloaded(downloadFileData.getFileName())) { - Logging.DEBUG_OUT("Downloading file: " + downloadFileData.getFileName()); - z = downloadAndValidateZipFile(downloadFileData, checksumsHashtable); - if (!z) { - break; - } - this.assetManager.saveState(downloadFileData.getFileName() + "\t" + downloadFileData.getVersion(), null); - downloadProgress.setCurrentFile("n_" + downloadFileData.getFileName(), downloadFileData.getSize()); - downloadProgress.fillCurrentFileDownload(false); - } else { - Logging.DEBUG_OUT("File already downloaded:" + downloadFileData.getFileName()); - downloadProgress.setCurrentFile("n_" + downloadFileData.getFileName(), downloadFileData.getSize()); - downloadProgress.fillCurrentFileDownload(true); - setFlagLastReportDownload(false); - z = true; - } - } else { - Logging.DEBUG_OUT("File to download (ZIP): " + downloadFileData.getFileName()); - Logging.DEBUG_OUT("Zip will be downloaded and uncompressed on device: resume is possible"); - Hashtable checksumsHashtable2 = getChecksumsHashtable(downloadFileData.getFileName(), downloadFileDataArr); - if (checksumsHashtable2 == null) { - Logging.DEBUG_OUT("[ERROR] Unable to download required checksums file: " + getMatchingChecksumFile(downloadFileData.getFileName(), this.downloadFileData).getFileName() + " (" + resolution + ")"); - recordError(-13); - return false; - } - if (!this.assetManager.isFileDownloaded(downloadFileData.getFileName())) { - Logging.DEBUG_OUT("Downloading file: " + downloadFileData.getFileName()); - if (!downloadOtherFile(downloadFileData, null)) { - z = false; - break; - } - z = extractAndValidateFilesFromZip(downloadFileData.getFileName(), checksumsHashtable2); - new File(this.assetManager.getFilePath(downloadFileData.getFileName())).delete(); - if (z) { - this.assetManager.saveState(downloadFileData.getFileName() + "\t" + downloadFileData.getVersion(), null); - } else { - recordError(-12); - break; - } - } else { - Logging.DEBUG_OUT("File already downloaded:" + downloadFileData.getFileName()); - downloadProgress.setCurrentFile("n_" + downloadFileData.getFileName(), downloadFileData.getSize()); - downloadProgress.fillCurrentFileDownload(true); - setFlagLastReportDownload(false); - z = true; - } - } - } else if (downloadFileData.getType() == 3) { - Logging.DEBUG_OUT("File to download (NON-ZIP): " + downloadFileData.getFileName()); - Hashtable checksumsHashtable3 = getChecksumsHashtable(downloadFileData.getFileName(), downloadFileDataArr); - if (checksumsHashtable3 == null) { - Logging.DEBUG_OUT("[ERROR] Unable to download required checksums file: " + getMatchingChecksumFile(downloadFileData.getFileName(), this.downloadFileData).getFileName() + " (" + resolution + ")"); - recordError(-13); - return false; - } - if (!this.assetManager.isFileDownloaded(downloadFileData.getFileName())) { - Logging.DEBUG_OUT("Downloading file: " + downloadFileData.getFileName()); - z = downloadOtherFile(downloadFileData, checksumsHashtable3); - if (!z) { - break; - } - this.assetManager.saveState(downloadFileData.getFileName() + "\t" + downloadFileData.getVersion(), null); - } else { - Logging.DEBUG_OUT("File already downloaded:" + downloadFileData.getFileName()); - downloadProgress.setCurrentFile("n_" + downloadFileData.getFileName(), downloadFileData.getSize()); - downloadProgress.fillCurrentFileDownload(true); - setFlagLastReportDownload(false); - z = true; - } - } else { - continue; - } - i++; - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred while downloading files: " + e); - Logging.DEBUG_OUT_STACK(e); - return false; - } - } - if (z) { - this.assetManager.saveStateDownloadFinished(); - this.assetManager.saveDownloadListFile(downloadFileDataArr); - this.assetManager.saveAssetInfo(generateAssetInfo()); - this.percent_downloaded = 100; - Logging.DEBUG_OUT("[FINISHED] All files downloaded successfully."); - } else { - Logging.DEBUG_OUT("[ERROR] Assets download failed."); - } - return z; - } - - public boolean checkScreenSizeChange() { - if (!REDOWNLOAD_ON_SCREEN_SIZE_CHANGE) { - return false; - } - Logging.DEBUG_OUT("Checking for screen size change..."); - Properties loadAssetInfo = this.assetManager.loadAssetInfo(); - if (loadAssetInfo != null) { - String property = loadAssetInfo.getProperty("width"); - String property2 = loadAssetInfo.getProperty("height"); - if (property != null && property2 != null) { - try { - int parseInt = Integer.parseInt(property); - int parseInt2 = Integer.parseInt(property2); - Logging.DEBUG_OUT("Device width: " + width); - Logging.DEBUG_OUT("Assets width: " + parseInt); - Logging.DEBUG_OUT("Device height: " + height); - Logging.DEBUG_OUT("Assets height: " + parseInt2); - if (parseInt == width && parseInt2 == height) { - Logging.DEBUG_OUT("NO screen change detected."); - return false; - } - Logging.DEBUG_OUT("Screen change detected."); - return true; - } catch (Exception e) { - Logging.DEBUG_OUT("Invalid information."); - Logging.DEBUG_OUT_STACK(e); - return false; - } - } - Logging.DEBUG_OUT("No information found."); - return false; - } - Logging.DEBUG_OUT("No information found."); - return false; - } - - private Properties generateAssetInfo() { - Properties properties = new Properties(); - properties.setProperty("packageName", this.mContext.getPackageName()); - properties.setProperty("width", String.valueOf(width)); - properties.setProperty("height", String.valueOf(height)); - return properties; - } - - /* JADX WARN: Removed duplicated region for block: B:92:0x020b A[Catch: Exception -> 0x020e, TRY_ENTER, TRY_LEAVE, TryCatch #2 {Exception -> 0x020e, blocks: (B:30:0x01ed, B:92:0x020b), top: B:3:0x0002 }] */ - /* JADX WARN: Removed duplicated region for block: B:94:? A[RETURN, SYNTHETIC] */ - /* JADX WARN: Removed duplicated region for block: B:95:0x0206 A[EXC_TOP_SPLITTER, SYNTHETIC] */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - private boolean downloadOtherFile(com.eamobile.download.DownloadFileData r12, java.util.Hashtable r13) { - /* - Method dump skipped, instructions count: 539 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.eamobile.DownloadActivityInternal.downloadOtherFile(com.eamobile.download.DownloadFileData, java.util.Hashtable):boolean"); - } - - private boolean extractAndValidateFilesFromZip(String str, Hashtable hashtable) { - Logging.DEBUG_OUT("Extracting files from Zip: " + str); - try { - FileInputStream fileInputStream = new FileInputStream(this.assetManager.getFilePath(str)); - Thread.sleep(1000L); - return checkZipExtractorResult(new ZipExtractor().extractFiles(fileInputStream, hashtable, this.assetManager.getAssetPath(), TIMEOUT, new LocalZipExtractorEvent())); - } catch (IOException e) { - e.printStackTrace(); - return false; - } catch (InterruptedException unused) { - return false; - } - } - - private boolean checkZipExtractorResult(int i) { - switch (i) { - case -4: - recordError(-11); - break; - case -3: - setStateChecksumError(); - break; - case -2: - case -1: - recordError(-12); - break; - } - return false; - } - - private boolean downloadAndValidateZipFile(DownloadFileData downloadFileData, Hashtable hashtable) { - String fileURL = downloadFileData.getFileURL(); - Logging.DEBUG_OUT("Downloading Zip:" + fileURL); - try { - URLConnection openConnection = new URL(fileURL).openConnection(); - openConnection.setConnectTimeout(30000); - openConnection.setReadTimeout(30000); - InputStream inputStream = openConnection.getInputStream(); - if (inputStream == null) { - return false; - } - return checkZipExtractorResult(new ZipExtractor().extractFiles(inputStream, hashtable, this.assetManager.getAssetPath(), TIMEOUT, new RemoteZipExtractorEvent(downloadProgress, downloadFileData))); - } catch (MalformedURLException e) { - e.printStackTrace(); - return false; - } catch (IOException e2) { - e2.printStackTrace(); - return false; - } - } - - /* JADX WARN: Removed duplicated region for block: B:45:0x00b4 A[EXC_TOP_SPLITTER, SYNTHETIC] */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - private java.util.Hashtable getChecksumsHashtable(java.lang.String r8, com.eamobile.download.DownloadFileData[] r9) { - /* - Method dump skipped, instructions count: 192 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.eamobile.DownloadActivityInternal.getChecksumsHashtable(java.lang.String, com.eamobile.download.DownloadFileData[]):java.util.Hashtable"); - } - - private DownloadFileData getMatchingChecksumFile(String str, DownloadFileData[] downloadFileDataArr) { - for (int i = 0; i < downloadFileDataArr.length; i++) { - if (downloadFileDataArr[i].getType() == 2 && downloadFileDataArr[i].getFileName().contains(str)) { - return downloadFileDataArr[i]; - } - } - return null; - } - - /* JADX WARN: Removed duplicated region for block: B:33:0x030a A[Catch: Exception -> 0x047e, TryCatch #0 {Exception -> 0x047e, blocks: (B:31:0x025d, B:33:0x030a, B:35:0x0326, B:39:0x0330, B:40:0x033c, B:42:0x0342, B:44:0x03d6, B:45:0x03df, B:47:0x03e5, B:49:0x041b, B:53:0x0430, B:55:0x0438, B:58:0x0440, B:60:0x0448, B:64:0x0453, B:71:0x0469), top: B:30:0x025d, inners: #3 }] */ - /* JADX WARN: Removed duplicated region for block: B:72:0x047d A[RETURN] */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - private int updateDownloadFilesData(boolean r19) { - /* - Method dump skipped, instructions count: 1166 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.eamobile.DownloadActivityInternal.updateDownloadFilesData(boolean):int"); - } - - public void recordError(int i) { - mErrorList.add(Integer.valueOf(i)); - Logging.DEBUG_OUT("ERROR OCCURRED: " + i + " (total: " + mErrorList.size() + ")"); - } - - public int getLastError() { - if (mErrorList.size() == 0) { - return 0; - } - return mErrorList.get(mErrorList.size() - 1).intValue(); - } - - public int getNumErrors() { - return mErrorList.size(); - } - - public void setStateChecksumError() { - recordError(-10); - this.serverErrorView.setErrorCode(getLastError()); - setState(13); - } - - private JSONObject sendHttpPost(String str, JSONObject jSONObject) { - InputStream inputStream; - try { - CloseableHttpClient defaultHttpClient = new DefaultHttpClient(); - HttpConnectionParams.setConnectionTimeout(defaultHttpClient.getParams(), 10000); - HttpPost httpPost = new HttpPost(str); - httpPost.setEntity(new StringEntity(jSONObject.toString())); - httpPost.setHeader(HttpHeaders.ACCEPT, "application/json"); - httpPost.setHeader("Content-type", "application/json"); - HttpEntity entity = defaultHttpClient.execute((HttpUriRequest) httpPost).getEntity(); - if (entity != null) { - inputStream = entity.getContent(); - try { - try { - JSONObject jSONObject2 = new JSONObject(convertStreamToString(inputStream)); - unknownHostExceptionTryAgain = true; - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused) { - } - } - return jSONObject2; - } catch (Throwable th) { - th = th; - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused2) { - } - } - throw th; - } - } catch (Exception e) { - e = e; - Logging.DEBUG_OUT("[ERROR] An exception occurred in sendHttpPost while trying to obtain the file list."); - Logging.DEBUG_OUT_STACK(e); - Logging.DEBUG_OUT("URL: " + str); - Logging.DEBUG_OUT("jsonObjSend: " + jSONObject); - if (unknownHostExceptionTryAgain) { - Logging.DEBUG_OUT("Trying sendHttpPost again..."); - unknownHostExceptionTryAgain = false; - JSONObject sendHttpPost = sendHttpPost(str, jSONObject); - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused3) { - } - } - return sendHttpPost; - } - Logging.DEBUG_OUT("Already tried sendHttpPost after failure."); - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused4) { - } - } - return null; - } - } - } catch (Exception e2) { - e = e2; - inputStream = null; - } catch (Throwable th2) { - th = th2; - inputStream = null; - } - return null; - } - - protected String getAndroidUniqueId() { - String string = Settings.Secure.getString(instance.getContentResolver(), "android_id"); - String deviceId = ((TelephonyManager) instance.getSystemService(PlaceFields.PHONE)).getDeviceId(); - if (string != null) { - return "androidId=" + string + "&imei=" + deviceId; - } - return "imei=" + deviceId; - } - - protected String getDeviceString() { - String str = getManufacturer() + com.google.android.vending.expansion.downloader.Constants.FILENAME_SEQUENCE_SEPARATOR + getModel(); - try { - return URLEncoder.encode(str, HTTP.UTF_8); - } catch (Exception e) { - Logging.DEBUG_OUT("getDeviceString Encode Exception:" + e); - return str; - } - } - - protected String getManufacturer() { - try { - return Build.MANUFACTURER; - } catch (Exception e) { - Logging.DEBUG_OUT("getManufacturer Exception:" + e); - return AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_UNKNOWN; - } - } - - protected String getModel() { - try { - return Build.MODEL; - } catch (Exception e) { - Logging.DEBUG_OUT("getModel Exception:" + e); - return AnalyticsEvents.PARAMETER_DIALOG_OUTCOME_VALUE_UNKNOWN; - } - } - - protected String getBrand() { - String str = Build.BRAND; - try { - return URLEncoder.encode(str, HTTP.UTF_8); - } catch (Exception unused) { - return str; - } - } - - public String getApplicationName() { - try { - return instance.getString(instance.getPackageManager().getPackageInfo(instance.getPackageName(), 0).applicationInfo.labelRes); - } catch (PackageManager.NameNotFoundException unused) { - return ""; - } - } - - protected String getAPKVersion() { - try { - return instance.getPackageManager().getPackageInfo(instance.getPackageName(), 0).versionName; - } catch (PackageManager.NameNotFoundException unused) { - return ""; - } - } - - public void startGameActivity(int i) { - ADCTelemetry.getInstance().sendTelemetry(4); - try { - Thread.sleep(1000L); - } catch (InterruptedException unused) { - } - ADCTelemetry.getInstance().onDestroy(); - Logging.DEBUG_OUT("onResult assetPath = " + this.assetManager.getAssetPath() + " result = " + i); - this.mDownloadActivity.onResult(this.assetManager.getAssetPath(), i); - Logging.DEBUG_CLOSE(); - } - - private String readUrlFromFile() { - try { - File file = new File(this.assetManager.getFilePath(DOWNLOAD_URL_CONFIG_FILE)); - if (file.exists()) { - BufferedReader bufferedReader = new BufferedReader(new FileReader(file)); - String readLine = bufferedReader.readLine(); - bufferedReader.close(); - return readLine; - } - Logging.DEBUG_OUT("\t\tDownloadURL.indicate does not exist."); - return null; - } catch (Exception e) { - Logging.DEBUG_OUT("\t\tException while reading DownloadURL.indicate: " + e); - return null; - } - } - - private void checkPermissions() { - try { - PackageManager packageManager = this.mContext.getPackageManager(); - Logging.DEBUG_OUT(" "); - Logging.DEBUG_OUT("[uses-permission tags]"); - Logging.DEBUG_OUT("Checking permissions for package: " + this.mContext.getPackageName()); - List asList = Arrays.asList(packageManager.getPackageInfo(this.mContext.getPackageName(), 4096).requestedPermissions); - boolean z = false; - for (int i = 0; i < EXPECTED_PERMISSIONS.length; i++) { - if (!asList.contains(EXPECTED_PERMISSIONS[i])) { - Logging.DEBUG_OUT("\tPermission " + EXPECTED_PERMISSIONS[i] + " is missing."); - z = true; - } - } - if (z) { - Logging.DEBUG_OUT(" "); - Logging.DEBUG_OUT("!!!!! WARNING !!!!!"); - Logging.DEBUG_OUT("\tOne or more expected permissions is missing. Please check uses-permission tags in AndroidManifest.xml"); - Logging.DEBUG_OUT("!!!!! WARNING !!!!!"); - } else { - Logging.DEBUG_OUT("\tPermissions OK."); - } - Logging.DEBUG_OUT(" "); - } catch (Exception e) { - Logging.DEBUG_OUT_STACK(e); - } - } - - private void loadConfigProperties() { - try { - try { - Properties properties = new Properties(); - properties.load(instance.getAssets().open(getResourcesPath() + "config.properties")); - MASTER_SELL_ID = Integer.parseInt(properties.getProperty("MASTER_SELL_ID").trim()); - TOTAL_SPACE_MB = Integer.parseInt(properties.getProperty("TOTAL_SPACE_MB").trim()); - PRODUCT_ID = Integer.parseInt(properties.getProperty("PRODUCT_ID").trim()); - Logging.DEBUG_OUT(" "); - Logging.DEBUG_OUT("[config.properties]"); - Logging.DEBUG_OUT("\tMASTER_SELL_ID: " + MASTER_SELL_ID); - Logging.DEBUG_OUT("\tPRODUCT_ID: " + PRODUCT_ID); - Logging.DEBUG_OUT("\tTOTAL_SPACE_MB: " + TOTAL_SPACE_MB); - String property = properties.getProperty("USE_INTERNAL_STORAGE"); - if (property != null) { - USE_INTERNAL_STORAGE = Boolean.parseBoolean(property.trim()); - } - Logging.DEBUG_OUT("\tUSE_INTERNAL_STORAGE: " + USE_INTERNAL_STORAGE); - String property2 = properties.getProperty("ALTERNATIVE_DATA_FOLDER"); - if (property2 != null) { - ALTERNATIVE_DATA_FOLDER = Boolean.parseBoolean(property2.trim()); - } - Logging.DEBUG_OUT("\tALTERNATIVE_DATA_FOLDER: " + ALTERNATIVE_DATA_FOLDER); - String property3 = properties.getProperty("DATA_FOLDER"); - if (property3 != null) { - Logging.DEBUG_OUT("\tDATA_FOLDER: " + property3); - setAssetPathAux(property3, true); - } else { - Logging.DEBUG_OUT("\tDATA_FOLDER not specified in config.properties"); - if (this.callSetAssetPathAux) { - setAssetPathAux(this.activityAssetPath, this.activityUseExternal); - } else { - Logging.DEBUG_OUT("[ERROR] DATA_FOLDER not specified in config.properties and setAssetPath() was not called from game's activity."); - } - } - String property4 = properties.getProperty("TIMEOUT"); - if (property4 != null) { - try { - int parseInt = Integer.parseInt(property4.trim()); - if (parseInt > 0) { - TIMEOUT = parseInt * 1000; - Logging.DEBUG_OUT("\tTIMEOUT read from config.properties"); - } - } catch (Exception e) { - Logging.DEBUG_OUT("\t" + e.toString()); - } - } - Logging.DEBUG_OUT("\tTIMEOUT: " + TIMEOUT + " milliseconds"); - String property5 = properties.getProperty("READ_DOWNLOAD_URL_FROM_SDCARD"); - if (property5 != null) { - property5 = property5.trim(); - } - if (Boolean.parseBoolean(property5)) { - Logging.DEBUG_OUT("\tWill try to read DOWNLOAD_URL from SD card..."); - String readUrlFromFile = readUrlFromFile(); - if (readUrlFromFile != null) { - Logging.DEBUG_OUT("\t\tOK: DOWNLOAD_URL read from SD Card"); - DOWNLOAD_URL = readUrlFromFile; - } else { - Logging.DEBUG_OUT("\t\tFAILED. Will use DOWNLOAD_URL defined in config.properties"); - DOWNLOAD_URL = properties.getProperty("DOWNLOAD_URL").trim(); - } - } else { - DOWNLOAD_URL = properties.getProperty("DOWNLOAD_URL").trim(); - } - Logging.DEBUG_OUT("\tDOWNLOAD_URL: " + DOWNLOAD_URL); - String property6 = properties.getProperty("UNCOMPRESS_ZIP_ON_DEVICE"); - if (property6 != null) { - property6 = property6.trim(); - } - UNCOMPRESS_ZIP_ON_DEVICE = Boolean.parseBoolean(property6); - Logging.DEBUG_OUT("\tUNCOMPRESS_ZIP_ON_DEVICE: " + UNCOMPRESS_ZIP_ON_DEVICE); - String property7 = properties.getProperty("CUSTOM_PROGRESS_BAR"); - if (property7 != null) { - CUSTOM_PROGRESS_BAR = Boolean.parseBoolean(property7.trim()); - } - Logging.DEBUG_OUT("\tCUSTOM_PROGRESS_BAR: " + CUSTOM_PROGRESS_BAR); - String property8 = properties.getProperty("USE_OLD_PROGRESS_BAR"); - if (property8 != null) { - USE_OLD_PROGRESS_BAR = Boolean.parseBoolean(property8.trim()); - } - Logging.DEBUG_OUT("\tUSE_OLD_PROGRESS_BAR: " + USE_OLD_PROGRESS_BAR); - String property9 = properties.getProperty("TOTAL_SPACE_MB_MIN"); - if (property9 != null) { - try { - TOTAL_SPACE_MB_MIN = Integer.parseInt(property9.trim()); - } catch (Exception e2) { - Logging.DEBUG_OUT("\t" + e2.toString()); - } - } - Logging.DEBUG_OUT("\tTOTAL_SPACE_MB_MIN: " + TOTAL_SPACE_MB_MIN); - if (TOTAL_SPACE_MB_MIN > 0 && TOTAL_SPACE_MB > TOTAL_SPACE_MB_MIN) { - isDownloadRange = true; - } else { - isDownloadRange = false; - } - String property10 = properties.getProperty("DISABLE_3G"); - if (property10 != null) { - DISABLE_3G = Boolean.parseBoolean(property10.trim()); - } - Logging.DEBUG_OUT("\tDISABLE_3G: " + DISABLE_3G); - String property11 = properties.getProperty("FORCE_WAKE_DURING_DOWNLOAD"); - if (property11 != null) { - setForceWakeDuringDownload(Boolean.parseBoolean(property11.trim())); - } - Logging.DEBUG_OUT("\tFORCE_WAKE_DURING_DOWNLOAD: " + getForceWakeDuringDownload()); - String property12 = properties.getProperty("DO_NOT_OPEN_STORAGE_SETTINGS"); - if (property12 != null) { - DO_NOT_OPEN_STORAGE_SETTINGS = Boolean.parseBoolean(property12.trim()); - } - Logging.DEBUG_OUT("\tDO_NOT_OPEN_STORAGE_SETTINGS: " + DO_NOT_OPEN_STORAGE_SETTINGS); - MIN_ASSET_VERSION_REQUIRED = properties.getProperty("MIN_ASSET_VERSION_REQUIRED"); - Logging.DEBUG_OUT("\tMIN_ASSET_VERSION_REQUIRED: " + MIN_ASSET_VERSION_REQUIRED); - String property13 = properties.getProperty("DELETE_ASSETS_ON_UPDATE"); - if (property13 != null) { - DELETE_ASSETS_ON_UPDATE = Boolean.parseBoolean(property13.trim()); - } - Logging.DEBUG_OUT("\tDELETE_ASSETS_ON_UPDATE: " + DELETE_ASSETS_ON_UPDATE); - String property14 = properties.getProperty("UNSAFE_ASSET_DELETION_ON_UPDATE"); - if (property14 != null) { - UNSAFE_ASSET_DELETION_ON_UPDATE = Boolean.parseBoolean(property14.trim()); - } - Logging.DEBUG_OUT("\tUNSAFE_ASSET_DELETION_ON_UPDATE: " + UNSAFE_ASSET_DELETION_ON_UPDATE); - if (UNSAFE_ASSET_DELETION_ON_UPDATE) { - Logging.DEBUG_OUT(" "); - Logging.DEBUG_OUT("!!!!! WARNING !!!!!"); - Logging.DEBUG_OUT("\tUNSAFE_ASSET_DELETION_ON_UPDATE = true"); - Logging.DEBUG_OUT("\tADC will delete the entire download folder before an update"); - Logging.DEBUG_OUT("!!!!! WARNING !!!!!"); - Logging.DEBUG_OUT(" "); - } - String property15 = properties.getProperty("REDOWNLOAD_ON_SCREEN_SIZE_CHANGE"); - if (property15 != null) { - REDOWNLOAD_ON_SCREEN_SIZE_CHANGE = Boolean.parseBoolean(property15.trim()); - } - Logging.DEBUG_OUT("\tREDOWNLOAD_ON_SCREEN_SIZE_CHANGE: " + REDOWNLOAD_ON_SCREEN_SIZE_CHANGE); - String property16 = properties.getProperty("NUMBER_OF_HOURS_TO_UPDATE_CHECKING"); - if (property16 != null) { - try { - NUMBER_OF_HOURS_TO_UPDATE_CHECKING = Integer.parseInt(property16.trim()); - Logging.DEBUG_OUT("\tNUMBER_OF_HOURS_TO_UPDATE_CHECKING read from config.properties"); - } catch (Exception e3) { - Logging.DEBUG_OUT("\t" + e3.toString()); - } - } - Logging.DEBUG_OUT("\tNUMBER_OF_HOURS_TO_UPDATE_CHECKING: " + NUMBER_OF_HOURS_TO_UPDATE_CHECKING + " hours"); - String property17 = properties.getProperty("RETRIEVE_FULL_SCREEN_RESOLUTION"); - if (property17 != null) { - RETRIEVE_FULL_SCREEN_RESOLUTION = Boolean.parseBoolean(property17.trim()); - } - Logging.DEBUG_OUT("\tRETRIEVE_FULL_SCREEN_RESOLUTION: " + RETRIEVE_FULL_SCREEN_RESOLUTION); - this.configLoaded = true; - } catch (Exception e4) { - Logging.DEBUG_OUT("\tException while loading properties: config.properties" + e4); - } - } finally { - Logging.DEBUG_OUT(" "); - } - } - - /* JADX WARN: Code restructure failed: missing block: B:51:0x00f3, code lost: - - r0.close(); - */ - /* JADX WARN: Code restructure failed: missing block: B:53:?, code lost: - - return; - */ - /* JADX WARN: Code restructure failed: missing block: B:54:0x00f7, code lost: - - r0 = move-exception; - */ - /* JADX WARN: Code restructure failed: missing block: B:55:0x00f8, code lost: - - r0.printStackTrace(); - */ - /* JADX WARN: Code restructure failed: missing block: B:56:0x00fb, code lost: - - return; - */ - /* JADX WARN: Code restructure failed: missing block: B:60:0x00fe, code lost: - - r0.close(); - */ - /* JADX WARN: Code restructure failed: missing block: B:62:?, code lost: - - return; - */ - /* JADX WARN: Code restructure failed: missing block: B:63:0x0102, code lost: - - r0 = move-exception; - */ - /* JADX WARN: Code restructure failed: missing block: B:64:0x0103, code lost: - - r0.printStackTrace(); - */ - /* JADX WARN: Code restructure failed: missing block: B:65:0x0106, code lost: - - return; - */ - /* JADX WARN: Code restructure failed: missing block: B:69:0x0109, code lost: - - r0.close(); - */ - /* JADX WARN: Code restructure failed: missing block: B:71:?, code lost: - - return; - */ - /* JADX WARN: Code restructure failed: missing block: B:72:0x010d, code lost: - - r0 = move-exception; - */ - /* JADX WARN: Code restructure failed: missing block: B:73:0x010e, code lost: - - r0.printStackTrace(); - */ - /* JADX WARN: Code restructure failed: missing block: B:74:0x0111, code lost: - - return; - */ - /* JADX WARN: Multi-variable type inference failed */ - /* JADX WARN: Removed duplicated region for block: B:89:0x0129 A[EXC_TOP_SPLITTER, SYNTHETIC] */ - /* JADX WARN: Type inference failed for: r0v1, types: [java.lang.String] */ - /* JADX WARN: Type inference failed for: r0v4 */ - /* JADX WARN: Type inference failed for: r0v8, types: [java.io.InputStream] */ - /* JADX WARN: Type inference failed for: r2v1, types: [android.content.res.AssetManager] */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - private void loadOverrides() { - /* - Method dump skipped, instructions count: 318 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.eamobile.DownloadActivityInternal.loadOverrides():void"); - } - - public String getRequiredSpaceForDownload() { - if (spaceNeededToDownload > 0) { - return "" + ((spaceNeededToDownload / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID); - } - return "" + TOTAL_SPACE_MB; - } - - public String getAvailableSpaceForDownload() { - return "" + ((spaceAvailableToDownload / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID); - } - - public String getSpaceRangeForDownload() { - if (spaceNeededToDownload > 0) { - return "" + ((spaceNeededToDownload / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID); - } - if (!isDownloadRange) { - return "" + TOTAL_SPACE_MB; - } - return "" + TOTAL_SPACE_MB_MIN + com.google.android.vending.expansion.downloader.Constants.FILENAME_SEQUENCE_SEPARATOR + TOTAL_SPACE_MB; - } - - private String convertStreamToString(InputStream inputStream) { - StringBuilder sb; - BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 8192); - StringBuilder sb2 = new StringBuilder(); - while (true) { - try { - try { - String readLine = bufferedReader.readLine(); - if (readLine != null) { - sb2.append(readLine + "\n"); - } else { - try { - break; - } catch (IOException e) { - e = e; - sb = new StringBuilder(); - sb.append("convertStreamToString Unable to close reader:"); - sb.append(e); - Logging.DEBUG_OUT(sb.toString()); - return sb2.toString(); - } - } - } catch (IOException e2) { - Logging.DEBUG_OUT("convertStreamToString Exception:" + e2); - try { - bufferedReader.close(); - } catch (IOException e3) { - e = e3; - sb = new StringBuilder(); - sb.append("convertStreamToString Unable to close reader:"); - sb.append(e); - Logging.DEBUG_OUT(sb.toString()); - return sb2.toString(); - } - } - } catch (Throwable th) { - try { - bufferedReader.close(); - } catch (IOException e4) { - Logging.DEBUG_OUT("convertStreamToString Unable to close reader:" + e4); - } - throw th; - } - } - bufferedReader.close(); - return sb2.toString(); - } - - public boolean canOpenStorageSettings() { - return !DO_NOT_OPEN_STORAGE_SETTINGS; - } - - public int getTotalDownloadSize(DownloadFileData[] downloadFileDataArr) { - totalDownloadSizeMB = 0; - int i = 0; - for (DownloadFileData downloadFileData : downloadFileDataArr) { - try { - i += downloadFileData.getSize(); - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred while calculating download size:" + e); - } - } - totalDownloadSizeMB = (i / 1024) / 1024; - return totalDownloadSizeMB; - } - - public static int getTotalDownloadSizeMB() { - return totalDownloadSizeMB; - } - - public static String getTotalDownloadSizeMBString() { - return Integer.toString(totalDownloadSizeMB); - } - - public long getTotalDownloadSizeForNonZipFiles(DownloadFileData[] downloadFileDataArr) { - long j = 0; - for (int i = 0; i < downloadFileDataArr.length; i++) { - try { - if (downloadFileDataArr[i].getType() != 1) { - j += downloadFileDataArr[i].getSize(); - } - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred while calculating download size for non-zip files:"); - Logging.DEBUG_OUT_STACK(e); - } - } - return j; - } - - public Bitmap getBackgroundBitmap() { - return this.bmpBg; - } - - public void setBackgroundBitmap(Bitmap bitmap) { - this.bmpBg = bitmap; - } - - public static boolean getForceWakeDuringDownload() { - return FORCE_WAKE_DURING_DOWNLOAD; - } - - public static void setForceWakeDuringDownload(boolean z) { - FORCE_WAKE_DURING_DOWNLOAD = z; - } -} diff --git a/app/src/main/java/com/eamobile/IDeviceData.java b/app/src/main/java/com/eamobile/IDeviceData.java deleted file mode 100644 index 24680ab..0000000 --- a/app/src/main/java/com/eamobile/IDeviceData.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.eamobile; - -import com.eamobile.download.DeviceData; - -/* loaded from: classes.dex */ -public interface IDeviceData { - void onRetrievedDeviceData(DeviceData deviceData); -} diff --git a/app/src/main/java/com/eamobile/IDownloadActivity.java b/app/src/main/java/com/eamobile/IDownloadActivity.java deleted file mode 100644 index 70b227e..0000000 --- a/app/src/main/java/com/eamobile/IDownloadActivity.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.eamobile; - -/* loaded from: classes.dex */ -public interface IDownloadActivity { - public static final int DOWNLOAD_CANCEL = 1; - public static final int DOWNLOAD_START = 0; - - void onDownloadEvent(int i); - - void onResult(String str, int i); -} diff --git a/app/src/main/java/com/eamobile/Language.java b/app/src/main/java/com/eamobile/Language.java deleted file mode 100644 index 2769d28..0000000 --- a/app/src/main/java/com/eamobile/Language.java +++ /dev/null @@ -1,246 +0,0 @@ -package com.eamobile; - -import com.eamobile.download.Logging; -import java.io.DataInput; -import java.io.DataInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.Vector; - -/* loaded from: classes.dex */ -public class Language { - public static final int ASCII = 1; - public static final int BTN_3G = 23; - public static final int BTN_ALWAYS = 48; - public static final int BTN_CANCEL = 49; - public static final int BTN_DOWNLOAD = 5; - public static final int BTN_EXIT = 6; - public static final int BTN_NO = 18; - public static final int BTN_OK = 2; - public static final int BTN_RETRY = 14; - public static final int BTN_RETRY_TITLE = 13; - public static final int BTN_THIS_TIME_ONLY = 47; - public static final int BTN_WIFI = 16; - public static final int BTN_YES = 17; - public static final int CHECK_UPDATES_MSG = 22; - public static final int CHECK_UPDATES_TITLE = 21; - public static final int CONTACTING_SERVER_MSG = 38; - public static final int CONTACTING_SERVER_TITLE = 37; - public static final int DEBUG_DOWNLOAD_TITLE = 52; - public static final int DELETING_OLD_CONTENT = 45; - public static final int DOWNLOADING_MSG = 20; - public static final int DOWNLOADING_TITLE = 19; - public static final int DOWNLOAD_EXIT_CONFIRMATION = 41; - public static final int DOWNLOAD_MSG = 1; - public static final int DOWNLOAD_MSG_NEW = 50; - public static final int DOWNLOAD_PROGRESS = 15; - public static final int DOWNLOAD_SPEED_TXT = 36; - public static final int DOWNLOAD_TITLE = 0; - public static final char END_OF_LINE = '\n'; - public static final int FAILED_MSG = 12; - public static final int FAILED_TITLE = 11; - public static final int INVALID_CONTENT_TITLE = 42; - public static final int INVALID_CONTENT_TXT = 43; - public static final int MANDATORY_UPDATE_WARNING = 44; - private static final int NB_STRINGS = 53; - public static final int NETWORK_3G_CONNECT_TITLE = 39; - public static final int NETWORK_WARNING_TXT = 24; - public static final int NETWORK_WIFI_DISABLED = 40; - public static final int NW_UNAVAIL = 9; - public static final int NW_UNAVAIL_MSG = 10; - public static final int PRESS_BACK_FOR_3G = 30; - public static final int PRESS_BACK_FOR_WIFI = 29; - public static final int PRESS_BTN_3G_FOR_3G = 31; - public static final int SERVER_ERROR_TEXT = 34; - public static final int SERVER_ERROR_TITLE = 33; - public static final int SIGNAL_STRENGTH_TXT = 35; - public static final int SPACE_UNAVAIL_MSG = 4; - public static final int SPACE_UNAVAIL_MSG_NEW = 51; - public static final int SPACE_UNAVAIL_TITLE = 3; - public static final int UNICODE = 2; - public static final int UNSUPPORTED_DEVICE_TITLE = 27; - public static final int UNSUPPORTED_DEVICE_TXT = 28; - public static final int UPDATES_FOUND_TITLE = 25; - public static final int UPDATES_FOUND_TXT = 26; - public static final int WIFI_LOST = 46; - public static final int WIFI_MSG = 8; - public static final int WIFI_MSG_ENABLE_MANUALLY = 32; - public static final int WIFI_TITLE = 7; - private static int fileType; - public static final String[] strings = new String[53]; - public final int BUFFER_SIZE = 8096; - private String curLanguage; - - public boolean loadStrings(String str) { - InputStream inputStream; - Logging.DEBUG_OUT("\tloadString(" + str + ")"); - if (str == null) { - return false; - } - String str2 = DownloadActivityInternal.getResourcesPath() + str + ".txt"; - Logging.DEBUG_OUT("\tOpening file: " + str2); - InputStream inputStream2 = null; - try { - try { - inputStream = DownloadActivityInternal.getInstance().getAssets().open(str2); - } catch (FileNotFoundException unused) { - } catch (Exception e) { - e = e; - } - try { - try { - if (inputStream == null) { - Logging.DEBUG_OUT("\tCouldn't find file: " + str2); - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused2) { - } - } - return false; - } - Vector vector = new Vector(); - DataInputStream dataInputStream = new DataInputStream(inputStream); - fileType = determineFileType(str2); - if (fileType == 2) { - dataInputStream.skipBytes(2); - } - boolean z = true; - while (z) { - try { - vector.addElement(readTo(dataInputStream, '\n', true)); - } catch (Exception unused3) { - z = false; - } - } - for (int i = 0; i < strings.length; i++) { - strings[i] = ((String) vector.elementAt(i)).toString(); - } - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused4) { - } - } - this.curLanguage = str; - return true; - } catch (FileNotFoundException unused5) { - inputStream2 = inputStream; - Logging.DEBUG_OUT("\tFile not found: " + str2); - if (inputStream2 != null) { - try { - inputStream2.close(); - } catch (Exception unused6) { - } - } - return false; - } catch (Throwable th) { - th = th; - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused7) { - } - } - throw th; - } - } catch (Exception e2) { - e = e2; - inputStream2 = inputStream; - Logging.DEBUG_OUT("\tException caught: " + e); - Logging.DEBUG_OUT("[ERROR] An error occurred while loading text messages.Some messages may not display as expected."); - if (inputStream2 != null) { - try { - inputStream2.close(); - } catch (Exception unused8) { - } - } - return false; - } - } catch (Throwable th2) { - th = th2; - inputStream = null; - } - } - - public static String readTo(DataInput dataInput, char c, boolean z) throws IOException { - StringBuffer stringBuffer = new StringBuffer(); - char readChar = readChar(dataInput); - while (readChar != c) { - stringBuffer.append(readChar); - readChar = readChar(dataInput); - } - String stringBuffer2 = stringBuffer.toString(); - if (stringBuffer2 != null) { - return stringBuffer2.trim(); - } - return null; - } - - public static char readChar(DataInput dataInput) throws IOException { - if (fileType == 2) { - int readUnsignedShort = dataInput.readUnsignedShort(); - return (char) (((readUnsignedShort & 255) << 8) | (readUnsignedShort >> 8)); - } - return (char) dataInput.readUnsignedByte(); - } - - public static int determineFileType(String str) { - DataInputStream dataInputStream; - DataInputStream dataInputStream2 = null; - try { - try { - dataInputStream = new DataInputStream(DownloadActivityInternal.getInstance().getAssets().open(str)); - } catch (IOException unused) { - } catch (Throwable th) { - th = th; - } - try { - r0 = dataInputStream.readUnsignedShort() == 65534 ? 2 : 1; - dataInputStream.close(); - } catch (IOException unused2) { - dataInputStream2 = dataInputStream; - dataInputStream2.close(); - return r0; - } catch (Throwable th2) { - th = th2; - dataInputStream2 = dataInputStream; - try { - dataInputStream2.close(); - } catch (Exception unused3) { - } - throw th; - } - } catch (Exception unused4) { - } - return r0; - } - - public static String getString(int i) { - return getString(i, null); - } - - public static String getString(int i, String[] strArr) { - String str = strings[i]; - if (strArr != null) { - try { - if (strArr.length > 0) { - int i2 = 0; - while (str.indexOf("%%") != -1 && i2 < strArr.length) { - int indexOf = str.indexOf("%%"); - i2++; - str = str.substring(0, indexOf) + strArr[i2] + str.substring(indexOf + 2); - } - } - } catch (Exception e) { - Logging.DEBUG_OUT("Exception e:" + e); - } - } - return str; - } - - public String getCurrentLanguage() { - return this.curLanguage; - } -} diff --git a/app/src/main/java/com/eamobile/WifiReceiver.java b/app/src/main/java/com/eamobile/WifiReceiver.java deleted file mode 100644 index 1ca38e2..0000000 --- a/app/src/main/java/com/eamobile/WifiReceiver.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.eamobile; - -import android.content.BroadcastReceiver; -import android.content.Context; -import android.content.Intent; -import android.net.wifi.WifiInfo; -import android.net.wifi.WifiManager; -import com.eamobile.download.Logging; - -/* loaded from: classes.dex */ -public class WifiReceiver extends BroadcastReceiver { - private WifiManager wifiManager; - private String wifiName = ""; - private int wifiLevel = 0; - - public WifiReceiver() { - setWifiManager(); - } - - private void setWifiManager() { - Logging.DEBUG_OUT("Calling setWifiManager..."); - try { - if (DownloadActivityInternal.getInstance() != null) { - this.wifiManager = (WifiManager) DownloadActivityInternal.getInstance().getApplicationContext().getSystemService("wifi"); - } else { - this.wifiManager = null; - } - } catch (Exception e) { - this.wifiManager = null; - Logging.DEBUG_OUT("[ERROR] An exception occurred in WifiReceiver while trying to get WifiManager."); - Logging.DEBUG_OUT_STACK(e); - } - } - - @Override // android.content.BroadcastReceiver - public void onReceive(Context context, Intent intent) { - updateWifiInfo(); - } - - public void updateWifiInfo() { - if (this.wifiManager == null) { - setWifiManager(); - } - if (this.wifiManager == null || !this.wifiManager.isWifiEnabled()) { - return; - } - WifiInfo connectionInfo = this.wifiManager.getConnectionInfo(); - this.wifiName = connectionInfo.getSSID(); - int calculateSignalLevel = WifiManager.calculateSignalLevel(connectionInfo.getRssi(), 3); - if (this.wifiLevel != calculateSignalLevel) { - this.wifiLevel = calculateSignalLevel; - Logging.DEBUG_OUT("Wifi connection: " + this.wifiName + " (signal strength: " + this.wifiLevel + "/3)"); - } - } - - public String getWifiName() { - return this.wifiName; - } - - public int getWifiLevel() { - return this.wifiLevel; - } -} diff --git a/app/src/main/java/com/eamobile/download/AssetManager.java b/app/src/main/java/com/eamobile/download/AssetManager.java deleted file mode 100644 index 476a838..0000000 --- a/app/src/main/java/com/eamobile/download/AssetManager.java +++ /dev/null @@ -1,654 +0,0 @@ -package com.eamobile.download; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.FileWriter; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.Properties; -import java.util.TreeSet; -import java.util.regex.Pattern; - -/* loaded from: classes.dex */ -public class AssetManager { - static final String ADC_ASSET_INFO_FILE = "AssetInfo.indicate"; - static final String DOWNLOAD_CONTROL_FILE1 = "Downloaded.indicate"; - static final String DOWNLOAD_CONTROL_FILE2 = "Downloaded2.indicate"; - static final String INDICATE_FINISHED = "COMPLETE"; - static final String INDICATE_PROGRESS = "PROGRESS"; - private String mAlternativeAssetPath; - private String mAssetPath; - private boolean mUseAlternativeAssetPath = false; - - public void setAssetPath(String str) { - this.mAssetPath = str; - } - - public void setAlternativeAssetPath(String str) { - this.mAlternativeAssetPath = str; - } - - public String getAssetPath() { - if (!this.mUseAlternativeAssetPath) { - return this.mAssetPath; - } - return this.mAlternativeAssetPath; - } - - public void useAlternativeAssetPath(boolean z) { - if (z) { - Logging.DEBUG_OUT("AssetManager: using alternative location"); - } else { - Logging.DEBUG_OUT("AssetManager: using main location"); - } - this.mUseAlternativeAssetPath = z; - } - - public String getFilePath(String str) { - if (!this.mUseAlternativeAssetPath) { - return this.mAssetPath + "/" + str; - } - return this.mAlternativeAssetPath + "/" + str; - } - - public String getLocalAssetVersion() { - Logging.DEBUG_OUT("Calling: AssetManager getLocalAssetVersion()"); - try { - File file = new File(getFilePath(DOWNLOAD_CONTROL_FILE1)); - if (!file.exists()) { - return null; - } - Hashtable hashtable = new Hashtable(); - BufferedReader bufferedReader = new BufferedReader(new FileReader(file), 8192); - while (true) { - String readLine = bufferedReader.readLine(); - if (readLine == null) { - break; - } - if (!readLine.contains(INDICATE_FINISHED) && !readLine.trim().equals("")) { - String[] split = readLine.split("\t"); - hashtable.put(split[0], split[1]); - } - } - bufferedReader.close(); - Enumeration keys = hashtable.keys(); - String str = ""; - while (keys.hasMoreElements()) { - str = (String) hashtable.get((String) keys.nextElement()); - } - return str; - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred while getting local asset version: " + e); - Logging.DEBUG_OUT_STACK(e); - return null; - } - } - - public boolean checkForUpdates(DownloadFileData[] downloadFileDataArr) { - Logging.DEBUG_OUT("Calling: AssetManager checkForUpdates()"); - if (downloadFileDataArr == null || downloadFileDataArr.length <= 0) { - return false; - } - try { - return isVersionLower(getLocalAssetVersion(), downloadFileDataArr[0].getVersion()); - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred while checking for updates: " + e); - Logging.DEBUG_OUT_STACK(e); - return false; - } - } - - public boolean assetsFoundLocally() { - File file = new File(getAssetPath()); - if (!file.exists()) { - file.mkdir(); - } - try { - File file2 = new File(getFilePath(DOWNLOAD_CONTROL_FILE1)); - if (!file2.exists()) { - return false; - } - BufferedReader bufferedReader = new BufferedReader(new FileReader(file2), 8192); - String str = ""; - while (true) { - String readLine = bufferedReader.readLine(); - if (readLine == null) { - break; - } - str = str + readLine + "\n"; - } - bufferedReader.close(); - if (!str.contains(INDICATE_FINISHED)) { - return false; - } - File file3 = new File(getFilePath(DOWNLOAD_CONTROL_FILE2)); - if (!file3.exists()) { - return true; - } - BufferedReader bufferedReader2 = new BufferedReader(new FileReader(file3), 8192); - ArrayList arrayList = new ArrayList<>(); - while (true) { - String readLine2 = bufferedReader2.readLine(); - if (readLine2 != null) { - arrayList.add(readLine2); - } else { - bufferedReader2.close(); - return checkFiles(arrayList); - } - } - } catch (Exception unused) { - return false; - } - } - - public boolean isFileDownloaded(String str) { - File file = new File(getAssetPath()); - if (!file.exists()) { - file.mkdir(); - } - try { - File file2 = new File(getFilePath(DOWNLOAD_CONTROL_FILE1)); - if (!file2.exists()) { - return false; - } - BufferedReader bufferedReader = new BufferedReader(new FileReader(file2), 8192); - String str2 = ""; - while (true) { - String readLine = bufferedReader.readLine(); - if (readLine == null) { - break; - } - str2 = str2 + readLine + "\n"; - } - bufferedReader.close(); - return str2.contains(str); - } catch (Exception unused) { - Logging.DEBUG_OUT(str + " is not downloaded."); - return false; - } - } - - public void prepareSDCard() { - try { - File file = new File(getFilePath(DOWNLOAD_CONTROL_FILE1)); - if (file.exists()) { - file.delete(); - } - } catch (Exception e) { - Logging.DEBUG_OUT("Exception while cleaning SDCard:"); - Logging.DEBUG_OUT_STACK(e); - } - } - - public void deleteEntireDownloadFolder() { - deleteEntireDownloadFolderAux(new File(getAssetPath())); - } - - public void deleteEntireDownloadFolderAux(File file) { - try { - File[] listFiles = file.listFiles(); - for (int i = 0; i < listFiles.length; i++) { - if (listFiles[i].isDirectory()) { - deleteEntireDownloadFolderAux(listFiles[i]); - } - if (!listFiles[i].exists()) { - Logging.DEBUG_OUT("\tDeleting file: " + listFiles[i].getAbsolutePath() + " (NOT FOUND)"); - } else if (listFiles[i].delete()) { - Logging.DEBUG_OUT("\tDeleting file: " + listFiles[i].getAbsolutePath() + " (OK)"); - } else { - Logging.DEBUG_OUT("\tDeleting file: " + listFiles[i].getAbsolutePath() + " (FAILED)"); - } - } - } catch (Exception e) { - Logging.DEBUG_OUT("Exception while deleting download folder:"); - Logging.DEBUG_OUT_STACK(e); - } - } - - public void deleteAssets() { - try { - File file = new File(getFilePath(DOWNLOAD_CONTROL_FILE2)); - if (!file.exists()) { - return; - } - BufferedReader bufferedReader = new BufferedReader(new FileReader(file), 8192); - while (true) { - String readLine = bufferedReader.readLine(); - if (readLine != null) { - String filePath = getFilePath(readLine); - File file2 = new File(filePath); - if (file2.exists()) { - if (file2.delete()) { - Logging.DEBUG_OUT("\tDeleting file: " + filePath + " (OK)"); - } else { - Logging.DEBUG_OUT("\tDeleting file: " + filePath + " (FAILED)"); - } - } else { - Logging.DEBUG_OUT("\tDeleting file: " + filePath + " (NOT FOUND)"); - } - } else { - bufferedReader.close(); - deleteEmptyDirs(getAssetPath(), getDirList()); - return; - } - } - } catch (Exception e) { - Logging.DEBUG_OUT("Exception while deleting assets:"); - Logging.DEBUG_OUT_STACK(e); - } - } - - private void deleteEmptyDirs(String str, ArrayList arrayList) { - try { - File file = new File(str); - File[] listFiles = file.listFiles(); - if (listFiles == null) { - Logging.DEBUG_OUT("Error listing files for directory: " + file.getAbsolutePath()); - return; - } - for (int i = 0; i < listFiles.length; i++) { - if (listFiles[i].isDirectory()) { - deleteEmptyDirs(listFiles[i].getAbsolutePath(), arrayList); - } - } - File[] listFiles2 = file.listFiles(); - String absolutePath = file.getAbsolutePath(); - if (listFiles2.length == 0) { - if (belongsToADC(file, arrayList)) { - if (file.delete()) { - Logging.DEBUG_OUT(absolutePath + " (DELETED)"); - } else { - Logging.DEBUG_OUT(absolutePath + " (UNKNOWN ERROR WHILE DELETING)"); - } - try { - Thread.sleep(10L); - return; - } catch (InterruptedException e) { - Logging.DEBUG_OUT_STACK(e); - return; - } - } - Logging.DEBUG_OUT(absolutePath + " (DOES NOT BELONG TO ADC)"); - return; - } - Logging.DEBUG_OUT(absolutePath + " (NOT EMPTY)"); - } catch (SecurityException e2) { - Logging.DEBUG_OUT_STACK(e2); - } - } - - private boolean belongsToADC(File file, ArrayList arrayList) { - return arrayList.contains(file); - } - - private ArrayList getDirList() { - int i; - try { - ArrayList arrayList = new ArrayList<>(); - File file = new File(getFilePath(DOWNLOAD_CONTROL_FILE2)); - if (file.exists()) { - BufferedReader bufferedReader = new BufferedReader(new FileReader(file), 8192); - TreeSet treeSet = new TreeSet(); - while (true) { - String readLine = bufferedReader.readLine(); - i = 0; - if (readLine == null) { - break; - } - String[] split = readLine.split("/"); - String str = ""; - while (i < split.length - 1) { - str = str + split[i] + "/"; - treeSet.add(str); - i++; - } - } - Iterator it = treeSet.iterator(); - while (it.hasNext()) { - String str2 = (String) it.next(); - if (new File(getFilePath(str2)).isDirectory()) { - arrayList.add(new File(getFilePath(str2))); - } - } - Logging.DEBUG_OUT("ADC Directories read from Downloaded2.indicate: "); - while (i < arrayList.size()) { - Logging.DEBUG_OUT(arrayList.get(i).getAbsolutePath()); - i++; - } - bufferedReader.close(); - } - return arrayList; - } catch (Exception unused) { - return null; - } - } - - public void saveStateDownloadStarted() { - saveState(INDICATE_PROGRESS, null); - } - - public void saveStateDownloadFinished() { - saveState(INDICATE_PROGRESS, INDICATE_FINISHED); - } - - public void saveState(String str, String str2) { - try { - String filePath = getFilePath(DOWNLOAD_CONTROL_FILE1); - File file = new File(filePath); - if (file.exists()) { - BufferedReader bufferedReader = new BufferedReader(new FileReader(file), 8192); - String str3 = ""; - while (true) { - String readLine = bufferedReader.readLine(); - if (readLine == null) { - break; - } - str3 = str3 + readLine + "\n"; - } - bufferedReader.close(); - if (str2 != null) { - str = str3.replaceAll(str, str2); - } else if (!exists(str, filePath)) { - str = str3 + str; - } - if (exists(str, filePath)) { - return; - } - File file2 = new File(filePath); - if (file2.exists()) { - file2.delete(); - } - BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePath, true), 8192); - bufferedWriter.write(str + "\n"); - bufferedWriter.close(); - return; - } - try { - new File(getAssetPath()).mkdirs(); - } catch (SecurityException e) { - Logging.DEBUG_OUT("saveState Security Exception:" + e); - } - FileWriter fileWriter = new FileWriter(filePath, true); - BufferedWriter bufferedWriter2 = new BufferedWriter(fileWriter, 8192); - bufferedWriter2.write(str + "\n"); - bufferedWriter2.close(); - fileWriter.close(); - } catch (Exception e2) { - Logging.DEBUG_OUT("Exception while saving state to SDCard: " + e2); - } - } - - public void clearDownloadDir() { - File file = new File(getAssetPath()); - if (file.isDirectory()) { - for (String str : file.list()) { - new File(file, str).delete(); - } - } - } - - public void saveDownloadListFile(DownloadFileData[] downloadFileDataArr) { - String downloadList = getDownloadList(downloadFileDataArr); - try { - FileOutputStream fileOutputStream = new FileOutputStream(getFilePath(DOWNLOAD_CONTROL_FILE2)); - fileOutputStream.write(downloadList.getBytes()); - fileOutputStream.close(); - } catch (Exception e) { - Logging.DEBUG_OUT_STACK(e); - } - } - - public String getDownloadList(DownloadFileData[] downloadFileDataArr) { - String str = ""; - for (int i = 0; i < downloadFileDataArr.length; i++) { - if (downloadFileDataArr[i].getType() == 2) { - str = str + getFileList(downloadFileDataArr[i]); - } - } - return str; - } - - /* JADX WARN: Multi-variable type inference failed */ - /* JADX WARN: Removed duplicated region for block: B:38:0x00a3 A[EXC_TOP_SPLITTER, SYNTHETIC] */ - /* JADX WARN: Type inference failed for: r1v0, types: [java.io.BufferedReader, java.io.DataInputStream] */ - /* JADX WARN: Type inference failed for: r1v13 */ - /* JADX WARN: Type inference failed for: r1v14 */ - /* JADX WARN: Type inference failed for: r1v2, types: [java.io.BufferedReader] */ - /* JADX WARN: Type inference failed for: r1v3 */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - private java.lang.String getFileList(com.eamobile.download.DownloadFileData r8) { - /* - r7 = this; - java.lang.String r0 = "" - r1 = 0 - java.net.URL r2 = new java.net.URL // Catch: java.lang.Throwable -> L87 java.lang.Exception -> L8b - java.lang.String r8 = r8.getFileURL() // Catch: java.lang.Throwable -> L87 java.lang.Exception -> L8b - r2.(r8) // Catch: java.lang.Throwable -> L87 java.lang.Exception -> L8b - java.net.URLConnection r8 = r2.openConnection() // Catch: java.lang.Throwable -> L87 java.lang.Exception -> L8b - r2 = 30000(0x7530, float:4.2039E-41) - r8.setConnectTimeout(r2) // Catch: java.lang.Throwable -> L87 java.lang.Exception -> L8b - r8.setReadTimeout(r2) // Catch: java.lang.Throwable -> L87 java.lang.Exception -> L8b - java.io.InputStream r8 = r8.getInputStream() // Catch: java.lang.Throwable -> L87 java.lang.Exception -> L8b - if (r8 != 0) goto L2f - if (r8 == 0) goto L2e - r8.close() // Catch: java.lang.Exception -> L2a - r1.close() // Catch: java.lang.Exception -> L2a - r1.close() // Catch: java.lang.Exception -> L2a - goto L2e - L2a: - r8 = move-exception - com.eamobile.download.Logging.DEBUG_OUT_STACK(r8) - L2e: - return r1 - L2f: - java.io.DataInputStream r2 = new java.io.DataInputStream // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L82 - r2.(r8) // Catch: java.lang.Throwable -> L7f java.lang.Exception -> L82 - java.io.BufferedReader r3 = new java.io.BufferedReader // Catch: java.lang.Throwable -> L78 java.lang.Exception -> L7a - java.io.InputStreamReader r4 = new java.io.InputStreamReader // Catch: java.lang.Throwable -> L78 java.lang.Exception -> L7a - r4.(r2) // Catch: java.lang.Throwable -> L78 java.lang.Exception -> L7a - r5 = 8192(0x2000, float:1.148E-41) - r3.(r4, r5) // Catch: java.lang.Throwable -> L78 java.lang.Exception -> L7a - L40: - java.lang.String r1 = r3.readLine() // Catch: java.lang.Exception -> L76 java.lang.Throwable -> L9f - if (r1 == 0) goto L65 - java.lang.String r4 = "\t" - java.lang.String[] r1 = r1.split(r4) // Catch: java.lang.Exception -> L76 java.lang.Throwable -> L9f - java.lang.StringBuilder r4 = new java.lang.StringBuilder // Catch: java.lang.Exception -> L76 java.lang.Throwable -> L9f - r4.() // Catch: java.lang.Exception -> L76 java.lang.Throwable -> L9f - r4.append(r0) // Catch: java.lang.Exception -> L76 java.lang.Throwable -> L9f - r5 = 0 - r1 = r1[r5] // Catch: java.lang.Exception -> L76 java.lang.Throwable -> L9f - r4.append(r1) // Catch: java.lang.Exception -> L76 java.lang.Throwable -> L9f - java.lang.String r1 = "\n" - r4.append(r1) // Catch: java.lang.Exception -> L76 java.lang.Throwable -> L9f - java.lang.String r1 = r4.toString() // Catch: java.lang.Exception -> L76 java.lang.Throwable -> L9f - r0 = r1 - goto L40 - L65: - if (r8 == 0) goto L9e - r8.close() // Catch: java.lang.Exception -> L71 - r2.close() // Catch: java.lang.Exception -> L71 - r3.close() // Catch: java.lang.Exception -> L71 - goto L9e - L71: - r8 = move-exception - com.eamobile.download.Logging.DEBUG_OUT_STACK(r8) - goto L9e - L76: - r1 = move-exception - goto L90 - L78: - r0 = move-exception - goto La1 - L7a: - r3 = move-exception - r6 = r3 - r3 = r1 - r1 = r6 - goto L90 - L7f: - r0 = move-exception - r2 = r1 - goto La1 - L82: - r2 = move-exception - r3 = r1 - r1 = r2 - r2 = r3 - goto L90 - L87: - r0 = move-exception - r8 = r1 - r2 = r8 - goto La1 - L8b: - r8 = move-exception - r2 = r1 - r3 = r2 - r1 = r8 - r8 = r3 - L90: - com.eamobile.download.Logging.DEBUG_OUT_STACK(r1) // Catch: java.lang.Throwable -> L9f - if (r8 == 0) goto L9e - r8.close() // Catch: java.lang.Exception -> L71 - r2.close() // Catch: java.lang.Exception -> L71 - r3.close() // Catch: java.lang.Exception -> L71 - L9e: - return r0 - L9f: - r0 = move-exception - r1 = r3 - La1: - if (r8 == 0) goto Lb1 - r8.close() // Catch: java.lang.Exception -> Lad - r2.close() // Catch: java.lang.Exception -> Lad - r1.close() // Catch: java.lang.Exception -> Lad - goto Lb1 - Lad: - r8 = move-exception - com.eamobile.download.Logging.DEBUG_OUT_STACK(r8) - Lb1: - throw r0 - */ - throw new UnsupportedOperationException("Method not decompiled: com.eamobile.download.AssetManager.getFileList(com.eamobile.download.DownloadFileData):java.lang.String"); - } - - public long getTotalSize(String str) { - long j = 0; - for (String str2 : str.split("\n")) { - j += getFileSize(str2); - } - return j; - } - - public long getFileSize(String str) { - File file = new File(getFilePath(str)); - if (file.exists()) { - Logging.DEBUG_OUT("File: " + getFilePath(str) + " Size: " + file.length()); - return file.length(); - } - Logging.DEBUG_OUT("File: " + getFilePath(str) + " Size: 0"); - return 0L; - } - - private boolean checkFiles(ArrayList arrayList) { - Logging.DEBUG_OUT("[checkFiles]"); - for (int i = 0; i < arrayList.size(); i++) { - String filePath = getFilePath(arrayList.get(i)); - if (!new File(filePath).exists()) { - Logging.DEBUG_OUT("\tChecking file: " + filePath + " (NOT FOUND)"); - new File(getFilePath(DOWNLOAD_CONTROL_FILE1)).delete(); - return false; - } - Logging.DEBUG_OUT("\tChecking file: " + filePath + " (OK)"); - } - Logging.DEBUG_OUT(" "); - return true; - } - - public boolean isAssetVersionCompatible(String str) { - String localAssetVersion = getLocalAssetVersion(); - Logging.DEBUG_OUT("Checking asset version:"); - Logging.DEBUG_OUT("\tLocal asset version: " + localAssetVersion); - Logging.DEBUG_OUT("\tMinimum asset version: " + str); - if (isVersionLower(localAssetVersion, str)) { - Logging.DEBUG_OUT("FAILED"); - return false; - } - Logging.DEBUG_OUT("OK"); - return true; - } - - public boolean isVersionLower(String str, String str2) { - int compareTo = normalisedVersion(str2).compareTo(normalisedVersion(str)); - return compareTo >= 0 && compareTo > 0; - } - - private String normalisedVersion(String str) { - return normalisedVersion(str, ".", 4); - } - - private String normalisedVersion(String str, String str2, int i) { - String[] split = Pattern.compile(str2, 16).split(str); - StringBuilder sb = new StringBuilder(); - for (String str3 : split) { - sb.append(String.format("%" + i + 's', str3)); - } - return sb.toString(); - } - - private boolean exists(String str, String str2) { - String str3 = ""; - try { - BufferedReader bufferedReader = new BufferedReader(new FileReader(new File(str2)), 8192); - while (true) { - String readLine = bufferedReader.readLine(); - if (readLine == null) { - break; - } - str3 = str3 + readLine + "\r\n"; - } - Logging.DEBUG_OUT("Existing Text:" + str3 + ", new Value:" + str); - bufferedReader.close(); - } catch (Exception unused) { - } - return str3.contains(str); - } - - public Properties loadAssetInfo() { - try { - File file = new File(getFilePath(ADC_ASSET_INFO_FILE)); - if (!file.exists()) { - return null; - } - FileInputStream fileInputStream = new FileInputStream(file); - Properties properties = new Properties(); - properties.load(fileInputStream); - return properties; - } catch (Exception e) { - Logging.DEBUG_OUT("\tException while loading properties from: AssetInfo.indicate"); - Logging.DEBUG_OUT_STACK(e); - return null; - } - } - - public void saveAssetInfo(Properties properties) { - try { - FileOutputStream fileOutputStream = new FileOutputStream(getFilePath(ADC_ASSET_INFO_FILE)); - properties.store(fileOutputStream, ""); - fileOutputStream.close(); - } catch (Exception e) { - Logging.DEBUG_OUT("\tException while saving properties to: AssetInfo.indicate"); - Logging.DEBUG_OUT_STACK(e); - } - } -} diff --git a/app/src/main/java/com/eamobile/download/ChecksumValidator.java b/app/src/main/java/com/eamobile/download/ChecksumValidator.java deleted file mode 100644 index 5f21923..0000000 --- a/app/src/main/java/com/eamobile/download/ChecksumValidator.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.eamobile.download; - -import java.io.FileInputStream; -import java.io.IOException; -import java.util.zip.CRC32; -import java.util.zip.CheckedInputStream; - -/* loaded from: classes.dex */ -public class ChecksumValidator { - public static boolean validate(String str, String str2, long j) { - String str3; - boolean z = true; - if (str.contains(str2)) { - str3 = str.substring(str.lastIndexOf(str2) + (str2.charAt(str2.length() - 1) == '/' ? str2.length() : str2.length() + 1)); - } else { - str3 = str; - } - Logging.DEBUG_OUT("Validating checksum for " + str3); - try { - CheckedInputStream checkedInputStream = new CheckedInputStream(new FileInputStream(str), new CRC32()); - while (checkedInputStream.read(new byte[8192]) != -1) { - } - long value = checkedInputStream.getChecksum().getValue(); - checkedInputStream.close(); - if (value != j) { - z = false; - } - if (z) { - Logging.DEBUG_OUT("Checksums match: " + j); - Logging.DEBUG_OUT("File " + str3 + " downloaded successfully"); - } else { - Logging.DEBUG_OUT("[ERROR] Checksums do not match FileChecksum:" + value + ", Server Checksums:" + j); - StringBuilder sb = new StringBuilder(); - sb.append("File "); - sb.append(str3); - sb.append(" failed to download"); - Logging.DEBUG_OUT(sb.toString()); - } - return z; - } catch (IOException unused) { - return false; - } - } -} diff --git a/app/src/main/java/com/eamobile/download/Constants.java b/app/src/main/java/com/eamobile/download/Constants.java deleted file mode 100644 index 8e7cd77..0000000 --- a/app/src/main/java/com/eamobile/download/Constants.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.eamobile.download; - -/* loaded from: classes.dex */ -public class Constants { - public static final String ADC_BUILD_LOCAL = "@ADC_BUILD_LOCAL_DYNAMIC_VALUE@"; - public static final String ADC_BUILD_TIME = "@ADC_BUILD_TIME_DYNAMIC_VALUE@"; - public static final String ADC_BUILD_VERSION = "@ADC_BUILD_VERSION_DYNAMIC_VALUE@"; - public static final int DEFAULT_BUFFER_SIZE = 8192; -} diff --git a/app/src/main/java/com/eamobile/download/Device.java b/app/src/main/java/com/eamobile/download/Device.java deleted file mode 100644 index db50636..0000000 --- a/app/src/main/java/com/eamobile/download/Device.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.eamobile.download; - -/* loaded from: classes.dex */ -public class Device { - private int height; - private String name; - private int width; - - public Device(String str, int i, int i2) { - this.name = ""; - this.width = 0; - this.height = 0; - this.name = str; - this.width = i; - this.height = i2; - } - - public String getName() { - return this.name; - } - - public String getResolutionString() { - return this.width + "x" + this.height; - } - - public int getWidth() { - return this.width; - } - - public int getHeight() { - return this.height; - } -} diff --git a/app/src/main/java/com/eamobile/download/DeviceData.java b/app/src/main/java/com/eamobile/download/DeviceData.java deleted file mode 100644 index d9d3c82..0000000 --- a/app/src/main/java/com/eamobile/download/DeviceData.java +++ /dev/null @@ -1,119 +0,0 @@ -package com.eamobile.download; - -import java.util.EnumSet; -import java.util.Set; - -/* loaded from: classes.dex */ -public class DeviceData { - private String brandName; - private String deviceName; - private String glExtensions; - private int height; - private int width; - - public enum TextureType { - PVR, - ATI, - DXT, - ETC, - S3TC, - _3DC, - PALETTED, - LATC, - UNCOMPRESSED - } - - public String getDeviceName() { - return this.deviceName; - } - - public void setDeviceName(String str) { - this.deviceName = str; - } - - public String getBrandName() { - return this.brandName; - } - - public void setBrandName(String str) { - this.brandName = str; - } - - public int getWidth() { - return this.width; - } - - public int getHeight() { - return this.height; - } - - public void setResolution(int i, int i2) { - this.width = i; - this.height = i2; - } - - public String getGlExtensions() { - return this.glExtensions; - } - - public void setGlExtensions(String str) { - this.glExtensions = str; - } - - public EnumSet getSupportedTextureTypes() { - EnumSet of = EnumSet.of(TextureType.UNCOMPRESSED); - if (this.glExtensions.contains("GL_IMG_texture_compression_pvrtc")) { - of.add(TextureType.PVR); - } - if (this.glExtensions.contains("GL_ATI_compressed_texture_atitc") || this.glExtensions.contains("GL_AMD_compressed_ATC_texture") || this.glExtensions.contains("GL_ATI_texture_compression_atitc")) { - of.add(TextureType.ATI); - } - if (this.glExtensions.contains("GL_EXT_texture_compression_dxt1") || this.glExtensions.contains("GL_EXT_texture_compression_dxt3") || this.glExtensions.contains("GL_EXT_texture_compression_dxt5")) { - of.add(TextureType.DXT); - } - if (this.glExtensions.contains("GL_OES_compressed_ETC1_RGB8_texture")) { - of.add(TextureType.ETC); - } - if (this.glExtensions.contains("GL_OES_texture_compression_S3TC") || this.glExtensions.contains("GL_EXT_texture_compression_s3tc")) { - of.add(TextureType.S3TC); - } - if (this.glExtensions.contains("GL_AMD_compressed_3DC_texture")) { - of.add(TextureType._3DC); - } - if (this.glExtensions.contains("GL_OES_compressed_paletted_texture")) { - of.add(TextureType.PALETTED); - } - if (this.glExtensions.contains("GL_EXT_texture_compression_latc")) { - of.add(TextureType.LATC); - } - return of; - } - - public void forceTexture(Set set) { - this.glExtensions = ""; - if (set.contains(TextureType.PVR)) { - this.glExtensions += "GL_IMG_texture_compression_pvrtc "; - } - if (set.contains(TextureType.ATI)) { - this.glExtensions += "GL_ATI_compressed_texture_atitc "; - } - if (set.contains(TextureType.DXT)) { - this.glExtensions += "GL_EXT_texture_compression_dxt1 "; - } - if (set.contains(TextureType.ETC)) { - this.glExtensions += "GL_OES_compressed_ETC1_RGB8_texture "; - } - if (set.contains(TextureType.S3TC)) { - this.glExtensions += "GL_OES_texture_compression_S3TC "; - } - if (set.contains(TextureType._3DC)) { - this.glExtensions += "GL_AMD_compressed_3DC_texture "; - } - if (set.contains(TextureType.PALETTED)) { - this.glExtensions += "GL_OES_compressed_paletted_texture "; - } - if (set.contains(TextureType.LATC)) { - this.glExtensions += "GL_EXT_texture_compression_latc "; - } - } -} diff --git a/app/src/main/java/com/eamobile/download/DownloadFileData.java b/app/src/main/java/com/eamobile/download/DownloadFileData.java deleted file mode 100644 index d58ebdc..0000000 --- a/app/src/main/java/com/eamobile/download/DownloadFileData.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.eamobile.download; - -/* loaded from: classes.dex */ -public class DownloadFileData { - public static final int FILE_TYPE_CHECKSUMS = 2; - public static final int FILE_TYPE_OTHER = 3; - public static final int FILE_TYPE_ZIP = 1; - private String fileName; - private String fileURL; - private String language; - private int size; - private int type; - private String version; - - public DownloadFileData(String str, int i, String str2, String str3, String str4, int i2) { - this.fileName = str; - this.size = i; - this.version = str2; - this.language = str3; - this.fileURL = str4; - this.type = i2; - } - - public String getFileName() { - return this.fileName; - } - - public void setFileName(String str) { - this.fileName = str; - } - - public int getSize() { - return this.size; - } - - public void setSize(int i) { - this.size = i; - } - - public String getVersion() { - return this.version; - } - - public void setVersion(String str) { - this.version = str; - } - - public String getLanguage() { - return this.language; - } - - public void setLanguage(String str) { - this.language = str; - } - - public String getFileURL() { - return this.fileURL; - } - - public void setFileURL(String str) { - this.fileURL = str; - } - - public int getType() { - return this.type; - } - - public void setType(int i) { - this.type = i; - } - - public String toString() { - return this.fileName + " " + this.size + " " + this.version + " " + this.language + " " + this.fileURL + " " + this.type; - } -} diff --git a/app/src/main/java/com/eamobile/download/DownloadProgress.java b/app/src/main/java/com/eamobile/download/DownloadProgress.java deleted file mode 100644 index 8973860..0000000 --- a/app/src/main/java/com/eamobile/download/DownloadProgress.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.eamobile.download; - -import java.util.HashMap; - -/* loaded from: classes.dex */ -public class DownloadProgress { - private FileProgress currentFileProgress; - private boolean isLastReportDownload; - private HashMap progressMap; - private long realDownloaded; - private long sizeDownloaded; - - class FileProgress { - public long downloaded; - public long total; - - FileProgress(long j, long j2) { - this.downloaded = j; - this.total = j2; - } - } - - public DownloadProgress() { - Logging.DEBUG_OUT("DownloadProgress: constructor"); - this.sizeDownloaded = 0L; - this.realDownloaded = 0L; - this.progressMap = new HashMap<>(); - this.currentFileProgress = null; - this.isLastReportDownload = true; - } - - public void setFlagLastReportDownload(boolean z) { - this.isLastReportDownload = z; - } - - public boolean getFlagLastReportDownload() { - return this.isLastReportDownload; - } - - public long getSizeDownloaded() { - return this.sizeDownloaded; - } - - public long getRealDownloaded() { - return this.realDownloaded; - } - - public void setCurrentFile(String str, long j) { - Logging.DEBUG_OUT("DownloadProgress: controlling progress for: " + str); - Logging.DEBUG_OUT("DownloadProgress: size: " + j); - FileProgress fileProgress = this.progressMap.get(str); - if (fileProgress == null) { - this.currentFileProgress = new FileProgress(0L, j); - this.progressMap.put(str, this.currentFileProgress); - } else { - this.currentFileProgress = fileProgress; - } - } - - public void reportProgress(long j, boolean z) { - if (this.currentFileProgress != null) { - if (j > this.currentFileProgress.total) { - j = this.currentFileProgress.total; - } - long j2 = j - this.currentFileProgress.downloaded; - if (j2 > 0) { - if (z) { - this.sizeDownloaded += j2; - } - this.currentFileProgress.downloaded = j; - } - } - } - - public void fillCurrentFileDownload(boolean z) { - if (this.currentFileProgress != null) { - long j = this.currentFileProgress.total - this.currentFileProgress.downloaded; - if (j < 0) { - j = 0; - } - this.currentFileProgress.downloaded += j; - if (z) { - this.sizeDownloaded += j; - } - } - } - - public void reportTotalDownloaded(long j) { - this.realDownloaded += j; - } -} diff --git a/app/src/main/java/com/eamobile/download/IZipExtractorEvent.java b/app/src/main/java/com/eamobile/download/IZipExtractorEvent.java deleted file mode 100644 index 6ed9be2..0000000 --- a/app/src/main/java/com/eamobile/download/IZipExtractorEvent.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.eamobile.download; - -/* loaded from: classes.dex */ -public interface IZipExtractorEvent { - void onExtractEntryFinish(); - - void onExtractEntryStart(String str, long j); - - void onReportDownload(int i); - - void onReportProgress(int i); -} diff --git a/app/src/main/java/com/eamobile/download/LocalZipExtractorEvent.java b/app/src/main/java/com/eamobile/download/LocalZipExtractorEvent.java deleted file mode 100644 index 4ac3313..0000000 --- a/app/src/main/java/com/eamobile/download/LocalZipExtractorEvent.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.eamobile.download; - -/* loaded from: classes.dex */ -public class LocalZipExtractorEvent implements IZipExtractorEvent { - @Override // com.eamobile.download.IZipExtractorEvent - public void onReportDownload(int i) { - } - - @Override // com.eamobile.download.IZipExtractorEvent - public void onReportProgress(int i) { - } - - @Override // com.eamobile.download.IZipExtractorEvent - public void onExtractEntryStart(String str, long j) { - Logging.DEBUG_OUT("LocalZipExtractorEvent.onExtractEntryStart"); - } - - @Override // com.eamobile.download.IZipExtractorEvent - public void onExtractEntryFinish() { - Logging.DEBUG_OUT("LocalZipExtractorEvent.onExtractEntryFinish"); - } -} diff --git a/app/src/main/java/com/eamobile/download/LockManager.java b/app/src/main/java/com/eamobile/download/LockManager.java deleted file mode 100644 index dd5dcb0..0000000 --- a/app/src/main/java/com/eamobile/download/LockManager.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.eamobile.download; - -import android.content.Context; -import android.net.wifi.WifiManager; -import android.os.PowerManager; - -/* loaded from: classes.dex */ -public class LockManager { - private static final String ADC_WAKE_LOCK_TAG = "ADCWakeLock"; - private static final String ADC_WIFI_LOCK_TAG = "ADCWifiLock"; - private Context context; - private WifiManager.WifiLock wifiLock; - private WifiManager wifiManager = null; - private PowerManager powerManager = null; - private PowerManager.WakeLock wakeLock = null; - - public LockManager(Context context) { - this.context = context; - } - - public boolean acquireWifiLock() { - try { - if (this.wifiManager == null) { - this.wifiManager = (WifiManager) this.context.getSystemService("wifi"); - } - if (this.wifiManager != null && this.wifiLock == null) { - this.wifiLock = this.wifiManager.createWifiLock(1, ADC_WIFI_LOCK_TAG); - } - if (this.wifiLock != null) { - if (!this.wifiLock.isHeld()) { - this.wifiLock.acquire(); - Logging.DEBUG_OUT("LockManager.acquireWifiLock() successfully called."); - return true; - } - Logging.DEBUG_OUT("LockManager.acquireWifiLock() - wifiLock already acquired."); - return false; - } - Logging.DEBUG_OUT("[ERROR] While acquiring WifiLock (LockManager.acquireWifiLock())."); - return false; - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred in LockManager.acquireWifiLock()."); - Logging.DEBUG_OUT_STACK(e); - return false; - } - } - - public void releaseWifiLock() { - if (this.wifiLock == null || !this.wifiLock.isHeld()) { - return; - } - this.wifiLock.release(); - this.wifiLock = null; - Logging.DEBUG_OUT("LockManager.releaseWifiLock() successfully called."); - } - - public boolean acquireWakeLock() { - try { - if (this.powerManager == null) { - this.powerManager = (PowerManager) this.context.getSystemService("power"); - } - if (this.powerManager != null && this.wakeLock == null) { - this.wakeLock = this.powerManager.newWakeLock(6, ADC_WAKE_LOCK_TAG); - } - if (this.wakeLock != null) { - if (!this.wakeLock.isHeld()) { - this.wakeLock.acquire(); - Logging.DEBUG_OUT("LockManager.acquireWakeLock() successfully called."); - return true; - } - Logging.DEBUG_OUT("LockManager.acquireWakeLock() - wakeLock already acquired."); - return false; - } - Logging.DEBUG_OUT("[ERROR] While acquiring WakeLock (LockManager.acquireWakeLock())."); - return false; - } catch (Exception e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred in LockManager.acquireWakeLock()."); - Logging.DEBUG_OUT_STACK(e); - return false; - } - } - - public void releaseWakeLock() { - if (this.wakeLock == null || !this.wakeLock.isHeld()) { - return; - } - this.wakeLock.release(); - this.wakeLock = null; - Logging.DEBUG_OUT("LockManager.releaseWakeLock() successfully called."); - } -} diff --git a/app/src/main/java/com/eamobile/download/Logging.java b/app/src/main/java/com/eamobile/download/Logging.java deleted file mode 100644 index 6467263..0000000 --- a/app/src/main/java/com/eamobile/download/Logging.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.eamobile.download; - -import android.os.Environment; -import android.util.Log; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.StringWriter; - -/* loaded from: classes.dex */ -public class Logging { - public static boolean DEBUG_ON; - static OutputStream out; - - public static void DEBUG_INIT() { - if (new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/debug.enable").exists()) { - DEBUG_ON = true; - DEBUG_OUT("*** WARNING: debug.enable found in SD card root, enabling debug output. ***"); - DEBUG_OUT("*** ADC-only debug output is saved in SD card root, under debug.txt file. ***"); - } - if (DEBUG_ON) { - try { - out = new FileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath() + "/debug.txt", true); - } catch (Throwable th) { - th.printStackTrace(); - } - } - } - - public static void DEBUG_OUT(String str) { - if (DEBUG_ON) { - Log.w("DownloadActivity", str); - try { - if (out != null) { - out.write((str + "\n").getBytes()); - } - } catch (IOException unused) { - } - } - } - - public static void DEBUG_OUT_STACK(Exception exc) { - StringWriter stringWriter = new StringWriter(); - exc.printStackTrace(new PrintWriter(stringWriter)); - DEBUG_OUT(stringWriter.toString()); - } - - public static void DEBUG_CLOSE() { - if (DEBUG_ON) { - try { - out.flush(); - out.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } -} diff --git a/app/src/main/java/com/eamobile/download/MemoryStatus.java b/app/src/main/java/com/eamobile/download/MemoryStatus.java deleted file mode 100644 index 70256ce..0000000 --- a/app/src/main/java/com/eamobile/download/MemoryStatus.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.eamobile.download; - -import android.os.Environment; -import android.os.StatFs; -import android.support.v4.media.session.PlaybackStateCompat; - -/* loaded from: classes.dex */ -public final class MemoryStatus { - static final int ERROR = -1; - - public static boolean externalMemoryAvailable() { - return Environment.getExternalStorageState().equals("mounted"); - } - - public static long getAvailableInternalMemorySize() { - StatFs statFs = new StatFs(Environment.getDataDirectory().getPath()); - return statFs.getAvailableBlocks() * statFs.getBlockSize(); - } - - public static long getTotalInternalMemorySize() { - StatFs statFs = new StatFs(Environment.getDataDirectory().getPath()); - return statFs.getBlockCount() * statFs.getBlockSize(); - } - - public static long getAvailableExternalMemorySize() { - if (!externalMemoryAvailable()) { - return -1L; - } - StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath()); - return statFs.getAvailableBlocks() * statFs.getBlockSize(); - } - - public static long getTotalExternalMemorySize() { - if (!externalMemoryAvailable()) { - return -1L; - } - StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath()); - return statFs.getBlockCount() * statFs.getBlockSize(); - } - - public static String formatSize(long j) { - String str; - if (j >= PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) { - str = "KiB"; - j /= PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID; - if (j >= PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) { - str = "MiB"; - j /= PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID; - } - } else { - str = null; - } - StringBuilder sb = new StringBuilder(Long.toString(j)); - for (int length = sb.length() - 3; length > 0; length -= 3) { - sb.insert(length, ','); - } - if (str != null) { - sb.append(str); - } - return sb.toString(); - } -} diff --git a/app/src/main/java/com/eamobile/download/RandomAccessFileReadThread.java b/app/src/main/java/com/eamobile/download/RandomAccessFileReadThread.java deleted file mode 100644 index 813a900..0000000 --- a/app/src/main/java/com/eamobile/download/RandomAccessFileReadThread.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.eamobile.download; - -import java.io.IOException; -import java.io.InputStream; -import java.io.RandomAccessFile; - -/* loaded from: classes.dex */ -public class RandomAccessFileReadThread extends Thread { - private DownloadProgress downloadProgress; - private RandomAccessFile file; - private InputStream in; - public boolean killMe = false; - public long timestamp = System.currentTimeMillis(); - public boolean reading = true; - private byte[] buffer = new byte[8192]; - public int sizeDownloaded = 0; - public int currentFileSize = 0; - - public RandomAccessFileReadThread(InputStream inputStream, RandomAccessFile randomAccessFile, DownloadProgress downloadProgress) { - this.in = inputStream; - this.file = randomAccessFile; - this.downloadProgress = downloadProgress; - } - - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - int i = 0; - while (i != -1) { - if (i != 0) { - try { - this.timestamp = System.currentTimeMillis(); - } catch (IOException e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred in RandomAccessFileReadThread: " + e); - } - } - i = this.in.read(this.buffer); - if (this.killMe) { - break; - } - if (i == 0) { - Logging.DEBUG_OUT("0 BYTES READ>>>"); - } else if (i > 0) { - this.file.write(this.buffer, 0, i); - this.sizeDownloaded += i; - this.downloadProgress.reportTotalDownloaded(i); - this.currentFileSize = ((int) this.file.getFilePointer()) - 1; - if (this.currentFileSize < 0) { - this.currentFileSize = 0; - } - } - } - this.reading = false; - } -} diff --git a/app/src/main/java/com/eamobile/download/ReadThread.java b/app/src/main/java/com/eamobile/download/ReadThread.java deleted file mode 100644 index e49d0f8..0000000 --- a/app/src/main/java/com/eamobile/download/ReadThread.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.eamobile.download; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -/* loaded from: classes.dex */ -class ReadThread extends Thread { - private float compRatio; - private InputStream in; - private OutputStream out; - private IZipExtractorEvent zipExtractorEvent; - public boolean killMe = false; - public long timestamp = System.currentTimeMillis(); - public boolean reading = true; - public volatile boolean pause = false; - private byte[] buffer = new byte[8192]; - public int sizeDownloaded = 0; - - public ReadThread(InputStream inputStream, OutputStream outputStream, float f, IZipExtractorEvent iZipExtractorEvent) { - this.compRatio = 0.0f; - this.in = inputStream; - this.out = outputStream; - this.compRatio = f; - this.zipExtractorEvent = iZipExtractorEvent; - } - - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - int i = 0; - while (i != -1) { - if (i != 0) { - try { - this.timestamp = System.currentTimeMillis(); - } catch (IOException e) { - Logging.DEBUG_OUT("[ERROR] An exception occurred in ReadThread: " + e); - } - } - if (this.killMe) { - break; - } - if (!this.pause) { - i = this.in.read(this.buffer); - if (i == 0) { - Logging.DEBUG_OUT("0 BYTES READ>>>"); - } else if (i > 0) { - this.out.write(this.buffer, 0, i); - this.sizeDownloaded += i; - this.zipExtractorEvent.onReportDownload(Math.round(i * this.compRatio)); - } - } - } - this.reading = false; - } -} diff --git a/app/src/main/java/com/eamobile/download/RemoteZipExtractorEvent.java b/app/src/main/java/com/eamobile/download/RemoteZipExtractorEvent.java deleted file mode 100644 index 812c8de..0000000 --- a/app/src/main/java/com/eamobile/download/RemoteZipExtractorEvent.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.eamobile.download; - -/* loaded from: classes.dex */ -public class RemoteZipExtractorEvent implements IZipExtractorEvent { - private DownloadProgress downloadProgress; - private DownloadFileData zipFileData; - - public RemoteZipExtractorEvent(DownloadProgress downloadProgress, DownloadFileData downloadFileData) { - this.downloadProgress = downloadProgress; - this.zipFileData = downloadFileData; - } - - @Override // com.eamobile.download.IZipExtractorEvent - public void onExtractEntryStart(String str, long j) { - Logging.DEBUG_OUT("RemoteZipExtractorEvent.onExtractEntryStart"); - this.downloadProgress.setCurrentFile("z_" + this.zipFileData.getFileName() + "_" + str, j); - } - - @Override // com.eamobile.download.IZipExtractorEvent - public void onExtractEntryFinish() { - Logging.DEBUG_OUT("RemoteZipExtractorEvent.onExtractEntryFinish"); - this.downloadProgress.fillCurrentFileDownload(true); - } - - @Override // com.eamobile.download.IZipExtractorEvent - public void onReportProgress(int i) { - this.downloadProgress.reportProgress(i, true); - } - - @Override // com.eamobile.download.IZipExtractorEvent - public void onReportDownload(int i) { - this.downloadProgress.reportTotalDownloaded(i); - } -} diff --git a/app/src/main/java/com/eamobile/download/SpeedCalculator.java b/app/src/main/java/com/eamobile/download/SpeedCalculator.java deleted file mode 100644 index 4398065..0000000 --- a/app/src/main/java/com/eamobile/download/SpeedCalculator.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.eamobile.download; - -/* loaded from: classes.dex */ -public class SpeedCalculator { - private float smoothingFactor; - private float currentAmount = 0.0f; - private float previousAmount = 0.0f; - private float currentTime = 0.0f; - private float previousTime = 0.0f; - private float averageSpeed = 0.0f; - private float currentSpeed = 0.0f; - - public SpeedCalculator(float f) { - this.smoothingFactor = 0.0f; - this.smoothingFactor = f; - } - - public void reportAmount(float f, float f2) { - this.currentAmount = f; - this.currentTime = f2; - float f3 = this.currentAmount - this.previousAmount; - float f4 = this.currentTime - this.previousTime; - this.previousAmount = this.currentAmount; - this.previousTime = this.currentTime; - float f5 = (this.smoothingFactor * this.currentSpeed) + ((1.0f - this.smoothingFactor) * this.averageSpeed); - if (!Float.isNaN(f5) && !Float.isInfinite(f5)) { - this.averageSpeed = f5; - } - if (f4 > 0.001f) { - this.currentSpeed = f3 / f4; - } - } - - public float getCurrentSpeed() { - return this.averageSpeed; - } - - public void forceAmount(float f) { - this.previousAmount = f; - } -} diff --git a/app/src/main/java/com/eamobile/download/ZipExtractor.java b/app/src/main/java/com/eamobile/download/ZipExtractor.java deleted file mode 100644 index 8aacd01..0000000 --- a/app/src/main/java/com/eamobile/download/ZipExtractor.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.eamobile.download; - -/* loaded from: classes.dex */ -public class ZipExtractor { - private static final int ERROR_ZIP_CHECKSUM_MATCH_FAILED = -4; - private static final int ERROR_ZIP_CHECKSUM_NOT_FOUND = -3; - private static final int ERROR_ZIP_EXCEPTION = -1; - private static final int ERROR_ZIP_NO_ENTRIES = -2; - private static final int NO_ZIP_ERRORS = 1; - private static boolean pause; - private static boolean pauseDirty; - private IZipExtractorEvent zipExtractorEvent; - - public static void setPause(boolean z) { - pause = z; - pauseDirty = true; - } - - /* JADX WARN: Removed duplicated region for block: B:60:0x0132 A[Catch: Exception -> 0x021b, TryCatch #2 {Exception -> 0x021b, blocks: (B:18:0x00fb, B:19:0x010e, B:21:0x0112, B:24:0x0125, B:27:0x0150, B:29:0x0154, B:30:0x017c, B:33:0x018f, B:35:0x019d, B:36:0x01a8, B:37:0x01ac, B:39:0x01b2, B:41:0x01c0, B:43:0x01c6, B:47:0x01d3, B:52:0x01d8, B:54:0x01a2, B:56:0x0206, B:58:0x0129, B:60:0x0132, B:62:0x013b), top: B:17:0x00fb, outer: #4, inners: #7 }] */ - /* JADX WARN: Removed duplicated region for block: B:63:0x013a */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public int extractFiles(java.io.InputStream r22, java.util.Hashtable r23, java.lang.String r24, int r25, com.eamobile.download.IZipExtractorEvent r26) { - /* - Method dump skipped, instructions count: 641 - To view this dump change 'Code comments level' option to 'DEBUG' - */ - throw new UnsupportedOperationException("Method not decompiled: com.eamobile.download.ZipExtractor.extractFiles(java.io.InputStream, java.util.Hashtable, java.lang.String, int, com.eamobile.download.IZipExtractorEvent):int"); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/ILicenseServerActivityCallback.java b/app/src/main/java/com/eamobile/licensing/ILicenseServerActivityCallback.java deleted file mode 100644 index 51ceb99..0000000 --- a/app/src/main/java/com/eamobile/licensing/ILicenseServerActivityCallback.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.eamobile.licensing; - -/* loaded from: classes.dex */ -public interface ILicenseServerActivityCallback { - void onLicenseResultEnd(); - - void onLicenseResultStart(); -} diff --git a/app/src/main/java/com/eamobile/licensing/LicenseServerActivity.java b/app/src/main/java/com/eamobile/licensing/LicenseServerActivity.java deleted file mode 100644 index a1002f3..0000000 --- a/app/src/main/java/com/eamobile/licensing/LicenseServerActivity.java +++ /dev/null @@ -1,264 +0,0 @@ -package com.eamobile.licensing; - -import android.app.Activity; -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.os.Handler; -import android.os.HandlerThread; -import com.android.vending.licensing.as; -import com.android.vending.licensing.bd; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; - -/* loaded from: classes.dex */ -public class LicenseServerActivity { - private static boolean H = false; - private static Activity I = null; - private static int N = -1; - private static int O = -1; - public static final String a = "com.android.vending.licensing.eapref"; - static final int l = -1; - static final int m = 13; - static final int n = 14; - static final int o = 15; - static final int p = 16; - static final int q = 17; - static final int r = 18; - static final int s = 19; - static final int t = 20; - static final int u = 21; - protected static final String v = "licenseserver/"; - protected static g w; - private static LicenseServerActivity z; - private r A; - private as B; - private String C; - private Context D; - private String E; - private b J; - private d K; - private a L; - private String M; - public q b; - public bd c; - byte[] d; - String e; - public String j; - private Handler F = null; - public Handler f = null; - Handler g = null; - public Handler h = null; - public Handler i = null; - private boolean G = false; - Bitmap k = null; - private String P = "en"; - ILicenseServerActivityCallback x = null; - ArrayList y = new ArrayList(); - - private LicenseServerActivity() { - } - - protected static Activity b() { - return I; - } - - private void g() { - if (this.B != null) { - this.B.a(); - this.B = null; - } - I = null; - z = null; - } - - public static LicenseServerActivity getInstance() { - if (z == null) { - z = new LicenseServerActivity(); - } - return z; - } - - private void h() { - if (this.L != null) { - this.L.b(); - } - if (this.K != null) { - this.K.b(); - } - } - - public boolean LastCheckPointCheck() { - return this.c.a().a().equals(this.M); - } - - public void a() { - this.f.post(new n(this)); - } - - /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */ - /* JADX WARN: Removed duplicated region for block: B:13:0x0025 A[Catch: Exception -> 0x0010, TryCatch #0 {Exception -> 0x0010, blocks: (B:10:0x000d, B:11:0x0021, B:13:0x0025, B:14:0x0031, B:17:0x0012, B:18:0x0018, B:19:0x001b, B:20:0x001e), top: B:6:0x0007 }] */ - /* - Code decompiled incorrectly, please refer to instructions dump. - To view partially-correct code enable 'Show inconsistent code' option in preferences - */ - public void a(int r3) { - /* - r2 = this; - int r0 = com.eamobile.licensing.LicenseServerActivity.O - if (r3 != r0) goto L5 - return - L5: - r0 = 15 - if (r3 == r0) goto L1e - r0 = 0 - switch(r3) { - case 19: goto L1b; - case 20: goto L18; - case 21: goto L12; - default: goto Ld; - } - Ld: - r2.J = r0 // Catch: java.lang.Exception -> L10 - goto L21 - L10: - r3 = move-exception - goto L38 - L12: - r2.J = r0 // Catch: java.lang.Exception -> L10 - r2.a() // Catch: java.lang.Exception -> L10 - goto L21 - L18: - com.eamobile.licensing.a r0 = r2.L // Catch: java.lang.Exception -> L10 - goto Ld - L1b: - com.eamobile.licensing.d r0 = r2.K // Catch: java.lang.Exception -> L10 - goto Ld - L1e: - com.eamobile.licensing.d r0 = r2.K // Catch: java.lang.Exception -> L10 - goto Ld - L21: - com.eamobile.licensing.b r0 = r2.J // Catch: java.lang.Exception -> L10 - if (r0 == 0) goto L31 - com.eamobile.licensing.b r0 = r2.J // Catch: java.lang.Exception -> L10 - r0.a() // Catch: java.lang.Exception -> L10 - android.app.Activity r0 = com.eamobile.licensing.LicenseServerActivity.I // Catch: java.lang.Exception -> L10 - com.eamobile.licensing.b r1 = r2.J // Catch: java.lang.Exception -> L10 - r0.setContentView(r1) // Catch: java.lang.Exception -> L10 - L31: - int r0 = com.eamobile.licensing.LicenseServerActivity.N // Catch: java.lang.Exception -> L10 - com.eamobile.licensing.LicenseServerActivity.O = r0 // Catch: java.lang.Exception -> L10 - com.eamobile.licensing.LicenseServerActivity.N = r3 // Catch: java.lang.Exception -> L10 - goto L4c - L38: - java.lang.StringBuilder r0 = new java.lang.StringBuilder - r0.() - java.lang.String r1 = "Exception in setState:" - r0.append(r1) - r0.append(r3) - java.lang.String r3 = r0.toString() - com.eamobile.licensing.z.a(r3) - L4c: - return - */ - throw new UnsupportedOperationException("Method not decompiled: com.eamobile.licensing.LicenseServerActivity.a(int):void"); - } - - protected void a(Context context) { - if (this.L == null) { - this.L = new a(context); - } - if (this.K == null) { - this.K = new d(context); - } - } - - public void c() { - } - - public int d() { - return N; - } - - public void destroyLicenseServerActvity() { - if (this.k != null) { - this.k.recycle(); - this.k = null; - } - h(); - H = false; - N = -1; - g(); - } - - protected int e() { - return O; - } - - protected void f() { - h(); - H = false; - N = -1; - g(); - } - - public void initLicenseServerActivity(Activity activity, ILicenseServerActivityCallback iLicenseServerActivityCallback, Context context, byte[] bArr, String str, String str2, String str3) { - if (this.G) { - return; - } - this.G = true; - this.M = str3; - if (this.M == null) { - this.M = "001"; - } - this.g = new h(this); - this.C = str2; - this.D = context; - this.d = bArr; - this.e = str; - this.F = new i(this); - this.h = new j(this); - this.i = new k(this); - HandlerThread handlerThread = new HandlerThread("waitting thread"); - handlerThread.start(); - this.f = new Handler(handlerThread.getLooper()); - h hVar = null; - this.b = new q(this, hVar); - this.A = new r(this, hVar); - this.y.add(new l(this)); - this.y.add(new m(this)); - this.f.post(new o(this)); - if (I == null) { - I = activity; - this.x = iLicenseServerActivityCallback; - } - try { - InputStream open = context.getAssets().open("licenseserver/title.png"); - if (open != null) { - this.k = Bitmap.createBitmap(BitmapFactory.decodeStream(open)); - open.close(); - } - z.a("CREATING BITMAP IMAGE"); - } catch (IOException unused) { - this.k = null; - } - if (w == null) { - w = new g(); - this.P = context.getResources().getConfiguration().locale.toString(); - String language = context.getResources().getConfiguration().locale.getLanguage(); - z.a("Locale>>>>>:" + this.P); - z.a("Language>>>>>:" + language); - if (!w.a(this.P) && !w.a(language)) { - this.P = "en"; - w.a("en"); - } - } - a(context); - if (H) { - return; - } - H = true; - a(20); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/a.java b/app/src/main/java/com/eamobile/licensing/a.java deleted file mode 100644 index c2b623e..0000000 --- a/app/src/main/java/com/eamobile/licensing/a.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.eamobile.licensing; - -import android.app.ProgressDialog; -import android.content.Context; -import android.view.View; - -/* loaded from: classes.dex */ -public class a extends b { - ProgressDialog a; - - public a(Context context) { - super(context); - this.b = context; - } - - private void a(View view) { - this.a = new com.a.a.h(this.b); - this.a.setCancelable(true); - this.a.setTitle(g.a(2)); - this.a.setMessage(g.a(3)); - this.a.setIndeterminate(true); - this.a.setCancelable(false); - this.a.show(); - } - - @Override // com.eamobile.licensing.b, com.eamobile.licensing.f - public void a() { - super.a(); - a(this); - } - - @Override // com.eamobile.licensing.b, com.eamobile.licensing.f - public void b() { - super.b(); - try { - this.a.dismiss(); - } catch (Exception unused) { - } - } - - @Override // android.view.View - protected void onWindowVisibilityChanged(int i) { - super.onWindowVisibilityChanged(i); - if (i == 8) { - this.a.cancel(); - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/b.java b/app/src/main/java/com/eamobile/licensing/b.java deleted file mode 100644 index ccb43ef..0000000 --- a/app/src/main/java/com/eamobile/licensing/b.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.eamobile.licensing; - -import android.content.Context; -import android.widget.Button; -import android.widget.LinearLayout; - -/* loaded from: classes.dex */ -public class b extends LinearLayout implements f { - protected static final float c = 16.0f; - protected Context b; - - public b(Context context) { - super(context); - this.b = context; - } - - public static Button a(Context context, LinearLayout linearLayout, String str) { - Button button = new Button(context); - button.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - button.setPadding(15, 15, 15, 15); - button.setTextSize(c); - button.setText(str); - linearLayout.addView(button); - return button; - } - - public void a() { - c(); - } - - public void b() { - } - - protected void c() { - setLayoutParams(new LinearLayout.LayoutParams(-1, -2)); - setOrientation(1); - setGravity(48); - setBackgroundDrawable(new c(this)); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/c.java b/app/src/main/java/com/eamobile/licensing/c.java deleted file mode 100644 index bb7e059..0000000 --- a/app/src/main/java/com/eamobile/licensing/c.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.eamobile.licensing; - -import android.graphics.Canvas; -import android.graphics.ColorFilter; -import android.graphics.Paint; -import android.graphics.drawable.Drawable; - -/* loaded from: classes.dex */ -class c extends Drawable { - final /* synthetic */ b a; - - c(b bVar) { - this.a = bVar; - } - - @Override // android.graphics.drawable.Drawable - public void draw(Canvas canvas) { - if (LicenseServerActivity.getInstance().k != null) { - canvas.drawBitmap(LicenseServerActivity.getInstance().k, (canvas.getWidth() - LicenseServerActivity.getInstance().k.getWidth()) >> 1, (canvas.getHeight() - LicenseServerActivity.getInstance().k.getHeight()) >> 1, (Paint) null); - } - } - - @Override // android.graphics.drawable.Drawable - public int getOpacity() { - return 0; - } - - @Override // android.graphics.drawable.Drawable - public void setAlpha(int i) { - } - - @Override // android.graphics.drawable.Drawable - public void setColorFilter(ColorFilter colorFilter) { - } -} diff --git a/app/src/main/java/com/eamobile/licensing/d.java b/app/src/main/java/com/eamobile/licensing/d.java deleted file mode 100644 index 754adca..0000000 --- a/app/src/main/java/com/eamobile/licensing/d.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.eamobile.licensing; - -import android.app.Dialog; -import android.content.Context; -import android.view.View; - -/* loaded from: classes.dex */ -public class d extends b { - Dialog a; - - public d(Context context) { - super(context); - this.b = context; - } - - private void a(View view) { - String a = g.a(1); - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - if (licenseServerActivity.j != null) { - a = a + " " + licenseServerActivity.j; - } - com.a.a.b bVar = new com.a.a.b(this.b); - bVar.b(a).a(g.a(3)).a(false).b(g.a(0), new e(this)); - bVar.b(); - } - - @Override // com.eamobile.licensing.b, com.eamobile.licensing.f - public void a() { - super.a(); - a(this); - } - - @Override // com.eamobile.licensing.b, com.eamobile.licensing.f - public void b() { - super.b(); - try { - this.a.dismiss(); - } catch (Exception unused) { - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/e.java b/app/src/main/java/com/eamobile/licensing/e.java deleted file mode 100644 index 7fea0ab..0000000 --- a/app/src/main/java/com/eamobile/licensing/e.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.eamobile.licensing; - -import android.content.DialogInterface; - -/* loaded from: classes.dex */ -class e implements DialogInterface.OnClickListener { - final /* synthetic */ d a; - - e(d dVar) { - this.a = dVar; - } - - @Override // android.content.DialogInterface.OnClickListener - public void onClick(DialogInterface dialogInterface, int i) { - try { - LicenseServerActivity.getInstance().a(); - } catch (Throwable unused) { - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/f.java b/app/src/main/java/com/eamobile/licensing/f.java deleted file mode 100644 index 2e7b3f8..0000000 --- a/app/src/main/java/com/eamobile/licensing/f.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.eamobile.licensing; - -/* loaded from: classes.dex */ -public interface f { - void a(); - - void b(); -} diff --git a/app/src/main/java/com/eamobile/licensing/g.java b/app/src/main/java/com/eamobile/licensing/g.java deleted file mode 100644 index f1de99a..0000000 --- a/app/src/main/java/com/eamobile/licensing/g.java +++ /dev/null @@ -1,199 +0,0 @@ -package com.eamobile.licensing; - -import java.io.DataInput; -import java.io.DataInputStream; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.Vector; - -/* loaded from: classes.dex */ -public class g { - public static final int a = 0; - public static final int b = 1; - public static final int c = 2; - public static final int d = 3; - public static final String[] e = new String[4]; - public static final int g = 2; - public static final int h = 1; - public static final char i = '\n'; - private static final int j = 4; - private static int l; - public final int f = 8096; - private String k; - - public static char a(DataInput dataInput) { - int readUnsignedByte; - if (l == 2) { - int readUnsignedShort = dataInput.readUnsignedShort(); - readUnsignedByte = ((readUnsignedShort & 255) << 8) | (readUnsignedShort >> 8); - } else { - readUnsignedByte = dataInput.readUnsignedByte(); - } - return (char) readUnsignedByte; - } - - public static String a(int i2) { - return a(i2, null); - } - - public static String a(int i2, String[] strArr) { - String str = e[i2]; - if (strArr != null) { - try { - if (strArr.length > 0) { - int i3 = 0; - while (str.indexOf("%%") != -1 && i3 < strArr.length) { - int indexOf = str.indexOf("%%"); - i3++; - str = str.substring(0, indexOf) + strArr[i3] + str.substring(indexOf + 2); - } - } - } catch (Exception e2) { - z.a("Exception e:" + e2); - } - } - return str; - } - - public static String a(DataInput dataInput, char c2, boolean z) { - StringBuffer stringBuffer = new StringBuffer(); - while (true) { - char a2 = a(dataInput); - if (a2 == c2) { - break; - } - stringBuffer.append(a2); - } - String stringBuffer2 = stringBuffer.toString(); - if (stringBuffer2 != null) { - return stringBuffer2.trim(); - } - return null; - } - - public static int b(String str) { - DataInputStream dataInputStream; - DataInputStream dataInputStream2 = null; - try { - try { - dataInputStream = new DataInputStream(LicenseServerActivity.b().getAssets().open(str)); - } catch (IOException unused) { - } catch (Throwable th) { - th = th; - } - try { - r0 = dataInputStream.readUnsignedShort() == 65534 ? 2 : 1; - dataInputStream.close(); - } catch (IOException unused2) { - dataInputStream2 = dataInputStream; - dataInputStream2.close(); - return r0; - } catch (Throwable th2) { - th = th2; - dataInputStream2 = dataInputStream; - try { - dataInputStream2.close(); - } catch (Exception unused3) { - } - throw th; - } - } catch (Exception unused4) { - } - return r0; - } - - public String a() { - return this.k; - } - - public boolean a(String str) { - InputStream inputStream; - if (str == null) { - return false; - } - String str2 = "licenseserver/" + str + ".txt"; - z.a("Opening file: " + str2); - InputStream inputStream2 = null; - try { - try { - inputStream = LicenseServerActivity.b().getAssets().open(str2); - } catch (FileNotFoundException unused) { - } catch (Exception e2) { - e = e2; - } - try { - try { - if (inputStream == null) { - z.a("Couldn't find file: " + str2); - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused2) { - } - } - return false; - } - Vector vector = new Vector(); - DataInputStream dataInputStream = new DataInputStream(inputStream); - l = b(str2); - if (l == 2) { - dataInputStream.skipBytes(2); - } - boolean z = true; - while (z) { - try { - vector.addElement(a(dataInputStream, '\n', true)); - } catch (Exception unused3) { - z = false; - } - } - for (int i2 = 0; i2 < e.length; i2++) { - e[i2] = ((String) vector.elementAt(i2)).toString(); - } - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused4) { - } - } - this.k = str; - return true; - } catch (FileNotFoundException unused5) { - inputStream2 = inputStream; - z.a("File not found: " + str2); - if (inputStream2 != null) { - try { - inputStream2.close(); - } catch (Exception unused6) { - } - } - return false; - } catch (Throwable th) { - th = th; - if (inputStream != null) { - try { - inputStream.close(); - } catch (Exception unused7) { - } - } - throw th; - } - } catch (Exception e3) { - e = e3; - inputStream2 = inputStream; - z.a("Exception caught: " + e); - if (inputStream2 != null) { - try { - inputStream2.close(); - } catch (Exception unused8) { - } - } - return false; - } - } catch (Throwable th2) { - th = th2; - inputStream = null; - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/h.java b/app/src/main/java/com/eamobile/licensing/h.java deleted file mode 100644 index 9597e66..0000000 --- a/app/src/main/java/com/eamobile/licensing/h.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.eamobile.licensing; - -import android.os.Handler; -import android.os.Message; - -/* loaded from: classes.dex */ -class h extends Handler { - final /* synthetic */ LicenseServerActivity a; - - h(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // android.os.Handler - public void handleMessage(Message message) { - r rVar; - try { - LicenseServerActivity licenseServerActivity = this.a; - rVar = this.a.A; - licenseServerActivity.a(rVar.a); - } catch (Exception unused) { - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/i.java b/app/src/main/java/com/eamobile/licensing/i.java deleted file mode 100644 index 0414001..0000000 --- a/app/src/main/java/com/eamobile/licensing/i.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.eamobile.licensing; - -import android.os.Handler; -import android.os.Message; - -/* loaded from: classes.dex */ -class i extends Handler { - final /* synthetic */ LicenseServerActivity a; - - i(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // android.os.Handler - public void handleMessage(Message message) { - try { - this.a.b.e(); - } catch (Exception unused) { - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/j.java b/app/src/main/java/com/eamobile/licensing/j.java deleted file mode 100644 index d28b4d4..0000000 --- a/app/src/main/java/com/eamobile/licensing/j.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.eamobile.licensing; - -import android.os.Handler; -import android.os.Message; - -/* loaded from: classes.dex */ -class j extends Handler { - final /* synthetic */ LicenseServerActivity a; - - j(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // android.os.Handler - public void handleMessage(Message message) { - try { - this.a.x.onLicenseResultStart(); - } catch (Exception unused) { - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/k.java b/app/src/main/java/com/eamobile/licensing/k.java deleted file mode 100644 index fcf8770..0000000 --- a/app/src/main/java/com/eamobile/licensing/k.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.eamobile.licensing; - -import android.os.Handler; -import android.os.Message; - -/* loaded from: classes.dex */ -class k extends Handler { - final /* synthetic */ LicenseServerActivity a; - - k(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // android.os.Handler - public void handleMessage(Message message) { - try { - this.a.x.onLicenseResultEnd(); - } catch (Exception unused) { - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/l.java b/app/src/main/java/com/eamobile/licensing/l.java deleted file mode 100644 index d808f69..0000000 --- a/app/src/main/java/com/eamobile/licensing/l.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.eamobile.licensing; - -/* loaded from: classes.dex */ -class l implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - l(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - if (licenseServerActivity.x != null) { - licenseServerActivity.i.sendEmptyMessage(1); - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/m.java b/app/src/main/java/com/eamobile/licensing/m.java deleted file mode 100644 index 18e265d..0000000 --- a/app/src/main/java/com/eamobile/licensing/m.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.eamobile.licensing; - -/* loaded from: classes.dex */ -class m implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - m(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - if (licenseServerActivity.x != null) { - licenseServerActivity.h.sendEmptyMessage(1); - } - } -} diff --git a/app/src/main/java/com/eamobile/licensing/n.java b/app/src/main/java/com/eamobile/licensing/n.java deleted file mode 100644 index 6cc2341..0000000 --- a/app/src/main/java/com/eamobile/licensing/n.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.eamobile.licensing; - -import android.os.Handler; - -/* loaded from: classes.dex */ -class n implements Runnable { - int a = 0; - final /* synthetic */ LicenseServerActivity b; - - n(LicenseServerActivity licenseServerActivity) { - this.b = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - Handler handler; - handler = this.b.F; - handler.sendEmptyMessage(1); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/o.java b/app/src/main/java/com/eamobile/licensing/o.java deleted file mode 100644 index 2ad3c7b..0000000 --- a/app/src/main/java/com/eamobile/licensing/o.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.eamobile.licensing; - -import android.os.Handler; - -/* loaded from: classes.dex */ -class o implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - o(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - String str; - Handler handler; - Runnable sVar; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - str = licenseServerActivity.M; - switch (str.hashCode() % 7) { - case 0: - handler = licenseServerActivity.f; - sVar = new s(this.a); - break; - case 1: - handler = licenseServerActivity.f; - sVar = new t(this.a); - break; - case 2: - handler = licenseServerActivity.f; - sVar = new u(this.a); - break; - case 3: - handler = licenseServerActivity.f; - sVar = new v(this.a); - break; - case 4: - handler = licenseServerActivity.f; - sVar = new w(this.a); - break; - case 5: - handler = licenseServerActivity.f; - sVar = new x(this.a); - break; - case 6: - handler = licenseServerActivity.f; - sVar = new y(this.a); - break; - default: - handler = licenseServerActivity.f; - sVar = new s(this.a); - break; - } - handler.post(sVar); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/p.java b/app/src/main/java/com/eamobile/licensing/p.java deleted file mode 100644 index 61288ad..0000000 --- a/app/src/main/java/com/eamobile/licensing/p.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.eamobile.licensing; - -import com.android.vending.licensing.as; - -/* loaded from: classes.dex */ -class p implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - p(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - as asVar; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - asVar = licenseServerActivity.B; - asVar.a(licenseServerActivity.b); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/q.java b/app/src/main/java/com/eamobile/licensing/q.java deleted file mode 100644 index 7f51a9f..0000000 --- a/app/src/main/java/com/eamobile/licensing/q.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.eamobile.licensing; - -import com.android.vending.licensing.aq; -import com.android.vending.licensing.ar; -import java.security.SecureRandom; - -/* loaded from: classes.dex */ -class q implements aq { - int a; - final /* synthetic */ LicenseServerActivity b; - - private q(LicenseServerActivity licenseServerActivity) { - this.b = licenseServerActivity; - this.a = 0; - } - - /* synthetic */ q(LicenseServerActivity licenseServerActivity, h hVar) { - this(licenseServerActivity); - } - - @Override // com.android.vending.licensing.aq - public void a() { - } - - @Override // com.android.vending.licensing.aq - public void a(ar arVar) { - r rVar; - this.a = 0; - rVar = this.b.A; - rVar.a = 19; - int ordinal = arVar.ordinal(); - int abs = (Math.abs(new SecureRandom().nextInt()) % 1000) + 1000; - LicenseServerActivity.getInstance().j = Integer.toString(abs) + Integer.toString(ordinal); - this.b.g.sendEmptyMessage(1); - } - - @Override // com.android.vending.licensing.aq - public void b() { - } - - @Override // com.android.vending.licensing.aq - public void c() { - String str; - String str2; - this.a = 1; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - str = licenseServerActivity.E; - str2 = licenseServerActivity.M; - if (str == str2) { - this.b.g.sendEmptyMessage(1); - } - } - - @Override // com.android.vending.licensing.aq - public void d() { - this.a = 0; - this.b.g.sendEmptyMessage(1); - } - - public void e() { - LicenseServerActivity.getInstance().f.post((Runnable) this.b.y.get(this.a)); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/r.java b/app/src/main/java/com/eamobile/licensing/r.java deleted file mode 100644 index 1e0ab4b..0000000 --- a/app/src/main/java/com/eamobile/licensing/r.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.eamobile.licensing; - -import com.android.vending.licensing.at; - -/* loaded from: classes.dex */ -class r implements at { - public int a; - final /* synthetic */ LicenseServerActivity b; - - private r(LicenseServerActivity licenseServerActivity) { - this.b = licenseServerActivity; - this.a = 21; - } - - /* synthetic */ r(LicenseServerActivity licenseServerActivity, h hVar) { - this(licenseServerActivity); - } - - @Override // com.android.vending.licensing.at - public void a() { - this.a = 15; - } - - @Override // com.android.vending.licensing.at - public void b() { - this.a = 15; - } - - @Override // com.android.vending.licensing.at - public void c() { - String str; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - str = licenseServerActivity.M; - licenseServerActivity.E = str; - } -} diff --git a/app/src/main/java/com/eamobile/licensing/s.java b/app/src/main/java/com/eamobile/licensing/s.java deleted file mode 100644 index b2db4f8..0000000 --- a/app/src/main/java/com/eamobile/licensing/s.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.eamobile.licensing; - -import android.content.Context; -import com.android.vending.licensing.au; -import com.android.vending.licensing.bd; - -/* loaded from: classes.dex */ -class s implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - s(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - Context context; - String str; - String str2; - r rVar; - Context context2; - String str3; - String str4; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - context = licenseServerActivity.D; - byte[] bArr = licenseServerActivity.d; - String str5 = licenseServerActivity.e; - str = licenseServerActivity.M; - com.android.vending.licensing.a aVar = new com.android.vending.licensing.a(bArr, str5, str); - str2 = licenseServerActivity.M; - rVar = licenseServerActivity.A; - licenseServerActivity.c = new au(context, aVar, str2, rVar); - context2 = licenseServerActivity.D; - bd bdVar = licenseServerActivity.c; - str3 = licenseServerActivity.C; - str4 = licenseServerActivity.M; - licenseServerActivity.B = new com.android.vending.licensing.o(context2, bdVar, str3, str4); - licenseServerActivity.f.post(new p(this.a)); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/t.java b/app/src/main/java/com/eamobile/licensing/t.java deleted file mode 100644 index 17d0c15..0000000 --- a/app/src/main/java/com/eamobile/licensing/t.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.eamobile.licensing; - -import android.content.Context; -import com.android.vending.licensing.av; -import com.android.vending.licensing.bd; - -/* loaded from: classes.dex */ -class t implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - t(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - Context context; - String str; - String str2; - r rVar; - Context context2; - String str3; - String str4; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - context = licenseServerActivity.D; - byte[] bArr = licenseServerActivity.d; - String str5 = licenseServerActivity.e; - str = licenseServerActivity.M; - com.android.vending.licensing.b bVar = new com.android.vending.licensing.b(bArr, str5, str); - str2 = licenseServerActivity.M; - rVar = licenseServerActivity.A; - licenseServerActivity.c = new av(context, bVar, str2, rVar); - context2 = licenseServerActivity.D; - bd bdVar = licenseServerActivity.c; - str3 = licenseServerActivity.C; - str4 = licenseServerActivity.M; - licenseServerActivity.B = new com.android.vending.licensing.s(context2, bdVar, str3, str4); - licenseServerActivity.f.post(new p(this.a)); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/u.java b/app/src/main/java/com/eamobile/licensing/u.java deleted file mode 100644 index c0c076e..0000000 --- a/app/src/main/java/com/eamobile/licensing/u.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.eamobile.licensing; - -import android.content.Context; -import com.android.vending.licensing.aw; -import com.android.vending.licensing.bd; - -/* loaded from: classes.dex */ -class u implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - u(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - Context context; - String str; - String str2; - r rVar; - Context context2; - String str3; - String str4; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - context = licenseServerActivity.D; - byte[] bArr = licenseServerActivity.d; - String str5 = licenseServerActivity.e; - str = licenseServerActivity.M; - com.android.vending.licensing.c cVar = new com.android.vending.licensing.c(bArr, str5, str); - str2 = licenseServerActivity.M; - rVar = licenseServerActivity.A; - licenseServerActivity.c = new aw(context, cVar, str2, rVar); - context2 = licenseServerActivity.D; - bd bdVar = licenseServerActivity.c; - str3 = licenseServerActivity.C; - str4 = licenseServerActivity.M; - licenseServerActivity.B = new com.android.vending.licensing.w(context2, bdVar, str3, str4); - licenseServerActivity.f.post(new p(this.a)); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/v.java b/app/src/main/java/com/eamobile/licensing/v.java deleted file mode 100644 index ff963bf..0000000 --- a/app/src/main/java/com/eamobile/licensing/v.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.eamobile.licensing; - -import android.content.Context; -import com.android.vending.licensing.aa; -import com.android.vending.licensing.ax; -import com.android.vending.licensing.bd; - -/* loaded from: classes.dex */ -class v implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - v(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - Context context; - String str; - String str2; - r rVar; - Context context2; - String str3; - String str4; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - context = licenseServerActivity.D; - byte[] bArr = licenseServerActivity.d; - String str5 = licenseServerActivity.e; - str = licenseServerActivity.M; - com.android.vending.licensing.d dVar = new com.android.vending.licensing.d(bArr, str5, str); - str2 = licenseServerActivity.M; - rVar = licenseServerActivity.A; - licenseServerActivity.c = new ax(context, dVar, str2, rVar); - context2 = licenseServerActivity.D; - bd bdVar = licenseServerActivity.c; - str3 = licenseServerActivity.C; - str4 = licenseServerActivity.M; - licenseServerActivity.B = new aa(context2, bdVar, str3, str4); - licenseServerActivity.f.post(new p(this.a)); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/w.java b/app/src/main/java/com/eamobile/licensing/w.java deleted file mode 100644 index 330cab8..0000000 --- a/app/src/main/java/com/eamobile/licensing/w.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.eamobile.licensing; - -import android.content.Context; -import com.android.vending.licensing.ae; -import com.android.vending.licensing.ay; -import com.android.vending.licensing.bd; - -/* loaded from: classes.dex */ -class w implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - w(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - Context context; - String str; - String str2; - r rVar; - Context context2; - String str3; - String str4; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - context = licenseServerActivity.D; - byte[] bArr = licenseServerActivity.d; - String str5 = licenseServerActivity.e; - str = licenseServerActivity.M; - com.android.vending.licensing.e eVar = new com.android.vending.licensing.e(bArr, str5, str); - str2 = licenseServerActivity.M; - rVar = licenseServerActivity.A; - licenseServerActivity.c = new ay(context, eVar, str2, rVar); - context2 = licenseServerActivity.D; - bd bdVar = licenseServerActivity.c; - str3 = licenseServerActivity.C; - str4 = licenseServerActivity.M; - licenseServerActivity.B = new ae(context2, bdVar, str3, str4); - licenseServerActivity.f.post(new p(this.a)); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/x.java b/app/src/main/java/com/eamobile/licensing/x.java deleted file mode 100644 index c2275e9..0000000 --- a/app/src/main/java/com/eamobile/licensing/x.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.eamobile.licensing; - -import android.content.Context; -import com.android.vending.licensing.ai; -import com.android.vending.licensing.az; -import com.android.vending.licensing.bd; - -/* loaded from: classes.dex */ -class x implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - x(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - Context context; - String str; - String str2; - r rVar; - Context context2; - String str3; - String str4; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - context = licenseServerActivity.D; - byte[] bArr = licenseServerActivity.d; - String str5 = licenseServerActivity.e; - str = licenseServerActivity.M; - com.android.vending.licensing.f fVar = new com.android.vending.licensing.f(bArr, str5, str); - str2 = licenseServerActivity.M; - rVar = licenseServerActivity.A; - licenseServerActivity.c = new az(context, fVar, str2, rVar); - context2 = licenseServerActivity.D; - bd bdVar = licenseServerActivity.c; - str3 = licenseServerActivity.C; - str4 = licenseServerActivity.M; - licenseServerActivity.B = new ai(context2, bdVar, str3, str4); - licenseServerActivity.f.post(new p(this.a)); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/y.java b/app/src/main/java/com/eamobile/licensing/y.java deleted file mode 100644 index 4eeed2d..0000000 --- a/app/src/main/java/com/eamobile/licensing/y.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.eamobile.licensing; - -import android.content.Context; -import com.android.vending.licensing.am; -import com.android.vending.licensing.ba; -import com.android.vending.licensing.bd; - -/* loaded from: classes.dex */ -class y implements Runnable { - final /* synthetic */ LicenseServerActivity a; - - y(LicenseServerActivity licenseServerActivity) { - this.a = licenseServerActivity; - } - - @Override // java.lang.Runnable - public void run() { - Context context; - String str; - String str2; - r rVar; - Context context2; - String str3; - String str4; - LicenseServerActivity licenseServerActivity = LicenseServerActivity.getInstance(); - context = licenseServerActivity.D; - byte[] bArr = licenseServerActivity.d; - String str5 = licenseServerActivity.e; - str = licenseServerActivity.M; - com.android.vending.licensing.g gVar = new com.android.vending.licensing.g(bArr, str5, str); - str2 = licenseServerActivity.M; - rVar = licenseServerActivity.A; - licenseServerActivity.c = new ba(context, gVar, str2, rVar); - context2 = licenseServerActivity.D; - bd bdVar = licenseServerActivity.c; - str3 = licenseServerActivity.C; - str4 = licenseServerActivity.M; - licenseServerActivity.B = new am(context2, bdVar, str3, str4); - licenseServerActivity.f.post(new p(this.a)); - } -} diff --git a/app/src/main/java/com/eamobile/licensing/z.java b/app/src/main/java/com/eamobile/licensing/z.java deleted file mode 100644 index fb49ebf..0000000 --- a/app/src/main/java/com/eamobile/licensing/z.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.eamobile.licensing; - -import android.os.Environment; -import android.util.Log; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; - -/* loaded from: classes.dex */ -public class z { - public static boolean a; - static OutputStream b; - - public static void a() { - if (a) { - try { - b = new FileOutputStream(Environment.getExternalStorageDirectory().getAbsolutePath() + "/debug.txt", true); - } catch (Throwable th) { - th.printStackTrace(); - } - } - } - - public static void a(String str) { - if (a) { - Log.w("DownloadActivity", str); - try { - b.write((str + "\n").getBytes()); - } catch (IOException unused) { - } - } - } - - public static void b() { - if (a) { - try { - b.flush(); - b.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } -} diff --git a/app/src/main/java/com/eamobile/views/CheckUpdatesView.java b/app/src/main/java/com/eamobile/views/CheckUpdatesView.java deleted file mode 100644 index 4dd4747..0000000 --- a/app/src/main/java/com/eamobile/views/CheckUpdatesView.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.app.ProgressDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.os.Handler; -import android.os.Message; -import android.view.KeyEvent; -import android.view.View; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; -import com.eamobile.download.Logging; - -/* loaded from: classes.dex */ -public class CheckUpdatesView extends CustomView { - protected static final int MSG_NO_UPDATES = 0; - protected static final int MSG_UPDATE_FOUND = 1; - Dialog dialog; - public Handler handler; - boolean updateFound; - - private void showContent(View view) { - } - - public CheckUpdatesView(Context context) { - super(context); - this.updateFound = false; - this.handler = new Handler() { // from class: com.eamobile.views.CheckUpdatesView.3 - @Override // android.os.Handler - public void handleMessage(Message message) { - if (message.what == 1) { - Logging.DEBUG_OUT("An update has been found"); - CheckUpdatesView.this.dialog.dismiss(); - if (DownloadActivityInternal.getMainActivity() != null) { - DownloadActivityInternal.getMainActivity().setState(9); - return; - } - return; - } - if (message.what == 0) { - Logging.DEBUG_OUT("No updates found"); - CheckUpdatesView.this.dialog.dismiss(); - if (DownloadActivityInternal.getMainActivity() != null) { - DownloadActivityInternal.getMainActivity().setState(11); - } - } - } - }; - this.context = context; - } - - /* JADX WARN: Type inference failed for: r0v3, types: [com.eamobile.views.CheckUpdatesView$2] */ - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - this.dialog = ProgressDialog.show(this.context, Language.getString(21), Language.getString(22), true); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.CheckUpdatesView.1 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - new Thread() { // from class: com.eamobile.views.CheckUpdatesView.2 - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - CheckUpdatesView.this.updateFound = DownloadActivityInternal.getMainActivity().checkForUpdates(); - if (CheckUpdatesView.this.updateFound) { - CheckUpdatesView.this.handler.sendEmptyMessage(1); - } else if (DownloadActivityInternal.getMainActivity() != null && DownloadActivityInternal.getMainActivity().checkScreenSizeChange()) { - CheckUpdatesView.this.handler.sendEmptyMessage(1); - } else { - CheckUpdatesView.this.handler.sendEmptyMessage(0); - } - } - }.start(); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - if (this.dialog != null) { - this.dialog.dismiss(); - } - } catch (Exception e) { - Logging.DEBUG_OUT("CheckUpdates View clean:" + e); - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } -} diff --git a/app/src/main/java/com/eamobile/views/CheckingHostIpView.java b/app/src/main/java/com/eamobile/views/CheckingHostIpView.java deleted file mode 100644 index 8d16ad8..0000000 --- a/app/src/main/java/com/eamobile/views/CheckingHostIpView.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.eamobile.views; - -import android.content.Context; - -/* loaded from: classes.dex */ -public class CheckingHostIpView extends CustomView { - public CheckingHostIpView(Context context) { - super(context); - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - } -} diff --git a/app/src/main/java/com/eamobile/views/ContactingServerView.java b/app/src/main/java/com/eamobile/views/ContactingServerView.java deleted file mode 100644 index cd31abf..0000000 --- a/app/src/main/java/com/eamobile/views/ContactingServerView.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.app.ProgressDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.os.Handler; -import android.os.Message; -import android.view.KeyEvent; -import android.view.View; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; -import com.eamobile.download.Logging; - -/* loaded from: classes.dex */ -public class ContactingServerView extends CustomView { - protected static final int MSG_DONE = 1; - Dialog dialog; - public Handler handler; - - private void showContent(View view) { - } - - public ContactingServerView(Context context) { - super(context); - this.handler = new Handler() { // from class: com.eamobile.views.ContactingServerView.3 - @Override // android.os.Handler - public void handleMessage(Message message) { - ContactingServerView.this.dialog.dismiss(); - } - }; - this.context = context; - } - - /* JADX WARN: Type inference failed for: r0v3, types: [com.eamobile.views.ContactingServerView$2] */ - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - this.dialog = ProgressDialog.show(this.context, Language.getString(37), Language.getString(38), true); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.ContactingServerView.1 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - new Thread() { // from class: com.eamobile.views.ContactingServerView.2 - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - DownloadActivityInternal.getMainActivity().checkServerContent(true); - ContactingServerView.this.handler.sendEmptyMessage(1); - } - }.start(); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - if (this.dialog != null) { - this.dialog.dismiss(); - } - } catch (Exception e) { - Logging.DEBUG_OUT("CheckUpdates View clean:" + e); - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } -} diff --git a/app/src/main/java/com/eamobile/views/CustomProgressBar.java b/app/src/main/java/com/eamobile/views/CustomProgressBar.java deleted file mode 100644 index d73a53a..0000000 --- a/app/src/main/java/com/eamobile/views/CustomProgressBar.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.eamobile.views; - -import android.content.Context; -import android.graphics.Canvas; -import android.graphics.Paint; -import android.graphics.RectF; -import android.support.v4.view.InputDeviceCompat; -import android.view.View; - -/* loaded from: classes.dex */ -public class CustomProgressBar extends View { - private Paint paint; - private float progress; - - public CustomProgressBar(Context context) { - super(context); - this.paint = new Paint(); - this.progress = 0.0f; - } - - public void setProgress(float f) { - if (f < 0.0f) { - f = 0.0f; - } - if (f > 1.0f) { - f = 1.0f; - } - this.progress = f; - } - - @Override // android.view.View - protected void onMeasure(int i, int i2) { - super.onMeasure(i, i2); - setMeasuredDimension(View.MeasureSpec.getSize(i), 34); - } - - @Override // android.view.View - public void onDraw(Canvas canvas) { - this.paint.setColor(-1); - this.paint.setStrokeWidth(0.0f); - this.paint.setAntiAlias(true); - this.paint.setStyle(Paint.Style.FILL); - this.paint.setARGB(180, 120, 120, 120); - canvas.drawRect(new RectF(10.0f, 1.0f, getWidth() - 10, 33.0f), this.paint); - this.paint.setStyle(Paint.Style.FILL); - this.paint.setColor(InputDeviceCompat.SOURCE_ANY); - canvas.drawRect(new RectF(11, 2.0f, ((int) Math.floor(((r0 - 1) - 11) * this.progress)) + 11, 32.0f), this.paint); - } -} diff --git a/app/src/main/java/com/eamobile/views/CustomProgressDialog.java b/app/src/main/java/com/eamobile/views/CustomProgressDialog.java deleted file mode 100644 index fb644db..0000000 --- a/app/src/main/java/com/eamobile/views/CustomProgressDialog.java +++ /dev/null @@ -1,335 +0,0 @@ -package com.eamobile.views; - -import android.app.AlertDialog; -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.view.KeyEvent; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; -import com.eamobile.download.ZipExtractor; -import java.io.IOException; -import java.io.InputStream; - -/* loaded from: classes.dex */ -public class CustomProgressDialog extends CustomView implements IProgressDialog { - private static final int WIFI_LAYOUT_ID = 90; - private static final int WIFI_LAYOUT_WIFI_TEXTVIEW_ID = 92; - private static final int WIFI_LAYOUT_WIFI_VIEW_ID = 91; - private static final int WIFI_LEVELS = 4; - private static final int WIFI_LEVELS_ENABLED = 3; - private static boolean alwaysSwitchTo3G = false; - private static boolean showDialogSwitchTo3G = false; - private static boolean wifiSwitchedTo3G = true; - private AlertDialog alertDialog; - private Bitmap[] bmpWifi; - private int[] connectionType; - private CustomProgressBar customProgressBar; - private Dialog dialog; - private boolean exitConfirmation; - private Boolean isLoadedBmpWifi; - private LinearLayout mainLayout; - private int max; - private int progress; - private float speed; - private TextView wifiTextView; - - public CustomProgressDialog(Context context) { - super(context); - this.exitConfirmation = false; - this.connectionType = new int[1]; - this.bmpWifi = null; - this.context = context; - this.dialog = null; - this.customProgressBar = null; - this.mainLayout = null; - this.progress = 0; - this.max = 0; - if (this.bmpWifi == null) { - this.bmpWifi = new Bitmap[4]; - } - for (int i = 0; i < 4; i++) { - try { - InputStream open = context.getAssets().open(DownloadActivityInternal.getResourcesPath() + "adc-wifi" + i + ".png"); - if (open != null) { - BitmapFactory.Options options = new BitmapFactory.Options(); - options.inTempStorage = new byte[4096]; - this.bmpWifi[i] = Bitmap.createBitmap(BitmapFactory.decodeStream(open, null, options)); - open.close(); - } - } catch (IOException unused) { - this.bmpWifi[i] = null; - } - } - this.isLoadedBmpWifi = true; - for (int i2 = 0; i2 < 4; i2++) { - this.isLoadedBmpWifi = Boolean.valueOf(this.isLoadedBmpWifi.booleanValue() && this.bmpWifi[i2] != null); - } - } - - @Override // com.eamobile.views.IProgressDialog - public void initDialog() { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(20)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setId(1); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 2, 10, 18); - textView.setTextSize(1, 16.0f); - textView.setText("..."); - scrollView.addView(textView); - this.customProgressBar = new CustomProgressBar(this.context); - linearLayout.addView(scrollView); - this.mainLayout.addView(this.customProgressBar); - this.mainLayout.addView(linearLayout); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setId(90); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(19); - if (this.isLoadedBmpWifi.booleanValue()) { - ImageView imageView = new ImageView(this.context); - imageView.setId(91); - imageView.setPadding(10, 0, 10, 10); - imageView.setImageBitmap(null); - imageView.setClickable(false); - linearLayout2.addView(imageView); - } - this.wifiTextView = new TextView(this.context); - this.wifiTextView.setId(92); - this.wifiTextView.setClickable(false); - this.wifiTextView.setCursorVisible(false); - this.wifiTextView.setTextSize(1, 16.0f); - if (!this.isLoadedBmpWifi.booleanValue()) { - this.wifiTextView.setPadding(10, 0, 10, 10); - } - linearLayout2.addView(this.wifiTextView); - this.mainLayout.addView(linearLayout2); - } - - @Override // com.eamobile.views.IProgressDialog - public void dismissDialog() { - if (this.isLoadedBmpWifi.booleanValue()) { - this.mainLayout.removeView((LinearLayout) this.dialog.findViewById(90)); - } - if (this.bmpWifi != null) { - for (int i = 0; i < 4; i++) { - if (this.bmpWifi[i] != null) { - this.bmpWifi[i].recycle(); - this.bmpWifi[i] = null; - } - } - this.bmpWifi = null; - } - this.wifiTextView = null; - if (this.alertDialog != null) { - this.alertDialog.dismiss(); - this.alertDialog = null; - this.exitConfirmation = false; - } - this.dialog.dismiss(); - } - - @Override // com.eamobile.views.IProgressDialog - public boolean isDialogValid() { - return this.dialog != null; - } - - @Override // com.eamobile.views.IProgressDialog - public void showDialogContent() { - if (this.dialog != null) { - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - updateWifiInfo(); - if (showDialogSwitchTo3G) { - ZipExtractor.setPause(true); - showDialogSwitchTo3G = false; - String string = Language.getString(46); - String string2 = Language.getString(47); - String string3 = Language.getString(48); - String string4 = Language.getString(49); - this.alertDialog = new AlertDialog.Builder(this.context).create(); - this.alertDialog.setCancelable(true); - this.alertDialog.setCanceledOnTouchOutside(false); - this.alertDialog.setMessage(string); - this.alertDialog.setButton(-1, string2, new DialogInterface.OnClickListener() { // from class: com.eamobile.views.CustomProgressDialog.1 - @Override // android.content.DialogInterface.OnClickListener - public void onClick(DialogInterface dialogInterface, int i) { - CustomProgressDialog.this.alertDialog.dismiss(); - CustomProgressDialog.this.alertDialog = null; - CustomProgressDialog.this.exitConfirmation = false; - CustomProgressDialog.this.showDialogContent(); - ZipExtractor.setPause(false); - } - }); - this.alertDialog.setButton(-3, string3, new DialogInterface.OnClickListener() { // from class: com.eamobile.views.CustomProgressDialog.2 - @Override // android.content.DialogInterface.OnClickListener - public void onClick(DialogInterface dialogInterface, int i) { - boolean unused = CustomProgressDialog.alwaysSwitchTo3G = true; - CustomProgressDialog.this.alertDialog.dismiss(); - CustomProgressDialog.this.alertDialog = null; - CustomProgressDialog.this.exitConfirmation = false; - CustomProgressDialog.this.showDialogContent(); - ZipExtractor.setPause(false); - } - }); - this.alertDialog.setButton(-2, string4, new DialogInterface.OnClickListener() { // from class: com.eamobile.views.CustomProgressDialog.3 - @Override // android.content.DialogInterface.OnClickListener - public void onClick(DialogInterface dialogInterface, int i) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.alertDialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.CustomProgressDialog.4 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84 || i == 4; - } - }); - this.alertDialog.show(); - this.exitConfirmation = true; - } - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.CustomProgressDialog.5 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.CustomProgressDialog.6 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - String string5 = Language.getString(41); - String string6 = Language.getString(17); - String string7 = Language.getString(18); - TextView textView = new TextView(CustomProgressDialog.this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setSingleLine(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 18.0f); - textView.setTextColor(-1); - textView.setText(string5); - CustomProgressDialog.this.alertDialog = new AlertDialog.Builder(CustomProgressDialog.this.context).create(); - CustomProgressDialog.this.alertDialog.setCancelable(true); - CustomProgressDialog.this.alertDialog.setCanceledOnTouchOutside(false); - CustomProgressDialog.this.alertDialog.setView(textView); - CustomProgressDialog.this.alertDialog.setButton(-1, string6, new DialogInterface.OnClickListener() { // from class: com.eamobile.views.CustomProgressDialog.6.1 - @Override // android.content.DialogInterface.OnClickListener - public void onClick(DialogInterface dialogInterface2, int i) { - dialogInterface2.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - CustomProgressDialog.this.alertDialog.setButton(-2, string7, new DialogInterface.OnClickListener() { // from class: com.eamobile.views.CustomProgressDialog.6.2 - @Override // android.content.DialogInterface.OnClickListener - public void onClick(DialogInterface dialogInterface2, int i) { - CustomProgressDialog.this.alertDialog.dismiss(); - CustomProgressDialog.this.alertDialog = null; - CustomProgressDialog.this.exitConfirmation = false; - CustomProgressDialog.this.showDialogContent(); - } - }); - CustomProgressDialog.this.alertDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.CustomProgressDialog.6.3 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface2) { - CustomProgressDialog.this.alertDialog.dismiss(); - CustomProgressDialog.this.alertDialog = null; - CustomProgressDialog.this.exitConfirmation = false; - CustomProgressDialog.this.showDialogContent(); - } - }); - CustomProgressDialog.this.alertDialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.CustomProgressDialog.6.4 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface2, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - CustomProgressDialog.this.alertDialog.show(); - CustomProgressDialog.this.exitConfirmation = true; - } - }); - } - if (this.alertDialog == null || !this.exitConfirmation) { - return; - } - this.alertDialog.show(); - this.dialog.hide(); - } - - @Override // com.eamobile.views.IProgressDialog - public void updateDialog() { - if (this.max > 0) { - this.customProgressBar.setProgress(this.progress / this.max); - this.customProgressBar.invalidate(); - int floor = (int) Math.floor(r0 * 100.0f); - String format = String.format("%.0f", Float.valueOf(this.speed)); - String replace = (floor + "% " + Language.getString(36)).replace("%1", "" + this.progress).replace("%2", "" + this.max).replace("%3", "" + format); - updateWifiInfo(); - ((TextView) this.dialog.findViewById(1)).setText(replace); - } - } - - @Override // com.eamobile.views.IProgressDialog - public void setDownloadProgress(int i) { - this.progress = i; - } - - @Override // com.eamobile.views.IProgressDialog - public void setDownloadMax(int i) { - this.max = i; - } - - @Override // com.eamobile.views.IProgressDialog - public void setDownloadSpeed(float f) { - this.speed = f; - } - - private void updateWifiInfo() { - if (((LinearLayout) this.dialog.findViewById(90)) == null || DownloadActivityInternal.getMainActivity() == null) { - return; - } - if (DownloadActivityInternal.getMainActivity().isWifiAvailable()) { - wifiSwitchedTo3G = false; - int wifiLevel = DownloadActivityInternal.getMainActivity().getWifiReceiver().getWifiLevel(); - String str = " " + Language.getString(16) + ": " + DownloadActivityInternal.getMainActivity().getWifiReceiver().getWifiName(); - if (!this.isLoadedBmpWifi.booleanValue()) { - str = str + " (" + Language.getString(35) + ": " + wifiLevel + "/3)"; - } else if (wifiLevel >= 0 && wifiLevel < 4) { - ((ImageView) this.dialog.findViewById(91)).setImageBitmap(this.bmpWifi[wifiLevel]); - } - this.wifiTextView.setText(str); - return; - } - int[] iArr = {-1}; - if (!alwaysSwitchTo3G && !wifiSwitchedTo3G && DownloadActivityInternal.getMainActivity().testNetwork(iArr) && iArr[0] == 0) { - wifiSwitchedTo3G = true; - showDialogSwitchTo3G = true; - showDialogContent(); - } - if (this.isLoadedBmpWifi.booleanValue()) { - ((ImageView) this.dialog.findViewById(91)).setImageBitmap(this.bmpWifi[0]); - } - this.wifiTextView.setText(Language.getString(16) + ": " + Language.getString(40)); - } -} diff --git a/app/src/main/java/com/eamobile/views/CustomView.java b/app/src/main/java/com/eamobile/views/CustomView.java deleted file mode 100644 index 71b0167..0000000 --- a/app/src/main/java/com/eamobile/views/CustomView.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.eamobile.views; - -import android.app.Activity; -import android.content.Context; -import android.graphics.Canvas; -import android.graphics.ColorFilter; -import android.graphics.Paint; -import android.graphics.drawable.Drawable; -import android.os.Handler; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; - -/* loaded from: classes.dex */ -public class CustomView extends LinearLayout implements IDownloadView { - protected static final float TEXT_BODY_SIZE = 16.0f; - protected static final float TEXT_TITLE_SIZE = 18.0f; - protected Context context; - protected Handler mHandler; - - public void clean() { - } - - public void pause() { - } - - public void resume() { - } - - public CustomView(Context context) { - super(context); - this.context = context; - } - - public void init() { - showBackground(); - ((Activity) this.context).getWindow().getDecorView().setSystemUiVisibility(5894); - } - - protected void showBackground() { - setLayoutParams(new LinearLayout.LayoutParams(-1, -2)); - setOrientation(1); - setGravity(48); - setBackgroundDrawable(new BackGround()); - } - - class BackGround extends Drawable { - @Override // android.graphics.drawable.Drawable - public int getOpacity() { - return 0; - } - - @Override // android.graphics.drawable.Drawable - public void setAlpha(int i) { - } - - @Override // android.graphics.drawable.Drawable - public void setColorFilter(ColorFilter colorFilter) { - } - - BackGround() { - } - - @Override // android.graphics.drawable.Drawable - public void draw(Canvas canvas) { - if (DownloadActivityInternal.getMainActivity() == null || DownloadActivityInternal.getMainActivity().getBackgroundBitmap() == null) { - return; - } - canvas.drawBitmap(DownloadActivityInternal.getMainActivity().getBackgroundBitmap(), (canvas.getWidth() - DownloadActivityInternal.getMainActivity().getBackgroundBitmap().getWidth()) >> 1, (canvas.getHeight() - DownloadActivityInternal.getMainActivity().getBackgroundBitmap().getHeight()) >> 1, (Paint) null); - } - } - - public static Button addButton(Context context, LinearLayout linearLayout, String str) { - Button button = new Button(context); - button.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - button.setPadding(15, 15, 15, 15); - button.setTextSize(1, TEXT_BODY_SIZE); - button.setText(str); - linearLayout.addView(button); - return button; - } - - public static TextView addTitle(Context context, LinearLayout linearLayout, String str) { - TextView textView = new TextView(context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setSingleLine(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, TEXT_TITLE_SIZE); - textView.setTextColor(-1); - textView.setText(str); - linearLayout.addView(textView); - return textView; - } -} diff --git a/app/src/main/java/com/eamobile/views/DefaultProgressDialog.java b/app/src/main/java/com/eamobile/views/DefaultProgressDialog.java deleted file mode 100644 index 3c090a8..0000000 --- a/app/src/main/java/com/eamobile/views/DefaultProgressDialog.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.eamobile.views; - -import android.app.ProgressDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; -import com.eamobile.download.Logging; -import java.lang.reflect.Method; - -/* loaded from: classes.dex */ -public class DefaultProgressDialog extends CustomView implements IProgressDialog { - private static Method mSetProgressNumberFormat; - private ProgressDialog dialog; - private int max; - private int progress; - private float speed; - - public DefaultProgressDialog(Context context) { - super(context); - this.context = context; - mSetProgressNumberFormat = null; - this.dialog = null; - this.progress = 0; - this.max = 0; - } - - @Override // com.eamobile.views.IProgressDialog - public void initDialog() { - try { - mSetProgressNumberFormat = ProgressDialog.class.getMethod("setProgressNumberFormat", String.class); - } catch (NoSuchMethodException unused) { - } - this.dialog = new ProgressDialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.setMessage(Language.getString(20)); - this.dialog.setProgressStyle(1); - this.dialog.setProgress(0); - } - - @Override // com.eamobile.views.IProgressDialog - public void dismissDialog() { - this.dialog.dismiss(); - } - - @Override // com.eamobile.views.IProgressDialog - public boolean isDialogValid() { - return this.dialog != null; - } - - @Override // com.eamobile.views.IProgressDialog - public void showDialogContent() { - if (this.dialog != null) { - this.dialog.show(); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.DefaultProgressDialog.1 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.DefaultProgressDialog.2 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - } - } - - @Override // com.eamobile.views.IProgressDialog - public void updateDialog() { - try { - if (mSetProgressNumberFormat != null) { - this.dialog.setMax(this.max); - try { - String format = String.format("%.0f", Float.valueOf(this.speed)); - mSetProgressNumberFormat.invoke(this.dialog, "%d MB of %d MB " + format + " Kb/s"); - this.dialog.setProgress(this.progress); - } catch (Exception unused) { - this.dialog.setProgress(DownloadActivityInternal.getMainActivity().getPercentDownloaded()); - } - } - } catch (Exception e) { - Logging.DEBUG_OUT("Exception here:" + e); - this.dialog.setProgress(DownloadActivityInternal.getMainActivity().getPercentDownloaded()); - } - } - - @Override // com.eamobile.views.IProgressDialog - public void setDownloadProgress(int i) { - this.progress = i; - } - - @Override // com.eamobile.views.IProgressDialog - public void setDownloadMax(int i) { - this.max = i; - } - - @Override // com.eamobile.views.IProgressDialog - public void setDownloadSpeed(float f) { - this.speed = f; - } -} diff --git a/app/src/main/java/com/eamobile/views/DeletingAssetsView.java b/app/src/main/java/com/eamobile/views/DeletingAssetsView.java deleted file mode 100644 index 68395de..0000000 --- a/app/src/main/java/com/eamobile/views/DeletingAssetsView.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.app.ProgressDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.os.Handler; -import android.os.Message; -import android.view.KeyEvent; -import android.view.View; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; -import com.eamobile.download.Logging; - -/* loaded from: classes.dex */ -public class DeletingAssetsView extends CustomView { - Dialog dialog; - public Handler handler; - boolean updateFound; - - private void showContent(View view) { - } - - public DeletingAssetsView(Context context) { - super(context); - this.updateFound = false; - this.handler = new Handler() { // from class: com.eamobile.views.DeletingAssetsView.3 - @Override // android.os.Handler - public void handleMessage(Message message) { - DeletingAssetsView.this.dialog.dismiss(); - if (DownloadActivityInternal.getMainActivity() != null) { - DownloadActivityInternal.getMainActivity().setState(1); - } - } - }; - this.context = context; - } - - /* JADX WARN: Type inference failed for: r0v3, types: [com.eamobile.views.DeletingAssetsView$2] */ - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - this.dialog = ProgressDialog.show(this.context, "", Language.getString(45), true); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.DeletingAssetsView.1 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - new Thread() { // from class: com.eamobile.views.DeletingAssetsView.2 - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - try { - Thread.sleep(300L); - } catch (InterruptedException e) { - Logging.DEBUG_OUT_STACK(e); - } - DownloadActivityInternal.getMainActivity().deleteAssets(); - DeletingAssetsView.this.handler.sendEmptyMessage(0); - } - }.start(); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - if (this.dialog != null) { - this.dialog.dismiss(); - } - } catch (Exception e) { - Logging.DEBUG_OUT("CheckUpdates View clean:" + e); - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } -} diff --git a/app/src/main/java/com/eamobile/views/DownloadFailedView.java b/app/src/main/java/com/eamobile/views/DownloadFailedView.java deleted file mode 100644 index bb87cb2..0000000 --- a/app/src/main/java/com/eamobile/views/DownloadFailedView.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.ADCTelemetry; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class DownloadFailedView extends CustomView { - Dialog dialog; - int errorCode; - Button lskBtn; - LinearLayout mainLayout; - - public DownloadFailedView(Context context) { - super(context); - this.errorCode = 0; - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - showContent(this); - } - - private void createContent(View view) { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(11)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - textView.setText(Language.getString(12, new String[]{"" + this.errorCode})); - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - this.lskBtn = addButton(this.context, linearLayout2, Language.getString(14)); - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - } - - private void showContent(View view) { - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.DownloadFailedView.1 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.lskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.DownloadFailedView.2 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - DownloadFailedView.this.dialog.dismiss(); - ADCTelemetry.getInstance().sendTelemetry(2); - DownloadActivityInternal.getMainActivity().setState(2); - } - }); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.DownloadFailedView.3 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - } - - public void setErrorCode(int i) { - this.errorCode = i; - } -} diff --git a/app/src/main/java/com/eamobile/views/DownloadMsgView.java b/app/src/main/java/com/eamobile/views/DownloadMsgView.java deleted file mode 100644 index 611a187..0000000 --- a/app/src/main/java/com/eamobile/views/DownloadMsgView.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.ADCTelemetry; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class DownloadMsgView extends CustomView { - Dialog dialog; - Button lskBtn; - LinearLayout mainLayout; - int spaceRequiredMB; - - public DownloadMsgView(Context context) { - super(context); - this.spaceRequiredMB = 0; - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } - - private void createContent(View view) { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(0)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - DownloadActivityInternal.getMainActivity(); - textView.setText(Language.getString(50, new String[]{DownloadActivityInternal.getMainActivity().getApplicationName(), DownloadActivityInternal.getTotalDownloadSizeMBString(), DownloadActivityInternal.getMainActivity().getSpaceRangeForDownload()})); - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - this.lskBtn = addButton(this.context, linearLayout2, Language.getString(5)); - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - ADCTelemetry.getInstance().sendTelemetry(0); - } - - private void showContent(View view) { - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.DownloadMsgView.1 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.lskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.DownloadMsgView.2 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - DownloadMsgView.this.dialog.dismiss(); - if (!DownloadActivityInternal.getMainActivity().chooseAvailableMemory()) { - DownloadActivityInternal.getMainActivity().setState(4); - } else { - DownloadActivityInternal.getMainActivity().startWifiDownload(false); - } - } - }); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.DownloadMsgView.3 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - } -} diff --git a/app/src/main/java/com/eamobile/views/DownloadProgressView.java b/app/src/main/java/com/eamobile/views/DownloadProgressView.java deleted file mode 100644 index d40df5e..0000000 --- a/app/src/main/java/com/eamobile/views/DownloadProgressView.java +++ /dev/null @@ -1,217 +0,0 @@ -package com.eamobile.views; - -import android.content.Context; -import android.os.Handler; -import android.os.Message; -import android.os.SystemClock; -import android.support.v4.media.session.PlaybackStateCompat; -import android.view.View; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.download.LockManager; -import com.eamobile.download.Logging; -import com.eamobile.download.SpeedCalculator; -import com.google.android.vending.expansion.downloader.Constants; -import java.util.Timer; -import java.util.TimerTask; - -/* loaded from: classes.dex */ -public class DownloadProgressView extends CustomView { - protected static final int MSG_DOWNLOAD_FAILURE = 2; - protected static final int MSG_DOWNLOAD_RETRY = 1; - public static boolean downloaded; - private static Timer t; - private LockManager lockManager; - private IProgressDialog progressDialog; - public Handler progressHandler; - private SpeedCalculator speedCalculator; - private float timeSeconds; - private RetryTimerTask timerTask; - - public DownloadProgressView(Context context) { - super(context); - this.speedCalculator = null; - this.timeSeconds = 0.0f; - this.progressHandler = new Handler() { // from class: com.eamobile.views.DownloadProgressView.2 - @Override // android.os.Handler - public void handleMessage(Message message) { - try { - if (DownloadActivityInternal.getMainActivity() == null || !DownloadActivityInternal.isInitialized()) { - return; - } - int totalDownloadSizeMB = DownloadActivityInternal.getTotalDownloadSizeMB(); - int sizeDownloaded = (int) ((DownloadActivityInternal.getSizeDownloaded() / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID) / PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID); - DownloadActivityInternal.setFlagLastReportDownload(true); - if (totalDownloadSizeMB > 0) { - if (DownloadProgressView.this.speedCalculator == null) { - Logging.DEBUG_OUT("DownloadProgressView: creating a new SpeedCalculator"); - DownloadProgressView.this.speedCalculator = new SpeedCalculator(0.05f); - DownloadProgressView.this.timeSeconds = SystemClock.uptimeMillis() / 1000.0f; - } else { - DownloadProgressView.this.speedCalculator.reportAmount(DownloadActivityInternal.getRealDownloaded() / 1024.0f, (SystemClock.uptimeMillis() / 1000.0f) - DownloadProgressView.this.timeSeconds); - } - DownloadProgressView.this.progressDialog.setDownloadMax(totalDownloadSizeMB); - DownloadProgressView.this.progressDialog.setDownloadProgress(sizeDownloaded); - DownloadProgressView.this.progressDialog.setDownloadSpeed(DownloadProgressView.this.speedCalculator.getCurrentSpeed()); - DownloadProgressView.this.progressDialog.updateDialog(); - } - if (DownloadActivityInternal.getMainActivity().getPercentDownloaded() >= 100 && DownloadProgressView.downloaded) { - Logging.DEBUG_OUT("Going to State SUCCESS"); - DownloadProgressView.this.progressDialog.dismissDialog(); - DownloadActivityInternal.getMainActivity().setState(11); - } else { - if (message.what == 1 && !DownloadProgressView.downloaded) { - Logging.DEBUG_OUT("Going to State RETRY"); - Timer unused = DownloadProgressView.t = new Timer(); - DownloadProgressView.this.timerTask = DownloadProgressView.this.new RetryTimerTask(); - DownloadProgressView.t.schedule(DownloadProgressView.this.timerTask, 0L, Constants.ACTIVE_THREAD_WATCHDOG); - return; - } - if (message.what == 2) { - Logging.DEBUG_OUT("Going to State FAILURE"); - DownloadProgressView.this.progressDialog.dismissDialog(); - DownloadActivityInternal.getMainActivity().setState(5); - } - } - } catch (Exception e) { - Logging.DEBUG_OUT("Exception here:" + e + ",DownloadActivityInternal.getMainActivity():" + DownloadActivityInternal.getMainActivity()); - Logging.DEBUG_OUT_STACK(e); - } - } - }; - Logging.DEBUG_OUT("DownloadProgressView constructor"); - this.context = context; - this.lockManager = new LockManager(context); - } - - @Override // com.eamobile.views.CustomView - public void pause() { - Logging.DEBUG_OUT("DownloadProgressView pause"); - if (!DownloadActivityInternal.getForceWakeDuringDownload() || this.lockManager == null) { - return; - } - this.lockManager.releaseWakeLock(); - } - - @Override // com.eamobile.views.CustomView - public void resume() { - Logging.DEBUG_OUT("DownloadProgressView resume"); - if (this.progressDialog == null || !this.progressDialog.isDialogValid()) { - return; - } - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - Logging.DEBUG_OUT("DownloadProgressView init"); - if (DownloadActivityInternal.getMainActivity().useCustomProgressBar() && !DownloadActivityInternal.getMainActivity().useOldProgressBar()) { - this.progressDialog = new CustomProgressDialog(this.context); - } else { - this.progressDialog = new DefaultProgressDialog(this.context); - } - this.progressDialog.initDialog(); - new Thread(new Runnable() { // from class: com.eamobile.views.DownloadProgressView.1 - /* JADX WARN: Type inference failed for: r0v3, types: [com.eamobile.views.DownloadProgressView$1$1] */ - @Override // java.lang.Runnable - public void run() { - try { - DownloadProgressView.downloaded = false; - new Thread() { // from class: com.eamobile.views.DownloadProgressView.1.1 - @Override // java.lang.Thread, java.lang.Runnable - public void run() { - Logging.DEBUG_OUT("STARTING A NEW DOWNLOAD >>>>>>>"); - DownloadProgressView.downloaded = DownloadActivityInternal.getMainActivity().startDownload(); - Logging.DEBUG_OUT("DOWNLOADED in PROGRESS VIEW:" + DownloadProgressView.downloaded); - if (DownloadProgressView.downloaded || DownloadActivityInternal.getMainActivity() == null) { - return; - } - Logging.DEBUG_OUT("Failed to download assets. Internal state: " + DownloadActivityInternal.getMainActivity().getStateName()); - if (DownloadProgressView.this.encounteredFatalDownloadError()) { - return; - } - DownloadProgressView.this.progressHandler.sendEmptyMessage(1); - } - }.start(); - Logging.DEBUG_OUT("DownloadProgressView before background loop downloaded=" + DownloadProgressView.downloaded); - while (!DownloadProgressView.downloaded && DownloadActivityInternal.isInitialized()) { - Thread.sleep(100L); - DownloadProgressView.this.progressHandler.sendMessage(DownloadProgressView.this.progressHandler.obtainMessage()); - } - } catch (Exception e) { - Logging.DEBUG_OUT("DownloadProgressView init Exception:" + e); - } - } - }).start(); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - Logging.DEBUG_OUT("DownloadProgressView clean"); - try { - if (this.progressDialog != null && this.progressDialog.isDialogValid()) { - this.progressDialog.dismissDialog(); - } - } catch (Exception e) { - Logging.DEBUG_OUT("DownloadProgressView Clean Exception:" + e); - } - if (this.lockManager != null) { - this.lockManager.releaseWifiLock(); - } - if (!DownloadActivityInternal.getForceWakeDuringDownload() || this.lockManager == null) { - return; - } - this.lockManager.releaseWakeLock(); - } - - private void showContent(View view) { - Logging.DEBUG_OUT("DownloadProgressView showContent"); - this.progressDialog.showDialogContent(); - if (this.lockManager != null) { - this.lockManager.acquireWifiLock(); - } - if (!DownloadActivityInternal.getForceWakeDuringDownload() || this.lockManager == null) { - return; - } - this.lockManager.acquireWakeLock(); - } - - public boolean encounteredFatalDownloadError() { - int state = DownloadActivityInternal.getMainActivity().getState(); - return state == 12 || state == 13; - } - - class RetryTimerTask extends TimerTask { - static final int QTY_RETRY = 10; - int numTries = 10; - - RetryTimerTask() { - } - - @Override // java.util.TimerTask, java.lang.Runnable - public void run() { - Logging.DEBUG_OUT("Attempting to download assets (attempt " + (10 - this.numTries) + "/10) in RetryTimerTask"); - if (this.numTries > 0) { - DownloadProgressView.this.progressHandler.sendEmptyMessage(0); - if (DownloadActivityInternal.getMainActivity().startDownload()) { - Logging.DEBUG_OUT("Download: Successful (in RetryTimerTask, after " + (10 - this.numTries) + " attempt(s))."); - DownloadProgressView.t.cancel(); - DownloadProgressView.downloaded = true; - this.numTries = 0; - } else if (DownloadActivityInternal.getMainActivity() != null && DownloadProgressView.this.encounteredFatalDownloadError()) { - DownloadProgressView.t.cancel(); - DownloadProgressView.this.progressHandler.sendEmptyMessage(2); - this.numTries = 0; - } - this.numTries--; - return; - } - Logging.DEBUG_OUT("Download: Failed (in RetryTimerTask)."); - DownloadProgressView.t.cancel(); - DownloadProgressView.this.progressHandler.sendEmptyMessage(2); - this.numTries = 0; - } - } -} diff --git a/app/src/main/java/com/eamobile/views/IDownloadView.java b/app/src/main/java/com/eamobile/views/IDownloadView.java deleted file mode 100644 index f31377a..0000000 --- a/app/src/main/java/com/eamobile/views/IDownloadView.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.eamobile.views; - -/* loaded from: classes.dex */ -public interface IDownloadView { - void clean(); - - void init(); -} diff --git a/app/src/main/java/com/eamobile/views/IProgressDialog.java b/app/src/main/java/com/eamobile/views/IProgressDialog.java deleted file mode 100644 index aa443df..0000000 --- a/app/src/main/java/com/eamobile/views/IProgressDialog.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.eamobile.views; - -/* loaded from: classes.dex */ -public interface IProgressDialog { - void dismissDialog(); - - void initDialog(); - - boolean isDialogValid(); - - void setDownloadMax(int i); - - void setDownloadProgress(int i); - - void setDownloadSpeed(float f); - - void showDialogContent(); - - void updateDialog(); -} diff --git a/app/src/main/java/com/eamobile/views/InvalidAssetVersionView.java b/app/src/main/java/com/eamobile/views/InvalidAssetVersionView.java deleted file mode 100644 index c943e7f..0000000 --- a/app/src/main/java/com/eamobile/views/InvalidAssetVersionView.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class InvalidAssetVersionView extends CustomView { - Dialog dialog; - Button exitBtn; - LinearLayout mainLayout; - - public InvalidAssetVersionView(Context context) { - super(context); - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } - - private void createContent(View view) { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(42)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - textView.setText(Language.getString(43)); - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - this.exitBtn = addButton(this.context, linearLayout2, Language.getString(6)); - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - } - - private void showContent(View view) { - this.exitBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.InvalidAssetVersionView.1 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - InvalidAssetVersionView.this.dialog.dismiss(); - try { - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } catch (Throwable unused) { - } - } - }); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.InvalidAssetVersionView.2 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.InvalidAssetVersionView.3 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - } -} diff --git a/app/src/main/java/com/eamobile/views/NetworkUnavailableView.java b/app/src/main/java/com/eamobile/views/NetworkUnavailableView.java deleted file mode 100644 index 26bdcc2..0000000 --- a/app/src/main/java/com/eamobile/views/NetworkUnavailableView.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class NetworkUnavailableView extends CustomView { - Dialog dialog; - Button lskBtn; - LinearLayout mainLayout; - Button rskBtn; - - public NetworkUnavailableView(Context context) { - super(context); - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - private void createContent(View view) { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(9)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - textView.setText(Language.getString(10)); - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - this.lskBtn = addButton(this.context, linearLayout2, Language.getString(16)); - this.rskBtn = addButton(this.context, linearLayout2, Language.getString(6)); - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - } - - private void showContent(View view) { - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.NetworkUnavailableView.1 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.lskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.NetworkUnavailableView.2 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - NetworkUnavailableView.this.dialog.dismiss(); - DownloadActivityInternal.getMainActivity().startWifiManager(); - if (DownloadActivityInternal.getMainActivity().isWifiAvailable()) { - DownloadActivityInternal.getMainActivity().setState(2); - } else { - DownloadActivityInternal.getMainActivity().setState(6); - } - } - }); - this.rskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.NetworkUnavailableView.3 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - NetworkUnavailableView.this.dialog.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.NetworkUnavailableView.4 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - } -} diff --git a/app/src/main/java/com/eamobile/views/ServerErrorView.java b/app/src/main/java/com/eamobile/views/ServerErrorView.java deleted file mode 100644 index 10b14be..0000000 --- a/app/src/main/java/com/eamobile/views/ServerErrorView.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class ServerErrorView extends CustomView { - Dialog dialog; - int errorCode; - Button lskBtn; - LinearLayout mainLayout; - - public ServerErrorView(Context context) { - super(context); - this.errorCode = 0; - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } - - private void createContent(View view) { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(33)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - textView.setText(Language.getString(34, new String[]{"" + this.errorCode})); - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - this.lskBtn = addButton(this.context, linearLayout2, Language.getString(6)); - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - } - - private void showContent(View view) { - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.ServerErrorView.1 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.lskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.ServerErrorView.2 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - ServerErrorView.this.dialog.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.ServerErrorView.3 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - } - - public void setErrorCode(int i) { - this.errorCode = i; - } -} diff --git a/app/src/main/java/com/eamobile/views/Show3GView.java b/app/src/main/java/com/eamobile/views/Show3GView.java deleted file mode 100644 index ef7e3ce..0000000 --- a/app/src/main/java/com/eamobile/views/Show3GView.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class Show3GView extends CustomView { - Dialog dialog; - Button lskBtn; - LinearLayout mainLayout; - Button rskBtn; - - public Show3GView(Context context) { - super(context); - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } - - private void createContent(View view) { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(39)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - textView.setText(Language.getString(24) + " " + Language.getString(29)); - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - this.lskBtn = addButton(this.context, linearLayout2, Language.getString(17)); - this.rskBtn = addButton(this.context, linearLayout2, Language.getString(6)); - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - } - - private void showContent(View view) { - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.Show3GView.1 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().setState(6); - } - }); - this.lskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.Show3GView.2 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - Show3GView.this.dialog.dismiss(); - if (!DownloadActivityInternal.getMainActivity().test3GNetwork()) { - DownloadActivityInternal.getMainActivity().setState(7); - } else if (DownloadActivityInternal.getTotalDownloadSizeMB() != 0) { - DownloadActivityInternal.getMainActivity().setState(2); - } else { - DownloadActivityInternal.getMainActivity().setState(14); - } - } - }); - this.rskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.Show3GView.3 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - Show3GView.this.dialog.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.Show3GView.4 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - } -} diff --git a/app/src/main/java/com/eamobile/views/ShowBGView.java b/app/src/main/java/com/eamobile/views/ShowBGView.java deleted file mode 100644 index 17639c5..0000000 --- a/app/src/main/java/com/eamobile/views/ShowBGView.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.eamobile.views; - -import android.content.Context; -import android.os.CountDownTimer; -import android.view.View; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.download.Logging; - -/* loaded from: classes.dex */ -public class ShowBGView extends CustomView { - public ShowBGView(Context context) { - super(context); - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - Logging.DEBUG_OUT("ShowBGView.init: before calling showContent"); - showContent(this); - Logging.DEBUG_OUT("ShowBGView.init: after calling showContent"); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - } - - @Override // com.eamobile.views.CustomView - public void resume() { - Logging.DEBUG_OUT("ShowBGView.resume"); - } - - private void showContent(View view) { - new CountDownTimer(1000L, 100L) { // from class: com.eamobile.views.ShowBGView.1 - @Override // android.os.CountDownTimer - public void onTick(long j) { - } - - @Override // android.os.CountDownTimer - public void onFinish() { - if (DownloadActivityInternal.getMainActivity() != null) { - DownloadActivityInternal.getMainActivity().setState(3); - } - } - }.start(); - } -} diff --git a/app/src/main/java/com/eamobile/views/ShowWifiView.java b/app/src/main/java/com/eamobile/views/ShowWifiView.java deleted file mode 100644 index 6ad6a05..0000000 --- a/app/src/main/java/com/eamobile/views/ShowWifiView.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class ShowWifiView extends CustomView { - Dialog dialog; - Button lskBtn; - LinearLayout mainLayout; - Button midBtn; - Button rskBtn; - - public ShowWifiView(Context context) { - super(context); - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } - - private void createContent(View view) { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(7)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - if (DownloadActivityInternal.getMainActivity().isAmazonDevice()) { - textView.setText(Language.getString(32)); - } else if (DownloadActivityInternal.getMainActivity().is3GDisabled()) { - textView.setText(Language.getString(8)); - } else { - textView.setText(Language.getString(8) + " " + Language.getString(31)); - } - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - if (!DownloadActivityInternal.getMainActivity().isAmazonDevice()) { - this.lskBtn = addButton(this.context, linearLayout2, Language.getString(16)); - if (!DownloadActivityInternal.getMainActivity().is3GDisabled()) { - this.midBtn = addButton(this.context, linearLayout2, Language.getString(23)); - } - } - this.rskBtn = addButton(this.context, linearLayout2, Language.getString(6)); - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - } - - private void showContent(View view) { - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.ShowWifiView.1 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.ShowWifiView.2 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().setState(1); - } - }); - if (!DownloadActivityInternal.getMainActivity().isAmazonDevice()) { - this.lskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.ShowWifiView.3 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - ShowWifiView.this.dialog.dismiss(); - DownloadActivityInternal.getMainActivity().startWifiManager(); - } - }); - if (!DownloadActivityInternal.getMainActivity().is3GDisabled()) { - this.midBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.ShowWifiView.4 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - ShowWifiView.this.dialog.dismiss(); - DownloadActivityInternal.getMainActivity().setState(10); - } - }); - } - } - this.rskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.ShowWifiView.5 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - ShowWifiView.this.dialog.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - } -} diff --git a/app/src/main/java/com/eamobile/views/SpaceUnavailableView.java b/app/src/main/java/com/eamobile/views/SpaceUnavailableView.java deleted file mode 100644 index 99e99a7..0000000 --- a/app/src/main/java/com/eamobile/views/SpaceUnavailableView.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class SpaceUnavailableView extends CustomView { - Dialog dialog; - Button lskBtn; - LinearLayout mainLayout; - Button rskBtn; - - public SpaceUnavailableView(Context context) { - super(context); - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } - - private void createContent(View view) { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(3)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - textView.setText(Language.getString(51, new String[]{DownloadActivityInternal.getMainActivity().getRequiredSpaceForDownload(), DownloadActivityInternal.getMainActivity().getAvailableSpaceForDownload()})); - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - if (DownloadActivityInternal.getMainActivity().canOpenStorageSettings()) { - this.lskBtn = addButton(this.context, linearLayout2, Language.getString(2)); - } - this.rskBtn = addButton(this.context, linearLayout2, Language.getString(6)); - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - } - - private void showContent(View view) { - this.rskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.SpaceUnavailableView.1 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - SpaceUnavailableView.this.dialog.dismiss(); - try { - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } catch (Throwable unused) { - } - } - }); - if (DownloadActivityInternal.getMainActivity().canOpenStorageSettings()) { - this.lskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.SpaceUnavailableView.2 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - SpaceUnavailableView.this.dialog.dismiss(); - try { - DownloadActivityInternal.getMainActivity().startDataManagement(); - } catch (Throwable unused) { - } - } - }); - } - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.SpaceUnavailableView.3 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.SpaceUnavailableView.4 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - } -} diff --git a/app/src/main/java/com/eamobile/views/UnSupportedDeviceView.java b/app/src/main/java/com/eamobile/views/UnSupportedDeviceView.java deleted file mode 100644 index 03356c9..0000000 --- a/app/src/main/java/com/eamobile/views/UnSupportedDeviceView.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class UnSupportedDeviceView extends CustomView { - Dialog dialog; - Button lskBtn; - LinearLayout mainLayout; - - public UnSupportedDeviceView(Context context) { - super(context); - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } - - private void createContent(View view) { - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(27)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - textView.setText(Language.getString(28)); - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - this.lskBtn = addButton(this.context, linearLayout2, Language.getString(6)); - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - } - - private void showContent(View view) { - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.UnSupportedDeviceView.1 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.lskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.UnSupportedDeviceView.2 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - UnSupportedDeviceView.this.dialog.dismiss(); - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - }); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.UnSupportedDeviceView.3 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84; - } - }); - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - } -} diff --git a/app/src/main/java/com/eamobile/views/UpdatesFoundView.java b/app/src/main/java/com/eamobile/views/UpdatesFoundView.java deleted file mode 100644 index bce7ebc..0000000 --- a/app/src/main/java/com/eamobile/views/UpdatesFoundView.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.eamobile.views; - -import android.app.Dialog; -import android.content.Context; -import android.content.DialogInterface; -import android.view.KeyEvent; -import android.view.View; -import android.widget.Button; -import android.widget.LinearLayout; -import android.widget.ScrollView; -import android.widget.TextView; -import com.eamobile.DownloadActivityInternal; -import com.eamobile.Language; - -/* loaded from: classes.dex */ -public class UpdatesFoundView extends CustomView { - Dialog dialog; - boolean localAssetsOK; - Button lskBtn; - LinearLayout mainLayout; - Button rskBtn; - - public UpdatesFoundView(Context context) { - super(context); - this.localAssetsOK = true; - this.context = context; - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void init() { - super.init(); - createContent(this); - showContent(this); - } - - @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView - public void clean() { - super.clean(); - try { - this.dialog.dismiss(); - } catch (Exception unused) { - } - } - - @Override // com.eamobile.views.CustomView - public void resume() { - if (this.dialog != null) { - showContent(this); - } - } - - private void createContent(View view) { - this.localAssetsOK = DownloadActivityInternal.getMainActivity().checkLocalAssetVersion(); - this.dialog = new Dialog(this.context); - this.dialog.setCancelable(true); - this.dialog.setCanceledOnTouchOutside(false); - this.dialog.requestWindowFeature(1); - this.mainLayout = new LinearLayout(this.context); - this.mainLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - this.mainLayout.setOrientation(1); - this.mainLayout.setGravity(16); - addTitle(this.context, this.mainLayout, Language.getString(25)); - LinearLayout linearLayout = new LinearLayout(this.context); - linearLayout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout.setOrientation(1); - linearLayout.setGravity(16); - ScrollView scrollView = new ScrollView(this.context); - scrollView.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - scrollView.setForegroundGravity(16); - TextView textView = new TextView(this.context); - textView.setClickable(false); - textView.setCursorVisible(false); - textView.setPadding(10, 10, 10, 10); - textView.setTextSize(1, 16.0f); - String string = Language.getString(26, new String[]{DownloadActivityInternal.getMainActivity().getApplicationName(), DownloadActivityInternal.getMainActivity().getSpaceRangeForDownload()}); - String string2 = Language.getString(44); - if (!this.localAssetsOK) { - string = string + "\n" + string2; - } - textView.setText(string); - scrollView.addView(textView); - LinearLayout linearLayout2 = new LinearLayout(this.context); - linearLayout2.setLayoutParams(new LinearLayout.LayoutParams(-1, -2, 1.0f)); - linearLayout2.setPadding(5, 0, 5, 5); - linearLayout2.setOrientation(0); - linearLayout2.setGravity(80); - this.lskBtn = addButton(this.context, linearLayout2, Language.getString(5)); - if (this.localAssetsOK) { - this.rskBtn = addButton(this.context, linearLayout2, Language.getString(18)); - } else { - this.rskBtn = addButton(this.context, linearLayout2, Language.getString(6)); - } - linearLayout.addView(scrollView); - this.mainLayout.addView(linearLayout); - this.mainLayout.addView(linearLayout2); - } - - private void showContent(View view) { - this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { // from class: com.eamobile.views.UpdatesFoundView.1 - @Override // android.content.DialogInterface.OnCancelListener - public void onCancel(DialogInterface dialogInterface) { - dialogInterface.dismiss(); - DownloadActivityInternal.getMainActivity().setState(3); - } - }); - this.lskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.UpdatesFoundView.2 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - UpdatesFoundView.this.dialog.dismiss(); - DownloadActivityInternal.getMainActivity().updateDownload(); - } - }); - this.rskBtn.setOnClickListener(new View.OnClickListener() { // from class: com.eamobile.views.UpdatesFoundView.3 - @Override // android.view.View.OnClickListener - public void onClick(View view2) { - UpdatesFoundView.this.dialog.dismiss(); - if (UpdatesFoundView.this.localAssetsOK) { - DownloadActivityInternal.getMainActivity().setState(11); - } else { - DownloadActivityInternal.getMainActivity().startGameActivity(0); - } - } - }); - this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { // from class: com.eamobile.views.UpdatesFoundView.4 - @Override // android.content.DialogInterface.OnKeyListener - public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { - return i == 82 || i == 84 || i == 4; - } - }); - this.dialog.setContentView(this.mainLayout); - this.dialog.show(); - } -} diff --git a/app/src/main/java/org/fmod/FMODAudioDevice.java b/app/src/main/java/org/fmod/FMODAudioDevice.java index bba1050..c3e2fb6 100644 --- a/app/src/main/java/org/fmod/FMODAudioDevice.java +++ b/app/src/main/java/org/fmod/FMODAudioDevice.java @@ -83,7 +83,11 @@ public class FMODAudioDevice implements Runnable { } } } else { - Thread.sleep(100L); + try { + Thread.sleep(100L); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } } } else if (fmodGetInfo(FMOD_INFO_MIXERRUNNING) == 1) { fmodProcess(byteBuffer); diff --git a/app/src/main/res/values-h720dp/dimens.xml b/app/src/main/res/values-h720dp/dimens.xml deleted file mode 100644 index 4ba8679..0000000 --- a/app/src/main/res/values-h720dp/dimens.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - 54dp - diff --git a/app/src/main/res/values-hdpi/styles.xml b/app/src/main/res/values-hdpi/styles.xml deleted file mode 100644 index 86098ea..0000000 --- a/app/src/main/res/values-hdpi/styles.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - diff --git a/app/src/main/res/values-land/dimens.xml b/app/src/main/res/values-land/dimens.xml deleted file mode 100644 index 85b96fd..0000000 --- a/app/src/main/res/values-land/dimens.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - 48dp - 32dp - 12dp - 14dp - diff --git a/app/src/main/res/values-large/dimens.xml b/app/src/main/res/values-large/dimens.xml deleted file mode 100644 index 038fd5f..0000000 --- a/app/src/main/res/values-large/dimens.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - 440dp - 60% - 90% - 60% - 90% - 55% - 80% - diff --git a/app/src/main/res/values-large/styles.xml b/app/src/main/res/values-large/styles.xml deleted file mode 100644 index e607987..0000000 --- a/app/src/main/res/values-large/styles.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/app/src/main/res/values-ldltr-v21/styles.xml b/app/src/main/res/values-ldltr-v21/styles.xml deleted file mode 100644 index 2073606..0000000 --- a/app/src/main/res/values-ldltr-v21/styles.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml deleted file mode 100644 index c32172f..0000000 --- a/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/values-port/bools.xml b/app/src/main/res/values-port/bools.xml deleted file mode 100644 index d0ac80b..0000000 --- a/app/src/main/res/values-port/bools.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - false - diff --git a/app/src/main/res/values-sw600dp/dimens.xml b/app/src/main/res/values-sw600dp/dimens.xml deleted file mode 100644 index 661020b..0000000 --- a/app/src/main/res/values-sw600dp/dimens.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - 24dp - 80dp - 64dp - 8dp - 8dp - 580dp - 16dp - 20dp - diff --git a/app/src/main/res/values-xlarge/dimens.xml b/app/src/main/res/values-xlarge/dimens.xml deleted file mode 100644 index 1fd0d37..0000000 --- a/app/src/main/res/values-xlarge/dimens.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - 50% - 70% - 45% - 72% - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index f22c481..f214615 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -73,8 +73,6 @@ Verifying uncompressed assets dev - @drawable/icon - @drawable/icon_round %1$s KB/s You are not authorized to play this game Send