commit 4dad8633709999f40b13363d286ddb7c884a27d4 Author: michael Date: Mon Oct 16 16:40:14 2023 +0300 init commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..10cfdbf --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +*.iml +.gradle +/local.properties +/.idea +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000..19d9afa --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,110 @@ +@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed +plugins { + alias(libs.plugins.androidApplication) + alias(libs.plugins.kotlinAndroid) +} + +android { + namespace = "com.ea.games.nfs13_na" + compileSdk = 34 + + defaultConfig { + applicationId = "com.ea.games.nfs13_na" + minSdk = 21 + targetSdk = 34 + versionCode = 1 + versionName = "1.0" + + buildConfigField( "String", "DEV_MENU_VERSION", "\"0.1\"") + buildConfigField( "String", "DEV_MENU_ID", "\"DevMenu\"") + + ndk.abiFilters.add("armeabi-v7a") + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + vectorDrawables { + useSupportLibrary = true + } + } + ndkVersion = "21.0.6113669" + + packaging { + resources.excludes.add("META-INF/DEPENDENCIES") + resources.excludes.add("META-INF/LICENSE") + resources.excludes.add("META-INF/LICENSE.txt") + resources.excludes.add("META-INF/license.txt") + resources.excludes.add("META-INF/NOTICE") + resources.excludes.add("META-INF/NOTICE.txt") + resources.excludes.add("META-INF/notice.txt") + resources.excludes.add("META-INF/ASL2.0") + resources.excludes.add("META-INF/*.kotlin_module") + } + + android.buildFeatures.buildConfig = true + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } + buildFeatures { + compose = true + } + composeOptions { + kotlinCompilerExtensionVersion = "1.5.1" + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + } + } +} + +dependencies { + + implementation(libs.core.ktx) + implementation(libs.lifecycle.runtime.ktx) + implementation(libs.activity.compose) + implementation(platform(libs.compose.bom)) + implementation(libs.ui) + implementation(libs.ui.graphics) + implementation(libs.ui.tooling.preview) + implementation(libs.material3) + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.test.ext.junit) + androidTestImplementation(libs.espresso.core) + androidTestImplementation(platform(libs.compose.bom)) + androidTestImplementation(libs.ui.test.junit4) + debugImplementation(libs.ui.tooling) + debugImplementation(libs.ui.test.manifest) + + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2") + val google_ver = "7.0.0" + implementation ("org.apache.httpcomponents:httpclient:4.5") + implementation ("com.google.android.gms:play-services:$google_ver") + implementation ("com.google.android.gms:play-services-base:$google_ver") + + implementation ("com.google.android.gms:play-services-ads:$google_ver") + implementation ("com.google.android.gms:play-services-drive:$google_ver") + + implementation ("commons-codec:commons-codec:1.15") + implementation ("com.google.code.gson:gson:2.7") + implementation ("com.facebook.android:facebook-android-sdk:3.21.0") + + val fragment_version = "1.6.1" + implementation("androidx.fragment:fragment:$fragment_version") + // Kotlin + implementation("androidx.fragment:fragment-ktx:$fragment_version") + + implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.0.0") +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/androidTest/java/com/ea/games/nfs13_na/ExampleInstrumentedTest.kt b/app/src/androidTest/java/com/ea/games/nfs13_na/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..a27fe34 --- /dev/null +++ b/app/src/androidTest/java/com/ea/games/nfs13_na/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package com.ea.games.nfs13_na + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("com.ea.games.nfs13_na", appContext.packageName) + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..988fd59 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/EASP/DMG/resources/dmg_strings.txt b/app/src/main/assets/EASP/DMG/resources/dmg_strings.txt new file mode 100644 index 0000000..932d381 --- /dev/null +++ b/app/src/main/assets/EASP/DMG/resources/dmg_strings.txt @@ -0,0 +1,172 @@ +{ + "strings": + [ + { + "en": + [ + { + "MoreStr":"More", + "GamesStr":"Games", + "CatHotstr":"What's Hot", + "CatYouStr":"Games For You", + "CatNewStr":"New", + "CatSoonStr":"Coming Soon", + "CatAllStr":"All Games", + "BuyNowStr":"BUY NOW", + "AlertTitleStr":"", + "AlertMsgStr":"To access your data, deactivate flight mode or use Wi-Fi", + "AlertButStr":"OK", + "Cancel":"CANCEL", + "ServerErrMsg":"This service is temporarily unavailable.", + "StaticPage":"dmg_staticpage_en.html", "Cancel":"Cancel", "Loading":"Loading ..." + } + ] + }, + { + "fr": + [ + { + "MoreStr":"Plus de Jeux", + "GamesStr":"", + "CatHotstr":"Nouveautés", + "CatYouStr":"Jeux pour vous", + "CatNewStr":"Nouveau", + "CatSoonStr":"Bientôt disponible(s)", + "CatAllStr":"Tous les jeux", + "BuyNowStr":"ACHETER", + "AlertTitleStr":"Erreur réseau", + "AlertMsgStr":"Désactivez le mode Avion ou utilisez Wi-Fi pour accéder à vos données", + "AlertButStr":"OK", + "Cancel":"ANNULER", + "ServerErrMsg":"Ce service est momentanément indisponible.", + "StaticPage":"dmg_staticpage_fr.html", "Loading":"Chargement ...", "Cancel":"Annuler" + } + ] + }, + { + "it": + [ + { + "MoreStr":"Altri Giochi", + "GamesStr":"", + "CatHotstr":"Ultimissime", + "CatYouStr":"Giochi per te", + "CatNewStr":"Novità", + "CatSoonStr":"Prossimamente", + "CatAllStr":"Tutti i giochi", + "BuyNowStr":"COMPRA ORA", + "AlertTitleStr":"Errore di rete", + "AlertMsgStr":"Disattiva la modalità di uso in aereo o usa il Wi-Fi per accedere ai dati", + "AlertButStr":"OK", + "Cancel":"ANNULLA", + "ServerErrMsg":"Il servizio non è momentaneamente disponibile.", + "StaticPage":"dmg_staticpage_it.html", "Loading":"Caricamento ...", "Cancel":"Annulla" + } + ] + }, + { + "de": + [ + { + "MoreStr":"Mehr", + "GamesStr":"-Spiele", + "CatHotstr":"Angesagt", + "CatYouStr":"Spiele für dich", + "CatNewStr":"Neues", + "CatSoonStr":"Bald erhältlich", + "CatAllStr":"Alle Spiele", + "BuyNowStr":"JETZT KAUFEN", + "AlertTitleStr":"Netzwerkfehler", + "AlertMsgStr":"Flugmodus deaktivieren oder Wi-Fi für Datenzugriff verwenden", + "AlertButStr":"OK", + "Cancel":"ABBRECHEN", + "ServerErrMsg":"Dieser Dienst ist vorübergehend nicht verfügbar.", + "StaticPage":"dmg_staticpage_de.html", "Loading":"Geladen ...", "Cancel":"Abbrechen" + } + ] + }, + { + "es": + [ + { + "MoreStr":"Más Juegos de", + "GamesStr":"", + "CatHotstr":"Novedades", + "CatYouStr":"Juegos para ti", + "CatNewStr":"Nuevo", + "CatSoonStr":"Próximamente", + "CatAllStr":"Todos los juegos", + "BuyNowStr":"COMPRAR AHORA", + "AlertTitleStr":"Error de red", + "AlertMsgStr":"Para acceder a tus datos, desactiva el modo Avión o usa Wi-Fi", + "AlertButStr":"OK", + "Cancel":"CANCELAR", + "ServerErrMsg":"Este servicio está temporalmente indisponible.", + "StaticPage":"dmg_staticpage_es.html", "Loading":"Cargando ...", "Cancel":"Cancelar" + } + ] + }, + { + "ja": + [ + { + "MoreStr":"他の", + "GamesStr":"ゲーム", + "CatHotstr":"ホットな\nアプリ", + "CatYouStr":"お勧め\nゲーム", + "CatNewStr":"新作", + "CatSoonStr":"近日配信", + "CatAllStr":"全ての\nゲーム", + "BuyNowStr":"今すぐ購入", + "AlertTitleStr":"ネットワークエラー", + "AlertMsgStr":"データにアクセスするには、機内モードをオフにするか、Wi-Fiを使用してください", + "AlertButStr":"OK", + "Cancel":"キャンセル", + "ServerErrMsg":"現在このサービスは使用できません.", + "StaticPage":"dmg_staticpage_ja.html", "Loading":"ロード ...", "Cancel":"キャンセル" + } + ] + }, + { + "zh": + [ + { + "MoreStr":"更多", + "GamesStr":"游戏", + "CatHotstr":"热门", + "CatYouStr":"推荐", + "CatNewStr":"最新", + "CatSoonStr":"即将推出", + "CatAllStr":"所有游戏", + "BuyNowStr":"马上购买", + "AlertTitleStr":"网络错误", + "AlertMsgStr":"要存取你的资料,关闭飞行模式或使用Wi-Fi", + "AlertButStr":"好", + "Cancel":"取消", + "ServerErrMsg":"服务器暂时无法使用。", + "StaticPage":"dmg_staticpage_zh.html", "Loading":"載入中 ...", "Cancel":"取消" + } + ] + }, + { + "ko": + [ + { + "MoreStr":"더 보기", + "GamesStr":"게임", + "CatHotstr":"따끈한 소식", + "CatYouStr":"당신을 위한 게임", + "CatNewStr":"신규", + "CatSoonStr":"곧 출시", + "CatAllStr":"모든 게임", + "BuyNowStr":"즉시 구매", + "AlertTitleStr":"네트워크 오류", + "AlertMsgStr":"데이터에 접근하려면 에어플레인 모드를 끄거나 Wi-Fi를 사용하십시오.", + "AlertButStr":"OK", + "Cancel":"취소", + "ServerErrMsg":"이 기능은 일시적으로 이용이 불가능합니다.", + "StaticPage":"dmg_staticpage_ko.html", "Loading":"로드 ...", "Cancel":"취소" + } + ] + }, { "ru": [ { "MoreStr":"Еще", "GamesStr":"Игры", "CatHotstr":"Бестселлеры", "CatYouStr":"Игры для вас", "CatNewStr":"Новые", "CatSoonStr":"Скоро...", "CatAllStr":"Все игры", "BuyNowStr":"КУПИТЬ", "AlertTitleStr":":", "AlertMsgStr":"Для доступа к данным отключите режим \"в самолете\" или используйте Wi-Fi.", "AlertButStr":"OK", "Cancel":"ОТМЕНА", "ServerErrMsg":"Временно недоступно.", "NoContentMsg":"Отсутствует доступный контент.", "StaticPage":"dmg_staticpage_en.html" } ] }, { "nl": [ { "MoreStr":"Meer", "GamesStr":"Games", "CatHotstr":"Wat is hot", "CatYouStr":"Games voor jou", "CatNewStr":"Nieuw", "CatSoonStr":"Binnenkort verwacht", "CatAllStr":"Alle games", "BuyNowStr":"KOOP NU", "AlertTitleStr":":", "AlertMsgStr":"Om toegang tot je gegevens te krijgen, deactiveer je de vliegtuigmodus of gebruik je Wi-Fi", "AlertButStr":"OK", "Cancel":"ANNULEREN", "ServerErrMsg":"Deze dienst is tijdelijk niet beschikbaar.", "NoContentMsg":"Er is geen content beschikbaar.", "StaticPage":"dmg_staticpage_en.html" } ] }, { "pt": [ { "MoreStr":"Mais", "GamesStr":"Jogos", "CatHotstr":"Populares", "CatYouStr":"Jogos para você", "CatNewStr":"Nova", "CatSoonStr":"EM BREVE", "CatAllStr":"Todos os Jogos", "BuyNowStr":"COMPRAR AGORA", "AlertTitleStr":":", "AlertMsgStr":"Para acessar seus dados, desative o modo avião ou use o Wi-Fi", "AlertButStr":"OK", "Cancel":"CANCELAR", "ServerErrMsg":"No momento, esse serviço está indisponível.", "NoContentMsg":"Não há conteúdo disponível.", "StaticPage":"dmg_staticpage_en.html" } ] } ] +} diff --git a/app/src/main/assets/EASP/DMG/static_page/buy_now_dmg.png b/app/src/main/assets/EASP/DMG/static_page/buy_now_dmg.png new file mode 100644 index 0000000..b6d94f0 Binary files /dev/null and b/app/src/main/assets/EASP/DMG/static_page/buy_now_dmg.png differ diff --git a/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_de.html b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_de.html new file mode 100644 index 0000000..53904fe --- /dev/null +++ b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_de.html @@ -0,0 +1,154 @@ + + + +More EA Games + + + + + + + + + + +
+
+ + + +
+ + + + + +
    + + +
  • + + + + +
    + +
    +

    MONOPOLY

    +

    Rücke auf LOS vor! Spiele den Brettspiel-Klassiker, in dem du alles besitzen kannst.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Die Sims 3

    +

    Lang leben Die Sims. In diesem Verkaufsschlager ist der Kreislauf des Lebens unendlich.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Need for Speed Shift

    +

    Think Fast, Drive Faster! Erlebe den Rausch des Profi-Rennsports bis ins letzte Detail.

    +
    +
    +
  • + + + + + +
+ +
+ + +
+
+ + + diff --git a/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_en.html b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_en.html new file mode 100644 index 0000000..72a7547 --- /dev/null +++ b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_en.html @@ -0,0 +1,154 @@ + + + +More EA Games + + + + + + + + + + +
+
+ + + +
+ + + + + +
    + + +
  • + + + + +
    + +
    +

    MONOPOLY

    +

    It's "Go" time! Play the original board game where you can own it all.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    The Sims 3

    +

    Long live The Sims. The circle of life is infinite in the best-selling experience.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Need for Speed Shift

    +

    Think fast! Drive faster! Experience every visceral detail of the pro circuit.

    +
    +
    +
  • + + + + + +
+ +
+ + +
+
+ + + diff --git a/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_es.html b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_es.html new file mode 100644 index 0000000..4ae745c --- /dev/null +++ b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_es.html @@ -0,0 +1,154 @@ + + + +More EA Games + + + + + + + + + + +
+
+ + + +
+ + + + + +
    + + +
  • + + + + +
    + +
    +

    MONOPOLY

    +

    ¡Te toca! Juega al clásico juego de mesa en el que puedes ganarlo todo.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Los Sims 3

    +

    Larga vida a los Sims. El círculo de la vida no tiene fin en este gran éxito mundial.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Need for Speed Shift

    +

    ¡Piensa rápido, conduce aún más rápido! Siente la emoción del circuito profesional.

    +
    +
    +
  • + + + + + +
+ +
+ + +
+
+ + + diff --git a/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_fr.html b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_fr.html new file mode 100644 index 0000000..3ea859f --- /dev/null +++ b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_fr.html @@ -0,0 +1,154 @@ + + + +More EA Games + + + + + + + + + + +
+
+ + + +
+ + + + + +
    + + +
  • + + + + +
    + +
    +

    MONOPOLY

    +

    Avancez jusqu'à la case DÉPART ! Jouez à votre jeu de transactions immobilières préféré.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Les Sims 3

    +

    Vive les Sims ! Découvrez le cercle de la vie infini avec ce titre incontournable.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Need for Speed Shift

    +

    Un esprit vif dans un bolide encore plus vif ! Éprouvez l'excitation des courses de rue.

    +
    +
    +
  • + + + + + +
+ +
+ + +
+
+ + + diff --git a/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_it.html b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_it.html new file mode 100644 index 0000000..36925d2 --- /dev/null +++ b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_it.html @@ -0,0 +1,154 @@ + + + +More EA Games + + + + + + + + + + +
+
+ + + +
+ + + + + +
    + + +
  • + + + + +
    + +
    +

    MONOPOLY

    +

    È ora di passare dal “Via”! Monopolizza tutto nel gioco da tavolo per eccellenza.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    The Sims 3

    +

    Lunga vita ai Sims. Le novità non finiscono mai con questo gioco campione di vendite.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Need for Speed Shift

    +

    Pensa veloce, guida come un fulmine! Prova il brivido del circuito per professionisti.

    +
    +
    +
  • + + + + + +
+ +
+ + +
+
+ + + diff --git a/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_ja.html b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_ja.html new file mode 100644 index 0000000..9f1e2af --- /dev/null +++ b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_ja.html @@ -0,0 +1,154 @@ + + + +More EA Games + + + + + + + + + + +
+
+ + + +
+ + + + + +
    + + +
  • + + + + +
    + +
    +

    MONOPOLY

    +

    MonopolyでGo!全てを独占できるボードゲームの元祖をプレイしましょう!

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    The Sims 3

    +

    シム万歳!ベストセラーゲームの勢いは止まらない!

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Need for Speed Shift

    +

    音速の判断力!#1レースフランチャイズでプロストリートバトルの迫力を体験しましょう!

    +
    +
    +
  • + + + + + +
+ +
+ + +
+
+ + + diff --git a/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_ko.html b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_ko.html new file mode 100644 index 0000000..51bb114 --- /dev/null +++ b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_ko.html @@ -0,0 +1,154 @@ + + + +More EA Games + + + + + + + + + + +
+
+ + + +
+ + + + + +
    + + +
  • + + + + +
    + +
    +

    MONOPOLY

    +

    It's "Go" time! Play the original board game where you can own it all.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    The Sims 3

    +

    Long live The Sims. The circle of life is infinite in the best-selling experience.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Need for Speed Shift

    +

    Think fast! Drive faster! Experience every visceral detail of the pro circuit.

    +
    +
    +
  • + + + + + +
+ +
+ + +
+
+ + + diff --git a/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_zh.html b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_zh.html new file mode 100644 index 0000000..38bef8e --- /dev/null +++ b/app/src/main/assets/EASP/DMG/static_page/dmg_staticpage_zh.html @@ -0,0 +1,154 @@ + + + +More EA Games + + + + + + + + + + +
+
+ + + +
+ + + + + +
    + + +
  • + + + + +
    + +
    +

    MONOPOLY

    +

    It's "Go" time! Play the original board game where you can own it all.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    The Sims 3

    +

    Long live The Sims. The circle of life is infinite in the best-selling experience.

    +
    +
    +
  • + + + +
  • + + + + +
    + +
    +

    Need for Speed Shift

    +

    Think fast! Drive faster! Experience every visceral detail of the pro circuit.

    +
    +
    +
  • + + + + + +
+ +
+ + +
+
+ + + diff --git a/app/src/main/assets/EASP/DMG/static_page/ealogo_dmg.png b/app/src/main/assets/EASP/DMG/static_page/ealogo_dmg.png new file mode 100644 index 0000000..9adf67a Binary files /dev/null and b/app/src/main/assets/EASP/DMG/static_page/ealogo_dmg.png differ diff --git a/app/src/main/assets/EASP/DMG/static_page/monopolyclassic_icon.png b/app/src/main/assets/EASP/DMG/static_page/monopolyclassic_icon.png new file mode 100644 index 0000000..7bc9471 Binary files /dev/null and b/app/src/main/assets/EASP/DMG/static_page/monopolyclassic_icon.png differ diff --git a/app/src/main/assets/EASP/DMG/static_page/nfs_shift_icon.png b/app/src/main/assets/EASP/DMG/static_page/nfs_shift_icon.png new file mode 100644 index 0000000..7a1dc21 Binary files /dev/null and b/app/src/main/assets/EASP/DMG/static_page/nfs_shift_icon.png differ diff --git a/app/src/main/assets/EASP/DMG/static_page/sims3_icon.png b/app/src/main/assets/EASP/DMG/static_page/sims3_icon.png new file mode 100644 index 0000000..822d7ed Binary files /dev/null and b/app/src/main/assets/EASP/DMG/static_page/sims3_icon.png differ diff --git a/app/src/main/assets/EASP/DMG/static_page/tetris_banner.png b/app/src/main/assets/EASP/DMG/static_page/tetris_banner.png new file mode 100644 index 0000000..8d13880 Binary files /dev/null and b/app/src/main/assets/EASP/DMG/static_page/tetris_banner.png differ diff --git a/app/src/main/assets/EASP/GeoTrustGlobalCA.crt b/app/src/main/assets/EASP/GeoTrustGlobalCA.crt new file mode 100644 index 0000000..4ae42e8 Binary files /dev/null and b/app/src/main/assets/EASP/GeoTrustGlobalCA.crt differ diff --git a/app/src/main/assets/EASP/GeoTrustSSLDV.crt b/app/src/main/assets/EASP/GeoTrustSSLDV.crt new file mode 100644 index 0000000..2361d20 Binary files /dev/null and b/app/src/main/assets/EASP/GeoTrustSSLDV.crt differ diff --git a/app/src/main/assets/EASP/Origin/Facebook/DigiCertHighAssuranceCA-3.crt b/app/src/main/assets/EASP/Origin/Facebook/DigiCertHighAssuranceCA-3.crt new file mode 100644 index 0000000..c1b7a5e Binary files /dev/null and b/app/src/main/assets/EASP/Origin/Facebook/DigiCertHighAssuranceCA-3.crt differ diff --git a/app/src/main/assets/EASP/Origin/Facebook/DigiCertHighAssuranceEVRootCA.crt b/app/src/main/assets/EASP/Origin/Facebook/DigiCertHighAssuranceEVRootCA.crt new file mode 100644 index 0000000..dae0196 Binary files /dev/null and b/app/src/main/assets/EASP/Origin/Facebook/DigiCertHighAssuranceEVRootCA.crt differ diff --git a/app/src/main/assets/EASP/Origin/Facebook/GTE_CyberTrust_Global_Root.crt b/app/src/main/assets/EASP/Origin/Facebook/GTE_CyberTrust_Global_Root.crt new file mode 100644 index 0000000..e37fa29 Binary files /dev/null and b/app/src/main/assets/EASP/Origin/Facebook/GTE_CyberTrust_Global_Root.crt differ diff --git a/app/src/main/assets/EASP/Origin/Facebook/defaultUserPicture.png b/app/src/main/assets/EASP/Origin/Facebook/defaultUserPicture.png new file mode 100644 index 0000000..13eab5c Binary files /dev/null and b/app/src/main/assets/EASP/Origin/Facebook/defaultUserPicture.png differ diff --git a/app/src/main/assets/EASP/Origin/Facebook/defaultUserPictureBig.png b/app/src/main/assets/EASP/Origin/Facebook/defaultUserPictureBig.png new file mode 100644 index 0000000..13eab5c Binary files /dev/null and b/app/src/main/assets/EASP/Origin/Facebook/defaultUserPictureBig.png differ diff --git a/app/src/main/assets/EASP/Origin/Facebook/defaultUserPictureSmall.png b/app/src/main/assets/EASP/Origin/Facebook/defaultUserPictureSmall.png new file mode 100644 index 0000000..13eab5c Binary files /dev/null and b/app/src/main/assets/EASP/Origin/Facebook/defaultUserPictureSmall.png differ diff --git a/app/src/main/assets/EASP/Origin/Facebook/defaultUserPictureSquare.png b/app/src/main/assets/EASP/Origin/Facebook/defaultUserPictureSquare.png new file mode 100644 index 0000000..13eab5c Binary files /dev/null and b/app/src/main/assets/EASP/Origin/Facebook/defaultUserPictureSquare.png differ diff --git a/app/src/main/assets/EASP/Origin/Facebook/facebook-DigiCertHighAssuranceCA-3.crt b/app/src/main/assets/EASP/Origin/Facebook/facebook-DigiCertHighAssuranceCA-3.crt new file mode 100644 index 0000000..edbf940 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/Facebook/facebook-DigiCertHighAssuranceCA-3.crt @@ -0,0 +1,36 @@ +-----BEGIN CERTIFICATE----- +MIIGWDCCBUCgAwIBAgIQCl8RTQNbF5EX0u/UA4w/OzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA4MDQwMjEyMDAwMFoXDTIyMDQwMzAwMDAwMFowZjEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTElMCMGA1UEAxMcRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +Q0EtMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9hCikQH17+NDdR +CPge+yLtYb4LDXBMUGMmdRW5QYiXtvCgFbsIYOBC6AUpEIc2iihlqO8xB3RtNpcv +KEZmBMcqeSZ6mdWOw21PoF6tvD2Rwll7XjZswFPPAAgyPhBkWBATaccM7pxCUQD5 +BUTuJM56H+2MEb0SqPMV9Bx6MWkBG6fmXcCabH4JnudSREoQOiPkm7YDr6ictFuf +1EutkozOtREqqjcYjbTCuNhcBoz4/yO9NV7UfD5+gw6RlgWYw7If48hl66l7XaAs +zPw82W3tzPpLQ4zJ1LilYRyyQLYoEt+5+F/+07LJ7z20Hkt8HEyZNp496+ynaF4d +32duXvsCAwEAAaOCAvowggL2MA4GA1UdDwEB/wQEAwIBhjCCAcYGA1UdIASCAb0w +ggG5MIIBtQYLYIZIAYb9bAEDAAIwggGkMDoGCCsGAQUFBwIBFi5odHRwOi8vd3d3 +LmRpZ2ljZXJ0LmNvbS9zc2wtY3BzLXJlcG9zaXRvcnkuaHRtMIIBZAYIKwYBBQUH +AgIwggFWHoIBUgBBAG4AeQAgAHUAcwBlACAAbwBmACAAdABoAGkAcwAgAEMAZQBy +AHQAaQBmAGkAYwBhAHQAZQAgAGMAbwBuAHMAdABpAHQAdQB0AGUAcwAgAGEAYwBj +AGUAcAB0AGEAbgBjAGUAIABvAGYAIAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAg +AEMAUAAvAEMAUABTACAAYQBuAGQAIAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQ +AGEAcgB0AHkAIABBAGcAcgBlAGUAbQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBt +AGkAdAAgAGwAaQBhAGIAaQBsAGkAdAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBj +AG8AcgBwAG8AcgBhAHQAZQBkACAAaABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBl +AHIAZQBuAGMAZQAuMBIGA1UdEwEB/wQIMAYBAf8CAQAwNAYIKwYBBQUHAQEEKDAm +MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wgY8GA1UdHwSB +hzCBhDBAoD6gPIY6aHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0SGln +aEFzc3VyYW5jZUVWUm9vdENBLmNybDBAoD6gPIY6aHR0cDovL2NybDQuZGlnaWNl +cnQuY29tL0RpZ2lDZXJ0SGlnaEFzc3VyYW5jZUVWUm9vdENBLmNybDAfBgNVHSME +GDAWgBSxPsNpA/i/RwHUmCYaCALvY2QrwzAdBgNVHQ4EFgQUUOpzidsp+xCPnuUB +INTeeZlIg/cwDQYJKoZIhvcNAQEFBQADggEBAB7ipUiebNtTOA/vphoqrOIDQ+2a +vD6OdRvw/S4iWawTwGHi5/rpmc2HCXVUKL9GYNy+USyS8xuRfDEIcOI3ucFbqL2j +CwD7GhX9A61YasXHJJlIR0YxHpLvtF9ONMeQvzHB+LGEhtCcAarfilYGzjrpDq6X +dF3XcZpCdF/ejUN83ulV7WkAywXgemFhM9EZTfkI7qA5xSU1tyvED7Ld8aW3DiTE +JiiNeXf1L/BXunwH1OH8zVowV36GEEfdMR/X/KLCvzB8XSSq6PmuX2p0ws5rs0bY +Ib4p1I5eFdZCSucyb6Sxa1GDWL4/bcf72gMhy2oWGU4K8K2Eyl2Us1p292E= +-----END CERTIFICATE----- diff --git a/app/src/main/assets/EASP/Origin/Facebook/facebook-DigiCertHighAssuranceEVRootCA.crt b/app/src/main/assets/EASP/Origin/Facebook/facebook-DigiCertHighAssuranceEVRootCA.crt new file mode 100644 index 0000000..9e6810a --- /dev/null +++ b/app/src/main/assets/EASP/Origin/Facebook/facebook-DigiCertHighAssuranceEVRootCA.crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm ++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW +PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM +xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB +Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 +hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg +EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA +FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec +nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z +eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF +hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 +Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep ++OkuE6N36B9K +-----END CERTIFICATE----- diff --git a/app/src/main/assets/EASP/Origin/Google-GeoTrustGlobalCA.crt b/app/src/main/assets/EASP/Origin/Google-GeoTrustGlobalCA.crt new file mode 100644 index 0000000..bcb2529 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/Google-GeoTrustGlobalCA.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg +R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 +9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE----- diff --git a/app/src/main/assets/EASP/Origin/Google-GoogleInternetAuthorityG2.crt b/app/src/main/assets/EASP/Origin/Google-GoogleInternetAuthorityG2.crt new file mode 100644 index 0000000..3f79ee0 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/Google-GoogleInternetAuthorityG2.crt @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID8DCCAtigAwIBAgIDAjqDMA0GCSqGSIb3DQEBCwUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMTMwNDA1MTUxNTU2WhcNMTYxMjMxMjM1OTU5WjBJMQswCQYDVQQG +EwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzElMCMGA1UEAxMcR29vZ2xlIEludGVy +bmV0IEF1dGhvcml0eSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AJwqBHdc2FCROgajguDYUEi8iT/xGXAaiEZ+4I/F8YnOIe5a/mENtzJEiaB0C1NP +VaTOgmKV7utZX8bhBYASxF6UP7xbSDj0U/ck5vuR6RXEz/RTDfRK/J9U3n2+oGtv +h8DQUB8oMANA2ghzUWx//zo8pzcGjr1LEQTrfSTe5vn8MXH7lNVg8y5Kr0LSy+rE +ahqyzFPdFUuLH8gZYR/Nnag+YyuENWllhMgZxUYi+FOVvuOAShDGKuy6lyARxzmZ +EASg8GF6lSWMTlJ14rbtCMoU/M4iarNOz0YDl5cDfsCx3nuvRTPPuj5xt970JSXC +DTWJnZ37DhF5iR43xa+OcmkCAwEAAaOB5zCB5DAfBgNVHSMEGDAWgBTAephojYn7 +qwVkDBF9qn1luMrMTjAdBgNVHQ4EFgQUSt0GFhu89mi1dvWBtrtiGrpagS8wDgYD +VR0PAQH/BAQDAgEGMC4GCCsGAQUFBwEBBCIwIDAeBggrBgEFBQcwAYYSaHR0cDov +L2cuc3ltY2QuY29tMBIGA1UdEwEB/wQIMAYBAf8CAQAwNQYDVR0fBC4wLDAqoCig +JoYkaHR0cDovL2cuc3ltY2IuY29tL2NybHMvZ3RnbG9iYWwuY3JsMBcGA1UdIAQQ +MA4wDAYKKwYBBAHWeQIFATANBgkqhkiG9w0BAQsFAAOCAQEAqvqpIM1qZ4PtXtR+ +3h3Ef+AlBgDFJPupyC1tft6dgmUsgWM0Zj7pUsIItMsv91+ZOmqcUHqFBYx90SpI +hNMJbHzCzTWf84LuUt5oX+QAihcglvcpjZpNy6jehsgNb1aHA30DP9z6eX0hGfnI +Oi9RdozHQZJxjyXON/hKTAAj78Q1EK7gI4BzfE00LshukNYQHpmEcxpw8u1VDu4X +Bupn7jLrLN1nBz/2i8Jw3lsA5rsb0zYaImxssDVCbJAJPZPpZAkiDoUGn8JzIdPm +X4DkjYUiOnMDsWCOrmji9D6X52ASCWg23jrW4kOVWzeBkoEfu43XrVJkFleW2V40 +fsg12A== +-----END CERTIFICATE----- diff --git a/app/src/main/assets/EASP/Origin/Thawte_SGC_CA.crt b/app/src/main/assets/EASP/Origin/Thawte_SGC_CA.crt new file mode 100644 index 0000000..63dbd46 Binary files /dev/null and b/app/src/main/assets/EASP/Origin/Thawte_SGC_CA.crt differ diff --git a/app/src/main/assets/EASP/Origin/VeriSignPublicPrimaryCA-G5.crt b/app/src/main/assets/EASP/Origin/VeriSignPublicPrimaryCA-G5.crt new file mode 100644 index 0000000..9818d19 Binary files /dev/null and b/app/src/main/assets/EASP/Origin/VeriSignPublicPrimaryCA-G5.crt differ diff --git a/app/src/main/assets/EASP/Origin/VeriSignSecureServer-G3.crt b/app/src/main/assets/EASP/Origin/VeriSignSecureServer-G3.crt new file mode 100644 index 0000000..55923a0 Binary files /dev/null and b/app/src/main/assets/EASP/Origin/VeriSignSecureServer-G3.crt differ diff --git a/app/src/main/assets/EASP/Origin/VeriSign_PCA3_G1_SHA1.crt b/app/src/main/assets/EASP/Origin/VeriSign_PCA3_G1_SHA1.crt new file mode 100644 index 0000000..268d327 Binary files /dev/null and b/app/src/main/assets/EASP/Origin/VeriSign_PCA3_G1_SHA1.crt differ diff --git a/app/src/main/assets/EASP/Origin/resources/Chinese Simplified Text.plist b/app/src/main/assets/EASP/Origin/resources/Chinese Simplified Text.plist new file mode 100644 index 0000000..4c8fa52 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/Chinese Simplified Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR*真实名称EBISU_LOGIN_OPTIONAL_INFO_STR*为可选信息EBISU_ACHIEVEMENT_USER_DOING_GREAT_STR%USERNAME%,您做得很好!您要在Origin网络分享您的高分吗?EBISU_FRIENDS_GAME_LIST_TITLE_STR%USERNAME%的游戏EBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% 在%GAMENAME%已打败了你的最佳时间。EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% 在%GAMENAME%已超越了您的最高积分。EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% 向您发送了好友请求。EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STR需要出生日期。EBISU_ERROR_WIFI_REQUIRED_STR你需要WiFi连接从%GAMENAME%登录Origin。EBISU_ERROR_WIFI_3G_REQUIRED_STR你需要WiFi或3G连接从%GAMENAME%登录Origin。EBISU_NEWS_ACCEPT_STR接受EBISU_NEWS_ACCEPTED_FRIEND_STR接受好友请求EBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STR目前无法访问保密协议。EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STR目前无法访问服务条款。EBISU_ERROR_TOS_FAILURE_STR目前无法访问服务条款。EBISU_ERROR_TOS_NOT_FOUND_STR目前无法访问服务条款。EBISU_NEWS_ACHIEVEMENT_UNLOCK_STR成就解锁:EBISU_FRIENDS_ADD_STR添加EBISU_FRIENDS_ADD_FRIENDS_TAB_STR添加好友EBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STR添加好友至你的网络!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STR添加好友至你的Origin网络。EBISU_PROFILE_ADD_GAMES_STR添加游戏EBISU_FRIENDS_ADD_YOUR_CONTACTS_STR添加你的联系人EBISU_FRIENDS_AGE_STR年龄EBISU_PROFILE_AGE_STR年龄EBISU_PROFILE_SETTINGS_AGE_STR年龄EBISU_ERROR_ALERT_STR提醒EBISU_FRIENDS_ALREADY_ADDED_STR已加入EBISU_LOGIN_INVITATION_SENT_STR已向%EMAIL%发出一个请求EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STR您无法登录吗?EBISU_FRIENDS_BACK_STR后退EBISU_PROFILE_SETTINGS_BACK_STR后退EBISU_FRIENDS_BLOCK_STR阻挡EBISU_FRIENDS_BLOCK_USER_STR阻挡%USERNAME%EBISU_FRIENDS_BUY_STR购买EBISU_PROFILE_BUY_NOW_STR立即购买EBISU_GMAIL_CANCEL_STR取消EBISU_FRIENDS_CHALLENGE_STR挑战EBISU_PROFILE_CHALLENGE_STR挑战EBISU_NEWS_CHALLENGE_STR挑战:EBISU_LOGIN_CHANGE_USERNAME_STR更改用户名EBISU_LOGIN_CHECKING_EMAIL_STR检查电子邮件地址EBISU_FRIENDS_COMMENT_STR评论EBISU_LOGIN_COMPLETE_SETUP_STR完成设置EBISU_LOGIN_CONFIRM_STR确认EBISU_PROFILE_SETTINGS_CONFIRM_STR确认EBISU_LOGIN_CONGRATULATIONS_STR恭喜您!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STR恭喜!%USERNAME%,您刚取得了快速的时间!想看看它是如何在Origin排行吗?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STR恭喜!%USERNAME%,您刚取得了快速的时间!想要查看您在Origin的排名吗?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STR恭喜!%USERNAME%,您刚取得了高积分!想要查看您在Origin的排名吗?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STR恭喜!%USERNAME%,您刚取得了高积分!想要查看您在Origin的排名吗?EBISU_FRIENDS_CONNECT_FB_STR连接 Facebook EBISU_FRIENDS_CONNECT_GOOGLE_STR连接 GoogleEBISU_FRIENDS_CONTACTS_STR联系人EBISU_LOGIN_CONTINUE_STR继续EBISU_LOGIN_CREATE_ACCOUNT_STR创建帐户EBISU_LOGIN_DATE_OF_BIRTH_STR出生日期EBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STR出生日期EBISU_FRIENDS_DELETE_STR删除EBISU_FRIENDS_DELETING_FRIEND_STR删除好友EBISU_NEWS_DISMISS_STR屏除EBISU_PROFILE_DISPLAY_STR显示EBISU_PROFILE_SETTINGS_DISPLAY_NAME_STR显示名称:EBISU_GMAIL_DONE_STR完成EBISU_PROFILE_EDIT_STR编辑EBISU_NEWS_EDIT_STR编辑EBISU_FRIENDS_EMAIL_STR电邮地址:EBISU_INVITE_EMAIL_STR电邮地址EBISU_PROFILE_EMAIL_STR电邮地址:EBISU_LOGIN_EMAIL_STR电邮地址EBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STR电邮地址和密码已经存在。EBISU_ERROR_EMAIL_REQUIRED_STR请输入电邮地址以继续。EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STR电邮和用户名EBISU_PROFILE_SETTINGS_EMAIL_STR电邮地址EBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STR输入电子邮件EBISU_LOGIN_ENTER_PHONE_NUMBER_STR输入电话号码以接收文本通知和更多信息!EBISU_LOGIN_ACCOUNT_STR输入电子邮件地址以登录或创建账户。EBISU_ERROR_ERROR_TITLE_STR错误EBISU_GMAIL_GMAILPLACEHOLDER_STRexample@gmail.comEBISU_RETURN_EXIT_STR退出EBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRFacebook好友EBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRFacebook设置EBISU_ERROR_FAILED_TO_DELETE_FRIEND_STR无法删除好友。EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STR无法删除消息项目。EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STR无法发送接受。EBISU_ERROR_FAILED_TO_SEND_DECLINE_STR无法发送拒绝。EBISU_PROFILE_SETTINGS_FEMALE_STR女性EBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STR 通过联系人搜寻好友或让自己被搜寻。EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STR通过 Facebook 搜寻好友或让自己被搜寻。EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STR通过 Gmail 搜寻好友或让自己被搜寻。EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STR在 Origin 上搜索好友EBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STR了解您的好友在玩什么游戏!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STR在 Origin 上搜索好友EBISU_LOGIN_FORGOT_PASSWORD_STR忘了密码EBISU_FRIENDS_FRI_STR星期五EBISU_NEWS_FRI_STR星期五EBISU_NEWS_FRIEND_REQUEST_BODY_STR向您发送了好友请求。EBISU_NEWS_FRIEND_REQUEST_STR好友请求EBISU_CAT_FRIENDS_STR好友EBISU_NAV_FRIENDS_STR好友EBISU_PROFILE_FRIENDS_ONLY_STR只限好友EBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STR只限好友EBISU_FRIENDS_FRIENDS_WHO_HAVE_STR拥有%GAMENAME%的好友EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STR没有%GAMENAME%的好友EBISU_FRIENDS_GENDER_STR性别:EBISU_PROFILE_SETTINGS_GENDER_STR性别EBISU_PROFILE_GENDER_STR性别:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STR从电艺得知游戏消息和独家优惠!EBISU_NEWS_GET_IT_STR获取EBISU_ERROR_GETTING_USER_INFO_STR获取您的信息EBISU_NEWS_GO_TO_STR载入页面EBISU_FRIENDS_GOOGLE_STR谷歌EBISU_FRIENDS_GOOGLEFRIENDS_STR谷歌好友EBISU_NEWS_HIGH_SCORE_STR积分EBISU_FRIENDS_HOME_STR首页EBISU_PROFILE_HOME_STR首页EBISU_PROFILE_SETTINGS_HOME_STR首页EBISU_LOGIN_AGREE_PP_TOS_STR我同意保密协议和服务条款。EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIA我可以通过此方式被搜索:EBISU_NEWS_IGNORE_STR忽略EBISU_FRIENDS_CONTACTS_IN_STR在OriginEBISU_ERROR_INCORRECT_LOGIN_INFO_STR登录信息不正确EBISU_FRIENDS_INVITE_STR邀请EBISU_FRIENDS_CHOOSE_SMS_EMAIL_STR邀请好友加入OriginEBISU_FRIENDS_SENTINVITE_STR邀请发送了EBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STR邀请您的好友加入OriginEBISU_NEWS_INVITES_STR邀请EBISU_LOGIN_DUMMY_REAL_NAME_STRJohn DoeEBISU_FRIENDS_LAST_LOGIN_STR上次登录于:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STR上次登录于:EBISU_NEWS_LAST_UPDATE_STR最后更新:%TIME%EBISU_NEWS_LASTUPDATE_NEVER_STR最后更新:从末EBISU_NEWS_LAUNCH_STR启动EBISU_PROFILE_LEGEND_STR说明EBISU_PROFILE_SETTINGS_LOADING_STR载入中EBISU_LOGIN_LOGIN_STR登录EBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STR登录FacebookEBISU_PROFILE_LOGOUT_STR登出EBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STR登出FacebookEBISU_LOGIN_LOGGING_IN_STR登录中 。。。EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STR通过游戏挑战认识新朋友!EBISU_PROFILE_SETTINGS_MALE_STR男性EBISU_FRIENDS_MOBILE_STR流动EBISU_PROFILE_MOBILE_STR流动EBISU_PROFILE_SETTINGS_MOBILE_STR流动EBISU_FRIENDS_MON_STR星期一EBISU_NEWS_MON_STR星期一EBISU_FRIENDS_MY_FRIENDS_TAB_STR我的好友EBISU_PROFILE_MY_GAMES_STR我的游戏EBISU_PROFILE_SETTINGS_MY_IMAGE_STR我的图片EBISU_NAV_PROFILE_STR我的个人资料EBISU_PROFILE_MY_WISH_LIST_STR我的愿望清单EBISU_CAT_NEWS_STR消息EBISU_NAV_NEWS_STR消息EBISU_ACHIEVEMENT_NICE_JOB_STR干得好!要在Origin网络分享您的积分和挑战其他玩家吗?EBISU_ACHIEVEMENT_NICE_JOB_USER_STR%USERNAME%,干得好!要在Origin网络分享您的成就吗?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STR不要以我的Facebook名称搜索我EBISU_ACHIEVEMENT_NO_STR不,谢谢EBISU_FRIENDS_CONTACTS_NOT_IN_STR不在OriginEBISU_LOGIN_OK_STROKEBISU_ERROR_SOMETHING_WENT_WRONG_STR糟糕!有些不对劲 。。。EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_INVALID_DOCUMENT_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_INVALID_LANGUAGE_CODE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_LICENSE_NOT_FOUND_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_REFERENCE_NOT_FOUND_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_REGISTRATION_FAILED_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_SERVER_USER_API_FAILURE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_SERVICE_FAILURE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_USER_CREATION_FAILED_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_USER_LISTING_FAILED_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STR糟糕!有些不对劲 。。。发生了一个意外错误。EBISU_PROFILE_OPT_IN_STR选择性加入EBISU_PROFILE_OPT_OUT_STR选择性退出EBISU_LOGIN_PASSWORD_STR密码EBISU_PROFILE_SETTINGS_PASSWORD_STR密码EBISU_GMAIL_PASSWORD_STR密码EBISU_ERROR_PASSWORD_REQUIRED_STR请输入密码以继续。EBISU_ERROR_PASSWORD_RESTRICTIONS_STR密码必须为4-16个数字母字符。EBISU_FRIENDS_PENDINGINVITES_STR待处理邀请EBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STR被阻挡的人将无法挑战您或查看您的个人资料。EBISU_PROFILE_PLAY_STR玩游戏EBISU_FRIENDS_PLAYNOW_STR现在玩?EBISU_FRIENDS_PLAYING_COLON_STR正在玩:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STR请创建一个用户名称以完成您Origin帐户的创建。若您喜欢您可以采用我们的建议!EBISU_ERROR_ENTER_USERNAME_STR请输入用户名以继续。EBISU_ERROR_ENTER_VALID_EMAIL_STR请输入一个有效的电子邮件地址以继续。EBISU_GMAIL_ENTERGMAILDATA_STR请输入您的Gmail用户名和密码。EBISU_ERROR_USER_NOT_LOGGED_IN_STR请登录。EBISU_ERROR_REENTER_INFO_STR请重新输入你的信息以继续。EBISU_ERROR_REENTER_INFO_CONTINUE_STR请重新输入你的信息以继续。EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STR请查阅和接受服务条款。EBISU_ERROR_SIGN_IN_STR请登录EBISU_ERROR_SIGN_IN_TO_CONTINUE_STR请登录以继续。EBISU_PROFILE_PRIVACY_POLICY_STR隐私权政策EBISU_PROFILE_PRIVATE_STR私人EBISU_PROFILE_SETTINGS_PRIVATE_STR私人EBISU_CAT_PROFILE_STR个人资料EBISU_FRIENDS_PROFILE_STR个人资料EBISU_NEWS_PROFILE_STR个人资料EBISU_PROFILE_SETTINGS_TAB_STR个人资料设置EBISU_PROFILE_PROFILE_PRIVACY_STR个人资料/隐私权设置EBISU_PROFILE_PUBLIC_STR公开EBISU_PROFILE_SETTINGS_PUBLIC_STR公开EBISU_NEWS_PULLDOWN_TO_UPDATE_STR拉下以更新。。。EBISU_PROFILE_REAL_NAME_STR真实姓名:EBISU_FRIENDS_REAL_NAME_STR真实姓名:EBISU_PROFILE_SETTINGS_REAL_NAME_STR真实姓名EBISU_LOGIN_RECOVER_MY_PASSWORD_STR恢复我的密码EBISU_LOGIN_REGISTER_NEW_USER_STR注册新用户。EBISU_LOGIN_REGISTERING_NEW_USER_STR新用户注册中。。。EBISU_NEWS_REJECT_STR驳回EBISU_NEWS_RELEASE_TO_UPDATE_STR松手后更新EBISU_FRIENDS_BLOCKING_A_USER_STR请记住,阻挡此人将使你从今以后无法在Origin与他联系。EBISU_NEWS_REMOVE_STR删除EBISU_FRIENDS_REMOVE_FRIEND_STR删除好友EBISU_FRIENDS_REPORT_STR报告EBISU_FRIENDS_REPORT_USER_STR报告%USERNAME%EBISU_FRIENDS_REPORT_BLOCK_STR报告/阻挡EBISU_NEWS_REPORT_BLOCK_STR报告/阻挡EBISU_ERROR_RESULTS_LOADING_STR载入结果中。。。EBISU_ERROR_RETRIEVING_STR检索EBISU_RETURN_RETURN_TO_GAME_STR回到游戏EBISU_FRIENDS_SAT_STR星期六EBISU_NEWS_SAT_STR星期六EBISU_PROFILE_SETTINGS_SAVE_STR保存EBISU_PROFILE_SETTINGS_SAVING_STR保存中EBISU_FRIENDS_SEARCH_STR搜索EBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STR搜索标准必须至少三个字符。EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STR搜索标准必须至少三个字符。EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STR搜索标准必须至少三个字符。EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STR在网络上搜索。EBISU_SEARCH_OPTIONS_STR搜索选项EBISU_FRIENDS_SEARCH_ORIGIN_STR搜索OriginEBISU_FRIENDS_SEARCH_RESULTS_STR搜索结果EBISU_FRIENDS_SEARCHRESULTS_STR搜索结果EBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STR联系人内搜索结果EBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRFacebook内搜索结果EBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STR谷歌内搜索结果EBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STROrigin内搜索结果EBISU_FRIENDS_SEARCHING_STR搜索中EBISU_FRIENDS_SENDING_FRIEND_REQUEST_STR好友请求发送中。。。EBISU_LOGIN_SETUP_ACCOUNT_STR设置账户EBISU_PROFILE_SETTINGS_EDIT_STR设置EBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STR否,我不想通过电邮地址被搜索。EBISU_PROFILE_SETTINGS_NEWPASSWORD_STR新的密码EBISU_LOGIN_SETTING_UP_ACCOUNT_STR帐户设置中。。。EBISU_NEWS_SHARE_STR共享EBISU_PROFILE_SHOW_LESS_STR显示较少EBISU_PROFILE_SHOW_MORE_STR显示更多EBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STR登录OriginEBISU_LOGIN_SIGN_IN_ORIGIN_STR登录OriginEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STR签所需的信息EBISU_LOGIN_SIGN_UP_BUTTON_STR赶快注册!EBISU_FRIENDS_SMS_STR短讯EBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STR抱歉,%USERNAME%在Origin网络中已被使用。使用我们的建议名称或创建一个新的用户名以继续。EBISU_ERROR_UNEXPECTED_ERROR_STR抱歉,发生了意外错误。请在试一次。EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STR抱歉,由于区域限制,你目前暂时无法加入Origin。EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STR抱歉 帐户不存在EBISU_ERROR_NO_RESULTS_FOUND_STR抱歉,没有找到任何结果。请再试一次。EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STR抱歉,暂时无法访问OriginEBISU_ERROR_LOGIN_FAILED_STR抱歉,Origin登录失败。EBISU_ERROR_SERVER_DOWN_STR抱歉,我们的服务器暂停服务。请稍后重试。EBISU_ERROR_ID_ALREADY_TAKEN_STR抱歉,该用户名已经被占用。请尝试另一个。EBISU_ERROR_DATE_OF_BIRTH_INVALID_STR抱歉,您输入的出生日期是无效的。EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STR抱歉,电邮地址和密码不能相同。请再试一次。EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STR抱歉,您输入的密码不匹配。EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STR抱歉,密码服务连接发生错误。请稍后重试。EBISU_ERROR_EMAIL_ADRESS_INVALID_STR抱歉,这个电邮地址是无效的。EBISU_ERROR_EMAIL_FORMAT_INVALID_STR抱歉,此电邮地址格式无效。请再试一次。EBISU_ERROR_USER_NOT_FOUND_STR抱歉,此用户名不存在。EBISU_ERROR_DIDNT_RECEIVE_INFO_STR抱歉,我们没有收到你的信息。请重试。EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STR抱歉,您目前暂时无法加入Origin。EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STR抱歉,您的密码不能包含空格。请再试一次EBISU_FRIENDS_SUN_STR星期天EBISU_NEWS_SUN_STR星期天EBISU_PROFILE_TOS_STR服务条款EBISU_ERROR_Origin_NET_NOT_REACHED_STR无法连接至Origin网络。请检查你的网络连接并重试。EBISU_ERROR_EMAIL_ALREADY_EXISTS_STR此电邮地址已在Origin存在EBISU_ERROR_INVALID_EMAIL_FORMAT_STR此电邮地址格式无效。EBISU_ERROR_EMAIL_NOT_REGISTERED_STR此电邮地址目前还没在Origin被注册。EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STR可能需要一点时间,请稍等。。。EBISU_ERROR_USERNAME_ALREASY_EXISTS_STR此用户名已在Origin存在。EBISU_FRIENDS_THUR_STR星期四EBISU_NEWS_THUR_STR星期四EBISU_ERROR_DOMAIN_INVALID_STR请输入一个有效的电邮地址以继续。EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STR请输入与您帐户联接的电邮地址,以恢复密码。EBISU_FRIENDS_TODAY_STR今天EBISU_NEWS_TODAY_STR今天EBISU_LOGIN_TRY_STR试一试EBISU_FRIENDS_TUE_STR星期二EBISU_NEWS_TUE_STR星期二EBISU_LOGIN_SOMETHING_WENT_WRONG_STR糟糕!有一点不对劲。。。EBISU_NEWS_UPDATES_STR更新EBISU_ERROR_UPDATING_CHANGES_STR更新中。。。EBISU_LOGIN_USER_REGISTERED_STR用户注册成功!EBISU_PROFILE_USERNAME_STR用户名EBISU_LOGIN_USERNAME_STR用户名EBISU_PROFILE_SETTINGS_USERNAME_STR用户名EBISU_GMAIL_USERNAME_STR用户名EBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STR请输入用户名和密码以继续。EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STR用户名和密码的长度必须为4-12个数字母字符。EBISU_ERROR_USERNAME_REQUIRED_STR请输入用户名以继续。EBISU_ERROR_USERNAME_RESTRICTIONS_STR用户名必须为4-12个数字母字符。EBISU_ERROR_USERNAME_NOT_AVAILABLE_STR用户名不可用。EBISU_ACHIEVEMENT_WAY_TO_GO_STR太棒了!要在Origin网络分享您的积分和挑战其他玩家吗?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STR太棒了%USERNAME%!要在Origin网络分享您的时间记录吗?EBISU_ERROR_SEARCH_FAILED_STR我们没有寻获与搜索匹配的结果。EBISU_FRIENDS_WED_STR星期三EBISU_NEWS_WED_STR星期三EBISU_NAV_WELCOME_STR欢迎EBISU_LOGIN_WELCOME_BACK_STR欢迎回来!EBISU_ACHIEVEMENT_WELL_DONE_STR干得好!要在Origin网络分享您的积分和挑战其他玩家吗?EBISU_ACHIEVEMENT_WELL_DONE_USER_STR干得好,%USERNAME%!要在Origin网络挑战其他%GAMENAME%玩家吗?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STR您想要做什么?EBISU_LOGIN_WHY_JOIN_STR为什么要加入Origin?EBISU_ACHIEVEMENT_YES_STREBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STR是的,请允许会员以我的Facebook名搜索我。EBISU_FRIENDS_YESTERDAY_STR昨天EBISU_NEWS_YESTERDAY_STR昨天EBISU_ERROR_MUST_AGREE_TOS_AND_PP_STR你必须同意服务条款和保密协议以继续。EBISU_ACHIEVEMENT_DOING_GREAT_STR您做得很好!要在Origin网络分享您的高分和挑战其他玩家吗?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STR您受挑战了! %USERNAME%要向您挑战 %GAMENAME%!接受挑战吗?立即下载 %GAMENAME%。EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STR您受挑战了! %USERNAME%要向您挑战 %GAMENAME%!EBISU_ERROR_CONN_TIMED_OUT_STR您的连接已超时。请重新登录Origin。EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STR您的电邮地址和密码不匹配。请重试。EBISU_LOGIN_NEW_PASSWORD_SENT_STR一封电子邮件已经发至EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STR您的Origin帐户已成功创建,而且您目前已登录。现在就开始使用并与好友联系!EBISU_ERROR_SEARCH_NO_RESULTS_STR没有对应的搜索结果。EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRyyyy-mm-ddEBISU_ERROR_EMAIL_TOO_LONG_STR电邮地址太长了。EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STR这个Origin帐户已不存在。EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STR您的装置内存不足。为使 Origin 能够更加顺畅地运行,我们建议您删除一些不使用的应用程序。EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STR对不起,您的装置现在不能发送文本信息。EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STR对不起,您的装置现在还没建立电邮帐户。EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STR您确定要修改密码吗?您每次登录 Origin 都要使用它。[确定] [取消]EBISU_FRIENDS_PLAYER_STR玩家EBISU_STRING_TODAY_WITH_DATE_STR今天%DATE%EBISU_STRING_ONE_DAY_AGO_STR1天前EBISU_STRING_DAYS_AGO_STR%DAYS%天前EBISU_STRING_ONE_WEEK_AGO_STR1个星期前EBISU_STRING_WEEKS_AGO_STR%WEEKS%个星期前EBISU_STRING_ONE_MONTH_AGO_STR1个月前EBISU_STRING_FACEBOOK_TOS_STR通过我登录Facebook,我同意让别人以我的Facebook名字搜索我。EBISU_STRING_GMAIL_AUTH_FAILED_STR您输入的用户名或密码不正确。EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STR您已成功创建 Origin 帐户!现在就查找和添加好友,向他们发出挑战吧。[BUTTON] 确定EBISU_STRING_PRIVACY_CAPS_COLON_STR保密EBISU_STRING_JOIN_EBISU_STR加入Origin!EBISU_STRING_WELCOME_BACK_USER_STR欢迎您回来 %USERNAME%!EBISU_FRIENDS_PENDING_STR待处理EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STR请稍候。EBISU_FRIENDS_LAUNCH_MANUALLY_STR抱歉——您需要手动运行 %GAMENAME%。若已删除了该游戏,您可以再次下载。EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STR对不起,您的装置现在不能发送文本信息。EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STR您已成功创建 Origin 帐户!现在就查找和添加好友,向他们发出挑战吧。[BUTTON] 确定EBISU_FRIENDS_GO_STR进入EBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STR对不起,您的装置现在还没建立电邮帐户。EBISU_ERROR_CONN_TIMED_OUT_2_STR您的连接已超时。请再试一次或选择“确定”以修改网络设置。[BUTTON] 重试 [BUTTON] 确定EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STR您确定要修改密码吗?您每次登录 Origin 都要使用它。[确定] [取消]EBISU_FRIENDS_PLAYER_2_STR玩家EBISU_STRING_MONTHS_AGO_STR %MONTHS%个月前EBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STR您可使用我们的建议,或用自己的选择。EBISU_LOGIN_MOBILE_STR手机EBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@我同意EA的 @a href=\"http://privacy\"@保密协议@/a@ 和 @a href=\"http://tos\"@服务条款@/a@@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STR请确保您输入的信息是完整和正确的。EBISU_FRIENDS_NO_FRIENDS_TITLE_STR现在就添加您的好友!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STR分享成绩,挑战好友及得知新游戏!EBISU_STRING_ADD_FRIENDS_GMAIL_STR搜寻联络名单找好友。EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STR成功注册后,即表示我同意允许别人通过电邮地址搜索我,和让我的游戏过程自动发布。这些选项均能通过个人资料更改。EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STR高分榜EBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STR游戏成就EBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STR与好友分享EBISU_PROFILE_SETTINGS_NEWSSETTINGS_STR消息配置EBISU_LOGIN_AGE_STR年龄EBISU_PROFILE_ABOUT_STR最终用户许可协议EBISU_LOGO_LOGO_INSTRUCTIONS_STR点击Origin标志以返回您的游戏。 再点击则来回切换。EBISU_NEWS_NO_INVITES_STR暂时没有好友邀请。敬请期待!EBISU_NEWS_NO_INVITES_DESCRIPTION_STR天天回来查看好友邀请和挑战。EBISU_PROFILE_INFO_STR信息EBISU_LOGIN_TRY_AGAIN_STR清在试一次EBISU_ERROR_ENTER_VALID_AGE_STR请输入有效年龄。EBISU_LOGIN_AUTO_LOGGING_IN_STR自动登录中。。。EBISU_STRING_JOIN_EBISU_TITLE_STR我觉得Origin很酷。你也会有同感。加入它我们就可以成为好友!EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STR,内含重置您的密码的操作指示。EBISU_ERROR_PASSWORD_INVALID_STR密码无效。EBISU_ERROR_TOS_TOO_LONG_STR服务条款太长。EBISU_STRING_START_NOW_STR是的!现在开始!EBISU_LOGO_PLAYER_STR玩家EBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STR请使用您的主要Origin帐户更改您的Facebook配置。EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STR使您的个人资料公开以让好友看得见。EBISU_FRIEND_REMOVE_CONFIRMATION_STR您确定吗?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STR%USERNAME%將會從您的朋友名單中刪除。您可以日後再重新添加他們。EBISU_FRIEND_IGNORING_CHALLENGE_STR忽略請求。。。EBISU_FRIEND_ACCEPTING_REQUEST_STR接受朋友請求。。。EBISU_FRIEND_DECLINING_REQUEST_STR拒絕朋友請求。。。EBISU_FRIEND_SENDING_BLOCK_STR请求发送EBISU_FRIEND_SENDING_REPORT_STR请求发送EBISU_LOGIN_RECEIVE_EA_UPDATE_STR我希望获取EA游戏消息和信息。EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STR抱歉,您不符合注册条件。EBISU_PROFILE_ERROR_FACEBOOK_STR请登录到FacebookEBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STR在保存前请选择其中一个可选设置。。EBISU_ERROR_USERNAME_NOT_ALLOWED_STR这用户名是不允许的。请另选一个或采用我们的建议。EBISU_PROFILE_SETTINGS_SEACHABLEOK_STR是,让成员通过电邮地址搜寻我。EBISU_EMAIL_INVITE_SUBJECT_STR加入 Origin 的邀请EBISU_ERROR_LOG_INTO_FACEBOOK_STR请登录 Facebook。EBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STR玩过的游戏EBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STR已经拥有一个EA帐户?请在下面输入密码。EBISU_ERROR_REAL_NAME_TOO_LONG您输入的真实姓名太长了EBISU_ERROR_REAL_NAME_INVALID_CHARACTERS请在输入真实姓名时使用字母数字字符EBISU_ERROR_TOO_MANY_ATTEMPTS您试图登录Origin太多次了。请等一会儿再试。EBISU_FRIENDS_SENT_REQUEST_TITLE_STR请求发送EBISU_SENDING_REQUEST_STR发送请求EBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STREBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STREBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STR在联系人中搜索您的好友?EBISU_FRIEND_PERMISSION_CONTACTS_STR为了找到您的好友,您的联系人信息将临时与我们的服务器共享来匹配已存在的Origin用户。我们不会保留该信息。 \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/Dutch Text.plist b/app/src/main/assets/EASP/Origin/resources/Dutch Text.plist new file mode 100644 index 0000000..7d10943 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/Dutch Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR* Echte naamEBISU_LOGIN_OPTIONAL_INFO_STR*Duid optionele informatie aan.EBISU_ACHIEVEMENT_USER_DOING_GREAT_STR%USERNAME%, je doet het super! Wil je je highscore delen op Origin?EBISU_FRIENDS_GAME_LIST_TITLE_STRSpellen van %USERNAME%EBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% heeft je beste tijd verbroken in %GAMENAME%.EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% heeft je score verbroken in %GAMENAME%.EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% heeft je een vriendschapsverzoek gestuurd.EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STRGeboortedatum is verplicht.EBISU_ERROR_WIFI_REQUIRED_STRJe hebt een WiFi-verbinding nodig om op Origin in te loggen van %GAMENAME%.EBISU_ERROR_WIFI_3G_REQUIRED_STRJe hebt een WiFi- of 3G-verbinding nodig om op Origin in te loggen van %GAMENAME%.EBISU_NEWS_ACCEPT_STRAanvaardenEBISU_NEWS_ACCEPTED_FRIEND_STRHeeft vriendschapsverzoek aanvaardEBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STRHet privacybeleid is momenteel niet beschikbaar.EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STRDe Algemene Voorwaarden zijn momenteel niet beschikbaar.EBISU_ERROR_TOS_FAILURE_STRDe Algemene Voorwaarden zijn momenteel niet beschikbaar.EBISU_ERROR_TOS_NOT_FOUND_STRDe Algemene Voorwaarden zijn momenteel niet beschikbaar.EBISU_NEWS_ACHIEVEMENT_UNLOCK_STRTrofee vrijgespeeld: EBISU_FRIENDS_ADD_STRToevoegenEBISU_FRIENDS_ADD_FRIENDS_TAB_STRVrienden toevoegenEBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STRVoeg je vrienden aan je netwerk toe!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STRVoeg je vrienden aan Origin toe!EBISU_PROFILE_ADD_GAMES_STRGames toevoegenEBISU_FRIENDS_ADD_YOUR_CONTACTS_STRVoeg je contacten toeEBISU_FRIENDS_AGE_STRLeeftijdEBISU_PROFILE_AGE_STRLeeftijdEBISU_PROFILE_SETTINGS_AGE_STRLeeftijdEBISU_ERROR_ALERT_STRBerichtEBISU_FRIENDS_ALREADY_ADDED_STRAl toegevoegdEBISU_LOGIN_INVITATION_SENT_STREr werd een uitnodiging gestuurd naar %EMAIL%EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STRHeb je problemen om in te loggen?EBISU_FRIENDS_BACK_STRTerugEBISU_PROFILE_SETTINGS_BACK_STRTerugEBISU_FRIENDS_BLOCK_STRBlokkerenEBISU_FRIENDS_BLOCK_USER_STR%USERNAME% blokkeren?EBISU_FRIENDS_BUY_STRFå detEBISU_PROFILE_BUY_NOW_STRFå detEBISU_GMAIL_CANCEL_STRAnnulerenEBISU_FRIENDS_CHALLENGE_STRUitdagingEBISU_PROFILE_CHALLENGE_STRUitdagingEBISU_NEWS_CHALLENGE_STRUitdagingEBISU_LOGIN_CHANGE_USERNAME_STRVerander gebruikersnaamEBISU_LOGIN_CHECKING_EMAIL_STRE-mailadres aan het controlerenEBISU_FRIENDS_COMMENT_STROpmerkingEBISU_LOGIN_COMPLETE_SETUP_STRSet-up voltooienEBISU_LOGIN_CONFIRM_STRBevestigEBISU_PROFILE_SETTINGS_CONFIRM_STRBevestigEBISU_LOGIN_CONGRATULATIONS_STRGefeliciteerd!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STRGefeliciteerd %USERNAME%, je hebt net een snelle tijd behaald! Wil je zien hoe goed je hiermee scoort op Origin?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STRGefeliciteerd %USERNAME%, je hebt net een snelle tijd behaald! Wil je jouw rangschikking op Origin bekijken?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STRGefeliciteerd %USERNAME%, je hebt net een highscore behaald! Wil je zien hoe goed je hiermee scoort op Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STRGefeliciteerd %USERNAME%, je hebt net een highscore behaald! Wil je jouw rangschikking op Origin bekijken?EBISU_FRIENDS_CONNECT_FB_STRVerbinden met FacebookEBISU_FRIENDS_CONNECT_GOOGLE_STRVerbinden met GoogleEBISU_FRIENDS_CONTACTS_STRContactenEBISU_LOGIN_CONTINUE_STRDoorgaanEBISU_LOGIN_CREATE_ACCOUNT_STRAccount aanmakenEBISU_LOGIN_DATE_OF_BIRTH_STRGeboortedatumEBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STRGeboortedatumEBISU_FRIENDS_DELETE_STRVerwijderenEBISU_FRIENDS_DELETING_FRIEND_STRVriend aan het verwijderen...EBISU_NEWS_DISMISS_STRNegerenEBISU_PROFILE_DISPLAY_STRBeeldschermEBISU_PROFILE_SETTINGS_DISPLAY_NAME_STRWeergavenaam:EBISU_GMAIL_DONE_STRKlaarEBISU_PROFILE_EDIT_STRBewerkenEBISU_NEWS_EDIT_STRBewerkenEBISU_FRIENDS_EMAIL_STRE-mail:EBISU_INVITE_EMAIL_STRE-mailEBISU_PROFILE_EMAIL_STRE-mail:EBISU_LOGIN_EMAIL_STRE-mailEBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STRE-mailadres en wachtwoord bestaan al.EBISU_ERROR_EMAIL_REQUIRED_STRE-mailadres is vereist om door te gaan.EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STRE-mail, gebruikersnaamEBISU_PROFILE_SETTINGS_EMAIL_STRE-mailEBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STRVoer res inEBISU_LOGIN_ENTER_PHONE_NUMBER_STRVoer je telefoonnummer in om tekstberichten en meer te ontvangen!EBISU_LOGIN_ACCOUNT_STRVoer jouw e-mailadres in om in te loggen of om een account aan te maken.EBISU_ERROR_ERROR_TITLE_STRFoutEBISU_GMAIL_GMAILPLACEHOLDER_STRexample@gmail.comEBISU_RETURN_EXIT_STRAfsluitenEBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRFacebookvriendenEBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRFacebookinstellingenEBISU_ERROR_FAILED_TO_DELETE_FRIEND_STRKon vriend niet verwijderen.EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STRKon nieuwsitem niet verwijderen.EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STRKon aanvaarding niet versturen.EBISU_ERROR_FAILED_TO_SEND_DECLINE_STRKon afwijzing niet versturen.EBISU_PROFILE_SETTINGS_FEMALE_STRVrouwEBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STRVind vrienden via contacten.EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STRVind vrienden en wordt gevonden via Facebook. EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STRVind vrienden en wordt gevonden via Gmail. EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STRVind vriend op OriginEBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STROntdek welke games jouw vrienden spelen!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STRVind je vrienden op OriginEBISU_LOGIN_FORGOT_PASSWORD_STRWachtwoord vergeten? EBISU_FRIENDS_FRI_STRVrijEBISU_NEWS_FRI_STRVrijEBISU_NEWS_FRIEND_REQUEST_BODY_STR heeft je een vriendschapsverzoek gestuurd.EBISU_NEWS_FRIEND_REQUEST_STRVriendschapsverzoekEBISU_CAT_FRIENDS_STRVriendenEBISU_NAV_FRIENDS_STRVriendenEBISU_PROFILE_FRIENDS_ONLY_STRAlleen vriendenEBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STRAlleen vriendenEBISU_FRIENDS_FRIENDS_WHO_HAVE_STRVrienden met %GAMENAME%EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STRVrienden zonder %GAMENAME%EBISU_FRIENDS_GENDER_STRGeslacht:EBISU_PROFILE_SETTINGS_GENDER_STRGeslachtEBISU_PROFILE_GENDER_STRGeslacht:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STROntvang nieuwsberichten en exclusieve aanbiedingen van EA!EBISU_NEWS_GET_IT_STRFå detEBISU_ERROR_GETTING_USER_INFO_STRJouw info wordt opgehaald...EBISU_NEWS_GO_TO_STROKEBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRGooglevriendenEBISU_NEWS_HIGH_SCORE_STRHighscoreEBISU_FRIENDS_HOME_STRHomeEBISU_PROFILE_HOME_STRHomeEBISU_PROFILE_SETTINGS_HOME_STRHomeEBISU_LOGIN_AGREE_PP_TOS_STRIk ga akkoord met het privacybeleid en de algemene voorwaarden.EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIAIk wil gevonden kunnen worden via:EBISU_NEWS_IGNORE_STRNegerenEBISU_FRIENDS_CONTACTS_IN_STROP OriginEBISU_ERROR_INCORRECT_LOGIN_INFO_STRIncorrecte login informatieEBISU_FRIENDS_INVITE_STRUitnodigenEBISU_FRIENDS_CHOOSE_SMS_EMAIL_STRVrienden op Origin uitnodigenEBISU_FRIENDS_SENTINVITE_STRUitnodiging verstuurdEBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STRNodig je vrienden op Origin uitEBISU_NEWS_INVITES_STRUitnodigingenEBISU_LOGIN_DUMMY_REAL_NAME_STRJohn DoeEBISU_FRIENDS_LAST_LOGIN_STRLaatste Login:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STRLaatste Login:EBISU_NEWS_LAST_UPDATE_STRLaatste update: %TIME%EBISU_NEWS_LASTUPDATE_NEVER_STRLaatst geüpdatet: NooitEBISU_NEWS_LAUNCH_STROpstartenEBISU_PROFILE_LEGEND_STRLegendaEBISU_PROFILE_SETTINGS_LOADING_STRBezig met ladenEBISU_LOGIN_LOGIN_STRInloggenEBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRAanmelden bij FacebookEBISU_PROFILE_LOGOUT_STRAfmeldenEBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STRAfmelden bij FacebookEBISU_LOGIN_LOGGING_IN_STRAan het inloggen...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STRMaak nieuwe vrienden via uitdagingen!EBISU_PROFILE_SETTINGS_MALE_STRMannelijkEBISU_FRIENDS_MOBILE_STRMobiel:EBISU_PROFILE_MOBILE_STRMobiel:EBISU_PROFILE_SETTINGS_MOBILE_STRMobielEBISU_FRIENDS_MON_STRMaEBISU_NEWS_MON_STRMaEBISU_FRIENDS_MY_FRIENDS_TAB_STRMijn vriendenEBISU_PROFILE_MY_GAMES_STRMijn gamesEBISU_PROFILE_SETTINGS_MY_IMAGE_STRMy afbeeldingEBISU_NAV_PROFILE_STRMijn profielEBISU_PROFILE_MY_WISH_LIST_STRMijn verlanglijstEBISU_CAT_NEWS_STRNieuwsEBISU_NAV_NEWS_STRNieuwsEBISU_ACHIEVEMENT_NICE_JOB_STRGoed gedaan! Wil je jouw score delen en spelers op het Originnetwerk uitdagen?EBISU_ACHIEVEMENT_NICE_JOB_USER_STRGoed gedaan %USERNAME%! Wil je jouw prestatie delen op het Originnetwerk?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STRNee, mij niet zoeken via mijn Facebooknaam.EBISU_ACHIEVEMENT_NO_STRNee, bedanktEBISU_FRIENDS_CONTACTS_NOT_IN_STRNIET OP OriginEBISU_LOGIN_OK_STROKEBISU_ERROR_SOMETHING_WENT_WRONG_STROeps, er is iets fout gegaan...EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_INVALID_DOCUMENT_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_INVALID_LANGUAGE_CODE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_LICENSE_NOT_FOUND_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_REFERENCE_NOT_FOUND_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_REGISTRATION_FAILED_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_SERVER_USER_API_FAILURE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_SERVICE_FAILURE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_USER_CREATION_FAILED_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_USER_LISTING_FAILED_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STROeps, er is iets fout gegaan... Er is een onverwachte fout opgetreden.EBISU_PROFILE_OPT_IN_STRMeld je aanEBISU_PROFILE_OPT_OUT_STRMeld je afEBISU_LOGIN_PASSWORD_STRWachtwoordEBISU_PROFILE_SETTINGS_PASSWORD_STRWachtwoord wijzigenEBISU_GMAIL_PASSWORD_STRWachtwoordEBISU_ERROR_PASSWORD_REQUIRED_STRWachtwoord is vereist om door te gaan.EBISU_ERROR_PASSWORD_RESTRICTIONS_STRWachtwoord moet tussen 4 en 16 tekens bevatten.EBISU_FRIENDS_PENDINGINVITES_STRWachtende vriendenEBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STRAls je personen blokkeert, zullen zij jou niet kunnen uitdagen en jouw profiel niet kunnen bekijken.EBISU_PROFILE_PLAY_STRSpelenEBISU_FRIENDS_PLAYNOW_STRNu spelen?EBISU_FRIENDS_PLAYING_COLON_STRSpelen:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STRKies een gebruikersnaam om de set-up van jouw Origin account te voltooien. Gebruik eventueel onze suggestie!EBISU_ERROR_ENTER_USERNAME_STRVoer een gebruikersnaam in om door te gaan. EBISU_ERROR_ENTER_VALID_EMAIL_STRVoer een geldig e-mailadres in om door te gaan.EBISU_GMAIL_ENTERGMAILDATA_STRVoer jouw Gmail gebruikersnaam en wachtwoord in.EBISU_ERROR_USER_NOT_LOGGED_IN_STRLog in.EBISU_ERROR_REENTER_INFO_STRVoer je gegevens nog eens in om door te gaan. EBISU_ERROR_REENTER_INFO_CONTINUE_STRVoer je gegevens nog eens in om door te gaan. EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STRBekijk en aanvaard de algemene voorwaarden.EBISU_ERROR_SIGN_IN_STRLog in.EBISU_ERROR_SIGN_IN_TO_CONTINUE_STRLog in om door te gaan.EBISU_PROFILE_PRIVACY_POLICY_STRPrivacybeleidEBISU_PROFILE_PRIVATE_STRPrivéEBISU_PROFILE_SETTINGS_PRIVATE_STRPrivéEBISU_CAT_PROFILE_STRProfielEBISU_FRIENDS_PROFILE_STRProfielEBISU_NEWS_PROFILE_STRProfielEBISU_PROFILE_SETTINGS_TAB_STRProfielinstellingenEBISU_PROFILE_PROFILE_PRIVACY_STRProfiel/PrivacyinstellingenEBISU_PROFILE_PUBLIC_STROpenbaarEBISU_PROFILE_SETTINGS_PUBLIC_STROpenbaarEBISU_NEWS_PULLDOWN_TO_UPDATE_STRVeeg naar beneden op te updaten...EBISU_PROFILE_REAL_NAME_STREchte naam:EBISU_FRIENDS_REAL_NAME_STREchte naam:EBISU_PROFILE_SETTINGS_REAL_NAME_STREchte naamEBISU_LOGIN_RECOVER_MY_PASSWORD_STRMijn wachtwoord ophalenEBISU_LOGIN_REGISTER_NEW_USER_STRRegistreer nieuwe gebruiker.EBISU_LOGIN_REGISTERING_NEW_USER_STRNieuwe gebruiker aan het registeren...EBISU_NEWS_REJECT_STRAfwijzenEBISU_NEWS_RELEASE_TO_UPDATE_STRLoslaten om te updaten...EBISU_FRIENDS_BLOCKING_A_USER_STROnthoud, als je deze persoon blokkeert zal je geen contact meer met hem/haar kunnen opnemen.EBISU_NEWS_REMOVE_STRVerwijderenEBISU_FRIENDS_REMOVE_FRIEND_STRVerwijder vriendEBISU_FRIENDS_REPORT_STRRapporterenEBISU_FRIENDS_REPORT_USER_STRRapporteer %USERNAME%EBISU_FRIENDS_REPORT_BLOCK_STRRapporteer/BlokkeerEBISU_NEWS_REPORT_BLOCK_STRRapporteer/BlokkeerEBISU_ERROR_RESULTS_LOADING_STRResultaten aan het laden...EBISU_ERROR_RETRIEVING_STROphalenEBISU_RETURN_RETURN_TO_GAME_STRTerug naar spelEBISU_FRIENDS_SAT_STRFelheidEBISU_NEWS_SAT_STRFelheidEBISU_PROFILE_SETTINGS_SAVE_STROpslaanEBISU_PROFILE_SETTINGS_SAVING_STRBezig met opslaan...EBISU_FRIENDS_SEARCH_STRZoekenEBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STRDe zoekopdracht moet minstens 3 tekens bevatten.EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STRDe zoekopdracht moet minstens 3 tekens bevatten.EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STRDe zoekopdracht moet minstens 3 tekens bevatten.EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STRZoek op deze netwerken:EBISU_SEARCH_OPTIONS_STRZoekoptiesEBISU_FRIENDS_SEARCH_ORIGIN_STRZoek OriginEBISU_FRIENDS_SEARCH_RESULTS_STRZoekresultatenEBISU_FRIENDS_SEARCHRESULTS_STRZoekresultatenEBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STRZoekresultaten in ContactenEBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRZoekresultaten op FacebookEBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRZoekresultaten op GoogleEBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STRZoekresultaten op OriginEBISU_FRIENDS_SEARCHING_STRBezig met zoekenEBISU_FRIENDS_SENDING_FRIEND_REQUEST_STRBezig met versturen van jouw vriendschapsverzoek...EBISU_LOGIN_SETUP_ACCOUNT_STRAccount instellenEBISU_PROFILE_SETTINGS_EDIT_STRInstellingenEBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STRNee, ik wil niet gevonden kunnen worden via e-mail.EBISU_PROFILE_SETTINGS_NEWPASSWORD_STRNieuw wachtwoordEBISU_LOGIN_SETTING_UP_ACCOUNT_STRBezig met het instellen van jouw account...EBISU_NEWS_SHARE_STRDelenEBISU_PROFILE_SHOW_LESS_STRMinder weergevenEBISU_PROFILE_SHOW_MORE_STRMeer weergevenEBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STRAanmelden bij OriginEBISU_LOGIN_SIGN_IN_ORIGIN_STRAanmelden bij OriginEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STRLogin vereistEBISU_LOGIN_SIGN_UP_BUTTON_STRMeld je aan!EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STRSMSEBISU_ERROR_UNEXPECTED_ERROR_STREr is een onverwachte fout opgetreden. Probeer het nog eens.EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STRHelaas, wegens gebiedsbeperkingen kom je momenteel niet in aanmerking om je aan te sluiten Origin.EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STRHelaas, er bestaat geen account voorEBISU_ERROR_NO_RESULTS_FOUND_STRGeen resultaten gevonden. Probeer het nog eens.EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STRHelaas, je kunt momenteel geen toegang tot Origin verkrijgen.EBISU_ERROR_LOGIN_FAILED_STRHelaas, kon niet inloggen op Origin.EBISU_ERROR_SERVER_DOWN_STROnze servers liggen plat. Probeer het later nog eens.EBISU_ERROR_ID_ALREADY_TAKEN_STRHelaas, die gebruikersnaam bestaat al. Probeer een andere.EBISU_ERROR_DATE_OF_BIRTH_INVALID_STRDe geboortedatum die je hebt ingevoerd is niet geldig.EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STRE-mailadres en wachtwoord kunnen niet dezelfde. Probeer het nog eens.EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STRDe ingevoerde wachtwoorden komen niet overeen.EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STREr heeft zich een communicatieprobleem voorgedaan. Probeer het later nog eens.EBISU_ERROR_EMAIL_ADRESS_INVALID_STRDit e-mailadres is ongeldig.EBISU_ERROR_EMAIL_FORMAT_INVALID_STRHet formaat van het ingevoerde e-mailadres is ongeldig. Probeer het nog eens.EBISU_ERROR_USER_NOT_FOUND_STRDeze gebruikersnaam werd niet gevonden.EBISU_ERROR_DIDNT_RECEIVE_INFO_STRWij hebben jouw informatie niet ontvangen. Probeer het nog eens.EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STRHelaas, je komt momenteel niet in aanmerking om je aan te sluiten Origin.EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STRJe wachtwoord mag geen spaties bevatten. Probeer het nog eens.EBISU_FRIENDS_SUN_STRZonEBISU_NEWS_SUN_STRZonEBISU_PROFILE_TOS_STRAlgemene voorwaardenEBISU_ERROR_Origin_NET_NOT_REACHED_STRHet Originnetwerk kon niet worden bereikt. Controleer de netwerkverbinding en probeer het opnieuw.EBISU_ERROR_EMAIL_ALREADY_EXISTS_STRDit e-mailadres bestaat al op OriginEBISU_ERROR_INVALID_EMAIL_FORMAT_STRDit e-mailformaat is ongeldig.EBISU_ERROR_EMAIL_NOT_REGISTERED_STRDit e-mailadres staat momenteel niet geregistreerd bij Origin.EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STRDit kan even duren...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STRDeze gebruikersnaam bestaat al op Origin.EBISU_FRIENDS_THUR_STRDonEBISU_NEWS_THUR_STRDonEBISU_ERROR_DOMAIN_INVALID_STRVoer een geldig e-mailadres in om door te gaan.EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STRVoer het e-mailadres in dat gelinkt is met jouw account om je wachtwoord opnieuw in te stellen.EBISU_FRIENDS_TODAY_STRVandaagEBISU_NEWS_TODAY_STRVandaagEBISU_LOGIN_TRY_STRProbeerEBISU_FRIENDS_TUE_STRDiEBISU_NEWS_TUE_STRDiEBISU_LOGIN_SOMETHING_WENT_WRONG_STROeps, er is iets fout gegaan...EBISU_NEWS_UPDATES_STRUpdatesEBISU_ERROR_UPDATING_CHANGES_STRBezig met updaten...EBISU_LOGIN_USER_REGISTERED_STRGebruiker geregistreerd!EBISU_PROFILE_USERNAME_STRGebruikersnaam EBISU_LOGIN_USERNAME_STRGebruikersnaam EBISU_PROFILE_SETTINGS_USERNAME_STRGebruikersnaam EBISU_GMAIL_USERNAME_STRGebruikersnaam EBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STRGebruikersnaam en wachtwoord vereist om door te gaan.EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STRGebruikersnaam en wachtwoord moeten 4-12 tekens bevatten.EBISU_ERROR_USERNAME_REQUIRED_STRGebruikersnaam is vereist om door te gaan.EBISU_ERROR_USERNAME_RESTRICTIONS_STRGebruikersnaam moet tussen 4 en 12 tekens bevatten.EBISU_ERROR_USERNAME_NOT_AVAILABLE_STRGebruikersnaam niet beschikbaar.EBISU_ACHIEVEMENT_WAY_TO_GO_STRGoed zo! Wil je jouw score delen en spelers uitdagen op het Originnetwerk?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STRGoed zo %USERNAME%! Wil je jouw delen op het Originnetwerk?EBISU_ERROR_SEARCH_FAILED_STRWij hebben geen resultaten gevonden voor jouw zoekopdracht.EBISU_FRIENDS_WED_STRWoeEBISU_NEWS_WED_STRWoeEBISU_NAV_WELCOME_STRWelkomEBISU_LOGIN_WELCOME_BACK_STRWelkom terug!EBISU_ACHIEVEMENT_WELL_DONE_STRGoed gedaan! Wil je jouw score delen en spelers op het Originnetwerk uitdagen?EBISU_ACHIEVEMENT_WELL_DONE_USER_STRGoed gedaan %USERNAME%! Wil je andere %GAMENAME% spelers uitdagen op het Originnetwerk?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STRWat wil je doen?EBISU_LOGIN_WHY_JOIN_STRWat zijn de voordelen van Origin?EBISU_ACHIEVEMENT_YES_STRJaEBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STRJa, sta toe dat leden mij zoeken via mijn Facebooknaam.EBISU_FRIENDS_YESTERDAY_STRGisterenEBISU_NEWS_YESTERDAY_STRGisterenEBISU_ERROR_MUST_AGREE_TOS_AND_PP_STRJe moet akkoord gaan met de algemene voorwaarden en het privacybeleid om door te kunnen gaan.EBISU_ACHIEVEMENT_DOING_GREAT_STRGoed zo! Wil je jouw highscore delen en spelers op het Originnetwerk uitdagen?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STRJe werd uitgedaagd! %USERNAME% wil%GAMENAME% met jou spelen! Wil je de uitdaging aanvaarden? Haal dan nu %GAMENAME% in huis. EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STRJe werd uitgedaagd! %USERNAME% wil %GAMENAME% met jou spelen! EBISU_ERROR_CONN_TIMED_OUT_STRJouw verbinding is verbroken. Log opnieuw in op Origin.EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STRJouw e-mail en wachtwoord komen niet overeen. Probeer het nog eens.EBISU_LOGIN_NEW_PASSWORD_SENT_STRJouw nieuw wachtwoord werd gestuurd naarEBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STRJouw Origin account werd aangemaakt en je bent momenteel ingelogd. Begin alvast en kom in contact met vrienden!EBISU_ERROR_SEARCH_NO_RESULTS_STRJouw zoekopdracht heeft geen resultaten opgeleverd. EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRdd-mm-jjjjEBISU_ERROR_EMAIL_TOO_LONG_STRHet e-mailadres is te lang.EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STRDeze Origin account bestaat niet meer.EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STRBeperkt toestelgeheugen. Om Origin vlotjes te laten lopen, raden wij je aan om apps die je niet gebruikt te verwijderen.EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRJouw toestel kan momenteel geen tekstberichten sturen.EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STREr is momenteel geen e-mailaccount ingesteld op jouw toestel.EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STRWeet je zeker dat je jouw wachtwoord wil veranderen? Je zal het nodig hebben om je aan te melden op Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_STRSpelerEBISU_STRING_TODAY_WITH_DATE_STRVandaag %DATE%EBISU_STRING_ONE_DAY_AGO_STR1 dag geledenEBISU_STRING_DAYS_AGO_STR%DAYS% dagen geledenEBISU_STRING_ONE_WEEK_AGO_STR1 week geledenEBISU_STRING_WEEKS_AGO_STR%WEEKS% weken geledenEBISU_STRING_ONE_MONTH_AGO_STR1 maand geledenEBISU_STRING_FACEBOOK_TOS_STRDoor in te loggen op Facebook, ga ik ermee om op mijn Facebooknaam te worden gezocht.EBISU_STRING_GMAIL_AUTH_FAILED_STRDe gebruikersnaam of het wachtwoord dat je hebt ingevoerd, is onjuist.EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STRJe hebt een Origin account aangemaakt! Ga nu op zoek naar vrienden om uit te dagen. [BUTTON] OKEBISU_STRING_PRIVACY_CAPS_COLON_STRPRIVACY:EBISU_STRING_JOIN_EBISU_STRWord lid van Origin!EBISU_STRING_WELCOME_BACK_USER_STRWelkom terug %USERNAME%.EBISU_FRIENDS_PENDING_STRIn behandelingEBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STRDit kan even duren.EBISU_FRIENDS_LAUNCH_MANUALLY_STRJe moet %GAMENAME% manueel opstarten. Als je het verwijderd hebt, kan je het opnieuw downloaden.EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRJouw toestel kan momenteel geen tekstberichten sturen.EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STRJe hebt een Origin account aangemaakt! Ga nu op zoek naar vrienden om uit te dagen. [BUTTON] OKEBISU_FRIENDS_GO_STROKEBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STREr is momenteel geen e-mailaccount ingesteld op jouw toestel.EBISU_ERROR_CONN_TIMED_OUT_2_STRVerbinding verbroken. Probeer opnieuw of selecteer OK om je netwerkinstellingen te veranderen. [BUTTON] OPNIEUW PROBEREN [BUTTON] OKEBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STRWeet je zeker dat je jouw wachtwoord wil veranderen? Je zal het nodig hebben om je aan te melden op Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_2_STRSpelerEBISU_STRING_MONTHS_AGO_STR %MONTHS% maanden geledenEBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STRGebruik onze suggestie of kies zelf.EBISU_LOGIN_MOBILE_STRMobielEBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@Ik ga akkoord met het @a href=\"http://privacy\"@Privacybeleid@/a@ en de @a href=\"http://tos\"@Algemene Voorwaarden EA@/a@@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STRZorg ervoor dat je volledige en juiste informatie invoert.EBISU_FRIENDS_NO_FRIENDS_TITLE_STRVoeg jouw vrienden nu toe!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STRDeel scores, daag vrienden uit en ontdek games!EBISU_STRING_ADD_FRIENDS_GMAIL_STRDoorzoek jouw contacten om vrienden te vinden.EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STRDoor mij te registeren, ga ik ermee akkoord dat personen mij kunnen zoeken via e-mail en dat mijn gameplay evenementen automatisch worden gepost. Deze opties kunnen gewijzigd worden in de profielinstellingen.EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STRHighscoresEBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STRIn-game prestatiesEBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STRDelen met vriendenEBISU_PROFILE_SETTINGS_NEWSSETTINGS_STRNieuwsinstellingenEBISU_LOGIN_AGE_STRLeeftijdEBISU_PROFILE_ABOUT_STRGebruikersovereenkomst(EULA) EBISU_LOGO_LOGO_INSTRUCTIONS_STRTik op het Origin logo om gelijk wanneer naar je spel terug te keren. Tik nog eens om heen en weer te toggelen.EBISU_NEWS_NO_INVITES_STRGeen nieuwe uitnodiging. Neem regelmatig een kijkje!EBISU_NEWS_NO_INVITES_DESCRIPTION_STRBezoek ons regelmatig om vriendschapsverzoeken en uitdagingen te bekijken.EBISU_PROFILE_INFO_STRInfoEBISU_LOGIN_TRY_AGAIN_STRProbeer opnieuwEBISU_ERROR_ENTER_VALID_AGE_STRVoer een geldige leeftijd in.EBISU_LOGIN_AUTO_LOGGING_IN_STRBezig met automatisch inloggen...EBISU_STRING_JOIN_EBISU_TITLE_STROrigin is cool. Registreer je ook, dan kunnen we vrienden zijn!EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STRmet instructies om je wachtwoord opnieuw in te stellen.EBISU_ERROR_PASSWORD_INVALID_STRWachtwoord is ongeldig.EBISU_ERROR_TOS_TOO_LONG_STRAlgemene Voorwaarden zijn te lang.EBISU_STRING_START_NOW_STRVrienden zoekenEBISU_LOGO_PLAYER_STRSpelerEBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STRGebruik je primaire Origin account om je Facebookinstellingen aan te passen.EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STRMaak je profiel openbaar, zodat jouw vrienden het kunnen zien.EBISU_FRIEND_REMOVE_CONFIRMATION_STRWeet je het zeker?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STR%USERNAME% zal verwijderd worden uit je vriendenlijst. Je kan hem/haar later altijd terug toevoegen.EBISU_FRIEND_IGNORING_CHALLENGE_STRUitdaging aan het negeren ...EBISU_FRIEND_ACCEPTING_REQUEST_STRVriendschapsverzoek aan het aanvaarden ...EBISU_FRIEND_DECLINING_REQUEST_STRVriendschapsverzoek aan het afwijzen ...EBISU_FRIEND_SENDING_BLOCK_STR%USERNAME% is nu geblokkeerd.EBISU_FRIEND_SENDING_REPORT_STRJe aanvraag om %USERNAME% te rapporteren, is verzonden.EBISU_LOGIN_RECEIVE_EA_UPDATE_STRIk wil EA nieuws en info krijgen.EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STRSorry, je voldoet niet aan de criteria voor registratie.EBISU_PROFILE_ERROR_FACEBOOK_STRLog in op Facebook.EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STRSelecteer een van de beschikbare instellingen voor je opslaat... EBISU_ERROR_USERNAME_NOT_ALLOWED_STRGebruikersnaam mag enkel letters en cijfers bevatten. Probeer het nog eens.EBISU_PROFILE_SETTINGS_SEACHABLEOK_STRJa, sta leden toe mij via mijn e-mailadres te zoeken.EBISU_EMAIL_INVITE_SUBJECT_STRUitnodiging om lid te worden van OriginEBISU_ERROR_LOG_INTO_FACEBOOK_STRLog in op Facebook.EBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STRSpellen gespeeldEBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STRHeb je al een EA Account? Voer je wachtwoord hieronder in.EBISU_ERROR_REAL_NAME_TOO_LONGDe echte naam die je hebt ingevoerd is te langEBISU_ERROR_REAL_NAME_INVALID_CHARACTERSGebruik alfanumerieke tekens voor echte naamEBISU_ERROR_TOO_MANY_ATTEMPTSJe hebt te veel keren geprobeerd om toegang tot Origin te krijgen. Wacht even voordat je het opnieuw probeert.EBISU_FRIENDS_SENT_REQUEST_TITLE_STRAanvraag verzondenEBISU_SENDING_REQUEST_STRVerzenden...EBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STRJaEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STRNejEBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STRVrienden zoeken in contactpersonen?EBISU_FRIEND_PERMISSION_CONTACTS_STROm je vrienden te kunnen vinden, worden je contactpersonen tijdelijk gedeeld met onze servers om overeenkomsten te zoeken met bestaande Origin-gebruikers. Deze gegevens worden door ons niet bewaard. \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/English Text.plist b/app/src/main/assets/EASP/Origin/resources/English Text.plist new file mode 100644 index 0000000..7340dda --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/English Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR* Real NameEBISU_LOGIN_OPTIONAL_INFO_STR*Denotes optional information.EBISU_ACHIEVEMENT_USER_DOING_GREAT_STR%USERNAME%, you’re doing great! Want to share your high score on Origin?EBISU_FRIENDS_GAME_LIST_TITLE_STR%USERNAME%'s GamesEBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% has beat your best time in %GAMENAME%.EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% has beat your high score in %GAMENAME%.EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% has sent you a friend request.EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STRA date of birth is required.EBISU_ERROR_WIFI_REQUIRED_STRA WiFi connection is required to log in to Origin from %GAMENAME%.EBISU_ERROR_WIFI_3G_REQUIRED_STRA WiFi or 3G connection is required to log in to Origin from %GAMENAME%.EBISU_NEWS_ACCEPT_STRAcceptEBISU_NEWS_ACCEPTED_FRIEND_STRAccepted friend requestEBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STRAccess to the Privacy Policy is not available at this time.EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STRAccess to the Terms of Service is not available at this time.EBISU_ERROR_TOS_FAILURE_STRAccess to the Terms of Service is not available at this time.EBISU_ERROR_TOS_NOT_FOUND_STRAccess to the Terms of Service is not available at this time.EBISU_NEWS_ACHIEVEMENT_UNLOCK_STRAchievement unlocked:EBISU_FRIENDS_ADD_STRAddEBISU_FRIENDS_ADD_FRIENDS_TAB_STRAdd FriendsEBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STRAdd friends to your network!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STRAdd your friends to Origin.EBISU_PROFILE_ADD_GAMES_STRAdd gamesEBISU_FRIENDS_ADD_YOUR_CONTACTS_STRAdd your contactsEBISU_FRIENDS_AGE_STRAgeEBISU_PROFILE_AGE_STRAgeEBISU_PROFILE_SETTINGS_AGE_STRAgeEBISU_ERROR_ALERT_STRAlertEBISU_FRIENDS_ALREADY_ADDED_STRAlready addedEBISU_LOGIN_INVITATION_SENT_STRAn invite has been sent to %EMAIL%EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STRAre you having trouble logging in?EBISU_FRIENDS_BACK_STRBackEBISU_PROFILE_SETTINGS_BACK_STRBackEBISU_FRIENDS_BLOCK_STRBlockEBISU_FRIENDS_BLOCK_USER_STRBlock %USERNAME%?EBISU_FRIENDS_BUY_STRGet ItEBISU_PROFILE_BUY_NOW_STRGet ItEBISU_GMAIL_CANCEL_STRCancelEBISU_FRIENDS_CHALLENGE_STRChallengeEBISU_PROFILE_CHALLENGE_STRChallengeEBISU_NEWS_CHALLENGE_STRChallengeEBISU_LOGIN_CHANGE_USERNAME_STRChange UsernameEBISU_LOGIN_CHECKING_EMAIL_STRChecking email addressEBISU_FRIENDS_COMMENT_STRCommentEBISU_LOGIN_COMPLETE_SETUP_STRComplete set upEBISU_LOGIN_CONFIRM_STRConfirmEBISU_PROFILE_SETTINGS_CONFIRM_STRConfirmEBISU_LOGIN_CONGRATULATIONS_STRCongratulations!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STRCongratulations! %USERNAME%, you have just achieved a fast time! Want to see how it ranks on Origin?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STRCongratulations! %USERNAME%, you have just achieved a fast time! Want to view your Origin ranking?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STRCongratulations! %USERNAME%, you have just achieved a high score! Want to see how it ranks on Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STRCongratulations! %USERNAME%, you have just achieved a high score! Want to view your Origin ranking?EBISU_FRIENDS_CONNECT_FB_STRConnect with FacebookEBISU_FRIENDS_CONNECT_GOOGLE_STRConnect with GoogleEBISU_FRIENDS_CONTACTS_STRContactsEBISU_LOGIN_CONTINUE_STRContinueEBISU_LOGIN_CREATE_ACCOUNT_STRCreate AccountEBISU_LOGIN_DATE_OF_BIRTH_STRDate of BirthEBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STRDate of BirthEBISU_FRIENDS_DELETE_STRDeleteEBISU_FRIENDS_DELETING_FRIEND_STRDeleting friend...EBISU_NEWS_DISMISS_STRDismissEBISU_PROFILE_DISPLAY_STRDisplayEBISU_PROFILE_SETTINGS_DISPLAY_NAME_STRDisplay Name:EBISU_GMAIL_DONE_STRDoneEBISU_PROFILE_EDIT_STREditEBISU_NEWS_EDIT_STREditEBISU_FRIENDS_EMAIL_STREmail:EBISU_INVITE_EMAIL_STREmailEBISU_PROFILE_EMAIL_STREmail:EBISU_LOGIN_EMAIL_STREmailEBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STREmail and password already exist.EBISU_ERROR_EMAIL_REQUIRED_STREmail is required to continue.EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STREmail, UsernameEBISU_PROFILE_SETTINGS_EMAIL_STREmailEBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STREnter emailEBISU_LOGIN_ENTER_PHONE_NUMBER_STREnter your mobile number to receive text notifications and more!EBISU_LOGIN_ACCOUNT_STREnter your email address to log in or to create an account.EBISU_ERROR_ERROR_TITLE_STRErrorEBISU_GMAIL_GMAILPLACEHOLDER_STRexample@gmail.comEBISU_RETURN_EXIT_STRExitEBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRFacebook FriendsEBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRFacebook SettingsEBISU_ERROR_FAILED_TO_DELETE_FRIEND_STRFailed to delete friend.EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STRFailed to remove news item.EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STRFailed to send acceptance.EBISU_ERROR_FAILED_TO_SEND_DECLINE_STRFailed to send decline.EBISU_PROFILE_SETTINGS_FEMALE_STRFemaleEBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STRFind friends via contacts.EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STRFind friends and be found via Facebook. EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STRFind friends and be found via Gmail.EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STRFind friends in OriginEBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STRFind out what games your friends are playing!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STRFind your friends in OriginEBISU_LOGIN_FORGOT_PASSWORD_STRForgot password?EBISU_FRIENDS_FRI_STRFriEBISU_NEWS_FRI_STRFriEBISU_NEWS_FRIEND_REQUEST_BODY_STRhas sent you a friend request.EBISU_NEWS_FRIEND_REQUEST_STRFriend RequestEBISU_CAT_FRIENDS_STRFriendsEBISU_NAV_FRIENDS_STRFriendsEBISU_PROFILE_FRIENDS_ONLY_STRFriends OnlyEBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STRFriends OnlyEBISU_FRIENDS_FRIENDS_WHO_HAVE_STRFriends with %GAMENAME%EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STRFriends without %GAMENAME%EBISU_FRIENDS_GENDER_STRGender:EBISU_PROFILE_SETTINGS_GENDER_STRGenderEBISU_PROFILE_GENDER_STRGender:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STRGet game news and exclusive Offers from EA!EBISU_NEWS_GET_IT_STRGet ItEBISU_ERROR_GETTING_USER_INFO_STRGetting your info...EBISU_NEWS_GO_TO_STRGoEBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRGoogle friendsEBISU_NEWS_HIGH_SCORE_STRHigh ScoreEBISU_FRIENDS_HOME_STRHomeEBISU_PROFILE_HOME_STRHomeEBISU_PROFILE_SETTINGS_HOME_STRHomeEBISU_LOGIN_AGREE_PP_TOS_STRI agree to the Privacy Policy and Terms of Service.EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIAI want to be searchable via:EBISU_NEWS_IGNORE_STRIgnoreEBISU_FRIENDS_CONTACTS_IN_STRIN OriginEBISU_ERROR_INCORRECT_LOGIN_INFO_STRIncorrect login informationEBISU_FRIENDS_INVITE_STRInviteEBISU_FRIENDS_CHOOSE_SMS_EMAIL_STRInvite friends to OriginEBISU_FRIENDS_SENTINVITE_STRInvite sentEBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STRInvite your friends to OriginEBISU_NEWS_INVITES_STRInvitesEBISU_LOGIN_DUMMY_REAL_NAME_STRJohn DoeEBISU_FRIENDS_LAST_LOGIN_STRLast Login:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STRLast Login:EBISU_NEWS_LAST_UPDATE_STRLast update: %TIME%EBISU_NEWS_LASTUPDATE_NEVER_STRLast updated: NeverEBISU_NEWS_LAUNCH_STRLaunchEBISU_PROFILE_LEGEND_STRLegendEBISU_PROFILE_SETTINGS_LOADING_STRLoadingEBISU_LOGIN_LOGIN_STRLog inEBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRLog in to FacebookEBISU_PROFILE_LOGOUT_STRLog outEBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STRLog out of FacebookEBISU_LOGIN_LOGGING_IN_STRLogging in...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STRMake new friends through game challenges!EBISU_PROFILE_SETTINGS_MALE_STRMaleEBISU_FRIENDS_MOBILE_STRMobile:EBISU_PROFILE_MOBILE_STRMobile:EBISU_PROFILE_SETTINGS_MOBILE_STRMobileEBISU_FRIENDS_MON_STRMonEBISU_NEWS_MON_STRMonEBISU_FRIENDS_MY_FRIENDS_TAB_STRMy FriendsEBISU_PROFILE_MY_GAMES_STRMy GamesEBISU_PROFILE_SETTINGS_MY_IMAGE_STRMy ImageEBISU_NAV_PROFILE_STRMy ProfileEBISU_PROFILE_MY_WISH_LIST_STRMy Wish ListEBISU_CAT_NEWS_STRNewsEBISU_NAV_NEWS_STRNewsEBISU_ACHIEVEMENT_NICE_JOB_STRNice job! Want to share your score and challenge players on the Origin network?EBISU_ACHIEVEMENT_NICE_JOB_USER_STRNice job, %USERNAME%! Want to share your achievement on the Origin network?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STRNo, do not search for me by my Facebook name.EBISU_ACHIEVEMENT_NO_STRNo, thanksEBISU_FRIENDS_CONTACTS_NOT_IN_STRNOT IN OriginEBISU_LOGIN_OK_STROKEBISU_ERROR_SOMETHING_WENT_WRONG_STROops! Something went wrong...EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_INVALID_DOCUMENT_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_INVALID_LANGUAGE_CODE_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_LICENSE_NOT_FOUND_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_REFERENCE_NOT_FOUND_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_REGISTRATION_FAILED_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_SERVER_USER_API_FAILURE_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_SERVICE_FAILURE_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_USER_CREATION_FAILED_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_USER_LISTING_FAILED_STROops! Something went wrong...An unexpected error has occurred.EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STROops! Something went wrong...An unexpected error has occurred.EBISU_PROFILE_OPT_IN_STROpt InEBISU_PROFILE_OPT_OUT_STROpt OutEBISU_LOGIN_PASSWORD_STRPasswordEBISU_PROFILE_SETTINGS_PASSWORD_STRChange PasswordEBISU_GMAIL_PASSWORD_STRPasswordEBISU_ERROR_PASSWORD_REQUIRED_STRPassword is required to continue.EBISU_ERROR_PASSWORD_RESTRICTIONS_STRPassword must be 4-16 characters.EBISU_FRIENDS_PENDINGINVITES_STRPending InvitesEBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STRPeople you block won't be able to challenge you or view your Profile.EBISU_PROFILE_PLAY_STRPlayEBISU_FRIENDS_PLAYNOW_STRPlay Now?EBISU_FRIENDS_PLAYING_COLON_STRPlaying:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STRPlease create a username to complete the set up of your Origin account. Use our suggestion if you like!EBISU_ERROR_ENTER_USERNAME_STRPlease enter a username to continue. EBISU_ERROR_ENTER_VALID_EMAIL_STRPlease enter a valid email address to continue.EBISU_GMAIL_ENTERGMAILDATA_STRPlease enter your Gmail username and password.EBISU_ERROR_USER_NOT_LOGGED_IN_STRPlease log in.EBISU_ERROR_REENTER_INFO_STRPlease re-enter your information to continue.EBISU_ERROR_REENTER_INFO_CONTINUE_STRPlease re-enter your information to continue. EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STRPlease review and accept the Terms of Service.EBISU_ERROR_SIGN_IN_STRPlease log inEBISU_ERROR_SIGN_IN_TO_CONTINUE_STRPlease log in to continue.EBISU_PROFILE_PRIVACY_POLICY_STRPrivacy PolicyEBISU_PROFILE_PRIVATE_STRPrivateEBISU_PROFILE_SETTINGS_PRIVATE_STRPrivateEBISU_CAT_PROFILE_STRProfileEBISU_FRIENDS_PROFILE_STRProfileEBISU_NEWS_PROFILE_STRProfileEBISU_PROFILE_SETTINGS_TAB_STRProfile SettingsEBISU_PROFILE_PROFILE_PRIVACY_STRProfile/Privacy SettingsEBISU_PROFILE_PUBLIC_STRPublicEBISU_PROFILE_SETTINGS_PUBLIC_STRPublicEBISU_NEWS_PULLDOWN_TO_UPDATE_STRPull down to update...EBISU_PROFILE_REAL_NAME_STRReal Name:EBISU_FRIENDS_REAL_NAME_STRReal Name:EBISU_PROFILE_SETTINGS_REAL_NAME_STRReal NameEBISU_LOGIN_RECOVER_MY_PASSWORD_STRRecover my passwordEBISU_LOGIN_REGISTER_NEW_USER_STRRegister new user.EBISU_LOGIN_REGISTERING_NEW_USER_STRRegistering new user...EBISU_NEWS_REJECT_STRDeclineEBISU_NEWS_RELEASE_TO_UPDATE_STRRelease to update...EBISU_FRIENDS_BLOCKING_A_USER_STRRemember, blocking will prevent all future contact with this person on Origin.EBISU_NEWS_REMOVE_STRRemoveEBISU_FRIENDS_REMOVE_FRIEND_STRRemove FriendEBISU_FRIENDS_REPORT_STRReportEBISU_FRIENDS_REPORT_USER_STRReport %USERNAME%EBISU_FRIENDS_REPORT_BLOCK_STRReport/BlockEBISU_NEWS_REPORT_BLOCK_STRReport/BlockEBISU_ERROR_RESULTS_LOADING_STRResults loading...EBISU_ERROR_RETRIEVING_STRRetrievingEBISU_RETURN_RETURN_TO_GAME_STRReturn to gameEBISU_FRIENDS_SAT_STRSatEBISU_NEWS_SAT_STRSatEBISU_PROFILE_SETTINGS_SAVE_STRSaveEBISU_PROFILE_SETTINGS_SAVING_STRSavingEBISU_FRIENDS_SEARCH_STRSearchEBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STRSearch entries must be at least 3 characters.EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STRSearch entries must be at least 3 characters.EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STRSearch entries must be at least 3 characters.EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STRSearch on these networks:EBISU_SEARCH_OPTIONS_STRSearch OptionsEBISU_FRIENDS_SEARCH_ORIGIN_STRSearch OriginEBISU_FRIENDS_SEARCH_RESULTS_STRSearch ResultsEBISU_FRIENDS_SEARCHRESULTS_STRSearch ResultsEBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STRSearch results in ContactsEBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRSearch results in FacebookEBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRSearch results in GoogleEBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STRSearch results in OriginEBISU_FRIENDS_SEARCHING_STRSearchingEBISU_FRIENDS_SENDING_FRIEND_REQUEST_STRSending your friend request...EBISU_LOGIN_SETUP_ACCOUNT_STRSet Up AccountEBISU_PROFILE_SETTINGS_EDIT_STRSettingsEBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STRNo, I don't want to be searchable by e-mail.EBISU_PROFILE_SETTINGS_NEWPASSWORD_STRNew PasswordEBISU_LOGIN_SETTING_UP_ACCOUNT_STRSetting up account...EBISU_NEWS_SHARE_STRShareEBISU_PROFILE_SHOW_LESS_STRShow LessEBISU_PROFILE_SHOW_MORE_STRShow MoreEBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STRLog in to OriginEBISU_LOGIN_SIGN_IN_ORIGIN_STRLog in to OriginEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STRLogin requiredEBISU_LOGIN_SIGN_UP_BUTTON_STRSign up!EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STRSMSEBISU_ERROR_UNEXPECTED_ERROR_STRSorry, an unexpected error occurred. Please try again.EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STRSorry, due to territory restrictions, you are not eligible to join Origin at this time.EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STRSorry, no account exists forEBISU_ERROR_NO_RESULTS_FOUND_STRSorry, no results were found. Please try again.EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STRSorry, Origin cannot be accessed at this time.EBISU_ERROR_LOGIN_FAILED_STRSorry, Origin login failed.EBISU_ERROR_SERVER_DOWN_STRSorry, our servers are down. Please try again later.EBISU_ERROR_ID_ALREADY_TAKEN_STRSorry, that username has already been taken. Please try another one.EBISU_ERROR_DATE_OF_BIRTH_INVALID_STRSorry, the date of birth you entered is not valid.EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STRSorry, the e-mail and password cannot be the same. Please try again.EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STRSorry, the passwords you entered do not match.EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STRSorry, there was a communication problem. Please try again later.EBISU_ERROR_EMAIL_ADRESS_INVALID_STRSorry, this e-mail address is invalid.EBISU_ERROR_EMAIL_FORMAT_INVALID_STRSorry, this e-mail format is invalid. Please try again.EBISU_ERROR_USER_NOT_FOUND_STRSorry, this username was not found.EBISU_ERROR_DIDNT_RECEIVE_INFO_STRSorry, we didn’t receive your information. Please try again.EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STRSorry, you are not eligible to join Origin at this time.EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STRSorry, your password cannot contain spaces. Please try again.EBISU_FRIENDS_SUN_STRSunEBISU_NEWS_SUN_STRSunEBISU_PROFILE_TOS_STRTerms of ServiceEBISU_ERROR_Origin_NET_NOT_REACHED_STRThe Origin network could not be reached. Please check your network connection and try again.EBISU_ERROR_EMAIL_ALREADY_EXISTS_STRThis e-mail already exists in OriginEBISU_ERROR_INVALID_EMAIL_FORMAT_STRThis e-mail format is invalid.EBISU_ERROR_EMAIL_NOT_REGISTERED_STRThis e-mail is not currently registered in Origin.EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STRThis may take a moment...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STRThis username already exists in Origin.EBISU_FRIENDS_THUR_STRThurEBISU_NEWS_THUR_STRThurEBISU_ERROR_DOMAIN_INVALID_STRTo continue, please enter a valid email address.EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STRTo reset your password, enter the email address linked to your account.EBISU_FRIENDS_TODAY_STRTodayEBISU_NEWS_TODAY_STRTodayEBISU_LOGIN_TRY_STRTryEBISU_FRIENDS_TUE_STRTueEBISU_NEWS_TUE_STRTueEBISU_LOGIN_SOMETHING_WENT_WRONG_STRUh oh! Something went wrong...EBISU_NEWS_UPDATES_STRUpdatesEBISU_ERROR_UPDATING_CHANGES_STRUpdating...EBISU_LOGIN_USER_REGISTERED_STRUser registered!EBISU_PROFILE_USERNAME_STRUsernameEBISU_LOGIN_USERNAME_STRUsernameEBISU_PROFILE_SETTINGS_USERNAME_STRUsernameEBISU_GMAIL_USERNAME_STRUsername EBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STRUsername and password are required to continue.EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STRUsername and password must be 4-12 characters.EBISU_ERROR_USERNAME_REQUIRED_STRUsername is required to continue.EBISU_ERROR_USERNAME_RESTRICTIONS_STRUsername must be 4-12 characters.EBISU_ERROR_USERNAME_NOT_AVAILABLE_STRUsername not available.EBISU_ACHIEVEMENT_WAY_TO_GO_STRWay to go! Want to share your score and challenge players on the Origin network?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STRWay to go, %USERNAME%! Want to share your time on the Origin network?EBISU_ERROR_SEARCH_FAILED_STRWe did not find any matching Search results.EBISU_FRIENDS_WED_STRWedEBISU_NEWS_WED_STRWedEBISU_NAV_WELCOME_STRWelcomeEBISU_LOGIN_WELCOME_BACK_STRWelcome back!EBISU_ACHIEVEMENT_WELL_DONE_STRWell done! Want to share your score and challenge players on the Origin network?EBISU_ACHIEVEMENT_WELL_DONE_USER_STRWell done, %USERNAME%! Want to challenge other %GAMENAME% players on the Origin network?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STRWhat would you like to do?EBISU_LOGIN_WHY_JOIN_STRWhy should I join Origin?EBISU_ACHIEVEMENT_YES_STRYesEBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STRYes, allow members to search for me by my Facebook name.EBISU_FRIENDS_YESTERDAY_STRYesterdayEBISU_NEWS_YESTERDAY_STRYesterdayEBISU_ERROR_MUST_AGREE_TOS_AND_PP_STRYou must agree to the Terms of Service and Privacy Policy to continue.EBISU_ACHIEVEMENT_DOING_GREAT_STRYou’re doing great! Want to share your high score and challenge players on the Origin network?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STRYou’ve Been Challenged! %USERNAME% wants to play %GAMENAME% with you! Want to accept the Challenge? Get %GAMENAME% now. EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STRYou’ve Been Challenged! %USERNAME% wants to play %GAMENAME% with you! EBISU_ERROR_CONN_TIMED_OUT_STRYour connection has timed out. Please log back in to Origin.EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STRYour e-mail and password do not match. Please try again.EBISU_LOGIN_NEW_PASSWORD_SENT_STRAn email has been sent toEBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STRYour Origin account has been successfully created and you are currently logged in. Get started now and connect with friends!EBISU_ERROR_SEARCH_NO_RESULTS_STRYour search yielded no results. EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRdd-mm-yyyyEBISU_ERROR_EMAIL_TOO_LONG_STREmail address is too long.EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STRThis Origin account no longer exists.EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STRYour device is running low on memory. In order for Origin to run more smoothly, we recommend deleting any apps that you aren't using.EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRSorry, your device cannot send text messages at this time.EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRSorry, an email account is not set up on your device at this time.EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STRAre you sure you want to change your password? You'll need to use it wherever you log in to Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_STRPlayerEBISU_STRING_TODAY_WITH_DATE_STRToday %DATE%EBISU_STRING_ONE_DAY_AGO_STR1 day agoEBISU_STRING_DAYS_AGO_STR%DAYS% days agoEBISU_STRING_ONE_WEEK_AGO_STR1 week agoEBISU_STRING_WEEKS_AGO_STR%WEEKS% weeks agoEBISU_STRING_ONE_MONTH_AGO_STROne month agoEBISU_STRING_FACEBOOK_TOS_STRBy Logging into Facebook, I consent to being searched by my Facebook name.EBISU_STRING_GMAIL_AUTH_FAILED_STRThe username or password you entered is incorrect.EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STRYou successfully created an Origin account! Now find and add friends to challenge. [BUTTON] OKEBISU_STRING_PRIVACY_CAPS_COLON_STRPRIVACY:EBISU_STRING_JOIN_EBISU_STRJoin Origin!EBISU_STRING_WELCOME_BACK_USER_STRWelcome back, %USERNAME%.EBISU_FRIENDS_PENDING_STRPendingEBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STRThis may take a moment.EBISU_FRIENDS_LAUNCH_MANUALLY_STRSorry, you'll need to launch %GAMENAME% manually. If you've deleted it, you can download it again.EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRSorry, your device cannot send text messages at this time.EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STRYou successfully created an Origin account! Now find and add friends to challenge. [BUTTON] OKEBISU_FRIENDS_GO_STRGoEBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRSorry, an email account is not set up on your device at this time.EBISU_ERROR_CONN_TIMED_OUT_2_STRYour connection timed out. Try again or select OK to change your network settings. [BUTTON] RETRY [BUTTON] OKEBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STRAre you sure you want to change your password? You will need to use it wherever you sign in to Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_2_STRPlayerEBISU_STRING_MONTHS_AGO_STR %MONTHS% months agoEBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STRUse our suggestion or choose your own.EBISU_LOGIN_MOBILE_STRMobileEBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@I agree to the EA @a href=\"http://privacy\"@Privacy Policy@/a@ and @a href=\"http://tos\"@Terms of Service@/a@@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STRPlease be sure to enter complete and accurate information.EBISU_FRIENDS_NO_FRIENDS_TITLE_STRAdd Your Friends Now!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STRShare scores, challenge friends and discover games!EBISU_STRING_ADD_FRIENDS_GMAIL_STRSearch your contacts to find friends.EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STRBy signing up, I agree to be searchable via email and have my gameplay events automatically posted. These options can be changed in the profile settings.EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STRHigh ScoresEBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STRIn-Game AchievementsEBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STRShare With FriendsEBISU_PROFILE_SETTINGS_NEWSSETTINGS_STRNews SettingsEBISU_LOGIN_AGE_STRAgeEBISU_PROFILE_ABOUT_STREULA EBISU_LOGO_LOGO_INSTRUCTIONS_STRTap the Origin logo to return to your game at any time. Tap again to toggle back and forth.EBISU_NEWS_NO_INVITES_STRNo new invites. Stay tuned!EBISU_NEWS_NO_INVITES_DESCRIPTION_STRCheck back daily for friend invites and challenges.EBISU_PROFILE_INFO_STRInfoEBISU_LOGIN_TRY_AGAIN_STRTry againEBISU_ERROR_ENTER_VALID_AGE_STRPlease enter a valid age.EBISU_LOGIN_AUTO_LOGGING_IN_STRAuto logging in...EBISU_STRING_JOIN_EBISU_TITLE_STRI think Origin is cool. So will you. Join it and we can be friends!EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STRwith instructions on how to reset your password.EBISU_ERROR_PASSWORD_INVALID_STRPassword is invalid.EBISU_ERROR_TOS_TOO_LONG_STRTerms of Service is too long.EBISU_STRING_START_NOW_STRFind FriendsEBISU_LOGO_PLAYER_STRPlayerEBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STRPlease use your primary Origin account to edit your Facebook settings.EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STRSet your profile to public so your friends can see it.EBISU_FRIEND_REMOVE_CONFIRMATION_STRAre you sure?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STR%USERNAME% will be removed from your friends list. You can always re-add them later.EBISU_FRIEND_IGNORING_CHALLENGE_STRIgnoring challenge ...EBISU_FRIEND_ACCEPTING_REQUEST_STRAccepting friend request ...EBISU_FRIEND_DECLINING_REQUEST_STRDeclining friend request ...EBISU_FRIEND_SENDING_BLOCK_STR%USERNAME% is now blocked.EBISU_FRIEND_SENDING_REPORT_STRYour request to report %USERNAME% has been sent.EBISU_LOGIN_RECEIVE_EA_UPDATE_STRI'd like to receive EA game news and info.EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STRSorry, you do not meet the requirements for registration.EBISU_PROFILE_ERROR_FACEBOOK_STRPlease log in to Facebook.EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STRPlease select one of the available settings before saving..EBISU_ERROR_USERNAME_NOT_ALLOWED_STRUsername is not allowed. Please choose a different one or use the suggested one.EBISU_PROFILE_SETTINGS_SEACHABLEOK_STRYes, let members search for me by e-mail.EBISU_EMAIL_INVITE_SUBJECT_STRInvitation to join OriginEBISU_ERROR_LOG_INTO_FACEBOOK_STRPlease log in to Facebook.EBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STRGames PlayedEBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STRAlready got an EA Account? Enter existing password below.EBISU_ERROR_REAL_NAME_TOO_LONGYour entry for Real Name is too longEBISU_ERROR_REAL_NAME_INVALID_CHARACTERSPlease use alphanumeric characters for Real NameEBISU_ERROR_TOO_MANY_ATTEMPTSYou’ve attempted to access Origin too many times. Please wait before trying again.EBISU_FRIENDS_SENT_REQUEST_TITLE_STRRequest sentEBISU_SENDING_REQUEST_STRSending RequestEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STRYesEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STRNoEBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STRSearch for Your Friends in Contacts?EBISU_FRIEND_PERMISSION_CONTACTS_STRIn order to find your friends, your contacts will be shared temporarily with our servers to match with existing Origin users. We do not retain this information. \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/French Text.plist b/app/src/main/assets/EASP/Origin/resources/French Text.plist new file mode 100644 index 0000000..8ea9955 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/French Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR*Nom RéelEBISU_LOGIN_OPTIONAL_INFO_STR*Indique une information facultativeEBISU_ACHIEVEMENT_USER_DOING_GREAT_STRBeau travail, %USERNAME% ! Voulez-vous partager votre record sur le réseau Origin ?EBISU_FRIENDS_GAME_LIST_TITLE_STRJeux de %USERNAME%EBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% a battu votre meilleur temps à %GAMENAME%.EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% a battu votre record à %GAMENAME%.EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% vous a envoyé une requête d'amis.EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STRIndiquez la date de naissance.EBISU_ERROR_WIFI_REQUIRED_STRUne connexion Wi-Fi est nécessaire pour vous connecter à Origin depuis %GAMENAME%.EBISU_ERROR_WIFI_3G_REQUIRED_STRUne connexion Wi-Fi ou 3G est nécessaire pour vous connecter à Origin depuis %GAMENAME%.EBISU_NEWS_ACCEPT_STRAccepterEBISU_NEWS_ACCEPTED_FRIEND_STRRequête d'amis acceptéeEBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STRL'accès à la Charte de confidentialité n'est pas disponible pour le moment.EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STRL'accès aux Conditions d'utilisation n'est pas disponible pour le moment.EBISU_ERROR_TOS_FAILURE_STRL'accès aux Conditions d'utilisation n'est pas disponible pour le moment.EBISU_ERROR_TOS_NOT_FOUND_STRL'accès aux Conditions d'utilisation n'est pas disponible pour le moment.EBISU_NEWS_ACHIEVEMENT_UNLOCK_STRSuccès débl. :EBISU_FRIENDS_ADD_STRAjouterEBISU_FRIENDS_ADD_FRIENDS_TAB_STRAjouter AmisEBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STRAjoutez des amis à votre réseau !EBISU_ERROR_ADD_FRIENDS_TO_Origin_STRAjoutez des amis à votre réseau Origin.EBISU_PROFILE_ADD_GAMES_STRAjouter des jeuxEBISU_FRIENDS_ADD_YOUR_CONTACTS_STRAjouter vos contactsEBISU_FRIENDS_AGE_STRÂgeEBISU_PROFILE_AGE_STRÂgeEBISU_PROFILE_SETTINGS_AGE_STRÂgeEBISU_ERROR_ALERT_STRAlerterEBISU_FRIENDS_ALREADY_ADDED_STRDéjà ajoutéEBISU_LOGIN_INVITATION_SENT_STRUne invitation a été envoyée à %EMAIL%EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STRAvez-vous des difficultés pour vous connecter ?EBISU_FRIENDS_BACK_STRRetourEBISU_PROFILE_SETTINGS_BACK_STRRetourEBISU_FRIENDS_BLOCK_STRBloquerEBISU_FRIENDS_BLOCK_USER_STRBloquer %USERNAME% ?EBISU_FRIENDS_BUY_STRAcheterEBISU_PROFILE_BUY_NOW_STRAcheterEBISU_GMAIL_CANCEL_STRAnnulerEBISU_FRIENDS_CHALLENGE_STRDéfierEBISU_PROFILE_CHALLENGE_STRDéfierEBISU_NEWS_CHALLENGE_STRDéfierEBISU_LOGIN_CHANGE_USERNAME_STRChanger l'identifiantEBISU_LOGIN_CHECKING_EMAIL_STRVérification de l'adresse e-mailEBISU_FRIENDS_COMMENT_STRCommenterEBISU_LOGIN_COMPLETE_SETUP_STRTerminer la configurationEBISU_LOGIN_CONFIRM_STRValiderEBISU_PROFILE_SETTINGS_CONFIRM_STRValiderEBISU_LOGIN_CONGRATULATIONS_STRFélicitations !EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STRFélicitations ! %USERNAME%, vous venez de réaliser un chrono ! Voulez-vous voir son classement sur Origin ?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STRFélicitations ! %USERNAME%, vous venez de réaliser un chrono ! Voulez-vous afficher votre classement Origin ?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STRFélicitations ! %USERNAME%, vous venez de réaliser un record ! Voulez-vous voir son classement sur Origin ?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STRFélicitations ! %USERNAME%, vous venez de réaliser un record ! Voulez-vous afficher votre classement Origin ?EBISU_FRIENDS_CONNECT_FB_STRConnexion à FacebookEBISU_FRIENDS_CONNECT_GOOGLE_STRConnexion à GoogleEBISU_FRIENDS_CONTACTS_STRContactsEBISU_LOGIN_CONTINUE_STRContinuerEBISU_LOGIN_CREATE_ACCOUNT_STRCréer un CompteEBISU_LOGIN_DATE_OF_BIRTH_STRDate de NaissanceEBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STRDate de NaissanceEBISU_FRIENDS_DELETE_STRSupprimerEBISU_FRIENDS_DELETING_FRIEND_STRSuppression d'un ami...EBISU_NEWS_DISMISS_STRAnnulerEBISU_PROFILE_DISPLAY_STRAfficherEBISU_PROFILE_SETTINGS_DISPLAY_NAME_STRAfficher le Nom :EBISU_GMAIL_DONE_STRTerminéEBISU_PROFILE_EDIT_STRModifierEBISU_NEWS_EDIT_STRModifierEBISU_FRIENDS_EMAIL_STRE-mail :EBISU_INVITE_EMAIL_STRE-mail EBISU_PROFILE_EMAIL_STRE-mail:EBISU_LOGIN_EMAIL_STRE-mailEBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STRL'adresse e-mail et le mot de passe existent déjà.EBISU_ERROR_EMAIL_REQUIRED_STRAdresse e-mail nécessaire pour continuer.EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STRE-mail, PseudoEBISU_PROFILE_SETTINGS_EMAIL_STRE-mailEBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STRSaisissez une adresse e-mailEBISU_LOGIN_ENTER_PHONE_NUMBER_STRSaisissez votre numéro de téléphone portable pour recevoir des notifications par texto et plus encore !EBISU_LOGIN_ACCOUNT_STRSaisissez votre adresse e-mail pour vous connecter ou créer un compte.EBISU_ERROR_ERROR_TITLE_STRErreurEBISU_GMAIL_GMAILPLACEHOLDER_STRexemple@gmail.comEBISU_RETURN_EXIT_STRQuitterEBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRAmis FacebookEBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRParamètres FacebookEBISU_ERROR_FAILED_TO_DELETE_FRIEND_STRÉchec de la suppression d'ami.EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STRÉchec de la suppression d'actu.EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STRÉchec d'envoi de l'acceptation.EBISU_ERROR_FAILED_TO_SEND_DECLINE_STRÉchec d'envoi du refus.EBISU_PROFILE_SETTINGS_FEMALE_STRFemmeEBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STRRetrouvez vos amis dans vos contacts.EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STRCherchez et aidez vos amis à vous trouver via Facebook.EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STRCherchez et aidez vos amis à vous trouver avec Gmail.EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STRVos amis sur OriginEBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STRDécouvrez à quels jeux jouent vos amis !EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STRTrouvez vos amis sur OriginEBISU_LOGIN_FORGOT_PASSWORD_STRMot de passe oubliéEBISU_FRIENDS_FRI_STRVenEBISU_NEWS_FRI_STRVenEBISU_NEWS_FRIEND_REQUEST_BODY_STRvous a envoyé une requête d'amis.EBISU_NEWS_FRIEND_REQUEST_STRRequête D'AmisEBISU_CAT_FRIENDS_STRAmisEBISU_NAV_FRIENDS_STRAmisEBISU_PROFILE_FRIENDS_ONLY_STRAmis UniquementEBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STRAmis UniquementEBISU_FRIENDS_FRIENDS_WHO_HAVE_STRAmis possédant %GAMENAME%EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STRAmis ne possédant pas %GAMENAME%EBISU_FRIENDS_GENDER_STRSexe :EBISU_PROFILE_SETTINGS_GENDER_STRSexeEBISU_PROFILE_GENDER_STRSexe :EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STRSoyez au courant des nouveautés de jeu et des offres exclusives d'EA !EBISU_NEWS_GET_IT_STRRécupérerEBISU_ERROR_GETTING_USER_INFO_STRRécupération de vos informationsEBISU_NEWS_GO_TO_STRAccéderEBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRAmis GoogleEBISU_NEWS_HIGH_SCORE_STRRecordEBISU_FRIENDS_HOME_STRDomicileEBISU_PROFILE_HOME_STRDomicileEBISU_PROFILE_SETTINGS_HOME_STRDomicileEBISU_LOGIN_AGREE_PP_TOS_STRJ'accepte la Charte de confidentialité et les Conditions d'utilisation.EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIAJe veux qu'on puisse me rechercher avec :EBISU_NEWS_IGNORE_STRIgnorerEBISU_FRIENDS_CONTACTS_IN_STRINSCRIT À OriginEBISU_ERROR_INCORRECT_LOGIN_INFO_STRInformations de connexion non validesEBISU_FRIENDS_INVITE_STRInviterEBISU_FRIENDS_CHOOSE_SMS_EMAIL_STRInviter des amis sur OriginEBISU_FRIENDS_SENTINVITE_STRInvitation envoyéeEBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STRInviter vos amis sur OriginEBISU_NEWS_INVITES_STRInvitationsEBISU_LOGIN_DUMMY_REAL_NAME_STRMartin DupondEBISU_FRIENDS_LAST_LOGIN_STRDernier jeu :EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STRDernier jeu :EBISU_NEWS_LAST_UPDATE_STRDernière mise à jour : %TIME%EBISU_NEWS_LASTUPDATE_NEVER_STRDernière mise à jour : JamaisEBISU_NEWS_LAUNCH_STRDémarrerEBISU_PROFILE_LEGEND_STRLégendeEBISU_PROFILE_SETTINGS_LOADING_STRChargementEBISU_LOGIN_LOGIN_STRSe connecterEBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRSe connecter à FacebookEBISU_PROFILE_LOGOUT_STRSe déconnecterEBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STRSe déconnecter de FacebookEBISU_LOGIN_LOGGING_IN_STRConnexion...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STRFaites-vous de nouveaux amis en les défiant à un jeu !EBISU_PROFILE_SETTINGS_MALE_STRHommeEBISU_FRIENDS_MOBILE_STRMobile :EBISU_PROFILE_MOBILE_STRMobile :EBISU_PROFILE_SETTINGS_MOBILE_STRMobileEBISU_FRIENDS_MON_STRLunEBISU_NEWS_MON_STRLunEBISU_FRIENDS_MY_FRIENDS_TAB_STRMes AmisEBISU_PROFILE_MY_GAMES_STRMes JeuxEBISU_PROFILE_SETTINGS_MY_IMAGE_STRMon imageEBISU_NAV_PROFILE_STRMon profilEBISU_PROFILE_MY_WISH_LIST_STRMa liste de souhaitsEBISU_CAT_NEWS_STRNouveautésEBISU_NAV_NEWS_STRNouveautésEBISU_ACHIEVEMENT_NICE_JOB_STRBien joué ! Voulez-vous partager votre score et défier les joueurs du réseau Origin ?EBISU_ACHIEVEMENT_NICE_JOB_USER_STRBien joué, %USERNAME% ! Voulez-vous annoncer votre succès sur le réseau Origin ?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STRNon, ne pas me rechercher avec mon nom Facebook.EBISU_ACHIEVEMENT_NO_STRNon, merciEBISU_FRIENDS_CONTACTS_NOT_IN_STRNON INSCRIT À OriginEBISU_LOGIN_OK_STROKEBISU_ERROR_SOMETHING_WENT_WRONG_STRAïe ! Il y a eu un problème...EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_INVALID_DOCUMENT_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_INVALID_LANGUAGE_CODE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_LICENSE_NOT_FOUND_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_REFERENCE_NOT_FOUND_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_REGISTRATION_FAILED_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_SERVER_USER_API_FAILURE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_SERVICE_FAILURE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_USER_CREATION_FAILED_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_USER_LISTING_FAILED_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STRAïe ! Il y a eu un problème... Une erreur inattendue est survenue.EBISU_PROFILE_OPT_IN_STRParticiperEBISU_PROFILE_OPT_OUT_STRNe pas ParticiperEBISU_LOGIN_PASSWORD_STRMot de passeEBISU_PROFILE_SETTINGS_PASSWORD_STRMot de PasseEBISU_GMAIL_PASSWORD_STRMot de PasseEBISU_ERROR_PASSWORD_REQUIRED_STRMot de passe nécessaire pour continuer.EBISU_ERROR_PASSWORD_RESTRICTIONS_STRLe mot de passe doit comporter de 4 à 16 caractères alphanumériques.EBISU_FRIENDS_PENDINGINVITES_STRInvitations en AttenteEBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STRLes personnes que vous bloquez ne pourront pas vous défier ou voir votre profil.EBISU_PROFILE_PLAY_STRJouerEBISU_FRIENDS_PLAYNOW_STRJouer Maintenant ?EBISU_FRIENDS_PLAYING_COLON_STREn jeu :EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STRVeuillez créer un identifiant pour terminer la configuration de votre compte Origin. Utilisez notre suggestion si vous le voulez !EBISU_ERROR_ENTER_USERNAME_STRVeuillez saisir un identifiant pour continuer. EBISU_ERROR_ENTER_VALID_EMAIL_STRVeuillez saisir une adresse e-mail valide pour continuer.EBISU_GMAIL_ENTERGMAILDATA_STRVeuillez saisir vos identifiant et mot de passe Gmail.EBISU_ERROR_USER_NOT_LOGGED_IN_STRVeuillez vous connecter.EBISU_ERROR_REENTER_INFO_STRVeuillez saisir à nouveau vos informations pour continuer.EBISU_ERROR_REENTER_INFO_CONTINUE_STRVeuillez saisir à nouveau vos informations pour continuer.EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STRVeuillez lire et accepter les Conditions d'utilisation.EBISU_ERROR_SIGN_IN_STRVeuillez vous connecterEBISU_ERROR_SIGN_IN_TO_CONTINUE_STRVeuillez vous connecter pour continuer.EBISU_PROFILE_PRIVACY_POLICY_STRConfidentialitéEBISU_PROFILE_PRIVATE_STRPrivéEBISU_PROFILE_SETTINGS_PRIVATE_STRPrivéEBISU_CAT_PROFILE_STRProfilEBISU_FRIENDS_PROFILE_STRProfilEBISU_NEWS_PROFILE_STRProfilEBISU_PROFILE_SETTINGS_TAB_STRParamètres du ProfilEBISU_PROFILE_PROFILE_PRIVACY_STRParamètres Profil/ConfidentialitéEBISU_PROFILE_PUBLIC_STRPublicEBISU_PROFILE_SETTINGS_PUBLIC_STRPublicEBISU_NEWS_PULLDOWN_TO_UPDATE_STRTirer vers le bas pour mettre à jourEBISU_PROFILE_REAL_NAME_STRPrénom / Nom:EBISU_FRIENDS_REAL_NAME_STRPrénom / Nom:EBISU_PROFILE_SETTINGS_REAL_NAME_STRPrénom / Nom:EBISU_LOGIN_RECOVER_MY_PASSWORD_STRRécupérer mon mot de passeEBISU_LOGIN_REGISTER_NEW_USER_STRInscrire un nouvel utilisateur.EBISU_LOGIN_REGISTERING_NEW_USER_STRInscription d'un nouvel utilisateur...EBISU_NEWS_REJECT_STRRejeterEBISU_NEWS_RELEASE_TO_UPDATE_STRRelâcher pour mettre à jourEBISU_FRIENDS_BLOCKING_A_USER_STRN'oubliez pas, le blocage empêchera tout contact futur avec cette personne sur Origin.EBISU_NEWS_REMOVE_STRSupprimerEBISU_FRIENDS_REMOVE_FRIEND_STRSupprimer un AmiEBISU_FRIENDS_REPORT_STRSignalerEBISU_FRIENDS_REPORT_USER_STRSignaler %USERNAME%EBISU_FRIENDS_REPORT_BLOCK_STRSignaler/BloquerEBISU_NEWS_REPORT_BLOCK_STRSignaler/BloquerEBISU_ERROR_RESULTS_LOADING_STRChargement des résultats...EBISU_ERROR_RETRIEVING_STRRécupérationEBISU_RETURN_RETURN_TO_GAME_STRRevenir au jeuEBISU_FRIENDS_SAT_STRSamEBISU_NEWS_SAT_STRSamEBISU_PROFILE_SETTINGS_SAVE_STRSauvegarderEBISU_PROFILE_SETTINGS_SAVING_STRSauvegardeEBISU_FRIENDS_SEARCH_STRRechercherEBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STRLes critères de recherche doivent comporter au moins 3 caractères.EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STRLes critères de recherche doivent comporter au moins 3 caractères.EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STRLes critères de recherche doivent comporter au moins 3 caractères.EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STREffectuez une recherche sur ces réseaux :EBISU_SEARCH_OPTIONS_STROptions de RechercheEBISU_FRIENDS_SEARCH_ORIGIN_STRRechercher sur OriginEBISU_FRIENDS_SEARCH_RESULTS_STRRésultats de la RechercheEBISU_FRIENDS_SEARCHRESULTS_STRRésultats de la RechercheEBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STRRésultats de la recherche avec les ContactsEBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRRésultats de la recherche avec FacebookEBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRRésultats de la recherche avec GoogleEBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STRRésultats de la recherche avec OriginEBISU_FRIENDS_SEARCHING_STRRechercheEBISU_FRIENDS_SENDING_FRIEND_REQUEST_STREnvoi de votre requête d'amis...EBISU_LOGIN_SETUP_ACCOUNT_STRConfigurer le CompteEBISU_PROFILE_SETTINGS_EDIT_STRParamètresEBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STRJe refuse de figurer dans les recherches par adresse e-mail.EBISU_PROFILE_SETTINGS_NEWPASSWORD_STRNv. MdpEBISU_LOGIN_SETTING_UP_ACCOUNT_STRConfiguration du compte...EBISU_NEWS_SHARE_STRPartagerEBISU_PROFILE_SHOW_LESS_STRAfficher MoinsEBISU_PROFILE_SHOW_MORE_STRAfficher PlusEBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STRSe connecter à OriginEBISU_LOGIN_SIGN_IN_ORIGIN_STRSe connecter à OriginEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STRMessage de connexion nécessaireEBISU_LOGIN_SIGN_UP_BUTTON_STRInscription !EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STRDésolé, %USERNAME% est déjà utilisé sur le réseau Origin. Utilisez notre suggestion ou créez un autre identifiant pour continuer.EBISU_ERROR_UNEXPECTED_ERROR_STRDésolé, une erreur inattendue est survenue. Veuillez réessayer.EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STRDésolé, en raison de restrictions territoriales, vous ne remplissez pas les conditions pour rejoindre Origin à l'heure actuelle.EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STRDésolé, il n'existe aucun compte pour.EBISU_ERROR_NO_RESULTS_FOUND_STRDésolé, aucun résultat trouvé. Veuillez réessayer.EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STRDésolé, impossible d'accéder à Origin pour le moment.EBISU_ERROR_LOGIN_FAILED_STRDésolé, échec de la connexion à Origin.EBISU_ERROR_SERVER_DOWN_STRDésolé, nos serveurs sont actuellement hors service. Veuillez réessayer ultérieurement.EBISU_ERROR_ID_ALREADY_TAKEN_STRDésolé, cet identifiant est déjà utilisé. Veuillez en sélectionner un autre.EBISU_ERROR_DATE_OF_BIRTH_INVALID_STRDésolé, la date de naissance que vous avez saisie n'est pas valide.EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STRDésolé, l'adresse e-mail et le mot de passe doivent être différents. Veuillez réessayer.EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STRDésolé, les mots de passe que vous avez saisis doivent correspondre.EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STRDésolé, un problème est survenu lors de la communication avec le service de mots de passe. Veuillez réessayer ultérieurement.EBISU_ERROR_EMAIL_ADRESS_INVALID_STRDésolé, cette adresse e-mail n'est pas valide.EBISU_ERROR_EMAIL_FORMAT_INVALID_STRDésolé, le format de cette adresse e-mail n'est pas valide. Veuillez réessayer.EBISU_ERROR_USER_NOT_FOUND_STRDésolé, cet identifiant n'a pas pu être trouvé.EBISU_ERROR_DIDNT_RECEIVE_INFO_STRDésolé, nous n'avons pas reçu vos informations. Veuillez réessayer.EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STRDésolé, vous ne remplissez pas les conditions pour rejoindre Origin à l'heure actuelle.EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STRDésolé, votre mot de passe ne peut pas contenir d'espace. Veuillez réessayer.EBISU_FRIENDS_SUN_STRDimEBISU_NEWS_SUN_STRDimEBISU_PROFILE_TOS_STRConditions D'utilisationEBISU_ERROR_Origin_NET_NOT_REACHED_STRImpossible de joindre le réseau Origin. Veuillez vérifier votre connexion réseau et réessayer.EBISU_ERROR_EMAIL_ALREADY_EXISTS_STRCette adresse e-mail existe déjà sur OriginEBISU_ERROR_INVALID_EMAIL_FORMAT_STRLe format de cette adresse e-mail n'est pas valide.EBISU_ERROR_EMAIL_NOT_REGISTERED_STRCette adresse e-mail n'est pas enregistrée sur Origin à l'heure actuelle.EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STRCela peut prendre quelques instants...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STRCet identifiant existe déjà sur Origin.EBISU_FRIENDS_THUR_STRJeuEBISU_NEWS_THUR_STRJeuEBISU_ERROR_DOMAIN_INVALID_STRPour continuer, veuillez saisir une adresse e-mail valide.EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STRPour réinitialiser votre mot de passe, saisissez l'adresse e-mail associée à votre compte.EBISU_FRIENDS_TODAY_STRAujourd'huiEBISU_NEWS_TODAY_STRAujourd'huiEBISU_LOGIN_TRY_STREssayerEBISU_FRIENDS_TUE_STRMarEBISU_NEWS_TUE_STRMarEBISU_LOGIN_SOMETHING_WENT_WRONG_STROh oh ! Il y a eu un problème...EBISU_NEWS_UPDATES_STRMises à jourEBISU_ERROR_UPDATING_CHANGES_STRMise à jour...EBISU_LOGIN_USER_REGISTERED_STRUtilisateur inscrit !EBISU_PROFILE_USERNAME_STRIdentifiantEBISU_LOGIN_USERNAME_STRIdentifiantEBISU_PROFILE_SETTINGS_USERNAME_STRIdentifiantEBISU_GMAIL_USERNAME_STRIdentifiantEBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STRIdentifiant et mot de passe nécessaires pour continuer.EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STRL'identifiant et le mot de passe doivent comporter de 4 à 12 caractères alphanumériques.EBISU_ERROR_USERNAME_REQUIRED_STRIdentifiant nécessaire pour continuer.EBISU_ERROR_USERNAME_RESTRICTIONS_STRL'identifiant doit comporter de 4 à 12 caractères alphanumériques.EBISU_ERROR_USERNAME_NOT_AVAILABLE_STRIdentifiant non disponible.EBISU_ACHIEVEMENT_WAY_TO_GO_STRBravo ! Voulez-vous partager votre score et défier les joueurs du réseau Origin ?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STRBravo, %USERNAME% ! Voulez-vous annoncer votre chrono sur le réseau Origin ?EBISU_ERROR_SEARCH_FAILED_STRNous n'avons trouvé aucun résultat correspondant à votre recherche.EBISU_FRIENDS_WED_STRMerEBISU_NEWS_WED_STRMerEBISU_NAV_WELCOME_STRBienvenueEBISU_LOGIN_WELCOME_BACK_STRBienvenue!EBISU_ACHIEVEMENT_WELL_DONE_STRJoli ! Voulez-vous partager votre score et défier les joueurs du réseau Origin ?EBISU_ACHIEVEMENT_WELL_DONE_USER_STRJoli, %USERNAME%! Voulez-vous défier les autres joueurs de %GAMENAME% sur le réseau Origin ?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STRQue voulez-vous faire ?EBISU_LOGIN_WHY_JOIN_STRPourquoi rejoindre Origin ?EBISU_ACHIEVEMENT_YES_STROuiEBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STROui, j'autorise les membres à me rechercher en utilisant mon nom Facebook.EBISU_FRIENDS_YESTERDAY_STRHierEBISU_NEWS_YESTERDAY_STRHierEBISU_ERROR_MUST_AGREE_TOS_AND_PP_STRVous devez accepter la Charte de Confidentialité et les Conditions D'utilisation pour continuer.EBISU_ACHIEVEMENT_DOING_GREAT_STRBeau travail ! Voulez-vous partager votre record et défier les joueurs du réseau Origin ?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STRVous avez reçu un défi ! %USERNAME% désire jouer à %GAMENAME% avec vous ! Voulez-vous relever le défi ? Téléchargez %GAMENAME% maintenant.EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STRVous avez reçu un défi ! %USERNAME% désire jouer à %GAMENAME% avec vous !EBISU_ERROR_CONN_TIMED_OUT_STRLe délai imparti à votre connexion a expiré. Veuillez vous reconnecter à Origin.EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STRVotre adresse e-mail et votre mot de passe ne correspondent pas. Veuillez réessayer.EBISU_LOGIN_NEW_PASSWORD_SENT_STRUn e-mail a été envoyé àEBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STRVotre compte Origin a été créé avec succès et vous êtes actuellement connecté. Lancez-vous et connectez-vous avec vos amis!EBISU_ERROR_SEARCH_NO_RESULTS_STRVotre recherche n'a renvoyé aucun résultat.EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRjj-mm-aaaaEBISU_ERROR_EMAIL_TOO_LONG_STRAdresse e-mail trop longue.EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STRCe compte Origin n'existe plus.EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STRLa mémoire disponible sur votre appareil sera bientôt insuffisante. Afin d'optimiser le fonctionnement d'Origin, nous vous recommandons de supprimer les applications superflues.EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRDésolé, votre appareil n'est pas actuellement en mesure d'envoyer des messages textes.EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRDésolé, aucun compte de messagerie n'est actuellement configuré sur votre appareil.EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STRVoulez-vous vraiment changer de mot de passe ? Vous devrez utiliser le nouveau mot de passe lors de chaque connexion à Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_STRJoueurEBISU_STRING_TODAY_WITH_DATE_STRAujourd'hui %DATE%EBISU_STRING_ONE_DAY_AGO_STRIl y a 1 jourEBISU_STRING_DAYS_AGO_STRIl y a %DAYS% joursEBISU_STRING_ONE_WEEK_AGO_STRIl y a 1 semaineEBISU_STRING_WEEKS_AGO_STRIl y a %WEEKS% semainesEBISU_STRING_ONE_MONTH_AGO_STRIl y a un moisEBISU_STRING_FACEBOOK_TOS_STREn me connectant à Facebook, j'accepte d'apparaître dans les résultats de recherches par pseudo Facebook.EBISU_STRING_GMAIL_AUTH_FAILED_STRLe nom d'utilisateur ou mot de passe saisi est incorrect.EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STRVotre compte Origin a été créé ! À présent, trouvez et ajoutez des amis à défier. [BUTTON] OKEBISU_STRING_PRIVACY_CAPS_COLON_STRCONFIDENTIALITÉ :EBISU_STRING_JOIN_EBISU_STRRejoindre Origin !EBISU_STRING_WELCOME_BACK_USER_STRBon retour parmi nous, %USERNAME%.EBISU_FRIENDS_PENDING_STREn attenteEBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STRL'opération peut durer quelques instants.EBISU_FRIENDS_LAUNCH_MANUALLY_STRDésolé - vous allez devoir exécuter %GAMENAME% manuellement. Si vous l'avez supprimé, vous pouvez le télécharger à nouveau.EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRDésolé, votre appareil n'est pas actuellement en mesure d'envoyer des messages textes.EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STRVotre compte Origin a été créé ! À présent, trouvez et ajoutez des amis à défier. [BUTTON] OKEBISU_FRIENDS_GO_STRAccéderEBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRDésolé, aucun compte de messagerie n'est actuellement configuré sur votre appareil.EBISU_ERROR_CONN_TIMED_OUT_2_STRVotre connexion a expiré. Réessayez ou sélectionnez OK pour modifier vos paramètres réseau. [BUTTON] RÉESSAYER [BUTTON] OKEBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STRVoulez-vous vraiment changer de mot de passe ? Vous devrez utiliser le nouveau mot de passe lors de chaque connexion à Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_2_STRJoueurEBISU_STRING_MONTHS_AGO_STR Il y a %MONTHS% moisEBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STRUtilisez notre suggestion ou choisissez la vôtre.EBISU_LOGIN_MOBILE_STRPortableEBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@J'accepte la @a href=\"http://privacy\"@Charte de confidentialité@/a@ et les @a href=\"http://tos\"@Conditions d'utilisation @/a@d'EA@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STRVeillez à saisir des informations complètes et exactes.EBISU_FRIENDS_NO_FRIENDS_TITLE_STRAjoutez Vos Amis Maintenant !EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STRDéfiez vos amis avec vos scores et découvrez des jeux !EBISU_STRING_ADD_FRIENDS_GMAIL_STRFaites une recherche dans vos contacts pour trouver des amis.EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STREn me connectant, j'accepte d'apparaître dans les résultats de recherches par e-mail et de publier automatiquement les informations relatives à mes parties. Je peux modifier ces deux paramètres dans mon profil.EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STRMeilleurs ScoresEBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STRSuccèsEBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STRPartager Avec Mes AmisEBISU_PROFILE_SETTINGS_NEWSSETTINGS_STRParamètres des ActualitésEBISU_LOGIN_AGE_STRÂgeEBISU_PROFILE_ABOUT_STRCLUF EBISU_LOGO_LOGO_INSTRUCTIONS_STRCliquez sur le logo Origin pour revenir à votre partie. Cliquez encore pour basculer à nouveau.EBISU_NEWS_NO_INVITES_STRAucune invitation. Patience !EBISU_NEWS_NO_INVITES_DESCRIPTION_STRRevenez souvent pour voir invitations et défis.EBISU_PROFILE_INFO_STRInfosEBISU_LOGIN_TRY_AGAIN_STRRéessayerEBISU_ERROR_ENTER_VALID_AGE_STRVeuillez saisir un âge valide.EBISU_LOGIN_AUTO_LOGGING_IN_STRConnexion automatique...EBISU_STRING_JOIN_EBISU_TITLE_STRJe trouve Origin cool. Tu vas voir. Rejoins-moi et nous pourrons être amis !EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STRavec les instructions pour réinitialiser votre mot de passe.EBISU_ERROR_PASSWORD_INVALID_STRMot de passe non valide.EBISU_ERROR_TOS_TOO_LONG_STRConditions D'utilisation trop longues.EBISU_STRING_START_NOW_STRCommencez!EBISU_LOGO_PLAYER_STRJoueurEBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STRUtilisez votre compte Origin principal pour modifier vos paramètres Facebook.EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STRRendez votre profil public pour que vos amis puissent le voir.EBISU_FRIEND_REMOVE_CONFIRMATION_STRConfirmer ?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STR%USERNAME% sera retiré de votre liste d'amis. Vous pourrez toujours l'ajouter à nouveau ultérieurement.EBISU_FRIEND_IGNORING_CHALLENGE_STRDéfi ignoré...EBISU_FRIEND_ACCEPTING_REQUEST_STRAcceptation de la demande d'ami...EBISU_FRIEND_DECLINING_REQUEST_STRDéclin demande d'ami ...EBISU_FRIEND_SENDING_BLOCK_STRDemande envoyéeEBISU_FRIEND_SENDING_REPORT_STRDemande envoyéeEBISU_LOGIN_RECEIVE_EA_UPDATE_STRJe souhaite recevoir les infos et l'actu des jeux EA.EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STRDésolé, vous ne répondez pas aux critères requis pour vous inscrire.EBISU_PROFILE_ERROR_FACEBOOK_STRS'il vous plaît vous connecter à Facebook.EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STRSélectionnez l'un des paramètres disponibles avant de sauvegarder...EBISU_ERROR_USERNAME_NOT_ALLOWED_STRNom d'utilisateur non autorisé. Choisissez-en un autre ou utilisez la suggestion.EBISU_PROFILE_SETTINGS_SEACHABLEOK_STRLaissez les membres me rechercher (mail)EBISU_EMAIL_INVITE_SUBJECT_STRInvitation à join OriginEBISU_ERROR_LOG_INTO_FACEBOOK_STRSe connecter à FacebookEBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STRParties disputéesEBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STRVous avez déjà un compte EA ? Veuillez saisir votre mot de passe ci-dessous.EBISU_ERROR_REAL_NAME_TOO_LONGLa valeur Nom réel que vous avez saisie est trop longueEBISU_ERROR_REAL_NAME_INVALID_CHARACTERSUtilisez des caractères alphanumériques pour Nom réelEBISU_ERROR_TOO_MANY_ATTEMPTSTrop de tentatives d'accès à Origin. Veuillez patienter avant de réessayer.EBISU_SENDING_REQUEST_STREnvoi de la requêteEBISU_FRIENDS_SENT_REQUEST_TITLE_STRDemande envoyéeEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STROuiEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STRNONEBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STRVous recherchez vos amis dans les contacts ?EBISU_FRIEND_PERMISSION_CONTACTS_STRPour retrouver vos amis, vos contacts seront temporairement partagés avec nos serveurs afin de les comparer avec les utilisateurs d'Origin existants. Ces informations ne seront pas conservées. \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/German Text.plist b/app/src/main/assets/EASP/Origin/resources/German Text.plist new file mode 100644 index 0000000..8384a58 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/German Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR*Echter NameEBISU_LOGIN_OPTIONAL_INFO_STR*Kennzeichnet freiwillige AngabenEBISU_ACHIEVEMENT_USER_DOING_GREAT_STR%USERNAME%, du schlägst dich großartig! Willst du deinen Highscore im Origin-Netzwerk freigeben?EBISU_FRIENDS_GAME_LIST_TITLE_STRSpiele von %USERNAME%EBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% hat deine Bestzeit in %GAMENAME% geschlagen.EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% hat deinen Highscore in %GAMENAME% geknackt.EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% hat dir eine Freundschaftsanfrage geschickt.EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STREin Geburtsdatum ist erforderlich.EBISU_ERROR_WIFI_REQUIRED_STREs wird eine Wi-Fi-Verbindung benötigt, um sich von %GAMENAME% aus bei Origin anzumelden.EBISU_ERROR_WIFI_3G_REQUIRED_STREs wird eine Wi-Fi- oder 3G-Verbindung benötigt, um sich von %GAMENAME% aus bei Origin anzumelden.EBISU_NEWS_ACCEPT_STRAnnehmenEBISU_NEWS_ACCEPTED_FRIEND_STRFreundschaftsanfrage akzeptiertEBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STRDer Zugriff auf die Datenschutzrichtlinie ist momentan nicht möglich.EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STRDer Zugriff auf die Nutzungsbedingungen ist momentan nicht möglich.EBISU_ERROR_TOS_FAILURE_STRDer Zugriff auf die Nutzungsbedingungen ist momentan nicht möglich.EBISU_ERROR_TOS_NOT_FOUND_STRDer Zugriff auf die Nutzungsbedingungen ist momentan nicht möglich.EBISU_NEWS_ACHIEVEMENT_UNLOCK_STRErfolg freigeschaltet:EBISU_FRIENDS_ADD_STRHinzuEBISU_FRIENDS_ADD_FRIENDS_TAB_STRFreunde HinzuEBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STRFüge deinem Netzwerk Freunde hinzu!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STRFüge Origin deine Freunde hinzu.EBISU_PROFILE_ADD_GAMES_STRSpiele hinzufügenEBISU_FRIENDS_ADD_YOUR_CONTACTS_STRDeine Kontakte hinzufügenEBISU_FRIENDS_AGE_STRAlterEBISU_PROFILE_AGE_STRAlterEBISU_PROFILE_SETTINGS_AGE_STRAlterEBISU_ERROR_ALERT_STRWarntonEBISU_FRIENDS_ALREADY_ADDED_STRBereits HinzuEBISU_LOGIN_INVITATION_SENT_STRAn %EMAIL% wurde eine Einladung geschickt.EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STRHast du Probleme beim Einloggen?EBISU_FRIENDS_BACK_STRZurückEBISU_PROFILE_SETTINGS_BACK_STRZurückEBISU_FRIENDS_BLOCK_STRBlockierenEBISU_FRIENDS_BLOCK_USER_STR%USERNAME% blockieren?EBISU_FRIENDS_BUY_STRKaufenEBISU_PROFILE_BUY_NOW_STRKaufenEBISU_GMAIL_CANCEL_STRAbbrechenEBISU_FRIENDS_CHALLENGE_STRHerausford.EBISU_PROFILE_CHALLENGE_STRHerausford.EBISU_NEWS_CHALLENGE_STRHerausford.EBISU_LOGIN_CHANGE_USERNAME_STRBenutzernamen ändernEBISU_LOGIN_CHECKING_EMAIL_STRE-Mail-Adresse wird überprüftEBISU_FRIENDS_COMMENT_STRKommentarEBISU_LOGIN_COMPLETE_SETUP_STRKonfiguration abschließenEBISU_LOGIN_CONFIRM_STRBestätigenEBISU_PROFILE_SETTINGS_CONFIRM_STRBestätigenEBISU_LOGIN_CONGRATULATIONS_STRGlückwunsch!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STRGlückwunsch! %USERNAME%, du hast gerade eine schnelle Zeit erzielt! Willst du sehen, welchen Rang sie in Origin hat?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STRGlückwunsch! %USERNAME%, du hast gerade eine schnelle Zeit erzielt! Willst du deinen Origin-Rang sehen?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STRGlückwunsch! %USERNAME%, du hast gerade einen Highscore aufgestellt! Willst du sehen, welchen Rang er in Origin hat?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STRGlückwunsch! %USERNAME%, du hast gerade einen Highscore aufgestellt! Willst du deinen Origin-Rang sehen?EBISU_FRIENDS_CONNECT_FB_STRMit Facebook verbinden.EBISU_FRIENDS_CONNECT_GOOGLE_STRMit Google verbindenEBISU_FRIENDS_CONTACTS_STRKontakteEBISU_LOGIN_CONTINUE_STRFortfahrenEBISU_LOGIN_CREATE_ACCOUNT_STRKonto ErstellenEBISU_LOGIN_DATE_OF_BIRTH_STRGeburtsdatumEBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STRGeburtsdatumEBISU_FRIENDS_DELETE_STRLöschenEBISU_FRIENDS_DELETING_FRIEND_STRFreundIn wird gelöscht ...EBISU_NEWS_DISMISS_STRVerwerfenEBISU_PROFILE_DISPLAY_STRAnzeigenEBISU_PROFILE_SETTINGS_DISPLAY_NAME_STRNamen Anzeigen:EBISU_GMAIL_DONE_STRFertigEBISU_PROFILE_EDIT_STRBearbeitenEBISU_NEWS_EDIT_STRBearbeitenEBISU_FRIENDS_EMAIL_STRE-Mail:EBISU_INVITE_EMAIL_STRE-MailEBISU_PROFILE_EMAIL_STRE-Mail:EBISU_LOGIN_EMAIL_STRE-MailEBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STRE-Mail und Passwort gibt es bereits.EBISU_ERROR_EMAIL_REQUIRED_STRZum Fortfahren wird eine E-Mail benötigt.EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STRMail/Nutzern.EBISU_PROFILE_SETTINGS_EMAIL_STRE-MailEBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STRE-Mail eingebenEBISU_LOGIN_ENTER_PHONE_NUMBER_STRGib deine Handynummer ein, um Textmitteilungen und mehr zu erhalten!EBISU_LOGIN_ACCOUNT_STRGib deine E-Mail-Adresse ein, um dich anzumelden oder ein Konto zu erstellen.EBISU_ERROR_ERROR_TITLE_STRFehlerEBISU_GMAIL_GMAILPLACEHOLDER_STRexample@gmail.comEBISU_RETURN_EXIT_STRVerlassenEBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRFacebook-FreundeEBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRFacebook-EinstellungenEBISU_ERROR_FAILED_TO_DELETE_FRIEND_STRFreundIn löschen fehlgeschlagen.EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STRNews-Beitrag entfernen fehlgeschlagen.EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STRAkzeptierung senden fehlgeschlagen.EBISU_ERROR_FAILED_TO_SEND_DECLINE_STRAblehnung senden fehlgeschlagen.EBISU_PROFILE_SETTINGS_FEMALE_STRWeiblichEBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STRFinde Freunde über Kontakte.EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STRFinde Freunde und werde von ihnen gefunden über Facebook.EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STRFinde Freunde und werde von ihnen gefunden über Gmail.EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STRFinde Freunde in OriginEBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STRFinde heraus, welche Spiele deine Freunde spielen!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STRFreunde in Origin findenEBISU_LOGIN_FORGOT_PASSWORD_STRPasswort vergessenEBISU_FRIENDS_FRI_STRFrEBISU_NEWS_FRI_STRFrEBISU_NEWS_FRIEND_REQUEST_BODY_STRhat dir eine Freundschaftsanfrage geschickt.EBISU_NEWS_FRIEND_REQUEST_STRFreundschaftsanfrageEBISU_CAT_FRIENDS_STRFreundeEBISU_NAV_FRIENDS_STRFreundeEBISU_PROFILE_FRIENDS_ONLY_STRNur FreundeEBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STRNur FreundeEBISU_FRIENDS_FRIENDS_WHO_HAVE_STRFreunde mit %GAMENAME%EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STRFreunde ohne %GAMENAME%EBISU_FRIENDS_GENDER_STRGeschlecht:EBISU_PROFILE_SETTINGS_GENDER_STRGeschlechtEBISU_PROFILE_GENDER_STRGeschlecht:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STRErhalte Neuigkeiten zu Spielen und exklusive Angebote von EA!EBISU_NEWS_GET_IT_STRHol es DirEBISU_ERROR_GETTING_USER_INFO_STRDeine Daten werden abgerufenEBISU_NEWS_GO_TO_STRLosEBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRGoogle-FreundeEBISU_NEWS_HIGH_SCORE_STRHighscoreEBISU_FRIENDS_HOME_STRWohnortEBISU_PROFILE_HOME_STRWohnortEBISU_PROFILE_SETTINGS_HOME_STRWohnortEBISU_LOGIN_AGREE_PP_TOS_STRIch stimme der Datenschutzrichtlinie und den Nutzungsbedingungen zu.EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIAIch möchte suchbar sein über:EBISU_NEWS_IGNORE_STRIgnorierenEBISU_FRIENDS_CONTACTS_IN_STRIN OriginEBISU_ERROR_INCORRECT_LOGIN_INFO_STRFalsche Login-DatenEBISU_FRIENDS_INVITE_STREinladenEBISU_FRIENDS_CHOOSE_SMS_EMAIL_STRFreunde zu Origin einladenEBISU_FRIENDS_SENTINVITE_STREinladung verschicktEBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STRDeine Freunde zu Origin einladenEBISU_NEWS_INVITES_STREinladungenEBISU_LOGIN_DUMMY_REAL_NAME_STRMax MustermannEBISU_FRIENDS_LAST_LOGIN_STRLetzte Anmeldung:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STRLetzte Anmeldung:EBISU_NEWS_LAST_UPDATE_STRLetzte Aktualisierung: %TIME%EBISU_NEWS_LASTUPDATE_NEVER_STRZuletzt aktualisiert: NieEBISU_NEWS_LAUNCH_STRStartenEBISU_PROFILE_LEGEND_STRLegendeEBISU_PROFILE_SETTINGS_LOADING_STRLädtEBISU_LOGIN_LOGIN_STRAnmeldenEBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRBei Facebook anmeldenEBISU_PROFILE_LOGOUT_STRAbmeldenEBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STRBei Facebook abmeldenEBISU_LOGIN_LOGGING_IN_STRAnmelden ...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STRFinde über Spielherausforderungen neue Freunde!EBISU_PROFILE_SETTINGS_MALE_STRMännlichEBISU_FRIENDS_MOBILE_STRMobil:EBISU_PROFILE_MOBILE_STRMobil:EBISU_PROFILE_SETTINGS_MOBILE_STRMobilEBISU_FRIENDS_MON_STRMoEBISU_NEWS_MON_STRMoEBISU_FRIENDS_MY_FRIENDS_TAB_STRMeine FreundeEBISU_PROFILE_MY_GAMES_STRMeine SpieleEBISU_PROFILE_SETTINGS_MY_IMAGE_STRMein BildEBISU_NAV_PROFILE_STRMein ProfilEBISU_PROFILE_MY_WISH_LIST_STRMeine WunschlisteEBISU_CAT_NEWS_STRNeuigkeitenEBISU_NAV_NEWS_STRNeuigkeitenEBISU_ACHIEVEMENT_NICE_JOB_STRGute Arbeit! Willst du deine Punktzahl freigeben und Spieler im Origin-Netzwerk herausfordern?EBISU_ACHIEVEMENT_NICE_JOB_USER_STRGute Arbeit, %USERNAME%! Willst du deinen Erfolg im Origin-Netzwerk freigeben?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STRNein, nicht mit meinem Facebook-Namen nach mir suchen.EBISU_ACHIEVEMENT_NO_STRNein, dankeEBISU_FRIENDS_CONTACTS_NOT_IN_STRNICHT IN OriginEBISU_LOGIN_OK_STROKEBISU_ERROR_SOMETHING_WENT_WRONG_STRHoppla! Etwas ist schiefgelaufen ...EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_INVALID_DOCUMENT_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_INVALID_LANGUAGE_CODE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_LICENSE_NOT_FOUND_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_REFERENCE_NOT_FOUND_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_REGISTRATION_FAILED_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_SERVER_USER_API_FAILURE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_SERVICE_FAILURE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_USER_CREATION_FAILED_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_USER_LISTING_FAILED_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STRHoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.EBISU_PROFILE_OPT_IN_STRAbbonierenEBISU_PROFILE_OPT_OUT_STRAbbestellenEBISU_LOGIN_PASSWORD_STRPasswortEBISU_PROFILE_SETTINGS_PASSWORD_STRPasswort ÄndernEBISU_GMAIL_PASSWORD_STRPasswortEBISU_ERROR_PASSWORD_REQUIRED_STRZum Fortfahren wird ein Passwort benötigt.EBISU_ERROR_PASSWORD_RESTRICTIONS_STRDas Passwort muss aus 4-16 alphanumerischen Zeichen bestehen.EBISU_FRIENDS_PENDINGINVITES_STRAusstehende EinladungenEBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STRVon dir blockierte Personen können dich nicht herausfordern oder dein Profil ansehen.EBISU_PROFILE_PLAY_STRSpielenEBISU_FRIENDS_PLAYNOW_STRJetzt Spielen?EBISU_FRIENDS_PLAYING_COLON_STRSpielt:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STRBitte erstelle einen Benutzernamen, um die Einrichtung deines Origin-Kontos abzuschließen. Du kannst gerne unseren Vorschlag benutzen!EBISU_ERROR_ENTER_USERNAME_STRBitte gib zum Fortfahren einen Benutzernamen ein.EBISU_ERROR_ENTER_VALID_EMAIL_STRBitte gib zum Fortfahren eine gültige E-Mail-Adresse ein.EBISU_GMAIL_ENTERGMAILDATA_STRBitte gib deinen Gmail-Benutzernamen und dein Passwort ein.EBISU_ERROR_USER_NOT_LOGGED_IN_STRBitte logge dich ein.EBISU_ERROR_REENTER_INFO_STRBitte gib deine Daten erneut ein, um fortzufahren.EBISU_ERROR_REENTER_INFO_CONTINUE_STRBitte gib deine Daten erneut ein, um fortzufahren.EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STRBitte sieh dir die Nutzungsbedingungen an und akzeptiere sie.EBISU_ERROR_SIGN_IN_STRBitte anmeldenEBISU_ERROR_SIGN_IN_TO_CONTINUE_STRBitte zum Fortfahren anmelden.EBISU_PROFILE_PRIVACY_POLICY_STRDatenschutzrichtlinienEBISU_PROFILE_PRIVATE_STRPrivatEBISU_PROFILE_SETTINGS_PRIVATE_STRPrivatEBISU_CAT_PROFILE_STRProfilEBISU_FRIENDS_PROFILE_STRProfilEBISU_NEWS_PROFILE_STRProfilEBISU_PROFILE_SETTINGS_TAB_STRProfil-EinstellungenEBISU_PROFILE_PROFILE_PRIVACY_STRProfil-/Privatsphäre-EinstellungenEBISU_PROFILE_PUBLIC_STRÖffentlichEBISU_PROFILE_SETTINGS_PUBLIC_STRÖffentlichEBISU_NEWS_PULLDOWN_TO_UPDATE_STRZum Aktualisieren herunterziehen ...EBISU_PROFILE_REAL_NAME_STREchter Name:EBISU_FRIENDS_REAL_NAME_STREchter Name:EBISU_PROFILE_SETTINGS_REAL_NAME_STREchter NameEBISU_LOGIN_RECOVER_MY_PASSWORD_STRMein Passwort wiederherstellenEBISU_LOGIN_REGISTER_NEW_USER_STRNeuen Benutzer registrieren.EBISU_LOGIN_REGISTERING_NEW_USER_STRNeuer Benutzer wird registriert...EBISU_NEWS_REJECT_STRAblehnenEBISU_NEWS_RELEASE_TO_UPDATE_STRZum Aktualisieren loslassenEBISU_FRIENDS_BLOCKING_A_USER_STRDenk daran: Blockierst du diese Person, unterbindest du jeglichen zukünftigen Kontakt mit ihr in Origin.EBISU_NEWS_REMOVE_STREntfernenEBISU_FRIENDS_REMOVE_FRIEND_STRFreundIn EntfernenEBISU_FRIENDS_REPORT_STRMeldenEBISU_FRIENDS_REPORT_USER_STR%USERNAME% meldenEBISU_FRIENDS_REPORT_BLOCK_STRMelden/BlockierenEBISU_NEWS_REPORT_BLOCK_STRMelden/BlockierenEBISU_ERROR_RESULTS_LOADING_STRErgebnisse werden geladen ...EBISU_ERROR_RETRIEVING_STRWird abgerufenEBISU_RETURN_RETURN_TO_GAME_STRZum Spiel zurückkehrenEBISU_FRIENDS_SAT_STRSaEBISU_NEWS_SAT_STRSaEBISU_PROFILE_SETTINGS_SAVE_STRSpeichernEBISU_PROFILE_SETTINGS_SAVING_STRWird gespeichertEBISU_FRIENDS_SEARCH_STRSuchenEBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STRSuchkriterien müssen aus 3 oder mehr Zeichen bestehen.EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STRSuchkriterien müssen aus 3 oder mehr Zeichen bestehen.EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STRSuchkriterien müssen aus 3 oder mehr Zeichen bestehen.EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STRDiese Netzwerke durchsuchen.EBISU_SEARCH_OPTIONS_STRSuchoptionenEBISU_FRIENDS_SEARCH_ORIGIN_STROrigin DurchsuchenEBISU_FRIENDS_SEARCH_RESULTS_STRSuchergebnisseEBISU_FRIENDS_SEARCHRESULTS_STRSuchergebnisseEBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STRSuchergebnisse in KontakteEBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRSuchergebnisse in FacebookEBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRSuchergebnisse in GoogleEBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STRSuchergebnisse in OriginEBISU_FRIENDS_SEARCHING_STRWird gesuchtEBISU_FRIENDS_SENDING_FRIEND_REQUEST_STRDeine Freundschaftsanfrage wird gesendet ...EBISU_LOGIN_SETUP_ACCOUNT_STRKonto EinrichtenEBISU_PROFILE_SETTINGS_EDIT_STREinstellEBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STRNein, ich möchte nicht mit meiner E-Mail suchbar sein.EBISU_PROFILE_SETTINGS_NEWPASSWORD_STRNeues PasswortEBISU_LOGIN_SETTING_UP_ACCOUNT_STRKonto wird eingerichtet ...EBISU_NEWS_SHARE_STRFreigebenEBISU_PROFILE_SHOW_LESS_STRWeniger ZeigenEBISU_PROFILE_SHOW_MORE_STRMehr ZeigenEBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STRBei Origin-Konto anmeldenEBISU_LOGIN_SIGN_IN_ORIGIN_STRBei Origin-Konto anmeldenEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STRAnmeldung erforderlichEBISU_LOGIN_SIGN_UP_BUTTON_STRAnmelden!EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STRLeider ist %USERNAME% in Origin schon vergeben. Verwende unseren Vorschlag oder erstelle einen neuen Benutzernamen, um fortzufahren.EBISU_ERROR_UNEXPECTED_ERROR_STRLeider ist ein unerwarteter Fehler aufgetreten. Bitte versuche es noch einmal.EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STRAufgrund von Gebietsbeschränkungen bist du momentan leider nicht berechtigt, Origin beizutreten.EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STRFür existiert leider kein Konto.EBISU_ERROR_NO_RESULTS_FOUND_STRLeider wurden keine Ergebnisse gefunden. Bitte versuche es noch einmal.EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STRAuf Origin kann im Moment leider nicht zugegriffen werden.EBISU_ERROR_LOGIN_FAILED_STRAnmeldung bei Origin leider fehlgeschlagen.EBISU_ERROR_SERVER_DOWN_STRLeider sind unsere Server außer Betrieb. Bitte versuche es später noch einmal.EBISU_ERROR_ID_ALREADY_TAKEN_STRDieser Benutzername ist leider schon vergeben. Bitte versuche einen anderen.EBISU_ERROR_DATE_OF_BIRTH_INVALID_STRDas von dir eingegebene Geburtsdatum ist leider ungültig.EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STRE-Mail und Passwort dürfen leider nicht übereinstimmen. Bitte versuche es noch einmal.EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STRDie von dir eingegebenen Passwörter stimmen leider nicht überein.EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STRLeider gab es ein Kommnikationsproblem. Bitte versuche es später noch einmal.EBISU_ERROR_EMAIL_ADRESS_INVALID_STRDiese E-Mail-Adresse ist leider nicht gültig.EBISU_ERROR_EMAIL_FORMAT_INVALID_STRDieses E-Mail-Format ist leider nicht gültig. Bitte versuche es noch einmal.EBISU_ERROR_USER_NOT_FOUND_STRDieser Benutzername konnte leider nicht gefunden werden.EBISU_ERROR_DIDNT_RECEIVE_INFO_STRLeider haben wir deine Daten nicht erhalten. Bitte versuche es noch einmal.EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STRDu bist momentan leider nicht berechtigt, Origin beizutreten.EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STRDein Passwort darf leider keine Leerzeichen enthalten. Bitte versuche es noch einmal.EBISU_FRIENDS_SUN_STRSoEBISU_NEWS_SUN_STRSoEBISU_PROFILE_TOS_STRNutzungsbedingungenEBISU_ERROR_Origin_NET_NOT_REACHED_STRDas Origin-Netzwerk konnte nicht erreicht werden. Bitte überprüfe deine Netzwerkverbindung und versuche es erneut.EBISU_ERROR_EMAIL_ALREADY_EXISTS_STRDiese E-Mail gibt es bereits in Origin.EBISU_ERROR_INVALID_EMAIL_FORMAT_STRDieses E-Mail-Format ist nicht gültig.EBISU_ERROR_EMAIL_NOT_REGISTERED_STRDiese E-Mail ist momentan nicht in Origin registriert.EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STRDas könnte einen Moment dauern ...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STRDieser Benutzername existiert bereits in Origin.EBISU_FRIENDS_THUR_STRDoEBISU_NEWS_THUR_STRDoEBISU_ERROR_DOMAIN_INVALID_STRBitte gib eine gültige E-Mail-Adresse ein, um fortzufahren.EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STRGib die mit deinem Konto verknüpfte E-Mail-Adresse ein, um dein Passwort zurückzusetzen.EBISU_FRIENDS_TODAY_STRHeuteEBISU_NEWS_TODAY_STRHeuteEBISU_LOGIN_TRY_STRVersuchenEBISU_FRIENDS_TUE_STRDiEBISU_NEWS_TUE_STRDiEBISU_LOGIN_SOMETHING_WENT_WRONG_STRHoppla! Etwas ist schiefgelaufen ...EBISU_NEWS_UPDATES_STRUpdatesEBISU_ERROR_UPDATING_CHANGES_STRWird aktualisiert ...EBISU_LOGIN_USER_REGISTERED_STRBenutzer registriert!EBISU_PROFILE_USERNAME_STRBenutzernameEBISU_LOGIN_USERNAME_STRNutzernameEBISU_PROFILE_SETTINGS_USERNAME_STRBenutzernameEBISU_GMAIL_USERNAME_STRBenutzernameEBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STRZum Fortfahren werden ein Benutzername und ein Passwort benötigt.EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STRBenutzername und Passwort müssen aus 4-12 Zeichen bestehen.EBISU_ERROR_USERNAME_REQUIRED_STRZum Fortfahren wird ein Benutzername benötigt.EBISU_ERROR_USERNAME_RESTRICTIONS_STRDer Benutzername muss aus 4-12 Zeichen bestehen.EBISU_ERROR_USERNAME_NOT_AVAILABLE_STRBenutzername nicht verfügbar.EBISU_ACHIEVEMENT_WAY_TO_GO_STRWeiter so! Willst du deine Punktzahl freigeben und Spieler im Origin-Netzwerk herausfordern?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STRWeiter so, %USERNAME%! Willst du deine Zeit im Origin-Netzwerk freigeben?EBISU_ERROR_SEARCH_FAILED_STRWir haben keine passenden Suchergebnisse gefunden.EBISU_FRIENDS_WED_STRMiEBISU_NEWS_WED_STRMiEBISU_NAV_WELCOME_STRWillkommenEBISU_LOGIN_WELCOME_BACK_STRWillkommen zurück!EBISU_ACHIEVEMENT_WELL_DONE_STRGut gemacht! Willst du deine Punktzahl freigeben und Spieler im Origin-Netzwerk herausfordern?EBISU_ACHIEVEMENT_WELL_DONE_USER_STRGut gemacht, %USERNAME%! Willst du andere %GAMENAME%-Spieler im Origin-Netzwerk herausfordern?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STRWas möchtest du tun?EBISU_LOGIN_WHY_JOIN_STRWarum soll ich Origin beitreten?EBISU_ACHIEVEMENT_YES_STRJaEBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STRJa, Mitgliedern gestatten, mit meinem Facebook-Namen nach mir zu suchenEBISU_FRIENDS_YESTERDAY_STRGesternEBISU_NEWS_YESTERDAY_STRGesternEBISU_ERROR_MUST_AGREE_TOS_AND_PP_STRDu musst den Nutzungsbedingungen und der Datenschutzrichtlinie zustimmen, um fortzufahren.EBISU_ACHIEVEMENT_DOING_GREAT_STRDas machst du großartig! Willst du deinen Highscore freigeben und Spieler im Origin-Netzwerk herausfordern?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STRDu wurdest herausgefordert! %USERNAME% möchte %GAMENAME% mit dir spielen! Die Herausforderung annehmen? Hol dir jetzt %GAMENAME%.EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STRDu wurdest herausgefordert! %USERNAME% möchte %GAMENAME% mit dir spielen! EBISU_ERROR_CONN_TIMED_OUT_STRDeine Verbindungszeit ist abgelaufen. Bitte melde dich erneut bei Origin an.EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STRE-Mail und Passwort passen nicht zusammen. Bitte versuche es erneut.EBISU_LOGIN_NEW_PASSWORD_SENT_STREine E-Mail mit einer Anleitung zum Zurücksetzen deines Passworts wurde anEBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STRDein Origin-Konto wurde erfolgreich erstellt. Du bist momentan eingeloggt. Leg los und vernetze dich mit Freunden!EBISU_ERROR_SEARCH_NO_RESULTS_STRDeine Suche erzielte kein Ergebnis.EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRtt-mm-jjjjEBISU_ERROR_EMAIL_TOO_LONG_STRDie E-Mail-Adresse ist zu lang.EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STRDieses Origin-Konto gibt es nicht mehr.EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STRDein Gerät hat nur noch wenig Speicher. Damit Origin problemlos ausgeführt werden kann, empfehlen wir dir, alle Apps zu löschen, die du nicht benutzt.EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRLeider kann dein Gerät momentan keine Textnachrichten verschicken.EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRLeider ist auf deinem Gerät momentan kein E-Mail-Konto eingerichtet.EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STRWillst du dein Passwort wirklich ändern? Du musst es benutzen, von wo auch immer du dich bei Origin anmeldest. [OK] [CANCEL] EBISU_FRIENDS_PLAYER_STRSpielerEBISU_STRING_TODAY_WITH_DATE_STRHeute %DATE%EBISU_STRING_ONE_DAY_AGO_STRVor 1 TagEBISU_STRING_DAYS_AGO_STRVor %DAYS% TagenEBISU_STRING_ONE_WEEK_AGO_STRVor 1 WocheEBISU_STRING_WEEKS_AGO_STRVor %WEEKS% WochenEBISU_STRING_ONE_MONTH_AGO_STRVor einem MonatEBISU_STRING_FACEBOOK_TOS_STRDurch meinen Login bei Facebook bin ich damit einverstanden, dass ich über meinen Facebook-Namen gesucht werden kann.EBISU_STRING_GMAIL_AUTH_FAILED_STRDer von dir eingegebene Benutzername bzw. das Passwort ist nicht korrekt.EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STRDu hast erfolgreich ein Origin-Konto erstellt! Finde und füge Freunde hinzu, um sie herauszufordern. [BUTTON] OKEBISU_STRING_PRIVACY_CAPS_COLON_STRPRIVATSPHÄRE:EBISU_STRING_JOIN_EBISU_STRMach bei Origin mit!EBISU_STRING_WELCOME_BACK_USER_STRWillkommen zurück, %USERNAME%!EBISU_FRIENDS_PENDING_STRAnstehendEBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STRBitte habe einen Moment Geduld.EBISU_FRIENDS_LAUNCH_MANUALLY_STRLeider musst du %GAMENAME% manuell starten. Wenn du es gelöscht hast, kannst du es noch einmal herunterladen.EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRLeider kann dein Gerät momentan keine Textnachrichten verschicken.EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STRDu hast erfolgreich ein Origin-Konto erstellt! Finde und füge Freunde hinzu, um sie herauszufordern. [BUTTON] OKEBISU_FRIENDS_GO_STRLosEBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRLeider ist auf deinem Gerät momentan kein E-Mail-Konto eingerichtet.EBISU_ERROR_CONN_TIMED_OUT_2_STRDeine Verbindungszeit ist abgelaufen. Versuche es noch einmal oder wähle OK, um deine Netzwerkeinstellungen zu ändern. [BUTTON] NOCH MAL [BUTTON] OKEBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STRWillst du dein Passwort wirklich ändern? Du musst es benutzen, von wo auch immer du dich bei Origin anmeldest. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_2_STRSpielerEBISU_STRING_MONTHS_AGO_STR Vor %MONTHS% MonatenEBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STRVerwende unseren Vorschlag oder wähle deinen eigenen.EBISU_LOGIN_MOBILE_STRHandyEBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@Ich stimme der @a href=\"http://privacy\"@Datenschutzrichtlinie@/a@ und den @a href=\"http://tos\"@Nutzungsbedingungen@/a@ von EA zu@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STRAchte bitte darauf, vollständige und richtige Angaben zu machen.EBISU_FRIENDS_NO_FRIENDS_TITLE_STRFüge Jetzt Deine Freunde Hinzu!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STRFordere Freunde mit Punkten heraus, entdecke Spiele!EBISU_STRING_ADD_FRIENDS_GMAIL_STRDurchsuche deine Kontakte, um Freunde zu finden.EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STRDurch meine Anmeldung bin ich damit einverstanden, dass ich über meine E-Mail suchbar bin und meine Spielereignisse automatisch veröffentlicht werden. Dies kann ich in meinen Profileinstellungen ändern.EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STRHighscoresEBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STRErfolge im SpielEBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STRMit Freunden teilenEBISU_PROFILE_SETTINGS_NEWSSETTINGS_STRNews-EinstellungenEBISU_LOGIN_AGE_STRAlterEBISU_PROFILE_ABOUT_STREULA EBISU_LOGO_LOGO_INSTRUCTIONS_STRTippe das Origin-Logo an, um zu deinem Spiel zurückzukehren. Tippe es noch einmal an, um vor und zurück zu schalten.EBISU_NEWS_NO_INVITES_STRKeine neuen Einladungen. Bleib dran!EBISU_NEWS_NO_INVITES_DESCRIPTION_STRÜberprüfe täglich auf Einladungen oder Herausforderungen.EBISU_PROFILE_INFO_STRInfoEBISU_LOGIN_TRY_AGAIN_STRNochmal versuchenEBISU_ERROR_ENTER_VALID_AGE_STRGib bitte ein gültiges Alter ein.EBISU_LOGIN_AUTO_LOGGING_IN_STRAutomatische Anmeldung ...EBISU_STRING_JOIN_EBISU_TITLE_STRIch finde Origin total cool, und dir wird es auch gefallen. Melde dich an, dann können wir Freunde sein!EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STRgesendet.EBISU_ERROR_PASSWORD_INVALID_STRDas Passwort ist ungültig.EBISU_ERROR_TOS_TOO_LONG_STRNutzungsbedingungen sind zu lang.EBISU_STRING_START_NOW_STRFreunde FindenEBISU_LOGO_PLAYER_STRSpielerEBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STRBitte verwende dein Origin-Hauptkonto, um deine Facebook-Einstellungen zu bearbeiten.EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STRVeröffentliche dein Profil, damit deine Freunde es sehen können.EBISU_FRIEND_REMOVE_CONFIRMATION_STRBist du sicher?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STR%USERNAME% wird aus deiner Freundesliste entfernt. Du kannst ihn/sie jederzeit später wieder hinzufügen.EBISU_FRIEND_IGNORING_CHALLENGE_STRHerausforderung wird ignoriert ...EBISU_FRIEND_ACCEPTING_REQUEST_STRFreundschaftsanfrage wird akzeptiert ...EBISU_FRIEND_DECLINING_REQUEST_STRFreundschaftsanfrage wird abgelehnt ...EBISU_FRIEND_SENDING_BLOCK_STRAnfrage gesendetEBISU_FRIEND_SENDING_REPORT_STRAnfrage gesendetEBISU_LOGIN_RECEIVE_EA_UPDATE_STRIch möchte Neuigkeiten und Infos zu EA-Spielen erhalten.EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STRLeider erfüllst du nicht die Voraussetzungen für eine Registrierung.EBISU_PROFILE_ERROR_FACEBOOK_STRBitte melde dich bei Facebook an.EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STRBitte wähle vor dem Speichern eine der verfügbaren Einstellungen.EBISU_ERROR_USERNAME_NOT_ALLOWED_STRBenutzername nicht erlaubt. Bitte wähle einen anderen oder verwende den Vorschlag.EBISU_PROFILE_SETTINGS_SEACHABLEOK_STRJa, Mitglieder dürfen mich mit meiner E-Mail suchen.EBISU_EMAIL_INVITE_SUBJECT_STREinladung zu OriginEBISU_ERROR_LOG_INTO_FACEBOOK_STRBitte melde dich bei Facebook an.EBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STRSpieleEBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STRDu hast bereits ein EA-Konto? Dann gib dein Passwort unten ein.EBISU_ERROR_REAL_NAME_TOO_LONGDein Eintrag für Echter Name ist zu lang.EBISU_ERROR_REAL_NAME_INVALID_CHARACTERSBitte verwende alphanumerische Zeichen für Echter Name.EBISU_ERROR_TOO_MANY_ATTEMPTSDu hast zu oft versucht, auf Origin zuzugreifen. Bitte warte, bevor du es erneut versuchst.EBISU_SENDING_REQUEST_STRAnfrage sendenEBISU_FRIENDS_SENT_REQUEST_TITLE_STRAnfrage gesendetEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STRJaEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STRNEINEBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STRNach deinen Freunden in Kontakten suchen?EBISU_FRIEND_PERMISSION_CONTACTS_STRDamit deine Freunde gefunden werden können, werden deine Kontakte vorübergehend mit unseren Servern geteilt, um sie mit existierenden Origin-Benutzern abzugleichen. Wir speichern diese Daten nicht. \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/Italian Text.plist b/app/src/main/assets/EASP/Origin/resources/Italian Text.plist new file mode 100644 index 0000000..ad4580f --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/Italian Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR*Nome RealeEBISU_LOGIN_OPTIONAL_INFO_STR*Indica che il dato è facoltativoEBISU_ACHIEVEMENT_USER_DOING_GREAT_STR%USERNAME%, stai andando alla grande! Vuoi condividere il tuo record di punteggio su Origin?EBISU_FRIENDS_GAME_LIST_TITLE_STRGiochi di %USERNAME%EBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% ha battuto il tuo miglior tempo a %GAMENAME%.EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% ha battuto il tuo record di punteggio a %GAMENAME%.EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% ti ha inviato una richiesta di amicizia.EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STRÈ necessaria una data di nascita.EBISU_ERROR_WIFI_REQUIRED_STRÈ necessaria una connessione WiFi per accedere a Origin da %GAMENAME%.EBISU_ERROR_WIFI_3G_REQUIRED_STRÈ necessaria una connessione WiFi o 3G per accedere a Origin da %GAMENAME%.EBISU_NEWS_ACCEPT_STRAccettaEBISU_NEWS_ACCEPTED_FRIEND_STRRichiesta di amicizia accettataEBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STRAl momento non è possibile accedere alla Politica sulla privacy.EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STRAl momento non è possibile accedere ai Termini di servizio.EBISU_ERROR_TOS_FAILURE_STRAl momento non è possibile accedere ai Termini di servizio.EBISU_ERROR_TOS_NOT_FOUND_STRAl momento non è possibile accedere ai Termini di servizio.EBISU_NEWS_ACHIEVEMENT_UNLOCK_STRObiettivo sbloccato:EBISU_FRIENDS_ADD_STRAgg.EBISU_FRIENDS_ADD_FRIENDS_TAB_STRAgg. AmiciEBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STRAggiungi amici alla tua rete!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STRAggiungi amici a Origin.EBISU_PROFILE_ADD_GAMES_STRAggiungi giochiEBISU_FRIENDS_ADD_YOUR_CONTACTS_STRAggiungi i tuoi contattiEBISU_FRIENDS_AGE_STREtàEBISU_PROFILE_AGE_STREtàEBISU_PROFILE_SETTINGS_AGE_STREtàEBISU_ERROR_ALERT_STRAvvisoEBISU_FRIENDS_ALREADY_ADDED_STRGià agg.EBISU_LOGIN_INVITATION_SENT_STRÈ stato inviato un invito a %EMAIL%EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STRHai problemi a effettuare l'accesso?EBISU_FRIENDS_BACK_STRIndietroEBISU_PROFILE_SETTINGS_BACK_STRIndietroEBISU_FRIENDS_BLOCK_STRBloccaEBISU_FRIENDS_BLOCK_USER_STRBloccare %USERNAME%?EBISU_FRIENDS_BUY_STRCompraEBISU_PROFILE_BUY_NOW_STRCompraEBISU_GMAIL_CANCEL_STRAnnullaEBISU_FRIENDS_CHALLENGE_STRSfidaEBISU_PROFILE_CHALLENGE_STRSfidaEBISU_NEWS_CHALLENGE_STRSfidaEBISU_LOGIN_CHANGE_USERNAME_STRCambia nome utenteEBISU_LOGIN_CHECKING_EMAIL_STRControllo indirizzo e-mailEBISU_FRIENDS_COMMENT_STRCommentoEBISU_LOGIN_COMPLETE_SETUP_STRCompleta la configurazioneEBISU_LOGIN_CONFIRM_STRConfermaEBISU_PROFILE_SETTINGS_CONFIRM_STRConfermaEBISU_LOGIN_CONGRATULATIONS_STRComplimenti!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STRComplimenti! %USERNAME%, hai appena ottenuto un buon tempo! Vuoi vedere la tua posizione su Origin?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STRComplimenti! %USERNAME%, hai appena ottenuto un buon tempo! Vuoi vedere la tua posizione in classifica su Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STRComplimenti! %USERNAME%, hai appena stabilito un nuovo record! Vuoi vedere la tua posizione su Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STRComplimenti! %USERNAME%, hai appena stabilito un nuovo record! Vuoi vedere la tua posizione in classifica su Origin?EBISU_FRIENDS_CONNECT_FB_STRAccedi a FacebookEBISU_FRIENDS_CONNECT_GOOGLE_STRAccedi a GoogleEBISU_FRIENDS_CONTACTS_STRContattiEBISU_LOGIN_CONTINUE_STRContinua EBISU_LOGIN_CREATE_ACCOUNT_STRCrea AccountEBISU_LOGIN_DATE_OF_BIRTH_STRData di NascitaEBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STRData di NascitaEBISU_FRIENDS_DELETE_STREliminaEBISU_FRIENDS_DELETING_FRIEND_STREliminazione amico...EBISU_NEWS_DISMISS_STRChiudiEBISU_PROFILE_DISPLAY_STRMostraEBISU_PROFILE_SETTINGS_DISPLAY_NAME_STRMostra Nome:EBISU_GMAIL_DONE_STRFineEBISU_PROFILE_EDIT_STRModificaEBISU_NEWS_EDIT_STRModificaEBISU_FRIENDS_EMAIL_STRE-mail:EBISU_INVITE_EMAIL_STRE-mailEBISU_PROFILE_EMAIL_STRE-mail:EBISU_LOGIN_EMAIL_STRE-mailEBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STRE-mail e password già esistenti.EBISU_ERROR_EMAIL_REQUIRED_STRE-mail necessaria per continuare.EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STRMail+N.utenteEBISU_PROFILE_SETTINGS_EMAIL_STRE-mailEBISU_LOGIN_DUMMY_EMAIL_STRemail@domain.comEBISU_LOGIN_ENTER_EMAIL_STRInserisci l'e-mailEBISU_LOGIN_ENTER_PHONE_NUMBER_STRInserisci il numero di telefono per ricevere notifiche e altro via sms!EBISU_LOGIN_ACCOUNT_STRInserisci il tuo indirizzo e-mail per creare o accedere a un account.EBISU_ERROR_ERROR_TITLE_STRErroreEBISU_GMAIL_GMAILPLACEHOLDER_STRexample@domain.comEBISU_RETURN_EXIT_STREsciEBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRAmici di FacebookEBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRImpostazioni di FacebookEBISU_ERROR_FAILED_TO_DELETE_FRIEND_STRImpossibile eliminare amico.EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STRImpossibile rimuovere notizia.EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STRImpossibile inviare l'accettazione.EBISU_ERROR_FAILED_TO_SEND_DECLINE_STRImpossibile inviare il rifiuto.EBISU_PROFILE_SETTINGS_FEMALE_STRFemminaEBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STRCerca amici tramite i contatti.EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STRCerca amici e fatti rintracciare tramite Facebook. EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STRCerca amici e fatti rintracciare tramite Gmail.EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STRCerca amici su OriginEBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STRScopri con quali giochi si divertono i tuoi amici!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STRCerca tuoi amici su OriginEBISU_LOGIN_FORGOT_PASSWORD_STRHo dimenticato la passwordEBISU_FRIENDS_FRI_STRVenEBISU_NEWS_FRI_STRVenEBISU_NEWS_FRIEND_REQUEST_BODY_STRti ha inviato una richiesta di amicizia.EBISU_NEWS_FRIEND_REQUEST_STRRichiesta di AmiciziaEBISU_CAT_FRIENDS_STRAmiciEBISU_NAV_FRIENDS_STRAmiciEBISU_PROFILE_FRIENDS_ONLY_STRSolo gli AmiciEBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STRSolo gli AmiciEBISU_FRIENDS_FRIENDS_WHO_HAVE_STRAmici con %GAMENAME%EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STRAmici senza %GAMENAME%EBISU_FRIENDS_GENDER_STRSesso:EBISU_PROFILE_SETTINGS_GENDER_STRSessoEBISU_PROFILE_GENDER_STRSesso:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STRRicevi notizie sui giochi e offerte esclusive da EA!EBISU_NEWS_GET_IT_STRPrendiloEBISU_ERROR_GETTING_USER_INFO_STROttenere i tuoi datiEBISU_NEWS_GO_TO_STRVaiEBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRAmici di GoogleEBISU_NEWS_HIGH_SCORE_STRRecordEBISU_FRIENDS_HOME_STRResidenzaEBISU_PROFILE_HOME_STRResidenzaEBISU_PROFILE_SETTINGS_HOME_STRResidenzaEBISU_LOGIN_AGREE_PP_TOS_STRAccetto la Politica sulla privacy e i Termini di servizio.EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIAVoglio essere rintracciabile tramite:EBISU_NEWS_IGNORE_STRIgnoraEBISU_FRIENDS_CONTACTS_IN_STRIN OriginEBISU_ERROR_INCORRECT_LOGIN_INFO_STRDati di accesso erratiEBISU_FRIENDS_INVITE_STRInvitaEBISU_FRIENDS_CHOOSE_SMS_EMAIL_STRInvita gli amici su OriginEBISU_FRIENDS_SENTINVITE_STRInvito inviatoEBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STRInvita i tuoi amici su OriginEBISU_NEWS_INVITES_STRInvitiEBISU_LOGIN_DUMMY_REAL_NAME_STRTizio CaioEBISU_FRIENDS_LAST_LOGIN_STRUltimo accesso:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STRUltimo accesso:EBISU_NEWS_LAST_UPDATE_STRUltimo aggiornamento: %TIME%EBISU_NEWS_LASTUPDATE_NEVER_STRUltimo aggiornamento: MaiEBISU_NEWS_LAUNCH_STRAvviaEBISU_PROFILE_LEGEND_STRLegendaEBISU_PROFILE_SETTINGS_LOADING_STRCaricamentoEBISU_LOGIN_LOGIN_STRAccediEBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRAccedi a FacebookEBISU_PROFILE_LOGOUT_STREsciEBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STREsci da FacebookEBISU_LOGIN_LOGGING_IN_STRAccesso in corso...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STRFatti dei nuovi amici partecipando alle sfide!EBISU_PROFILE_SETTINGS_MALE_STRMaschioEBISU_FRIENDS_MOBILE_STRCellulare:EBISU_PROFILE_MOBILE_STRCellulare:EBISU_PROFILE_SETTINGS_MOBILE_STRCellulareEBISU_FRIENDS_MON_STRLunEBISU_NEWS_MON_STRLunEBISU_FRIENDS_MY_FRIENDS_TAB_STRI miei Amici EBISU_PROFILE_MY_GAMES_STRI miei Giochi EBISU_PROFILE_SETTINGS_MY_IMAGE_STRLa mia immagineEBISU_NAV_PROFILE_STRIl mio profilo EBISU_PROFILE_MY_WISH_LIST_STRLa mia lista dei desideriEBISU_CAT_NEWS_STRNovitàEBISU_NAV_NEWS_STRNovitàEBISU_ACHIEVEMENT_NICE_JOB_STROttimo lavoro! Vuoi condividere il tuo punteggio e sfidare altri giocatori sulla rete di Origin?EBISU_ACHIEVEMENT_NICE_JOB_USER_STROttimo lavoro, %USERNAME%! Vuoi condividere il tuo risultato sulla rete di Origin?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STRNo, non rintracciarmi tramite il nome su Facebook.EBISU_ACHIEVEMENT_NO_STRNo, grazieEBISU_FRIENDS_CONTACTS_NOT_IN_STRNON IN OriginEBISU_LOGIN_OK_STROKEBISU_ERROR_SOMETHING_WENT_WRONG_STROps! Si è verificato un inconveniente...EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STROps! Si è verificato un errore inatteso.EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STROps! Si è verificato un errore inatteso.EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STROps! Si è verificato un errore inatteso.EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STROps! Si è verificato un errore inatteso.EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STROps! Si è verificato un errore inatteso.EBISU_ERROR_INVALID_DOCUMENT_STROps! Si è verificato un errore inatteso.EBISU_ERROR_INVALID_LANGUAGE_CODE_STROps! Si è verificato un errore inatteso.EBISU_ERROR_LICENSE_NOT_FOUND_STROps! Si è verificato un errore inatteso.EBISU_ERROR_REFERENCE_NOT_FOUND_STROps! Si è verificato un errore inatteso.EBISU_ERROR_REGISTRATION_FAILED_STROps! Si è verificato un errore inatteso.EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STROps! Si è verificato un errore inatteso.EBISU_ERROR_SERVER_USER_API_FAILURE_STROps! Si è verificato un errore inatteso.EBISU_ERROR_SERVICE_FAILURE_STROps! Si è verificato un errore inatteso.EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STROps! Si è verificato un errore inatteso.EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STROps! Si è verificato un errore inatteso.EBISU_ERROR_USER_CREATION_FAILED_STROps! Si è verificato un errore inatteso.EBISU_ERROR_USER_LISTING_FAILED_STROps! Si è verificato un errore inatteso.EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STROps! Si è verificato un errore inatteso.EBISU_PROFILE_OPT_IN_STRAccettaEBISU_PROFILE_OPT_OUT_STRRinunciaEBISU_LOGIN_PASSWORD_STRPasswordEBISU_PROFILE_SETTINGS_PASSWORD_STRCambia PasswordEBISU_GMAIL_PASSWORD_STRPasswordEBISU_ERROR_PASSWORD_REQUIRED_STRPassword necessaria per continuare.EBISU_ERROR_PASSWORD_RESTRICTIONS_STRDa 4 a 16 caratteri consentiti per la password.EBISU_FRIENDS_PENDINGINVITES_STRInviti in AttesaEBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STRLe persone bloccate non possono sfidarti o visualizzare il tuo profilo.EBISU_PROFILE_PLAY_STRGiocaEBISU_FRIENDS_PLAYNOW_STRGiocare Ora?EBISU_FRIENDS_PLAYING_COLON_STRGioco in corso:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STRCrea un nome utente per completare la configurazione del tuo account Origin. Usa quello suggerito, se ti piace!EBISU_ERROR_ENTER_USERNAME_STRInserisci un nome utente per continuare. EBISU_ERROR_ENTER_VALID_EMAIL_STRInserisci un indirizzo e-mail valido per continuare.EBISU_GMAIL_ENTERGMAILDATA_STRInserisci nome utente e password Gmail.EBISU_ERROR_USER_NOT_LOGGED_IN_STREffettua l'accesso.EBISU_ERROR_REENTER_INFO_STRInserisci di nuovo i tuoi dati per continuare.EBISU_ERROR_REENTER_INFO_CONTINUE_STRInserisci di nuovo i tuoi dati per continuare.EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STRLeggi e accetta i Termini di servizio.EBISU_ERROR_SIGN_IN_STRAccediEBISU_ERROR_SIGN_IN_TO_CONTINUE_STRAccedi per continuareEBISU_PROFILE_PRIVACY_POLICY_STRPolitica Sulla PrivacyEBISU_PROFILE_PRIVATE_STRPrivatoEBISU_PROFILE_SETTINGS_PRIVATE_STRPrivatoEBISU_CAT_PROFILE_STRProfiloEBISU_FRIENDS_PROFILE_STRProfiloEBISU_NEWS_PROFILE_STRProfiloEBISU_PROFILE_SETTINGS_TAB_STRImpostazioni ProfiloEBISU_PROFILE_PROFILE_PRIVACY_STRImpostazioni Profilo/PrivacyEBISU_PROFILE_PUBLIC_STRPubblicoEBISU_PROFILE_SETTINGS_PUBLIC_STRPubblicoEBISU_NEWS_PULLDOWN_TO_UPDATE_STRTrascina in basso per aggiornare...EBISU_PROFILE_REAL_NAME_STRNome Reale:EBISU_FRIENDS_REAL_NAME_STRNome Reale:EBISU_PROFILE_SETTINGS_REAL_NAME_STRNome RealeEBISU_LOGIN_RECOVER_MY_PASSWORD_STRRecupera la mia passwordEBISU_LOGIN_REGISTER_NEW_USER_STRRegistra nuovo utente.EBISU_LOGIN_REGISTERING_NEW_USER_STRRegistrazione nuovo utente...EBISU_NEWS_REJECT_STRRifiutaEBISU_NEWS_RELEASE_TO_UPDATE_STRPubblicazione aggiornamentoEBISU_FRIENDS_BLOCKING_A_USER_STRBloccando questa persona impedirai futuri contatti tra di voi su Origin.EBISU_NEWS_REMOVE_STRRimuoviEBISU_FRIENDS_REMOVE_FRIEND_STRRimuovi AmicoEBISU_FRIENDS_REPORT_STRSegnalaEBISU_FRIENDS_REPORT_USER_STRSegnala %USERNAME%EBISU_FRIENDS_REPORT_BLOCK_STRSegnala/BloccaEBISU_NEWS_REPORT_BLOCK_STRSegnala/BloccaEBISU_ERROR_RESULTS_LOADING_STRCaricamento risultati...EBISU_ERROR_RETRIEVING_STRRecuperoEBISU_RETURN_RETURN_TO_GAME_STRTornare al giocoEBISU_FRIENDS_SAT_STRSabEBISU_NEWS_SAT_STRSabEBISU_PROFILE_SETTINGS_SAVE_STRSalvaEBISU_PROFILE_SETTINGS_SAVING_STRSalvataggioEBISU_FRIENDS_SEARCH_STRCerca EBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STRI criteri di ricerca devono essere composti da almeno 3 caratteri.EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STRI criteri di ricerca devono essere composti da almeno 3 caratteri.EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STRI criteri di ricerca devono essere composti da almeno 3 caratteri.EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STRCerca in queste reti.EBISU_SEARCH_OPTIONS_STROpzioni di RicercaEBISU_FRIENDS_SEARCH_ORIGIN_STRCerca su OriginEBISU_FRIENDS_SEARCH_RESULTS_STRRisultati della RicercaEBISU_FRIENDS_SEARCHRESULTS_STRRisultati della RicercaEBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STRRisultati della ricerca tra i ContattiEBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRRisultati della ricerca su FacebookEBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRRisultati della ricerca su GoogleEBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STRRisultati della ricerca su OriginEBISU_FRIENDS_SEARCHING_STRRicerca in corsoEBISU_FRIENDS_SENDING_FRIEND_REQUEST_STRInvio richiesta di amicizia...EBISU_LOGIN_SETUP_ACCOUNT_STRConfigura AccountEBISU_PROFILE_SETTINGS_EDIT_STRImpostazEBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STRNon voglio essere rintracciabile tramite e-mail.EBISU_PROFILE_SETTINGS_NEWPASSWORD_STRNuova Pass.EBISU_LOGIN_SETTING_UP_ACCOUNT_STRConfigurazione account...EBISU_NEWS_SHARE_STRCondividiEBISU_PROFILE_SHOW_LESS_STRMostra di MenoEBISU_PROFILE_SHOW_MORE_STRMostra di PiùEBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STRConnettiti a OriginEBISU_LOGIN_SIGN_IN_ORIGIN_STRConnettiti a OriginEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STRMessaggio richiesta connessioneEBISU_LOGIN_SIGN_UP_BUTTON_STRRegistrati!EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STRSpiacenti, %USERNAME% non è più disponibile nella rete di Origin. Usa quello suggerito o crea un altro nome utente per continuare.EBISU_ERROR_UNEXPECTED_ERROR_STRSpiacenti, si è verificato un errore inatteso. Riprova.EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STRSpiacenti, a causa di restrizioni locali, al momento non hai i requisiti per registrarti a Origin.EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STRSpiacenti, non esiste alcun account perEBISU_ERROR_NO_RESULTS_FOUND_STRSpiacenti, nessun risultato trovato. Riprova.EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STRSpiacenti, al momento non è possibile accedere a Origin.EBISU_ERROR_LOGIN_FAILED_STRSpiacenti, accesso a Origin fallito.EBISU_ERROR_SERVER_DOWN_STRSpiacenti, i nostri server non sono attivi. Riprova.EBISU_ERROR_ID_ALREADY_TAKEN_STRSpiacenti, questo nome utente non è più disponibile. Scegline un altro.EBISU_ERROR_DATE_OF_BIRTH_INVALID_STRSpiacenti, la data di nascita che hai inserito non è valida.EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STRSpiacenti, e-mail e password non possono essere uguali. Riprova.EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STRSpiacenti, le password che hai inserito non corrispondono.EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STRSpiacenti, si è verificato un errore di comunicazione con il servizio per la password. Riprova più tardi.EBISU_ERROR_EMAIL_ADRESS_INVALID_STRSpiacenti, questo indirizzo e-mail non è valido.EBISU_ERROR_EMAIL_FORMAT_INVALID_STRSpiacenti, il formato dell'e-mail non è valido. Riprova.EBISU_ERROR_USER_NOT_FOUND_STRSpiacenti, questo nome utente non è stato trovato.EBISU_ERROR_DIDNT_RECEIVE_INFO_STRSpiacenti, i tuoi dati non sono pervenuti. Riprova.EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STRSpiacenti, al momento non hai i requisiti per registrarti a Origin.EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STRSpiacenti, la password non può contenere spazi. Riprova.EBISU_FRIENDS_SUN_STRDomEBISU_NEWS_SUN_STRDomEBISU_PROFILE_TOS_STRTermini di ServizioEBISU_ERROR_Origin_NET_NOT_REACHED_STRImpossibile raggiungere la rete di Origin. Controlla la tua connessione di rete e riprova.EBISU_ERROR_EMAIL_ALREADY_EXISTS_STRQuesta e-mail è già presente su OriginEBISU_ERROR_INVALID_EMAIL_FORMAT_STRIl formato di questa e-mail non è valido.EBISU_ERROR_EMAIL_NOT_REGISTERED_STRQuesta e-mail non è al momento registrata su Origin.EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STRPotrebbe richiedere qualche minuto...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STRQuesto nome utente è già presente su Origin.EBISU_FRIENDS_THUR_STRGioEBISU_NEWS_THUR_STRGioEBISU_ERROR_DOMAIN_INVALID_STRPer continuare, inserisci un indirizzo e-mail valido.EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STRPer reimpostare la password, inserisci l'indirizzo e-mail associato al tuo account.EBISU_FRIENDS_TODAY_STROggiEBISU_NEWS_TODAY_STROggiEBISU_LOGIN_TRY_STRProvaEBISU_FRIENDS_TUE_STRMarEBISU_NEWS_TUE_STRMarEBISU_LOGIN_SOMETHING_WENT_WRONG_STROps! Si è verificato un inconveniente...EBISU_NEWS_UPDATES_STRAggiornamentiEBISU_ERROR_UPDATING_CHANGES_STRAggiornamento in corso...EBISU_LOGIN_USER_REGISTERED_STRUtente registrato!EBISU_PROFILE_USERNAME_STRNome utenteEBISU_LOGIN_USERNAME_STRN. utenteEBISU_PROFILE_SETTINGS_USERNAME_STRNome utenteEBISU_GMAIL_USERNAME_STRNome utenteEBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STRNome utente e password necessari per continuare.EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STRDa 4 a 12 caratteri alfanumerici consentiti per nome utente e password.EBISU_ERROR_USERNAME_REQUIRED_STRNome utente necessario per continuare.EBISU_ERROR_USERNAME_RESTRICTIONS_STRDa 4 a 12 caratteri alfanumerici consentiti per il nome utente.EBISU_ERROR_USERNAME_NOT_AVAILABLE_STRNome utente non valido.EBISU_ACHIEVEMENT_WAY_TO_GO_STRCosì si fa! Vuoi condividere il tuo punteggio e sfidare altri giocatori sulla rete di Origin?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STRCosì si fa, %USERNAME%! Vuoi condividere il tuo tempo sulla rete di Origin?EBISU_ERROR_SEARCH_FAILED_STRNon sono stati trovati risultati corrispondenti alla ricerca.EBISU_FRIENDS_WED_STRMerEBISU_NEWS_WED_STRMerEBISU_NAV_WELCOME_STRBenvenutoEBISU_LOGIN_WELCOME_BACK_STRCiao!EBISU_ACHIEVEMENT_WELL_DONE_STRBen fatto! Vuoi condividere il tuo punteggio e sfidare altri giocatori sulla rete di Origin?EBISU_ACHIEVEMENT_WELL_DONE_USER_STRBen fatto, %USERNAME%! Vuoi sfidare altri giocatori di %GAMENAME% sulla rete Origin?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STRCosa ti piacerebbe fare?EBISU_LOGIN_WHY_JOIN_STRPerché dovrei registrarmi a Origin?EBISU_ACHIEVEMENT_YES_STREBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STRSì, permetti ai membri di Origin di rintracciarmi tramite il nome di Facebook.EBISU_FRIENDS_YESTERDAY_STRIeriEBISU_NEWS_YESTERDAY_STRIeriEBISU_ERROR_MUST_AGREE_TOS_AND_PP_STRDevi accettare i Termini di Servizio e la Politica sulla Privacy per continuare.EBISU_ACHIEVEMENT_DOING_GREAT_STRStai andando alla grande! Vuoi condividere il tuo record di punteggio e sfidare altri giocatori sulla rete di Origin?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STRTi è stata lanciata una sfida! %USERNAME% vuole giocare con te a %GAMENAME%! Vuoi accettare la sfida? Prendi subito %GAMENAME%.EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STRTi è stata lanciata una sfida! %USERNAME% vuole giocare con te a %GAMENAME%! EBISU_ERROR_CONN_TIMED_OUT_STRIl tempo di connessione è scaduto. Connettiti di nuovo a Origin.EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STRL'e-mail e la password non corrispondono. Riprova.EBISU_LOGIN_NEW_PASSWORD_SENT_STRÈ stata inviata un'e-mail aEBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STRIl tuo account Origin è stato creato e hai effettuato l'accesso. Comincia subito ad aggiungere gli amici!EBISU_ERROR_SEARCH_NO_RESULTS_STRLa ricerca non ha prodotto risultati. EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRgg-mm-aaaaEBISU_ERROR_EMAIL_TOO_LONG_STRL'indirizzo e-mail è troppo lungo.EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STRQuesto account Origin non esiste più.EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STRLa memoria disponibile del dispositivo si sta esaurendo. Per consentire la corretta esecuzione di Origin, consigliamo di eliminare le applicazioni inutilizzate.EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRSpiacenti, il dispositivo non è in grado di inviare messaggi in questo momento.EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRSpiacenti, sul tuo dispositivo non è configurato un account e-mail in questo momento.EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STRVuoi davvero cambiare la password? Dovrai usarla ogni volta che ti connetterai a Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_STRGiocatoreEBISU_STRING_TODAY_WITH_DATE_STROggi %DATE%EBISU_STRING_ONE_DAY_AGO_STR1 giorno faEBISU_STRING_DAYS_AGO_STR%DAYS% giorni faEBISU_STRING_ONE_WEEK_AGO_STR1 settimana faEBISU_STRING_WEEKS_AGO_STR%WEEKS% settimane faEBISU_STRING_ONE_MONTH_AGO_STRUn mese faEBISU_STRING_FACEBOOK_TOS_STREffettuando l'accesso a Facebook, accetto di essere rintracciabile tramite il mio nome su Facebook.EBISU_STRING_GMAIL_AUTH_FAILED_STRIl nome utente o la password che hai inserito sono errati.EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STRHai creato correttamente un account Origin! Ora trova gli amici, aggiungili e sfidali. [BUTTON] OKEBISU_STRING_PRIVACY_CAPS_COLON_STRPRIVACY:EBISU_STRING_JOIN_EBISU_STRRegistrati a Origin!EBISU_STRING_WELCOME_BACK_USER_STRCiao, %USERNAME%!EBISU_FRIENDS_PENDING_STRIn sospesoEBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STRPotrebbe richiedere qualche minuto.EBISU_FRIENDS_LAUNCH_MANUALLY_STRSpiacenti, dovrai avviare %GAMENAME% manualmente. Se hai già eliminato l'applicazione, scaricala di nuovo.EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRSpiacenti, il dispositivo non è in grado di inviare messaggi in questo momento.EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STRHai creato correttamente un account Origin! Ora trova gli amici, aggiungili e sfidali. [BUTTON] OKEBISU_FRIENDS_GO_STRVaiEBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRSpiacenti, sul tuo dispositivo non è configurato un account e-mail in questo momento.EBISU_ERROR_CONN_TIMED_OUT_2_STRIl tempo di connessione è scaduto. Riprova o seleziona OK per cambiare le impostazioni di rete. [BUTTON] RIPROVA [BUTTON] OKEBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STRVuoi davvero cambiare la password? Dovrai usarla ogni volta che ti connetterai a Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_2_STRGiocatoreEBISU_STRING_MONTHS_AGO_STR %MONTHS% mesi faEBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STRUsa il nome suggerito o creane un altro.EBISU_LOGIN_MOBILE_STRCellulareEBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@Accetto la @a href=\"http://privacy\"@Politica sulla privacy@/a@ e i @a href=\"http://tos\"@Termini di servizio@/a@ di EA@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STRAssicurati che i dati inseriti siano completi e corretti.EBISU_FRIENDS_NO_FRIENDS_TITLE_STRAggiungi i Tuoi Amici Ora!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STRCondividi punteggi, sfida amici e scopri giochi!EBISU_STRING_ADD_FRIENDS_GMAIL_STRCerca fra i contatti per trovare gli amici.EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STRRegistrandomi, accetto di essere rintracciabile tramite e-mail e acconsento alla pubblicazione automatica degli eventi relativi ai miei giochi. Posso modificare tali impostazioni nella sezione apposita del mio profilo.EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STRRecordEBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STRRisultatiEBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STRCondividi Con Gli AmiciEBISU_PROFILE_SETTINGS_NEWSSETTINGS_STRImpostazioni NotizieEBISU_LOGIN_AGE_STREtàEBISU_PROFILE_ABOUT_STREULAEBISU_LOGO_LOGO_INSTRUCTIONS_STRTocca il logo Origin per tornare al gioco. Tocca di nuovo per andare avanti e indietro.EBISU_NEWS_NO_INVITES_STRNessun nuovo invito. Torna presto!EBISU_NEWS_NO_INVITES_DESCRIPTION_STRControlla ogni giorno se hai inviti o sfide dagli amici.EBISU_PROFILE_INFO_STRInfoEBISU_LOGIN_TRY_AGAIN_STRRiprovaEBISU_ERROR_ENTER_VALID_AGE_STRInserisci un'età valida.EBISU_LOGIN_AUTO_LOGGING_IN_STRAccesso automatico...EBISU_STRING_JOIN_EBISU_TITLE_STRPenso che Origin sia il top. E lo penserai anche tu. Registrati e potremo essere amici!EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STRcontenente le istruzioni per ripristinare la tua password.EBISU_ERROR_PASSWORD_INVALID_STRPassword non valida.EBISU_ERROR_TOS_TOO_LONG_STRTermini di Servizio troppo lunghi.EBISU_STRING_START_NOW_STRSì! Inizia ora!EBISU_LOGO_PLAYER_STRGiocatoreEBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STRUsa il tuo account Origin principale per modificare le impostazioni di Facebook.EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STRRendi pubblico il tuo profilo per farlo vedere ai tuoi amici. EBISU_FRIEND_REMOVE_CONFIRMATION_STRConfermare?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STRL'utente %USERNAME% sarà rimosso della tua lista amici. Potrai sempre reinserirlo in un secondo momento.EBISU_FRIEND_IGNORING_CHALLENGE_STRSfida ignorata...EBISU_FRIEND_ACCEPTING_REQUEST_STRAccettazione richiesta di amicizia...EBISU_FRIEND_DECLINING_REQUEST_STRRifiuto richiesta di amicizia...EBISU_FRIEND_SENDING_BLOCK_STRRichiesta inviataEBISU_FRIEND_SENDING_REPORT_STRRichiesta inviataEBISU_LOGIN_RECEIVE_EA_UPDATE_STRVorrei ricevere informazioni e notizie sui giochi EA.EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STRPurtroppo non possiedi i requisiti per la registrazione.EBISU_PROFILE_ERROR_FACEBOOK_STRSi prega di accedere a Facebook.EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STRSeleziona una delle impostazioni disponibili prima di salvare..EBISU_ERROR_USERNAME_NOT_ALLOWED_STRNome utente non consentito. Scegline uno diverso o usa quello suggerito.EBISU_PROFILE_SETTINGS_SEACHABLEOK_STRPermetti ai soci di cercarmi per e-mail.EBISU_EMAIL_INVITE_SUBJECT_STRInvito a OriginEBISU_ERROR_LOG_INTO_FACEBOOK_STRAccedi a Facebook.EBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STRPartite giocateEBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STRHai già un account EA? Inserisci la tua password sotto.EBISU_ERROR_REAL_NAME_TOO_LONGIl Nome reale immesso è troppo lungoEBISU_ERROR_REAL_NAME_INVALID_CHARACTERSUsa solo caratteri alfanumerici per il Nome realeEBISU_ERROR_TOO_MANY_ATTEMPTSHai tentato l'accesso a Origin troppe volte. Attendi prima di riprovare.EBISU_SENDING_REQUEST_STRInvio di richiestaEBISU_FRIENDS_SENT_REQUEST_TITLE_STRRichiesta inviataEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STREBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STRNOEBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STRCerchi i tuoi amici presenti nei contatti?EBISU_FRIEND_PERMISSION_CONTACTS_STRPer trovare i tuoi amici, i tuoi contatti verranno condivisi temporaneamente con i nostri server per essere confrontati con gli utenti di Origin esistenti. Le informazioni non verranno conservate. \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/Japanese Text.plist b/app/src/main/assets/EASP/Origin/resources/Japanese Text.plist new file mode 100644 index 0000000..a7a4cd5 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/Japanese Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR*本名EBISU_LOGIN_OPTIONAL_INFO_STR*は任意情報ですEBISU_ACHIEVEMENT_USER_DOING_GREAT_STR%USERNAME%、素晴らしいスコアです! あなたのハイスコアをOriginネットワークで共有してみませんか?EBISU_FRIENDS_GAME_LIST_TITLE_STR%USERNAME%のゲームEBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME%が%GAMENAME%であなたのベストタイムを更新しました。EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME%が%GAMENAME%であなたのハイスコアを更新しました。EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME%からフレンド登録の依頼が送られています。EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STR誕生日の入力が必要です。EBISU_ERROR_WIFI_REQUIRED_STR%GAMENAME%からOriginにサインインするにはWiFi接続が必要です。EBISU_ERROR_WIFI_3G_REQUIRED_STR%GAMENAME%からOriginにサインインするにはWiFiまたは3G接続が必要です。EBISU_NEWS_ACCEPT_STR承認EBISU_NEWS_ACCEPTED_FRIEND_STRフレンド登録の依頼を承認するEBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STR現在、プライバシーポリシーへはアクセスできません。EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STR現在、利用規約へはアクセスできません。EBISU_ERROR_TOS_FAILURE_STR現在、利用規約へはアクセスできません。EBISU_ERROR_TOS_NOT_FOUND_STR現在、利用規約へはアクセスできません。EBISU_NEWS_ACHIEVEMENT_UNLOCK_STR解除した実績:EBISU_FRIENDS_ADD_STR追加EBISU_FRIENDS_ADD_FRIENDS_TAB_STRフレンドの追加EBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STRあなたのネットワークにフレンドを追加しましょう!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STROriginネットワークでフレンドを追加する。EBISU_PROFILE_ADD_GAMES_STRゲームを追加EBISU_FRIENDS_ADD_YOUR_CONTACTS_STR連絡先を追加EBISU_FRIENDS_AGE_STR年齢EBISU_PROFILE_AGE_STR年齢EBISU_PROFILE_SETTINGS_AGE_STR年齢EBISU_ERROR_ALERT_STRアナウンスEBISU_FRIENDS_ALREADY_ADDED_STR追加済みですEBISU_LOGIN_INVITATION_SENT_STR%EMAIL%に招待を送信しましたEBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STRログインできない状態ですか?EBISU_FRIENDS_BACK_STR戻るEBISU_PROFILE_SETTINGS_BACK_STR戻るEBISU_FRIENDS_BLOCK_STRブロックEBISU_FRIENDS_BLOCK_USER_STR%USERNAME%をブロックしますか?EBISU_FRIENDS_BUY_STR購入EBISU_PROFILE_BUY_NOW_STR今すぐ購入EBISU_GMAIL_CANCEL_STRキャンセルEBISU_FRIENDS_CHALLENGE_STRチャレンジEBISU_PROFILE_CHALLENGE_STRチャレンジEBISU_NEWS_CHALLENGE_STRチャレンジEBISU_LOGIN_CHANGE_USERNAME_STRユーザー名の変更EBISU_LOGIN_CHECKING_EMAIL_STREメールアドレスを確認中EBISU_FRIENDS_COMMENT_STRコメントEBISU_LOGIN_COMPLETE_SETUP_STR設定完了EBISU_LOGIN_CONFIRM_STR確認EBISU_PROFILE_SETTINGS_CONFIRM_STR確認EBISU_LOGIN_CONGRATULATIONS_STRおめでとうございます!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STRおめでとうございます、%USERNAME%! 速いタイムを叩き出しました! Originランキングを確認しますか?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STRおめでとうございます、%USERNAME%! 速いタイムを叩き出しました! 自分のOriginランキングを確認しますか?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STRおめでとうございます、%USERNAME%! ハイスコアを達成しました! Originランキングを確認しますか?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STRおめでとうございます、%USERNAME%! ハイスコアを達成しました! 自分のOriginランキングを確認しますか?EBISU_FRIENDS_CONNECT_FB_STRFacebookに接続EBISU_FRIENDS_CONNECT_GOOGLE_STRGoogleに接続EBISU_FRIENDS_CONTACTS_STR連絡先EBISU_LOGIN_CONTINUE_STR続行EBISU_LOGIN_CREATE_ACCOUNT_STRアカウントの作成EBISU_LOGIN_DATE_OF_BIRTH_STR誕生日EBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STR誕生日EBISU_FRIENDS_DELETE_STR削除EBISU_FRIENDS_DELETING_FRIEND_STRフレンドの削除中...EBISU_NEWS_DISMISS_STR却下EBISU_PROFILE_DISPLAY_STR表示EBISU_PROFILE_SETTINGS_DISPLAY_NAME_STR表示名:EBISU_GMAIL_DONE_STR完了EBISU_PROFILE_EDIT_STR編集EBISU_NEWS_EDIT_STR編集EBISU_FRIENDS_EMAIL_STREmail:EBISU_INVITE_EMAIL_STREmailEBISU_PROFILE_EMAIL_STREmail:EBISU_LOGIN_EMAIL_STREmailEBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STREメールアドレスとパスワードが既に存在します。EBISU_ERROR_EMAIL_REQUIRED_STR続けるにはEメールアドレスが必要です。EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STREmailとユーザー名 EBISU_PROFILE_SETTINGS_EMAIL_STREmailEBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STREメールアドレスを入力EBISU_LOGIN_ENTER_PHONE_NUMBER_STR電話番号を入力すると、テキスト通知などが送られてきます!EBISU_LOGIN_ACCOUNT_STRサインインするか、アカウントを作成。EBISU_ERROR_ERROR_TITLE_STRエラーEBISU_GMAIL_GMAILPLACEHOLDER_STRexample@gmail.comEBISU_RETURN_EXIT_STR終了EBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRFacebook フレンドEBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRFacebook 設定EBISU_ERROR_FAILED_TO_DELETE_FRIEND_STRフレンドの削除に失敗しました。EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STRニュースアイテムの削除に失敗しました。EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STR承認の送信に失敗しました。EBISU_ERROR_FAILED_TO_SEND_DECLINE_STR拒否の送信に失敗しました。EBISU_PROFILE_SETTINGS_FEMALE_STR女性EBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STR連絡先でお互いを検索する。EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STRFacebookでお互いを検索する。EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STRGmailでお互いを検索する。EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STROriginでフレンドを検索するEBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STRフレンドがプレイしているゲームを確かめよう!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STROriginでフレンドを検索するEBISU_LOGIN_FORGOT_PASSWORD_STRパスワードを忘れた場合EBISU_FRIENDS_FRI_STREBISU_NEWS_FRI_STREBISU_NEWS_FRIEND_REQUEST_BODY_STRからフレンド登録の依頼が送られています。EBISU_NEWS_FRIEND_REQUEST_STRフレンド登録の依頼EBISU_CAT_FRIENDS_STRフレンドEBISU_NAV_FRIENDS_STRフレンドEBISU_PROFILE_FRIENDS_ONLY_STRフレンドのみEBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STRフレンドのみEBISU_FRIENDS_FRIENDS_WHO_HAVE_STR%GAMENAME%を持っているフレンドEBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STR%GAMENAME%を持っていないフレンドEBISU_FRIENDS_GENDER_STR性別:EBISU_PROFILE_SETTINGS_GENDER_STR性別EBISU_PROFILE_GENDER_STR性別:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STREAからゲームニュースと限定オファーをゲットしよう!EBISU_NEWS_GET_IT_STR入手EBISU_ERROR_GETTING_USER_INFO_STR情報の入手EBISU_NEWS_GO_TO_STR移動するEBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRGoogle FriendEBISU_NEWS_HIGH_SCORE_STRハイスコアEBISU_FRIENDS_HOME_STRホームEBISU_PROFILE_HOME_STRホームEBISU_PROFILE_SETTINGS_HOME_STRホームEBISU_LOGIN_AGREE_PP_TOS_STRプライバシーポリシーと利用規約に同意します。EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIA次の方法による検索を有効にする:EBISU_NEWS_IGNORE_STR無視EBISU_FRIENDS_CONTACTS_IN_STROrigin内EBISU_ERROR_INCORRECT_LOGIN_INFO_STRログイン情報に誤りがありますEBISU_FRIENDS_INVITE_STR招待EBISU_FRIENDS_CHOOSE_SMS_EMAIL_STRフレンドをOriginに招待するEBISU_FRIENDS_SENTINVITE_STR送信した招待EBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STRフレンドをOriginへ招待するEBISU_NEWS_INVITES_STR招待EBISU_LOGIN_DUMMY_REAL_NAME_STR未公表EBISU_FRIENDS_LAST_LOGIN_STR最後のログイン:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STR最後のログイン:EBISU_NEWS_LAST_UPDATE_STR最後のアップデート:%TIME%EBISU_NEWS_LASTUPDATE_NEVER_STR最後のアップデート:なしEBISU_NEWS_LAUNCH_STR起動EBISU_PROFILE_LEGEND_STRレジェンドEBISU_PROFILE_SETTINGS_LOADING_STRロード中EBISU_LOGIN_LOGIN_STRログインEBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRFacebookへログインEBISU_PROFILE_LOGOUT_STRログアウトEBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STRFacebookからログアウトEBISU_LOGIN_LOGGING_IN_STRログイン中...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STRゲームチャレンジに参加して新しいフレンドを作ろう!EBISU_PROFILE_SETTINGS_MALE_STR男性EBISU_FRIENDS_MOBILE_STR携帯:EBISU_PROFILE_MOBILE_STR携帯:EBISU_PROFILE_SETTINGS_MOBILE_STR携帯EBISU_FRIENDS_MON_STREBISU_NEWS_MON_STREBISU_FRIENDS_MY_FRIENDS_TAB_STRマイフレンドEBISU_PROFILE_MY_GAMES_STRマイゲームEBISU_PROFILE_SETTINGS_MY_IMAGE_STRマイイメージEBISU_NAV_PROFILE_STRマイ横顔EBISU_PROFILE_MY_WISH_LIST_STR希望リストEBISU_CAT_NEWS_STRニュースEBISU_NAV_NEWS_STRニュースEBISU_ACHIEVEMENT_NICE_JOB_STR素晴らしい結果です! Originネットワークであなたのハイスコアを共有し、他のプレイヤーにチャレンジしてみませんか?EBISU_ACHIEVEMENT_NICE_JOB_USER_STR素晴らしい結果です、%USERNAME%! あなたの実績をOriginネットワークで共有してみませんか?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STRいいえ、Facebook名では検索しないでください。EBISU_ACHIEVEMENT_NO_STRいいえEBISU_FRIENDS_CONTACTS_NOT_IN_STROrigin外EBISU_LOGIN_OK_STROKEBISU_ERROR_SOMETHING_WENT_WRONG_STR問題が発生しました。EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_INVALID_DOCUMENT_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_INVALID_LANGUAGE_CODE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_LICENSE_NOT_FOUND_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_REFERENCE_NOT_FOUND_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_REGISTRATION_FAILED_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_SERVER_USER_API_FAILURE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_SERVICE_FAILURE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_USER_CREATION_FAILED_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_USER_LISTING_FAILED_STR問題が発生しました。予期しないエラーが発生しました。EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STR問題が発生しました。予期しないエラーが発生しました。EBISU_PROFILE_OPT_IN_STRオプトインEBISU_PROFILE_OPT_OUT_STRオプトアウトEBISU_LOGIN_PASSWORD_STRパスワードEBISU_PROFILE_SETTINGS_PASSWORD_STRパスワードの変更EBISU_GMAIL_PASSWORD_STRパスワードEBISU_ERROR_PASSWORD_REQUIRED_STR続けるにはパスワードが必要です。EBISU_ERROR_PASSWORD_RESTRICTIONS_STRパスワードは4~16文字の英数字で入力してください。EBISU_FRIENDS_PENDINGINVITES_STR保留中の招待EBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STRブロックされた相手はあなたにチャレンジすることも、横顔の閲覧もできなくなります。EBISU_PROFILE_PLAY_STRプレイするEBISU_FRIENDS_PLAYNOW_STR今すぐプレイしますか?EBISU_FRIENDS_PLAYING_COLON_STRプレイ中:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STRユーザー名を作成して、Originアカウントの設定を完了してください。こちらの提案をご利用いただくことも可能です!EBISU_ERROR_ENTER_USERNAME_STR続けるにはユーザー名を入力してください。EBISU_ERROR_ENTER_VALID_EMAIL_STR続けるには有効なEメールアドレスを入力してください。EBISU_GMAIL_ENTERGMAILDATA_STRGmailのユーザー名とパスワードを入力してください。EBISU_ERROR_USER_NOT_LOGGED_IN_STRログインしてください。EBISU_ERROR_REENTER_INFO_STR続けるには再度情報を入力し直してください。EBISU_ERROR_REENTER_INFO_CONTINUE_STR続けるには再度情報を入力し直してください。EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STR利用規約を閲覧し、承認してください。EBISU_ERROR_SIGN_IN_STRログインしてくださいEBISU_ERROR_SIGN_IN_TO_CONTINUE_STR続けるにはサインインしてください。EBISU_PROFILE_PRIVACY_POLICY_STRプライバシーEBISU_PROFILE_PRIVATE_STR非公開EBISU_PROFILE_SETTINGS_PRIVATE_STR非公開EBISU_CAT_PROFILE_STR横顔EBISU_FRIENDS_PROFILE_STR横顔EBISU_NEWS_PROFILE_STR横顔EBISU_PROFILE_SETTINGS_TAB_STR横顔設定EBISU_PROFILE_PROFILE_PRIVACY_STR横顔/プライバシー設定EBISU_PROFILE_PUBLIC_STR公開EBISU_PROFILE_SETTINGS_PUBLIC_STR公開EBISU_NEWS_PULLDOWN_TO_UPDATE_STRプルダウンでアップデートします...EBISU_PROFILE_REAL_NAME_STR本名:EBISU_FRIENDS_REAL_NAME_STR本名:EBISU_PROFILE_SETTINGS_REAL_NAME_STR本名EBISU_LOGIN_RECOVER_MY_PASSWORD_STRパスワードの回復EBISU_LOGIN_REGISTER_NEW_USER_STR新しいユーザーを登録してください。EBISU_LOGIN_REGISTERING_NEW_USER_STR新しいユーザーを登録しています。。。EBISU_NEWS_REJECT_STR拒否EBISU_NEWS_RELEASE_TO_UPDATE_STRリリースしてアップデートEBISU_FRIENDS_BLOCKING_A_USER_STRブロックした相手とはOrigin上で一切連絡が取れなくなります。ご注意ください。EBISU_NEWS_REMOVE_STR削除EBISU_FRIENDS_REMOVE_FRIEND_STRフレンドの削除EBISU_FRIENDS_REPORT_STR報告EBISU_FRIENDS_REPORT_USER_STR%USERNAME%を報告するEBISU_FRIENDS_REPORT_BLOCK_STR報告/ブロックEBISU_NEWS_REPORT_BLOCK_STR報告/ブロックEBISU_ERROR_RESULTS_LOADING_STR結果のロード中...EBISU_ERROR_RETRIEVING_STR取得中EBISU_RETURN_RETURN_TO_GAME_STRゲームを再開しますかEBISU_FRIENDS_SAT_STREBISU_NEWS_SAT_STREBISU_PROFILE_SETTINGS_SAVE_STR保存EBISU_PROFILE_SETTINGS_SAVING_STR保存中EBISU_FRIENDS_SEARCH_STR検索EBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STR検索する言葉は3文字以上である必要があります。EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STR検索する言葉は3文字以上である必要があります。EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STR検索する言葉は3文字以上である必要があります。EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STRこのネットワークで検索する。EBISU_SEARCH_OPTIONS_STR検索オプションEBISU_FRIENDS_SEARCH_ORIGIN_STROriginを検索EBISU_FRIENDS_SEARCH_RESULTS_STR検索結果EBISU_FRIENDS_SEARCHRESULTS_STR検索結果EBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STR連絡先の検索結果EBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRFacebookの検索結果EBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRGoogleの検索結果EBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STROriginの検索結果EBISU_FRIENDS_SEARCHING_STR検索中EBISU_FRIENDS_SENDING_FRIEND_REQUEST_STRフレンド登録の依頼を送信中...EBISU_LOGIN_SETUP_ACCOUNT_STRアカウント設定EBISU_PROFILE_SETTINGS_EDIT_STR設定EBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STRいいえ。Eメールで私を探すことを許可しない。EBISU_PROFILE_SETTINGS_NEWPASSWORD_STR新しいパスワードEBISU_LOGIN_SETTING_UP_ACCOUNT_STRアカウントの設定中...EBISU_NEWS_SHARE_STR共有EBISU_PROFILE_SHOW_LESS_STR表示を減らすEBISU_PROFILE_SHOW_MORE_STRもっと表示するEBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STROriginにログインEBISU_LOGIN_SIGN_IN_ORIGIN_STRにログインEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STRログインする必要がありますEBISU_LOGIN_SIGN_UP_BUTTON_STRサインアップ!EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STR%USERNAME%はOriginネットワークですでに使用されています。続けるには新しいユーザー名を作成してください。EBISU_ERROR_UNEXPECTED_ERROR_STR予期せぬエラーが発生しました。後ほどお試しください。EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STR申し訳ございません、地域の制限により、現在Originに登録する事ができません。EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STR申し訳ございませんにはアカウントが存在しませんEBISU_ERROR_NO_RESULTS_FOUND_STR申し訳ございません、検索結果が存在しませんでした。もう一度お試しください。EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STR申し訳ございません、現在Originへはアクセスできません。EBISU_ERROR_LOGIN_FAILED_STROriginへのログインに失敗しました。EBISU_ERROR_SERVER_DOWN_STR現在サーバーが停止しております。後ほどお試しください。EBISU_ERROR_ID_ALREADY_TAKEN_STR申し訳ございません、そのユーザー名は現在使用されています。別のユーザー名をご入力ください。EBISU_ERROR_DATE_OF_BIRTH_INVALID_STR申し訳ございません、入力された誕生日が無効です。EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STR申し訳ございません、Eメールアドレスと同一のパスワードは使用できません。もう一度お試しください。EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STR申し訳ございません、入力されたパスワードが一致しません。EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STRパスワードサービスとの接続に問題が発生しました。後ほどお試しください。EBISU_ERROR_EMAIL_ADRESS_INVALID_STR申し訳ございません、Eメールアドレスが無効です。EBISU_ERROR_EMAIL_FORMAT_INVALID_STR申し訳ございません、このEメール形式は無効です。もう一度お試しください。EBISU_ERROR_USER_NOT_FOUND_STR申し訳ございません、ユーザー名が存在しません。EBISU_ERROR_DIDNT_RECEIVE_INFO_STR申し訳ございません、情報を取得する事ができませんでした。再度お試しください。EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STR申し訳ございません、Originに登録して頂くための条件が不足しております。EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STR申し訳ございません、パスワードに空白が使われています。もう一度お試しください。EBISU_FRIENDS_SUN_STREBISU_NEWS_SUN_STREBISU_PROFILE_TOS_STR利用規約EBISU_ERROR_Origin_NET_NOT_REACHED_STROriginのネットワークに接続できませんでした。ネットワーク接続を確認してから再度お試しください。EBISU_ERROR_EMAIL_ALREADY_EXISTS_STR同じEメールが既にOriginに存在しますEBISU_ERROR_INVALID_EMAIL_FORMAT_STRこのEメール形式は無効です。EBISU_ERROR_EMAIL_NOT_REGISTERED_STRこのEメールは現在Originへ登録されていません。EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STR今しばらくお待ちください...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STR同じユーザー名が既にOriginに存在します。EBISU_FRIENDS_THUR_STREBISU_NEWS_THUR_STREBISU_ERROR_DOMAIN_INVALID_STR続行するには、有効なEメールアドレスを入力してください。EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STRパスワードをリセットするには、アカウントにリンクされているEメールアドレスを入力してください。EBISU_FRIENDS_TODAY_STR今日EBISU_NEWS_TODAY_STR今日EBISU_LOGIN_TRY_STR試すEBISU_FRIENDS_TUE_STREBISU_NEWS_TUE_STREBISU_LOGIN_SOMETHING_WENT_WRONG_STRうわ! 何かがおかしいようです...EBISU_NEWS_UPDATES_STRアップデートEBISU_ERROR_UPDATING_CHANGES_STRアップデート中...EBISU_LOGIN_USER_REGISTERED_STRユーザーが登録されました!EBISU_PROFILE_USERNAME_STRユーザー名EBISU_LOGIN_USERNAME_STRユーザー名EBISU_PROFILE_SETTINGS_USERNAME_STRユーザー名EBISU_GMAIL_USERNAME_STRユーザー名EBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STR続けるにはユーザー名とパスワードが必要です。EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STRユーザー名とパスワードは4~12文字の英数字で入力してください。EBISU_ERROR_USERNAME_REQUIRED_STR続けるにはユーザー名が必要です。EBISU_ERROR_USERNAME_RESTRICTIONS_STRユーザー名は4~12文字の英数字で入力してください。EBISU_ERROR_USERNAME_NOT_AVAILABLE_STRユーザー名が使用できません。EBISU_ACHIEVEMENT_WAY_TO_GO_STRその調子です! Originネットワークであなたのハイスコアを共有し、他のプレイヤーにチャレンジしてみませんか?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STRその調子です、%USERNAME%! あなたのタイムをOriginネットワークで共有してみませんか?EBISU_ERROR_SEARCH_FAILED_STR一致する検索結果がありません。EBISU_FRIENDS_WED_STREBISU_NEWS_WED_STREBISU_NAV_WELCOME_STRようこそEBISU_LOGIN_WELCOME_BACK_STRお帰りなさい、!EBISU_ACHIEVEMENT_WELL_DONE_STR見事です! Originネットワークであなたのハイスコアを共有し、他のプレイヤーにチャレンジしてみませんか?EBISU_ACHIEVEMENT_WELL_DONE_USER_STR見事です、%USERNAME%! Originネットワークで他の%GAMENAME%プレイヤーにチャレンジしてみませんか?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STR何をされたいですか?EBISU_LOGIN_WHY_JOIN_STROriginに参加する利点とは?EBISU_ACHIEVEMENT_YES_STRはいEBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STRはい、メンバーにFacebook名での検索を許可します。EBISU_FRIENDS_YESTERDAY_STR昨日EBISU_NEWS_YESTERDAY_STR昨日EBISU_ERROR_MUST_AGREE_TOS_AND_PP_STR続けるには、利用規約およびプライバシーポリシーに同意してください。EBISU_ACHIEVEMENT_DOING_GREAT_STR素晴らしいスコアです! Originネットワークであなたのハイスコアを共有し、他のプレイヤーにチャレンジしてみませんか?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STRあなたはチャレンジされました! %USERNAME%が%GAMENAME%を一緒に遊びたいようです! チャレンジを承認しますか? 今すぐ%GAMENAME%をゲットしましょう。EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STRあなたはチャレンジされました! %USERNAME%が%GAMENAME%を一緒に遊びたいようです! EBISU_ERROR_CONN_TIMED_OUT_STR接続がタイムアウトしました。Originに再度サインインしてください。EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STREメールアドレスとパスワードが一致しません。再度お試しください。EBISU_LOGIN_NEW_PASSWORD_SENT_STRパスワードの再設定方法を、EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STROriginアカウントが無事に作成されました。現在はログインしています。友達に連絡してみましょう!EBISU_ERROR_SEARCH_NO_RESULTS_STR検索結果が見つかりませんでした。EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRyyyy-mm-ddEBISU_ERROR_EMAIL_TOO_LONG_STREメールアドレスが長すぎます。EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STRこのOriginアカウントは存在しません。EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STRデバイスのメモリーが少なくなっています。Origin をスムーズに実行するため、現在使用していないアプリケーションを削除することを推奨します。EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRお使いのデバイスから携帯メールを送信することはできません。EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRお使いのデバイスにEメールアカウントが設定されていません。EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STRパスワードを変更しますか? Originにサインインする際はいつでも必要になります。 [OK] [CANCEL]EBISU_FRIENDS_PLAYER_STRプレイヤーEBISU_STRING_TODAY_WITH_DATE_STR本日 %DATE%EBISU_STRING_ONE_DAY_AGO_STR1 日前EBISU_STRING_DAYS_AGO_STR%DAYS% 日前EBISU_STRING_ONE_WEEK_AGO_STR1週間前EBISU_STRING_WEEKS_AGO_STR%WEEKS% 週間前EBISU_STRING_ONE_MONTH_AGO_STR1カ月前EBISU_STRING_FACEBOOK_TOS_STRFacebookへログインする事によって、Facebook上の名前で検索される事を許可します。EBISU_STRING_GMAIL_AUTH_FAILED_STR入力したユーザー名またはパスワードに誤りがあります。EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STROrigin アカウントが無事に作成されました! フレンドを追加してチャレンジしましょう。[BUTTON] OKEBISU_STRING_PRIVACY_CAPS_COLON_STRプライバシー:EBISU_STRING_JOIN_EBISU_STROriginに参加しましょう!EBISU_STRING_WELCOME_BACK_USER_STRおかえりなさい、%USERNAME%。EBISU_FRIENDS_PENDING_STR保留中EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STR今しばらくお待ちください。EBISU_FRIENDS_LAUNCH_MANUALLY_STR%GAMENAME%を手動で起動する必要があります。削除済みの場合、もう一度ダウンロードすることができます。EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRお使いのデバイスから携帯メールを送信することはできません。EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STROrigin アカウントが無事に作成されました! フレンドを追加してチャレンジしましょう。[BUTTON] OKEBISU_FRIENDS_GO_STRGoEBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRお使いのデバイスにEメールアカウントが設定されていません。EBISU_ERROR_CONN_TIMED_OUT_2_STR接続がタイムアウトしました。再度お試しいただくか、OK を選択してネットワーク設定を変更してください。 [BUTTON] 再試行 [BUTTON] OKEBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STRパスワードを変更しますか? Originにサインインする際はいつでも必要になります。 [OK] [CANCEL]EBISU_FRIENDS_PLAYER_2_STRプレイヤーEBISU_STRING_MONTHS_AGO_STR%MONTHS%カ月前EBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STRこちらで提案したものを選ぶか、自分で選ぶ事もできます。EBISU_LOGIN_MOBILE_STR携帯EBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@私はEAの @a href=\"http://privacy\"@プライバシーポリシー@/a@ および利用規約に @a href=\"http://tos\"@同意します@/a@@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STR正確に情報を入力してください。EBISU_FRIENDS_NO_FRIENDS_TITLE_STR今すぐフレンドを追加しましょう!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STRハイスコアを公開、フレンドと対戦、新しいゲームを発見!EBISU_STRING_ADD_FRIENDS_GMAIL_STRフレンドをコンタクトリストから検索しましょう。EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STR登録する事によって、Eメールアドレスで検索される事、およびゲームの進行状況などが自動的にアップロードされる事を許可します。これらは横顔設定から変更できます。EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STRハイスコアEBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STRインゲーム実績EBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STRフレンドと共有するEBISU_PROFILE_SETTINGS_NEWSSETTINGS_STRニュース設定EBISU_LOGIN_AGE_STR年齢EBISU_PROFILE_ABOUT_STREULAEBISU_LOGO_LOGO_INSTRUCTIONS_STRゲームに戻るにはOriginのロゴをタッチしてください。 再度タッチすると画面が切り替わります。EBISU_NEWS_NO_INVITES_STR現在新しいフレンド依頼はありません。また後ほどご確認ください!EBISU_NEWS_NO_INVITES_DESCRIPTION_STR新しいフレンド依頼やチャレンジを毎日確認しましょう。EBISU_PROFILE_INFO_STR情報EBISU_LOGIN_TRY_AGAIN_STR再試行するEBISU_ERROR_ENTER_VALID_AGE_STR有効な年齢を入力してください。EBISU_LOGIN_AUTO_LOGGING_IN_STRオートログイン中...EBISU_STRING_JOIN_EBISU_TITLE_STROriginはすごいと思います。参加してフレンドになりましょう!EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STR宛てに送信しました。EBISU_ERROR_PASSWORD_INVALID_STRパスワードが無効です。EBISU_ERROR_TOS_TOO_LONG_STR利用規約が長すぎます。EBISU_STRING_START_NOW_STRフレンドを探すEBISU_LOGO_PLAYER_STRプレイヤーEBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STRFacebookの設定を編集するには、Originのメインアカウントを使用してください。EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STR横顔を公開して、フレンドが閲覧できるようにしましょう。EBISU_FRIEND_REMOVE_CONFIRMATION_STR本当によろしいですか?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STR%USERNAME%をフレンドリストから外します。再度登録する事も可能です。EBISU_FRIEND_IGNORING_CHALLENGE_STRチャレンジを無視します・・・EBISU_FRIEND_ACCEPTING_REQUEST_STRフレンドリクエストを承認・・・EBISU_FRIEND_DECLINING_REQUEST_STRフレンドリクエストを拒否・・・EBISU_FRIEND_SENDING_BLOCK_STRリクエスト送信済みEBISU_FRIEND_SENDING_REPORT_STRリクエスト送信済みEBISU_LOGIN_RECEIVE_EA_UPDATE_STREAゲームのニュースや情報を希望します。EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STR申し訳ございません。登録の必要条件を満たしていません。EBISU_PROFILE_ERROR_FACEBOOK_STRFacebookにログインしてください。EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STR保存する前に、設定を1つ選択してください。EBISU_ERROR_USERNAME_NOT_ALLOWED_STR使用できません。別のユーザー名か、こちらが提案するものを使用してください。EBISU_PROFILE_SETTINGS_SEACHABLEOK_STRはい。メンバーがEメールで私を探すことを許可します。EBISU_EMAIL_INVITE_SUBJECT_STROriginへの参加の招待EBISU_ERROR_LOG_INTO_FACEBOOK_STR Facebookにログインしてください。EBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STRプレイしたゲームEBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STRすでにEAアカウントをお持ちですか?パスワードを入力してください。EBISU_ERROR_REAL_NAME_TOO_LONG名前の入力が長すぎますEBISU_ERROR_REAL_NAME_INVALID_CHARACTERS名前は半角英数を入力してくださいEBISU_ERROR_TOO_MANY_ATTEMPTS何度か続けてOriginにアクセスしたようです。しばらくお待ちになってからお試しください。EBISU_SENDING_REQUEST_STRリクエストを送信するEBISU_FRIENDS_SENT_REQUEST_TITLE_STRリクエスト送信済みEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STRはいEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STRいいえEBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STR「連絡先」からフレンドを検索しますか?EBISU_FRIEND_PERMISSION_CONTACTS_STRフレンド検索の際は該当する既存Originユーザーから探す為、一時的にあなたの情報がサーバーに共有されます。我々がこの情報を保持する事はありません。 \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/Korean Text.plist b/app/src/main/assets/EASP/Origin/resources/Korean Text.plist new file mode 100644 index 0000000..8ea3015 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/Korean Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR* 실명EBISU_LOGIN_OPTIONAL_INFO_STR* 부가 정보 표시EBISU_ACHIEVEMENT_USER_DOING_GREAT_STR%USERNAME%, 님, 멋진 플레이입니다! 최고 점수를 Origin 네트워크에 올리시겠습니까?EBISU_FRIENDS_GAME_LIST_TITLE_STR%USERNAME% 님의 게임EBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% : %GAMENAME%에서 당신의 최고 기록을 경신했습니다.EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% : %GAMENAME%에서 당신의 최고 점수를 경신했습니다.EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% : 친구 요청을 했습니다.EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STR생년월일을 입력해야 합니다.EBISU_ERROR_WIFI_REQUIRED_STR%GAMENAME%에서 Origin에 로그인하려면 Wi-Fi 연결이 필요합니다.EBISU_ERROR_WIFI_3G_REQUIRED_STR%GAMENAME%에서 Origin에 로그인하려면 Wi-Fi나 3G 연결이 필요합니다.EBISU_NEWS_ACCEPT_STR수락EBISU_NEWS_ACCEPTED_FRIEND_STR친구 요청 수락EBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STR지금은 개인정보 보호정책을 확인할 수 없습니다.EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STR지금은 서비스 이용약관을 확인할 수 없습니다.EBISU_ERROR_TOS_FAILURE_STR지금은 서비스 이용약관을 확인할 수 없습니다.EBISU_ERROR_TOS_NOT_FOUND_STR지금은 서비스 이용약관을 확인할 수 없습니다.EBISU_NEWS_ACHIEVEMENT_UNLOCK_STR잠금 해제된 도전 과제:EBISU_FRIENDS_ADD_STR추가EBISU_FRIENDS_ADD_FRIENDS_TAB_STR친구 추가EBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STR친구들을 여러분의 네트워크에 추가하세요!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STROrigin 네트워크에 친구 추가EBISU_PROFILE_ADD_GAMES_STR게임 추가EBISU_FRIENDS_ADD_YOUR_CONTACTS_STR내 연락처에 추가EBISU_FRIENDS_AGE_STR나이EBISU_PROFILE_AGE_STR나이EBISU_PROFILE_SETTINGS_AGE_STR나이EBISU_ERROR_ALERT_STR주의EBISU_FRIENDS_ALREADY_ADDED_STR이미 추가되었습니다EBISU_LOGIN_INVITATION_SENT_STR초대를 %EMAIL%로 보냈습니다.EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STR로그인하는 데 문제가 있으신가요?EBISU_FRIENDS_BACK_STR뒤로EBISU_PROFILE_SETTINGS_BACK_STR뒤로EBISU_FRIENDS_BLOCK_STR차단EBISU_FRIENDS_BLOCK_USER_STR%USERNAME% 님을 차단합니까?EBISU_FRIENDS_BUY_STR구매EBISU_PROFILE_BUY_NOW_STR구매EBISU_GMAIL_CANCEL_STR취소EBISU_FRIENDS_CHALLENGE_STR도전EBISU_PROFILE_CHALLENGE_STR도전EBISU_NEWS_CHALLENGE_STR도전:EBISU_LOGIN_CHANGE_USERNAME_STR사용자 이름 변경EBISU_LOGIN_CHECKING_EMAIL_STR이메일 주소 확인EBISU_FRIENDS_COMMENT_STR코멘트EBISU_LOGIN_COMPLETE_SETUP_STR설정 완료EBISU_LOGIN_CONFIRM_STR확인EBISU_PROFILE_SETTINGS_CONFIRM_STR확인EBISU_LOGIN_CONGRATULATIONS_STR축하합니다!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STR축하합니다! %USERNAME%님, 시간 기록을 달성하셨습니다! Origin에서 순위를 확인하시겠습니까?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STR축하합니다! %USERNAME%님, 시간 기록을 달성하셨습니다! Origin 순위를 확인하시겠습니까?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STR축하합니다! %USERNAME%님, 최고 점수를 달성하셨습니다! Origin에서 순위를 확인하시겠습니까?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STR축하합니다! %USERNAME%님, 최고 점수를 달성하셨습니다! Origin 순위를 확인하시겠습니까?EBISU_FRIENDS_CONNECT_FB_STRFacebook과 연동EBISU_FRIENDS_CONNECT_GOOGLE_STRGoogle과 연동EBISU_FRIENDS_CONTACTS_STR연락처EBISU_LOGIN_CONTINUE_STR계속EBISU_LOGIN_CREATE_ACCOUNT_STR계정 생성EBISU_LOGIN_DATE_OF_BIRTH_STR생년월일EBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STR생년월일EBISU_FRIENDS_DELETE_STR삭제EBISU_FRIENDS_DELETING_FRIEND_STR친구를 삭제하고 있습니다...EBISU_NEWS_DISMISS_STR무시EBISU_PROFILE_DISPLAY_STR표시EBISU_PROFILE_SETTINGS_DISPLAY_NAME_STR표시 이름:EBISU_GMAIL_DONE_STR완료EBISU_PROFILE_EDIT_STR변경EBISU_NEWS_EDIT_STR변경EBISU_FRIENDS_EMAIL_STR이메일:EBISU_INVITE_EMAIL_STR이메일EBISU_PROFILE_EMAIL_STR이메일:EBISU_LOGIN_EMAIL_STR이메일EBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STR이미 존재하는 이메일과 암호입니다.EBISU_ERROR_EMAIL_REQUIRED_STR이메일 주소를 입력해야 진행할 수 있습니다.EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STR이메일/이름EBISU_PROFILE_SETTINGS_EMAIL_STR이메일EBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STR이메일 입력EBISU_LOGIN_ENTER_PHONE_NUMBER_STR문자 알림 등을 받을 전화번호를 입력하세요!EBISU_LOGIN_ACCOUNT_STR로그인하거나 계정을 생성하는 데 필요한 이메일 주소를 입력하십시오.EBISU_ERROR_ERROR_TITLE_STR오류EBISU_GMAIL_GMAILPLACEHOLDER_STRexample@gmail.comEBISU_RETURN_EXIT_STR나가기EBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRFacebook 친구들EBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRFacebook 설정EBISU_ERROR_FAILED_TO_DELETE_FRIEND_STR친구를 삭제하지 못했습니다.EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STR뉴스 아이템을 제거하지 못했습니다.EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STR수락 메시지를 전송하지 못했습니다.EBISU_ERROR_FAILED_TO_SEND_DECLINE_STR거절 메시지를 전송하지 못했습니다.EBISU_PROFILE_SETTINGS_FEMALE_STR여성EBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STR연락처를 이용해 친구를 검색하고 자신을 검색에 노출합니다.EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STRFacebook을 이용해 친구를 검색하고 자신을 검색에 노출합니다.EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STRGmail을 이용해 친구를 검색하고 자신을 검색에 노출합니다.EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STROrigin에서 친구 찾기EBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STR친구들이 플레이하고 있는 게임을 확인해보세요!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STROrigin에서 친구 찾기EBISU_LOGIN_FORGOT_PASSWORD_STR암호 분실EBISU_FRIENDS_FRI_STR금요일EBISU_NEWS_FRI_STR금요일EBISU_NEWS_FRIEND_REQUEST_BODY_STR친구 요청을 했습니다.EBISU_NEWS_FRIEND_REQUEST_STR친구 요청EBISU_CAT_FRIENDS_STR친구들EBISU_NAV_FRIENDS_STR친구들EBISU_PROFILE_FRIENDS_ONLY_STR친구만EBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STR친구만EBISU_FRIENDS_FRIENDS_WHO_HAVE_STR%GAMENAME% 게임을 소유한 친구EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STR%GAMENAME% 게임이 없는 친구EBISU_FRIENDS_GENDER_STR성별:EBISU_PROFILE_SETTINGS_GENDER_STR성별EBISU_PROFILE_GENDER_STR성별:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STREA가 제공하는 게임 뉴스와 독점 혜택을 받으세요!EBISU_NEWS_GET_IT_STR받기EBISU_ERROR_GETTING_USER_INFO_STR개인 정보 수집EBISU_NEWS_GO_TO_STR이동EBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRGoogle 친구들EBISU_NEWS_HIGH_SCORE_STR최고 점수EBISU_FRIENDS_HOME_STREBISU_PROFILE_HOME_STREBISU_PROFILE_SETTINGS_HOME_STREBISU_LOGIN_AGREE_PP_TOS_STR개인정보 보호정책과 서비스 이용약관에 동의합니다.EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIA다음 수단을 통한 검색 노출 희망 :EBISU_NEWS_IGNORE_STR무시EBISU_FRIENDS_CONTACTS_IN_STROrigin 접속 중EBISU_ERROR_INCORRECT_LOGIN_INFO_STR잘못된 로그인 정보EBISU_FRIENDS_INVITE_STR초대EBISU_FRIENDS_CHOOSE_SMS_EMAIL_STR친구를 Origin에 초대하기EBISU_FRIENDS_SENTINVITE_STR초대했습니다EBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STR친구를 Origin에 초대하기EBISU_NEWS_INVITES_STR초대EBISU_LOGIN_DUMMY_REAL_NAME_STR홍길동EBISU_FRIENDS_LAST_LOGIN_STR마지막 로그인:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STR마지막 로그인:EBISU_NEWS_LAST_UPDATE_STR마지막 업데이트: %TIME%EBISU_NEWS_LASTUPDATE_NEVER_STR마지막 업데이트: 없음EBISU_NEWS_LAUNCH_STR실행EBISU_PROFILE_LEGEND_STR범례EBISU_PROFILE_SETTINGS_LOADING_STR로딩 중EBISU_LOGIN_LOGIN_STR로그인EBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRFacebook 로그인EBISU_PROFILE_LOGOUT_STR로그아웃EBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STRFacebook 로그아웃EBISU_LOGIN_LOGGING_IN_STR로그인 중...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STR게임 도전 기능을 이용해 새로운 친구를 만드세요!EBISU_PROFILE_SETTINGS_MALE_STR남성EBISU_FRIENDS_MOBILE_STR모바일EBISU_PROFILE_MOBILE_STR모바일EBISU_PROFILE_SETTINGS_MOBILE_STR모바일EBISU_FRIENDS_MON_STR월요일EBISU_NEWS_MON_STR월요일EBISU_FRIENDS_MY_FRIENDS_TAB_STR내 친구EBISU_PROFILE_MY_GAMES_STR내 게임EBISU_PROFILE_SETTINGS_MY_IMAGE_STR내 이미지EBISU_NAV_PROFILE_STR내 프로필EBISU_PROFILE_MY_WISH_LIST_STR내 소망 목록EBISU_CAT_NEWS_STR뉴스EBISU_NAV_NEWS_STR뉴스EBISU_ACHIEVEMENT_NICE_JOB_STR잘하셨습니다! Origin 네트워크에 점수를 올리고 다른 플레이어에게 도전하시겠습니까?EBISU_ACHIEVEMENT_NICE_JOB_USER_STR잘하셨습니다, %USERNAME% 님! Origin 네트워크에 도전 과제 기록을 올리시겠습니까?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STR아니오, Facebook 이름을 통한 노출을 원하지 않습니다.EBISU_ACHIEVEMENT_NO_STR거절하겠습니다EBISU_FRIENDS_CONTACTS_NOT_IN_STROrigin에 접속해 있지 않습니다EBISU_LOGIN_OK_STR확인EBISU_ERROR_SOMETHING_WENT_WRONG_STR이런! 뭔가가 잘못되었습니다...EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_INVALID_DOCUMENT_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_INVALID_LANGUAGE_CODE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_LICENSE_NOT_FOUND_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_REFERENCE_NOT_FOUND_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_REGISTRATION_FAILED_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_SERVER_USER_API_FAILURE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_SERVICE_FAILURE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_USER_CREATION_FAILED_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_USER_LISTING_FAILED_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STR이런! 뭔가가 잘못되었습니다...예상하지 못한 오류가 발생했습니다.EBISU_PROFILE_OPT_IN_STR수락EBISU_PROFILE_OPT_OUT_STR불허EBISU_LOGIN_PASSWORD_STR암호EBISU_PROFILE_SETTINGS_PASSWORD_STR암호 변경EBISU_GMAIL_PASSWORD_STR암호EBISU_ERROR_PASSWORD_REQUIRED_STR암호를 입력해야 진행할 수 있습니다.EBISU_ERROR_PASSWORD_RESTRICTIONS_STR암호는 4~16자 사이의 영문자와 숫자를 사용해야 합니다.EBISU_FRIENDS_PENDINGINVITES_STR대기 중인 초대EBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STR차단한 사람들은 당신에게 도전하거나 당신의 프로필을 보지 못합니다.EBISU_PROFILE_PLAY_STR플레이EBISU_FRIENDS_PLAYNOW_STR지금 플레이하시겠습니까?EBISU_FRIENDS_PLAYING_COLON_STR플레이 중:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STR사용자 이름을 생성해 Origin 계정 설정을 완료해주십시오. 원하신다면 저희가 추천해 드리는 이름을 쓰셔도 좋습니다!EBISU_ERROR_ENTER_USERNAME_STR사용자 이름을 입력하고 계속해 주십시오.EBISU_ERROR_ENTER_VALID_EMAIL_STR올바른 이메일 주소를 입력하고 계속해 주십시오.EBISU_GMAIL_ENTERGMAILDATA_STRGmail 사용자 이름과 암호를 입력해주십시오.EBISU_ERROR_USER_NOT_LOGGED_IN_STR로그인해 주십시오.EBISU_ERROR_REENTER_INFO_STR정보를 다시 입력해 주십시오.EBISU_ERROR_REENTER_INFO_CONTINUE_STR정보를 다시 입력해 주십시오.EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STR서비스 이용약관을 검토하고 수락해주십시오.EBISU_ERROR_SIGN_IN_STR로그인해 주십시오.EBISU_ERROR_SIGN_IN_TO_CONTINUE_STR다음으로 진행하려면 로그인해 주십시오EBISU_PROFILE_PRIVACY_POLICY_STRPPEBISU_PROFILE_PRIVATE_STR비공개EBISU_PROFILE_SETTINGS_PRIVATE_STR비공개EBISU_CAT_PROFILE_STR프로필EBISU_FRIENDS_PROFILE_STR프로필EBISU_NEWS_PROFILE_STR프로필EBISU_PROFILE_SETTINGS_TAB_STR프로필 설정EBISU_PROFILE_PROFILE_PRIVACY_STR프로필/개인정보 설정EBISU_PROFILE_PUBLIC_STR공개EBISU_PROFILE_SETTINGS_PUBLIC_STR공개EBISU_NEWS_PULLDOWN_TO_UPDATE_STR풀다운 메뉴를 이용해 업데이트하십시오...EBISU_PROFILE_REAL_NAME_STR실명:EBISU_FRIENDS_REAL_NAME_STR실명:EBISU_PROFILE_SETTINGS_REAL_NAME_STR실명EBISU_LOGIN_RECOVER_MY_PASSWORD_STR암호 찾기EBISU_LOGIN_REGISTER_NEW_USER_STR새로운 사용자를 등록합니다.EBISU_LOGIN_REGISTERING_NEW_USER_STR새로운 사용자를 등록하고 있습니다...EBISU_NEWS_REJECT_STR거부EBISU_NEWS_RELEASE_TO_UPDATE_STR업데이트 릴리즈EBISU_FRIENDS_BLOCKING_A_USER_STR조심하세요. 차단하면 해당 사용자와는 Origin에서 어떠한 연락도 할 수 없습니다.EBISU_NEWS_REMOVE_STR삭제EBISU_FRIENDS_REMOVE_FRIEND_STR친구 삭제EBISU_FRIENDS_REPORT_STR신고EBISU_FRIENDS_REPORT_USER_STR%USERNAME% 신고하기EBISU_FRIENDS_REPORT_BLOCK_STR신고/차단EBISU_NEWS_REPORT_BLOCK_STR신고/차단EBISU_ERROR_RESULTS_LOADING_STR결과 불러오는 중...EBISU_ERROR_RETRIEVING_STR찾는 중EBISU_RETURN_RETURN_TO_GAME_STR게임으로 돌아가시겠습니까EBISU_FRIENDS_SAT_STR토요일EBISU_NEWS_SAT_STR토요일EBISU_PROFILE_SETTINGS_SAVE_STR저장EBISU_PROFILE_SETTINGS_SAVING_STR저장 중EBISU_FRIENDS_SEARCH_STR검색EBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STR검색 조건은 3자 이상 입력해야 합니다.EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STR검색 조건은 3자 이상 입력해야 합니다.EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STR검색 조건은 3자 이상 입력해야 합니다.EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STR해당 네트워크 상 검색EBISU_SEARCH_OPTIONS_STR검색 옵션EBISU_FRIENDS_SEARCH_ORIGIN_STROrigin 검색EBISU_FRIENDS_SEARCH_RESULTS_STR검색 결과EBISU_FRIENDS_SEARCHRESULTS_STR검색 결과EBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STR연락처 검색 결과EBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRFacebook 검색 결과EBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRGoogle 검색 결과EBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STROrigin 검색 결과EBISU_FRIENDS_SEARCHING_STR검색 중EBISU_FRIENDS_SENDING_FRIEND_REQUEST_STR친구 요청을 전송하고 있습니다...EBISU_LOGIN_SETUP_ACCOUNT_STR계정 설정EBISU_PROFILE_SETTINGS_EDIT_STR설정EBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STR아니오. 이메일 검색에 노출되고 싶지 않습니다.EBISU_PROFILE_SETTINGS_NEWPASSWORD_STR새 암호EBISU_LOGIN_SETTING_UP_ACCOUNT_STR계정 설정 중...EBISU_NEWS_SHARE_STR공유EBISU_PROFILE_SHOW_LESS_STR표시 항목 줄이기EBISU_PROFILE_SHOW_MORE_STR표시 항목 늘리기EBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STROrigin 로그인EBISU_LOGIN_SIGN_IN_ORIGIN_STROrigin 로그인EBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STR로그인 필요EBISU_LOGIN_SIGN_UP_BUTTON_STR가입하세요!EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STR죄송합니다. Origin 네트워크에서 이미 사용 중인 %USERNAME%입니다. 예로 제안하는 이름이나 새로운 사용자 이름을 입력해 주십시오.EBISU_ERROR_UNEXPECTED_ERROR_STR죄송합니다. 예상하지 못한 오류가 발생했습니다. 다시 시도해 주십시오.EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STR죄송합니다. 지역 제한에 따라 지금은 Origin에 가입할 수 없습니다.EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STR죄송합니다.에 해당하는 계정이 없습니다.EBISU_ERROR_NO_RESULTS_FOUND_STR죄송합니다. 검색 결과가 없습니다. 다시 시도해주십시오.EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STR죄송합니다. 지금은 Origin에 접속할 수 없습니다.EBISU_ERROR_LOGIN_FAILED_STR죄송합니다. Origin 로그인에 실패했습니다.EBISU_ERROR_SERVER_DOWN_STR죄송합니다. 서버 점검 중입니다. 나중에 다시 시도해 주십시오.EBISU_ERROR_ID_ALREADY_TAKEN_STR죄송합니다. 이미 사용 중인 사용자 이름입니다. 다른 이름을 입력해주십시오.EBISU_ERROR_DATE_OF_BIRTH_INVALID_STR죄송합니다. 입력하신 생년월일이 유효하지 않습니다.EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STR죄송합니다. 이메일과 암호는 서로 달라야 합니다. 다시 시도해주십시오.EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STR죄송합니다. 입력하신 암호가 일치하지 않습니다.EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STR죄송합니다. 암호 서비스 전달에 문제가 발생했습니다. 나중에 다시 시도해 주십시오.EBISU_ERROR_EMAIL_ADRESS_INVALID_STR죄송합니다. 이 이메일 주소는 사용할 수 없습니다.EBISU_ERROR_EMAIL_FORMAT_INVALID_STR죄송합니다. 이메일 형식이 유효하지 않습니다. 다시 시도해주십시오.EBISU_ERROR_USER_NOT_FOUND_STR죄송합니다. 사용자 이름을 찾을 수 없습니다.EBISU_ERROR_DIDNT_RECEIVE_INFO_STR죄송합니다. 정보를 받을 수 없습니다. 다시 시도해 주십시오.EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STR죄송합니다. 현재는 조건이 맞지 않아 Origin에 가입할 수 없습니다.EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STR죄송합니다. 암호에 빈칸이 있으면 안 됩니다. 다시 시도해주십시오.EBISU_FRIENDS_SUN_STR일요일EBISU_NEWS_SUN_STR일요일EBISU_PROFILE_TOS_STR서비스 이용약관EBISU_ERROR_Origin_NET_NOT_REACHED_STROrigin에 정상적으로 연결하지 못했습니다. 네트워크 연결을 확인하고 다시 시도해 주십시오.EBISU_ERROR_EMAIL_ALREADY_EXISTS_STROrigin에 이미 존재하는 이메일입니다.EBISU_ERROR_INVALID_EMAIL_FORMAT_STR이메일 형식이 유효하지 않습니다.EBISU_ERROR_EMAIL_NOT_REGISTERED_STROrigin에 등록되어 있지 않은 이메일입니다.EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STR몇 분 정도 걸릴 수 있습니다...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STR이미 Origin에 존재하는 사용자 이름입니다.EBISU_FRIENDS_THUR_STR목요일EBISU_NEWS_THUR_STR목요일EBISU_ERROR_DOMAIN_INVALID_STR계속하려면 유효한 이메일 주소를 입력해주십시오.EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STR암호를 재설정하려면, 계정과 연결된 이메일 주소를 입력해주십시오.EBISU_FRIENDS_TODAY_STR오늘EBISU_NEWS_TODAY_STR오늘EBISU_LOGIN_TRY_STR시도EBISU_FRIENDS_TUE_STR화요일EBISU_NEWS_TUE_STR화요일EBISU_LOGIN_SOMETHING_WENT_WRONG_STR이런! 무언가가 잘못되었습니다...EBISU_NEWS_UPDATES_STR업데이트EBISU_ERROR_UPDATING_CHANGES_STR업데이트 중...EBISU_LOGIN_USER_REGISTERED_STR사용자가 등록되었습니다!EBISU_PROFILE_USERNAME_STR사용자 이름EBISU_LOGIN_USERNAME_STR사용자 이름EBISU_PROFILE_SETTINGS_USERNAME_STR사용자 이름EBISU_GMAIL_USERNAME_STR사용자 이름EBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STR사용자 이름과 암호를 입력해야 진행할 수 있습니다.EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STR사용자 이름과 암호는 4~12자 사이의 영문자와 숫자만 지원합니다.EBISU_ERROR_USERNAME_REQUIRED_STR사용자 이름을 입력해야 진행할 수 있습니다.EBISU_ERROR_USERNAME_RESTRICTIONS_STR사용자 이름은 4~12자 사이의 영문자와 숫자를 사용해야 합니다.EBISU_ERROR_USERNAME_NOT_AVAILABLE_STR사용할 수 없는 사용자 이름입니다.EBISU_ACHIEVEMENT_WAY_TO_GO_STR잘하셨습니다! 점수를 Origin 네트워크에 올리고 다른 플레이어에게 도전하시겠습니까?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STR잘하셨습니다, %USERNAME% 님! 기록을 Origin 네트워크에 올리시겠습니까?EBISU_ERROR_SEARCH_FAILED_STR해당하는 검색 결과가 없습니다EBISU_FRIENDS_WED_STR수요일EBISU_NEWS_WED_STR수요일EBISU_NAV_WELCOME_STR환영합니다EBISU_LOGIN_WELCOME_BACK_STR돌아오신 걸 환영합니다!EBISU_ACHIEVEMENT_WELL_DONE_STR잘하셨습니다! 점수를 Origin 네트워크에 올리고 다른 플레이어에게 도전하시겠습니까?EBISU_ACHIEVEMENT_WELL_DONE_USER_STR잘하셨습니다, %USERNAME% 님! Origin 네트워크의 다른 %GAMENAME% 플레이어에게 도전하시겠습니까?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STR무엇을 하고 싶으신가요?EBISU_LOGIN_WHY_JOIN_STR왜 Origin에 가입해야 합니까?EBISU_ACHIEVEMENT_YES_STREBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STR예, 회원들이 Facebook 이름을 이용해 절 검색하게 하겠습니다.EBISU_FRIENDS_YESTERDAY_STR어제EBISU_NEWS_YESTERDAY_STR어제EBISU_ERROR_MUST_AGREE_TOS_AND_PP_STR서비스 이용약관과 개인정보 보호정책에 동의해야 합니다.EBISU_ACHIEVEMENT_DOING_GREAT_STR멋진 플레이입니다! 최고 점수를 Origin 네트워크에 올리고 다른 플레이어에게 도전하시겠습니까?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STR도전을 받았습니다! %USERNAME% 님이 %GAMENAME% 게임을 함께 플레이하고 싶어합니다! 도전을 받아들이시겠습니까? 지금 바로 %GAMENAME% 게임을 구매하세요.EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STR도전을 받았습니다! %USERNAME% 님이 %GAMENAME% 게임을 함께 플레이하고 싶어합니다! EBISU_ERROR_CONN_TIMED_OUT_STR연결 가능 시간을 초과했습니다. Origin에 다시 로그인해 주십시오.EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STR이메일이나 암호가 틀렸습니다. 다시 시도해 주십시오.EBISU_LOGIN_NEW_PASSWORD_SENT_STR암호를 다시 설정하는 방법에 대한 안내를 아래의 주소로 보냈습니다 : EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STROrigin 계정이 무사히 생성되었고, 현재 로그인된 상태입니다. 게임을 시작하고 친구들을 만나세요!EBISU_ERROR_SEARCH_NO_RESULTS_STR검색 결과가 없습니다.EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRyyyy-mm-ddEBISU_ERROR_EMAIL_TOO_LONG_STR이메일 주소가 너무 깁니다.EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STR이 Origin 계정은 더 이상 존재하지 않습니다.EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STR메모리가 부족합니다. Origin을 원활하게 실행하려면 사용하지 않는 응용프로그램을 종료해 주십시오.EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STR죄송합니다. 현재 텍스트 메시지를 보낼 수 없습니다.EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STR죄송합니다. 이메일 계정이 시스템에 설정되어 있지 않습니다.EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STR암호를 변경하겠습니까? 앞으로 Origin에 로그인할 때 이 암호를 사용하게 됩니다. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_STR플레이어EBISU_STRING_TODAY_WITH_DATE_STR오늘 %DATE%EBISU_STRING_ONE_DAY_AGO_STR1일 전EBISU_STRING_DAYS_AGO_STR%DAYS%일 전EBISU_STRING_ONE_WEEK_AGO_STR1주 전EBISU_STRING_WEEKS_AGO_STR%WEEKS%주 전EBISU_STRING_ONE_MONTH_AGO_STR1달 전EBISU_STRING_FACEBOOK_TOS_STRFacebook에 로그인하는 것으로, Facebook 이름으로 검색에 노출되는 것에 대하여 동의합니다.EBISU_STRING_GMAIL_AUTH_FAILED_STR사용자 이름 또는 암호가 정확하지 않습니다.EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STROrigin 계정을 생성했습니다! 친구를 찾아 등록해 주십시오. [BUTTON] 확인EBISU_STRING_PRIVACY_CAPS_COLON_STR프라이버시:EBISU_STRING_JOIN_EBISU_STROrigin에 가입하세요!EBISU_STRING_WELCOME_BACK_USER_STR안녕하세요, %USERNAME%님!EBISU_FRIENDS_PENDING_STR대기 중EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STR약간의 시간이 걸립니다.EBISU_FRIENDS_LAUNCH_MANUALLY_STR죄송합니다. %GAMENAME% 게임을 수동으로 실행해야 합니다. 만약 지우셨다면 다시 다운로드 할 수 있습니다.EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STR죄송합니다. 현재 텍스트 메시지를 보낼 수 없습니다.EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STROrigin 계정을 생성했습니다! 친구를 찾아 등록해 주십시오. [BUTTON] 확인EBISU_FRIENDS_GO_STR이동EBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STR죄송합니다. 이메일 계정이 시스템에 설정되어 있지 않습니다.EBISU_ERROR_CONN_TIMED_OUT_2_STR접속이 중단되었습니다. 다시 시도하거나 확인을 눌러 네트워크 설정을 변경해 주십시오. [BUTTON] 재시도 [BUTTON] 확인EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STR암호를 변경하겠습니까? 앞으로 Origin에 로그인할 때 이 암호를 사용하게 됩니다. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_2_STR플레이어EBISU_STRING_MONTHS_AGO_STR %MONTHS%달 전EBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STR제안한 이름을 사용하거나 자신만의 이름을 선택해 주세요.EBISU_LOGIN_MOBILE_STR핸드폰EBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@EA @a href=\"http://privacy\"@개인정보 보호정책@/a@ 및 @a href=\"http://tos\"@서비스 이용약관@/a@에 동의합니다.@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STR올바른 정보를 정확히 입력해 주십시오.EBISU_FRIENDS_NO_FRIENDS_TITLE_STR친구를 추가하세요!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STR공유 점수, 도전의 친구와 게임을 발견!EBISU_STRING_ADD_FRIENDS_GMAIL_STR친구를 찾기위해 연락처를 검색합니다EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STR가입하는 것으로 인해 나는 이메일 주소를 통하여 내가 검색에 노출되고 게임 플레이 내용이 자동으로 포스트 된다는 것에 동의합니다. 이 설정은 프로필 설정에서 변경할 수 있습니다.EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STR최고 점수EBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STR게임 내 업적EBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STR친구와 공유하기EBISU_PROFILE_SETTINGS_NEWSSETTINGS_STR뉴스 설정EBISU_LOGIN_AGE_STR나이EBISU_PROFILE_ABOUT_STR최종사용자 라이선스 계약EBISU_LOGO_LOGO_INSTRUCTIONS_STR게임으로 돌아가려면 Origin 로고를 탭해주세요. 다시 전환하려면 다시 탭하면 됩니다.EBISU_NEWS_NO_INVITES_STR새로운 초대가 없습니다. 계속 확인해 주세요!EBISU_NEWS_NO_INVITES_DESCRIPTION_STR매일 들러서 친구의 초대와 도전을 확인하세요.EBISU_PROFILE_INFO_STR정보EBISU_LOGIN_TRY_AGAIN_STR다시 시도해 주십시오EBISU_ERROR_ENTER_VALID_AGE_STR올바른 나이를 입력해 주십시오.EBISU_LOGIN_AUTO_LOGGING_IN_STR자동 로그인 중...EBISU_STRING_JOIN_EBISU_TITLE_STROrigin은 정말 멋집니다. 가입해서 친구가 되어주세요!EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STR EBISU_ERROR_PASSWORD_INVALID_STR암호가 틀렸습니다.EBISU_ERROR_TOS_TOO_LONG_STR서비스 이용약관이 너무 깁니다.EBISU_STRING_START_NOW_STR친구찾기EBISU_LOGO_PLAYER_STR플레이어EBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STR당신의 기본 Origin 계정을 사용하여 Facebook 설정을 수정하세요.EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STR공개 프로필을 만드세요. 만든 프로필은 친구들이 볼 수 있습니다.EBISU_FRIEND_REMOVE_CONFIRMATION_STR확실합니까?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STR%USERNAME% 님이 친구 리스트에서 삭제되었습니다. 나중에 언제라도 다시 추가할 수 있습니다.EBISU_FRIEND_IGNORING_CHALLENGE_STR도전 무시 중...EBISU_FRIEND_ACCEPTING_REQUEST_STR친구 요청 수락 중...EBISU_FRIEND_DECLINING_REQUEST_STR친구 요청 거절 중...EBISU_FRIEND_SENDING_BLOCK_STR요청을 보냈습니다EBISU_FRIEND_SENDING_REPORT_STR요청을 보냈습니다EBISU_LOGIN_RECEIVE_EA_UPDATE_STREA 게임 뉴스 및 정보를 받고 싶습니다.EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STR죄송합니다마는 특정 요건들을 만족시키지 못해 가입이 불가능합니다.EBISU_PROFILE_ERROR_FACEBOOK_STRFacebook에 로그 인해주세요.EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STR저장하기 전에 가능한 설정 중에서 하나를 선택해 주십시오.EBISU_ERROR_USERNAME_NOT_ALLOWED_STR죄송합니다, 다른 이름이나 추천된 이름을 선택 해주세요.EBISU_PROFILE_SETTINGS_SEACHABLEOK_STR네, 이메일로 검색되는 것을 수락합니다.EBISU_EMAIL_INVITE_SUBJECT_STROrigin 가입 초대EBISU_ERROR_LOG_INTO_FACEBOOK_STRFacebook하려면 로그 인해주세요EBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STR플레이 한 게임EBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STREA 계정을 이미 가지고 있다면 그 정보로 로그인해 주십시오.EBISU_ERROR_REAL_NAME_TOO_LONG실명 텍스트가 너무 깁니다EBISU_ERROR_REAL_NAME_INVALID_CHARACTERS실명은 알파벳, 숫자만 사용 가능합니다EBISU_ERROR_TOO_MANY_ATTEMPTS너무 잦은 Origin 접속 시도가 감지되었습니다. 잠시 기다린 뒤 다시 시도해 주십시오. EBISU_SENDING_REQUEST_STR요청을 보내기EBISU_FRIENDS_SENT_REQUEST_TITLE_STR요청을 보냈습니다EBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STREBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STR아니요EBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STR연락처에서 친구를 검색할까요?EBISU_FRIEND_PERMISSION_CONTACTS_STR친구를 찾기 위해 연락처를 서버와 연동하여 Origin 사용자를 찾습니다. 이 정보는 저장되지 않습니다. \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/Portugese Text.plist b/app/src/main/assets/EASP/Origin/resources/Portugese Text.plist new file mode 100644 index 0000000..fffb41f --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/Portugese Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR* Nome VerdadeiroEBISU_LOGIN_OPTIONAL_INFO_STR* Indica informações opcionaisEBISU_ACHIEVEMENT_USER_DOING_GREAT_STR%USERNAME%, você está indo muito bem! Quer compartilhar o recorde no Origin?EBISU_FRIENDS_GAME_LIST_TITLE_STRJogos de %USERNAME%EBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% bateu o seu melhor tempo em %GAMENAME%.EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% bateu o seu recorde em %GAMENAME%.EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% lhe enviou um pedido de amizade.EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STRUma data de nascimento é obrigatória.EBISU_ERROR_WIFI_REQUIRED_STRUma conexão Wi-Fi é necessária para fazer o login no Origin a partir de %GAMENAME%.EBISU_ERROR_WIFI_3G_REQUIRED_STRUma conexão Wi-Fi ou 3G é necessária para fazer o login no Origin a partir de %GAMENAME%.EBISU_NEWS_ACCEPT_STRAceitarEBISU_NEWS_ACCEPTED_FRIEND_STRPedido de amizade aceitoEBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STRO acesso à Política de Privacidade não está disponível no momento.EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STRO acesso aos Termos de Serviço não está disponível no momento.EBISU_ERROR_TOS_FAILURE_STRO acesso aos Termos de Serviço não está disponível no momento.EBISU_ERROR_TOS_NOT_FOUND_STRO acesso aos Termos de Serviço não está disponível no momento.EBISU_NEWS_ACHIEVEMENT_UNLOCK_STRConquista desbloqueada:EBISU_FRIENDS_ADD_STRAdicionarEBISU_FRIENDS_ADD_FRIENDS_TAB_STRAdicione AmigosEBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STRAdicione amigos à sua rede!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STRAdicionar seus amigos no Origin.EBISU_PROFILE_ADD_GAMES_STRAdicionar jogosEBISU_FRIENDS_ADD_YOUR_CONTACTS_STRAdicionar seus contatosEBISU_FRIENDS_AGE_STRIdadeEBISU_PROFILE_AGE_STRIdadeEBISU_PROFILE_SETTINGS_AGE_STRIdadeEBISU_ERROR_ALERT_STRAlertaEBISU_FRIENDS_ALREADY_ADDED_STRJá adicionadoEBISU_LOGIN_INVITATION_SENT_STRUm convite foi enviado para %EMAIL%EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STREstá tendo problemas para fazer o login?EBISU_FRIENDS_BACK_STRVoltarEBISU_PROFILE_SETTINGS_BACK_STRVoltarEBISU_FRIENDS_BLOCK_STRBloquearEBISU_FRIENDS_BLOCK_USER_STRBloquear %USERNAME%?EBISU_FRIENDS_BUY_STRPegarEBISU_PROFILE_BUY_NOW_STRPegarEBISU_GMAIL_CANCEL_STRCancelarEBISU_FRIENDS_CHALLENGE_STRDesafioEBISU_PROFILE_CHALLENGE_STRDesafioEBISU_NEWS_CHALLENGE_STRDesafioEBISU_LOGIN_CHANGE_USERNAME_STRAlterar Nome de UsuárioEBISU_LOGIN_CHECKING_EMAIL_STRVerificando endereço de e-mailEBISU_FRIENDS_COMMENT_STRComentárioEBISU_LOGIN_COMPLETE_SETUP_STRCompletar configuraçãoEBISU_LOGIN_CONFIRM_STRConfirmarEBISU_PROFILE_SETTINGS_CONFIRM_STRConfirmarEBISU_LOGIN_CONGRATULATIONS_STRParabéns!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STRParabéns! %USERNAME%, você acabou de conquistar um tempo rápido! Deseja ver como se classifica no Origin?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STRParabéns! %USERNAME%, você acabou de conquistar um tempo rápido! Deseja ver sua classificação no Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STRParabéns! %USERNAME%, você acabou de conquistar um recorde! Deseja ver como se classifica no Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STRParabéns! %USERNAME%, você acabou de conquistar um recorde! Deseja ver sua classificação no Origin?EBISU_FRIENDS_CONNECT_FB_STRConectar com o FacebookEBISU_FRIENDS_CONNECT_GOOGLE_STRConectar ao GoogleEBISU_FRIENDS_CONTACTS_STRContatosEBISU_LOGIN_CONTINUE_STRContinueEBISU_LOGIN_CREATE_ACCOUNT_STRCriar ContaEBISU_LOGIN_DATE_OF_BIRTH_STRData de nascimentoEBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STRData de nascimentoEBISU_FRIENDS_DELETE_STRExcluirEBISU_FRIENDS_DELETING_FRIEND_STRExcluindo amigo...EBISU_NEWS_DISMISS_STRDescartarEBISU_PROFILE_DISPLAY_STRExibiçãoEBISU_PROFILE_SETTINGS_DISPLAY_NAME_STRNome de Exibição:EBISU_GMAIL_DONE_STRConcluídoEBISU_PROFILE_EDIT_STREditarEBISU_NEWS_EDIT_STREditarEBISU_FRIENDS_EMAIL_STRE-mail:EBISU_INVITE_EMAIL_STRE-mailEBISU_PROFILE_EMAIL_STRE-mail:EBISU_LOGIN_EMAIL_STRE-mail:EBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STRO e-mail e a senha já existem.EBISU_ERROR_EMAIL_REQUIRED_STRÉ necessário um e-mail para continuar.EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STRE-mail, nome de usuárioEBISU_PROFILE_SETTINGS_EMAIL_STRE-mailEBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STRInserir e-mailEBISU_LOGIN_ENTER_PHONE_NUMBER_STRInsira o seu número de celular para receber notificações por mensagem de texto e muito mais!EBISU_LOGIN_ACCOUNT_STRInsira o seu endereço de e-mail para fazer o login ou criar uma conta.EBISU_ERROR_ERROR_TITLE_STRErroEBISU_GMAIL_GMAILPLACEHOLDER_STRexample@gmail.comEBISU_RETURN_EXIT_STRSairEBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRAmigos do FacebookEBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRConfigurações do FacebookEBISU_ERROR_FAILED_TO_DELETE_FRIEND_STRFalha ao excluir amigo.EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STRFalha ao remover novos itens.EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STRFalha ao enviar aceitação.EBISU_ERROR_FAILED_TO_SEND_DECLINE_STRFalha ao enviar recusa.EBISU_PROFILE_SETTINGS_FEMALE_STRMulherEBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STREncontre amigos através dos contatos.EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STREncontre amigos e seja encontrado através do Facebook.EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STREncontre amigos e seja encontrado através do Gmail.EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STREncontre amigos no OriginEBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STRDescubra o que seus amigos estão jogando!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STREncontre seus amigos no OriginEBISU_LOGIN_FORGOT_PASSWORD_STREsqueceu a senha?EBISU_FRIENDS_FRI_STRSex.EBISU_NEWS_FRI_STRSex.EBISU_NEWS_FRIEND_REQUEST_BODY_STRlhe enviou um pedido de amizade.EBISU_NEWS_FRIEND_REQUEST_STRPedido de AmizadeEBISU_CAT_FRIENDS_STRAmigosEBISU_NAV_FRIENDS_STRAmigosEBISU_PROFILE_FRIENDS_ONLY_STRApenas AmigosEBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STRApenas AmigosEBISU_FRIENDS_FRIENDS_WHO_HAVE_STRAmigos com %GAMENAME%EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STRAmigos sem %GAMENAME%EBISU_FRIENDS_GENDER_STRSexo:EBISU_PROFILE_SETTINGS_GENDER_STRSexoEBISU_PROFILE_GENDER_STRSexo:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STRReceba notícias de jogos e ofertas exclusivas da EA!EBISU_NEWS_GET_IT_STRPegarEBISU_ERROR_GETTING_USER_INFO_STRObtendo suas informações...EBISU_NEWS_GO_TO_STRIrEBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRAmigos do GoogleEBISU_NEWS_HIGH_SCORE_STRRecordeEBISU_FRIENDS_HOME_STRCasaEBISU_PROFILE_HOME_STRCasaEBISU_PROFILE_SETTINGS_HOME_STRCasaEBISU_LOGIN_AGREE_PP_TOS_STREu aceito a Política de Privacidade e os Termos de Serviço.EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIADesejo ser encontrado através de:EBISU_NEWS_IGNORE_STRIgnorarEBISU_FRIENDS_CONTACTS_IN_STRNO OriginEBISU_ERROR_INCORRECT_LOGIN_INFO_STRInformações de login incorretasEBISU_FRIENDS_INVITE_STRConvidarEBISU_FRIENDS_CHOOSE_SMS_EMAIL_STRConvidar amigos para o OriginEBISU_FRIENDS_SENTINVITE_STRConvite enviadoEBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STRConvide seus amigos para o OriginEBISU_NEWS_INVITES_STRConvitesEBISU_LOGIN_DUMMY_REAL_NAME_STRFulanoEBISU_FRIENDS_LAST_LOGIN_STRÚltimo login:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STRÚltimo login:EBISU_NEWS_LAST_UPDATE_STRÚltima atualização: %TIME%EBISU_NEWS_LASTUPDATE_NEVER_STRAtualizado em: NuncaEBISU_NEWS_LAUNCH_STRIniciarEBISU_PROFILE_LEGEND_STRLegendEBISU_PROFILE_SETTINGS_LOADING_STRCarregandoEBISU_LOGIN_LOGIN_STRLoginEBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRFazer login no FacebookEBISU_PROFILE_LOGOUT_STRDesconectarEBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STRSair do FacebookEBISU_LOGIN_LOGGING_IN_STRAcessando...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STRFaça novos amigos através de desafios nos jogos!EBISU_PROFILE_SETTINGS_MALE_STRHomemEBISU_FRIENDS_MOBILE_STRCelular:EBISU_PROFILE_MOBILE_STRCelular:EBISU_PROFILE_SETTINGS_MOBILE_STRMóbileEBISU_FRIENDS_MON_STRSeg.EBISU_NEWS_MON_STRSeg.EBISU_FRIENDS_MY_FRIENDS_TAB_STRMeus AmigosEBISU_PROFILE_MY_GAMES_STRMeus JogosEBISU_PROFILE_SETTINGS_MY_IMAGE_STRMinha imagemEBISU_NAV_PROFILE_STRMeu perfilEBISU_PROFILE_MY_WISH_LIST_STRMinha Lista de DesejosEBISU_CAT_NEWS_STRNotíciasEBISU_NAV_NEWS_STRNotíciasEBISU_ACHIEVEMENT_NICE_JOB_STRBom trabalho! Deseja compartilhar sua pontuação e desafiar jogadores na Rede Origin?EBISU_ACHIEVEMENT_NICE_JOB_USER_STRBom trabalho, %USERNAME%! Desejar compartilhar sua conquista na rede Origin?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STRNão, não desejo ser encontrado pelo meu nome do Facebook.EBISU_ACHIEVEMENT_NO_STRNão, obrigadoEBISU_FRIENDS_CONTACTS_NOT_IN_STRNÃO NO OriginEBISU_LOGIN_OK_STROKEBISU_ERROR_SOMETHING_WENT_WRONG_STROpa! Algo deu errado...EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_INVALID_DOCUMENT_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_INVALID_LANGUAGE_CODE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_LICENSE_NOT_FOUND_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_REFERENCE_NOT_FOUND_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_REGISTRATION_FAILED_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_SERVER_USER_API_FAILURE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_SERVICE_FAILURE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_USER_CREATION_FAILED_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_USER_LISTING_FAILED_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STROpa! Algo deu errado... um erro inesperado ocorreu.EBISU_PROFILE_OPT_IN_STRAceitarEBISU_PROFILE_OPT_OUT_STRCancelarEBISU_LOGIN_PASSWORD_STRSenhaEBISU_PROFILE_SETTINGS_PASSWORD_STRAlterar senhaEBISU_GMAIL_PASSWORD_STRSenhaEBISU_ERROR_PASSWORD_REQUIRED_STRÉ necessária uma senha para continuar.EBISU_ERROR_PASSWORD_RESTRICTIONS_STRA senha deve ter entre 4 e 16 caracteres.EBISU_FRIENDS_PENDINGINVITES_STRAmigos PendentesEBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STRAs pessoas bloqueadas por você não poderão desafiá-lo ou visualizar seu Perfil.EBISU_PROFILE_PLAY_STRJogarEBISU_FRIENDS_PLAYNOW_STRJogar Agora?EBISU_FRIENDS_PLAYING_COLON_STRJogando:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STRPor favor, crie um nome de usuário para completar a configuração da sua conta Origin. Se desejar, use nossa sugestão!EBISU_ERROR_ENTER_USERNAME_STRPor favor, insira um nome de usuário para continuar. EBISU_ERROR_ENTER_VALID_EMAIL_STRPor favor, insira um endereço de e-mail válido para continuar.EBISU_GMAIL_ENTERGMAILDATA_STRPor favor, insira seu nome de usuário do Gmail e senha.EBISU_ERROR_USER_NOT_LOGGED_IN_STRPor favor, faça o login.EBISU_ERROR_REENTER_INFO_STRPor favor, insira novamente suas informações para continuar. EBISU_ERROR_REENTER_INFO_CONTINUE_STRPor favor, insira novamente suas informações para continuar. EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STRPor favor, leia e aceite os Termos de Serviço.EBISU_ERROR_SIGN_IN_STRPor favor, faça o loginEBISU_ERROR_SIGN_IN_TO_CONTINUE_STRPor favor, faça o login para continuar.EBISU_PROFILE_PRIVACY_POLICY_STRPolítica de PrivacidadeEBISU_PROFILE_PRIVATE_STRPrivadoEBISU_PROFILE_SETTINGS_PRIVATE_STRPrivadoEBISU_CAT_PROFILE_STRPerfilEBISU_FRIENDS_PROFILE_STRPerfilEBISU_NEWS_PROFILE_STRPerfilEBISU_PROFILE_SETTINGS_TAB_STRConfigurações do PerfilEBISU_PROFILE_PROFILE_PRIVACY_STRConfigurações de Perfil/PrivacidadeEBISU_PROFILE_PUBLIC_STRPúblicoEBISU_PROFILE_SETTINGS_PUBLIC_STRPúblicoEBISU_NEWS_PULLDOWN_TO_UPDATE_STRPuxe para baixo para atualizar...EBISU_PROFILE_REAL_NAME_STRNome verdadeiro:EBISU_FRIENDS_REAL_NAME_STRNome verdadeiro:EBISU_PROFILE_SETTINGS_REAL_NAME_STRNome VerdadeiroEBISU_LOGIN_RECOVER_MY_PASSWORD_STRRecuperar minha senhaEBISU_LOGIN_REGISTER_NEW_USER_STRRegistrar novo usuário.EBISU_LOGIN_REGISTERING_NEW_USER_STRRegistrando novo usuário...EBISU_NEWS_REJECT_STRRecusarEBISU_NEWS_RELEASE_TO_UPDATE_STRSolte para atualizar...EBISU_FRIENDS_BLOCKING_A_USER_STRLembre-se, ao bloquear, você não terá mais contado com essa pessoa no Origin.EBISU_NEWS_REMOVE_STRRemoverEBISU_FRIENDS_REMOVE_FRIEND_STRRemover amigoEBISU_FRIENDS_REPORT_STRRelatórioEBISU_FRIENDS_REPORT_USER_STRDenunciar %USERNAME%EBISU_FRIENDS_REPORT_BLOCK_STRDenunciar/BloquearEBISU_NEWS_REPORT_BLOCK_STRDenunciar/BloquearEBISU_ERROR_RESULTS_LOADING_STRCarregando resultados...EBISU_ERROR_RETRIEVING_STRRecuperandoEBISU_RETURN_RETURN_TO_GAME_STRVoltar para o jogoEBISU_FRIENDS_SAT_STRSat.EBISU_NEWS_SAT_STRSat.EBISU_PROFILE_SETTINGS_SAVE_STRSalvarEBISU_PROFILE_SETTINGS_SAVING_STRAo salvarEBISU_FRIENDS_SEARCH_STRProcurarEBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STRPara pesquisas insira pelo menos 3 caracteres.EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STRPara pesquisas insira pelo menos 3 caracteres.EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STRPara pesquisas insira pelo menos 3 caracteres.EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STRPesquisar nessas redes:EBISU_SEARCH_OPTIONS_STROpções de pesquisaEBISU_FRIENDS_SEARCH_ORIGIN_STRPesquisar no OriginEBISU_FRIENDS_SEARCH_RESULTS_STRResultados da PesquisaEBISU_FRIENDS_SEARCHRESULTS_STRResultados da PesquisaEBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STRResultados da pesquisa em ContatosEBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRResultados da pesquisa no FacebookEBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRResultados da pesquisa no GoogleEBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STRResultados da pesquisa no OriginEBISU_FRIENDS_SEARCHING_STRBuscandoEBISU_FRIENDS_SENDING_FRIEND_REQUEST_STREnviando seu pedido de amizade...EBISU_LOGIN_SETUP_ACCOUNT_STRConfigurar ContaEBISU_PROFILE_SETTINGS_EDIT_STRConfiguraç.EBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STRNão, não desejo ser encontrado através do e-mail.EBISU_PROFILE_SETTINGS_NEWPASSWORD_STRSenha NovaEBISU_LOGIN_SETTING_UP_ACCOUNT_STRConfigurando conta...EBISU_NEWS_SHARE_STRCompartilharEBISU_PROFILE_SHOW_LESS_STRExibir menosEBISU_PROFILE_SHOW_MORE_STRExibir maisEBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STRFazer login no OriginEBISU_LOGIN_SIGN_IN_ORIGIN_STRFazer login no OriginEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STRO login é necessárioEBISU_LOGIN_SIGN_UP_BUTTON_STRRegistrar!EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STRSMSEBISU_ERROR_UNEXPECTED_ERROR_STRDesculpe, ocorreu um erro inesperado. Tente novamente.EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STRDesculpe, devido a restrições territoriais, você não pode se registrar no Origin nesse momento.EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STRDesculpe, não há contas existentes paraEBISU_ERROR_NO_RESULTS_FOUND_STRDesculpe, nenhum resultado encontrado. Tente novamente.EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STRDesculpe, o Origin não pode ser acessado nesse momento.EBISU_ERROR_LOGIN_FAILED_STRDesculpe, falha ao fazer login no Origin.EBISU_ERROR_SERVER_DOWN_STRDesculpe, nossos servidores estão fora do ar. Tente novamente mais tarde.EBISU_ERROR_ID_ALREADY_TAKEN_STRDesculpe, esse nome de usuário não está disponível. Por favor, tente outro.EBISU_ERROR_DATE_OF_BIRTH_INVALID_STRDesculpe, a data de nascimento inserida é inválida.EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STRDesculpe, o e-mail e senha não podem ser os mesmos. Tente novamente.EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STRDesculpe, as senhas que você inseriu não são iguais.EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STRDesculpe, houve um erro de comunicação. Tente novamente mais tarde.EBISU_ERROR_EMAIL_ADRESS_INVALID_STRDesculpe, esse endereço de e-mail é inválido.EBISU_ERROR_EMAIL_FORMAT_INVALID_STRDesculpe, esse formato de e-mail é inválido. Tente novamente.EBISU_ERROR_USER_NOT_FOUND_STRDesculpe, esse nome de usuário não foi localizado.EBISU_ERROR_DIDNT_RECEIVE_INFO_STRDesculpe, não recebemos suas informações. Tente novamente.EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STRDesculpe, você não pode se registrar no Origin nesse momento.EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STRDesculpe, sua senha não pode conter espaços. Tente novamente.EBISU_FRIENDS_SUN_STRSolEBISU_NEWS_SUN_STRSolEBISU_PROFILE_TOS_STRTermos de ServiçoEBISU_ERROR_Origin_NET_NOT_REACHED_STRNão foi possível conectar à rede do Origin. Verifique sua conexão de rede e tente novamente.EBISU_ERROR_EMAIL_ALREADY_EXISTS_STREsse endereço de e-mail já está em uso no Origin.EBISU_ERROR_INVALID_EMAIL_FORMAT_STREsse formato de e-mail é inválido.EBISU_ERROR_EMAIL_NOT_REGISTERED_STREsse e-mail não está registrado no Origin.EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STRIsso pode levar alguns minutos...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STREsse nome de usuário já existe no Origin.EBISU_FRIENDS_THUR_STRQuiEBISU_NEWS_THUR_STRQuiEBISU_ERROR_DOMAIN_INVALID_STRPara continuar, insira um endereço de e-mail válido.EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STRPara redefinir sua senha, insira o endereço de e-mail vinculado à sua conta.EBISU_FRIENDS_TODAY_STRHojeEBISU_NEWS_TODAY_STRHojeEBISU_LOGIN_TRY_STRTentarEBISU_FRIENDS_TUE_STRTer.EBISU_NEWS_TUE_STRTer.EBISU_LOGIN_SOMETHING_WENT_WRONG_STROps! Algo deu errado...EBISU_NEWS_UPDATES_STRAtualizaçõesEBISU_ERROR_UPDATING_CHANGES_STRAtualizando...EBISU_LOGIN_USER_REGISTERED_STRUsuário registrado!EBISU_PROFILE_USERNAME_STRNome de Usuário EBISU_LOGIN_USERNAME_STRNome de Usuário EBISU_PROFILE_SETTINGS_USERNAME_STRNome de Usuário EBISU_GMAIL_USERNAME_STRNome de Usuário EBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STRNome de usuário e senha são necessários para continuar.EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STRNome de usuário e senha devem ter entre 4 e 12 caracteres.EBISU_ERROR_USERNAME_REQUIRED_STRÉ necessário um nome de usuário para continuar.EBISU_ERROR_USERNAME_RESTRICTIONS_STRO nome de usuário deve ter entre 4 e 12 caracteres.EBISU_ERROR_USERNAME_NOT_AVAILABLE_STRNome de usuário indisponível.EBISU_ACHIEVEMENT_WAY_TO_GO_STRBoa! Deseja compartilhar sua pontuação e desafiar jogadores na Rede Origin?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STRBoa, %USERNAME%! Desejar compartilhar seu tempo na rede Origin?EBISU_ERROR_SEARCH_FAILED_STRNão encontramos resultados de pesquisa correspondentes.EBISU_FRIENDS_WED_STRQua.EBISU_NEWS_WED_STRQua.EBISU_NAV_WELCOME_STRBem-vindo(a)EBISU_LOGIN_WELCOME_BACK_STROlá, outra vez!EBISU_ACHIEVEMENT_WELL_DONE_STRMuito bem! Deseja compartilhar sua pontuação e desafiar jogadores na Rede Origin?EBISU_ACHIEVEMENT_WELL_DONE_USER_STRMuito bem, %USERNAME%! Deseja desafiar outros jogadores de %GAMENAME% na Rede Origin?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STRO que você gostaria de fazer?EBISU_LOGIN_WHY_JOIN_STRPor que vale a pena entrar no Origin?EBISU_ACHIEVEMENT_YES_STRSimEBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STRSim, permitir que me encontrem pelo meu nome do Facebook.EBISU_FRIENDS_YESTERDAY_STROntemEBISU_NEWS_YESTERDAY_STROntemEBISU_ERROR_MUST_AGREE_TOS_AND_PP_STRVocê precisa aceitar os Termos de Serviço e a Política de Privacidade para continuar.EBISU_ACHIEVEMENT_DOING_GREAT_STRVocê está indo muito bem! Deseja compartilhar seu recorde e desafiar jogadores na rede Origin?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STRVocê foi desafiado! %USERNAME% deseja jogar %GAMENAME% com você! Deseja aceitar o Desafio? Obter %GAMENAME% agora. EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STRVocê foi desafiado! %USERNAME% deseja jogar %GAMENAME% com você! EBISU_ERROR_CONN_TIMED_OUT_STRSeu tempo de conexão acabou. Faça o login no Origin novamente.EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STRSeu e-mail e senha não conferem. Tente novamente.EBISU_LOGIN_NEW_PASSWORD_SENT_STRSua nova senha foi enviada paraEBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STRSua conta Origin foi criada com sucesso e você está conectado. Comece agora e faça contato com seus amigos!EBISU_ERROR_SEARCH_NO_RESULTS_STRSua pesquisa não produziu resultados. EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRdd-mm-aaaaEBISU_ERROR_EMAIL_TOO_LONG_STRO endereço de e-mail é longo demais.EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STREssa conta Origin não existe mais.EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STRSeu dispositivo está com pouca memória. Para que o Origin funcione melhor, recomendamos que você exclua aplicativos que não esteja usando.EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRDesculpe, seu dispositivo não pode enviar mensagens de texto nesse momento.EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRDesculpe, não há contas de e-mail configuradas no seu dispositivo nesse momento.EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STRTem certeza de que deseja alterar sua senha? Você precisará usá-la sempre que fizer o login no Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_STRJogadorEBISU_STRING_TODAY_WITH_DATE_STRHoje, %DATE%EBISU_STRING_ONE_DAY_AGO_STR1 dia atrásEBISU_STRING_DAYS_AGO_STRHá %DAYS% diasEBISU_STRING_ONE_WEEK_AGO_STR1 semana atrásEBISU_STRING_WEEKS_AGO_STRHá %WEEKS% semanasEBISU_STRING_ONE_MONTH_AGO_STRHá um mêsEBISU_STRING_FACEBOOK_TOS_STRAo fazer o login no Facebook, eu concordo em ser encontrado através do meu nome do Facebook.EBISU_STRING_GMAIL_AUTH_FAILED_STRO nome de usuário ou senha que você digitou está incorreto.EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STRVocê criou sua conta Origin com sucesso! Agora, encontre e adicione amigos para desafiar. [BUTTON] OKEBISU_STRING_PRIVACY_CAPS_COLON_STRPRIVACIDADE:EBISU_STRING_JOIN_EBISU_STREntre no Origin!EBISU_STRING_WELCOME_BACK_USER_STRBem-vindo de volta, %USERNAME%.EBISU_FRIENDS_PENDING_STRPendenteEBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STRIsso pode levar alguns minutos.EBISU_FRIENDS_LAUNCH_MANUALLY_STRDesculpe, você deve iniciar %GAMENAME% manualmente. Caso tenha excluído, faça o download novamente.EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRDesculpe, seu dispositivo não pode enviar mensagens de texto nesse momento.EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STRVocê criou sua conta Origin com sucesso! Agora, encontre e adicione amigos para desafiar. [BUTTON] OKEBISU_FRIENDS_GO_STRIrEBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRDesculpe, não há contas de e-mail configuradas no seu dispositivo nesse momento.EBISU_ERROR_CONN_TIMED_OUT_2_STRSeu tempo de conexão acabou. Tente novamente e selecione OK para alterar suas configurações de rede. [BUTTON] TENTAR NOVAMENTE [BUTTON] OKEBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STRTem certeza de que deseja alterar sua senha? Você precisará usá-la sempre que entrar no Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_2_STRJogadorEBISU_STRING_MONTHS_AGO_STR Há %MONTHS% mesesEBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STRUse nossa sugestão ou escolha uma.EBISU_LOGIN_MOBILE_STRMóbileEBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@Eu aceito a @a href=\"http://privacy\"@Política de Privacidade@/a@ и @a href=\"http://tos\"@Termos de Serviço da EA@/a@@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STRPor favor, certifique-se de inserir informações completas e precisas.EBISU_FRIENDS_NO_FRIENDS_TITLE_STRAdicione seus amigos agora!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STRCompartilhe pontuações, desafie os amigos e descubra jogos!EBISU_STRING_ADD_FRIENDS_GMAIL_STRBusque nos seus contatos para encontrar amigos.EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STRAo me registrar, eu concordo em ser encontrado através do endereço de e-mail e ter meus eventos dos jogos automaticamente publicados. Essas opções podem ser alteradas nas configurações do perfil.EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STRRecordesEBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STRConquistas no jogoEBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STRCompartilhar com os amigosEBISU_PROFILE_SETTINGS_NEWSSETTINGS_STRConfigurações das notíciasEBISU_LOGIN_AGE_STRIdadeEBISU_PROFILE_ABOUT_STREULA EBISU_LOGO_LOGO_INSTRUCTIONS_STRToque no logotipo do Origin para voltar ao jogo a qualquer momento. Toque novamente para alternar.EBISU_NEWS_NO_INVITES_STRNão há novos convites. Fique ligado!EBISU_NEWS_NO_INVITES_DESCRIPTION_STRVerifique diariamente seus convites de amigos e desafios.EBISU_PROFILE_INFO_STRInfoEBISU_LOGIN_TRY_AGAIN_STRTentar novamenteEBISU_ERROR_ENTER_VALID_AGE_STRPor favor, insira uma idade válida.EBISU_LOGIN_AUTO_LOGGING_IN_STRFazendo login automaticamente...EBISU_STRING_JOIN_EBISU_TITLE_STREu acho o Origin legal. Você também vai achar. Registre-se e podemos ser amigos!/EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STRcom instruções sobre como redefinir sua senha.EBISU_ERROR_PASSWORD_INVALID_STRSenha inválidaEBISU_ERROR_TOS_TOO_LONG_STROs Termos de Serviço são longos demais.EBISU_STRING_START_NOW_STREncontrar AmigosEBISU_LOGO_PLAYER_STRJogadorEBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STRPor favor, utilize sua conta Origin principal para editar suas configurações do Facebook.EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STRConfigure seu perfil como público para que seus amigos possam visualizá-lo.EBISU_FRIEND_REMOVE_CONFIRMATION_STRTem certeza?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STR%USERNAME% será removido da sua lista de amigos. Você pode adicioná-lo novamente depois.EBISU_FRIEND_IGNORING_CHALLENGE_STRIgnorando desafio...EBISU_FRIEND_ACCEPTING_REQUEST_STRAceitando pedido de amizade...EBISU_FRIEND_DECLINING_REQUEST_STRRecusando pedido de amizade...EBISU_FRIEND_SENDING_BLOCK_STR%USERNAME% está bloqueado.EBISU_FRIEND_SENDING_REPORT_STRSua informação sobre %USERNAME% foi enviada.EBISU_LOGIN_RECEIVE_EA_UPDATE_STREu gostaria de receber notícias e informações da EA.EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STRDesculpe, mas você não atende aos critérios para o registro.EBISU_PROFILE_ERROR_FACEBOOK_STRPor favor, faça o login no Facebook.EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STRPor favor, selecione uma das configurações disponíveis antes de salvar.EBISU_ERROR_USERNAME_NOT_ALLOWED_STRO nome de usuário só pode conter números e letras. Tente novamente.EBISU_PROFILE_SETTINGS_SEACHABLEOK_STRSim, permitir que os usuários me encontrem através do e-mail.EBISU_EMAIL_INVITE_SUBJECT_STRConvite para entrar no OriginEBISU_ERROR_LOG_INTO_FACEBOOK_STRPor favor, faça o login no Facebook.EBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STRJogos disputadosEBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STRJá tem uma Conta EA? Insira a senha existente abaixo.EBISU_ERROR_REAL_NAME_TOO_LONGO nome verdadeiro digitado é longo demaisEBISU_ERROR_REAL_NAME_INVALID_CHARACTERSPor favor, use caracteres alfanuméricos para o nome verdadeiroEBISU_ERROR_TOO_MANY_ATTEMPTSVocê tentou acessar o Origin muitas vezes. Por favor, aguarde antes de tentar novamente.EBISU_FRIENDS_SENT_REQUEST_TITLE_STRPedido enviadoEBISU_SENDING_REQUEST_STREnviando...EBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STRSimEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STRNãoEBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STRBuscar seus amigos nos contatos?EBISU_FRIEND_PERMISSION_CONTACTS_STRPara encontrar seus amigos, seus contatos serão compartilhados temporariamente com nossos servidores para buscar correspondências entre usuários existentes do Origin. Nós não retemos estas informações. \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/Russian Text.plist b/app/src/main/assets/EASP/Origin/resources/Russian Text.plist new file mode 100644 index 0000000..0ef74c6 --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/Russian Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR* Наст. ИмяEBISU_LOGIN_OPTIONAL_INFO_STR*Означает оптимальную информацию.EBISU_ACHIEVEMENT_USER_DOING_GREAT_STR%USERNAME%, отличный результат! Хочешь запостить рекорд на Origin?EBISU_FRIENDS_GAME_LIST_TITLE_STRИгры %USERNAME%EBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% побил твое лучшее время в %GAMENAME%.EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% побил твой рекорд в %GAMENAME%.EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% прислал запрос на дружбу.EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STRТребуется дата рождения.EBISU_ERROR_WIFI_REQUIRED_STRДля входа в Origin из %GAMENAME% тебуется соединение по Wi-Fi.EBISU_ERROR_WIFI_3G_REQUIRED_STRДля входа в Origin из %GAMENAME% тебуется соединение по Wi-Fi или 3G.EBISU_NEWS_ACCEPT_STRПринятьEBISU_NEWS_ACCEPTED_FRIEND_STRПредложение дружбы принятоEBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STRПолитика конфиденциальности в данный момент недоступна.EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STRУсловия обслуживания в данный момент недоступны.EBISU_ERROR_TOS_FAILURE_STRУсловия обслуживания в данный момент недоступны.EBISU_ERROR_TOS_NOT_FOUND_STRУсловия обслуживания в данный момент недоступны.EBISU_NEWS_ACHIEVEMENT_UNLOCK_STRДост. разбл:EBISU_FRIENDS_ADD_STRДобавитьEBISU_FRIENDS_ADD_FRIENDS_TAB_STRДоб. друзейEBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STRДобавить друзей в вашу сеть!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STRДобавить друзей в Origin.EBISU_PROFILE_ADD_GAMES_STRДобавить игрыEBISU_FRIENDS_ADD_YOUR_CONTACTS_STRДобавить ваши контактыEBISU_FRIENDS_AGE_STRВозрастEBISU_PROFILE_AGE_STRВозрастEBISU_PROFILE_SETTINGS_AGE_STRВозрастEBISU_ERROR_ALERT_STRПредупреждениеEBISU_FRIENDS_ALREADY_ADDED_STRУже добавленоEBISU_LOGIN_INVITATION_SENT_STRПриглашение было выслано на %EMAIL%EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STRПроблемы со входом?EBISU_FRIENDS_BACK_STRНазадEBISU_PROFILE_SETTINGS_BACK_STRНазадEBISU_FRIENDS_BLOCK_STRБлокиров.EBISU_FRIENDS_BLOCK_USER_STRЗаблокировать %USERNAME%?EBISU_FRIENDS_BUY_STRПолучитьEBISU_PROFILE_BUY_NOW_STRПолучитьEBISU_GMAIL_CANCEL_STRОтменаEBISU_FRIENDS_CHALLENGE_STRВызовEBISU_PROFILE_CHALLENGE_STRВызовEBISU_NEWS_CHALLENGE_STRВызовEBISU_LOGIN_CHANGE_USERNAME_STRСменить имяEBISU_LOGIN_CHECKING_EMAIL_STRПроверка электронной почтыEBISU_FRIENDS_COMMENT_STRКомментарийEBISU_LOGIN_COMPLETE_SETUP_STRЗавершить настройкуEBISU_LOGIN_CONFIRM_STRПодтвердитьEBISU_PROFILE_SETTINGS_CONFIRM_STRПодтвердитьEBISU_LOGIN_CONGRATULATIONS_STRПоздравляем!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STRПоздравляем! %USERNAME%, ты только что достиг быстрого времени! Хочешь посмотреть, как это отражено в Origin?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STRПоздравляем! %USERNAME%, ты только что достиг быстрого времени! Хочешь посмотреть свое место в Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STRПоздравляем! %USERNAME%, ты только что достиг рекорда! Хочешь посмотреть, как это отражено в Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STRПоздравляем! %USERNAME%, ты только что достиг рекорда! Хочешь посмотреть свое место в Origin?EBISU_FRIENDS_CONNECT_FB_STRПодключение к FacebookEBISU_FRIENDS_CONNECT_GOOGLE_STRПодключение к GoogleEBISU_FRIENDS_CONTACTS_STRКонтактыEBISU_LOGIN_CONTINUE_STRДалееEBISU_LOGIN_CREATE_ACCOUNT_STRСоздать учетную записьEBISU_LOGIN_DATE_OF_BIRTH_STRДата рожденияEBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STRДата рожденияEBISU_FRIENDS_DELETE_STRУдалитьEBISU_FRIENDS_DELETING_FRIEND_STRУдаление друга...EBISU_NEWS_DISMISS_STRПрерватьEBISU_PROFILE_DISPLAY_STRЭкранEBISU_PROFILE_SETTINGS_DISPLAY_NAME_STRОтображаемое имя:EBISU_GMAIL_DONE_STRГотовоEBISU_PROFILE_EDIT_STRРедактироватьEBISU_NEWS_EDIT_STRРедактироватьEBISU_FRIENDS_EMAIL_STRЭл. почта:EBISU_INVITE_EMAIL_STRЭл. почтаEBISU_PROFILE_EMAIL_STRЭл. почта:EBISU_LOGIN_EMAIL_STRЭл. почтаEBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STRАдрес почты и пароль уже существуют.EBISU_ERROR_EMAIL_REQUIRED_STRДля продолжения нужна электронная почта.EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STRЭл. почта, ИмяEBISU_PROFILE_SETTINGS_EMAIL_STRЭл. почтаEBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STRВведите адрес электронной почты почтыEBISU_LOGIN_ENTER_PHONE_NUMBER_STRВведите номер телефона для получения текстовых нотификаций и другой информации!EBISU_LOGIN_ACCOUNT_STRВведите адрес электронной почты для входа или создания учетной записи.EBISU_ERROR_ERROR_TITLE_STRОшибкаEBISU_GMAIL_GMAILPLACEHOLDER_STRexample@gmail.comEBISU_RETURN_EXIT_STRВыходEBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRДрузья FacebookEBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRНастройки FacebookEBISU_ERROR_FAILED_TO_DELETE_FRIEND_STRНе удалось удалить друга.EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STRНе удалось удалить новость.EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STRНе удалось послать подтверждение.EBISU_ERROR_FAILED_TO_SEND_DECLINE_STRНе удалось послать отказ.EBISU_PROFILE_SETTINGS_FEMALE_STRЖенщинаEBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STRНайти друзей через контакты.EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STRНайти друзей и быть найденным через Facebook.EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STRНайти друзей и быть найденным через Gmail.EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STRНайти друзей на OriginEBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STRУзнайте, во что играют ваши друзья!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STRНайти друзей на OriginEBISU_LOGIN_FORGOT_PASSWORD_STRЗабыли пароль?EBISU_FRIENDS_FRI_STRПтEBISU_NEWS_FRI_STRПтEBISU_NEWS_FRIEND_REQUEST_BODY_STRприслал запрос на дружбу.EBISU_NEWS_FRIEND_REQUEST_STRЗапрос на дружбуEBISU_CAT_FRIENDS_STRДрузьяEBISU_NAV_FRIENDS_STRДрузьяEBISU_PROFILE_FRIENDS_ONLY_STRТолько друзьяEBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STRТолько друзьяEBISU_FRIENDS_FRIENDS_WHO_HAVE_STRДрузья с %GAMENAME%EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STRДрузья без %GAMENAME%EBISU_FRIENDS_GENDER_STRПол:EBISU_PROFILE_SETTINGS_GENDER_STRПолEBISU_PROFILE_GENDER_STRПол:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STRПолучайте игровые новости и эксклюзивные предложения от EA!EBISU_NEWS_GET_IT_STRПолучитьEBISU_ERROR_GETTING_USER_INFO_STRПолучаем информацию...EBISU_NEWS_GO_TO_STRВойтиEBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRДрузья GoogleEBISU_NEWS_HIGH_SCORE_STRРекордEBISU_FRIENDS_HOME_STRДомEBISU_PROFILE_HOME_STRДомEBISU_PROFILE_SETTINGS_HOME_STRДомEBISU_LOGIN_AGREE_PP_TOS_STRЯ согласен с политиками конфиденциальности и условиями обслуживания.EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIAЯ хочу быть найден(а) через:EBISU_NEWS_IGNORE_STRИгнорироватьEBISU_FRIENDS_CONTACTS_IN_STRВ OriginEBISU_ERROR_INCORRECT_LOGIN_INFO_STRНеправильные данные входаEBISU_FRIENDS_INVITE_STRПригласитьEBISU_FRIENDS_CHOOSE_SMS_EMAIL_STRПригласить друзей в OriginEBISU_FRIENDS_SENTINVITE_STRПриглашение отправленоEBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STRПригласите друзей в Origin!EBISU_NEWS_INVITES_STRПриглашенияEBISU_LOGIN_DUMMY_REAL_NAME_STRИван ПетровEBISU_FRIENDS_LAST_LOGIN_STRПоследний вход:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STRПоследний вход:EBISU_NEWS_LAST_UPDATE_STRПоследнее обновление: %TIME%EBISU_NEWS_LASTUPDATE_NEVER_STRПоследнее обновление: НикогдаEBISU_NEWS_LAUNCH_STRЗапускEBISU_PROFILE_LEGEND_STRЛегендаEBISU_PROFILE_SETTINGS_LOADING_STRЗагрузкаEBISU_LOGIN_LOGIN_STRВходEBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRВойти в FacebookEBISU_PROFILE_LOGOUT_STRВыйтиEBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STRВыйти из FacebookEBISU_LOGIN_LOGGING_IN_STRВыполняется вход...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STRНаходите новых друзей через игровые вызовы!EBISU_PROFILE_SETTINGS_MALE_STRМужчинаEBISU_FRIENDS_MOBILE_STRМобильный телефон:EBISU_PROFILE_MOBILE_STRМобильный телефон:EBISU_PROFILE_SETTINGS_MOBILE_STRМобильн. телефонEBISU_FRIENDS_MON_STRПнEBISU_NEWS_MON_STRПнEBISU_FRIENDS_MY_FRIENDS_TAB_STRМои друзьяEBISU_PROFILE_MY_GAMES_STRМои игрыEBISU_PROFILE_SETTINGS_MY_IMAGE_STRМое изображениеEBISU_NAV_PROFILE_STRМой профильEBISU_PROFILE_MY_WISH_LIST_STRМой список желанийEBISU_CAT_NEWS_STRНовостиEBISU_NAV_NEWS_STRНовостиEBISU_ACHIEVEMENT_NICE_JOB_STRОтлично! Хочешь поделиться счетом и вызать игроков в сети Origin?EBISU_ACHIEVEMENT_NICE_JOB_USER_STRОтлично сработано, %USERNAME%! Хочешь поделиться достижением в сети Origin?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STRНет, не искать меня по моему имени на Facebook.EBISU_ACHIEVEMENT_NO_STRНет, спасибоEBISU_FRIENDS_CONTACTS_NOT_IN_STRНЕ В OriginEBISU_LOGIN_OK_STROKEBISU_ERROR_SOMETHING_WENT_WRONG_STRУпс! Что-то пошло не так...EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_INVALID_DOCUMENT_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_INVALID_LANGUAGE_CODE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_LICENSE_NOT_FOUND_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_REFERENCE_NOT_FOUND_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_REGISTRATION_FAILED_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_SERVER_USER_API_FAILURE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_SERVICE_FAILURE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_USER_CREATION_FAILED_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_USER_LISTING_FAILED_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STRУпс! Что-то пошло не так... Произошла неизвестная ошибка.EBISU_PROFILE_OPT_IN_STRПрисоединитьсяEBISU_PROFILE_OPT_OUT_STRВыйтиEBISU_LOGIN_PASSWORD_STRПарольEBISU_PROFILE_SETTINGS_PASSWORD_STRСмена пароляEBISU_GMAIL_PASSWORD_STRПарольEBISU_ERROR_PASSWORD_REQUIRED_STRДля продолжения нужен пароль.EBISU_ERROR_PASSWORD_RESTRICTIONS_STRПароль должен быть от 4 до 16 символов в длину.EBISU_FRIENDS_PENDINGINVITES_STRПредложения без ответаEBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STRЗаблокированнные люди не смогут посылать вызовы или просматривать ваш профиль.EBISU_PROFILE_PLAY_STRИграEBISU_FRIENDS_PLAYNOW_STRИграть сейчас?EBISU_FRIENDS_PLAYING_COLON_STRИгра:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STRПожалуйста, введите имя, чтобы завершить создание учетной записи Origin. При желании используйте наше предложение!EBISU_ERROR_ENTER_USERNAME_STRВведите имя для продолжения.EBISU_ERROR_ENTER_VALID_EMAIL_STRПожалуйста, введите действующий адрес электронной почты, чтобы продолжить.EBISU_GMAIL_ENTERGMAILDATA_STRПожалуйста, введите адрес и пароль Gmail.EBISU_ERROR_USER_NOT_LOGGED_IN_STRПожалуйста, войдите.EBISU_ERROR_REENTER_INFO_STRПожалуйста, повторите ввод информации, чтобы продолжить.EBISU_ERROR_REENTER_INFO_CONTINUE_STRПожалуйста, повторите ввод информации, чтобы продолжить.EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STRПожалуйста, прочтите и примите условия обслуживания.EBISU_ERROR_SIGN_IN_STRПожалуйста, войдитеEBISU_ERROR_SIGN_IN_TO_CONTINUE_STRПожалуйста, войдите, чтобы продолжить.EBISU_PROFILE_PRIVACY_POLICY_STRПравила соблюдения конфиденциальности информацииEBISU_PROFILE_PRIVATE_STRЛичноEBISU_PROFILE_SETTINGS_PRIVATE_STRЛичноEBISU_CAT_PROFILE_STRПрофильEBISU_FRIENDS_PROFILE_STRПрофильEBISU_NEWS_PROFILE_STRПрофильEBISU_PROFILE_SETTINGS_TAB_STRНастройки профиляEBISU_PROFILE_PROFILE_PRIVACY_STRПрофиль/Настройки приватностиEBISU_PROFILE_PUBLIC_STRПубличныйEBISU_PROFILE_SETTINGS_PUBLIC_STRПубличн.EBISU_NEWS_PULLDOWN_TO_UPDATE_STRПотяните, чтобы обновить...EBISU_PROFILE_REAL_NAME_STRНастоящее имя:EBISU_FRIENDS_REAL_NAME_STRНастоящее имя:EBISU_PROFILE_SETTINGS_REAL_NAME_STRНастоящее имяEBISU_LOGIN_RECOVER_MY_PASSWORD_STRВосстановить мой парольEBISU_LOGIN_REGISTER_NEW_USER_STRРегистрация нового пользователя.EBISU_LOGIN_REGISTERING_NEW_USER_STRРегистрация нового пользователя...EBISU_NEWS_REJECT_STRОтклонитьEBISU_NEWS_RELEASE_TO_UPDATE_STRОтпустите, чтобы обновить...EBISU_FRIENDS_BLOCKING_A_USER_STRПомните, блокировка закроет все контакты с этим пользователем в Origin.EBISU_NEWS_REMOVE_STRУдалитьEBISU_FRIENDS_REMOVE_FRIEND_STRУдалить другаEBISU_FRIENDS_REPORT_STRЗаявкаEBISU_FRIENDS_REPORT_USER_STRЗаявить на %USERNAME%EBISU_FRIENDS_REPORT_BLOCK_STRЗаявить/БлокироватьEBISU_NEWS_REPORT_BLOCK_STRЗаявить/БлокироватьEBISU_ERROR_RESULTS_LOADING_STRЗагрузка результатов...EBISU_ERROR_RETRIEVING_STRЗагрузкаEBISU_RETURN_RETURN_TO_GAME_STRВернуться к игреEBISU_FRIENDS_SAT_STRСбEBISU_NEWS_SAT_STRСбEBISU_PROFILE_SETTINGS_SAVE_STRСохранитьEBISU_PROFILE_SETTINGS_SAVING_STRСохранениеEBISU_FRIENDS_SEARCH_STRПоискEBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STRПоисковые запросы должны быть не меньше 3 символов.EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STRПоисковые запросы должны быть не меньше 3 символов.EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STRПоисковые запросы должны быть не меньше 3 символов.EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STRИскать в следующих сетях:EBISU_SEARCH_OPTIONS_STRНастройки поискаEBISU_FRIENDS_SEARCH_ORIGIN_STRПоиск в OriginEBISU_FRIENDS_SEARCH_RESULTS_STRРезультаты поискаEBISU_FRIENDS_SEARCHRESULTS_STRРезультаты поискаEBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STRРезультаты поиска в контактахEBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRРезультаты поиска в FacebookEBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRРезультаты поиска в GoogleEBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STRРезультаты поиска в OriginEBISU_FRIENDS_SEARCHING_STRПоискEBISU_FRIENDS_SENDING_FRIEND_REQUEST_STRОтправка запроса на дружбу...EBISU_LOGIN_SETUP_ACCOUNT_STRНастройка учетной записиEBISU_PROFILE_SETTINGS_EDIT_STRНастройкиEBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STRНет, я не хочу быть найденным по электронной почте.EBISU_PROFILE_SETTINGS_NEWPASSWORD_STRНовый парольEBISU_LOGIN_SETTING_UP_ACCOUNT_STRНастройка учетной записи...EBISU_NEWS_SHARE_STRПоделитьсяEBISU_PROFILE_SHOW_LESS_STRПоказать меньшеEBISU_PROFILE_SHOW_MORE_STRПоказать большеEBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STRВойти в OriginEBISU_LOGIN_SIGN_IN_ORIGIN_STRВойти в OriginEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STRТребуется входEBISU_LOGIN_SIGN_UP_BUTTON_STRПодпишитесь!EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STRSMSEBISU_ERROR_UNEXPECTED_ERROR_STRИзвините, произошла неожиданная ошибка. Пожалуйста, повторите попытку.EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STRИзвините, в силу территориальных ограничений в данный момент вы не можете присоединиться к Origin.EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STRИзвините, учетной записи не существуетEBISU_ERROR_NO_RESULTS_FOUND_STRИзвините, результатов не найдено. Пожалуйста, попробуйте еще раз.EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STRИзвините, в данный момент Origin недоступен.EBISU_ERROR_LOGIN_FAILED_STRИзвините, войти в Origin не удалось.EBISU_ERROR_SERVER_DOWN_STRИзвините, серверы отключены. Пожалуйста, попробуйте позже.EBISU_ERROR_ID_ALREADY_TAKEN_STRК сожалению, это имя пользователя уже занято. Попробуйте выбрать другое.EBISU_ERROR_DATE_OF_BIRTH_INVALID_STRИзвините, введеная дата рождения неверна.EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STRИзвините, электронная почта и пароль не могут совпадать. Пожалуйста, попробуйте еще раз.EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STRВведенные пароли не совпадают.EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STRИзвините, проблема с соединением. Пожалуйста, попробуйте позже.EBISU_ERROR_EMAIL_ADRESS_INVALID_STRИзвините, адрес электронной почты неверен.EBISU_ERROR_EMAIL_FORMAT_INVALID_STRИзвините, формат адреса электронной почты неверен. Пожалуйста, попробуйте еще раз.EBISU_ERROR_USER_NOT_FOUND_STRИзвините, это имя пользователя не найдено.EBISU_ERROR_DIDNT_RECEIVE_INFO_STRИзвините, мы не получили вашу информацию. Пожалуйста, попробуйте еще раз.EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STRИзвините, в данный момент вы не можете присоединиться к Origin.EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STRИзвините, ваш пароль не может содеражть пробелы. Пожалуйста, попробуйте еще раз.EBISU_FRIENDS_SUN_STRВсEBISU_NEWS_SUN_STRВсEBISU_PROFILE_TOS_STR Условия предоставления услугEBISU_ERROR_Origin_NET_NOT_REACHED_STRНет доступа к сети Origin. Проверьте сетевое подключение и повторите попытку.EBISU_ERROR_EMAIL_ALREADY_EXISTS_STRЭтот адрес электронной почты уже есть в OriginEBISU_ERROR_INVALID_EMAIL_FORMAT_STRФормат адреса неверный.EBISU_ERROR_EMAIL_NOT_REGISTERED_STRЭтот адрес электронной почты не зарегистрирован в Origin.EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STRЭто займет некоторое время...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STRЭтот идентификтор уже есть в Origin.EBISU_FRIENDS_THUR_STRЧтEBISU_NEWS_THUR_STRЧтEBISU_ERROR_DOMAIN_INVALID_STRЧтобы продолжить, введите действующий адрес электронной почты.EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STRЧтобы сбросить пароль, введите адрес электронной почты, связанный с вашей учетной записью.EBISU_FRIENDS_TODAY_STRСегодняEBISU_NEWS_TODAY_STRСегодняEBISU_LOGIN_TRY_STRПопытайтесьEBISU_FRIENDS_TUE_STRВтEBISU_NEWS_TUE_STRВтEBISU_LOGIN_SOMETHING_WENT_WRONG_STRОх нет! Что-то пошло не так...EBISU_NEWS_UPDATES_STRОбновленияEBISU_ERROR_UPDATING_CHANGES_STRОбновление...EBISU_LOGIN_USER_REGISTERED_STRПользователь зарегистрирован!EBISU_PROFILE_USERNAME_STRИмя пользователяEBISU_LOGIN_USERNAME_STRИмя пользователя EBISU_PROFILE_SETTINGS_USERNAME_STRИмя пользователя EBISU_GMAIL_USERNAME_STRИмя пользователя EBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STRДля продолжения требуются имя пользователя и пароль.EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STRИмя пользователя и пароль должны быть от 4 до12 символов в длину.EBISU_ERROR_USERNAME_REQUIRED_STRДля продолжения нужно имя пользователя.EBISU_ERROR_USERNAME_RESTRICTIONS_STRИмя пользователя должно быть от 4 до 12 символов в длину.EBISU_ERROR_USERNAME_NOT_AVAILABLE_STRИмя пользователя недоступно.EBISU_ACHIEVEMENT_WAY_TO_GO_STRЗдорово! Хочешь поделиться счетом и вызвать других игроков в сети Origin?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STRЗдорово, %USERNAME%! Хочешь поделиться своим временем в сети Origin?EBISU_ERROR_SEARCH_FAILED_STRРезультатов поиска не найдено.EBISU_FRIENDS_WED_STRСрEBISU_NEWS_WED_STRСрEBISU_NAV_WELCOME_STRДобро пожаловатьEBISU_LOGIN_WELCOME_BACK_STRС возвращением!EBISU_ACHIEVEMENT_WELL_DONE_STRОтлично! Хочешь поделиться счетом и вызвать игроков в сети Origin?EBISU_ACHIEVEMENT_WELL_DONE_USER_STRОтлично сработано, %USERNAME%! Хочешь вызвать других игроков в %GAMENAME% в сети Origin?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STRЧто вы хотите сделать?EBISU_LOGIN_WHY_JOIN_STRЗачем мне присоединяться к Origin?EBISU_ACHIEVEMENT_YES_STRДаEBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STRДа, позволить участникам находить меня по имени Facebook.EBISU_FRIENDS_YESTERDAY_STRВчераEBISU_NEWS_YESTERDAY_STRВчераEBISU_ERROR_MUST_AGREE_TOS_AND_PP_STRВы должны принять условия обслуживания и условия конфиденциальности, чтобы продолжить.EBISU_ACHIEVEMENT_DOING_GREAT_STRОтлично справляешься! Хочешь поделиться своим рекордом и вызвать других игроков в сети Origin?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STRТебя вызвали! %USERNAME% хочет сыграть с тобой в %GAMENAME%! Принять вызов? Получи %GAMENAME% сейчас. EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STRТебя вызвали! %USERNAME% хочет сыграть с тобой в %GAMENAME%! EBISU_ERROR_CONN_TIMED_OUT_STRВремя соединения истекло. Пожалуйста, войдите в Origin снова.EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STRВаши адрес электронной почты и пароль не совпадают. Пожалуйста, попробуйте еще раз.EBISU_LOGIN_NEW_PASSWORD_SENT_STRВаш новый пароль был выслан наEBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STRВаша учетная запись Origin была успешно создана, и вы вошли. Начните добавлять друзей!EBISU_ERROR_SEARCH_NO_RESULTS_STRПоиск не принес результатов. EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRдд-мм-ггггEBISU_ERROR_EMAIL_TOO_LONG_STRСлишком длинный адрес электронной почты.EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STRЭта учетная запись Origin больше не существует.EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STRВ вашем устройстве заканчивается память. Для лучшего быстродействия Origin рекомендуем удалить неиспользуемые приложения.EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRИзвините, ваше устройство не может в данный момент посылать сообщения.EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRИзвините, учетная запись почты на устройстве не настроена.EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STRВы уверены, что хотите сменить пароль? Он нужен при любом входе в Origin. [OK] [ОТМЕНА]EBISU_FRIENDS_PLAYER_STRИгрокEBISU_STRING_TODAY_WITH_DATE_STRСегодня %DATE%EBISU_STRING_ONE_DAY_AGO_STR1 день назадEBISU_STRING_DAYS_AGO_STR%DAYS% дней назадEBISU_STRING_ONE_WEEK_AGO_STR1 неделю назадEBISU_STRING_WEEKS_AGO_STR%WEEKS% недель назадEBISU_STRING_ONE_MONTH_AGO_STRМесяц назадEBISU_STRING_FACEBOOK_TOS_STRВходя в Facebook, я соглашаюсь на поиск по моему имени Facebook.EBISU_STRING_GMAIL_AUTH_FAILED_STRНеверное имя пользователя или неправильный пароль.EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STRВы успешно создали учетную запись Origin! теперь найдите и добавьте друзей для вызова. [КНОПКА] OKEBISU_STRING_PRIVACY_CAPS_COLON_STRКОНФИДЕНЦ.:EBISU_STRING_JOIN_EBISU_STRПрисоединяйтесь к Origin!EBISU_STRING_WELCOME_BACK_USER_STRС возвращением, %USERNAME%.EBISU_FRIENDS_PENDING_STRОжиданиеEBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STRЭто займет некоторое время.EBISU_FRIENDS_LAUNCH_MANUALLY_STRИзвините, вам нужно запустить %GAMENAME% вручную. Если вы ее удалили, можно скачать снова.EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRИзвините, ваше устройство не может в данный момент посылать сообщения.EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STRВы успешно создали учетную запись Origin! теперь найдите и добавьте друзей для вызова. [КНОПКА] OKEBISU_FRIENDS_GO_STRВойтиEBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRИзвините, учетная запись почты на устройстве не настроена.EBISU_ERROR_CONN_TIMED_OUT_2_STRВремя соединения истекло. Попробуйте снова или нажмите OK, чтобы поменять настройки сети. [КНОПКА] СНОВА [КНОПКА] OKEBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STRВы уверены, что хотите сменить пароль? Он нужен при любом входе в Origin. [OK] [ОТМЕНА]EBISU_FRIENDS_PLAYER_2_STRИгрокEBISU_STRING_MONTHS_AGO_STR %MONTHS% месяцев назадEBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STRИспользуйте наше предложение или введите свое.EBISU_LOGIN_MOBILE_STRМобильный телефонEBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@Я согласен на @a href=\"http://privacy\"@Политики конфидденциальности@/a@ и @a href=\"http://tos\"@Условия обслуживания EA@/a@@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STRПожалуйста, убедитесь в полноте и точности информации.EBISU_FRIENDS_NO_FRIENDS_TITLE_STRДобавьте друзей сейчас!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STRДелитесь счетом, вызывайте друзей и открывайте игры!EBISU_STRING_ADD_FRIENDS_GMAIL_STRИщите друзей в своих контактах.EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STRПодписываясь, я соглашаюсь на поиск по моему адресу электронной почты и автоматическую публикацию моих игровых событий. Эти опции могут быть изменены в настройках профиля.EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STRРекордыEBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STRИгровые достиженияEBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STRПоделиться с друзьямиEBISU_PROFILE_SETTINGS_NEWSSETTINGS_STRНастройки новостейEBISU_LOGIN_AGE_STRВозрастEBISU_PROFILE_ABOUT_STRЛицензионное соглашениеEBISU_LOGO_LOGO_INSTRUCTIONS_STRНажмите на лого Origin, чтобы вернуться к игре в любой момент. Нажмите снова, чтобы переключаться туда и обратно.EBISU_NEWS_NO_INVITES_STRНет новых приглашений. Оставайтесь с нами!EBISU_NEWS_NO_INVITES_DESCRIPTION_STRПроверяйте наличие приглашений и вызовов ежедневно.EBISU_PROFILE_INFO_STRИнфоEBISU_LOGIN_TRY_AGAIN_STRПопробуйте сноваEBISU_ERROR_ENTER_VALID_AGE_STRВведите корректный возраст.EBISU_LOGIN_AUTO_LOGGING_IN_STRАвтовход...EBISU_STRING_JOIN_EBISU_TITLE_STRЯ думаю, Origin крут. Как и ты. Присоединяйся, будем друзьями!EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STRс инструкциями по сбросу пароля.EBISU_ERROR_PASSWORD_INVALID_STRПароль неверен.EBISU_ERROR_TOS_TOO_LONG_STRУсловия обслуживания слишком длинные.EBISU_STRING_START_NOW_STRНайти друзейEBISU_LOGO_PLAYER_STRИгрокEBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STRПожалуйста, используйте основную учетную запись Origin, чтобы отредактировать ваши настройки Facebook.EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STRСделайте профиль публичным, чтобы ваши друзья могли его видеть.EBISU_FRIEND_REMOVE_CONFIRMATION_STRВы уверены?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STR%USERNAME% будет удален из списка друзей. Их всегда можно добавить обратно.EBISU_FRIEND_IGNORING_CHALLENGE_STRИгнорирование вызова...EBISU_FRIEND_ACCEPTING_REQUEST_STRПринятие заявки на дружбу...EBISU_FRIEND_DECLINING_REQUEST_STRОтклонение заявки на дружбу...EBISU_FRIEND_SENDING_BLOCK_STRПользователь %USERNAME% заблокирован.EBISU_FRIEND_SENDING_REPORT_STRЖалоба на пользователя %USERNAME% отправлена.EBISU_LOGIN_RECEIVE_EA_UPDATE_STRЯ хотел(а) бы получать новости и информацию об играх EA.EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STRИзвините, но Вы не соответствуете критериям регистрации.EBISU_PROFILE_ERROR_FACEBOOK_STRПожалуйста, войдите, чтобы продолжить.EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STRПожалуйста, выберите одну из доступных настроек перед сохранением.EBISU_ERROR_USERNAME_NOT_ALLOWED_STRИмя пользователя может включать лишь буквы и цифры. Пожалуйста, попробуйте еще.EBISU_PROFILE_SETTINGS_SEACHABLEOK_STRДа, позволить участникам находить меня по почте.EBISU_EMAIL_INVITE_SUBJECT_STRПриглашение присоединиться к OriginEBISU_ERROR_LOG_INTO_FACEBOOK_STRПожалуйста, войдите, чтобы продолжить.EBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STRСыграно игрEBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STRУже есть учетная запись EA? Введите существующий пароль.EBISU_ERROR_REAL_NAME_TOO_LONGВаше настоящее имя слишком длинноеEBISU_ERROR_REAL_NAME_INVALID_CHARACTERSПожалуйста, используйте буквенно-числовые значения для настоящего имени.EBISU_ERROR_TOO_MANY_ATTEMPTSВы сликом много раз пытались войти в Origin. Пожалуйста, подождите перед следующей попыткой.EBISU_FRIENDS_SENT_REQUEST_TITLE_STRЗапрос отправленEBISU_SENDING_REQUEST_STRОтправка...EBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STRДаEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STRНетEBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STRКак найти друзей в списке контактов?EBISU_FRIEND_PERMISSION_CONTACTS_STRЧтобы помочь вам найти ваших друзей, мы временно предоставим общий доступ к вашим контактам на наших серверах и определим совпадения с существующими пользователями Origin. Мы не будем сохранять вашу информацию. \ No newline at end of file diff --git a/app/src/main/assets/EASP/Origin/resources/Spanish Text.plist b/app/src/main/assets/EASP/Origin/resources/Spanish Text.plist new file mode 100644 index 0000000..5c540bc --- /dev/null +++ b/app/src/main/assets/EASP/Origin/resources/Spanish Text.plist @@ -0,0 +1 @@ +EBISU_LOGIN_REAL_NAME_STR* Nombre RealEBISU_LOGIN_OPTIONAL_INFO_STR*Indica información opcional.EBISU_ACHIEVEMENT_USER_DOING_GREAT_STR¡%USERNAME%, lo estás haciendo estupendamente! ¿Quieres compartir tu mejor puntuación en Origin?EBISU_FRIENDS_GAME_LIST_TITLE_STRJuegos de %USERNAME%EBISU_ACHIEVEMENT_BEAT_BEST_TIME_STR%USERNAME% ha superado tu mejor tiempo en %GAMENAME%.EBISU_ACHIEVEMENT_BEAT_HIGH_SCORE_STR%USERNAME% ha superado tu mejor puntuación en %GAMENAME%.EBISU_ACHIEVEMENT_HAS_SENT_FRIEND_REQ_STR%USERNAME% te ha enviado una solicitud de amistad.EBISU_ERROR_DATE_OF_BIRTH_REQUIRED_STRSe necesita una fecha de nacimiento.EBISU_ERROR_WIFI_REQUIRED_STRSe necesita una conexión Wi-Fi para iniciar sesión en Origin desde %GAMENAME%.EBISU_ERROR_WIFI_3G_REQUIRED_STRSe necesita una conexión Wi-Fi o 3G para iniciar sesión en Origin desde %GAMENAME%.EBISU_NEWS_ACCEPT_STRAceptarEBISU_NEWS_ACCEPTED_FRIEND_STRSolicitud de amistad aceptadaEBISU_ERROR_PRIVACY_DOC_NOT_FOUND_STREn estos momentos no es posible acceder la política de privacidad.EBISU_ERROR_TERMS_OF_SERVICE_TOO_LONG_STREn estos momentos no es posible acceder las condiciones del servicio.EBISU_ERROR_TOS_FAILURE_STREn estos momentos no es posible acceder las condiciones del servicio.EBISU_ERROR_TOS_NOT_FOUND_STREn estos momentos no es posible acceder las condiciones del servicio.EBISU_NEWS_ACHIEVEMENT_UNLOCK_STRLogro dsblq.EBISU_FRIENDS_ADD_STRAñadirEBISU_FRIENDS_ADD_FRIENDS_TAB_STRAñade AmigosEBISU_FRIENDS_ADD_FRIEND_TO_NETWORK_STR¡Añade amigos a tu red!EBISU_ERROR_ADD_FRIENDS_TO_Origin_STRAñade amigos a Origin.EBISU_PROFILE_ADD_GAMES_STRAñadir juegosEBISU_FRIENDS_ADD_YOUR_CONTACTS_STRAñadir tus contactosEBISU_FRIENDS_AGE_STREdadEBISU_PROFILE_AGE_STREdadEBISU_PROFILE_SETTINGS_AGE_STREdadEBISU_ERROR_ALERT_STRAlertaEBISU_FRIENDS_ALREADY_ADDED_STREstá añadidoEBISU_LOGIN_INVITATION_SENT_STRSe ha enviado una invitación a %EMAIL%EBISU_LOGIN_ARE_YOU_HAVING_TROUBLE_STR¿Tienes problemas para iniciar sesión?EBISU_FRIENDS_BACK_STRAtrásEBISU_PROFILE_SETTINGS_BACK_STRAtrásEBISU_FRIENDS_BLOCK_STRBloquearEBISU_FRIENDS_BLOCK_USER_STR¿Bloquear a %USERNAME%?EBISU_FRIENDS_BUY_STRComprarEBISU_PROFILE_BUY_NOW_STRComprarEBISU_GMAIL_CANCEL_STRCancelarEBISU_FRIENDS_CHALLENGE_STRRetarEBISU_PROFILE_CHALLENGE_STRRetarEBISU_NEWS_CHALLENGE_STRRetarEBISU_LOGIN_CHANGE_USERNAME_STRCambiar nombre de usuarioEBISU_LOGIN_CHECKING_EMAIL_STRComprobando dirección de correo electrónicoEBISU_FRIENDS_COMMENT_STRComentarEBISU_LOGIN_COMPLETE_SETUP_STRCompletar configuraciónEBISU_LOGIN_CONFIRM_STRConfirmarEBISU_PROFILE_SETTINGS_CONFIRM_STRConfirmarEBISU_LOGIN_CONGRATULATIONS_STR¡Enhorabuena!EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_SEE_HOW_YOU_RANK_STR¡Felicidades, %USERNAME%! ¡Acabas de conseguir un tiempo récord! ¿Quieres comprobar su clasificación en Origin?EBISU_ACHIEVEMENT_CONGRATULATION_FAST_TIME_YOUR_RANKING_STR¡Enhorabuena %USERNAME%! ¡Acabas de conseguir un tiempo récord! ¿Quieres ver tu clasificación en Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_SEE_HOW_IT_RANK_STR¡Felicidades, %USERNAME%! ¡Acabas de conseguir una mejor puntuación! ¿Quieres comprobar su clasificación en Origin?EBISU_ACHIEVEMENT_CONGRATULATION_HS_YOUR_RANKING_STR¡Enhorabuena, %USERNAME%! ¡Acabas de conseguir una mejor puntuación! ¿Quieres ver tu clasificación en Origin?EBISU_FRIENDS_CONNECT_FB_STRConectar a FacebookEBISU_FRIENDS_CONNECT_GOOGLE_STRConectar con GoogleEBISU_FRIENDS_CONTACTS_STRContactosEBISU_LOGIN_CONTINUE_STRContinuarEBISU_LOGIN_CREATE_ACCOUNT_STRCrear CuentaEBISU_LOGIN_DATE_OF_BIRTH_STRFecha de NacimientoEBISU_PROFILE_SETTINGS_DATE_OF_BIRTH_STRFecha de NacimientoEBISU_FRIENDS_DELETE_STREliminarEBISU_FRIENDS_DELETING_FRIEND_STREliminando amigo...EBISU_NEWS_DISMISS_STRDescartarEBISU_PROFILE_DISPLAY_STRMostrarEBISU_PROFILE_SETTINGS_DISPLAY_NAME_STRMostrar Nombre:EBISU_GMAIL_DONE_STRHechoEBISU_PROFILE_EDIT_STREditarEBISU_NEWS_EDIT_STREditarEBISU_FRIENDS_EMAIL_STRE-Mail:EBISU_INVITE_EMAIL_STRE-mailEBISU_PROFILE_EMAIL_STRE-Mail:EBISU_LOGIN_EMAIL_STRE-mailEBISU_ERROR_EMAIL_PASSWORD_ALREADY_EXISTS_STREl correo electrónico y la contraseña ya existen.EBISU_ERROR_EMAIL_REQUIRED_STRSe necesita un correo electrónico para continuar.EBISU_FRIENDS_SEARCH_FORM_FILL_TEXT_STRE-mail, UsuarioEBISU_PROFILE_SETTINGS_EMAIL_STRE-mailEBISU_LOGIN_DUMMY_EMAIL_STRexample@domain.comEBISU_LOGIN_ENTER_EMAIL_STRIntroducir correo electrónicoEBISU_LOGIN_ENTER_PHONE_NUMBER_STR¡Introduce tu número de teléfono para recibir avisos de texto y más cosas!EBISU_LOGIN_ACCOUNT_STRIntroduce tu correo electrónico para iniciar sesión o crear una cuenta.EBISU_ERROR_ERROR_TITLE_STRErrorEBISU_GMAIL_GMAILPLACEHOLDER_STRejemplo@gmail.comEBISU_RETURN_EXIT_STRSalirEBISU_FRIEND_FACEBOOK_STRFacebookEBISU_FRIENDS_FACEBOOKFRIENDS_STRAmigos de FacebookEBISU_PROFILE_SETTINGS_FACEBOOKSETTINGS_STRAjustes de FacebookEBISU_ERROR_FAILED_TO_DELETE_FRIEND_STRNo se pudo eliminar a un amigo.EBISU_ERROR_FAILED_TO_REMOVE_NEWSFEED_STRNo se pudo eliminar la noticia.EBISU_ERROR_FAILED_TO_SEND_ACCEPTANCE_STRNo se pudo enviar la aceptación.EBISU_ERROR_FAILED_TO_SEND_DECLINE_STRNo se pudo enviar el rechazo.EBISU_PROFILE_SETTINGS_FEMALE_STRFemeninoEBISU_FRIENDS_ADD_FRIENDS_CONTACTS_STREncuentra amigos a través de contactos.EBISU_FRIENDS_ADD_FRIENDS_FACEBOOK_STREncuentra amigos y haz que te encuentren vía Facebook. EBISU_FRIENDS_ADD_FRIENDS_GMAIL_STREncuentra amigos y haz que te encuentren vía Gmail.EBISU_FRIENDS_ADD_FRIENDS_ORIGIN_STREncuentra amigos en OriginEBISU_LOGIN_WHAT_GAMES_FRIENDS_PLAYING_STR¡Descubre a qué están jugando tus amigos!EBISU_FRIENDS_FIND_FRIENDS_IN_ORIGIN_STREncuentra amigos en OriginEBISU_LOGIN_FORGOT_PASSWORD_STRContraseña olvidadaEBISU_FRIENDS_FRI_STRVieEBISU_NEWS_FRI_STRVieEBISU_NEWS_FRIEND_REQUEST_BODY_STRte ha enviado una solicitud de amistad.EBISU_NEWS_FRIEND_REQUEST_STRSolicitud de AmistadEBISU_CAT_FRIENDS_STRAmigosEBISU_NAV_FRIENDS_STRAmigosEBISU_PROFILE_FRIENDS_ONLY_STRSolo AmigosEBISU_PROFILE_SETTINGS_FRIENDS_ONLY_STRSolo AmigosEBISU_FRIENDS_FRIENDS_WHO_HAVE_STRAmigos con %GAMENAME%EBISU_FRIENDS_FRIENDS_WHO_DONT_HAVE_STRAmigos sin %GAMENAME%EBISU_FRIENDS_GENDER_STRSexo:EBISU_PROFILE_SETTINGS_GENDER_STRSexoEBISU_PROFILE_GENDER_STRSexo:EBISU_LOGIN_GET_NEWS_EXCLUSIVE_EA_STR¡Consigue noticias y ofertas exclusivas de EA!EBISU_NEWS_GET_IT_STRConsígueloEBISU_ERROR_GETTING_USER_INFO_STRConseguir tu informaciónEBISU_NEWS_GO_TO_STRIr EBISU_FRIENDS_GOOGLE_STRGoogleEBISU_FRIENDS_GOOGLEFRIENDS_STRAmigos de GoogleEBISU_NEWS_HIGH_SCORE_STRMejor PuntoEBISU_FRIENDS_HOME_STRResidenciaEBISU_PROFILE_HOME_STRResidenciaEBISU_PROFILE_SETTINGS_HOME_STRResidenciaEBISU_LOGIN_AGREE_PP_TOS_STRAcepto la Política de privacidad y las Condiciones de servicio.EBISU_PROFILE_WANT_TO_BE_SEARCHABLE_VIAQuiero que me encuentren a través de:EBISU_NEWS_IGNORE_STRIgnorarEBISU_FRIENDS_CONTACTS_IN_STREN OriginEBISU_ERROR_INCORRECT_LOGIN_INFO_STRInformación de inicio de sesión incorrecta.EBISU_FRIENDS_INVITE_STRInvitarEBISU_FRIENDS_CHOOSE_SMS_EMAIL_STRInvitar amigos a OriginEBISU_FRIENDS_SENTINVITE_STRInvitación enviadaEBISU_FRIENDS_INVITE_FRIENDS_ORIGIN_STRInvita a tus amigos a OriginEBISU_NEWS_INVITES_STRInvitacionesEBISU_LOGIN_DUMMY_REAL_NAME_STRFulanitoEBISU_FRIENDS_LAST_LOGIN_STRÚltima conexión:EBISU_FRIENDS_LAST_LOGIN_DEFAULT_STRÚltima conexión:EBISU_NEWS_LAST_UPDATE_STRÚltima actualización: %TIME%EBISU_NEWS_LASTUPDATE_NEVER_STRÚltima actualización: NuncaEBISU_NEWS_LAUNCH_STREjecutarEBISU_PROFILE_LEGEND_STRLeyendaEBISU_PROFILE_SETTINGS_LOADING_STRCargandoEBISU_LOGIN_LOGIN_STRIniciar sesiónEBISU_PROFILE_SETTINGS_LOGINTOFACEBOOK_STRIniciar sesión en FacebookEBISU_PROFILE_LOGOUT_STRCerrar sesiónEBISU_PROFILE_SETTINGS_LOGOUTTOFACEBOOK_STRCerrar sesión de FacebookEBISU_LOGIN_LOGGING_IN_STRIniciando sesión...EBISU_LOGIN_MAKE_FRIENDS_CHALLENGES_STR¡Haz nuevos amigos mediante los retos de juego!EBISU_PROFILE_SETTINGS_MALE_STRMasculinoEBISU_FRIENDS_MOBILE_STRMóvil:EBISU_PROFILE_MOBILE_STRMóvil:EBISU_PROFILE_SETTINGS_MOBILE_STRMóvilEBISU_FRIENDS_MON_STRLunEBISU_NEWS_MON_STRLunEBISU_FRIENDS_MY_FRIENDS_TAB_STRMis AmigosEBISU_PROFILE_MY_GAMES_STRMis JuegosEBISU_PROFILE_SETTINGS_MY_IMAGE_STRMi imagenEBISU_NAV_PROFILE_STRMi perfilEBISU_PROFILE_MY_WISH_LIST_STRMi lista de regalosEBISU_CAT_NEWS_STRNoticiasEBISU_NAV_NEWS_STRNoticiasEBISU_ACHIEVEMENT_NICE_JOB_STR¡Bien hecho! ¿Quieres compartir tu puntuación y retar a los jugadores de la red Origin?EBISU_ACHIEVEMENT_NICE_JOB_USER_STR¡Bien hecho, %USERNAME%! ¿Quieres compartir tu logro en la red Origin?EBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLENOTOK_STRNo, no permito que me busquen por mi nombre de Facebook.EBISU_ACHIEVEMENT_NO_STRNo, graciasEBISU_FRIENDS_CONTACTS_NOT_IN_STRNO ESTÁ EN OriginEBISU_LOGIN_OK_STRAceptarEBISU_ERROR_SOMETHING_WENT_WRONG_STR¡Vaya! Algo ha ido mal...EBISU_ERROR_AGE_LIMIT_RETRIEVAL_FAILURE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_AN_ERROR_NO_DESC_HAS_OCCURRED_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_AUTHORIZATION_CREATION_FAILURE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_AUTHORIZATION_TOKEN_VALIDATION_FAILURE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_ENCRYPTED_TOKEN_VALIDATION_FAILURE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_INVALID_DOCUMENT_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_INVALID_LANGUAGE_CODE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_LICENSE_NOT_FOUND_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_REFERENCE_NOT_FOUND_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_REGISTRATION_FAILED_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_SERVER_CORE_USER_INFO_FAILURE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_SERVER_USER_API_FAILURE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_SERVICE_FAILURE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_UNEXPECTED_DATA_FORMAT_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_UNEXPECTED_SERVER_HTTP_CODE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_USER_CREATION_FAILED_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_USER_LISTING_FAILED_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_ERROR_USER_REFERENCE_CREATION_FAILURE_STR¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.EBISU_PROFILE_OPT_IN_STRSuscribirseEBISU_PROFILE_OPT_OUT_STRCancelar SuscripciónEBISU_LOGIN_PASSWORD_STRContraseñaEBISU_PROFILE_SETTINGS_PASSWORD_STRCambiar ContraseñaEBISU_GMAIL_PASSWORD_STRContraseñaEBISU_ERROR_PASSWORD_REQUIRED_STRSe necesita una contraseña para continuar.EBISU_ERROR_PASSWORD_RESTRICTIONS_STRLa contraseña tiene que tener de 4 a 16 caracteres.EBISU_FRIENDS_PENDINGINVITES_STRInvitaciones PendientesEBISU_FRIENDS_BLOCK_CHALLENGE_VIEW_WARNING_STRLas personas que bloquees no podrán retarte ni ver tu perfil.EBISU_PROFILE_PLAY_STRJugarEBISU_FRIENDS_PLAYNOW_STR¿Jugar Ahora?EBISU_FRIENDS_PLAYING_COLON_STRJugando:EBISU_LOGIN_COMPLETE_CREATING_USERNAME_STRCrea un nombre de usuario para completar la configuración de tu cuenta Origin. ¡Usa nuestra sugerencia si quieres!EBISU_ERROR_ENTER_USERNAME_STRIntroduce un nombre de usuario para continuar. EBISU_ERROR_ENTER_VALID_EMAIL_STRIntroduce una dirección de correo electrónico válida para continuar.EBISU_GMAIL_ENTERGMAILDATA_STRIntroduce tu nombre de usuario de Gmail y la contraseña.EBISU_ERROR_USER_NOT_LOGGED_IN_STRInicia sesión.EBISU_ERROR_REENTER_INFO_STRVuelve a introducir tu información para continuar.EBISU_ERROR_REENTER_INFO_CONTINUE_STRVuelve a introducir tu información para continuar.EBISU_ERROR_TERMS_OF_SERVICE_IS_REQUIRED_STRRevisa y acepta las Condiciones del servicio.EBISU_ERROR_SIGN_IN_STRInicia sesiónEBISU_ERROR_SIGN_IN_TO_CONTINUE_STRInicia sesión para continuar.EBISU_PROFILE_PRIVACY_POLICY_STRPolítica de PrivacidadEBISU_PROFILE_PRIVATE_STRPrivadoEBISU_PROFILE_SETTINGS_PRIVATE_STRPrivadoEBISU_CAT_PROFILE_STRPerfilEBISU_FRIENDS_PROFILE_STRPerfilEBISU_NEWS_PROFILE_STRPerfilEBISU_PROFILE_SETTINGS_TAB_STRConfiguración de PerfilEBISU_PROFILE_PROFILE_PRIVACY_STRPerfil/Ajustes de PrivacidadEBISU_PROFILE_PUBLIC_STRPúblicoEBISU_PROFILE_SETTINGS_PUBLIC_STRPúblicoEBISU_NEWS_PULLDOWN_TO_UPDATE_STRTira hacia abajo para actualizar...EBISU_PROFILE_REAL_NAME_STRNombre:EBISU_FRIENDS_REAL_NAME_STRNombre:EBISU_PROFILE_SETTINGS_REAL_NAME_STRNombreEBISU_LOGIN_RECOVER_MY_PASSWORD_STRRecuperar mi contraseñaEBISU_LOGIN_REGISTER_NEW_USER_STRRegistrar un nuevo usuario.EBISU_LOGIN_REGISTERING_NEW_USER_STRRegistrando un nuevo usuario...EBISU_NEWS_REJECT_STRRechazarEBISU_NEWS_RELEASE_TO_UPDATE_STRSuelta para actualizar...EBISU_FRIENDS_BLOCKING_A_USER_STRRecuerda, si bloqueas a alguien impedirás que esta persona contacte contigo en Origin.EBISU_NEWS_REMOVE_STREliminarEBISU_FRIENDS_REMOVE_FRIEND_STREliminar AmigoEBISU_FRIENDS_REPORT_STRInformeEBISU_FRIENDS_REPORT_USER_STRInformar sobre %USERNAME%EBISU_FRIENDS_REPORT_BLOCK_STRInformar/BloquearEBISU_NEWS_REPORT_BLOCK_STRInformar/BloquearEBISU_ERROR_RESULTS_LOADING_STRCargando resultados...EBISU_ERROR_RETRIEVING_STRRecuperandoEBISU_RETURN_RETURN_TO_GAME_STRVolver al juegoEBISU_FRIENDS_SAT_STRSábEBISU_NEWS_SAT_STRSábEBISU_PROFILE_SETTINGS_SAVE_STRGuardarEBISU_PROFILE_SETTINGS_SAVING_STRGuardandoEBISU_FRIENDS_SEARCH_STRBuscarEBISU_ERROR_SEARCH_RESTRICTION_THREE_CHAR_STRLas entradas de búsqueda deben tener al menos 3 caracteres.EBISU_ERROR_SEARCH_STRING_RESTRICTIONS_STRLas entradas de búsqueda deben tener al menos 3 caracteres.EBISU_ERROR_SEARCH_STRING_TOO_SHORT_STRLas entradas de búsqueda deben tener al menos 3 caracteres.EBISU_ERROR_SEARCH_ON_THESE_NETWORKS_STRBusca en estas redes.EBISU_SEARCH_OPTIONS_STROpciones de BúsquedaEBISU_FRIENDS_SEARCH_ORIGIN_STRBuscar en OriginEBISU_FRIENDS_SEARCH_RESULTS_STRResultados de la BúsquedaEBISU_FRIENDS_SEARCHRESULTS_STRResultados de la BúsquedaEBISU_FRIENDS_SEARCH_RESULTS_CONTACTS_STRResultados de la búsqueda en ContactosEBISU_FRIENDS_SEARCH_RESULTS_FACEBOOK_STRResultados de la búsqueda en FacebookEBISU_FRIENDS_SEARCH_RESULTS_GOOGLE_STRResultados de la búsqueda en GoogleEBISU_FRIENDS_SEARCH_RESULTS_ORIGIN_STRResultados de la búsqueda en OriginEBISU_FRIENDS_SEARCHING_STRBuscandoEBISU_FRIENDS_SENDING_FRIEND_REQUEST_STREnviando tu solicitud de amistad...EBISU_LOGIN_SETUP_ACCOUNT_STRConfigurar CuentaEBISU_PROFILE_SETTINGS_EDIT_STRConfigEBISU_PROFILE_SETTINGS_SEARCHABLENOTOK_STRNo quiero que me puedan buscar por correo electrónico.EBISU_PROFILE_SETTINGS_NEWPASSWORD_STRNueva ContraseñaEBISU_LOGIN_SETTING_UP_ACCOUNT_STRConfigurando cuenta...EBISU_NEWS_SHARE_STRCompartirEBISU_PROFILE_SHOW_LESS_STRMenos InformaciónEBISU_PROFILE_SHOW_MORE_STRMás InformaciónEBISU_LOGIN_SIGN_IN_ORIGIN_PASSWORD_STRIniciar sesión en OriginEBISU_LOGIN_SIGN_IN_ORIGIN_STRIniciar sesión en OriginEBISU_ERROR_SIGN_IN_REQUIRED_MESSAGE_STRInicio de sesión necesarioEBISU_LOGIN_SIGN_UP_BUTTON_STR¡Registrarse!EBISU_FRIENDS_SMS_STRSMSEBISU_ERROR_GAMERTAG_ALREADY_TAKEN_STRLo sentimos, %USERNAME% ya existe en Origin. Usa nuestra sugerencia o crea otro nombre de usuario.EBISU_ERROR_UNEXPECTED_ERROR_STRLo sentimos, ha ocurrido un error inesperado. Vuelve a intentarlo.EBISU_ERROR_TERRITORY_REST_NOT_ELIGIBLE_STRLo sentimos, debido a restricciones de territorio, no puedes unirte a Origin en estos momentos.EBISU_LOGIN_NO_ACCOUNT_EXISTIS_FOR_STRLo sentimos, no existe ninguna cuenta deEBISU_ERROR_NO_RESULTS_FOUND_STRLo sentimos, no se encontraron resultados. Vuelve a intentarlo.EBISU_ERROR_CANNOT_ACCESS_ORIGIN_THIS_TIME_STRLo sentimos, en estos momentos no puedes acceder a Origin.EBISU_ERROR_LOGIN_FAILED_STRLo sentimos, error en el inicio de sesión en Origin.EBISU_ERROR_SERVER_DOWN_STRLo sentimos, nuestros servidores no están disponibles. Inténtalo más tarde.EBISU_ERROR_ID_ALREADY_TAKEN_STRLo sentimos, ese nombre de usuario ya se ha utilizado. Prueba con otro.EBISU_ERROR_DATE_OF_BIRTH_INVALID_STRLo sentimos, la fecha de nacimiento introducida no es válida.EBISU_ERROR_DUPLICATE_PASSWORDS_AND_COMBOS_STRLo sentimos, el correo electrónico y la contraseña no pueden ser los mismos. Vuelve a intentarlo.EBISU_ERROR_PASSWORD_DO_NOT_MATCH_STRLo sentimos, las contraseñas introducidas no coinciden.EBISU_ERROR_PROB_COMMUNICATIONG_PASSWORD_SERVICE_STRLo sentimos, se ha producido un problema en la comunicación. Inténtalo más tarde.EBISU_ERROR_EMAIL_ADRESS_INVALID_STRLo sentimos, esta dirección de correo electrónico no es válida.EBISU_ERROR_EMAIL_FORMAT_INVALID_STRLo sentimos, el formato de correo electrónico no es válido. Vuelve a intentarlo.EBISU_ERROR_USER_NOT_FOUND_STRLo sentimos, no se ha encontrado este nombre de usuario.EBISU_ERROR_DIDNT_RECEIVE_INFO_STRLo sentimos, no hemos recibido tu información. Vuelve a intentarlo.EBISU_ERROR_NOT_ELIGIBLE_TO_JOIN_STRLo sentimos, no puedes unirte a Origin en estos momentos.EBISU_ERROR_PASSWORD_CONTAIN_SPACES_STRLo sentimos, tu contraseña no puede contener espacios. Vuelve a intentarlo.EBISU_FRIENDS_SUN_STRDomEBISU_NEWS_SUN_STRDomEBISU_PROFILE_TOS_STRCondiciones del ServicioEBISU_ERROR_Origin_NET_NOT_REACHED_STRNo se ha podido conectar con la red Origin. Comprueba tu conexión de red y vuelve a intentarlo.EBISU_ERROR_EMAIL_ALREADY_EXISTS_STREste correo electrónico ya existe en Origin.EBISU_ERROR_INVALID_EMAIL_FORMAT_STREl formato de correo electrónico no es válido.EBISU_ERROR_EMAIL_NOT_REGISTERED_STREste correo electrónico no está registrado en Origin.EBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_STREsto puede llevar un momento...EBISU_ERROR_USERNAME_ALREASY_EXISTS_STREste nombre de usuario ya existe en Origin.EBISU_FRIENDS_THUR_STRJueEBISU_NEWS_THUR_STRJueEBISU_ERROR_DOMAIN_INVALID_STRIntroduce una dirección de correo electrónico válida para continuar.EBISU_LOGIN_ENTER_EMAIL_ADRESS_LINKED_STRIntroduce la dirección de correo electrónico asociada a tu cuenta para restablecer tu contraseña.EBISU_FRIENDS_TODAY_STRHoyEBISU_NEWS_TODAY_STRHoyEBISU_LOGIN_TRY_STRIntentarEBISU_FRIENDS_TUE_STRMarEBISU_NEWS_TUE_STRMarEBISU_LOGIN_SOMETHING_WENT_WRONG_STR¡Oh, oh! Algo ha ido mal...EBISU_NEWS_UPDATES_STRActualizacionesEBISU_ERROR_UPDATING_CHANGES_STRActualizando...EBISU_LOGIN_USER_REGISTERED_STR¡Usuario registrado!EBISU_PROFILE_USERNAME_STRNombre de usuarioEBISU_LOGIN_USERNAME_STRNombre de usuarioEBISU_PROFILE_SETTINGS_USERNAME_STRNombre de usuarioEBISU_GMAIL_USERNAME_STRNombre de usuarioEBISU_ERROR_USERNAME_PASSWORD_REQUIRED_STRSe necesitan un nombre de usuario y una contraseña para continuar.EBISU_ERROR_USERNAME_PASSWORD_RESTRICTIONS_STREl nombre de usuario y la contraseña tienen que tener 4-12 caracteres de longitud.EBISU_ERROR_USERNAME_REQUIRED_STRSe necesita un nombre de usuario para continuar.EBISU_ERROR_USERNAME_RESTRICTIONS_STREl nombre de usuario tiene que tener de 4 a 12 caracteres.EBISU_ERROR_USERNAME_NOT_AVAILABLE_STREl nombre de usuario no está disponible.EBISU_ACHIEVEMENT_WAY_TO_GO_STR¡Así se hace! ¿Quieres compartir tu puntuación y retar a los jugadores de la red Origin?EBISU_ACHIEVEMENT_WAY_TO_GO_USER_STR¡Así se hace, %USERNAME%! ¿Quieres compartir tu tiempo en la red Origin?EBISU_ERROR_SEARCH_FAILED_STRNo hemos encontrado ningún resultado de búsqueda coincidente.EBISU_FRIENDS_WED_STRMiéEBISU_NEWS_WED_STRMiéEBISU_NAV_WELCOME_STRBienvenidoEBISU_LOGIN_WELCOME_BACK_STR¡Hola de nuevo!EBISU_ACHIEVEMENT_WELL_DONE_STR¡Muy bien! ¿Quieres compartir tu puntuación y retar a los jugadores de la red Origin?EBISU_ACHIEVEMENT_WELL_DONE_USER_STR¡Muy bien, %USERNAME%! ¿Quieres retar a otros jugadores de %GAMENAME% en la red Origin?EBISU_LOGIN_WHAT_WOULD_YOU_LIKE_STR¿Qué quieres hacer?EBISU_LOGIN_WHY_JOIN_STR¿Por qué debería unirme a Origin?EBISU_ACHIEVEMENT_YES_STREBISU_PROFILE_SETTINGS_FACEBOOKSEARCHABLEOK_STRSí, permitir a los miembros que me busquen por mi nombre de Facebook.EBISU_FRIENDS_YESTERDAY_STRAyerEBISU_NEWS_YESTERDAY_STRAyerEBISU_ERROR_MUST_AGREE_TOS_AND_PP_STRTienes que aceptar las Condiciones del Servicio y la Política de Privacidad para continuar.EBISU_ACHIEVEMENT_DOING_GREAT_STR¡Lo estás haciendo estupendamente! ¿Quieres compartir tu mejor puntuación y retar a los jugadores de la red Origin?EBISU_FRIENDS_WOUT_GAME_CHALLENGE_IN_APP_MSG_STR¡Te han retado! ¡%USERNAME% quiere jugar a %GAMENAME% contigo! ¿Quieres aceptar el reto? Consigue %GAMENAME% ahora.EBISU_FRIENDS_W_GAME_CHALLENGE_IN_APP_MSG_STR¡Te han retado! ¡%USERNAME% quiere jugar a %GAMENAME% contigo! EBISU_ERROR_CONN_TIMED_OUT_STRSe ha agotado el tiempo de espera de tu conexión. Vuelve a iniciar sesión en Origin.EBISU_ERROR_EMAIL_PASSWORD_NOT_MATCH_STRTu dirección de correo y la contraseña no coinciden. Vuelve a intentarlo.EBISU_LOGIN_NEW_PASSWORD_SENT_STRSe ha enviado un correo electrónico aEBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_STRTu cuenta de Origin se ha creado con éxito y has iniciado sesión. ¡Ponte en marcha y conecta con tus amigos!EBISU_ERROR_SEARCH_NO_RESULTS_STRTu búsqueda no obtuvo resultados. EBISU_LOGIN_DUMMY_DATE_OF_BIRTH_STRdd-mm-aaaaEBISU_ERROR_EMAIL_TOO_LONG_STRLa dirección de correo electrónico es demasiado larga.EBISU_ERROR_NO_ID_LINKED_TO_ACCOUNT_STREsta cuenta de Origin ya no existe.EBISU_FRIENDS_DEVICE_LOW_ON_MEMORY_STRTu dispositivo se está quedando sin memoria. Para que Origin se ejecute sin interrupciones, recomendamos que elimines las aplicaciones que no estés usando.EBISU_FRIENDS_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRLo sentimos, en estos momentos tu dispositivo no puede enviar mensajes de texto.EBISU_FRIENDS_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRLo sentimos, en estos momentos no hay ninguna cuenta de correo electrónico configurada en tu dispositivo.EBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_STR¿Seguro que quieres cambiar tu contraseña? Necesitarás utilizarla siempre que inicies sesión en Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_STRJugadorEBISU_STRING_TODAY_WITH_DATE_STRHoy %DATE%EBISU_STRING_ONE_DAY_AGO_STRHace 1 díaEBISU_STRING_DAYS_AGO_STRHace %DAYS% díasEBISU_STRING_ONE_WEEK_AGO_STRHace 1 semanaEBISU_STRING_WEEKS_AGO_STRHace %WEEKS% semanasEBISU_STRING_ONE_MONTH_AGO_STRHace un mesEBISU_STRING_FACEBOOK_TOS_STRAl iniciar sesión en Facebook, consiento que me busquen por mi nombre de Facebook.EBISU_STRING_GMAIL_AUTH_FAILED_STREl nombre de usuario o la contraseña que has introducido es incorrecta.EBISU_STRING_ORIGIN_ACCOUNT_CREATED_AND_LOGGEDIN_STR¡Has creado con éxito una cuenta en Origin! Ahora busca y añade a los amigos que quieras retar. [BUTTON] AceptarEBISU_STRING_PRIVACY_CAPS_COLON_STRPRIVACIDAD:EBISU_STRING_JOIN_EBISU_STR¡Únete a Origin!EBISU_STRING_WELCOME_BACK_USER_STR¡Hola otra vez %USERNAME%!EBISU_FRIENDS_PENDING_STRPendienteEBISU_ERROR_THIS_MAY_TAKE_A_MOMENT_2_STREsta operación puede tardar un tiempo.EBISU_FRIENDS_LAUNCH_MANUALLY_STRLo sentimos, tienes que ejecutar %GAMENAME% de forma manual. Si lo has eliminado, puedes volverlo a descargar.EBISU_STRING_DEVICE_DOESNT_SUPPORT_TEXT_MSG_STRLo sentimos, en estos momentos tu dispositivo no puede enviar mensajes de texto.EBISU_LOGIN_ACCOUNT_SUCCESFULLY_CREATED_2_STR¡Has creado con éxito una cuenta en Origin! Ahora busca y añade a los amigos que quieras retar. [BUTTON] ACEPTAREBISU_FRIENDS_GO_STRIrEBISU_STRING_EMAIL_ACCOUNT_NOT_SETUP_ON_DEVICE_STRLo sentimos, en estos momentos no hay ninguna cuenta de correo electrónico configurada en tu dispositivo.EBISU_ERROR_CONN_TIMED_OUT_2_STRSe ha agotado el tiempo de espera de tu conexión. Vuelve a intentarlo o selecciona Aceptar para cambiar tu configuración de red. [BUTTON] REINTENTAR [BUTTON] ACEPTAREBISU_FRIENDS_CONFIRM_CHANGE_PASSWORD_2_STR¿Seguro que quieres cambiar tu contraseña? Necesitarás utilizarla siempre que inicies sesión en Origin. [OK] [CANCEL]EBISU_FRIENDS_PLAYER_2_STRJugadorEBISU_STRING_MONTHS_AGO_STRHace %MONTHS% mesesEBISU_LOGIN_USE_SUGGESTION_OR_CHOOSE_OWN_STRUsa nuestra sugerencia o elige el tuyo.EBISU_LOGIN_MOBILE_STRTeléfono móvilEBISU_LOGIN_TOS_AGREE_LABEL_STR@html@@head@@style@body{font: 11px \"Arial\", sans-serif;color: #666666;}@/style@@/head@@body@Acepto la @a href=\"http://privacy\"@Política de confidencialidad@/a@ y los @a href=\"http://tos\"@Términos de servicio@/a@ de EA@/p@@/body@@/html@EBISU_ERROR_REGISTRATION_MISSING_MULTIPLE_ITEMS_STRAsegúrate de introducir información completa y precisa.EBISU_FRIENDS_NO_FRIENDS_TITLE_STR¡Añade Ahora a Tus Amigos!EBISU_FRIENDS_NO_FRIENDS_DESCRIPTION_STRComparte marcas, reta a amigos, descubre juegosEBISU_STRING_ADD_FRIENDS_GMAIL_STRBusca en tus contactos para encontrar amigos.EBISU_STRING_AGREE_TO_BE_SEARCHABLE_STRAl registrarme, acepto que puedan buscarme por correo electrónico y la publicación automática de mis eventos de juego. Puedo cambiar estas opciones en los ajustes de perfil.EBISU_PROFILE_POST_PRIVACY_HIGH_SCORES_STRMejores PuntuacionesEBISU_PROFILE_POST_PRIVACY_ACHIEVEMENTS_STRLogros Dentro del JuegoEBISU_PROFILE_POST_PRIVACY_DESCRIPTION_STRCompartir Con Tus AmigosEBISU_PROFILE_SETTINGS_NEWSSETTINGS_STRAjustes de NoticiasEBISU_LOGIN_AGE_STREdadEBISU_PROFILE_ABOUT_STRAcuerdo de Licencia de Usuario Final EBISU_LOGO_LOGO_INSTRUCTIONS_STRToca el logotipo de Origin para volver a tu juego. Vuelve a tocarlo para cambiar de vista.EBISU_NEWS_NO_INVITES_STRNo tienes invitaciones nuevas. ¡Sigue visitándonos!EBISU_NEWS_NO_INVITES_DESCRIPTION_STREcha un vistazo todos los días para ver las invitaciones de amigos y los retosEBISU_PROFILE_INFO_STRInformaciónEBISU_LOGIN_TRY_AGAIN_STRInténtalo de nuevoEBISU_ERROR_ENTER_VALID_AGE_STRIntroduce una edad válida.EBISU_LOGIN_AUTO_LOGGING_IN_STRInicio de sesión automático...EBISU_STRING_JOIN_EBISU_TITLE_STRCreo que Origin se sale. Tú opinarás igual. ¡Únete y podremos ser amigos!EBISU_LOGIN_NEW_PASSWORD_SENT_PART_2_STRcon instrucciones sobre cómo restablecer tu contraseña.EBISU_ERROR_PASSWORD_INVALID_STRContraseña no válida.EBISU_ERROR_TOS_TOO_LONG_STRLas Condiciones del Servicio son demasiado largas.EBISU_STRING_START_NOW_STRBuscar AmigosEBISU_LOGO_PLAYER_STRJugadorEBISU_ERROR_FACEBOOK_ACCOUNT_ALREADY_MAPPED_STRUtiliza tu cuenta principal de Origin para editar tu configuración de Facebook.EBISU_PROFILE_SETTINGS_SETPROFILETOPUBLIC_STRHaz tu perfil público para que tus amigos puedan verlo.EBISU_FRIEND_REMOVE_CONFIRMATION_STR¿Estás seguro?EBISU_FRIEND_REMOVE_CONFIRMATION_DESCRIPTION_STRSe eliminará a %USERNAME% de tu lista de amigos. Siempre puedes volver a agregarlo posteriormente.EBISU_FRIEND_IGNORING_CHALLENGE_STRDescartando reto...EBISU_FRIEND_ACCEPTING_REQUEST_STRAceptando solicitud de amigo...EBISU_FRIEND_DECLINING_REQUEST_STRRechazando solicitud de amigo...EBISU_FRIEND_SENDING_BLOCK_STRSolicitud enviadaEBISU_FRIEND_SENDING_REPORT_STRSolicitud enviadaEBISU_LOGIN_RECEIVE_EA_UPDATE_STRQuiero recibir información y noticias de EA.EBISU_ERROR_YOU_DO_NOT_MEET_AGE_REQ_STRLo sentimos, no cumples los requisitos para suscribirte.EBISU_PROFILE_ERROR_FACEBOOK_STRPor favor, inicia sesión en Facebook.EBISU_PROFILE_ERROR_FACEBOOK_ALREADY_TIED_STRSelecciona una de las configuraciones disponibles antes de guardar...EBISU_ERROR_USERNAME_NOT_ALLOWED_STREl nombre de usuario no está permitido. Elige uno diferente o el que te sugerimos.EBISU_PROFILE_SETTINGS_SEACHABLEOK_STRPermitir que amigos me busquen a través del correo electrónico.EBISU_EMAIL_INVITE_SUBJECT_STRInvitación a unirse a OriginEBISU_ERROR_LOG_INTO_FACEBOOK_STRInicia sesión en FacebookEBISU_PROFILE_POST_PRIVACY_GAMES_PLAYED_STRPartidas jugadasEBISU_LOGO_MESSAGE_EA_PASSWORD_REMINDER_STR¿Ya tienes una cuenta EA? Introduce tu contraseña debajo.EBISU_ERROR_REAL_NAME_TOO_LONGLa entrada del Nombre Real es demasiado larga.EBISU_ERROR_REAL_NAME_INVALID_CHARACTERSUsa caracteres alfanuméricos para el Nombre Real.EBISU_ERROR_TOO_MANY_ATTEMPTSHas intentado acceder a Origin demasiadas veces. Espera antes de volver a intentarlo.EBISU_SENDING_REQUEST_STREnviar solicitudEBISU_FRIENDS_SENT_REQUEST_TITLE_STRSolicitud enviadaEBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_YES_STREBISU_FRIEND_CONTINUE_TO_ADD_FRIEND_NO_STRNOEBISU_FRIEND_PERMISSION_CONTACTS_TITLE_STR¿Quieres buscar a los amigos que tienes en tu lista de Contactos?EBISU_FRIEND_PERMISSION_CONTACTS_STRPara encontrarlos, necesitamos compartir tus contactos de forma temporal con nuestros servidores para comparar tu lista con la de los usuarios de Origin. Posteriormente, no conservaremos estos datos. \ No newline at end of file diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_de_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_de_.png new file mode 100644 index 0000000..5c7ab8f Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_de_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_en_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_en_.png new file mode 100644 index 0000000..47b5c04 Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_en_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_es_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_es_.png new file mode 100644 index 0000000..acf55d7 Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_es_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_fr_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_fr_.png new file mode 100644 index 0000000..18d5e71 Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_fr_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_it_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_it_.png new file mode 100644 index 0000000..c91b651 Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_it_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_ja_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_ja_.png new file mode 100644 index 0000000..63632a3 Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_ja_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_ko_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_ko_.png new file mode 100644 index 0000000..aa61094 Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_ko_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_nl_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_nl_.png new file mode 100644 index 0000000..c8c9808 Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_nl_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_pt_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_pt_.png new file mode 100644 index 0000000..7a9d931 Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_pt_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_ru_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_ru_.png new file mode 100644 index 0000000..22db7be Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_ru_.png differ diff --git a/app/src/main/assets/EASP/OriginBanner/OriginBanner_zh_.png b/app/src/main/assets/EASP/OriginBanner/OriginBanner_zh_.png new file mode 100644 index 0000000..d57d4e0 Binary files /dev/null and b/app/src/main/assets/EASP/OriginBanner/OriginBanner_zh_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_de_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_de_.png new file mode 100644 index 0000000..9480881 Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_de_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_en_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_en_.png new file mode 100644 index 0000000..7f4544f Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_en_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_es_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_es_.png new file mode 100644 index 0000000..dfaae57 Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_es_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_fr_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_fr_.png new file mode 100644 index 0000000..a8bf37b Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_fr_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_it_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_it_.png new file mode 100644 index 0000000..2e0ae3f Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_it_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_ja_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_ja_.png new file mode 100644 index 0000000..7738731 Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_ja_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_ko_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_ko_.png new file mode 100644 index 0000000..6c2bcc3 Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_ko_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_nl_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_nl_.png new file mode 100644 index 0000000..d51168b Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_nl_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_pt_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_pt_.png new file mode 100644 index 0000000..38461e5 Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_pt_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_ru_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_ru_.png new file mode 100644 index 0000000..69d9fbe Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_ru_.png differ diff --git a/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_zh_.png b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_zh_.png new file mode 100644 index 0000000..9677ba6 Binary files /dev/null and b/app/src/main/assets/EASP/OriginLoginBanner/OriginLoginBanner_zh_.png differ diff --git a/app/src/main/assets/EASP/Social/Facebook/DigiCertHighAssuranceCA-3.crt b/app/src/main/assets/EASP/Social/Facebook/DigiCertHighAssuranceCA-3.crt new file mode 100644 index 0000000..c1b7a5e Binary files /dev/null and b/app/src/main/assets/EASP/Social/Facebook/DigiCertHighAssuranceCA-3.crt differ diff --git a/app/src/main/assets/EASP/Social/Facebook/DigiCertHighAssuranceEVRootCA.crt b/app/src/main/assets/EASP/Social/Facebook/DigiCertHighAssuranceEVRootCA.crt new file mode 100644 index 0000000..dae0196 Binary files /dev/null and b/app/src/main/assets/EASP/Social/Facebook/DigiCertHighAssuranceEVRootCA.crt differ diff --git a/app/src/main/assets/EASP/Social/Facebook/GTE_CyberTrust_Global_Root.crt b/app/src/main/assets/EASP/Social/Facebook/GTE_CyberTrust_Global_Root.crt new file mode 100644 index 0000000..e37fa29 Binary files /dev/null and b/app/src/main/assets/EASP/Social/Facebook/GTE_CyberTrust_Global_Root.crt differ diff --git a/app/src/main/assets/EASP/Social/Facebook/facebook-DigiCertHighAssuranceCA-3.crt b/app/src/main/assets/EASP/Social/Facebook/facebook-DigiCertHighAssuranceCA-3.crt new file mode 100644 index 0000000..edbf940 --- /dev/null +++ b/app/src/main/assets/EASP/Social/Facebook/facebook-DigiCertHighAssuranceCA-3.crt @@ -0,0 +1,36 @@ +-----BEGIN CERTIFICATE----- +MIIGWDCCBUCgAwIBAgIQCl8RTQNbF5EX0u/UA4w/OzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA4MDQwMjEyMDAwMFoXDTIyMDQwMzAwMDAwMFowZjEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTElMCMGA1UEAxMcRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +Q0EtMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9hCikQH17+NDdR +CPge+yLtYb4LDXBMUGMmdRW5QYiXtvCgFbsIYOBC6AUpEIc2iihlqO8xB3RtNpcv +KEZmBMcqeSZ6mdWOw21PoF6tvD2Rwll7XjZswFPPAAgyPhBkWBATaccM7pxCUQD5 +BUTuJM56H+2MEb0SqPMV9Bx6MWkBG6fmXcCabH4JnudSREoQOiPkm7YDr6ictFuf +1EutkozOtREqqjcYjbTCuNhcBoz4/yO9NV7UfD5+gw6RlgWYw7If48hl66l7XaAs +zPw82W3tzPpLQ4zJ1LilYRyyQLYoEt+5+F/+07LJ7z20Hkt8HEyZNp496+ynaF4d +32duXvsCAwEAAaOCAvowggL2MA4GA1UdDwEB/wQEAwIBhjCCAcYGA1UdIASCAb0w +ggG5MIIBtQYLYIZIAYb9bAEDAAIwggGkMDoGCCsGAQUFBwIBFi5odHRwOi8vd3d3 +LmRpZ2ljZXJ0LmNvbS9zc2wtY3BzLXJlcG9zaXRvcnkuaHRtMIIBZAYIKwYBBQUH +AgIwggFWHoIBUgBBAG4AeQAgAHUAcwBlACAAbwBmACAAdABoAGkAcwAgAEMAZQBy +AHQAaQBmAGkAYwBhAHQAZQAgAGMAbwBuAHMAdABpAHQAdQB0AGUAcwAgAGEAYwBj +AGUAcAB0AGEAbgBjAGUAIABvAGYAIAB0AGgAZQAgAEQAaQBnAGkAQwBlAHIAdAAg +AEMAUAAvAEMAUABTACAAYQBuAGQAIAB0AGgAZQAgAFIAZQBsAHkAaQBuAGcAIABQ +AGEAcgB0AHkAIABBAGcAcgBlAGUAbQBlAG4AdAAgAHcAaABpAGMAaAAgAGwAaQBt +AGkAdAAgAGwAaQBhAGIAaQBsAGkAdAB5ACAAYQBuAGQAIABhAHIAZQAgAGkAbgBj +AG8AcgBwAG8AcgBhAHQAZQBkACAAaABlAHIAZQBpAG4AIABiAHkAIAByAGUAZgBl +AHIAZQBuAGMAZQAuMBIGA1UdEwEB/wQIMAYBAf8CAQAwNAYIKwYBBQUHAQEEKDAm +MCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wgY8GA1UdHwSB +hzCBhDBAoD6gPIY6aHR0cDovL2NybDMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0SGln +aEFzc3VyYW5jZUVWUm9vdENBLmNybDBAoD6gPIY6aHR0cDovL2NybDQuZGlnaWNl +cnQuY29tL0RpZ2lDZXJ0SGlnaEFzc3VyYW5jZUVWUm9vdENBLmNybDAfBgNVHSME +GDAWgBSxPsNpA/i/RwHUmCYaCALvY2QrwzAdBgNVHQ4EFgQUUOpzidsp+xCPnuUB +INTeeZlIg/cwDQYJKoZIhvcNAQEFBQADggEBAB7ipUiebNtTOA/vphoqrOIDQ+2a +vD6OdRvw/S4iWawTwGHi5/rpmc2HCXVUKL9GYNy+USyS8xuRfDEIcOI3ucFbqL2j +CwD7GhX9A61YasXHJJlIR0YxHpLvtF9ONMeQvzHB+LGEhtCcAarfilYGzjrpDq6X +dF3XcZpCdF/ejUN83ulV7WkAywXgemFhM9EZTfkI7qA5xSU1tyvED7Ld8aW3DiTE +JiiNeXf1L/BXunwH1OH8zVowV36GEEfdMR/X/KLCvzB8XSSq6PmuX2p0ws5rs0bY +Ib4p1I5eFdZCSucyb6Sxa1GDWL4/bcf72gMhy2oWGU4K8K2Eyl2Us1p292E= +-----END CERTIFICATE----- diff --git a/app/src/main/assets/EASP/Social/Facebook/facebook-DigiCertHighAssuranceEVRootCA.crt b/app/src/main/assets/EASP/Social/Facebook/facebook-DigiCertHighAssuranceEVRootCA.crt new file mode 100644 index 0000000..9e6810a --- /dev/null +++ b/app/src/main/assets/EASP/Social/Facebook/facebook-DigiCertHighAssuranceEVRootCA.crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm ++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW +PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM +xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB +Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 +hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg +EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA +FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec +nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z +eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF +hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 +Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep ++OkuE6N36B9K +-----END CERTIFICATE----- diff --git a/app/src/main/assets/EASP/Social/defaultUserPicture.png b/app/src/main/assets/EASP/Social/defaultUserPicture.png new file mode 100644 index 0000000..13eab5c Binary files /dev/null and b/app/src/main/assets/EASP/Social/defaultUserPicture.png differ diff --git a/app/src/main/assets/EASP/Social/defaultUserPictureBig.png b/app/src/main/assets/EASP/Social/defaultUserPictureBig.png new file mode 100644 index 0000000..13eab5c Binary files /dev/null and b/app/src/main/assets/EASP/Social/defaultUserPictureBig.png differ diff --git a/app/src/main/assets/EASP/Social/defaultUserPictureSmall.png b/app/src/main/assets/EASP/Social/defaultUserPictureSmall.png new file mode 100644 index 0000000..13eab5c Binary files /dev/null and b/app/src/main/assets/EASP/Social/defaultUserPictureSmall.png differ diff --git a/app/src/main/assets/EASP/Social/defaultUserPictureSquare.png b/app/src/main/assets/EASP/Social/defaultUserPictureSquare.png new file mode 100644 index 0000000..13eab5c Binary files /dev/null and b/app/src/main/assets/EASP/Social/defaultUserPictureSquare.png differ diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_de.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_de.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_de.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_en.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_en.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_en.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_es.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_es.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_es.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_fr.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_fr.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_fr.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_it.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_it.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_it.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_ja.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_ja.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_ja.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_ko.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_ko.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_ko.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_nl.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_nl.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_nl.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_pt.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_pt.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_pt.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_ru.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_ru.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_ru.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_zh.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_zh.html new file mode 100644 index 0000000..22ab488 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Amazon/help_android_zh.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Amazon Account. If you have any billing disputes or questions, please contact Amazon.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Amazon Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_de.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_de.html new file mode 100644 index 0000000..62528e8 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_de.html @@ -0,0 +1 @@ +
HILFE


F: Wie werden Dinge abgerechnet, die ich im Spiel kaufe (In-App-Kaufabwicklung / Microtransaction)?
A: Die Abrechnung erfolgt auf die gleiche Weise wie bei anderen Kaufen auf deinem Android-Gerat uber dein Google-Konto. Bei Fragen oder Widerspruchen zu deinen Abrechnungen kontaktiere bitte Google.

F: Ich habe im Spiel etwas gekauft, kann es aber nicht sehen. Was kann ich tun?
A: Es kann sein, dass du das Spiel verlassen und neu starten musst, um Zugriff auf neue Inhalte zu erhalten. Wenn auch das nicht funktioniert, solltest du versuchen, dein Gerat auszuschalten und neu zu starten. Du kannst jederzeit nachsehen, was du gekauft hast, indem du das Portal des Spiels aufrufst (bei Sims 3 wahlst du beispielsweise im Hauptmenu des Spiels "Sims Store" und dann links unten im Bild "Meine Objekte").

F: Wenn ich einen Inhalt auf meinem Gerat kaufe, kann ich diesen dann auch auf einem anderen Gerat nutzen?
A: Ja, solange beide Gerate dasselbe Google-Konto nutzen. Du kannst jederzeit nachsehen, was du gekauft hast, indem du links unten im Bild den Ordner "Meine Objekte" auswahlst.

F: Meine Frage wurde hier nicht beantwortet. Was kann ich tun?
A: Du kannst den FAQ-Abschnitt unter http://www.google.com/support/androidmarket/ aufrufen und Google bezuglich Problemen bei Abrechnungen kontaktieren. Alternativ kannst du auch http://help.ea.com/de/ aufrufen und uns schreiben. Wenn du uns kontaktierst, gib bitte so viele und so genaue Informationen wie moglich an, damit wir dir besser helfen konnen.

F: Wie sehen eure Datenschutzrichtlinien aus?
A: Die EA Datenschutzrichtlinien findest du unter
http://tos.ea.com/legalapp/WEBPRIVACY/US/de/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_en.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_en.html new file mode 100644 index 0000000..f1d0818 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_en.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Google Account. If you have any billing disputes or questions, please contact Google.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Google Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit the FAQ sections at http://support.google.com/androidmarket/?hl=en and contact Google for any billing issues, or visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_es.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_es.html new file mode 100644 index 0000000..231e03c --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_es.html @@ -0,0 +1 @@ +
AYUDA


P.: ¿Cómo se me cobra algo que compre dentro del juego (Comercio en el App/microtransacción)?
R.: Se te facturará/cobrará de la misma forma que para cualquier otra compra en tu dispositivo Android a través de tu cuenta Google. En caso de dudas o controversia respecto a la facturación, ponte en contacto con Google.

P.: He comprado algo en el juego, pero no puedo verlo. ¿Qué ha pasado?
R.: En algunos casos, puede que tengas que salir del juego y reiniciarlo para acceder a tu contenido nuevo. Si eso no funciona, prueba a apagar tu dispositivo y a reiniciarlo. Siempre puedes comprobar qué has comprado si entras en el portal del juego (por ejemplo, para Sims 3, selecciona "La tienda de los Sims" en el menú principal del juego y luego selecciona la carpeta "Mis cosas" en la esquina inferior izquierda de la pantalla).

P.: He comprado algo en mi dispositivo. ¿Puedo conseguir este mismo contenido en otro dispositivo?
R.: Sí, siempre y cuando esos dispositivos compartan la misma cuenta Google. Siempre puedes comprobar qué has comprado si seleccionas la carpeta "Mis cosas" en la esquina inferior izquierda de la pantalla.

P.: Mi pregunta no encuentra respuesta aquí. ¿Qué puedo hacer?
R.: Puedes visitar las secciones de preguntas frecuentes en http://support.google.com/androidmarket/?hl=es y ponerte en contacto con Google por cualquier problema de facturación o visitar http://help.ea.com/es/ y escribirnos. En caso de ponerte en contacto con nosotros, incluye toda la información específica que puedas, para que podamos ayudarte mejor.

P.: ¿Cuál es vuestra política de privacidad?
R.: Puedes encontrar la política de privacidad si visitas
http://tos.ea.com/legalapp/WEBPRIVACY/US/es/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_fr.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_fr.html new file mode 100644 index 0000000..ecc7878 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_fr.html @@ -0,0 +1 @@ +
AIDE


Q : Comment suis-je facture(e) pour un achat au sein du jeu (commerce via l'application / microtransaction)?
R : Vous etes facture(e) de la meme facon que pour n'importe quel achat effectue a partir de votre appareil Android, via votre compte Google. Pour toutes questions ou reclamations a ce sujet, veuillez contacter Google

Q : J'ai achete quelque chose dans le jeu mais je ne le trouve pas. Pourquoi?
R : Dans certains cas, vous devez quitter le jeu et le relancer pour acceder a votre contenu. Si cela ne fonctionne pas, essayez d'eteindre votre appareil et de le redemarrer. Vous pouvez toujours verifier ce que vous avez achete en accedant au portail du jeu (par exemple : pour Les Sims 3, selectionnez "Sims Store" depuis le menu principal puis "Mon Equipement" dans le coin en bas a gauche de l'ecran).

Q : J'ai achete quelque chose sur mon appareil. Puis-je acceder a ce contenu sur un autre appareil?
R : Oui, tant que ces appareils partagent le meme compte Google. Vous pouvez toujours verifier ce que vous avez achete en selectionnant "Mon Equipement" dans le coin en bas a gauche de l'ecran.

Q : Je n'ai pas trouve de reponse a ma question. Que faire?
R : Visitez la FAQ disponible sur http://www.google.com/support/androidmarket/ et contactez Google pour tous problemes de facturation, ou rendez-vous sur http://help.ea.com/fr/ pour nous ecrire. Lorsque vous nous contactez, n'hesitez pas a preciser le plus de details possibles.

Q : Quelle est votre charte de confidentialite?
R : Vous pouvez consulter la charte de confidentialite d'EA sur
http://tos.ea.com/legalapp/WEBPRIVACY/US/fr/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_it.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_it.html new file mode 100644 index 0000000..d46a608 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_it.html @@ -0,0 +1 @@ +
AIUTO


D: In che modo posso pagare un prodotto acquistato all'interno del gioco (Microtransazione/commercio in-app)?
R: Il metodo di fatturazione/pagamento sara lo stesso per tutti gli acquisti effettuati sul tuo dispositivo Android attraverso il tuo account Google. Se hai qualche problema di fatturazione o delle domande, contatta Google.

D: Ho acquistato un prodotto all'interno del gioco, ma non riesco a visualizzarlo. Cosa puo essere successo?
R: A volte e necessario uscire dal gioco e riavviarlo per poter visualizzare i nuovi contenuti. Se in questo modo non funziona, prova a spegnere il dispositivo e a riavviarlo di nuovo. Puoi sempre controllare i tuoi acquisti attraverso il portale di gioco (per esempio: per Sims 3, seleziona "The Sims Store" dal menu principale del gioco e poi seleziona la cartella "Le mie cose" posizionata nell'angolo in basso a sinistra dello schermo).

D: Ho acquistato qualcosa sul mio dispositivo. Posso trasferire gli stessi contenuti su un altro dispositivo?
R: Si, a condizione che i dispositivi siano registrati con lo stesso account Google. Puoi sempre controllare i tuoi acquisti, selezionando la cartella "Le mie cose" posizionata nell'angolo in basso a sinistra dello schermo.

D: Non ho ancora ricevuto risposta alla mia domanda. Cosa devo fare?
R: Puoi visitare le sezioni delle FAQ su http://support.google.com/androidmarket/?hl=ite contattare Google per qualsiasi problema di fatturazione o visitare http://help.ea.com/it/ e scriverci, includendo piu informazioni dettagliate possibili, in questo modo potremo aiutarti al meglio.

D: Qual e la vostra Politica sulla Privacy?
R: Puoi consultare la Politica sulla Privacy di EA su
http://tos.ea.com/legalapp/WEBPRIVACY/US/it/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_ja.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_ja.html new file mode 100644 index 0000000..9873e1b --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_ja.html @@ -0,0 +1 @@ +
ヘルプ


Q: ゲーム内(アプリ内ショッピング/少額取引)で購入した場合の請求方法について教えて下さい
A: Android デバイスの Google アカウントから購入した場合と同様に請求されます。請求に関する質問、疑問は、Google へお問い合わせ下さい。

Q: インゲームで購入しましたが、見つかりません。問題があるのでしょうか?
A: 場合によっては、一度ゲームを終了、再起動して、新しいコンテンツにアクセスする必要があります。それでも難しい場合は、一度デバイスを終了し、再起動して下さい。

Q: 自分のデバイスから商品を購入しました。別のデバイスでも同じ商品を利用できますか?
A: はい。同じ Google アカウントを使用すれば、利用できます。スクリーン左下の My Stuff フォルダーから購入履歴を確認できます。

Q:質問したい事項がここに掲載されていません。どうしたらいいでしょうか?
A:請求に関しては、 http://support.google.com/androidmarket/?hl=ja の FAQ セクションをご覧になるか、Google にお問い合わせください。または http://help.ea.com/ja/ からメールでお問い合わせください。弊社へのご連絡の際には、より適切なサポートをお届けするため、詳細をお伝えくださりますようお願いいたします。

Q: プライバシーポリシーについて教えて下さい。
A: EAのプライバシーポリシーについては、
http://tos.ea.com/legalapp/WEBPRIVACY/US/ja/PC/ をご覧ください。
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_ko.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_ko.html new file mode 100644 index 0000000..cebd0f5 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_ko.html @@ -0,0 +1 @@ +
도움말


Q: 게임 내에서 구매를 하면 어떻게 결제해야 하나요(게임 내 결제 / 소액결제)?
A: Google 계정을 통해 Android 기기에서 다른 물품을 구매하는 것과 같은 과정으로 결제가 이루어집니다. 결제에 문제나 질문이 있으면, Google로 연락해 주시기 바랍니다.

Q: 게임 내에서 물품을 구매했는데, 찾을 수 없습니다. 어떻게 된 건가요?
A: 이러한 경우에는, 게임을 종료하고 다시 시작한 뒤에 새로운 콘텐츠를 확인해 보세요. 그래도 작동하지 않는다면, 기기를 껐다가 다시 켜보세요. 항상 해당 게임 메뉴에서 구매 내역을 확인할 수 있습니다 (예를 들어 심즈 3라면 게임의 메인 메뉴에 있는 '심즈 스토어'에서 화면의 왼쪽 아래에 있는 '내 물건(My Stuff)' 폴더를 선택하세요).

Q: 제 기기로 물품을 구매했습니다. 같은 콘텐츠를 다른 기기에서도 사용할 수 있나요?
A: 예, Google 계정이 같다면 다른 기기에서도 사용할 수 있습니다. 화면의 왼쪽 아래에 있는 '내 물건(My Stuff)' 폴더에서 구매 내역을 확인할 수 있습니다.

Q: 여기에는 제가 원하는 질문에 대한 답변이 없네요. 어떻게 해야 하나요?
A: http://support.google.com/androidmarket/?hl=ko 을 방문해서 FAQ를 확인하고 Google에 연락하여 결제 문제를 알리거나, http://help.ea.com/ko/ 을 방문해서 저희에게 연락하실 수 있습니다. 저희에게 연락하실 때, 구체적인 정보를 적어 주시면 저희가 좀 더 잘 도와드릴 수 있습니다.

Q: 개인정보 보호정책은 어떻게 되나요?
A: EA의 개인정보 보호정책은
http://tos.ea.com/legalapp/WEBPRIVACY/US/ko/PC/ 에서 확인하실 수 있습니다.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_nl.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_nl.html new file mode 100644 index 0000000..f1d0818 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_nl.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Google Account. If you have any billing disputes or questions, please contact Google.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Google Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit the FAQ sections at http://support.google.com/androidmarket/?hl=en and contact Google for any billing issues, or visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_pt.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_pt.html new file mode 100644 index 0000000..f1d0818 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_pt.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your Android device through your Google Account. If you have any billing disputes or questions, please contact Google.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my device. Can I get this same content on another device?
A: Yes, as long as those devices share the same Google Account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit the FAQ sections at http://support.google.com/androidmarket/?hl=en and contact Google for any billing issues, or visit http://help.ea.com/en/ and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://tos.ea.com/legalapp/WEBPRIVACY/US/en/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_ru.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_ru.html new file mode 100644 index 0000000..ad1e7d4 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_ru.html @@ -0,0 +1 @@ +
HELP


В: Как мне платить за предметы, которые я могу приобрести в игре? (торговля в пприложении/микротранзакции)?
О: Вы можете платить так же как и всегда через Google Play и вашу учетную запись Google. Если у вас какие проблемы или вопросы по платежам, пожалуйста свяжитесь с Google

В: Я купил кое-что в игре, но не вижу покупки. Что случилось?
О: В некоторых случаях вам нужно выйти из приложения и запустить его снова чтобы получить доступ к покупке. Если это не помогло, поробуйте перезагрузить устройство. Вы всегда можете проверить что вы купили через интернет сайт игры (например: Sims 3, выберете 'The Sims Store' из игрового меню, нажмите Мои покупки' в нижнем левом углу экрана).

В: Я кое-что купил на своем устройстве. Могу ли я получить доступ к нему с другого устройства?
О: Да, если на другом устройстве та же самая учетная запись Google. Вы всегда можете посмотреть ваши покупки в разделе "Мои покупки" в левом нижнем углу экрана.

В: Тут нет ответа на моу вопрос, что мне делать?
О: Попробуйте посетить FAQ, он находиться по адресу http://support.google.com/googleplay/?hl=ru и свяжитесь с Google чтобы решить проблемы с покупками или посетите http://help.ea.com/ru/ и пишите нам. Если будуте писать, пожалуйста опишите вашу проблему как можно подробнее чтобы мы смогли ответить максимально точно и быстро.

В: Какова ваша политика конфиденциальности?
О: Вы можете посмотреть политику конфиденциальности EA посетив
http://tos.ea.com/legalapp/WEBPRIVACY/US/ru/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_zh.html b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_zh.html new file mode 100644 index 0000000..6c7c23c --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/Android/Google/help_android_zh.html @@ -0,0 +1 @@ +
帮助


问:我在游戏内购买的东西(应用内交易/微交易),是怎样收费的?
答:您的付费形式将与您通过您的Google帐户在您的Android设备上进行的任何其他购买一致。如果您有任何账单争议,请与Google联系

问:我进行了游戏内购买,但看不到购买的内容。什么原因?
答:有时,您可能需要退出游戏,并重启来获得您的新内容。如果问题仍然存在,请尝试关闭您的设备,并重新启动。您可以随时进入游戏的网关(拿《模拟人生3》举例,您可以选择游戏主菜单中的“模拟人生商店”,再选择屏幕左下角的“我的物品”文件夹)查看您已购买的产品。

问:我在我的设备上进行了购买。我能在另一台设备上获得相同的内容吗?
答:可以,只要这些设备都拥有相同的Google帐户。您可以随时选择屏幕左下角的“我的物品”文件夹来查看您已经购买的内容。

问:我在上面没找到我的问题。我应该怎么做?
答:您可以访问位于 http://support.google.com/androidmarket/?hl=zh 的常见问题解答板块,联系Google咨询账单问题,或访问 http://help.ea.com/zh/ 致信给我们。当与我们联系时,请尽可能详细地提供您的信息,以便我们能更好地协助您解决问题。

问:你们的保密协议内容是什么?
答:您可以访问
http://tos.ea.com/legalapp/WEBPRIVACY/US/zh/PC/ 来查看EA的保密协议。
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_de.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_de.html new file mode 100644 index 0000000..8163e87 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_de.html @@ -0,0 +1 @@ +
FAQs zur Bezahlung bei iPhone/iPod


F: Wie bezahle ich für etwas, das ich im Spiel kaufe (In App Commerce/Mikrotransaktion)?
A: Das wird genau wie bei allen anderen Einkäufen auf deinem iPhone/iPod auch über dein iTunes-Konto abgerechnet. Solltest du noch Fragen zur Bezahlung haben, kontaktiere bitte Apple.

F: Ich habe im Spiel etwas gekauft, aber ich finde es nicht. Was ist geschehen?
A: Es kann sein, dass du das Spiel verlassen und neu starten musst, um deinen neuen Inhalt aufzurufen. Wenn das nicht funktioniert, schalte dein Gerät aus und starte es erneut. Du kannst deine Einkäufe jederzeit im Portal des Spiels ansehen (für Die Sims 3 wählst du zum Beispiel das Sims Store aus dem Hauptmenü des Spiels und dann den Ordner ‘Meine Sachen’ in der linken unteren Ecke des Bildschirms).

F: Ich habe auf meinem iPhone etwas gekauft. Kann ich den Inhalt auch auf meinem iPod nutzen (und umgekehrt)?
A: Ja, so lange du für beide Geräte dasselbe iTunes-Konto hast. Du kannst deine Einkäufe jederzeit ansehen, wenn du den Ordner ‘Meine Sachen’ in der linken unteren Ecke des Bildschirms auswählst.

F: Keine der Antworten passt zu meiner Frage. Was kann ich jetzt machen?
A: Du kannst dir die FAQs auf http://www.apple.com/support/itunes/store/games/ ansehen und bei Fragen zur Bezahlung Apple kontaktieren. Oder du besuchst http://support.eamobile.com und schreibst uns. Sende uns bitte so viele detaillierte Informationen wie möglich, damit wir deine Frage besser beantworten können.

F: Wie lautet die Datenschutzrichtlinie?
A: Du kannst dir die Datenschutzrichtlinie von EA auf http://www.ea.com/custom/privacy-policy ansehen.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_en.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_en.html new file mode 100644 index 0000000..c2382ea --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_en.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your iPhone/iPod; through your iTunes account. If you have any billing disputes or questions, please contact Apple.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my iPhone. Can I get this same content on my iPod (or vice-versa)?
A: Yes, as long as those devices share the same iTunes account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit the FAQ sections at http://www.apple.com/support/itunes/store/games/ and contact Apple for any billing issues, or visit http://support.eamobile.com and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://www.ea.com/custom/privacy-policy.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_es.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_es.html new file mode 100644 index 0000000..8fb5998 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_es.html @@ -0,0 +1 @@ +
Preguntas frecuentes sobre la facturación de iPhone/iPod


P: ¿Cómo pago por algo que compro dentro del juego (compra de aplicaciones internas o microtransacciones)?
R: Se te facturará o cobrará como cuando realizas cualquier otra compra desde tu iPhone/iPod a través de tu cuenta iTunes. Si tienes problemas o dudas sobre la facturación, ponte en contacto con Apple.

P: He comprado algo dentro del juego pero no consigo verlo. ¿Qué ocurre?
R: En algunos casos, necesitarás salir del juego y reiniciarlo para acceder al contenido nuevo. Si no funciona, intenta apagar el dispositivo y reiniciarlo. Si entras en la página inicial del juego puedes visualizar las compras que has realizado (por ejemplo: en Los Sims 3, seleccionas \"Tiendo Los Sims\" del menú principal y, después, seleccionas la carpeta \"Mis cosas\", situada en la esquina inferior izquierda de la pantalla).

P: He comprado desde el iPhone. ¿Puedo colocar el mismo contenido en mi iPod (o viceversa)?
R: Sí, siempre que los dispositivos compartan la misma cuenta iTunes. Si seleccionas la carpeta \"Mis cosas\", situada en la esquina inferior izquierda de la pantalla, podrás visualizar las compras que has realizado.

P: Mis dudas no se resuelven con estas preguntas. ¿Qué puedo hacer?
R: Puedes visitar la sección de preguntas frecuentes en http://www.apple.com/support/itunes/store/games/ y ponerte en contacto con Apple para cualquier problema con la facturación, o visitar http://support.eamobile.com y escribirnos. Cuando te pongas en contacto con nosotros, incluye toda la información posible para poder ofrecerte la mejor asistencia.

P: ¿Cuál es su política de privacidad?
R: Visita http://www.ea.com/custom/privacy-policy para acceder a la política de privacidad de EA.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_fr.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_fr.html new file mode 100644 index 0000000..bf4408f --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_fr.html @@ -0,0 +1 @@ +
FAQ Paiement iPhone/iPod


Q : Comment se déroule le paiement des contenus que j’achète dans un jeu (In-App Commerce / micro-transaction) ?
R : Le paiement s’effectue de la même façon que pour tout autre achat sur votre iPhone/iPod, c’est-à-dire par l’intermédiaire de votre compte iTunes. Si vous rencontrez des problèmes de paiement, ou si vous avez des questions, veuillez contacter Apple.

Q : J’ai acheté du contenu dans un jeu, mais je ne le trouve nulle part. Que se passe-t-il ?
R : Dans certains cas, vous devez quitter le jeu et le redémarrer pour accéder au nouveau contenu. Si cela ne fonctionne pas, essayez d’éteindre votre appareil, puis de le rallumer. Vous pouvez également vérifier vos achats en accédant au portail du jeu (par exemple : pour Les Sims 3, sélectionnez « La Boutique Sims » depuis le menu principal du jeu, puis sélectionnez le dossier « Mon Équipement » dans le coin inférieur gauche de l’écran).

Q : J’ai acheté du contenu sur mon iPhone. Puis-je y accéder sur mon iPod (ou vice versa) ?
R : Oui, si ces appareils partagent le même compte iTunes. Vous pouvez aussi vérifier vos achats en sélectionnant le dossier « Mon Équipement » dans le coin inférieur gauche de l’écran.

Q : Je ne trouve pas la réponse à ma question dans cette FAQ. Que dois-je faire ?
R : Consultez les sections FAQ sur http://www.apple.com/support/itunes/store/games/ et contactez Apple pour tout problème de paiement, ou rendez-vous sur http://support.eamobile.com (site en anglais) pour nous écrire. Si vous nous contactez, assurez-vous de nous fournir le maximum d’informations dont vous disposez afin que nous puissions vous aider du mieux possible.

Q : Pouvez-vous m’en dire plus sur votre Charte de confidentialité ?
R : Vous pouvez consulter la Charte de confidentialité d’EA en vous rendant sur http://www.ea.com/custom/privacy-policy
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_it.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_it.html new file mode 100644 index 0000000..fa1d5e2 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_it.html @@ -0,0 +1 @@ +
FAQ fatturazione iPhone/iPod


Q: Come vengono addebitati gli acquisti di prodotti effettuati all'interno del gioco (In-App Commerce / microtransazioni)?
A: La procedura di addebito è la medesima di qualsiasi altro prodotto acquistato su iPhone o iPod, ovvero avviene tramite il tuo account iTunes. Per domande o problemi relativi ai pagamenti, contatta Apple.

Q: Ho acquistato un prodotto all'interno del gioco, ma non riesco a trovarlo. Perché?
A: In alcuni casi potrebbe essere necessario uscire dal gioco e riavviarlo per accedere a un nuovo contenuto. Se ciò non dovesse bastare, prova a spegnere e riaccendere il dispositivo. Per verificare gli acquisti effettuati, puoi accedere al portale del gioco (ad esempio: per The Sims 3, seleziona \The Sims Store\ dal menu principale del gioco e quindi la cartella \I miei oggetti\ nell’angolo in basso a sinistra della schermata).

Q: Ho acquistato un contenuto su iPhone. Posso usufruirne anche su iPod (e viceversa)?
A: Sì, ma i due dispositivi devono condividere il medesimo account iTunes. Per verificare gli acquisti effettuati, puoi selezionare la cartella \I miei oggetti\ nell’angolo in basso a sinistra della schermata.

Q: Qui non trovo risposte alle mie domande. Cosa posso fare?
A: Puoi visitare la sezione FAQ del sito http://www.apple.com/support/itunes/store/games/ e contattare Apple per i problemi relativi ai pagamenti; oppure visitare il sito http://support.eamobile.com e scriverci. Ti preghiamo di fornire più dettagli possibile in merito al tuo problema; questo ci consentirà di assisterti al meglio.

Q: Che tipo di Politica sulla privacy applicate?
A: Puoi visionare la politica sulla privacy di EA all'indirizzo http://www.ea.com/custom/privacy-policy.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_ja.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_ja.html new file mode 100644 index 0000000..041a7bd --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_ja.html @@ -0,0 +1 @@ +
よくある質問:iPhone/iPodの請求処理について


Q: ゲーム中で購入したもの(ゲーム内商品/小額決済)に対して、どのように請求されるのでしょうか?
A: お使いのiPhone/iPodでの他の取引と同様に、お使いのiTunesアカウントを通じて請求/課金されます。請求に関するお問い合わせやご質問は、Apple社にご連絡ください。

Q: ゲーム内で購入したはずのものが表示されませんが、なぜでしょうか?
A: 場合によっては、新しいコンテンツを利用するにはゲームをいったん終了して再起動する必要があります。それでもうまくいかない場合、デバイスの電源をいったん切ったうえで入れなおしてみてください。なお、ゲームのポータルにアクセスすれば購入内容をご確認いただけます(例えば「ザ・シムズ3」であれば、ゲームのメインメニューから「The Sims ストア」を選択して、画面左下に表示される「マイ スタッフ」フォルダを選択してください)。

Q: iPhoneで購入したコンテンツ を、iPodで利用することは可能でしょうか?(また、その逆は可能でしょうか?)
A: 両方のデバイスで同一のiTunesアカウントを使用している限り、可能です。まずは新しいコンテンツを利用したいデバイスでゲームを起動してください(そのデバイスにまだゲームがインストールされていない場合、iTunesストアからダウンロードしてください)。次にゲームのポータルにアクセスしてください(例えば「ザ・シムズ3」であれば、ゲームのメインメニューから「ザ・シムズ ストア 」を選択して、画面右上に表示される「購入内容の再適用 」を選択してください)。なお、画面左下に表示される「マイ スタッフ 」フォルダを選択すれば 、いつでも購入したものをご確認いただけます。

Q: ここでは質問の答えが見つからなかったのですが、どうすればいいでしょうか?
A: http://www.apple.com/support/itunes/store/games/のよくある質問コーナーにアクセスしてください。課金についてはそこからApple社にお問い合わせいただくか、http://support.eamobile.com から弊社にお問い合わせください。ご連絡をいただく際は、より適切な対応を可能にするため、できる限り具体的な情報を含めていただけるよう、お願い申し上げます。

Q: プライバシーに関する方針を確認したいのですが?
A: エレクトロニックアーツのプライバシーに関する方針は http://www.ea.com/custom/privacy-policy からご確認いただけます。
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_ko.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_ko.html new file mode 100644 index 0000000..00dbeb9 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_ko.html @@ -0,0 +1 @@ +
HELP


Q: 게임에서 구매한 상품에 대한 요금 지불은 어떻게 진행되나요?
A: 아이폰이나 아이팟에서 다른 상품을 구입했을때와 같은 방법으로 요금이 지불됩니다. 요금 지불에 대해 궁금한 점이 있으면 애플사로 연락주시기 바랍니다.

Q: 게임에서 구매한 상품이 보이지 않습니다. 어떻게 된건가요?
A: 새로 구매한 컨텐츠를 확인하려면 게임을 종료하고 다시 시작해야되는 경우도 있습니다. 그래도 보이지 않는다면 전원을 껐다가 다시 시작해 보십시오. 언제든지 게임 메뉴에서 자신이 구매한 상품을 확인할 수 있습니다.(예를 들어, 심즈 3에서는 메인 메뉴의 '심즈 스토어'를 선택하고 화면 왼쪽 아래의 ''내 아이템 폴더를 선택하면 됩니다.)

Q: 아이폰으로 구매한 상품을 아이팟에서 받아볼 수 있나요?(또는 반대 상황)
A: 네, 두개의 장치가 같은 아이튠즈 계정을 사용한다면 가능합니다. 먼저 상품을 사용할 장치에서 게임을 시작합니다. (장치에 게임이 없으면 아이튠즈 스토어에서 게임을 다운로드 받으십시오.) 게임 메뉴로 들어갑니다. (예를 들어, 심즈 3에서는 메인 메뉴의 '심즈 스토어'를 선택하고 화면 오른쪽 위의 '구매 항목 불러오기'를 선택합니다.)

Q: 원하는 질문이 여기에 없습니다. 어떻게 해야 하나요?
A:애플사의 http://www.apple.com/support/itunes/store/games/ FAQ 메뉴에 요금과 관련된 질문을 올리시거나, 저희 웹사이트 http://support.eamobile.com에 글을 남겨 주시기 바랍니다. 글을 남기실 때에는 저희가 최대한의 지원을 할 수 있도록 가능하면 자세한 모든 정보를 포함해 주시기 바라니다.

Q: 귀사의 개인 정보 보호 정책은 어떻게 되나요?
A:
http://www.ea.com/custom/privacy-policy에서 EA의 개인 정보 보호 정책을 확인할 수 있습니다.
diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_nl.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_nl.html new file mode 100644 index 0000000..c2382ea --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_nl.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your iPhone/iPod; through your iTunes account. If you have any billing disputes or questions, please contact Apple.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my iPhone. Can I get this same content on my iPod (or vice-versa)?
A: Yes, as long as those devices share the same iTunes account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit the FAQ sections at http://www.apple.com/support/itunes/store/games/ and contact Apple for any billing issues, or visit http://support.eamobile.com and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://www.ea.com/custom/privacy-policy.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_pt.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_pt.html new file mode 100644 index 0000000..c2382ea --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_pt.html @@ -0,0 +1 @@ +
HELP


Q: How am I charged for something I purchase within the game (In-App Commerce / microtransaction)?
A: You are billed/charged the same way for any other purchase on your iPhone/iPod; through your iTunes account. If you have any billing disputes or questions, please contact Apple.

Q: I purchased something in-game, but I cannot see it. What happened?
A: In some cases, you may need to exit the game and restart it to access your new content. If that doesn't work, try turning off your device and restarting it. You can always check what you've purchased by entering the game's portal (for example: for Sims 3, select 'The Sims Store' from the game's main menu, then select the 'My Stuff' folder in the lower left hand corner of the screen).

Q: I purchased something on my iPhone. Can I get this same content on my iPod (or vice-versa)?
A: Yes, as long as those devices share the same iTunes account. You can always check what you've purchased by selecting the 'My Stuff' folder in the lower left hand corner of the screen.

Q: My question is not answered here. What can I do?
A: You can visit the FAQ sections at http://www.apple.com/support/itunes/store/games/ and contact Apple for any billing issues, or visit http://support.eamobile.com and write us. When contacting us, please include as much specific information as possible so that we can better assist you.

Q: What is your Privacy Policy?
A: You can view EA's privacy policy by visiting
http://www.ea.com/custom/privacy-policy.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_ru.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_ru.html new file mode 100644 index 0000000..078799d --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_ru.html @@ -0,0 +1 @@ +
HELP


В: Как мне платить за предметы, которые я могу приобрести в игре? (торговля в пприложении/микротранзакции)?
О: Вы можете платить так же как и всегда через ITunes вашу учетную запись. Если у вас какие проблемы или вопросы по платежам, пожалуйста свяжитесь с Apple

В: Я купил кое-что в игре, но не вижу покупки. Что случилось?
О: В некоторых случаях вам нужно выйти из приложения и запустить его снова чтобы получить доступ к покупке. Если это не помогло, поробуйте перезагрузить устройство. Вы всегда можете проверить что вы купили через интернет сайт игры (например: Sims 3, выберете 'The Sims Store' из игрового меню, нажмите Мои покупки' в нижнем левом углу экрана).

В: Я кое-что купил на своем устройстве. Могу ли я получить доступ к нему с другого устройства?
О: Да, если на другом устройстве та же самая учетная запись ITunes. Вы всегда можете посмотреть ваши покупки в разделе "Мои покупки" в левом нижнем углу экрана.

В: Тут нет ответа на моу вопрос, что мне делать?
О: Попробуйте посетить FAQ, он находиться по адресу http://www.apple.com/support/itunes/store/games и свяжитесь с Apple чтобы решить проблемы с покупками или посетите http://help.ea.com/ru/ и пишите нам. Если будуте писать, пожалуйста опишите вашу проблему как можно подробнее чтобы мы смогли ответить максимально точно и быстро.

В: Какова ваша политика конфиденциальности?
О: Вы можете посмотреть политику конфиденциальности EA посетив
http://tos.ea.com/legalapp/WEBPRIVACY/US/ru/PC/.
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/iOS/help_zh.html b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_zh.html new file mode 100644 index 0000000..158410d --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/iOS/help_zh.html @@ -0,0 +1 @@ +
帮助


问题:在游戏中购买物品后(程序内嵌商务或零售)如何付款?
答案:类似于在 iPhone/iPod 上购买其他物品,你可以通过 iTunes 账号支付或被收取费用。如果你有任何付款纠纷或问题,请联系 Apple。

问题:我在游戏中购买了一件物品,但是看不到它。怎么回事?
答案:有时候,你需要退出并重新启动游戏才能获得新物品。如果这不起作用,尝试关闭设备并重启。你总是可以通过进入游戏启动画面来查看已购买的商品(例如:在《模拟人生3》中,你可以首先选择主菜单中的「Sims商店」,然后选择画面左下角的「我的物品」文件夹)。

问题:我使用 iPhone 购买了一件物品。我在 iPod 中也可以拥有它吗(反之亦然)?
答案A: 是的,只要那些设备都共用一个 iTunes 账号。

问题:这里没有我所需要的答案。我该怎么做?
答案:你可以访问 http://www.apple.com/support/itunes/store/games/ 的疑难解答部分并联系 Apple 解决任何付款问题,或访问 http://support.eamobile.com 致函我们。请在信中尽可能地详述信息,以便我们更好地为你服务。

问题:隐私政策的内容?
答案:你可以访问 http://www.ea.com/custom/privacy-policy 查询 EA 隐私政策。
\ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/store_error_messages.txt b/app/src/main/assets/EASP/StoreUI/resources/store_error_messages.txt new file mode 100644 index 0000000..b329774 --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/store_error_messages.txt @@ -0,0 +1,261 @@ +{ + "strings": + [ + { + "en": + [ + { + "-1111":"To access your data, deactivate flight mode or use Wi-Fi", + "-2222":"To access your data, deactivate flight mode or use Wi-Fi", + "-3333":"Message 3333: Purchase cancelled.", + "-4444":"Error 4444: Purchasing server error or marketplace was minimized. Please try again later or restart the application.", + "-5555":"Message 5555: Restore cancelled.", "-5556":"Message 5556: Downloading cancelled.", + "-6666":"Error 6666: Restoring server error or marketplace was minimized. Please try again later or restart the application.", + "-8888":"Error 8888: Insufficient space. Please free up some space and try again.", + "-10001":"Error 10001: Master Item not found.", + "-10002":"Error 10002: Could not access profile.", + "-10003":"Error 10003: Insufficient privilege.", + "-10004":"Error 10004: Insufficient privilege.", + "-10005":"Message 10005: To access the in-game store please upgrade to the latest version of this application.", + "-10006":"Error 10006: Could not access item.", + "-10007":"Error 10007: Language not supported for this product.", "-13002":"Error 13002: Oops! Something went wrong...", + "-21002":"Error 21002: Could not access profile.", + "-21008":"Error 21008: Could not access profile.", + "-30001":"Error 30001: Could not access profile.", + "-30002":"Error 30002: Could not access item.", + "-30003":"Error 30003: Error validating receipt.", + "-30004":"Error 30004: Error validating purchase.", + "-30005":"Message 30005: Download limit exceeded.", + "-30006":"Error 30006: Access denied.", + "-30007":"Error 30007: Error validating purchase.", + "-30008":"Message 30008: Restore limit exceeded.", "-44443":"Error 44443: Could not log in Google Play. Please make sure that you have an active account on Google Play.", + "-44444":"Error 44444: Could not log in App Store. Please make sure that you have an active account on App Store." + + } + ] + }, + { + "fr": + [ + { + "-1111":"Désactivez le mode Avion ou utilisez Wi-Fi pour accéder à vos données", + "-2222":"Désactivez le mode Avion ou utilisez Wi-Fi pour accéder à vos données", + "-3333":"Message 3333 : achat annulé.", + "-4444":"Erreur 4444 : erreur du serveur pendant l'achat. Veuillez réessayer plus tard.", + "-5555":"Message 5555 : restauration annulée.", "-5556":"Message 5556 : téléchargement cancelled.", + "-6666":"Erreur 6666 : Réinitialisation interrompue. Veuillez réessayer.", + "-8888":"Erreur 8888 : espace insuffisant. Veuillez libérer de l'espace et réessayer.", + "-10001":"Erreur 10001 : impossible de trouver l'élément principal.", + "-10002":"Erreur 10002 : impossible d'accéder au profil.", + "-10003":"Erreur 10003 : privilèges insuffisants.", + "-10004":"Erreur 10004 : privilèges insuffisants.", + "-10005":"Message 10005 : pour accéder à la boutique du jeu, veuillez télécharger la dernière mise à jour de cette application.", + "-10006":"Erreur 10006 : impossible d'accéder à l'élément.", + "-10007":"Erreur 10007 : ce produit ne prend pas en charge cette langue.", "-13002":"Erreur 13002: Aïe ! Il y a eu un problème...", + "-21002":"Erreur 21002 : impossible d'accéder au profil.", + "-21008":"Erreur 21008 : impossible d'accéder au profil.", + "-30001":"Erreur 30001 : impossible d'accéder au profil.", + "-30002":"Erreur 30002 : impossible d'accéder à l'élément.", + "-30003":"Erreur 30003 : erreur de validation de la réception.", + "-30004":"Erreur 30004 : erreur de validation de l'achat.", + "-30005":"Message 30005 : dépassement de la limite du téléchargement.", + "-30006":"Erreur 30006 : accès refusé.", + "-30007":"Erreur 30007 : erreur de validation de l'achat.", + "-30008":"Message 30008 : dépassement de la limite de restauration.", "-44443":"Error 44443: Impossible de se connecter sur l'Google Play. S'il vous plaît assurez-vous d'avoir un compte actif sur Google Play.", + "-44444":"Error 44444: Impossible de se connecter sur l'App Store. S'il vous pla�Rt assurez-vous d'avoir un compte actif sur App Store." + + } + ] + }, + { + "it": + [ + { + "-1111":"Disattiva la modalità di uso in aereo o usa il Wi-Fi per accedere ai dati", + "-2222":"Disattiva la modalità di uso in aereo o usa il Wi-Fi per accedere ai dati", + "-3333":"Messaggio 3333: acquisto annullato.", + "-4444":"Errore 4444: errore del server nell'operazione d'acquisto. Riprova più tardi.", + "-5555":"Messaggio 5555: Ripristino annullato.", "-5556":"Messaggio 5556: Download annullato.", + "-6666":"Errore 6666: Ripristino interrotto. Riprovare.", + "-8888":"Errore 8888: spazio insufficiente. Libera dello spazio e riprova.", + "-10001":"Errore 10001: impossibile trovare elemento principale.", + "-10002":"Errore 10002: impossibile accedere al profilo.", + "-10003":"Errore 10003: privilegi insufficienti.", + "-10004":"Errore 10004: privilegi insufficienti.", + "-10005":"Messaggio 10005: per accedere al negozio interno al gioco esegui un aggiornamento di questa applicazione alla versione più recente.", + "-10006":"Errore 10006: impossibile accedere all'elemento.", + "-10007":"Errore 10007: lingua non supportata per questo prodotto.", "-13002":"Errore 13002: Ops! Si è verificato un errore inatteso.", + "-21002":"Errore 21002: impossibile accedere al profilo.", + "-21008":"Errore 21008: impossibile accedere al profilo.", + "-30001":"Errore 30001: impossibile accedere al profilo.", + "-30002":"Errore 30002: impossibile accedere all'elemento.", + "-30003":"Errore 30003: errore nella convalida della ricevuta.", + "-30004":"Errore 30004: errore nella convalida dell'acquisto.", + "-30005":"Messaggio 30005: limite di download superato.", + "-30006":"Errore 30006: accesso negato.", + "-30007":"Errore 30007: errore nella convalida dell'acquisto.", + "-30008":"Messaggio 30008: limite di ripristino superato.", "-44443":"Errore 44443: Impossibile accedere Google Play. Si prega di assicurarsi di avere un account attivo su Google Play.", "-44444":"Errore 44444: Impossibile accedere App Store. Si prega di assicurarsi di avere un account attivo su App Store." + + } + ] + }, + { + "de": + [ + { + "-1111":"Flugmodus deaktivieren oder Wi-Fi für Datenzugriff verwenden", + "-2222":"Flugmodus deaktivieren oder Wi-Fi für Datenzugriff verwenden", + "-3333":"Meldung 3333: Kauf abgebrochen.", + "-4444":"Fehler 4444: Serverfehler beim Zahlvorgang. Bitte versuche es später erneut.", + "-5555":"Meldung 5555: Wiederherstellen abgebrochen.", "-5556":"Meldung 5556: Herunterladen abgebrochen", + "-6666":"Fehler 6666: Wiederherstellung unterbrochen. Bitte erneut versuchen.", + "-8888":"Fehle 8888: Nicht genügend Speicherplatz. Bitte mach Speicherplatz frei und versuche es erneut.", + "-10001":"Fehler 10001: Das Spiel wurde nicht gefunden.", + "-10002":"Fehler 10002: Konnte nicht auf das Profil zugreifen.", + "-10003":"Fehler 10003: Unzureichende Benutzerrechte.", + "-10004":"Fehler 10004: Unzureichende Benutzerrechte.", + "-10005":"Meldung 10005: Für den Ingame-Store benötigst du die aktuelle Version dieser Anwendung.", + "-10006":"Fehler 10006: Konnte nicht auf das Objekt zugreifen.", + "-10007":"Fehler 10007: Die Sprache wird für dieses Produkt nicht unterstützt.", "-13002":"Fehler 13002: Hoppla! Etwas ist schiefgelaufen ... Ein unerwarteter Fehler ist aufgetreten.", + "-21002":"Fehler 21002: Konnte nicht auf das Profil zugreifen.", + "-21008":"Fehler 21008: Konnte nicht auf das Profil zugreifen.", + "-30001":"Fehler 30001: Konnte nicht auf das Profil zugreifen.", + "-30002":"Fehler 30002: Konnte nicht auf das Objekt zugreifen.", + "-30003":"Fehler 30003: Fehler bei der Eingangsbestätigung.", + "-30004":"Fehler 30004: Fehler bei der Kaufbestätigung.", + "-30005":"Meldung 30005: Download-Limit überschritten.", + "-30006":"Fehler 30006: Zugriff verweigert.", + "-30007":"Fehler 30007: Fehler bei der Kaufbestätigung.", + "-30008":"Meldung 30008: Wiederherstellen-Limit überschritten.", "-44443":"Fehler 44443: Konnte nicht in Google Play anmelden. Bitte stellen Sie sicher, dass Sie einen aktiven Account im Google Play zu haben.", "-44444":"Fehler 44444: Konnte nicht in App Store anmelden. Bitte stellen Sie sicher, dass Sie einen aktiven Account im App Store zu haben." + + } + ] + }, + { + "es": + [ + { + "-1111":"Para acceder a tus datos, desactiva el Avión o usa Wi-Fi", + "-2222":"Para acceder a tus datos, desactiva el Avión o usa Wi-Fi", + "-3333":"Mensaje 3333: Compra cancelada.", + "-4444":"Error 4444: Error del servidor durante la operación de compra. Inténtalo de nuevo.", + "-5555":"Mensaje 5555: Restauración cancelada.", "-5556":"Mensaje 5556: Descargar cancelado.", + "-6666":"Error 6666: Restauración interrumpida. Vuelve a intentarlo.", + "-8888":"Error 8888: Espacio insuficiente. Por favor libera algo de espacio e inténtalo de nuevo.", + "-10001":"Error 10001: no se encontró el elemento maestro.", + "-10002":"Error 10002: no se pudo acceder al perfil.", + "-10003":"Error 10003: privilegios insuficientes.", + "-10004":"Error 10004: privilegios insuficientes.", + "-10005":"Mensaje 10005: para poder acceder a la tienda del juego, actualiza a la última versión de esta aplicación.", + "-10006":"Error 10006: no se pudo acceder al artículo.", + "-10007":"Error 10007: este idioma no está disponible para este producto.", "-13002":"Error 13002: ¡Vaya! Algo ha ido mal... Ha ocurrido un error inesperado.", + "-21002":"Error 21002: no se pudo acceder al perfil.", + "-21008":"Error 21008: no se pudo acceder al perfil.", + "-30001":"Error 30001: no se pudo acceder al perfil.", + "-30002":"Error 30002: no se pudo acceder al artículo.", + "-30003":"Error 30003: error al validar el recibo.", + "-30004":"Error 30004: error al validar la compra.", + "-30005":"Mensaje 30005: se ha sobrepasado el límite de descargas.", + "-30006":"Error 30006: acceso denegado.", + "-30007":"Error 30007: error al validar la compra.", + "-30008":"Mensaje 30008: se ha sobrepasado el límite de restauraciones.", "-44443":"No se pudo iniciar sesión en el Google Play. Por favor, asegúrese de que usted tiene una cuenta activa en el Google Play.", "-44444":"No se pudo iniciar sesi�_n en el App Store. Por favor, asegúrese de que usted tiene una cuenta activa en el App Store." + + } + ] + }, + { + "ja": + [ + { + "-1111":"データにアクセスするには、機内モードをオフにするか、Wi-Fiを使用してください", + "-2222":"データにアクセスするには、機内モードをオフにするか、Wi-Fiを使用してください", + "-3333":"メッセージ3333: 購入後のキャンセル。", + "-4444":"エラー4444: 購買サーバーエラー。後でやり直してください。", + "-5555":"メッセージ5555: キャンセルを復元します。", "-5556":"メッセージ5556: キャンセルのダウンロード。", + "-6666":"エラー6666: 修復できませんでした。もう一度お試し下さい。", + "-8888":"エラー8888: 空き容量が不足しています。十分の空き容量を確保してから再度お試しください。", + "-10001":"エラー10001: ゲームが見つかりませんでした。", + "-10002":"エラー10002: プロフィールにアクセスできませんでした。", + "-10003":"エラー10003: 権限がありません。", + "-10004":"エラー10004: 権限がありません。", + "-10005":"メッセージ10005: インゲームストアにアクセスするには、このアプリケーションの最新版にアップグレードする必要があります。", + "-10006":"エラー10006: アイテムにアクセルできませんでした。", + "-10007":"エラー10007: この商品では対応されていない言語です。", "-13002":"エラー13002: 問題が発生しました。予期しないエラーが発生しました。", + "-21002":"エラー21002: プロフィールにアクセスできませんでした。", + "-21008":"エラー21008: プロフィールにアクセスできませんでした。", + "-30001":"エラー30001: プロフィールにアクセスできませんでした。", + "-30002":"エラー30002: アイテムにアクセスできませんでした。", + "-30003":"エラー30003: レシートの有効化でエラーが発生しました。", + "-30004":"エラー30004: 購入の有効化でエラーが発生しました。", + "-30005":"メッセージ30005: ダウンロード制限を越えました。", + "-30006":"", + "-30007":"エラー30007: 購入の有効化でエラーが発生しました。", + "-30008":"メッセージ30008: 復元制限を越えています。", "-44443":"エラ 44443: Androidマーケットにログインできませんでした。あなたがAndroidマーケットでアクティブなアカウントを持っていることを確認してください。", "-44444":"エラ 44444: App Storeマーケットにログインできませんでした。あなたがApp Storeマーケットでアクティブなアカウントを持っていることを確認してください。" + } + ] + }, + { + "zh": + [ + { + "-1111":"要存取你的资料,关闭飞行模式或使用Wi-Fi", + "-2222":"要存取你的资料,关闭飞行模式或使用Wi-Fi", + "-3333":"信息 3333:购买取消。", + "-4444":"错误代码 4444:购买服务器错误。请稍候再试。", + "-5555":"信息 5555:恢复取消。", "-5556":"信息 5556:下载取消。", + "-6666":"错误代码 6666:恢复被中断。请重试。", + "-8888":"错误代码 8888:没有足够的空间。请释放一些空间再试。", + "-10001":"错误代码 10001:没有找到主要项目。", + "-10002":"错误代码 10002:无法存取档案。", + "-10003":"错误代码 10003:权限不足。", + "-10004":"错误代码 10004:权限不足。", + "-10005":"信息 10005:要存取游戏储存,请将应用程序更新到最新版本。", + "-10006":"错误代码 10006:无法存取项目。", + "-10007":"错误代码 10007:产品不支援此语言。", "-13002":"错误代码 13002:糟糕!有些不对劲 。。。发生了一个意外错误。", + "-21002":"错误代码 21002:无法存取档案。", + "-21008":"错误代码 21008:无法存取档案。", + "-30001":"错误代码 30001:无法存取档案。", + "-30002":"错误代码 30002:无法存取项目。", + "-30003":"错误代码 30003:验证收据错误。", + "-30004":"错误代码 30004:验证购买错误。", + "-30005":"错误代码 30005:超过限制下载次数。", + "-30006":"错误代码 30006:拒绝存取。", + "-30007":"错误代码 30007:验证购买错误。", + "-30008":"信息 30008:超过限制恢复次数。", "-44443":"错误代码 44443: 在Google Play无法登录。请确保你有一个在Google Play的活跃帐户。", "-44444":"错误代码 44444: 在App Store无法登录。请确保你有一个在App Store的活跃帐户。" + } + ] + }, + { + "ko": + [ + { + "-1111":"데이터에 접근하려면 에어플레인 모드를 끄거나 Wi-Fi를 사용하십시오.", + "-2222":"데이터에 접근하려면 에어플레인 모드를 끄거나 Wi-Fi를 사용하십시오.", + "-3333":"메시지 3333: 구입이 취소되었습니다.", + "-4444":"오류 4444: 구매 서버 오류. 나중에 다시 시도해 주십시오.", + "-5555":"메시지 5555: 복원을 취소했습니다.", "-5556":"메시지 5556: 취소 다운로드.", + "-6666":"오류 6666: 복원이 중단되었습니다. 다시 시도해 주십시오.", + "-8888":"오류 8888: 공간이 부족합니다. 여유 공간 확보 후 다시 시도해 주십시오.", + "-10001":"오류 10001: 주 아이템을 찾을 수 없습니다.", + "-10002":"오류 10002: 프로필에 접속할 수 없습니다.", + "-10003":"오류 10003: 권한이 부족합니다.", + "-10004":"오류 10004: 권한이 부족합니다.", + "-10005":"메시지 10005: 게임 내 상점에 접속하려면 응용 프로그램을 최신 버전으로 업그레이드해주십시오.", + "-10006":"오류 10006: 아이템에 접속할 수 없습니다.", + "-10007":"오류 10007: 이 상품은 해당 언어를 지원하지 않습니다.", "-13002":"오류 13002: 이런! 뭔가가 잘못되었습니다…예상하지 못한 오류가 발생했습니다.", + "-21002":"오류 21002: 프로필에 접속할 수 없습니다.", + "-21008":"오류 21008: 프로필에 접속할 수 없습니다.", + "-30001":"오류 30001: 프로필에 접속할 수 없습니다.", + "-30002":"오류 30002: 프로필에 접속할 수 없습니다.", + "-30003":"오류 30003: 영수증 인증 중 오류가 발생했습니다.", + "-30004":"오류 30004: 구매 인증 중 오류가 발생했습니다.", + "-30005":"메시지 30005: 다운로드 제한 횟수를 넘었습니다.", + "-30006":"오류 30006: 접속이 거부되었습니다.", + "-30007":"오류 30007: 구매 인증 중 오류가 발생했습니다.", + "-30008":"메시지 30008: 복원 제한 횟수를 초과했습니다.", "-44443":"오류 44443: Android 마켓에 로그인할 수 없습니다. 당신은 Android 마켓에 활성화된 계정을 가지고 있는지 확인하십시오.", + "-44444":"오류 44444: App Store 마켓에 로그인할 수 없습니다. 당신은 App Store 마켓에 활성화된 계정을 가지고 있는지 확인하십시오." + } + ] + }, { "nl": [ { "-1111":"Algemene fout. Probeer het later nog eens.", "-2222":"Om toegang tot je gegevens te krijgen, deactiveer je de vliegtuigmodus of gebruik je Wi-Fi", "-3333":"Melding 3333: Aankoop geannuleerd.", "-4444":"Fout 4444: Serverfout tijdens aankoop. Probeer het later nog eens.", "-5555":"Melding 5555: Herstel geannuleerd.", "-6666":"Fout 6666: Herstel onderbroken. Probeer het nog eens.", "-8888":"Fout 8888: Onvoldoende ruimte. Maak ruimte vrij en probeer het opnieuw.", "-10001":"Fout 10001: Kan meesterartikel niet vinden.", "-10002":"Fout 10002: Kan geen toegang krijgen tot profiel.", "-10003":"Fout 10003: Onvoldoende rechten.", "-10004":"Fout 10004: Onvoldoende rechten.", "-10005":"Melding 10005: Om toegang te krijgen tot de in-game store, upgrade je naar de nieuwste versie van deze toepassing.", "-10006":"Fout 10006: Kan geen toegang krijgen tot artikel.", "-10007":"Fout 10007: Taal wordt niet ondersteund voor dit product.", "-21002":"Fout 21002: Kan geen toegang krijgen tot profiel.", "-21008":"Fout 21008: Kan geen toegang krijgen tot profiel.", "-30001":"Fout 30001: Kan geen toegang krijgen tot profiel.", "-30002":"Fout 30002: Kan geen toegang krijgen tot artikel.", "-30003":"Fout 30003: Fout tijdens valideren ontvangst.", "-30004":"Fout 30004: Fout tijdens valideren aankoop.", "-30005":"Melding 30005: Downloadlimiet overschreden.", "-30006":"Fout 30006: Toegang geweigerd.", "-30007":"Fout 30007: Fout tijdens valideren aankoop.", "-30008":"Melding 30008: Herstellimiet overschreden.", "-44443":"Error 44443: Could not log in Google Play. Please make sure that you have an active account on Google Play.", "-44444":"Error 44444: Could not log in App Store. Please make sure that you have an active account on App Store." } ] }, { "pt": [ { "-1111":"Erro Geral. Tente novamente mais tarde.", "-2222":"Para acessar seus dados, desative o modo avião ou use o Wi-Fi", "-3333":"Mensagem 3333: Compra cancelada.", "-4444":"Erro 4444: Erro no servidor de compras. Tente novamente mais tarde.", "-5555":"Mensagem 5555: Restauração cancelada.", "-6666":"Erro 6666: Restauração interrompida. Tente novamente.", "-8888":"Erro 8888: Não há espaço suficiente. Libere espaço em disco e tente novamente.", "-10001":"Erro 10001: Item principal não encontrado.", "-10002":"Erro 10002: Não foi possível acessar o perfil.", "-10003":"Erro 10003: Privilégios insuficientes.", "-10004":"Erro 10004: Privilégios insuficientes.", "-10005":"Mensagem 10005: Para acessar a loja do jogo, atualize para a versão mais recente deste aplicativo.", "-10006":"Erro 10006: Não foi possível acessar o item.", "-10007":"Erro 10007: Idioma não suportado para este produto.–", "-21002":"Erro 21002: Não foi possível acessar o perfil.", "-21008":"Erro 21008: Não foi possível acessar o perfil.", "-30001":"Erro 30001: Não foi possível acessar o perfil.", "-30002":"Erro 30002: Não foi possível acessar o item.", "-30003":"Erro 30003: Erro na validação do recibo.", "-30004":"Erro 30004: Erro na validação da compra.", "-30005":"Mensagem 30005: Limite de download excedido.", "-30006":"Erro 30006: Acesso negado.", "-30007":"Erro 30007: Erro na validação da compra.", "-30008":"Mensagem 30008: Limite de restaurações excedido.", "-44443":"Error 44443: Could not log in Google Play. Please make sure that you have an active account on Google Play.", "-44444":"Error 44444: Could not log in App Store. Please make sure that you have an active account on App Store." } ] }, { "ru": [ { "-1111":"Критическая ошибка. Пожалуйста, повторите попытку позже.", "-2222":"Для доступа к данным отключите режим \"в самолете\" или используйте Wi-Fi.", "-3333":"Сообщение 3333. Сделка отменена.", "-4444":"Ошибка 4444. Ошибка сервера покупателя. Пожалуйста, повторите попытку позже.", "-5555":"Сообщение 5555. Восстановление отменено.", "-6666":"Ошибка 6666. Восстановление прервано. Пожалуйста, повторите попытку.", "-8888":"Ошибка 8888. Недостаточно места. Пожалуйста, освободите место и повторите попытку.", "-10001":"Ошибка 10001. Не найден главный объект.", "-10002":"Ошибка 10002. Ошибка доступа к профилю.", "-10003":"Ошибка 10003. Недостаточные полномочия.", "-10004":"Ошибка 10004. Недостаточные полномочия.", "-10005":"Сообщение 10005. Для доступа к игровому магазину, пожалуйста, обновите приложение до последней версии.", "-10006":"Ошибка 10006. Ошибка доступа к объекту.", "-10007":"Ошибка 10007. Данный язык не поддерживается для этого продукта.", "-21002":"Ошибка 21002. Ошибка доступа к профилю.", "-21008":"Ошибка 21008. Ошибка доступа к профилю.", "-30001":"Ошибка 30001. Ошибка доступа к профилю.", "-30002":"Ошибка 30002.Ошибка доступа к объекту.", "-30003":"Ошибка 30003. Ошибка подтверждения квитанции.", "-30004":"Ошибка 30004. Ошибка подтверждения сделки.", "-30005":"Сообщение 30005. Превышен лимит загрузок.", "-30006":"Ошибка 30006. Отказано в доступе.", "-30007":"Ошибка 30007. Ошибка подтверждения сделки.", "-30008":"Сообщение 30008. Превышен лимит восстановлений.", "-44443":"Ошибка 44443: Ошибка доступа в Google Play. Убедитесь что у вас активирован аккаунт в Google Play на устройстве.", "-44444":"Ошибка 44444: CОшибка доступа в ITunes. Убедитесь что у вас активирован аккаунт в App Store на устройстве." } ] } + ] +} \ No newline at end of file diff --git a/app/src/main/assets/EASP/StoreUI/resources/store_strings.txt b/app/src/main/assets/EASP/StoreUI/resources/store_strings.txt new file mode 100644 index 0000000..0d1e50e --- /dev/null +++ b/app/src/main/assets/EASP/StoreUI/resources/store_strings.txt @@ -0,0 +1,368 @@ +{ + "strings": + [ + { + "en": + [ + { + "LoadingItems":"Loading Items ...", + "PurchasingItem":"Purchasing Item ...", + "DownloadingItem":"Downloading Item ...", + "RestoringItems":"Restoring Items ...", + "RestoreNothing":"0 items restored.", + "RestoreNumItems":"Restoring %d of %d items", + "RestoreFinished":"Restoring finished.", + "MyStuff":"My Stuff", + "New":"New", + "More":"More", + "Dismiss":"Dismiss", + "Cancel":"Cancel", + "Close":"Close", + "LowVersionMsg":"To download more great content currently available for your games, please update your itunes software. It's easy:\n1. Connect your device to your computer\n2. Open iTunes\n3. Click “UPDATE”", + "InsufficientSpaceMsg":"You do not have the sufficient space required to install this item. Please free up some space and try again.", + "FreeItemsRestoreMsg":"The game only contains free items. To restore previously downloaded free content, simply download the free item(s) again.", + "Exit":"Exit", + "Help":"Help", + "Restore":"Restore items", + "Back":"Back", + "Free":"Free", + "Install":"Install", + "Installed":"Installed", + "BuyNow":"Buy now", + "DontSeeYourItems":"DON'T SEE YOUR ITEMS?", + "TapOnRestore":"Tap on the RESTORE ITEMS button to view" + } + ] + }, + { + "fr": + [ + { + "LoadingItems":"Chargement des éléments...", + "PurchasingItem":"Achat d'élément...", + "DownloadingItem":"Téléchargement d'élément...", + "RestoringItems":"Restauration des éléments...", + "RestoreNothing":"0 élément restauré.", + "RestoreNumItems":"Élément(s) restauré(s) : %d sur %d", + "RestoreFinished":"Restauration terminée.", + "MyStuff":"Mon equipement", + "New":"Nouveau", + "More":"Plus", + "Dismiss":"Rejeter", + "Cancel":"Annuler", + "Close":"Fermer", + "LowVersionMsg":"Pour télécharger d'autres contenus passionnants pour vos jeux, veuillez mettre à jour votre logiciel iTunes. C'est tout simple :\n1. Connectez votre appareil à votre ordinateur\n2. Ouvrez iTunes\n3. Cliquez sur « METTRE À JOUR »", + "InsufficientSpaceMsg":"Vous ne disposez pas de l'espace nécessaire pour installer cet élément. Veuillez libérer de l'espace et réessayer.", + "FreeItemsRestoreMsg":"Le jeu ne contient que des éléments gratuits. Pour restaurer le contenu gratuit précédemment téléchargé, il vous suffit de le télécharger de nouveau.", + "Exit":"Sortir", + "Help":"Aide", + "Restore":"Restaurer éléments", + "Back":"Retour", + "Free":"Gratuit", + "Install":"Installer", + "Installed":"Installés", + "BuyNow":"Acheter", + "DontSeeYourItems":"VOUS NE VOYEZ PAS VOS ÉLÉMENTS?", + "TapOnRestore":"Appuyez vite sur le bouton RESTAURER ÉLÉMENTS pour les afficher." + } + ] + }, + { + "it": + [ + { + "LoadingItems":"Caricamento elementi...", + "PurchasingItem":"Acquisto elemento...", + "DownloadingItem":"Download elemento...", + "RestoringItems":"Ripristino elementi...", + "RestoreNothing":"0 elementi ripristinati.", + "RestoreNumItems":"Ripristino elementi: %d di %d...", + "RestoreFinished":"Ripristino terminato.", + "MyStuff":"I miei oggetti", + "New":"Nuovo", + "More":"Altro", + "Dismiss":"Elimina", + "Cancel":"Annulla", + "Close":"Chiudi", + "LowVersionMsg":"Per scaricare altri fantastici contenuti ora disponibili per i tuoi giochi, aggiorna il software del tuo iTunes. È semplice:\n1. Collega il dispositivo al tuo computer\n2. Apri iTunes\n3. Fai clic su “AGGIORNA”", + "InsufficientSpaceMsg":"Non disponi dello spazio necessario per installare questo elemento. Libera dello spazio e riprova.", + "FreeItemsRestoreMsg":"Questo gioco contiene esclusivamente degli elementi gratuiti. Per ripristinare i contenuti gratuiti precedentemente scaricati, devi semplicemente eseguire di nuovo il download.", + "Exit":"Uscita", + "Help":"Aiuto", + "Restore":"Ripristinare elementi", + "Back":"Indietro", + "Free":"Gratis", + "Install":"Installare", + "Installed":"Istallato", + "BuyNow":"Aquistare", + "DontSeeYourItems":"NON VEDI I TUOI ELEMENTI?", + "TapOnRestore":"Tocca il pulsante RIPRISTINA ELEMENTI per visualizzarli" + } + ] + }, + { + "de": + [ + { + "LoadingItems":"Objekte werden geladen ...", + "PurchasingItem":"Objekt wird gekauft ...", + "DownloadingItem":"Objekt wird heruntergeladen ...", + "RestoringItems":"Objekte werden wiederhergestellt ...", + "RestoreNothing":"0 Objekte wiederhergestellt.", + "RestoreNumItems":"Objekte werden wiederhergestellt: %d von %d ...", + "RestoreFinished":"Wiederherstellen abgeschlossen.", + "MyStuff":"Meine Objekte", + "New":"Neu", + "More":"Mehr", + "Dismiss":"Abbrechen", + "Cancel":"Abbrechen", + "Close":"Schließen", + "LowVersionMsg":"Aktualisiere bitte deine iTunes-Software, um weitere fantastische Inhalte für deine Spiele herunterzuladen. Das Update geht ganz einfach:\n1. Verbinde dein Gerät mit deinem Computer\n2. Öffne iTunes\n3. Klicke auf “UPDATE”", + "InsufficientSpaceMsg":"Nicht genügend Speicherplatz für die Installation vorhanden. Bitte mach Speicherplatz frei und versuche es erneut.", + "FreeItemsRestoreMsg":"Das Spiel enthält ausschließlich kostenlose Objekte. Lade dir das kostenlose Objekt/die kostenlosen Objekte einfach erneut herunter, um zuvor heruntergeladene kostenlose Inhalte wiederherzustellen.", + "Exit":"Ausfahrt", + "Help":"Hilfe", + "Restore":"Objecte wiederherstellen", + "Back":"Zurück", + "Free":"Gratis", + "Install":"Installieren", + "Installed":"Installiert", + "BuyNow":"Kaufen", + "DontSeeYourItems":"SIEHST DU DEINE OBJEKTE NICHT?", + "TapOnRestore":"Tippe den Button OBJEKTE WIEDERHERSTELLEN an damit sie angezeigt werden" + } + ] + }, + { + "es": + [ + { + "LoadingItems":"Cargando artículos ...", + "PurchasingItem":"Comprando artículo ...", + "DownloadingItem":"Descargando artículo ...", + "RestoringItems":"Restaurando artículos ...", + "RestoreNothing":"0 artículos restaurados.", + "RestoreNumItems":"Restaurando %d de %d artículos ...", + "RestoreFinished":"Restauración finalizada.", + "MyStuff":"Mis cosas", + "New":"Nuevo", + "More":"Más", + "Dismiss":"Descartar", + "Cancel":"Cancelar", + "Close":"Cerrar", + "LowVersionMsg":"Para descargar más contenidos apasionantes disponibles actualmente para tus juegos, actualiza tu software iTunes. Es fácil:\n1. Conecta el dispositivo a tu ordenador\n2. Abre iTunes\n3. Pincha en “ACTUALIZAR”", + "InsufficientSpaceMsg":"No dispones del espacio suficiente disponible para instalar este elemento. Por favor libera algo de espacio e inténtalo de nuevo.", + "FreeItemsRestoreMsg":"El juego solo contiene objetos gratuitos. Para restablecer contenido gratuito descargado anteriormente no tienes más que volver a descargar los objetos gratuitos.", + "Exit":"Salida", + "Help":"Ayuda", + "Restore":"Restablecer objectos", + "Back":"Atrás", + "Free":"Gratis", + "Install":"Instalar", + "Installed":"Instalado", + "BuyNow":"Comprar", + "DontSeeYourItems":"¿NO VES TUS OBJETOS?", + "TapOnRestore":"Toca el botón RESTABLECER OBJETOS para verlos" + } + ] + }, + { + "ja": + [ + { + "LoadingItems":"アイテムロード中 ...", + "PurchasingItem":"アイテム購入中 ...", + "DownloadingItem":"アイテムダウンロード中 ...", + "RestoringItems":"アイテム復元中 ...", + "RestoreNothing":"0アイテムを復元.", + "RestoreNumItems":"%d/%dアイテムを復元中 ...", + "RestoreFinished":"復元完了.", + "MyStuff":"マイスタッフ", + "New":"新規", + "More":"もっと", + "Dismiss":"棄却", + "Cancel":"キャンセル", + "Close":"Close", + "LowVersionMsg":"EAのコンテンツをダウンロードするにはiPhone®/iPod touch®のソフトウェアを更新する必要があります。手順は簡単です:\n1. 本体をコンピュータに接続\n2. iTunesを起動\n3. 「更新」をクリック", + "InsufficientSpaceMsg":"このアイテムをインストールするために必要な空き容量がありません。十分の空き容量を確保してから再度お試しください。", + "FreeItemsRestoreMsg":"The game only contains free items. To restore previously downloaded free content, simply download the free item(s) again.", + "Exit":"終了", + "Help":"ヘルプ", + "Restore":"アイテムを復元", + "Back":"戻る", + "Free":"無料", + "Install":"インストール", + "Installed":"インストール済み", + "BuyNow":"購入", + "DontSeeYourItems":"晡六したアイテムが見つからないですか?", + "TapOnRestore":"「晡六済みのアイテムを役元」ボタンを捭してくださし!" + } + ] + }, + { + "zh": + [ + { + "LoadingItems":"载入项目...", + "PurchasingItem":"购买项目...", + "DownloadingItem":"下载项目...", + "RestoringItems":"恢复项目...", + "RestoreNothing":"恢复0个项目。", + "RestoreNumItems":"恢复 %d / %d 项目", + "RestoreFinished":"恢复项目完成。", + "MyStuff":"我的东西", + "New":"新的", + "More":"更多", + "Dismiss":"放弃", + "Cancel":"取消", + "Close":"关闭", + "LowVersionMsg":"你的游戏现在有更多很棒的内容可以下载,请升级你的iTunes软件。只要:\n1. 连结你的装置到你的计算机\n2. 打开iTunes\n3. 点击“升级”", + "InsufficientSpaceMsg":"你没有足够的空间安装这个项目。请清出一些空间再重试。", + "FreeItemsRestoreMsg":"The game only contains free items. To restore previously downloaded free content, simply download the free item(s) again.", + "Exit":"退出", + "Help":"帮助", + "Restore":"恢复项目", + "Back":"返回", + "Free":"免费", + "Install":"安装", + "Installed":"已安装", + "BuyNow":"现在购买", + "DontSeeYourItems":"没看到您的物品?", + "TapOnRestore":"点击“还原物品”键以查看" + } + ] + }, + { + "ko": + [ + { + "LoadingItems":"아이템 로드 중...", + "PurchasingItem":"아이템 구매 중...", + "DownloadingItem":"아이템 다운로드 중...", + "RestoringItems":"아이템 복원 중...", + "RestoreNothing":"복원된 아이템이 없습니다.", + "RestoreNumItems":"%d / %d 아이템이 복원되었습니다.", + "RestoreFinished":"복원 완료", + "MyStuff":"내 아이템", + "New":"신규", + "More":"더 보기", + "Dismiss":"무시", + "Cancel":"취소", + "Close":"닫기", + "LowVersionMsg":"현재 이용 가능한 게임의 더 많은 콘텐츠를 다운로드하려면, itunes 소프트웨어를 업데이트 해 주십시오. 쉽습니다. :\n1. 장치를 컴퓨터에 연결해 주십시오.\n2. iTunes를 엽니다.\n3. “UPDATE” / “업데이트“ 클릭", + "InsufficientSpaceMsg":"이 아이템을 설치할 공간이 부족합니다. 여유 공간을 확보하고 다시 시도해 주십시오.", + "FreeItemsRestoreMsg":"The game only contains free items. To restore previously downloaded free content, simply download the free item(s) again.", + "Exit":"출구", + "Help":"도움", + "Restore":"항목을 복원", + "Back":"뒤로", + "Free":"무료", + "Install":"설치", + "Installed":"설치되어", + "BuyNow":"구매", + "DontSeeYourItems":"원하는항목을찾을수없습니까?", + "TapOnRestore":"구매항목눌릭오기버튼을클릭해보세요" + } + ] + }, + { + "pt": + [ + { + "LoadingItems":"Carregando Itens ...", + "PurchasingItem":"Comprando Item ...", + "DownloadingItem":"Recebendo Item ...", + "RestoringItems":"Restaurando Itens ...", + "RestoreNothing":"0 item restaurado.", + "RestoreNumItems":"Restaurando %d de %d itens", + "RestoreFinished":"Restauração concluída.", + "MyStuff":"Minhas Coisas", + "New":"Novo", + "More":"Mais", + "Dismiss":"Descartar", + "Cancel":"Cancelar", + "Close":"Fechar", + "LowVersionMsg":"Para fazer o download de outros conteúdos incríveis disponíveis para seus jogos, atualize seu software do iTunes. É fácil:\n1. Conecte seu aparelho ao seu computador\n2. Abra o iTunes\n3. Clique em “ATUALIZAR”", + "InsufficientSpaceMsg":"Você não tem o espaço suficiente necessário para instalar este item. Libere um pouco de espaço e tente novamente.\",", + "FreeItemsRestoreMsg":"O jogo contém apenas itens grátis. Para restaurar o conteúdo grátis obtido anteriormente, é só fazer o download dos itens novamente.", + "Exit":"Sair", + "Help":"Ajuda", + "Restore":"Ajuda", + "Back":"Voltar", + "Free":"Grátis", + "Install":"INSTALAR", + "Installed":"INSTALADO", + "BuyNow":"COMPRAR", + "DontSeeYourItems":"NÃO ESTÁ VENDO SEUS ITENS?", + "TapOnRestore":"Toque no botão Restaurar Itens para visualizá-los. " + } + ] + }, + { + "ru": + [ + { + "LoadingItems":"Загрузка списка продуктов ...", + "PurchasingItem":"Покупка ...", + "DownloadingItem":"Загружаю ...", + "RestoringItems":"Восстановление покупок ...", + "RestoreNothing":"0 объектов восстановлено.", + "RestoreNumItems":"Восстановление %d из %d покупок", + "RestoreFinished":"Восстановление выполнено.", + "MyStuff":"Мои покупки", + "New":"Новое", + "More":"Другое", + "Dismiss":"Прервать", + "Cancel":"Отмена", + "Close":"Закрыть", + "LowVersionMsg":"Для того чтобы загрузить больше интересного контента для ваших игр, обновите приложение iTunes. Это очень просто:\n1. Подсоедините мобильное устройство к своему компьютеру\n2. Запустите iTunes\n3. Нажмите «ОБНОВИТЬ»", + "InsufficientSpaceMsg":"У вас недостаточно свободного места для установки. Освободите место и попробуйте еще раз.", + "FreeItemsRestoreMsg":"Игра содержит только бесплатные объекты. Для восстановления ранее загруженного бесплатного контента повторно загрузите бесплатные объекты.", + "Exit":"Выход", + "Help":"Справка", + "Restore":"Восстановление покупок", + "Back":"Назад", + "Free":"Бесплатно", + "Install":"Установить", + "Installed":"Установлено", + "BuyNow":"Купить", + "DontSeeYourItems":"Не видишь своих покупок?", + "TapOnRestore":"Нажми на кнопку восстановления покупок" + } + ] + }, + { + "nl": + [ + { + "LoadingItems":"Artikels laden ...", + "PurchasingItem":"Artikel kopen ...", + "DownloadingItem":"Artikel downloaden ...", + "RestoringItems":"Artikels herstellen ...", + "RestoreNothing":"0 artikels hersteld.", + "RestoreNumItems":"%d van %d artikels herstellen", + "RestoreFinished":"Herstellen voltooid", + "MyStuff":"Mijn games", + "New":"Nieuw", + "More":"Meer", + "Dismiss":"Negeren", + "Cancel":"Annuleren", + "Close":"Sluiten", + "LowVersionMsg":"Om meer geweldige content te downloaden die momenteel voor je games verkrijgbaar is, werk je de software van iTunes bij. Dat is heel eenvoudig:\n1. Sluit je apparatuur aan op de computer\n2. Open iTunes\n3. Klik op “BIJWERKEN”", + "InsufficientSpaceMsg":"Je hebt niet voldoende ruimte om dit product te installeren. Maak ruimte vrij en probeer het opnieuw.\",", + "FreeItemsRestoreMsg":"Het spel bevat alleen gratis artikels. Om gratis content te herstellen die je eerder hebt gedownload, download je de gratis artikel(s) opnieuw.", + "Exit":"Afsluiten", + "Help":"Help", + "Restore":"Artikels herstellen", + "Back":"Terug", + "Free":"Gratis", + "Install":"INSTALLEREN", + "Installed":"GEÏNSTALLEERD", + "BuyNow":"KOOP NU", + "DontSeeYourItems":"ZIE JE GEEN ARTIKELS?", + "TapOnRestore":"Tik op de knop Artikels herstellen om ze weer te geven. " + } + ] + } + ] +} diff --git a/app/src/main/assets/EASP/TextStyles.css b/app/src/main/assets/EASP/TextStyles.css new file mode 100644 index 0000000..4806ef3 --- /dev/null +++ b/app/src/main/assets/EASP/TextStyles.css @@ -0,0 +1,174 @@ +// Supported parameters: +// +// font-size :Npx or Npt. (font-size : 12px) (font-size : 12pt) +// font-style :normal,italic,oblique +// font-weight :normal,bold +// font-variant :normal,small-caps +// font-pitch :variable,fixed +// font-smooth :auto,never,always +// font-stretch :N +// font-emphasize-style :none,accent,dot,circle,disc +// font-emphasize-position :before,after +// text-decoration :underline,overline,line-through +// text-linespacing :N +// text-letterspacing :(letter-spacing: 12px) (letter-spacing: -0.5px) +// text-wordspacing :N +// text-align :left,center,right,justify +// text-valign :top,middle,bottom +// text-justify :inter-word,inter-ideograph,distribute,newspaper,inter-cluster,kashida +// text-overflow-mode :none,clip,ellipsis,ellipsis-word +// color :#RGB or #RGBA. (color : #cc2255) (color : #cc2255ff) +// background-color :#RGB or #RGBA. (color : #cc2255) (color : #cc2255ff) +// wrap-option :wrap,no-wrap,soft-wrap,hard-wrap,emergency +// digit-substitution :none,context,western,national,traditional +// password-mode :none,password + +@font "arial*.ttf" ; +//@font "terminal.ttf" ; +//@font "comic*.ttf" ; +//@font "cour.ttf" ; +//@font "ravie regular.ttf"; +//@font "candara*.ttf"; + +EASPDefaultTextStyle{ + font-family:"Arial Unicode MS", "Arial"; + font-smooth:always; + font-weight:normal; + font-size:8px; +} + +DefaultText(0x0f170dc1) : EASPDefaultTextStyle{ +} + +// this should be defined by the application; all UTFWinControls will default to this style +WindowDefaultStyle(1) : EASPDefaultTextStyle { +} + + +TextEditStyle(0x01010202) : EASPDefaultTextStyle{ + font-family:"cour"; + font-size:24px; + /*font-effect: outline 2 2 #0000ff #000000]*/ +} + +DialogTitle(0xacbf4564) : EASPDefaultTextStyle{ + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; +} + +ButtonCaption(0xaf14b67e) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:center; +} + +LargeButtonCaption(0xaf90b579) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:center; + font-size:24px; + font-weight:bold; +} + +WatchWindowLabel(0x6fb342b7) : EASPDefaultTextStyle{ + font-size:8px; + text-valign:middle; + text-align:right; +} + +WatchWindowValue(0x6fb342b8) : EASPDefaultTextStyle{ + font-size:8px; + text-valign:middle; + text-align:left; +} + +MediumButtonCaption(0xdeadfeed) : EASPDefaultTextStyle{ + font-family:"Arial Unicode MS"; + text-valign:middle; + text-align:left; + font-size:15px; +} + +OriginStandart(0x6fb342b9) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:left; + font-size:8px; +} + +OriginHypertext(0x846af2dc) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:left; + font-size:8px; + text-decoration:underline; +} + +OriginBold(0x6fb342ba) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:left; + font-size:8px; + font-weight:bold; +} + +OriginBig(0x6fb342bb) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:left; + font-size:15px; +} + +OriginMB(0x6fb342be) : EASPDefaultTextStyle{ + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; + text-align:left; + font-size:10px; +} + +OriginPassword(0x6fb342bc) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:left; + font-size:8px; + password-mode:password; +} + +ButtonCaption_480x800(0x1f68321c) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:center; + font-size:12px; + font-weight:bold; +} + +DialogTitle_480x800(0xcc84fea0) : EASPDefaultTextStyle{ + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; + font-size:12px; + font-weight:bold; +} + +DialogTitle_480x800_DMG(0x0db7c2e0) : EASPDefaultTextStyle{ + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; + font-size:11px; + font-weight:bold; +} + +DialogTitle_DMG(0x0db7c300) : EASPDefaultTextStyle{ + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; + font-size:8px; +} + +WatchWindowLabel_480x800(0xbd9cec49) : EASPDefaultTextStyle{ + font-size:12px; + text-valign:middle; + text-align:right; + font-weight:bold; +} + +OriginDigits(0x6fb348bc) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:left; + font-size:8px; + digit-substitution:context; +} diff --git a/app/src/main/assets/EASP/TextStyles_android.css b/app/src/main/assets/EASP/TextStyles_android.css new file mode 100644 index 0000000..e92461c --- /dev/null +++ b/app/src/main/assets/EASP/TextStyles_android.css @@ -0,0 +1,171 @@ +// Supported parameters: +// +// font-size :Npx or Npt. (font-size : 12px) (font-size : 12pt) +// font-style :normal,italic,oblique +// font-weight :normal,bold +// font-variant :normal,small-caps +// font-pitch :variable,fixed +// font-smooth :auto,never,always +// font-stretch :N +// font-emphasize-style :none,accent,dot,circle,disc +// font-emphasize-position :before,after +// text-decoration :underline,overline,line-through +// text-linespacing :N +// text-letterspacing :(letter-spacing: 12px) (letter-spacing: -0.5px) +// text-wordspacing :N +// text-align :left,center,right,justify +// text-valign :top,middle,bottom +// text-justify :inter-word,inter-ideograph,distribute,newspaper,inter-cluster,kashida +// text-overflow-mode :none,clip,ellipsis,ellipsis-word +// color :#RGB or #RGBA. (color : #cc2255) (color : #cc2255ff) +// background-color :#RGB or #RGBA. (color : #cc2255) (color : #cc2255ff) +// wrap-option :wrap,no-wrap,soft-wrap,hard-wrap,emergency +// digit-substitution :none,context,western,national,traditional +// password-mode :none,password + +@font "DroidSansFallback.ttf"; +@font "DroidSans.ttf"; +@font "DroidSans-Bold.ttf"; + +EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + font-smooth:always; + font-weight:normal; + font-size:8px; +} + +DefaultText(0x0f170dc1) : EASPDefaultTextStyle{ +} + +// this should be defined by the application; all UTFWinControls will default to this style +WindowDefaultStyle(1) : EASPDefaultTextStyle { + font-family:"Droid Sans", "Droid Sans Fallback"; +} + + +TextEditStyle(0x01010202) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + font-size:24px; + /*font-effect: outline 2 2 #0000ff #000000]*/ +} + +DialogTitle(0xacbf4564) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; +} + +ButtonCaption(0xaf14b67e) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-align:center; +} + +LargeButtonCaption(0xaf90b579) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-align:center; + font-size:30px; + font-weight:bold; +} + +WatchWindowLabel(0x6fb342b7) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + font-size:8px; + text-valign:middle; + text-align:right; +} + +WatchWindowValue(0x6fb342b8) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + font-size:8px; + text-valign:middle; + text-align:left; +} + +OriginStandart(0x6fb342b9) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-align:left; + font-size:8px; +} + +OriginBold(0x6fb342ba) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-align:left; + font-size:8px; + font-weight:bold; +} + +OriginBig(0x6fb342bb) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-align:left; + font-size:15px; +} + +OriginMB(0x6fb342be) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + wrap-option:no-wrap; + text-overflow-mode:ellipsis; + text-align:left; + font-size:10px; +} + +OriginHypertext(0x846af2dc) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:left; + font-size:8px; + text-decoration:underline; +} + +OriginPassword(0x6fb342bc) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-align:left; + font-size:8px; + password-mode:password; +} + +ButtonCaption_480x800(0x1f68321c) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-align:center; + font-size:12px; + font-weight:bold; +} + +DialogTitle_480x800(0xcc84fea0) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; + font-size:12px; + font-weight:bold; +} + +WatchWindowLabel_480x800(0xbd9cec49) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + font-size:12px; + text-valign:middle; + text-align:right; + font-weight:bold; +} + +MediumButtonCaption(0xdeadfeed) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-align:left; + font-size:15px; +} + +OriginDigits(0x6fb348bc) : EASPDefaultTextStyle{ + font-family:"Droid Sans", "Droid Sans Fallback"; + text-valign:middle; + text-align:left; + font-size:8px; + digit-substitution:context; +} diff --git a/app/src/main/assets/EASP/TextStyles_iphone.css b/app/src/main/assets/EASP/TextStyles_iphone.css new file mode 100644 index 0000000..a735599 --- /dev/null +++ b/app/src/main/assets/EASP/TextStyles_iphone.css @@ -0,0 +1,260 @@ +// Supported parameters: +// +// font-size :Npx or Npt. (font-size : 12px) (font-size : 12pt) +// font-style :normal,italic,oblique +// font-weight :normal,bold +// font-variant :normal,small-caps +// font-pitch :variable,fixed +// font-smooth :auto,never,always +// font-stretch :N +// font-emphasize-style :none,accent,dot,circle,disc +// font-emphasize-position :before,after +// text-decoration :underline,overline,line-through +// text-linespacing :N +// text-letterspacing :(letter-spacing: 12px) (letter-spacing: -0.5px) +// text-wordspacing :N +// text-align :left,center,right,justify +// text-valign :top,middle,bottom +// text-justify :inter-word,inter-ideograph,distribute,newspaper,inter-cluster,kashida +// text-overflow-mode :none,clip,ellipsis,ellipsis-word +// color :#RGB or #RGBA. (color : #cc2255) (color : #cc2255ff) +// background-color :#RGB or #RGBA. (color : #cc2255) (color : #cc2255ff) +// wrap-option :wrap,no-wrap,soft-wrap,hard-wrap,emergency +// digit-substitution :none,context,western,national,traditional +// password-mode :none,password + +@font "Arial.ttf"; +@font "ArialBold.ttf"; +@font "STHeiti-Medium.ttc"; +@font "AppleGothic.ttf"; +@font "AppleGothic.otf"; + +EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + font-smooth:always; + font-weight:normal; + font-size:8px; +} + +DefaultText(0x0f170dc1) : EASPDefaultTextStyle{ +} + +// this should be defined by the application; all UTFWinControls will default to this style +WindowDefaultStyle(1) : EASPDefaultTextStyle { + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; +} + + +TextEditStyle(0x01010202) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + font-size:24px; + /*font-effect: outline 2 2 #0000ff #000000]*/ +} + +DialogTitle(0xacbf4564) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; +} + +DialogTitle_480x800_DMG(0x0db7c2e0) : EASPDefaultTextStyle{ + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; + font-size:11px; + font-weight:bold; +} + +DialogTitle_DMG(0x0db7c300) : EASPDefaultTextStyle{ + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; + font-size:8px; +} + +ButtonCaption(0xaf14b67e) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-align:center; +} + +LargeButtonCaption(0xaf90b579) : EASPDefaultTextStyle{ + font-family:"Arial", "STHeiti", "AppleGothic"; + text-valign:middle; + text-align:center; + font-size:30px; + font-weight:bold; +} + +WatchWindowLabel(0x6fb342b7) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + font-size:8px; + text-valign:middle; + text-align:right; +} + +WatchWindowValue(0x6fb342b8) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + font-size:8px; + text-valign:middle; + text-align:left; +} + +OriginStandart(0x6fb342b9) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-align:left; + font-size:8px; + text-overflow-mode:ellipsis; +} + +OriginBold(0x6fb342ba) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-align:left; + font-size:8px; + /*font-weight:bold;*/ +} + +OriginBig(0x6fb342bb) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-align:left; + font-size:15px; +} + +OriginMB(0x6fb342be) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; + text-valign:middle; + text-align:left; + font-size:10px; +} + +OriginPassword(0x6fb342bc) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-align:left; + font-size:8px; + password-mode:password; +} + +ButtonCaption_480x800(0x1f68321c) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-align:center; + font-size:12px; + font-weight:bold; +} + +DialogTitle_480x800(0xcc84fea0) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-overflow-mode:ellipsis; + wrap-option:no-wrap; + font-size:12px; + font-weight:bold; +} + +WatchWindowLabel_480x800(0xbd9cec49) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + font-size:12px; + text-valign:middle; + text-align:right; + font-weight:bold; +} + +OriginHypertext(0x846af2dc) : EASPDefaultTextStyle{ + text-valign:middle; + text-align:left; + font-size:8px; + text-decoration:underline; +} + +MediumButtonCaption(0xdeadfeed) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-align:left; + font-size:15px; +} + +OriginDigits(0x6fb348bc) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + text-valign:middle; + text-align:left; + font-size:8px; + digit-substitution:context; +} + +OriginIOS(0x0da7bac0) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + font-size:11px; + text-valign:middle; + text-align:right; + font-weight:bold; +} + +OriginIOS2(0x0da7c280) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + font-size:9px; + text-valign:middle; + text-align:right; + font-weight:bold; + text-overflow-mode:ellipsis; +} + +OriginIOS3(0x0da7ccf0) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + font-size:13px; + text-overflow-mode:ellipsis; + text-valign:middle; + text-align:right; + font-weight:bold; +} + +OriginIOS4(0x0da812a0) : EASPDefaultTextStyle{ + font-family:"Arial", "AppleGothic", "Heiti TC", ".Heiti J", ".Heiti K", "Heiti SC", "STHeiti"; + font-size:10px; + text-valign:middle; + text-align:right; + font-weight:bold; +} + +OriginIOSnom7(0x0dafd280) : EASPDefaultTextStyle{ + font-size:7px; + text-valign:middle; + text-align:right; +} + +OriginIOSnom8(0x0dafd2a0) : EASPDefaultTextStyle{ + font-size:8px; + text-valign:middle; + text-align:right; +} + +OriginIOSnom9(0x0dafd2d0) : EASPDefaultTextStyle{ + font-size:9px; + text-valign:middle; + text-align:right; +} + +OriginIOSnom9l(0x0dafee30) : EASPDefaultTextStyle{ + font-size:9px; + text-valign:middle; + text-align:left; +} + +OriginIOSnom10(0x0dafd2f0) : EASPDefaultTextStyle{ + font-size:10px; + text-valign:middle; + text-align:right; + font-weight:bold; +} + +OriginIOSnom14(0x0dafd310) : EASPDefaultTextStyle{ + font-size:14px; + text-valign:middle; + text-align:right; +} diff --git a/app/src/main/assets/EASP/WinSet/Package/Android/EASP.package b/app/src/main/assets/EASP/WinSet/Package/Android/EASP.package new file mode 100644 index 0000000..6d22d6b Binary files /dev/null and b/app/src/main/assets/EASP/WinSet/Package/Android/EASP.package differ diff --git a/app/src/main/assets/EASP/WinSet/Package/Android/EASP1.package b/app/src/main/assets/EASP/WinSet/Package/Android/EASP1.package new file mode 100644 index 0000000..136bbc6 Binary files /dev/null and b/app/src/main/assets/EASP/WinSet/Package/Android/EASP1.package differ diff --git a/app/src/main/assets/EASP/WinSet/Package/iOS/EASP.package b/app/src/main/assets/EASP/WinSet/Package/iOS/EASP.package new file mode 100644 index 0000000..4aff13d Binary files /dev/null and b/app/src/main/assets/EASP/WinSet/Package/iOS/EASP.package differ diff --git a/app/src/main/assets/EASP/WinSet/Package/iOS/EASP1.package b/app/src/main/assets/EASP/WinSet/Package/iOS/EASP1.package new file mode 100644 index 0000000..bb5195a Binary files /dev/null and b/app/src/main/assets/EASP/WinSet/Package/iOS/EASP1.package differ diff --git a/app/src/main/assets/EASP/WinSet/resource_Android.cfg b/app/src/main/assets/EASP/WinSet/resource_Android.cfg new file mode 100644 index 0000000..e928d0f --- /dev/null +++ b/app/src/main/assets/EASP/WinSet/resource_Android.cfg @@ -0,0 +1,21 @@ +# Resource configuration script for the EASP project + +# File types unique id's +PackedFile Package/Android/EASP.package +PackedFile Package/Android/EASP1.package + +FileType 0x2f7d0002 jpeg +FileType 0x2f7d0004 png +FileType 0x025C95B6 layout + +# common group +#Group 0x0fbda36d +#DirectoryFiles ./... autoupdate + +# StoreUI group +#Group 0x0fbda36e +#DirectoryFiles StoreUI/... autoupdate + +# DMG group +#Group 0x4f5ee58d +#DirectoryFiles DMG/... autoupdate diff --git a/app/src/main/assets/EASP/WinSet/resource_iOS.cfg b/app/src/main/assets/EASP/WinSet/resource_iOS.cfg new file mode 100644 index 0000000..5a8931d --- /dev/null +++ b/app/src/main/assets/EASP/WinSet/resource_iOS.cfg @@ -0,0 +1,21 @@ +# Resource configuration script for the EASP project + +# File types unique id's +PackedFile Package/iOS/EASP.package +PackedFile Package/iOS/EASP1.package + +FileType 0x2f7d0002 jpeg +FileType 0x2f7d0004 png +FileType 0x025C95B6 layout + +# common group +#Group 0x0fbda36d +#DirectoryFiles ./... autoupdate + +# StoreUI group +#Group 0x0fbda36e +#DirectoryFiles StoreUI/... autoupdate + +# DMG group +#Group 0x4f5ee58d +#DirectoryFiles DMG/... autoupdate diff --git a/app/src/main/assets/EASP/synergy-GeoTrustGlobalCA.crt b/app/src/main/assets/EASP/synergy-GeoTrustGlobalCA.crt new file mode 100644 index 0000000..bcb2529 --- /dev/null +++ b/app/src/main/assets/EASP/synergy-GeoTrustGlobalCA.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg +R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 +9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE----- diff --git a/app/src/main/assets/EASP/synergy-GeoTrustSSLCA.crt b/app/src/main/assets/EASP/synergy-GeoTrustSSLCA.crt new file mode 100644 index 0000000..a2c26f8 --- /dev/null +++ b/app/src/main/assets/EASP/synergy-GeoTrustSSLCA.crt @@ -0,0 +1,23 @@ +-----BEGIN CERTIFICATE----- +MIID2TCCAsGgAwIBAgIDAjbQMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMTAwMjE5MjIzOTI2WhcNMjAwMjE4MjIzOTI2WjBAMQswCQYDVQQG +EwJVUzEXMBUGA1UEChMOR2VvVHJ1c3QsIEluYy4xGDAWBgNVBAMTD0dlb1RydXN0 +IFNTTCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJCzgMHk5Uat +cGA9uuUU3Z6KXot1WubKbUGlI+g5hSZ6p1V3mkihkn46HhrxJ6ujTDnMyz1Hr4Gu +FmpcN+9FQf37mpc8oEOdxt8XIdGKolbCA0mEEoE+yQpUYGa5jFTk+eb5lPHgX3UR +8im55IaisYmtph6DKWOy8FQchQt65+EuDa+kvc3nsVrXjAVaDktzKIt1XTTYdwvh +dGLicTBi2LyKBeUxY0pUiWozeKdOVSQdl+8a5BLGDzAYtDRN4dgjOyFbLTAZJQ50 +96QhS6CkIMlszZhWwPKoXz4mdaAN+DaIiixafWcwqQ/RmXAueOFRJq9VeiS+jDkN +d53eAsMMvR8CAwEAAaOB2TCB1jAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFEJ5 +VBthzVUrPmPVPEhX9Z/7Rc5KMB8GA1UdIwQYMBaAFMB6mGiNifurBWQMEX2qfWW4 +ysxOMBIGA1UdEwEB/wQIMAYBAf8CAQAwOgYDVR0fBDMwMTAvoC2gK4YpaHR0cDov +L2NybC5nZW90cnVzdC5jb20vY3Jscy9ndGdsb2JhbC5jcmwwNAYIKwYBBQUHAQEE +KDAmMCQGCCsGAQUFBzABhhhodHRwOi8vb2NzcC5nZW90cnVzdC5jb20wDQYJKoZI +hvcNAQEFBQADggEBANTvU4ToGr2hiwTAqfVfoRB4RV2yV2pOJMtlTjGXkZrUJPji +J2ZwMZzBYlQG55cdOprApClICq8kx6jEmlTBfEx4TCtoLF0XplR4TEbigMMfOHES +0tdT41SFULgCy+5jOvhWiU1Vuy7AyBh3hjELC3DwfjWDpCoTZFZnNF0WX3OsewYk +2k9QbSqr0E1TQcKOu3EDSSmGGM8hQkx0YlEVxW+o78Qn5Rsz3VqI138S0adhJR/V +4NwdzxoQ2KDLX4z6DOW/cf/lXUQdpj6HR/oaToODEj+IZpWYeZqF6wJHzSXj8gYE +TpnKXKBuervdo5AaRTPvvz7SBMS24CqFZUE+ENQ= +-----END CERTIFICATE----- diff --git a/app/src/main/assets/EASP/synergy-stage.geotrustSSLDV.crt b/app/src/main/assets/EASP/synergy-stage.geotrustSSLDV.crt new file mode 100644 index 0000000..0f14bee --- /dev/null +++ b/app/src/main/assets/EASP/synergy-stage.geotrustSSLDV.crt @@ -0,0 +1,28 @@ +-----BEGIN CERTIFICATE----- +MIIE0jCCA7qgAwIBAgIQBzTcEW30pFfSlAEd3F7JmDANBgkqhkiG9w0BAQsFADBC +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMS +UmFwaWRTU0wgU0hBMjU2IENBMB4XDTE1MDgxMDAwMDAwMFoXDTE2MDgxMDIzNTk1 +OVowgY8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRUwEwYDVQQH +DAxSZWR3b29kIENpdHkxHjAcBgNVBAoMFUVsZWN0cm9uaWMgQXJ0cywgSW5jLjEb +MBkGA1UECwwSRUEgT25saW5lL1BvZ28uY29tMRcwFQYDVQQDDA4qLmVhbW9iaWxl +LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJxGyfYX5HpisvpL +ds39iL0pTEBigmSeJKiZBu4sq5Pre4dvUphsUDBFxRvEnukCFvzTkRDe4cQFL9u5 +joafNFia1DvakfqMEnMp5nb39XXUe+onsDXgTMTq4WuAAaMB5MfZuhFSTFb5IemY +nF5YsfPcb3Klu6KNaqMKin06B9BO1K8lZYWV0s5X4FO/9lLJ3j7HGfkJJQyk26tF +35WpHpAzVP+kBmyg6UPXjjQMbksgNHjSi5+8nmE6pDMzeZfqUnkIqPzzJcCW1bDP +bOWwRYSiCHiGrzgYN8G3KugQxyRj6KyK6lduQquLT2vmpASqoJ/8Em3+8g5Sqxa1 +4vFnpKUCAwEAAaOCAXQwggFwMBkGA1UdEQQSMBCCDiouZWFtb2JpbGUuY29tMAwG +A1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMB +BggrBgEFBQcDAjBvBgNVHSAEaDBmMGQGBmeBDAECAjBaMCoGCCsGAQUFBwIBFh5o +dHRwczovL3d3dy5yYXBpZHNzbC5jb20vbGVnYWwwLAYIKwYBBQUHAgIwIBoeaHR0 +cHM6Ly93d3cucmFwaWRzc2wuY29tL2xlZ2FsMB8GA1UdIwQYMBaAFJfCJ1Cewsns +DIgyyHyt4qYBT9pvMCsGA1UdHwQkMCIwIKAeoByGGmh0dHA6Ly9ncC5zeW1jYi5j +b20vZ3AuY3JsMFcGCCsGAQUFBwEBBEswSTAfBggrBgEFBQcwAYYTaHR0cDovL2dw +LnN5bWNkLmNvbTAmBggrBgEFBQcwAoYaaHR0cDovL2dwLnN5bWNiLmNvbS9ncC5j +cnQwDQYJKoZIhvcNAQELBQADggEBACK5Z3Oz18wjz2bervbh04WmqqlzihNBhXoN +zjjpmzmDPIkfO4Q5XX7fqcQ0eBZMWrJRWhPSkoCTggOtUA/J23zVOwjF1MTLD9ZS +kNzX3rmjE/oJchXdFBQOAxJo3hri3gQlJfwZzRyszta3VTT1KhfiXEJUCaca+K+i +RLoCvRyYBJo64HxxYWRZbpe9f7Y5imM2eXblOgWSAJyby30/W0ByyukLiQE7lVdN +dlMabCCgxGttaEC5aAV46TAzPQlWyU0fUFSxMsmDdTvU0cgyUYLTh8gvR1q4oVGa +pLU96MpmvXDn5toK8HvSHW9WeylVpvCTjkfgQB3aiUohsyb4daY= +-----END CERTIFICATE----- diff --git a/app/src/main/assets/downloadcontent/adc-wifi0.png b/app/src/main/assets/downloadcontent/adc-wifi0.png new file mode 100644 index 0000000..668c76c Binary files /dev/null and b/app/src/main/assets/downloadcontent/adc-wifi0.png differ diff --git a/app/src/main/assets/downloadcontent/adc-wifi1.png b/app/src/main/assets/downloadcontent/adc-wifi1.png new file mode 100644 index 0000000..66d0733 Binary files /dev/null and b/app/src/main/assets/downloadcontent/adc-wifi1.png differ diff --git a/app/src/main/assets/downloadcontent/adc-wifi2.png b/app/src/main/assets/downloadcontent/adc-wifi2.png new file mode 100644 index 0000000..abef826 Binary files /dev/null and b/app/src/main/assets/downloadcontent/adc-wifi2.png differ diff --git a/app/src/main/assets/downloadcontent/adc-wifi3.png b/app/src/main/assets/downloadcontent/adc-wifi3.png new file mode 100644 index 0000000..11e5d42 Binary files /dev/null and b/app/src/main/assets/downloadcontent/adc-wifi3.png differ diff --git a/app/src/main/assets/downloadcontent/config.properties b/app/src/main/assets/downloadcontent/config.properties new file mode 100644 index 0000000..bc3cb31 --- /dev/null +++ b/app/src/main/assets/downloadcontent/config.properties @@ -0,0 +1,14 @@ +# GAME = Need For Speed Most Wanted 2 +DOWNLOAD_URL=http://gam.eamobile.com/ +MASTER_SELL_ID=854398 +PRODUCT_ID=49062 +TOTAL_SPACE_MB=2055 +# TOTAL_SPACE_MB_MIN=440 +DATA_FOLDER=/Android/data/com.ea.games.nfs13_na/files +READ_DOWNLOAD_URL_FROM_SDCARD=false +CUSTOM_PROGRESS_BAR=true +FORCE_WAKE_DURING_DOWNLOAD=true +MIN_ASSET_VERSION_REQUIRED=1.0.32 +DELETE_ASSETS_ON_UPDATE=true +UNSAFE_ASSET_DELETION_ON_UPDATE=true +RETRIEVE_FULL_SCREEN_RESOLUTION=true \ No newline at end of file diff --git a/app/src/main/assets/downloadcontent/de.txt b/app/src/main/assets/downloadcontent/de.txt new file mode 100644 index 0000000..a07fc81 --- /dev/null +++ b/app/src/main/assets/downloadcontent/de.txt @@ -0,0 +1,53 @@ +HERUNTERLADEN UND SPIELEN +Fr %% werden ca. %% MB an zustzlichen Inhalten bentigt. Whle "Herunterladen", um zu beginnen. Download-Zeiten sind von Netzwerk und Standort abhngig. Wir empfehlen eine Wi-Fi-Verbindung. +OK +NICHT GENGEND SPEICHERPLATZ +Fr dieses Spiel werden %% MB bentigt. Lege eine SD Memory Card ein oder mach Speicherplatz darauf frei, um mit dem Herunterladen zu beginnen. +HERUNTERLADEN +BEENDEN +KEINE WI-FI-VERBINDUNG VORHANDEN +Wir empfehlen eine Wi-Fi-Verbindung, da dadurch das Herunterladen schneller geht. Whle "WI-FI", um eine Wi-Fi-Verbindung herzustellen und fortzufahren. +3G NICHT VERFGBAR +3G-Netzwerk zurzeit nicht verfgbar. Wir empfehlen eine Wi-Fi-Verbindung, da dadurch das Herunterladen schneller geht. Whle "WI-FI", um eine Wi-Fi-Verbindung herzustellen und fortzufahren, oder versuche es erneut, wenn der Dienst wieder verfgbar ist. +HERUNTERLADEN FEHLGESCHLAGEN +Der Fortschritt wurde gespeichert. Verbinde dich erneut und starte die App neu, um mit dem Herunterladen fortzufahren. (%%) +HERUNTERLADEN WURDE UNTERBROCHEN +WIEDERHOLEN +Versuche es erneut in [x, x-1...] Sekunden. +WI-FI +JA +NEIN +HERUNTERLADEN +Herunterladen luft... +UPDATES +Sucht nach Updates... +3G +Mchtest du wirklich ber 3G herunterladen? Das Herunterladen kann bis zu zwei Stunden dauern, und es knnen Kosten entstehen. +UPDATES VERFGBAR +%% erfordert eine Aktualisierung mit %% MB. Whle die Option "Herunterladen", um die Aktualisierung zu starten. +NICHT UNTERSTTZTES GERT +Beim Herunterladen des Spiels ist ein Fehler aufgetreten. Whle auf www.eamobile.com/countrygate dein Land und klicke auf den Link zum Kundendienst. +RCKSETZ-Taste drcken, um Wi-Fi zu konfigurieren. +RCKSETZ-Taste drcken, um 3G zu benutzen. +Whle die Option "3G", um 3G zu benutzen. +Eine Wi-Fi-Verbindung ist erforderlich, um zustzliche Inhalte herunterzuladen. Bitte aktiviere Wi-Fi und versuche es erneut. +SERVER-FEHLER +Ein Server-Fehler ist aufgetreten. Bitte besuche www.eamobile.com/countrygate, um dein Land auszuwhlen und klicke auf den Kundendienst-Link. (%%) +Signal-Strke +%1 MB von %2 MB %3 kb/s +BERPRFUNG AUF UPDATES +Inhalte werden bergeprft. Bitte warten, whrend die Serververbindung hergestellt wird... +3G-VERBINDUNG +deaktiviert +Mchtest du das Herunterladen der Inhalte anhalten und schlieen? +ZUSTZLICHE INHALTE NICHT AKTUELL +Die Inhalte auf dem Gert sind nicht mit der Spielversion kompatibel. Bitte aktualisiere sie und versuche es erneut. +Das Spiel lsst sich nicht starten, wenn du das Update nicht herunterldst. +Alte Inhalte werden gelscht ... +Wifi-Verbindung unterbrochen. Herunterladen pausiert. Herunterladen ber Datenverbindung fortsetzen? +Nur dieses Mal +Immer +Abbrechen +%% bentigt etwa %% MB zum Herunterladen und mindestens %% MB freien Speicherplatz auf deinem Gert oder deiner SD-Karte. Whle "Herunterladen", um zu beginnen. Die Downloadzeiten sind vom Netzwerk und deinen Standort abhngig. Wi-Fi-Verbindung empfohlen. +Fr dein Spiel sind %% MB Speicherplatz erforderlich. Auf deinem Gert sind jedoch nur %% MB verfgbar. Bitte schaffe zustzlichen Speicherplatz auf deinem Gert, um mit dem Download zu beginnen. +Debug Test Title diff --git a/app/src/main/assets/downloadcontent/en.txt b/app/src/main/assets/downloadcontent/en.txt new file mode 100644 index 0000000..0206683 --- /dev/null +++ b/app/src/main/assets/downloadcontent/en.txt @@ -0,0 +1,53 @@ +DOWNLOAD AND PLAY +%% requires approximately %% MB additional content to run. Select "Download" to begin. Download times may vary based on network and location. Wi-Fi connection is recommended. +OK +INSUFFICIENT MEMORY +%% MB is required for your game. Insert or clear space on your SD memory card to begin download. +DOWNLOAD +EXIT +WI-FI CONNECTION NOT FOUND +Wi-Fi strongly recommended for faster download. Choose "WI-FI" to setup Wi-Fi and continue. +3G UNAVAILABLE +3G network currently unavailable. Wi-Fi strongly recommended for faster download. Choose "WI-FI" to setup Wi-Fi and continue or try again when service is available. +DOWNLOAD FAILED +Progress has been saved. Reconnect then relaunch app to continue download. (%%) +DOWNLOAD INTERRUPTED +RETRY +Retry in [x, x-1...] seconds. +WI-FI +YES +NO +DOWNLOADING +Download in progress... +UPDATES +Checking for updates... +3G +Are you sure you want to download via 3G? Downloads can take up to 2 hours and carrier charges may apply. +UPDATES AVAILABLE +%% requires an update of %% MB. Select "Download" to begin. +UNSUPPORTED DEVICE +An error has occurred while downloading your game.Please visit www.eamobile.com/countrygate to choose your country and click the customer support link. +Press the BACK key to configure Wi-Fi. +Press the BACK key to use 3G. +Select "3G" to use 3G. +Wi-Fi connection is required in order to download additional content. Please enable Wi-Fi and try again. +SERVER ERROR +A server error has occurred. Please visit www.eamobile.com/countrygate to choose your country and click the customer support link. (%%) +signal strength +%1 MB of %2 MB %3 kb/s +UPDATE CHECK +Checking for content, please wait while contacting server... +3G CONNECT +disabled +Do you want to stop content download and exit? +ADDITIONAL CONTENT OUT-OF-DATE +The content found in the device is not compatible with the game version. Please update the additional content and try again. +Please note that you will not be able to launch the game if you do not download the update. +Deleting old content... +Wifi connection lost, pausing download. Continue download over data connection? +This time only +Always +Cancel + %% requires approximately %% MB to download and to have a minimum of %% MB of free space on your device or SD card to run. Select "Download" to begin. Download times may vary based on network and location. Wi-Fi connection is recommended. +%% MB is required for your game, but only %% MB storage is available on your device. Clear space on your device to begin download. +Debug Test Title diff --git a/app/src/main/assets/downloadcontent/es.txt b/app/src/main/assets/downloadcontent/es.txt new file mode 100644 index 0000000..9a6d413 --- /dev/null +++ b/app/src/main/assets/downloadcontent/es.txt @@ -0,0 +1,53 @@ +DESCARGA Y JUEGA +%% requiere aproximadamente %% MB de contenido adicional para ejecutarse. Selecciona "Descargar" para empezar. Los tiempos de descarga pueden variar dependiendo de la red y la ubicacin. Se recomienda una conexin Wi-Fi. +ACEPTAR +MEMORIA INSUFICIENTE +Se necesitan %% MB para tu juego. Inserta o libera espacio en tu tarjeta de memoria SD para comenzar la descarga. +DESCARGAR +SALIR +NO SE HA DETECTADO NINGUNA CONEXIN WI-FI +Se recomienda usar Wi-Fi para que la descarga sea ms rpida. Selecciona "WI-FI" para conectar Wi-Fi y continuar. +3G NO DISPONIBLE +Red 3G no disponible. Se recomienda Wi-Fi para una descarga ms rpida. Selecciona "WI-FI" para configurar Wi-Fi y continuar o vuelve a intentarlo cuando el servicio est disponible. +ERROR EN LA DESCARGA +Se han guardado los progresos. Vuelve a conectar y vuelve a ejecutar la aplicacin para continuar la descarga. (%%) +DESCARGA INTERRUMPIDA +REINTENTAR +Reintento en [x, x-1...] segundos. +WI-FI +S +NO +DESCARGANDO +Descarga en progreso... +ACTUALIZACIONES +Comprobando actualizaciones... +3G +Seguro que quieres iniciar la descarga mediante 3G? Las descargas pueden llegar a las 2 horas y puede aplicarse la tarifa de tu proveedor. +ACTUALIZACIONES DISPONIBLES +%% requiere una actualizacin de %% MB. Selecciona "Descargar" para empezar. +DISPOSITIVO NO COMPATIBLE +Se produjo un error al descargar el juego.Visita www.eamobile.com/countrygate para elegir tu pas y haz clic en el vnculo de asistencia al cliente. +Pulsa la tecla ATRS para configurar la Wi-Fi. +Pulsa la tecla ATRS para usar la 3G. +Selecciona "3G" para usar la 3G. +Se necesita una conexin Wi-Fi para descargar el contenido adicional. Activa el Wi-Fi e intntalo de nuevo. +ERROR DE SERVIDOR +Se ha producido un error de servidor. Visita www.eamobile.com/countrygate para seleccionar tu pas y pulsa en el enlace de asistencia. (%%) +calidad de la seal +%1 MB de %2 MB %3 kb/s +COMPROBACIN DE ACTUALIZACIN +Buscando contenido, espera mientras se contacta con el servidor... +CONEXIN 3G +desactivado +Quieres detener la descarga del contenido y salir? +CONTENIDO ADICIONAL DESACTUALIZADO +El contenido encontrado en el dispositivo no es compatible con la versin del juego. Actualiza el contenido adicional e intntalo de nuevo. +Ten en cuenta que no podrs ejecutar el juego si no descargas la actualizacin. +Eliminando contenido antiguo... +Se ha perdido la conexin Wi-Fi. Deteniendo descarga. Quieres continuar con la descarga una vez que se recupere la conexin? +Solo esta vez +Siempre +Cancelar + %% requiere aproximadamente %% MB para descargar y un espacio libre mnimo de %% MB en el dispositivo o en la tarjeta SD para ejecutarse. El tiempo de descarga puede variar dependiendo de la red y la localizacin. Se recomienda una conexin Wi-Fi. +Se necesitan %% MB para el juego, pero solo dispones de %% MB de almacenamiento en el dispositivo. Libera espacio en el dispositivo para comenzar la descarga. +Debug Test Title diff --git a/app/src/main/assets/downloadcontent/es_co.txt b/app/src/main/assets/downloadcontent/es_co.txt new file mode 100644 index 0000000..bad4714 --- /dev/null +++ b/app/src/main/assets/downloadcontent/es_co.txt @@ -0,0 +1,53 @@ +DESCARGAR Y JUGAR +El %% requiere aproximadamente %% MB de espacio adicional para ser ejecutado. Seleccione "Descargar" para iniciar. El tiempo de descarga puede variar en funcin de la red y la localizacin. Se recomienda el uso de conexin Wi-Fi. +ACEPTAR +MEMORIA INSUFICIENTE +%% MB es requerido para la descarga de su juego. Inserte o libere espacio de su tarjeta de memoria SD para iniciar con la descarga. +DESCARGAR +SALIR +CONEXIN WI-FI NO ENCONTRADA +Se recomienda el uso del Wi-Fi para una descarga ms rpida. Seleccione "WI-FI" a la configuracin de Wi-Fi y contine. +3G NO DISPONIBLE +La red 3G no est disponible en este momento. Se recomienda el uso del Wi-Fi para una descarga ms rpida. Seleccione "WI-FI" a la configuracin Wi-Fi y contine o intntelo nuevamente ms tarde cuando el servicio se encuentre disponible. +FALLO EN LA DESCARGA +El progreso ha sido guardado. Vuelva a conectarse y reanude la aplicacin para continuar con la descarga. (%%) +DESCARGA INTERRUMPIDA +REINGRESAR +Volver a intentar en [x, x-1...] segundos. +WI-FI +S +NO +DESCARGANDO +Descarga en progreso... +ACTUALIZACIONES +Verificando actualizaciones... +3G +Est seguro que desea descargar a travs de 3G? Las descargas pueden tomar hasta 2 horas y los cargos sern aplicados. +ACTUALIZACIONES DISPONIBLES +%% requiere una actualizacin de %% MB. Seleccione "Descargar" para iniciar. +DISPOSITIVO SIN SOPORTE +Ha ocurrido un error al descargar el juego. Por favor, visite www.eamobile.com/countrygate para elegir su pas y haga clic en el enlace de atencin al cliente. +Pulse la tecla ATRS para la configuracin de Wi-Fi. +Pulse la tecla ATRS para el uso de 3G. +Seleccione "3G" para el uso de 3G. +Se requiere una conexin Wi-Fi para descargar el contenido adicional. Habilita la conexin y vuelve a intentarlo. +ERROR DEL SERVIDOR +Se ha encontrado un error en el Servidor. Por favor visite www.eamobile.com/countrygate para escoger su pas y haga clic en el enlace de soporte al cliente. (%%) +intensidad de seal +%1 MB de %2 MB %3 kb/s +COMPROBACIN DE ACTUALIZACIN +Comprobando contenido. Por favor, espera mientras se contacta con el servidor... +CONEXIN 3G +desactivado +Quieres detener la descarga de contenido y salir? +CONTENIDO ADICIONAL DESACTUALIZADO +El contenido que se encuentra en el dispositivo no es compatible con la versin del juego. Actualiza el contenido adicional e intntalo de nuevo. +Ten en cuenta que no podrs iniciar el juego si no descargas la actualizacin. +Eliminando contenido antiguo... +Se perdi la conexin inalmbrica, pausando descarga. Quieres continuar la descarga usando la conexin de datos? +Solo esta vez +Siempre +Cancelar +%% necesita aproximadamente %% MB para poder descargarse y un mnimo de %% MB de espacio libre en tu dispositivo o tarjeta SD para ejecutarse. Selecciona "Descargar" para comenzar. El tiempo de descarga puede variar en funcin de la red y de la ubicacin. Se recomienda utilizar una conexin Wi-Fi. +Son necesarias %% MB para el juego, pero solo hay %% MB de almacenamiento disponible en el dispositivo. Libera espacio en el dispositivo para comenzar la descarga. +Debug Test Title diff --git a/app/src/main/assets/downloadcontent/fr.txt b/app/src/main/assets/downloadcontent/fr.txt new file mode 100644 index 0000000..6c07bfb --- /dev/null +++ b/app/src/main/assets/downloadcontent/fr.txt @@ -0,0 +1,53 @@ +TLCHARGER ET JOUER +%% ncessite environ %%Mo de contenu supplmentaire pour s'excuter. Slectionnez "Tlcharger" pour commencer. La dure de tlchargement peut varier en fonction du rseau et de l'emplacement. Une connexion Wi-Fi est recommande. +OK +MMOIRE INSUFFISANTE +%% Mo ncessaire(s) pour votre jeu. Insrez ou librez de l'espace sur votre carte mmoire SD pour dmarrer le tlchargement. +TLCHARGER +QUITTER +CONNEXION WI-FI NON DISPONIBLE +Une connexion Wi-Fi est fortement recommande pour un tlchargement plus rapide. Choisissez WI-FI pour configurer l'option Wi-Fi, puis continuez. +3G NON DISPONIBLE +Le rseau 3G n'est actuellement pas disponible. Une connexion Wi-Fi est fortement recommande pour un tlchargement plus rapide. Choisissez WI-FI pour configurer l'option Wi-Fi et continuer ou essayez nouveau lorsque le service est disponible. +CHEC DU TLCHARGEMENT +La progression a t sauvegarde. Reconnectez-vous, puis redmarrez l'application pour poursuivre le tlchargement. (%%) +TLCHARGEMENT INTERROMPU +RESSAYER +Ressayez dans [x, x-1...] secondes. +WI-FI +OUI +NON +TLCHARGEMENT +Tlchargement en cours... +MISES JOUR +Vrification des mises jour... +3G +Voulez-vous vraiment tlcharger en utilisant une connexion 3G? Les tlchargements peuvent durer jusqu' 2 heures, et votre oprateur peut vous faire payer des cots de connexion supplmentaires. +MISES JOUR DISPONIBLES +%% ncessite une mise jour de %% Mo. Cliquez sur "Tlcharger" pour commencer. +DISPOSITIF NON PRIS EN CHARGE +Une erreur s'est produite au cours du tlchargement du jeu. Rendez-vous sur www.eamobile.com/countrygate pour choisir votre pays et cliquez sur le lien d'assistance clientle. +Appuyez sur la touche RETOUR pour configurer le mode Wi-Fi. +Appuyez sur la touche RETOUR pour utiliser la fonction 3G. +Cliquez sur 3G pour utiliser la fonction 3G. +Une connexion Wi-Fi est ncessaire pour tlcharger du contenu supplmentaire. Veuillez activer votre connexion Wi-Fi et ressayer. +ERREUR DU SERVEUR +Une erreur du serveur est survenue. Rendez-vous sur www.eamobile.com/countrygate pour indiquer votre pays, puis cliquez sur le lien vers notre service consommateurs. (%%) +puissance du signal +%1 Mo sur %2 Mo %3 kb/s +VRIFICATION MISE JOUR +Recherche de contenu en cours, veuillez patienter pendant l'entre en contact avec le serveur... +CONNEXION 3G +dsactiv +Voulez-vous vraiment interrompre le tlechargement et quitter? +CONTENU ADDITIONNEL OBSOLTE +Le contenu dtect sur cet appareil n'est pas compatible avec la version du jeu. Veuillez mettre jour le contenu additionnel et ressayer. +Remarque: vous ne pourrez pas lancer le jeu avant d'avoir tlcharg la mise jour. +Suppression de l'ancien contenu... +Connexion WiFi perdue, tlchargement en pause. Poursuivre le tlchargement via la connexion des donnes? +Cette fois seulement +Toujours +Annuler +Vous devez avoir environ %% Mo d'espace livre sur votre appareil ou votre carte SD pour tlcharger %% et %% Mo pour l'excuter. Slectionnez "Tlcharger" pour lancer le tlchargement. La dure du tlchargement peut varier en fonction du rseau et du lieu. Une connexion Wi-Fi est recommande. +Ce jeu ncessite %%Mo, mais vous ne disposez que de %%Mo sur votre appareil. Librez de l'espace pour commencer le tlchargement. +Debug Test Title diff --git a/app/src/main/assets/downloadcontent/it.txt b/app/src/main/assets/downloadcontent/it.txt new file mode 100644 index 0000000..7d3bfee --- /dev/null +++ b/app/src/main/assets/downloadcontent/it.txt @@ -0,0 +1,53 @@ +SCARICA E GIOCA +Per essere eseguito, %% richiede circa %% MB di contenuto supplementare. Seleziona "Scarica" per iniziare. Il tempo di scaricamento varia a seconda della rete e del luogo. Si consiglia di utilizzare una connessione Wi-Fi. +OK +MEMORIA INSUFFICIENTE +Per il gioco sono necessari %% MB. Inserisci o crea spazio sulla scheda SD per avviare il scarica. +SCARICA +ESCI +CONNESSIONE WI-FI NON TROVATA +Per scaricare pi velocemente altamente raccomandata una connessione Wi-Fi. Scegli "WI-FI" per impostarla e continuare. +3G NON DISPONIBILE +Rete 3G non disponibile al momento. Per un scarica pi rapido si consiglia di utilizzare una connessione Wi-Fi. Scegli "WI-FI" per impostare la connessione Wi-Fi e continuare o riprova quando sar disponibile il servizio. +SCARICA NON RIUSCITO +Il progresso stato salvato. Connettiti di nuovo per riavviare l'applicazione e continuare il scarica. (%%) +SCARICA INTERROTTO +RIPROVA +Riprova fra [x, x-1...] secondi. +WI-FI +S +NO +SCARICA IN CORSO +Scarica in corso... +AGGIORNAMENTI +Ricerca aggiornamenti... +3G +Vuoi davvero scaricare tramite 3G? I scarica possono richiedere fino a 2 ore e potrebbero essere applicate le tariffe del gestore. +AGGIORNAMENTI DISPONIBILI +%% richiede un aggiornamento di %% MB. Seleziona "Scarica" per iniziare. +DISPOSITIVO NON SUPPORTATO +Si verificato un errore durante lo scaricamento del gioco. Visita www.eamobile.com/countrygate per scegliere il paese di residenza e fai clic sul collegamento del supporto clienti. +Premi il tasto INDIETRO per configurare la rete Wi-Fi. +Premi il tasto INDIETRO per usare la rete 3G. +Seleziona "3G" per usare la rete 3G. + richiesta una connessione Wi-Fi per poter scaricare il contenuto addizionale. Attiva il Wi-Fi e riprova. +ERRORE DEL SERVER +Si verificato un errore del server. Vai su www.eamobile.com/countrygate per scegliere il tuo paese e clicca sul link del supporto clienti. (%%) +intensit segnale +%1 MB di %2 MB %3 kb/s +CONTROLLO AGGIORNAMENTO +Ricerca contenuto in corso, si prega di attendere mentre il server viene contattato... +CONNESSIONE 3G +disattivato +Vuoi interrompere il scarica del contenuto e uscire? +CONTENUTO AGGIUNTIVO NON AGGIORNATO +Il contenuto trovato nel dispositivo non compatibile con la versione del gioco. Aggiorna il contenuto aggiuntivo e riprova. +Nota bene: non potrai avviare il gioco se non scarichi l'aggiornamento. +Eliminazione vecchio contenuto... +Connessione Wi-Fi interrotta, scaricamento in pausa. Continuare lo scaricamento con la connessione Dati? +Solo questa volta +Sempre +Annulla +Per funzionare, %% richiede lo scaricamento di circa %% MB e un minimo di %% MB di spazio libero sul proprio dispositivo o scheda di memoria. Seleziona "Scarica" per iniziare. I tempi di scaricamento possono variare a seconda della rete e del luogo. Si consiglia una connessione Wi-Fi. +Sono necessari %% MB per il gioco, ma sul tuo dispositivo sono disponibili solo %% MB. Libera dello spazio sul dispositivo per iniziare il scarica. +Debug Test Title diff --git a/app/src/main/assets/downloadcontent/ja.txt b/app/src/main/assets/downloadcontent/ja.txt new file mode 100644 index 0000000..a92c33c Binary files /dev/null and b/app/src/main/assets/downloadcontent/ja.txt differ diff --git a/app/src/main/assets/downloadcontent/ko.txt b/app/src/main/assets/downloadcontent/ko.txt new file mode 100644 index 0000000..2429802 Binary files /dev/null and b/app/src/main/assets/downloadcontent/ko.txt differ diff --git a/app/src/main/assets/downloadcontent/nl.txt b/app/src/main/assets/downloadcontent/nl.txt new file mode 100644 index 0000000..225fc77 --- /dev/null +++ b/app/src/main/assets/downloadcontent/nl.txt @@ -0,0 +1,53 @@ +DOWNLOAD EN SPELEN +%% werkt alleen in combinatie met aanvullend materiaal. Zorg dat je minimaal %% MB aan vrije ruimte op je SD-kaart hebt staan. Kies 'Downloaden' om te beginnen. De duur van het downloaden is gebaseerd op het netwerk en de locatie. We raden je aan om Wi-Fi te gebruiken. +Oké +ONVOLDOENDE GEHEUGEN +Je hebt %% MB nodig voor de game. Maak wat ruimte vrij op je SD-kaart om het downloaden te beginnen. +DOWNLOADEN +SLUITEN +WI-FI VERBINDING NIET GEVONDEN +We raden je aan om Wi-Fi te gebruiken om het downloaden te versnellen. Kies WI-FI om een draadloze verbinding in te stellen en verder te gaan. +3G NIET BESCHIKBAAR +3G-netwerk momenteel niet beschikbaar. We raden je aan om Wi-Fi te gebruiken om het downloaden te versnellen. Kies WI-FI om een draadloze verbinding in te stellen en verder te gaan, of probeer het opnieuw als de service beschikbaar is. +DOWNLOADEN MISLUKT +Voortgang is opgeslagen. Maak opnieuw verbinding om het downloaden te voltooien. (%%) +DOWNLOAD ONDERBROKEN +OPNIEUW PROBEREN +Probeer opnieuw over [x, x-1...] seconden. +WI-FI +JA +NEE +BEZIG MET DOWNLOADEN +Download wordt uitgevoerd... +UPDATES +Zoekt naar updates... +3G +Weet je zeker dat je het downloaden via 3G wilt annuleren? Het downloaden kan tot 2 uur in beslag nemen en er kunnen providerkosten van toepassing zijn. +UPDATES BESCHIKBAAR +%% vereist een update van %% MB. Kies 'Downloaden' om te beginnen. +NIET-ONDERSTEUND APPARAAT +Er is een fout opgetreden tijdens het downloaden van je game. Ga naar www.eamobile.com/countrygate om je land te kiezen en klik op de link voor klantenservice. +Druk op de toets TERUG om Wi-Fi te configureren. +Druk op de toets TERUG om 3G te gebruiken. +Selecteer '3G' om 3G te gebruiken. +Je hebt een draadloze verbinding nodig om aanvullend materiaal te downloaden. Schakel Wi-Fi opnieuw in en probeer het nogmaals. +FOUT MET DE SERVER +Er heeft zich een fout met de server voorgedaan. Ga naar www.eamobile.com/countrygate om je land te kiezen en klik op de link voor klantenservice. (%%) +signaalsterkte +%1 MB van %2 MB %3 kb/s +UPDATECONTROLE +Zoekt naar materiaal, momentje geduld terwijl er contact wordt gemaakt met de server... +3G VERBINDING +uit +Wil je het downloaden stoppen en afsluiten? +AANVULLEND MATERIAAL VEROUDERD +Het materiaal dat in het apparaat werd gevonden is niet compatibel met de gameversie. Update het aanvullende materiaal en probeer het opnieuw. +Je kunt de game niet lanceren als je de update niet downloadt. +Oud materiaal wordt verwijderd... +Wifi-verbinding verbroken, downloaden gepauzeerd. Doorgaan via mobiele dataverbinding? +Alleen deze keer +Altijd +Annuleren +De grootte van het downloadbestand voor %% is ongeveer %% MB en er is ongeveer %% MB vrije ruimte op een SD-kaart vereist. Selecteer 'Downloaden' om te beginnen. Downloadtijden kunnen variren en zijn afhankelijk van het netwerk en de locatie. Wifi-verbinding aanbevolen. +%% MB is vereist voor je spel, maar er is slechts %% MB geheugen beschikbaar op jouw toestel. Maak geheugen vrij en start met de download. +Debug testgame diff --git a/app/src/main/assets/downloadcontent/overrides.xml b/app/src/main/assets/downloadcontent/overrides.xml new file mode 100644 index 0000000..43af8cb --- /dev/null +++ b/app/src/main/assets/downloadcontent/overrides.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + diff --git a/app/src/main/assets/downloadcontent/pl.txt b/app/src/main/assets/downloadcontent/pl.txt new file mode 100644 index 0000000..eef7c95 --- /dev/null +++ b/app/src/main/assets/downloadcontent/pl.txt @@ -0,0 +1,53 @@ +POBIERZ I GRAJ +Do uruchomienia %% wymaga dodatkowo okolo %% MB dodatkowych danych. Wybierz polecenie "Pobierz", aby rozpoczac operacje. Czas pobierania moze sie zmieniac w zaleznosci od sieci i lokalizacji. Zalecane jest polaczenie Wi-Fi. +OK +NIEWYSTARCZAJACA PAMIEC +Twoja gra wymaga %% MB. Wprowadz lub zwolnij miejsce na swojej karcie pamieci SD, aby rozpoczac pobieranie. +POBIERZ +ZAKONCZ +NIE ZNALEZIONO POLACZENIA WI-FI +Wi-Fi jest zalecane w celu szybszego pobierania. Wybierz "WI-FI", aby uruchomic Wi-Fi i kontynuowac. +3G NIEDOSTEPNE +Siec 3G jest obecnie niedostepna. Polaczenie Wi-Fi jest zalecane w celu szybszego pobierania. Wybierz opcje "WI-FI", aby skonfigurowac polaczenie Wi-Fi i kontynuowac pobieranie lub sprbuj ponownie, gdy siec bedzie dostepna. +POBIERANIE NIE POWIODLO SIE +Zapisano postepy procesu. Polacz sie ponownie, a nastepnie jeszcze raz uruchom aplikacje, aby kontynuowac pobieranie. (%%) +POBIERANIE PRZERWANE +PONW PRBE +Sprbuj ponownie za [x, x-1...] sekund. +WI-FI +TAK +NIE +POBIERANIE +Trwa pobieranie... +AKTUALIZACJE +Sprawdzanie aktualizacji... +3G +Czy na pewno chcesz pobierac przez 3G? Pobieranie moze potrwac do 2 godzin i jest usluga platna. +AKTUALIZACJE DOSTEPNE +%% wymaga aktualizacji %% MB. Zaznacz "Pobierz", aby rozpoczac. +URZADZENIE NIEOBSLUGIWANE +W czasie pobierania gry wystapil blad. Odwiedz strone www.eamobile.com/countrygate, aby wybrac swj kraj, a nastepnie kliknij link obslugi klienta. +Nacisnij przycisk BACK, aby skonfigurowac Wi-Fi. +Nacisnij przycisk BACK, aby korzystac z 3G. +Zaznacz "3G", aby korzystac z 3G. +Do pobrania dodatkowej zawartosci wymagane jest polaczenie bezprzewodowe Wi-Fi. Prosimy wlaczyc Wi-Fi i sprbowac ponownie. +BLAD SERWERA +Wystapil blad serwera. Prosimy odwiedzic www.eamobile.com/countrygate i wybrac swj kraj, aby skontaktowac sie z pomoca techniczna. (%%) +sila sygnalu +%1 MB z %2 MB %3 kb/s +SPRAWDZANIE AKTUALIZACJI +Trwa sprawdzanie dostepnosci tresci, czekaj na nawiazanie polaczenia z serwerem... +POLACZ z 3G +wylaczono +Czy chcesz zatrzymac pobieranie tresci i wyjsc? +ZAWARTOSC DODATKOWA JEST NIEAKTUALNA +Zawartosc odnaleziona na urzadzeniu jest niekompatybilna z ta wersja gry. Przeprowadz aktualizacje zawartosci dodatkowej i sprbuj ponownie. +Zauwaz, ze nie da sie uruchomic gry jesli nie pobierzesz aktualizacji. +Usuwanie starej zawartosci... +Utracono polaczenie przez Wifi. Pobieranie zatrzymane. Kontynuowac pobieranie przez polaczenie transmisji danych? +Tylko teraz +Zawsze +Anuluj +Uruchomienie %% wymaga pobrania okolo %% MB danych oraz minimum %% MB wolnego miejsca na Twoim urzadzeniu lub karcie SD. Aby rozpoczac, wybierz opcje Pobierz. Czas pobierania zalezy od polaczenia i lokalizacji. Zalecamy polaczenia Wi-Fi. +Gra wymaga %% MB wolnego miejsca, a w Twoim urzadzeniu dostepne jest jedynie %% MB. Zwolnij miejsce, aby rozpoczac pobieranie. +Debug Test Title diff --git a/app/src/main/assets/downloadcontent/pt_BR.txt b/app/src/main/assets/downloadcontent/pt_BR.txt new file mode 100644 index 0000000..6a60a8a --- /dev/null +++ b/app/src/main/assets/downloadcontent/pt_BR.txt @@ -0,0 +1,53 @@ +BAIXAR E JOGAR +O %% necessita de aproximadamente %% MB de contedo adicional para executar. Selecione "Baixar" para iniciar. O tempo de baixar pode variar dependendo da rede e localizao. Recomenda-se utilizar a conexo Wi-Fi. +OK +MEMRIA INSUFICIENTE +%% MB necessrio para seu jogo. Insira ou libere espao no seu carto de memria SD para comear o baixar. +BAIXAR +SAIR +CONEXO WI-FI NO ENCONTRADA +Recomenda-se com nfase uma conexo Wi-Fi para o baixar mais rpido. Selecione "WI-FI" para configurar a conexo Wi-Fi e continue. +3G INDISPONVEL +A rede 3G no est disponvel no momento. A rede Wi-Fi altamente recomendada para baixar mais rpido. Selecione "WI-FI" para configurar a rede Wi-Fi e continue. Ou tente novamente quando o servio estiver disponvel. +FALHA NO BAIXAR +O andamento foi salvo. Reconecte e reinicie o aplicativo para continuar o baixar. (%%) +BAIXAR INTERROMPIDO +TENTE NOVAMENTE +Tente novamente em [x, x-1...] segundos. +WI-FI +SIM +NO +BAIXANDO +Baixar em andamento... +ATUALIZAES +Verificando se h atualizaes... +3G +Tem certeza de que deseja fazer o baixar via 3G? Os baixar podem demorar at 2 horas e encargos da operadora podem ser aplicados. +ATUALIZAES DISPONVEIS +%% requer uma atualizao de %% MB. Selecione "Baixar" para comear. +DISPOSITIVO INCOMPATVEL +Ocorreu um erro ao fazer o baixar do jogo. Visite www.eamobile.com/countrygate para selecionar seu pas e clique no link de suporte ao cliente. +Pressione a tecla VOLTAR para configurar a conexo Wi-Fi. +Pressione a tecla VOLTAR para utilizar a conexo 3G. +Selecione "3G" para utilizar a conexo 3G. +Uma conexo Wi-Fi necessria para fazer o baixar do contedo adicional. Ative o Wi-Fi e tente novamente. +ERRO NO SERVIDOR +Ocorreu um erro no servidor. Acesse www.eamobile.com/countrygate para escolher o seu pas e clique no link de atendimento ao consumidor. (%%) +qualidade do sinal +%1 MB de %2 MB %3 kb/s +VERIFICAO DE ATUALIZAO +Verificando contedo, aguarde a comunicao com o servidor... +CONEXO 3G +desabilitado +Voc deseja parar o baixar e sair? +CONTEDO ADICIONAL DESATUALIZADO +O contedo encontrado no dispositivo no compatvel com a verso do jogo. Faa a atualizao do contedo adicional e tente novamente. +Lembre-se de que voc no poder iniciar o jogo se no fizer o baixar da atualizao. +Eliminando o contedo antigo... +Conexo Wi-Fi perdida, baixar em pausa. Continuar o baixar por conexo de dados? +Somente desta vez +Sempre +Cancelar +%% requer aproximadamente %% MB para o baixar e no mnimo %% MB de espao livre em seu aparelho ou carto de memria SD para ser executado. Selecione "Baixar" para comear. Os tempos de baixar podem variar de acordo com rede e local. A conexo Wi-Fi recomendada. +%% MB so necessrios para o jogo, mas somente %% MB esto disponveis no seu dispositivo. Libere espao para iniciar o baixar. +Debug Test Title diff --git a/app/src/main/assets/downloadcontent/ru.txt b/app/src/main/assets/downloadcontent/ru.txt new file mode 100644 index 0000000..67f9992 Binary files /dev/null and b/app/src/main/assets/downloadcontent/ru.txt differ diff --git a/app/src/main/assets/downloadcontent/zh_CN.txt b/app/src/main/assets/downloadcontent/zh_CN.txt new file mode 100644 index 0000000..30f8f2e Binary files /dev/null and b/app/src/main/assets/downloadcontent/zh_CN.txt differ diff --git a/app/src/main/assets/downloadcontent/zh_TW.txt b/app/src/main/assets/downloadcontent/zh_TW.txt new file mode 100644 index 0000000..bfb4526 Binary files /dev/null and b/app/src/main/assets/downloadcontent/zh_TW.txt differ diff --git a/app/src/main/assets/licenseserver/de.txt b/app/src/main/assets/licenseserver/de.txt new file mode 100644 index 0000000..417de98 --- /dev/null +++ b/app/src/main/assets/licenseserver/de.txt @@ -0,0 +1,2 @@ +OK +Diese Anwendung ist nicht fr den Gebrauch auf deinem Android-Gert autorisiert. diff --git a/app/src/main/assets/licenseserver/en.txt b/app/src/main/assets/licenseserver/en.txt new file mode 100644 index 0000000..2f8ddb4 --- /dev/null +++ b/app/src/main/assets/licenseserver/en.txt @@ -0,0 +1,2 @@ +OK +This application is not authorized for use on your Android device. diff --git a/app/src/main/assets/licenseserver/es.txt b/app/src/main/assets/licenseserver/es.txt new file mode 100644 index 0000000..584bab5 --- /dev/null +++ b/app/src/main/assets/licenseserver/es.txt @@ -0,0 +1,3 @@ +ACEPTAR +El uso de esta aplicacin no est autorizado en tu dispositivo Android. + diff --git a/app/src/main/assets/licenseserver/es_co.txt b/app/src/main/assets/licenseserver/es_co.txt new file mode 100644 index 0000000..5d08040 --- /dev/null +++ b/app/src/main/assets/licenseserver/es_co.txt @@ -0,0 +1,2 @@ +ACEPTAR +El uso de esta aplicacin en su dispositivo Android no est autorizado. diff --git a/app/src/main/assets/licenseserver/fr.txt b/app/src/main/assets/licenseserver/fr.txt new file mode 100644 index 0000000..31a9ffd --- /dev/null +++ b/app/src/main/assets/licenseserver/fr.txt @@ -0,0 +1,2 @@ +OK +L'utilisation de cette application sur votre appareil Android n'est pas autorise. diff --git a/app/src/main/assets/licenseserver/it.txt b/app/src/main/assets/licenseserver/it.txt new file mode 100644 index 0000000..5466d2c --- /dev/null +++ b/app/src/main/assets/licenseserver/it.txt @@ -0,0 +1,2 @@ +OK +L'applicazione non dispone dell'autorizzazione necessaria per l'utilizzo sul tuo dispositivo Android. diff --git a/app/src/main/assets/licenseserver/ja.txt b/app/src/main/assets/licenseserver/ja.txt new file mode 100644 index 0000000..756b721 Binary files /dev/null and b/app/src/main/assets/licenseserver/ja.txt differ diff --git a/app/src/main/assets/licenseserver/ko.txt b/app/src/main/assets/licenseserver/ko.txt new file mode 100644 index 0000000..5b7c167 Binary files /dev/null and b/app/src/main/assets/licenseserver/ko.txt differ diff --git a/app/src/main/assets/licenseserver/pl.txt b/app/src/main/assets/licenseserver/pl.txt new file mode 100644 index 0000000..b1567e6 --- /dev/null +++ b/app/src/main/assets/licenseserver/pl.txt @@ -0,0 +1,2 @@ +OK +Ta aplikacja nie zosta?a zatwierdzona do u?ytku na Twoim urz?dzeniu Android. diff --git a/app/src/main/assets/licenseserver/pt_BR.txt b/app/src/main/assets/licenseserver/pt_BR.txt new file mode 100644 index 0000000..caf5532 --- /dev/null +++ b/app/src/main/assets/licenseserver/pt_BR.txt @@ -0,0 +1,2 @@ +OK +Esta aplicao no est autorizada para utilizao no seu dispositivo Android. diff --git a/app/src/main/assets/licenseserver/ru.txt b/app/src/main/assets/licenseserver/ru.txt new file mode 100644 index 0000000..d1af8d3 Binary files /dev/null and b/app/src/main/assets/licenseserver/ru.txt differ diff --git a/app/src/main/assets/licenseserver/zh_CN.txt b/app/src/main/assets/licenseserver/zh_CN.txt new file mode 100644 index 0000000..84d049b Binary files /dev/null and b/app/src/main/assets/licenseserver/zh_CN.txt differ diff --git a/app/src/main/assets/licenseserver/zh_TW.txt b/app/src/main/assets/licenseserver/zh_TW.txt new file mode 100644 index 0000000..eb87560 Binary files /dev/null and b/app/src/main/assets/licenseserver/zh_TW.txt differ diff --git a/app/src/main/assets/splash.png b/app/src/main/assets/splash.png new file mode 100644 index 0000000..7b8f31b Binary files /dev/null and b/app/src/main/assets/splash.png differ diff --git a/app/src/main/java/com/android/vending/billing/IInAppBillingService.java b/app/src/main/java/com/android/vending/billing/IInAppBillingService.java new file mode 100644 index 0000000..b72489d --- /dev/null +++ b/app/src/main/java/com/android/vending/billing/IInAppBillingService.java @@ -0,0 +1,222 @@ +package com.android.vending.billing; + +import android.os.Binder; +import android.os.Bundle; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; + +/* loaded from: stdlib.jar:com/android/vending/billing/IInAppBillingService.class */ +public interface IInAppBillingService extends IInterface { + + /* loaded from: stdlib.jar:com/android/vending/billing/IInAppBillingService$Stub.class */ + public static abstract class Stub extends Binder implements IInAppBillingService { + private static final String DESCRIPTOR = "com.android.vending.billing.IInAppBillingService"; + static final int TRANSACTION_consumePurchase = 5; + static final int TRANSACTION_getBuyIntent = 3; + static final int TRANSACTION_getPurchases = 4; + static final int TRANSACTION_getSkuDetails = 2; + static final int TRANSACTION_isBillingSupported = 1; + + /* loaded from: stdlib.jar:com/android/vending/billing/IInAppBillingService$Stub$Proxy.class */ + private static class Proxy implements IInAppBillingService { + private IBinder mRemote; + + Proxy(IBinder iBinder) { + this.mRemote = iBinder; + } + + @Override // android.os.IInterface + public IBinder asBinder() { + return this.mRemote; + } + + @Override // com.android.vending.billing.IInAppBillingService + public int consumePurchase(int i, String str, String str2) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeInt(i); + obtain.writeString(str); + obtain.writeString(str2); + this.mRemote.transact(5, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt(); + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + @Override // com.android.vending.billing.IInAppBillingService + public Bundle getBuyIntent(int i, String str, String str2, String str3, String str4) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeInt(i); + obtain.writeString(str); + obtain.writeString(str2); + obtain.writeString(str3); + obtain.writeString(str4); + this.mRemote.transact(3, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(obtain2) : null; + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + public String getInterfaceDescriptor() { + return Stub.DESCRIPTOR; + } + + @Override // com.android.vending.billing.IInAppBillingService + public Bundle getPurchases(int i, String str, String str2, String str3) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeInt(i); + obtain.writeString(str); + obtain.writeString(str2); + obtain.writeString(str3); + this.mRemote.transact(4, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(obtain2) : null; + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + @Override // com.android.vending.billing.IInAppBillingService + public Bundle getSkuDetails(int i, String str, String str2, Bundle bundle) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeInt(i); + obtain.writeString(str); + obtain.writeString(str2); + if (bundle != null) { + obtain.writeInt(1); + bundle.writeToParcel(obtain, 0); + } else { + obtain.writeInt(0); + } + this.mRemote.transact(2, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(obtain2) : null; + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + @Override // com.android.vending.billing.IInAppBillingService + public int isBillingSupported(int i, String str, String str2) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeInt(i); + obtain.writeString(str); + obtain.writeString(str2); + this.mRemote.transact(1, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt(); + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + } + + public Stub() { + attachInterface(this, DESCRIPTOR); + } + + public static IInAppBillingService asInterface(IBinder iBinder) { + if (iBinder == null) { + return null; + } + IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR); + return (queryLocalInterface == null || !(queryLocalInterface instanceof IInAppBillingService)) ? new Proxy(iBinder) : (IInAppBillingService) queryLocalInterface; + } + + @Override // android.os.IInterface + public IBinder asBinder() { + return this; + } + + @Override // android.os.Binder + public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException { + switch (i) { + case 1: + parcel.enforceInterface(DESCRIPTOR); + int isBillingSupported = isBillingSupported(parcel.readInt(), parcel.readString(), parcel.readString()); + parcel2.writeNoException(); + parcel2.writeInt(isBillingSupported); + return true; + case 2: + parcel.enforceInterface(DESCRIPTOR); + Bundle skuDetails = getSkuDetails(parcel.readInt(), parcel.readString(), parcel.readString(), parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null); + parcel2.writeNoException(); + if (skuDetails != null) { + parcel2.writeInt(1); + skuDetails.writeToParcel(parcel2, 1); + return true; + } + parcel2.writeInt(0); + return true; + case 3: + parcel.enforceInterface(DESCRIPTOR); + Bundle buyIntent = getBuyIntent(parcel.readInt(), parcel.readString(), parcel.readString(), parcel.readString(), parcel.readString()); + parcel2.writeNoException(); + if (buyIntent != null) { + parcel2.writeInt(1); + buyIntent.writeToParcel(parcel2, 1); + return true; + } + parcel2.writeInt(0); + return true; + case 4: + parcel.enforceInterface(DESCRIPTOR); + Bundle purchases = getPurchases(parcel.readInt(), parcel.readString(), parcel.readString(), parcel.readString()); + parcel2.writeNoException(); + if (purchases != null) { + parcel2.writeInt(1); + purchases.writeToParcel(parcel2, 1); + return true; + } + parcel2.writeInt(0); + return true; + case 5: + parcel.enforceInterface(DESCRIPTOR); + int consumePurchase = consumePurchase(parcel.readInt(), parcel.readString(), parcel.readString()); + parcel2.writeNoException(); + parcel2.writeInt(consumePurchase); + return true; + case 1598968902: + parcel2.writeString(DESCRIPTOR); + return true; + default: + return super.onTransact(i, parcel, parcel2, i2); + } + } + } + + int consumePurchase(int i, String str, String str2) throws RemoteException; + + Bundle getBuyIntent(int i, String str, String str2, String str3, String str4) throws RemoteException; + + Bundle getPurchases(int i, String str, String str2, String str3) throws RemoteException; + + Bundle getSkuDetails(int i, String str, String str2, Bundle bundle) throws RemoteException; + + int isBillingSupported(int i, String str, String str2) throws RemoteException; +} diff --git a/app/src/main/java/com/android/vending/billing/IMarketBillingService.java b/app/src/main/java/com/android/vending/billing/IMarketBillingService.java new file mode 100644 index 0000000..51d8dea --- /dev/null +++ b/app/src/main/java/com/android/vending/billing/IMarketBillingService.java @@ -0,0 +1,98 @@ +package com.android.vending.billing; + +import android.os.Binder; +import android.os.Bundle; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; + +/* loaded from: stdlib.jar:com/android/vending/billing/IMarketBillingService.class */ +public interface IMarketBillingService extends IInterface { + + /* loaded from: stdlib.jar:com/android/vending/billing/IMarketBillingService$Stub.class */ + public static abstract class Stub extends Binder implements IMarketBillingService { + private static final String DESCRIPTOR = "com.android.vending.billing.IMarketBillingService"; + static final int TRANSACTION_sendBillingRequest = 1; + + /* loaded from: stdlib.jar:com/android/vending/billing/IMarketBillingService$Stub$Proxy.class */ + private static class Proxy implements IMarketBillingService { + private IBinder mRemote; + + Proxy(IBinder iBinder) { + this.mRemote = iBinder; + } + + @Override // android.os.IInterface + public IBinder asBinder() { + return this.mRemote; + } + + public String getInterfaceDescriptor() { + return Stub.DESCRIPTOR; + } + + @Override // com.android.vending.billing.IMarketBillingService + public Bundle sendBillingRequest(Bundle bundle) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + if (bundle != null) { + obtain.writeInt(1); + bundle.writeToParcel(obtain, 0); + } else { + obtain.writeInt(0); + } + this.mRemote.transact(1, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(obtain2) : null; + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + } + + public Stub() { + attachInterface(this, DESCRIPTOR); + } + + public static IMarketBillingService asInterface(IBinder iBinder) { + if (iBinder == null) { + return null; + } + IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR); + return (queryLocalInterface == null || !(queryLocalInterface instanceof IMarketBillingService)) ? new Proxy(iBinder) : (IMarketBillingService) queryLocalInterface; + } + + @Override // android.os.IInterface + public IBinder asBinder() { + return this; + } + + @Override // android.os.Binder + public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException { + switch (i) { + case 1: + parcel.enforceInterface(DESCRIPTOR); + Bundle sendBillingRequest = sendBillingRequest(parcel.readInt() != 0 ? (Bundle) Bundle.CREATOR.createFromParcel(parcel) : null); + parcel2.writeNoException(); + if (sendBillingRequest != null) { + parcel2.writeInt(1); + sendBillingRequest.writeToParcel(parcel2, 1); + return true; + } + parcel2.writeInt(0); + return true; + case 1598968902: + parcel2.writeString(DESCRIPTOR); + return true; + default: + return super.onTransact(i, parcel, parcel2, i2); + } + } + } + + Bundle sendBillingRequest(Bundle bundle) throws RemoteException; +} diff --git a/app/src/main/java/com/bda/controller/BaseController.java b/app/src/main/java/com/bda/controller/BaseController.java new file mode 100644 index 0000000..e61ffa5 --- /dev/null +++ b/app/src/main/java/com/bda/controller/BaseController.java @@ -0,0 +1,222 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.ComponentName + * android.content.Context + * android.os.Handler + * android.os.IBinder + * android.os.RemoteException + */ +package com.bda.controller; + +import android.content.ComponentName; +import android.content.Context; +import android.os.Handler; +import android.os.IBinder; +import android.os.RemoteException; + +abstract class BaseController +extends BaseServiceConnection { + public static final int ACTION_CONNECTED = 1; + public static final int ACTION_CONNECTING = 2; + public static final int ACTION_DISCONNECTED = 0; + public static final int ACTION_DOWN = 0; + public static final int ACTION_FALSE = 0; + public static final int ACTION_TRUE = 1; + public static final int ACTION_UP = 1; + public static final int AXIS_LTRIGGER = 17; + public static final int AXIS_RTRIGGER = 18; + public static final int AXIS_RZ = 14; + public static final int AXIS_X = 0; + public static final int AXIS_Y = 1; + public static final int AXIS_Z = 11; + public static final int INFO_ACTIVE_DEVICE_COUNT = 2; + public static final int INFO_KNOWN_DEVICE_COUNT = 1; + public static final int INFO_UNKNOWN = 0; + public static final int KEYCODE_BUTTON_A = 96; + public static final int KEYCODE_BUTTON_B = 97; + public static final int KEYCODE_BUTTON_L1 = 102; + public static final int KEYCODE_BUTTON_L2 = 104; + public static final int KEYCODE_BUTTON_R1 = 103; + public static final int KEYCODE_BUTTON_R2 = 105; + public static final int KEYCODE_BUTTON_SELECT = 109; + public static final int KEYCODE_BUTTON_START = 108; + public static final int KEYCODE_BUTTON_THUMBL = 106; + public static final int KEYCODE_BUTTON_THUMBR = 107; + public static final int KEYCODE_BUTTON_X = 98; + public static final int KEYCODE_BUTTON_Y = 99; + public static final int KEYCODE_DPAD_DOWN = 20; + public static final int KEYCODE_DPAD_LEFT = 21; + public static final int KEYCODE_DPAD_RIGHT = 22; + public static final int KEYCODE_DPAD_UP = 19; + public static final int KEYCODE_UNKNOWN = 0; + public static final int STATE_CONNECTION = 1; + public static final int STATE_POWER_LOW = 2; + public static final int STATE_SELECTED_VERSION = 4; + public static final int STATE_SUPPORTED_VERSION = 3; + public static final int STATE_UNKNOWN = 0; + int mActivityEvent = 6; + Handler mHandler = null; + ControllerListener mListener = null; + final IControllerListener.Stub mListenerStub = this.getControllerListenerStub(); + ControllerMonitor mMonitor = null; + final IControllerMonitor.Stub mMonitorStub = this.getControllerMonitorStub(); + + BaseController(Context context) { + super(context); + } + + @Override + public final void exit() { + this.setListener(null, null); + this.setMonitor(null); + super.exit(); + } + + abstract IControllerListener.Stub getControllerListenerStub(); + + abstract IControllerMonitor.Stub getControllerMonitorStub(); + + public final void onPause() { + this.mActivityEvent = 6; + this.sendMessage(1, this.mActivityEvent); + this.registerListener(); + } + + public final void onResume() { + this.mActivityEvent = 5; + this.sendMessage(1, this.mActivityEvent); + this.registerListener(); + } + + @Override + public final void onServiceConnected(ComponentName componentName, IBinder iBinder) { + super.onServiceConnected(componentName, iBinder); + this.registerListener(); + this.registerMonitor(); + if (this.mActivityEvent != 5) return; + this.sendMessage(1, this.mActivityEvent); + this.sendMessage(1, 7); + } + + abstract void registerListener(); + + abstract void registerMonitor(); + + abstract void sendMessage(int var1, int var2); + + public final void setListener(ControllerListener controllerListener, Handler handler) { + this.unregisterListener(); + this.mListener = controllerListener; + this.mHandler = handler; + this.registerListener(); + } + + public final void setMonitor(ControllerMonitor controllerMonitor) { + this.unregisterMonitor(); + this.mMonitor = controllerMonitor; + this.registerMonitor(); + } + + abstract void unregisterListener(); + + abstract void unregisterMonitor(); + + class IControllerListenerStub + extends IControllerListener.Stub { + IControllerListenerStub() { + } + + @Override + public void onKeyEvent(KeyEvent object) throws RemoteException { + if (BaseController.this.mListener == null) return; + KeyRunnable keyRunnable = new KeyRunnable(object); + if (BaseController.this.mHandler != null) { + BaseController.this.mHandler.post(keyRunnable); + return; + } + keyRunnable.run(); + } + + @Override + public void onMotionEvent(MotionEvent object) throws RemoteException { + if (BaseController.this.mListener == null) return; + MotionRunnable motionRunnable = new MotionRunnable(object); + if (BaseController.this.mHandler != null) { + BaseController.this.mHandler.post(motionRunnable); + return; + } + motionRunnable.run(); + } + + @Override + public void onStateEvent(StateEvent object) throws RemoteException { + if (BaseController.this.mListener == null) return; + StateRunnable stateRunnable = new StateRunnable(object); + if (BaseController.this.mHandler != null) { + BaseController.this.mHandler.post(stateRunnable); + return; + } + stateRunnable.run(); + } + } + + class IControllerMonitorStub + extends IControllerMonitor.Stub { + IControllerMonitorStub() { + } + + @Override + public void onLog(int n2, int n3, String string2) throws RemoteException { + if (BaseController.this.mMonitor == null) return; + BaseController.this.mMonitor.onLog(n2, n3, string2); + } + } + + class KeyRunnable + implements Runnable { + final KeyEvent mEvent; + + public KeyRunnable(KeyEvent keyEvent) { + this.mEvent = keyEvent; + } + + @Override + public void run() { + if (BaseController.this.mListener == null) return; + BaseController.this.mListener.onKeyEvent(this.mEvent); + } + } + + class MotionRunnable + implements Runnable { + final MotionEvent mEvent; + + public MotionRunnable(MotionEvent motionEvent) { + this.mEvent = motionEvent; + } + + @Override + public void run() { + if (BaseController.this.mListener == null) return; + BaseController.this.mListener.onMotionEvent(this.mEvent); + } + } + + class StateRunnable + implements Runnable { + final StateEvent mEvent; + + public StateRunnable(StateEvent stateEvent) { + this.mEvent = stateEvent; + } + + @Override + public void run() { + if (BaseController.this.mListener == null) return; + BaseController.this.mListener.onStateEvent(this.mEvent); + } + } +} + diff --git a/app/src/main/java/com/bda/controller/BaseEvent.java b/app/src/main/java/com/bda/controller/BaseEvent.java new file mode 100644 index 0000000..ed52bc7 --- /dev/null +++ b/app/src/main/java/com/bda/controller/BaseEvent.java @@ -0,0 +1,61 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Parcel + * android.os.Parcelable + * android.os.Parcelable$Creator + */ +package com.bda.controller; + +import android.os.Parcel; +import android.os.Parcelable; + +class BaseEvent +implements Parcelable { + public static final Parcelable.Creator CREATOR = new ParcelableCreator(); + final int mControllerId; + final long mEventTime; + + public BaseEvent(long l2, int n2) { + this.mEventTime = l2; + this.mControllerId = n2; + } + + BaseEvent(Parcel parcel) { + this.mEventTime = parcel.readLong(); + this.mControllerId = parcel.readInt(); + } + + public int describeContents() { + return 0; + } + + public final int getControllerId() { + return this.mControllerId; + } + + public final long getEventTime() { + return this.mEventTime; + } + + public void writeToParcel(Parcel parcel, int n2) { + parcel.writeLong(this.mEventTime); + parcel.writeInt(this.mControllerId); + } + + static class ParcelableCreator + implements Parcelable.Creator { + ParcelableCreator() { + } + + public BaseEvent createFromParcel(Parcel parcel) { + return new BaseEvent(parcel); + } + + public BaseEvent[] newArray(int n2) { + return new BaseEvent[n2]; + } + } +} + diff --git a/app/src/main/java/com/bda/controller/BaseServiceConnection.java b/app/src/main/java/com/bda/controller/BaseServiceConnection.java new file mode 100644 index 0000000..17dbf79 --- /dev/null +++ b/app/src/main/java/com/bda/controller/BaseServiceConnection.java @@ -0,0 +1,56 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.ComponentName + * android.content.Context + * android.content.Intent + * android.content.ServiceConnection + * android.os.IBinder + */ +package com.bda.controller; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; + +abstract class BaseServiceConnection implements ServiceConnection { + final Context mContext; + boolean mIsBound = false; + TService mService = null; + + BaseServiceConnection(Context context) { + this.mContext = context; + } + + public void exit() { + if (!this.mIsBound) return; + this.mContext.unbindService((ServiceConnection)this); + this.mIsBound = false; + } + + abstract String getServiceIntentName(); + + abstract TService getServiceInterface(IBinder var1); + + public boolean init() { + if (this.mIsBound) return this.mIsBound; + Intent intent = new Intent(this.getServiceIntentName()); + //TODO работает только при родной версии target sdk + //this.mContext.startService(intent); + //this.mIsBound = this.mContext.bindService(intent, (ServiceConnection)this, 1); + //return this.mIsBound; + return true; + } + + public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + this.mService = this.getServiceInterface(iBinder); + } + + public void onServiceDisconnected(ComponentName componentName) { + this.mService = null; + } +} + diff --git a/app/src/main/java/com/bda/controller/Constants.java b/app/src/main/java/com/bda/controller/Constants.java new file mode 100644 index 0000000..09e303a --- /dev/null +++ b/app/src/main/java/com/bda/controller/Constants.java @@ -0,0 +1,25 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.bda.controller; + +public final class Constants { + public static final int MSG_SET_ACTIVITY_EVENT = 1; + + private Constants() { + } + + public static final class ActivityEvent { + public static final int CREATE = 1; + public static final int DESTROY = 2; + public static final int PAUSE = 6; + public static final int RESUME = 5; + public static final int SERVICE_CONNECTED = 7; + public static final int START = 3; + public static final int STOP = 4; + + private ActivityEvent() { + } + } +} + diff --git a/app/src/main/java/com/bda/controller/Controller.java b/app/src/main/java/com/bda/controller/Controller.java new file mode 100644 index 0000000..511ae9c --- /dev/null +++ b/app/src/main/java/com/bda/controller/Controller.java @@ -0,0 +1,184 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.Context + * android.os.IBinder + * android.os.RemoteException + */ +package com.bda.controller; + +import android.content.Context; +import android.os.IBinder; +import android.os.RemoteException; +import com.bda.controller.BaseController; +import com.bda.controller.IControllerListener; +import com.bda.controller.IControllerMonitor; +import com.bda.controller.IControllerService; +import com.bda.controller.KeyEvent; +import com.bda.controller.MotionEvent; +import com.bda.controller.StateEvent; + +public final class Controller +extends BaseController { + static final int CONTROLLER_ID = 1; + + Controller(Context context) { + super(context); + } + + public static final Controller getInstance(Context context) { + return new Controller(context); + } + + public final float getAxisValue(int n2) { + if (this.mService == null) return 0.0f; + try { + return ((IControllerService)this.mService).getAxisValue(1, n2); + } + catch (RemoteException remoteException) { + // empty catch block + } + return 0.0f; + } + + @Override + IControllerListener.Stub getControllerListenerStub() { + return new IControllerListenerStub(); + } + + @Override + IControllerMonitor.Stub getControllerMonitorStub() { + return new BaseController.IControllerMonitorStub(); + } + + public final int getInfo(int n2) { + if (this.mService == null) return 0; + try { + return ((IControllerService)this.mService).getInfo(n2); + } + catch (RemoteException remoteException) { + // empty catch block + } + return 0; + } + + public final int getKeyCode(int n2) { + if (this.mService == null) return 1; + try { + return ((IControllerService)this.mService).getKeyCode(1, n2); + } + catch (RemoteException remoteException) { + // empty catch block + } + return 1; + } + + @Override + String getServiceIntentName() { + return IControllerService.class.getName(); + } + + @Override + IControllerService getServiceInterface(IBinder iBinder) { + return IControllerService.Stub.asInterface(iBinder); + } + + public final int getState(int n2) { + if (this.mService == null) return 0; + try { + return ((IControllerService)this.mService).getState(1, n2); + } + catch (RemoteException remoteException) { + // empty catch block + } + return 0; + } + + @Override + void registerListener() { + if (this.mListener == null) return; + if (this.mService == null) return; + try { + ((IControllerService)this.mService).registerListener(this.mListenerStub, this.mActivityEvent); + return; + } + catch (RemoteException remoteException) { + return; + } + } + + @Override + void registerMonitor() { + if (this.mMonitor == null) return; + if (this.mService == null) return; + try { + ((IControllerService)this.mService).registerMonitor(this.mMonitorStub, this.mActivityEvent); + return; + } + catch (RemoteException remoteException) { + return; + } + } + + @Override + void sendMessage(int n2, int n3) { + if (this.mService == null) return; + try { + ((IControllerService)this.mService).sendMessage(n2, n3); + return; + } + catch (RemoteException remoteException) { + return; + } + } + + @Override + void unregisterListener() { + if (this.mService == null) return; + try { + ((IControllerService)this.mService).unregisterListener(this.mListenerStub, this.mActivityEvent); + return; + } + catch (RemoteException remoteException) { + return; + } + } + + @Override + void unregisterMonitor() { + if (this.mService == null) return; + try { + ((IControllerService)this.mService).unregisterMonitor(this.mMonitorStub, this.mActivityEvent); + return; + } + catch (RemoteException remoteException) { + return; + } + } + + class IControllerListenerStub + extends BaseController.IControllerListenerStub { + IControllerListenerStub() { + } + + @Override + public void onKeyEvent(KeyEvent keyEvent) throws RemoteException { + if (keyEvent.getControllerId() != 1) return; + super.onKeyEvent(keyEvent); + } + + @Override + public void onMotionEvent(MotionEvent motionEvent) throws RemoteException { + if (motionEvent.getControllerId() != 1) return; + super.onMotionEvent(motionEvent); + } + + @Override + public void onStateEvent(StateEvent stateEvent) throws RemoteException { + if (stateEvent.getControllerId() != 1) return; + super.onStateEvent(stateEvent); + } + } +} + diff --git a/app/src/main/java/com/bda/controller/Controller2.java b/app/src/main/java/com/bda/controller/Controller2.java new file mode 100644 index 0000000..b50c080 --- /dev/null +++ b/app/src/main/java/com/bda/controller/Controller2.java @@ -0,0 +1,156 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.Context + * android.os.IBinder + * android.os.RemoteException + */ +package com.bda.controller; + +import android.content.Context; +import android.os.IBinder; +import android.os.RemoteException; +import com.bda.controller.BaseController; +import com.bda.controller.IControllerListener; +import com.bda.controller.IControllerMonitor; +import com.bda.controller.IControllerService2; + +final class Controller2 +extends BaseController { + Controller2(Context context) { + super(context); + } + + public static final Controller2 getInstance(Context context) { + return new Controller2(context); + } + + public final float getAxisValue(int n2, int n3) { + if (this.mService == null) return 0.0f; + try { + return ((IControllerService2)this.mService).getAxisValue(n2, n3); + } + catch (RemoteException remoteException) { + // empty catch block + } + return 0.0f; + } + + @Override + IControllerListener.Stub getControllerListenerStub() { + return new BaseController.IControllerListenerStub(); + } + + @Override + IControllerMonitor.Stub getControllerMonitorStub() { + return new BaseController.IControllerMonitorStub(); + } + + public final int getInfo(int n2, int n3) { + if (this.mService == null) return 0; + try { + return ((IControllerService2)this.mService).getInfo(n2, n3); + } + catch (RemoteException remoteException) { + // empty catch block + } + return 0; + } + + public final int getKeyCode(int n2, int n3) { + if (this.mService == null) return 1; + try { + return ((IControllerService2)this.mService).getKeyCode(n2, n3); + } + catch (RemoteException remoteException) { + // empty catch block + } + return 1; + } + + @Override + String getServiceIntentName() { + return IControllerService2.class.getName(); + } + + @Override + IControllerService2 getServiceInterface(IBinder iBinder) { + return IControllerService2.Stub.asInterface(iBinder); + } + + public final int getState(int n2, int n3) { + if (this.mService == null) return 0; + try { + return ((IControllerService2)this.mService).getState(n2, n3); + } + catch (RemoteException remoteException) { + // empty catch block + } + return 0; + } + + @Override + void registerListener() { + if (this.mMonitor == null) return; + if (this.mService == null) return; + try { + ((IControllerService2)this.mService).registerListener(this.mListenerStub, this.mActivityEvent); + return; + } + catch (RemoteException remoteException) { + return; + } + } + + @Override + void registerMonitor() { + if (this.mMonitor == null) return; + if (this.mService == null) return; + try { + ((IControllerService2)this.mService).registerMonitor(this.mMonitorStub, this.mActivityEvent); + return; + } + catch (RemoteException remoteException) { + return; + } + } + + @Override + void sendMessage(int n2, int n3) { + if (this.mService == null) return; + try { + ((IControllerService2)this.mService).sendMessage(n2, n3); + return; + } + catch (RemoteException remoteException) { + return; + } + } + + @Override + void unregisterListener() { + if (this.mListener == null) return; + if (this.mService == null) return; + try { + ((IControllerService2)this.mService).unregisterListener(this.mListenerStub, this.mActivityEvent); + return; + } + catch (RemoteException remoteException) { + return; + } + } + + @Override + void unregisterMonitor() { + if (this.mService == null) return; + try { + ((IControllerService2)this.mService).unregisterMonitor(this.mMonitorStub, this.mActivityEvent); + return; + } + catch (RemoteException remoteException) { + return; + } + } +} + diff --git a/app/src/main/java/com/bda/controller/ControllerListener.java b/app/src/main/java/com/bda/controller/ControllerListener.java new file mode 100644 index 0000000..0c5e9f6 --- /dev/null +++ b/app/src/main/java/com/bda/controller/ControllerListener.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.bda.controller; + +import com.bda.controller.KeyEvent; +import com.bda.controller.MotionEvent; +import com.bda.controller.StateEvent; + +public interface ControllerListener { + public void onKeyEvent(KeyEvent var1); + + public void onMotionEvent(MotionEvent var1); + + public void onStateEvent(StateEvent var1); +} + diff --git a/app/src/main/java/com/bda/controller/ControllerMonitor.java b/app/src/main/java/com/bda/controller/ControllerMonitor.java new file mode 100644 index 0000000..a6ff708 --- /dev/null +++ b/app/src/main/java/com/bda/controller/ControllerMonitor.java @@ -0,0 +1,9 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.bda.controller; + +public interface ControllerMonitor { + public void onLog(int var1, int var2, String var3); +} + diff --git a/app/src/main/java/com/bda/controller/IControllerListener.java b/app/src/main/java/com/bda/controller/IControllerListener.java new file mode 100644 index 0000000..a75169b --- /dev/null +++ b/app/src/main/java/com/bda/controller/IControllerListener.java @@ -0,0 +1,165 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Binder + * android.os.IBinder + * android.os.IInterface + * android.os.Parcel + * android.os.RemoteException + */ +package com.bda.controller; + +import android.os.Binder; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; + +public interface IControllerListener +extends IInterface { + void onKeyEvent(KeyEvent var1) throws RemoteException; + + void onMotionEvent(MotionEvent var1) throws RemoteException; + + void onStateEvent(StateEvent var1) throws RemoteException; + + abstract class Stub + extends Binder + implements IControllerListener { + private static final String DESCRIPTOR = "com.bda.controller.IControllerListener"; + static final int TRANSACTION_onKeyEvent = 1; + static final int TRANSACTION_onMotionEvent = 2; + static final int TRANSACTION_onStateEvent = 3; + + public Stub() { + this.attachInterface(this, DESCRIPTOR); + } + + public static IControllerListener asInterface(IBinder iBinder) { + if (iBinder == null) { + return null; + } + IInterface iInterface = iBinder.queryLocalInterface(DESCRIPTOR); + if (iInterface == null) return new Proxy(iBinder); + if (!(iInterface instanceof IControllerListener)) return new Proxy(iBinder); + return (IControllerListener)iInterface; + } + + public IBinder asBinder() { + return this; + } + + public boolean onTransact(int n2, Parcel object, Parcel parcel, int n3) throws RemoteException { + switch (n2) { + default: { + return super.onTransact(n2, object, parcel, n3); + } + case 1598968902: { + parcel.writeString(DESCRIPTOR); + return true; + } + case 1: + case 2: { + object.enforceInterface(DESCRIPTOR); + KeyEvent keyEvent = object.readInt() != 0 ? KeyEvent.CREATOR.createFromParcel(object) : null; + this.onKeyEvent(keyEvent); + parcel.writeNoException(); + return true; + } + case 3: + } + object.enforceInterface(DESCRIPTOR); + StateEvent fromParcel = new StateEvent(object); + if (object.readInt() != 0) + fromParcel = StateEvent.CREATOR.createFromParcel(object); + this.onStateEvent(fromParcel); + parcel.writeNoException(); + return true; + } + + private static class Proxy + implements IControllerListener { + private IBinder mRemote; + + Proxy(IBinder iBinder) { + this.mRemote = iBinder; + } + + public IBinder asBinder() { + return this.mRemote; + } + + public String getInterfaceDescriptor() { + return Stub.DESCRIPTOR; + } + + @Override + public void onKeyEvent(KeyEvent keyEvent) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + if (keyEvent != null) { + parcel.writeInt(1); + keyEvent.writeToParcel(parcel, 0); + } else { + parcel.writeInt(0); + } + this.mRemote.transact(1, parcel, parcel2, 0); + parcel2.readException(); + return; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public void onMotionEvent(MotionEvent motionEvent) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + if (motionEvent != null) { + parcel.writeInt(1); + motionEvent.writeToParcel(parcel, 0); + } else { + parcel.writeInt(0); + } + this.mRemote.transact(2, parcel, parcel2, 0); + parcel2.readException(); + return; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public void onStateEvent(StateEvent stateEvent) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + if (stateEvent != null) { + parcel.writeInt(1); + stateEvent.writeToParcel(parcel, 0); + } else { + parcel.writeInt(0); + } + this.mRemote.transact(3, parcel, parcel2, 0); + parcel2.readException(); + return; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + } + } +} + diff --git a/app/src/main/java/com/bda/controller/IControllerMonitor.java b/app/src/main/java/com/bda/controller/IControllerMonitor.java new file mode 100644 index 0000000..3ad0ff8 --- /dev/null +++ b/app/src/main/java/com/bda/controller/IControllerMonitor.java @@ -0,0 +1,101 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Binder + * android.os.IBinder + * android.os.IInterface + * android.os.Parcel + * android.os.RemoteException + */ +package com.bda.controller; + +import android.os.Binder; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; + +public interface IControllerMonitor +extends IInterface { + public void onLog(int var1, int var2, String var3) throws RemoteException; + + public static abstract class Stub + extends Binder + implements IControllerMonitor { + private static final String DESCRIPTOR = "com.bda.controller.IControllerMonitor"; + static final int TRANSACTION_onLog = 1; + + public Stub() { + this.attachInterface(this, DESCRIPTOR); + } + + public static IControllerMonitor asInterface(IBinder iBinder) { + if (iBinder == null) { + return null; + } + IInterface iInterface = iBinder.queryLocalInterface(DESCRIPTOR); + if (iInterface == null) return new Proxy(iBinder); + if (!(iInterface instanceof IControllerMonitor)) return new Proxy(iBinder); + return (IControllerMonitor)iInterface; + } + + public IBinder asBinder() { + return this; + } + + public boolean onTransact(int n2, Parcel parcel, Parcel parcel2, int n3) throws RemoteException { + switch (n2) { + default: { + return super.onTransact(n2, parcel, parcel2, n3); + } + case 1598968902: { + parcel2.writeString(DESCRIPTOR); + return true; + } + case 1: + } + parcel.enforceInterface(DESCRIPTOR); + this.onLog(parcel.readInt(), parcel.readInt(), parcel.readString()); + parcel2.writeNoException(); + return true; + } + + private static class Proxy + implements IControllerMonitor { + private IBinder mRemote; + + Proxy(IBinder iBinder) { + this.mRemote = iBinder; + } + + public IBinder asBinder() { + return this.mRemote; + } + + public String getInterfaceDescriptor() { + return Stub.DESCRIPTOR; + } + + @Override + public void onLog(int n2, int n3, String string2) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + parcel.writeString(string2); + this.mRemote.transact(1, parcel, parcel2, 0); + parcel2.readException(); + return; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + } + } +} + diff --git a/app/src/main/java/com/bda/controller/IControllerService.java b/app/src/main/java/com/bda/controller/IControllerService.java new file mode 100644 index 0000000..1bd7539 --- /dev/null +++ b/app/src/main/java/com/bda/controller/IControllerService.java @@ -0,0 +1,317 @@ +package com.bda.controller; + +import android.os.Binder; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; + +interface IControllerService +extends IInterface { + float getAxisValue(int var1, int var2) throws RemoteException; + + int getInfo(int var1) throws RemoteException; + + int getKeyCode(int var1, int var2) throws RemoteException; + + int getState(int var1, int var2) throws RemoteException; + + void registerListener(IControllerListener var1, int var2) throws RemoteException; + + void registerMonitor(IControllerMonitor var1, int var2) throws RemoteException; + + void sendMessage(int var1, int var2) throws RemoteException; + + void unregisterListener(IControllerListener var1, int var2) throws RemoteException; + + void unregisterMonitor(IControllerMonitor var1, int var2) throws RemoteException; + + abstract class Stub + extends Binder + implements IControllerService { + private static final String DESCRIPTOR = "com.bda.controller.IControllerService"; + static final int TRANSACTION_getAxisValue = 7; + static final int TRANSACTION_getInfo = 5; + static final int TRANSACTION_getKeyCode = 6; + static final int TRANSACTION_getState = 8; + static final int TRANSACTION_registerListener = 1; + static final int TRANSACTION_registerMonitor = 3; + static final int TRANSACTION_sendMessage = 9; + static final int TRANSACTION_unregisterListener = 2; + static final int TRANSACTION_unregisterMonitor = 4; + + Stub() { + this.attachInterface(this, DESCRIPTOR); + } + + static IControllerService asInterface(IBinder iBinder) { + if (iBinder == null) { + return null; + } + IInterface iInterface = iBinder.queryLocalInterface(DESCRIPTOR); + if (iInterface == null) return new Proxy(iBinder); + if (!(iInterface instanceof IControllerService)) return new Proxy(iBinder); + return (IControllerService)iInterface; + } + + public IBinder asBinder() { + return this; + } + + public boolean onTransact(int n2, Parcel parcel, Parcel parcel2, int n3) throws RemoteException { + switch (n2) { + default: { + return super.onTransact(n2, parcel, parcel2, n3); + } + case 1598968902: { + parcel2.writeString(DESCRIPTOR); + return true; + } + case 1: { + parcel.enforceInterface(DESCRIPTOR); + this.registerListener(IControllerListener.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt()); + parcel2.writeNoException(); + return true; + } + case 2: { + parcel.enforceInterface(DESCRIPTOR); + this.unregisterListener(IControllerListener.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt()); + parcel2.writeNoException(); + return true; + } + case 3: { + parcel.enforceInterface(DESCRIPTOR); + this.registerMonitor(IControllerMonitor.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt()); + parcel2.writeNoException(); + return true; + } + case 4: { + parcel.enforceInterface(DESCRIPTOR); + this.unregisterMonitor(IControllerMonitor.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt()); + parcel2.writeNoException(); + return true; + } + case 5: { + parcel.enforceInterface(DESCRIPTOR); + n2 = this.getInfo(parcel.readInt()); + parcel2.writeNoException(); + parcel2.writeInt(n2); + return true; + } + case 6: { + parcel.enforceInterface(DESCRIPTOR); + n2 = this.getKeyCode(parcel.readInt(), parcel.readInt()); + parcel2.writeNoException(); + parcel2.writeInt(n2); + return true; + } + case 7: { + parcel.enforceInterface(DESCRIPTOR); + float f2 = this.getAxisValue(parcel.readInt(), parcel.readInt()); + parcel2.writeNoException(); + parcel2.writeFloat(f2); + return true; + } + case 8: { + parcel.enforceInterface(DESCRIPTOR); + n2 = this.getState(parcel.readInt(), parcel.readInt()); + parcel2.writeNoException(); + parcel2.writeInt(n2); + return true; + } + case 9: + } + parcel.enforceInterface(DESCRIPTOR); + this.sendMessage(parcel.readInt(), parcel.readInt()); + parcel2.writeNoException(); + return true; + } + + private static class Proxy + implements IControllerService { + private IBinder mRemote; + + Proxy(IBinder iBinder) { + this.mRemote = iBinder; + } + + public IBinder asBinder() { + return this.mRemote; + } + + @Override + public float getAxisValue(int n2, int n3) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + this.mRemote.transact(7, parcel, parcel2, 0); + parcel2.readException(); + float f2 = parcel2.readFloat(); + return f2; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public int getInfo(int n2) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + this.mRemote.transact(5, parcel, parcel2, 0); + parcel2.readException(); + n2 = parcel2.readInt(); + return n2; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + String getInterfaceDescriptor() { + return Stub.DESCRIPTOR; + } + + @Override + public int getKeyCode(int n2, int n3) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + this.mRemote.transact(6, parcel, parcel2, 0); + parcel2.readException(); + n2 = parcel2.readInt(); + return n2; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public int getState(int n2, int n3) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + this.mRemote.transact(8, parcel, parcel2, 0); + parcel2.readException(); + n2 = parcel2.readInt(); + return n2; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public void registerListener(IControllerListener iControllerListener, int n2) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + iControllerListener = iControllerListener != null ? (IControllerListener) iControllerListener.asBinder() : null; + parcel.writeStrongBinder((IBinder)iControllerListener); + parcel.writeInt(n2); + this.mRemote.transact(1, parcel, parcel2, 0); + parcel2.readException(); + return; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public void registerMonitor(IControllerMonitor iControllerMonitor, int n2) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + iControllerMonitor = iControllerMonitor != null ? (IControllerMonitor) iControllerMonitor.asBinder() : null; + parcel.writeStrongBinder((IBinder)iControllerMonitor); + parcel.writeInt(n2); + this.mRemote.transact(3, parcel, parcel2, 0); + parcel2.readException(); + return; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public void sendMessage(int n2, int n3) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + this.mRemote.transact(9, parcel, parcel2, 0); + parcel2.readException(); + return; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public void unregisterListener(IControllerListener iControllerListener, int n2) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + iControllerListener = iControllerListener != null ? (IControllerListener) iControllerListener.asBinder() : null; + parcel.writeStrongBinder((IBinder)iControllerListener); + parcel.writeInt(n2); + this.mRemote.transact(2, parcel, parcel2, 0); + parcel2.readException(); + return; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public void unregisterMonitor(IControllerMonitor iControllerMonitor, int n2) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + iControllerMonitor = iControllerMonitor != null ? (IControllerMonitor) iControllerMonitor.asBinder() : null; + parcel.writeStrongBinder((IBinder)iControllerMonitor); + parcel.writeInt(n2); + this.mRemote.transact(4, parcel, parcel2, 0); + parcel2.readException(); + return; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + } + } +} + diff --git a/app/src/main/java/com/bda/controller/IControllerService2.java b/app/src/main/java/com/bda/controller/IControllerService2.java new file mode 100644 index 0000000..67adf15 --- /dev/null +++ b/app/src/main/java/com/bda/controller/IControllerService2.java @@ -0,0 +1,322 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Binder + * android.os.IBinder + * android.os.IInterface + * android.os.Parcel + * android.os.RemoteException + */ +package com.bda.controller; + +import android.os.Binder; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; +import com.bda.controller.IControllerListener; +import com.bda.controller.IControllerMonitor; + +public interface IControllerService2 +extends IInterface { + public float getAxisValue(int var1, int var2) throws RemoteException; + + public int getInfo(int var1, int var2) throws RemoteException; + + public int getKeyCode(int var1, int var2) throws RemoteException; + + public int getState(int var1, int var2) throws RemoteException; + + public void registerListener(IControllerListener var1, int var2) throws RemoteException; + + public void registerMonitor(IControllerMonitor var1, int var2) throws RemoteException; + + public void sendMessage(int var1, int var2) throws RemoteException; + + public void unregisterListener(IControllerListener var1, int var2) throws RemoteException; + + public void unregisterMonitor(IControllerMonitor var1, int var2) throws RemoteException; + + public static abstract class Stub + extends Binder + implements IControllerService2 { + private static final String DESCRIPTOR = "com.bda.controller.IControllerService2"; + static final int TRANSACTION_getAxisValue = 7; + static final int TRANSACTION_getInfo = 5; + static final int TRANSACTION_getKeyCode = 6; + static final int TRANSACTION_getState = 8; + static final int TRANSACTION_registerListener = 1; + static final int TRANSACTION_registerMonitor = 3; + static final int TRANSACTION_sendMessage = 9; + static final int TRANSACTION_unregisterListener = 2; + static final int TRANSACTION_unregisterMonitor = 4; + + public Stub() { + this.attachInterface(this, DESCRIPTOR); + } + + public static IControllerService2 asInterface(IBinder iBinder) { + if (iBinder == null) { + return null; + } + IInterface iInterface = iBinder.queryLocalInterface(DESCRIPTOR); + if (iInterface == null) return new Proxy(iBinder); + if (!(iInterface instanceof IControllerService2)) return new Proxy(iBinder); + return (IControllerService2)iInterface; + } + + public IBinder asBinder() { + return this; + } + + public boolean onTransact(int n2, Parcel parcel, Parcel parcel2, int n3) throws RemoteException { + switch (n2) { + default: { + return super.onTransact(n2, parcel, parcel2, n3); + } + case 1598968902: { + parcel2.writeString(DESCRIPTOR); + return true; + } + case 1: { + parcel.enforceInterface(DESCRIPTOR); + this.registerListener(IControllerListener.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt()); + return true; + } + case 2: { + parcel.enforceInterface(DESCRIPTOR); + this.unregisterListener(IControllerListener.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt()); + return true; + } + case 3: { + parcel.enforceInterface(DESCRIPTOR); + this.registerMonitor(IControllerMonitor.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt()); + return true; + } + case 4: { + parcel.enforceInterface(DESCRIPTOR); + this.unregisterMonitor(IControllerMonitor.Stub.asInterface(parcel.readStrongBinder()), parcel.readInt()); + return true; + } + case 5: { + parcel.enforceInterface(DESCRIPTOR); + n2 = this.getInfo(parcel.readInt(), parcel.readInt()); + parcel2.writeNoException(); + parcel2.writeInt(n2); + return true; + } + case 6: { + parcel.enforceInterface(DESCRIPTOR); + n2 = this.getKeyCode(parcel.readInt(), parcel.readInt()); + parcel2.writeNoException(); + parcel2.writeInt(n2); + return true; + } + case 7: { + parcel.enforceInterface(DESCRIPTOR); + float f2 = this.getAxisValue(parcel.readInt(), parcel.readInt()); + parcel2.writeNoException(); + parcel2.writeFloat(f2); + return true; + } + case 8: { + parcel.enforceInterface(DESCRIPTOR); + n2 = this.getState(parcel.readInt(), parcel.readInt()); + parcel2.writeNoException(); + parcel2.writeInt(n2); + return true; + } + case 9: + } + parcel.enforceInterface(DESCRIPTOR); + this.sendMessage(parcel.readInt(), parcel.readInt()); + return true; + } + + private static class Proxy + implements IControllerService2 { + private IBinder mRemote; + + Proxy(IBinder iBinder) { + this.mRemote = iBinder; + } + + public IBinder asBinder() { + return this.mRemote; + } + + @Override + public float getAxisValue(int n2, int n3) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + this.mRemote.transact(7, parcel, parcel2, 0); + parcel2.readException(); + float f2 = parcel2.readFloat(); + return f2; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public int getInfo(int n2, int n3) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + this.mRemote.transact(5, parcel, parcel2, 0); + parcel2.readException(); + n2 = parcel2.readInt(); + return n2; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + public String getInterfaceDescriptor() { + return Stub.DESCRIPTOR; + } + + @Override + public int getKeyCode(int n2, int n3) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + this.mRemote.transact(6, parcel, parcel2, 0); + parcel2.readException(); + n2 = parcel2.readInt(); + return n2; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public int getState(int n2, int n3) throws RemoteException { + Parcel parcel = Parcel.obtain(); + Parcel parcel2 = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + this.mRemote.transact(8, parcel, parcel2, 0); + parcel2.readException(); + n2 = parcel2.readInt(); + return n2; + } + finally { + parcel2.recycle(); + parcel.recycle(); + } + } + + @Override + public void registerListener(IControllerListener iControllerListener, int n2) throws RemoteException { + IBinder iBinder = null; + Parcel parcel = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + if (iControllerListener != null) { + iBinder = iControllerListener.asBinder(); + } + parcel.writeStrongBinder(iBinder); + parcel.writeInt(n2); + this.mRemote.transact(1, parcel, null, 1); + return; + } + finally { + parcel.recycle(); + } + } + + @Override + public void registerMonitor(IControllerMonitor iControllerMonitor, int n2) throws RemoteException { + IBinder iBinder = null; + Parcel parcel = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + if (iControllerMonitor != null) { + iBinder = iControllerMonitor.asBinder(); + } + parcel.writeStrongBinder(iBinder); + parcel.writeInt(n2); + this.mRemote.transact(3, parcel, null, 1); + return; + } + finally { + parcel.recycle(); + } + } + + @Override + public void sendMessage(int n2, int n3) throws RemoteException { + Parcel parcel = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + parcel.writeInt(n2); + parcel.writeInt(n3); + this.mRemote.transact(9, parcel, null, 1); + return; + } + finally { + parcel.recycle(); + } + } + + @Override + public void unregisterListener(IControllerListener iControllerListener, int n2) throws RemoteException { + IBinder iBinder = null; + Parcel parcel = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + if (iControllerListener != null) { + iBinder = iControllerListener.asBinder(); + } + parcel.writeStrongBinder(iBinder); + parcel.writeInt(n2); + this.mRemote.transact(2, parcel, null, 1); + return; + } + finally { + parcel.recycle(); + } + } + + @Override + public void unregisterMonitor(IControllerMonitor iControllerMonitor, int n2) throws RemoteException { + IBinder iBinder = null; + Parcel parcel = Parcel.obtain(); + try { + parcel.writeInterfaceToken(Stub.DESCRIPTOR); + if (iControllerMonitor != null) { + iBinder = iControllerMonitor.asBinder(); + } + parcel.writeStrongBinder(iBinder); + parcel.writeInt(n2); + this.mRemote.transact(4, parcel, null, 1); + return; + } + finally { + parcel.recycle(); + } + } + } + } +} + diff --git a/app/src/main/java/com/bda/controller/KeyEvent.java b/app/src/main/java/com/bda/controller/KeyEvent.java new file mode 100644 index 0000000..7817d89 --- /dev/null +++ b/app/src/main/java/com/bda/controller/KeyEvent.java @@ -0,0 +1,87 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Parcel + * android.os.Parcelable + * android.os.Parcelable$Creator + */ +package com.bda.controller; + +import android.os.Parcel; +import android.os.Parcelable; +import com.bda.controller.BaseEvent; + +public final class KeyEvent +extends BaseEvent +implements Parcelable { + public static final int ACTION_DOWN = 0; + public static final int ACTION_UP = 1; + public static final Parcelable.Creator CREATOR = new ParcelableCreator(); + public static final int KEYCODE_BUTTON_A = 96; + public static final int KEYCODE_BUTTON_B = 97; + public static final int KEYCODE_BUTTON_L1 = 102; + public static final int KEYCODE_BUTTON_L2 = 104; + public static final int KEYCODE_BUTTON_R1 = 103; + public static final int KEYCODE_BUTTON_R2 = 105; + public static final int KEYCODE_BUTTON_SELECT = 109; + public static final int KEYCODE_BUTTON_START = 108; + public static final int KEYCODE_BUTTON_THUMBL = 106; + public static final int KEYCODE_BUTTON_THUMBR = 107; + public static final int KEYCODE_BUTTON_X = 98; + public static final int KEYCODE_BUTTON_Y = 99; + public static final int KEYCODE_DPAD_DOWN = 20; + public static final int KEYCODE_DPAD_LEFT = 21; + public static final int KEYCODE_DPAD_RIGHT = 22; + public static final int KEYCODE_DPAD_UP = 19; + public static final int KEYCODE_UNKNOWN = 0; + final int mAction; + final int mKeyCode; + + public KeyEvent(long l2, int n2, int n3, int n4) { + super(l2, n2); + this.mKeyCode = n3; + this.mAction = n4; + } + + KeyEvent(Parcel parcel) { + super(parcel); + this.mKeyCode = parcel.readInt(); + this.mAction = parcel.readInt(); + } + + @Override + public int describeContents() { + return 0; + } + + public final int getAction() { + return this.mAction; + } + + public final int getKeyCode() { + return this.mKeyCode; + } + + @Override + public void writeToParcel(Parcel parcel, int n2) { + super.writeToParcel(parcel, n2); + parcel.writeInt(this.mKeyCode); + parcel.writeInt(this.mAction); + } + + static class ParcelableCreator + implements Parcelable.Creator { + ParcelableCreator() { + } + + public KeyEvent createFromParcel(Parcel parcel) { + return new KeyEvent(parcel); + } + + public KeyEvent[] newArray(int n2) { + return new KeyEvent[n2]; + } + } +} + diff --git a/app/src/main/java/com/bda/controller/MotionEvent.java b/app/src/main/java/com/bda/controller/MotionEvent.java new file mode 100644 index 0000000..736cf56 --- /dev/null +++ b/app/src/main/java/com/bda/controller/MotionEvent.java @@ -0,0 +1,182 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Parcel + * android.os.Parcelable + * android.os.Parcelable$Creator + * android.util.SparseArray + */ +package com.bda.controller; + +import android.os.Parcel; +import android.os.Parcelable; +import android.util.SparseArray; + +public final class MotionEvent +extends BaseEvent +implements Parcelable { + public static final int AXIS_LTRIGGER = 17; + public static final int AXIS_RTRIGGER = 18; + public static final int AXIS_RZ = 14; + public static final int AXIS_X = 0; + public static final int AXIS_Y = 1; + public static final int AXIS_Z = 11; + public static final Parcelable.Creator CREATOR = new ParcelableCreator(); + final SparseArray mAxis; + final SparseArray mPrecision; + + public MotionEvent(long l2, int n2, float f2, float f3, float f4, float f5, float f6, float f7) { + super(l2, n2); + this.mAxis = new SparseArray(4); + this.mAxis.put(0, f2); + this.mAxis.put(1, f3); + this.mAxis.put(11, f4); + this.mAxis.put(14, f5); + this.mPrecision = new SparseArray(2); + this.mPrecision.put(0, f6); + this.mPrecision.put(1, f7); + } + + public MotionEvent(long l2, int n2, int[] nArray, float[] fArray, int[] nArray2, float[] fArray2) { + super(l2, n2); + int n3 = nArray.length; + this.mAxis = new SparseArray(n3); + n2 = 0; + while (true) { + if (n2 >= n3) break; + this.mAxis.put(nArray[n2], fArray[n2]); + ++n2; + } + n3 = nArray2.length; + this.mPrecision = new SparseArray(n3); + n2 = 0; + while (n2 < n3) { + this.mPrecision.put(nArray2[n2], fArray2[n2]); + ++n2; + } + return; + } + + MotionEvent(Parcel parcel) { + super(parcel); + float f2; + int n2; + int n3 = parcel.readInt(); + this.mAxis = new SparseArray(n3); + int n4 = 0; + while (true) { + if (n4 >= n3) break; + n2 = parcel.readInt(); + f2 = parcel.readFloat(); + this.mAxis.put(n2, f2); + ++n4; + } + this.mPrecision = new SparseArray(parcel.readInt()); + n4 = 0; + while (n4 < n3) { + n2 = parcel.readInt(); + f2 = parcel.readFloat(); + this.mPrecision.put(n2, f2); + ++n4; + } + return; + } + + @Override + public int describeContents() { + return 0; + } + + public final int findPointerIndex(int n2) { + return -1; + } + + public final float getAxisValue(int n2) { + return this.getAxisValue(n2, 0); + } + + public final float getAxisValue(int n2, int n3) { + float f2 = 0.0f; + if (n3 != 0) return f2; + return this.mAxis.get(n2, 0.001f); + } + + public final int getPointerCount() { + return 1; + } + + public final int getPointerId(int n2) { + return 0; + } + + public final float getRawX() { + return this.getX(); + } + + public final float getRawY() { + return this.getY(); + } + + public final float getX() { + return this.getAxisValue(0, 0); + } + + public final float getX(int n2) { + return this.getAxisValue(0, n2); + } + + public final float getXPrecision() { + return this.mPrecision.get(0, 0.0f); + } + + public final float getY() { + return this.getAxisValue(1, 0); + } + + public final float getY(int n2) { + return this.getAxisValue(1, n2); + } + + public final float getYPrecision() { + return this.mPrecision.get(1, 0.0f); + } + + @Override + public void writeToParcel(Parcel parcel, int n2) { + super.writeToParcel(parcel, n2); + int n3 = this.mAxis.size(); + parcel.writeInt(n3); + n2 = 0; + while (true) { + if (n2 >= n3) break; + parcel.writeInt(this.mAxis.keyAt(n2)); + parcel.writeFloat(((Float)this.mAxis.valueAt(n2)).floatValue()); + ++n2; + } + n3 = this.mPrecision.size(); + parcel.writeInt(n3); + n2 = 0; + while (n2 < n3) { + parcel.writeInt(this.mPrecision.keyAt(n2)); + parcel.writeFloat(((Float)this.mPrecision.valueAt(n2)).floatValue()); + ++n2; + } + return; + } + + static class ParcelableCreator + implements Parcelable.Creator { + ParcelableCreator() { + } + + public MotionEvent createFromParcel(Parcel parcel) { + return new MotionEvent(parcel); + } + + public MotionEvent[] newArray(int n2) { + return new MotionEvent[n2]; + } + } +} + diff --git a/app/src/main/java/com/bda/controller/StateEvent.java b/app/src/main/java/com/bda/controller/StateEvent.java new file mode 100644 index 0000000..dbe571e --- /dev/null +++ b/app/src/main/java/com/bda/controller/StateEvent.java @@ -0,0 +1,78 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Parcel + * android.os.Parcelable + * android.os.Parcelable$Creator + */ +package com.bda.controller; + +import android.os.Parcel; +import android.os.Parcelable; +import com.bda.controller.BaseEvent; + +public class StateEvent +extends BaseEvent +implements Parcelable { + public static final int ACTION_CONNECTED = 1; + public static final int ACTION_CONNECTING = 2; + public static final int ACTION_DISCONNECTED = 0; + public static final int ACTION_FALSE = 0; + public static final int ACTION_TRUE = 1; + public static final Parcelable.Creator CREATOR = new ParcelableCreator(); + public static final int STATE_CONNECTION = 1; + public static final int STATE_POWER_LOW = 2; + public static final int STATE_SELECTED_VERSION = 4; + public static final int STATE_SUPPORTED_VERSION = 3; + public static final int STATE_UNKNOWN = 0; + final int mAction; + final int mState; + + public StateEvent(long l2, int n2, int n3, int n4) { + super(l2, n2); + this.mState = n3; + this.mAction = n4; + } + + StateEvent(Parcel parcel) { + super(parcel); + this.mState = parcel.readInt(); + this.mAction = parcel.readInt(); + } + + @Override + public int describeContents() { + return 0; + } + + public final int getAction() { + return this.mAction; + } + + public final int getState() { + return this.mState; + } + + @Override + public void writeToParcel(Parcel parcel, int n2) { + super.writeToParcel(parcel, n2); + parcel.writeInt(this.mState); + parcel.writeInt(this.mAction); + } + + static class ParcelableCreator + implements Parcelable.Creator { + ParcelableCreator() { + } + + public StateEvent createFromParcel(Parcel parcel) { + return new StateEvent(parcel); + } + + public StateEvent[] newArray(int n2) { + return new StateEvent[n2]; + } + } +} + diff --git a/app/src/main/java/com/bda/controller/VersionInfo.java b/app/src/main/java/com/bda/controller/VersionInfo.java new file mode 100644 index 0000000..99f6893 --- /dev/null +++ b/app/src/main/java/com/bda/controller/VersionInfo.java @@ -0,0 +1,12 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.bda.controller; + +public class VersionInfo { + public static final String VERSION = "1.2.7a.120731"; + + private VersionInfo() { + } +} + diff --git a/app/src/main/java/com/ea/EAIO/EAIO.java b/app/src/main/java/com/ea/EAIO/EAIO.java new file mode 100644 index 0000000..a4489cd --- /dev/null +++ b/app/src/main/java/com/ea/EAIO/EAIO.java @@ -0,0 +1,15 @@ +package com.ea.EAIO; + +import android.app.Activity; +import android.content.res.AssetManager; +import android.os.Environment; + +public class EAIO { + public static native void Shutdown(); + + public static void Startup(Activity activity) { + StartupNativeImpl(activity.getAssets(), Environment.getDataDirectory().getAbsolutePath(), activity.getFilesDir().getAbsolutePath(), Environment.getExternalStorageDirectory().getAbsolutePath()); + } + + private static native void StartupNativeImpl(AssetManager assetManager, String dataDirectory, String filesDir, String externalStorage); +} diff --git a/app/src/main/java/com/ea/EAMIO/StorageDirectory.java b/app/src/main/java/com/ea/EAMIO/StorageDirectory.java new file mode 100644 index 0000000..cedbe5e --- /dev/null +++ b/app/src/main/java/com/ea/EAMIO/StorageDirectory.java @@ -0,0 +1,37 @@ +package com.ea.EAMIO; + +import android.app.Activity; +import android.os.Environment; + +public class StorageDirectory { + public static Activity sActivity; + + public static String GetDedicatedDirectory() { + return "Android/data/" + sActivity.getClass().getPackage().getName() + "/files/"; + } + + public static String GetInternalStorageDirectory() { + return sActivity.getFilesDir().getAbsolutePath(); + } + + public static String GetPrimaryExternalStorageDirectory() { + return Environment.getExternalStorageDirectory().getAbsolutePath(); + } + + public static String GetPrimaryExternalStorageState() { + return Environment.getExternalStorageState(); + } + + public static void Shutdown() { + ShutdownNativeImpl(); + } + + private static native void ShutdownNativeImpl(); + + public static void Startup(Activity activity) { + sActivity = activity; + StartupNativeImpl(); + } + + private static native void StartupNativeImpl(); +} diff --git a/app/src/main/java/com/ea/InAppWebBrowser/BrowserAndroid.java b/app/src/main/java/com/ea/InAppWebBrowser/BrowserAndroid.java new file mode 100644 index 0000000..8572784 --- /dev/null +++ b/app/src/main/java/com/ea/InAppWebBrowser/BrowserAndroid.java @@ -0,0 +1,189 @@ +package com.ea.InAppWebBrowser; + +import android.app.Activity; +import android.graphics.Paint; +import android.view.MotionEvent; +import android.view.View; +import android.view.ViewGroup; +import android.webkit.WebView; +import android.widget.RelativeLayout; +import com.ea.easp.VirtualKeyboardAndroidDelegate; +import java.util.UUID; + +public class BrowserAndroid { + public static int gInstanceCount = 0; + public static Activity mActivity; + public static ViewGroup mViewGroup; + public final int JAVASCRIPT_DISABLE = 0; + public final int JAVASCRIPT_ENABLE = 1; + public final int SCROLLBARSTYLE_DEFAULT = 0; + public final int SCROLLBARSTYLE_INSIDE_INSET = 2; + public final int SCROLLBARSTYLE_INSIDE_OVERLAY = 1; + public final int SCROLLBARSTYLE_OUTSIDE_INSET = 4; + public final int SCROLLBARSTYLE_OUTSIDE_OVERLAY = 3; + public final int SCROLLBAR_INVISIBLE = 1; + public final int SCROLLBAR_VISIBLE = 0; + public int mInstanceID = 0; + public RelativeLayout mLayout; + public WebView mWebView; + public InAppWebBrowserWebViewClient mWebViewClient; + + public static void Shutdown() { + ShutdownNativeImpl(); + } + + private static native void ShutdownNativeImpl(); + + public static void Startup(Activity activity, ViewGroup viewGroup) { + mActivity = activity; + mViewGroup = viewGroup; + StartupNativeImpl(); + } + + private static native void StartupNativeImpl(); + + public void EvaluateJavaScript(final String str) { + mActivity.runOnUiThread(new Runnable() { + /* class com.ea.InAppWebBrowser.BrowserAndroid.AnonymousClass5 */ + + public void run() { + UUID randomUUID; + do { + randomUUID = UUID.randomUUID(); + } while (!BrowserAndroid.this.mWebViewClient.addUUID(randomUUID)); + BrowserAndroid.this.mWebView.loadUrl("javascript: JavascriptCallback.ReceiveResult(eval(" + str + "), '" + randomUUID.toString() + "');"); + } + }); + } + + public void LoadHTML(final String str) { + mActivity.runOnUiThread(new Runnable() { + /* class com.ea.InAppWebBrowser.BrowserAndroid.AnonymousClass3 */ + + public void run() { + BrowserAndroid.this.mWebView.loadData(str, "text/html", null); + } + }); + } + + public void OpenUrl(final String str) { + mActivity.runOnUiThread(new Runnable() { + /* class com.ea.InAppWebBrowser.BrowserAndroid.AnonymousClass2 */ + + public void run() { + BrowserAndroid.this.mWebView.loadUrl(str); + } + }); + } + + public void SetViewFrame(final int i, final int i2, final int i3, final int i4) { + if (this.mWebView != null) { + mActivity.runOnUiThread(new Runnable() { + /* class com.ea.InAppWebBrowser.BrowserAndroid.AnonymousClass4 */ + + public void run() { + RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(i3, i4); + layoutParams.leftMargin = i; + layoutParams.topMargin = i2; + BrowserAndroid.this.mLayout.updateViewLayout(BrowserAndroid.this.mWebView, layoutParams); + } + }); + } + } + + public void destroy() { + mActivity.runOnUiThread(new Runnable() { + /* class com.ea.InAppWebBrowser.BrowserAndroid.AnonymousClass6 */ + + public void run() { + BrowserAndroid.this.mWebView.stopLoading(); + BrowserAndroid.this.mWebView.setWebViewClient(null); + BrowserAndroid.this.mWebViewClient = null; + BrowserAndroid.this.mLayout.removeView(BrowserAndroid.this.mWebView); + BrowserAndroid.mViewGroup.removeView(BrowserAndroid.this.mLayout); + BrowserAndroid.this.mWebView = null; + BrowserAndroid.this.mLayout = null; + } + }); + } + + public void init(final int i, final int i2, final int i3, final int i4, final int i5, final int i6, final int i7, final boolean z, final boolean z2) { + int i8 = gInstanceCount; + gInstanceCount = i8 + 1; + this.mInstanceID = i8; + mActivity.runOnUiThread(new Runnable() { + /* class com.ea.InAppWebBrowser.BrowserAndroid.AnonymousClass1 */ + + public void run() { + boolean z = true; + BrowserAndroid.this.mLayout = new RelativeLayout(BrowserAndroid.mActivity); + BrowserAndroid.this.mWebView = new WebView(BrowserAndroid.mActivity); + BrowserAndroid.this.mWebViewClient = new InAppWebBrowserWebViewClient(); + BrowserAndroid.this.mWebViewClient.mInstanceID = BrowserAndroid.this.mInstanceID; + BrowserAndroid.this.mWebView.setWebViewClient(BrowserAndroid.this.mWebViewClient); + if (z2) { + BrowserAndroid.this.mWebView.setBackgroundColor(0); + Class cls = BrowserAndroid.this.mWebView.getClass(); + try { + cls.getMethod("setLayerType", Integer.TYPE, Paint.class).invoke(BrowserAndroid.this.mWebView, Integer.valueOf(((Integer) cls.getField("LAYER_TYPE_SOFTWARE").get(BrowserAndroid.this.mWebView)).intValue()), null); + } catch (Exception e) { + } + } + if (!z) { + Class cls2 = BrowserAndroid.this.mWebView.getClass(); + try { + cls2.getMethod("setOverScrollMode", Integer.TYPE).invoke(BrowserAndroid.this.mWebView, Integer.valueOf(((Integer) cls2.getField("OVER_SCROLL_NEVER").get(BrowserAndroid.this.mWebView)).intValue())); + } catch (Exception e2) { + } + } + //BrowserAndroid.this.mWebView.requestFocus(TransportMediator.KEYCODE_MEDIA_RECORD); + BrowserAndroid.this.mWebView.setOnTouchListener(new View.OnTouchListener() { + /* class com.ea.InAppWebBrowser.BrowserAndroid.AnonymousClass1.AnonymousClass1 */ + + public boolean onTouch(View view, MotionEvent motionEvent) { + switch (motionEvent.getAction()) { + case 0: + case 1: + if (view.hasFocus()) { + return false; + } + view.requestFocus(); + return false; + default: + return false; + } + } + }); + if (i5 == 1) { + BrowserAndroid.this.mWebView.getSettings().setJavaScriptEnabled(true); + } + BrowserAndroid.this.mWebView.setVerticalScrollBarEnabled(i6 == 0); + WebView webView = BrowserAndroid.this.mWebView; + if (i6 != 0) { + z = false; + } + webView.setHorizontalScrollBarEnabled(z); + BrowserAndroid.this.mWebView.addJavascriptInterface(new JavascriptInterface(BrowserAndroid.this.mWebViewClient), "JavascriptCallback"); + switch (i7) { + case 1: + BrowserAndroid.this.mWebView.setScrollBarStyle(0); + break; + case 2: + BrowserAndroid.this.mWebView.setScrollBarStyle(16777216); + break; + case 3: + BrowserAndroid.this.mWebView.setScrollBarStyle(VirtualKeyboardAndroidDelegate.IME_FLAG_NO_FULLSCREEN); + break; + case 4: + BrowserAndroid.this.mWebView.setScrollBarStyle(50331648); + break; + } + RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(i3, i4); + layoutParams.leftMargin = i; + layoutParams.topMargin = i2; + BrowserAndroid.this.mLayout.addView(BrowserAndroid.this.mWebView, layoutParams); + BrowserAndroid.mViewGroup.addView(BrowserAndroid.this.mLayout); + } + }); + } +} diff --git a/app/src/main/java/com/ea/InAppWebBrowser/InAppWebBrowserWebViewClient.java b/app/src/main/java/com/ea/InAppWebBrowser/InAppWebBrowserWebViewClient.java new file mode 100644 index 0000000..ba70295 --- /dev/null +++ b/app/src/main/java/com/ea/InAppWebBrowser/InAppWebBrowserWebViewClient.java @@ -0,0 +1,68 @@ +package com.ea.InAppWebBrowser; + +import android.graphics.Bitmap; +import android.util.Log; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import java.util.Collections; +import java.util.SortedSet; +import java.util.TreeSet; +import java.util.UUID; + +public class InAppWebBrowserWebViewClient extends WebViewClient { + public int mInstanceID = 0; + private SortedSet mJavascriptIds = Collections.synchronizedSortedSet(new TreeSet()); + + public native void OnJavascriptResult(String str, int i); + + public native void OnLoadError(String str, int i); + + public native void OnLoadFinished(String str, int i); + + public native void OnLoadStarted(String str, int i); + + public native boolean ShouldLoadURL(String str, int i); + + public boolean addUUID(UUID uuid) { + if (this.mJavascriptIds.contains(uuid)) { + return false; + } + this.mJavascriptIds.add(uuid); + return true; + } + + public void onJavascriptResult(String str, String str2) throws Exception { + UUID fromString = UUID.fromString(str2); + if (fromString == null || !this.mJavascriptIds.contains(fromString)) { + throw new Exception("Unable to verify validity of script result."); + } + this.mJavascriptIds.remove(fromString); + OnJavascriptResult(str, this.mInstanceID); + } + + public void onLoadResource(WebView webView, String str) { + Log.e("InAppWebBrowserWebViewClient", "onLoadResource: " + str); + OnLoadStarted(str, this.mInstanceID); + } + + public void onPageFinished(WebView webView, String str) { + Log.e("InAppWebBrowserWebViewClient", "onPageFinished: " + str); + OnLoadFinished(str, this.mInstanceID); + } + + public void onPageStarted(WebView webView, String str, Bitmap bitmap) { + Log.e("InAppWebBrowserWebViewClient", "onPageStarted: " + str); + OnLoadStarted(str, this.mInstanceID); + } + + public void onReceivedError(WebView webView, int i, String str, String str2) { + Log.e("InAppWebBrowserWebViewClient", "onReceivedError"); + OnLoadError("Loading Error. URL: " + str2 + " ErrorCode: " + i + " Description: " + str, this.mInstanceID); + } + + @Override // android.webkit.WebViewClient + public boolean shouldOverrideUrlLoading(WebView webView, String str) { + Log.e("InAppWebBrowserWebViewClient", "shouldOverrideUrlLoading: " + str); + return !ShouldLoadURL(str, this.mInstanceID); + } +} diff --git a/app/src/main/java/com/ea/InAppWebBrowser/JavascriptInterface.java b/app/src/main/java/com/ea/InAppWebBrowser/JavascriptInterface.java new file mode 100644 index 0000000..798c32c --- /dev/null +++ b/app/src/main/java/com/ea/InAppWebBrowser/JavascriptInterface.java @@ -0,0 +1,13 @@ +package com.ea.InAppWebBrowser; + +public class JavascriptInterface { + private InAppWebBrowserWebViewClient mWebViewClient; + + public JavascriptInterface(InAppWebBrowserWebViewClient inAppWebBrowserWebViewClient) { + this.mWebViewClient = inAppWebBrowserWebViewClient; + } + + public void ReceiveResult(String str, String str2) throws Exception { + this.mWebViewClient.onJavascriptResult(str, str2); + } +} diff --git a/app/src/main/java/com/ea/InputMan/InputMan.java b/app/src/main/java/com/ea/InputMan/InputMan.java new file mode 100644 index 0000000..bebc77b --- /dev/null +++ b/app/src/main/java/com/ea/InputMan/InputMan.java @@ -0,0 +1,72 @@ +package com.ea.InputMan; + +import androidx.fragment.app.FragmentTransaction; +import androidx.core.view.MotionEventCompat; +import android.view.MotionEvent; + +public class InputMan { + private boolean gbMotionEvent_GetSource = false; + + public InputMan() { + try { + MotionEvent.class.getMethod("getSource"); + this.gbMotionEvent_GetSource = true; + } catch (Exception e) { + } + } + + private static int GetEventType(int i) { + switch (i) { + case 0: + case 4: + case 5: + default: + return 0; + case 1: + case 6: + return 2; + case 2: + return 1; + case 3: + return 3; + } + } + + private int GetSource(MotionEvent motionEvent) { + if (!this.gbMotionEvent_GetSource) { + return 0; + } + int source = motionEvent.getSource(); + if ((source & 2) == 0) { + return -1; + } + switch (source) { + case 1048584: + return 10; + case FragmentTransaction.TRANSIT_FRAGMENT_CLOSE: + break; + } + return 0; + } + + private static native boolean InputMan_OnMotionEvent(int i, int i2, float f, float f2, int i3, float f3); + + public boolean onTouchEvent(int i, MotionEvent motionEvent) { + boolean z = false; + int historySize = motionEvent.getHistorySize(); + int pointerCount = motionEvent.getPointerCount(); + int GetSource = GetSource(motionEvent); + int GetEventType = GetEventType(motionEvent.getAction() & MotionEventCompat.ACTION_MASK); + if (GetSource >= 0) { + for (int i2 = 0; i2 < historySize; i2++) { + for (int i3 = 0; i3 < pointerCount; i3++) { + InputMan_OnMotionEvent(i, motionEvent.getPointerId(i3), motionEvent.getHistoricalX(i3, i2), motionEvent.getHistoricalY(i3, i2), GetEventType, motionEvent.getHistoricalPressure(i3, i2)); + } + } + for (int i4 = 0; i4 < pointerCount; i4++) { + z = InputMan_OnMotionEvent(i, motionEvent.getPointerId(i4), motionEvent.getX(i4), motionEvent.getY(i4), GetEventType, motionEvent.getPressure(i4)); + } + } + return z; + } +} diff --git a/app/src/main/java/com/ea/easp/ContactsAndroid.kt b/app/src/main/java/com/ea/easp/ContactsAndroid.kt new file mode 100644 index 0000000..ef5172e --- /dev/null +++ b/app/src/main/java/com/ea/easp/ContactsAndroid.kt @@ -0,0 +1,17 @@ +package com.ea.easp + +import android.util.Log + +//Класс вызывается из нативного кода +class ContactsAndroid { + + fun CanSendMail() = false + + fun CanSendSMS() = false + + fun OpenEmailClient(str: String?, str2: String?, str3: String?) = Log.i("ContactsAndroid", "OpenEmailClient") + + fun OpenSMSClient(str: String?, str2: String?) = Log.i("ContactsAndroid", "OpenSMSClient") + + val contacts = "" +} diff --git a/app/src/main/java/com/ea/easp/Debug.java b/app/src/main/java/com/ea/easp/Debug.java new file mode 100644 index 0000000..ee2ec80 --- /dev/null +++ b/app/src/main/java/com/ea/easp/Debug.java @@ -0,0 +1,37 @@ +package com.ea.easp; + +public class Debug { + public static boolean LogEnabled = true; + + public static class Log { + public static void d(String str, String str2) { + if (Debug.LogEnabled) { + android.util.Log.d(str, str2); + } + } + + public static void e(String str, String str2) { + if (Debug.LogEnabled) { + android.util.Log.e(str, str2); + } + } + + public static void e(String str, String str2, Throwable th) { + if (Debug.LogEnabled) { + android.util.Log.e(str, str2, th); + } + } + + public static void i(String str, String str2) { + if (Debug.LogEnabled) { + android.util.Log.i(str, str2); + } + } + + public static void w(String str, String str2) { + if (Debug.LogEnabled) { + android.util.Log.w(str, str2); + } + } + } +} diff --git a/app/src/main/java/com/ea/easp/DeviceInfoUtil.java b/app/src/main/java/com/ea/easp/DeviceInfoUtil.java new file mode 100644 index 0000000..c46941b --- /dev/null +++ b/app/src/main/java/com/ea/easp/DeviceInfoUtil.java @@ -0,0 +1,153 @@ +package com.ea.easp; + +import android.app.Activity; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; +import android.net.wifi.WifiInfo; +import android.net.wifi.WifiManager; +import android.os.Build; +import android.provider.Settings; +import android.telephony.TelephonyManager; +import java.util.Calendar; +import java.util.Locale; + +public class DeviceInfoUtil { + private static final String TAG = "DeviceInfoUtil"; + private static ConnectivityManager connectivityManager = null; + private static TelephonyManager telephonyManager = null; + private static WifiManager wifiManager = null; + + public static String GetApplicationName() { + ApplicationInfo applicationInfo; + Debug.Log.d(TAG, "GetApplicationName()..."); + PackageManager packageManager = EASPHandler.mActivity.getPackageManager(); + try { + applicationInfo = EASPHandler.mActivity.getApplicationInfo(); + } catch (Exception e) { + Debug.Log.e(TAG, "[GetApplicationName] getApplicationInfo Exception : " + e); + applicationInfo = null; + } + String str = (String) (applicationInfo != null ? packageManager.getApplicationLabel(applicationInfo) : ""); + Debug.Log.d(TAG, "...GetApplicationName()"); + return str; + } + + public static String GetCurrentTimeZoneAbbreviation() { + Debug.Log.d(TAG, "GetCurrentTimeZoneAbbreviation()..."); + String format = String.format(Locale.US, "%tZ", Calendar.getInstance()); + Debug.Log.d(TAG, "...GetCurrentTimeZoneAbbreviation()"); + return format; + } + + public static String GetDeviceCountry() { + Debug.Log.d(TAG, "GetDeviceCountry()..."); + Locale locale = Locale.getDefault(); + Debug.Log.d(TAG, "...GetDeviceCountry()"); + return locale.getCountry(); + } + + public static String getAndroidID() { + Debug.Log.d(TAG, "getAndroidID()..."); + String string = Settings.Secure.getString(EASPHandler.mActivity.getContentResolver(), "android_id"); + Debug.Log.d(TAG, "...getAndroidID()"); + return string; + } + + public static String getBuildVersionSDK_INT() { + return "" + Build.VERSION.SDK_INT; + } + + public static String getMacAddress() { + Debug.Log.d(TAG, "getMacAddress()..."); + String str = null; + if (wifiManager != null) { + WifiInfo connectionInfo = wifiManager.getConnectionInfo(); + if (connectionInfo != null) { + str = connectionInfo.getMacAddress(); + Debug.Log.d(TAG, "MAC address: " + str); + } else { + Debug.Log.e(TAG, "WifiInfo is not available"); + } + } else { + Debug.Log.e(TAG, "WifiManager is not available"); + } + Debug.Log.d(TAG, "...getMacAddress()"); + return str; + } + + public static String getManufacturer() { + return Build.MANUFACTURER; + } + + public static String getModel() { + return Build.MODEL; + } + + public static String getNetworkOperator() { + Debug.Log.d(TAG, "getNetworkOperator()..."); + String str = null; + if (telephonyManager != null) { + str = telephonyManager.getNetworkOperator(); + } else { + Debug.Log.e(TAG, "TelephonyManager is not available"); + } + Debug.Log.d(TAG, "...getNetworkOperator()"); + return str; + } + + public static String getNetworkType() { + NetworkInfo activeNetworkInfo; + if (connectivityManager == null || (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) == null || !activeNetworkInfo.isConnectedOrConnecting()) { + return null; + } + switch (activeNetworkInfo.getType()) { + case 0: + return activeNetworkInfo.getSubtypeName(); + case 1: + return "WIFI"; + default: + return (Build.VERSION.SDK_INT < 8 || activeNetworkInfo.getType() != 6) ? "UNKNOWN" : "WIMAX"; + } + } + + public static String getPlatformVersion() { + return Build.VERSION.RELEASE; + } + + public static String getTelephonyDeviceID() { + Debug.Log.d(TAG, "getTelephonyDeviceID()..."); + String str = null; + if (telephonyManager != null) { + str = telephonyManager.getDeviceId(); + } else { + Debug.Log.e(TAG, "TelephonyManager is not available"); + } + Debug.Log.d(TAG, "...getTelephonyDeviceID()"); + return str; + } + + public static void init() { + Debug.Log.d(TAG, "init()..."); + Activity activity = EASPHandler.mActivity; + telephonyManager = (TelephonyManager) activity.getSystemService("phone"); + wifiManager = (WifiManager) activity.getSystemService("wifi"); + connectivityManager = (ConnectivityManager) activity.getSystemService("connectivity"); + initJNI(); + Debug.Log.d(TAG, "...init()"); + } + + public static native void initJNI(); + + public static void shutdown() { + Debug.Log.d(TAG, "shutdown()..."); + shutdownJNI(); + telephonyManager = null; + wifiManager = null; + connectivityManager = null; + Debug.Log.d(TAG, "...shutdown()"); + } + + public static native void shutdownJNI(); +} diff --git a/app/src/main/java/com/ea/easp/EASPHandler.kt b/app/src/main/java/com/ea/easp/EASPHandler.kt new file mode 100644 index 0000000..7da12d2 --- /dev/null +++ b/app/src/main/java/com/ea/easp/EASPHandler.kt @@ -0,0 +1,84 @@ +package com.ea.easp + +import android.annotation.SuppressLint +import android.app.Activity +import android.content.Intent +import android.content.res.Configuration +import android.opengl.GLSurfaceView +import android.os.Handler +import android.view.KeyEvent +import android.view.ViewGroup + +class EASPHandler( + activity: Activity, + viewGroup: ViewGroup, + mGLSurfaceView: GLSurfaceView +) { + + @SuppressLint("StaticFieldLeak") + companion object{ + @JvmStatic + lateinit var mActivity: Activity + @JvmStatic + lateinit var mViewGroup: ViewGroup + } + + init { + mActivity = activity + mViewGroup = viewGroup + } + private var mPhysicalKeyboard: PhysicalKeyboardAndroid? = null + private val mTaskLauncher: TaskLauncher = TaskLauncher(Handler(), mGLSurfaceView) + + external fun initJNI() + + fun onActivityResult(i: Int, i2: Int, intent: Intent?) { + Debug.Log.i(this.javaClass.name, "onActivityResult requestCode=$i, resultCode=$i2") + //this.mFacebookAgent.authorizeCallback(i, i2, intent); + } + + fun onConfigurationChanged(configuration: Configuration?) { + mPhysicalKeyboard!!.onConfigurationChanged(configuration) + } + + fun onCreate() { + Debug.Log.d(this.javaClass.name, "onCreate()...") + initJNI() + DeviceInfoUtil.init() + PackageUtil.init() + //this.mFacebookAgent = new FacebookAgentJNI(mActivity, this.mTaskLauncher); + //this.mFacebookAgent.init(); + //BrowserAndroid.Startup(mActivity, mViewGroup); + //this.mAndroidMarketJNI = new MarketJNI(mActivity, this.mTaskLauncher, MarketJNI.StoreType.UNKNOWN); + //this.mAndroidMarketJNI.init(); + mPhysicalKeyboard = PhysicalKeyboardAndroid(mTaskLauncher) + Debug.Log.d(this.javaClass.name, "...onCreate()") + } + + fun onDestroy() { + Debug.Log.d(this.javaClass.name, "onDestroy()...") + mPhysicalKeyboard = null + //this.mAndroidMarketJNI.shutdown(); + //BrowserAndroid.Shutdown(); + //this.mFacebookAgent.shutdown(); + PackageUtil.shutdown() + DeviceInfoUtil.shutdown() + shutdownJNI() + Debug.Log.d(this.javaClass.name, "...onDestroy()") + } + + fun onKeyDown(i: Int, keyEvent: KeyEvent?): Boolean { + return mPhysicalKeyboard!!.OnKeyDown(i, keyEvent) + } + + fun onKeyUp(i: Int, keyEvent: KeyEvent?): Boolean { + return mPhysicalKeyboard!!.OnKeyUp(i, keyEvent) + } + + fun setLogEnabled(enabled: Boolean) { + Debug.LogEnabled = enabled + } + + external fun shutdownJNI() + +} diff --git a/app/src/main/java/com/ea/easp/KeyboardAndroid.java b/app/src/main/java/com/ea/easp/KeyboardAndroid.java new file mode 100644 index 0000000..7e0a71e --- /dev/null +++ b/app/src/main/java/com/ea/easp/KeyboardAndroid.java @@ -0,0 +1,56 @@ +package com.ea.easp; + +import android.view.KeyEvent; +import com.eamobile.Language; + +/* access modifiers changed from: package-private */ +public abstract class KeyboardAndroid { + KeyboardAndroid() { + } + + public static final boolean IsSystemKey(int i) { + switch (i) { + case 3: + case 4: + case 5: + case 6: + case Language.NETWORK_WARNING_TXT /*{ENCODED_INT: 24}*/: + case Language.UPDATES_FOUND_TITLE /*{ENCODED_INT: 25}*/: + case Language.UPDATES_FOUND_TXT /*{ENCODED_INT: 26}*/: + case 91: + return true; + default: + return false; + } + } + + public static final boolean IsVirtualKeyboardEvent(KeyEvent keyEvent) { + return (keyEvent.getFlags() & 2) != 0; + } + + private native void NativeOnKeyDown(int i, int i2); + + private native void NativeOnKeyUp(int i, int i2); + + /* access modifiers changed from: protected */ + public native void NativeOnCharacter(int i); + + /* access modifiers changed from: protected */ + public native void NativeOnCursorMove(int i, int i2); + + /* access modifiers changed from: protected */ + public void NativeOnKeyDown(int i, boolean z) { + NativeOnKeyDown(i, z ? 1 : 0); + } + + /* access modifiers changed from: protected */ + public void NativeOnKeyUp(int i, boolean z) { + NativeOnKeyUp(i, z ? 1 : 0); + } + + /* access modifiers changed from: protected */ + public native void NativeOnKeyboardHideHerself(); + + /* access modifiers changed from: protected */ + public native void NativeOnVisibilityChanged(boolean z); +} diff --git a/app/src/main/java/com/ea/easp/PackageUtil.java b/app/src/main/java/com/ea/easp/PackageUtil.java new file mode 100644 index 0000000..61c9352 --- /dev/null +++ b/app/src/main/java/com/ea/easp/PackageUtil.java @@ -0,0 +1,37 @@ +package com.ea.easp; + +import android.content.Intent; +import com.ea.easp.Debug; + +public class PackageUtil { + private static final String TAG = "PackageUtil"; + + public static void init() { + initJNI(); + } + + public static native void initJNI(); + + public static void launchApplication(String str, String[] strArr, String[] strArr2) { + Debug.Log.d(TAG, "launchApplication()..."); + Intent launchIntentForPackage = EASPHandler.mActivity.getPackageManager().getLaunchIntentForPackage(str); + for (int i = 0; i < strArr.length; i++) { + launchIntentForPackage.putExtra(strArr[i], strArr2[i]); + } + EASPHandler.mActivity.startActivity(launchIntentForPackage); + Debug.Log.d(TAG, "...launchApplication()"); + } + + public static boolean packageIsInstalled(String str) { + Debug.Log.d(TAG, "packageIsInstalled()..."); + Intent launchIntentForPackage = EASPHandler.mActivity.getPackageManager().getLaunchIntentForPackage(str); + Debug.Log.d(TAG, "...packageIsInstalled()"); + return launchIntentForPackage != null; + } + + public static void shutdown() { + shutdownJNI(); + } + + public static native void shutdownJNI(); +} diff --git a/app/src/main/java/com/ea/easp/PhysicalKeyboardAndroid.java b/app/src/main/java/com/ea/easp/PhysicalKeyboardAndroid.java new file mode 100644 index 0000000..5da2b9c --- /dev/null +++ b/app/src/main/java/com/ea/easp/PhysicalKeyboardAndroid.java @@ -0,0 +1,77 @@ +package com.ea.easp; + +import android.content.res.Configuration; +import android.view.KeyEvent; + +public class PhysicalKeyboardAndroid extends KeyboardAndroid { + private static final boolean DEBUG_LOG_ENABLED = true; + private static final String DEBUG_LOG_TAG = "EASP PhysicalKeyboardAndroid"; + private int mPhysicalKeyboardVisibility = 0; + private TaskLauncher mTaskLauncher; + + PhysicalKeyboardAndroid(TaskLauncher taskLauncher) { + this.mTaskLauncher = taskLauncher; + } + + public boolean OnKeyDown(final int mCode, KeyEvent keyEvent) { + Debug.Log.d(DEBUG_LOG_TAG, "physical keyboard OnKeyDown: " + mCode); + if (IsSystemKey(mCode)) { + return false; + } + if (keyEvent.getRepeatCount() == 0) { + final boolean mAlt = keyEvent.isAltPressed(); + this.mTaskLauncher.runInGLThread(new Runnable() { + @Override + public void run() { + PhysicalKeyboardAndroid.this.NativeOnKeyDown(mCode, mAlt); + } + }); + } + return true; + } + + public boolean OnKeyUp(final int mCode, KeyEvent keyEvent) { + Debug.Log.d(DEBUG_LOG_TAG, "physical keyboard OnKeyUp: " + mCode); + if (IsSystemKey(mCode)) { + return false; + } + final boolean mAlt = keyEvent.isAltPressed(); + this.mTaskLauncher.runInGLThread(new Runnable() { + @Override + public void run() { + PhysicalKeyboardAndroid.this.NativeOnKeyUp(mCode, mAlt); + } + }); + final int unicodeChar = keyEvent.getUnicodeChar(); + if (unicodeChar != 0) { + this.mTaskLauncher.runInGLThread(new Runnable() { + public void run() { + PhysicalKeyboardAndroid.this.NativeOnCharacter(unicodeChar); + } + }); + } + return true; + } + + public void onConfigurationChanged(Configuration configuration) { + boolean mKeyboardVisible = true; + if (this.mPhysicalKeyboardVisibility != configuration.hardKeyboardHidden) { + switch (configuration.hardKeyboardHidden) { + case 1: + case 2: + if (configuration.hardKeyboardHidden != 1) { + mKeyboardVisible = false; + } + final boolean finalMKeyboardVisible = mKeyboardVisible; + this.mTaskLauncher.runInGLThread(new Runnable() { + @Override + public void run() { + PhysicalKeyboardAndroid.this.NativeOnVisibilityChanged(finalMKeyboardVisible); + } + }); + break; + } + this.mPhysicalKeyboardVisibility = configuration.hardKeyboardHidden; + } + } +} diff --git a/app/src/main/java/com/ea/easp/TaskLauncher.java b/app/src/main/java/com/ea/easp/TaskLauncher.java new file mode 100644 index 0000000..f4655b5 --- /dev/null +++ b/app/src/main/java/com/ea/easp/TaskLauncher.java @@ -0,0 +1,23 @@ +package com.ea.easp; + +import android.opengl.GLSurfaceView; +import android.os.Handler; + +public class TaskLauncher { + private static final String TAG = "TaskLauncher"; + private GLSurfaceView mGLSurfaceView; + private Handler mHandler; + + public TaskLauncher(Handler handler, GLSurfaceView gLSurfaceView) { + this.mHandler = handler; + this.mGLSurfaceView = gLSurfaceView; + } + + public void runInGLThread(Runnable runnable) { + this.mGLSurfaceView.queueEvent(runnable); + } + + public void runInUIThread(Runnable runnable) { + this.mHandler.post(runnable); + } +} diff --git a/app/src/main/java/com/ea/easp/User.java b/app/src/main/java/com/ea/easp/User.java new file mode 100644 index 0000000..98ee8a5 --- /dev/null +++ b/app/src/main/java/com/ea/easp/User.java @@ -0,0 +1,7 @@ +package com.ea.easp; + +public class User { + String mDisplayName; + String[] mEmail; + String[] mPhoneNumber; +} diff --git a/app/src/main/java/com/ea/easp/VirtualKeyboardAndroidDelegate.java b/app/src/main/java/com/ea/easp/VirtualKeyboardAndroidDelegate.java new file mode 100644 index 0000000..dd19a55 --- /dev/null +++ b/app/src/main/java/com/ea/easp/VirtualKeyboardAndroidDelegate.java @@ -0,0 +1,394 @@ +package com.ea.easp; + +import android.app.Activity; +import androidx.core.view.accessibility.AccessibilityEventCompat; +import android.text.InputFilter; +import android.view.KeyEvent; +import android.view.ViewGroup; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.RelativeLayout; + +import com.ea.nimble.Log; +import com.google.android.gms.drive.DriveFile; + +public class VirtualKeyboardAndroidDelegate extends KeyboardAndroid { + private static final boolean DEBUG_LOG_ENABLED = true; + private static final String DEBUG_LOG_TAG = "EASP VirtualKeyboardAndroidDelegate"; + private static final boolean DEBUG_SHOW_TEXT_FIELD = false; + public static final int IME_FLAG_NO_FULLSCREEN = 33554432; + private static final int kEnterKeyLabelDefault = 0; + private static final int kEnterKeyLabelDone = 5; + private static final int kEnterKeyLabelGo = 1; + private static final int kEnterKeyLabelNext = 2; + private static final int kEnterKeyLabelSearch = 3; + private static final int kEnterKeyLabelSend = 4; + private static final int kLayoutDefault = 0; + private static final int kLayoutDigits = 1; + private static final int kLayoutEmail = 2; + private static final int kLayoutPass = 5; + private static final int kLayoutPhone = 3; + private static final int kLayoutUrl = 4; + public int mAnchor; + public String mCurrenText; + public int mCursorPos; + private volatile int mEnterkeyLabel = 6; + private final InputMethodManager mInputMethodManager; + private volatile int mKeyboardLayout = 1; + private Activity mMainActivity; + public ViewGroup mMainViewGroup; + public int mMaxTextLength = Log.LEVEL_INFO; + public String mNewText; + private boolean mPhysicalKeyboardVisible = false; + public RelativeLayout mRelativeLayout; + RelativeLayout.LayoutParams mRelativeLayoutParam; + private volatile int mShiftFlag = 0; + private TextField mTextField; + private boolean mVisibleRequested = false; + + /* access modifiers changed from: protected */ + public class TextField extends EditText { + boolean isExtChange = false; + private final CharSequence mDefaultText = ""; + private final int mDefaultTextLength = this.mDefaultText.length(); + + TextField() { + super(VirtualKeyboardAndroidDelegate.this.mMainActivity); + } + + private int GetInputType() { + return VirtualKeyboardAndroidDelegate.this.mKeyboardLayout | VirtualKeyboardAndroidDelegate.this.mShiftFlag | AccessibilityEventCompat.TYPE_GESTURE_DETECTION_END; + } + + /* access modifiers changed from: private */ + /* access modifiers changed from: public */ + private void Hide() { + VirtualKeyboardAndroidDelegate.Log("Hide() from UiThread"); + try { + setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)}); + clearFocus(); + Thread.sleep(10); + if (!VirtualKeyboardAndroidDelegate.this.mVisibleRequested) { + VirtualKeyboardAndroidDelegate.this.mMainActivity.getWindow().setSoftInputMode(3); + VirtualKeyboardAndroidDelegate.this.mInputMethodManager.hideSoftInputFromWindow(getWindowToken(), 0); + VirtualKeyboardAndroidDelegate.this.mMainViewGroup.removeView(VirtualKeyboardAndroidDelegate.this.mRelativeLayout); + } + } catch (Exception e) { + } + } + + private boolean IsDefaultText(CharSequence charSequence) { + if (charSequence.length() != this.mDefaultTextLength) { + return false; + } + for (int i = 0; i < this.mDefaultTextLength; i++) { + if (charSequence.charAt(i) != this.mDefaultText.charAt(i)) { + return false; + } + } + return true; + } + + /* access modifiers changed from: private */ + /* access modifiers changed from: public */ + private void Show() { + VirtualKeyboardAndroidDelegate.Log("Show() from UiThread"); + setInputType(GetInputType()); + setImeOptions(VirtualKeyboardAndroidDelegate.this.mEnterkeyLabel | VirtualKeyboardAndroidDelegate.IME_FLAG_NO_FULLSCREEN | DriveFile.MODE_READ_ONLY); + setFilters(new InputFilter[]{new InputFilter.LengthFilter(VirtualKeyboardAndroidDelegate.this.mMaxTextLength)}); + try { + VirtualKeyboardAndroidDelegate.this.mMainViewGroup.addView(VirtualKeyboardAndroidDelegate.this.mRelativeLayout); + } catch (Exception e) { + VirtualKeyboardAndroidDelegate.Log("addView exception " + e); + } + requestFocus(); + VirtualKeyboardAndroidDelegate.this.mMainActivity.getWindow().setSoftInputMode(5); + VirtualKeyboardAndroidDelegate.this.mInputMethodManager.showSoftInput(this, 2); + } + + public void onEditorAction(int i) { + VirtualKeyboardAndroidDelegate.Log("onEditorAction actionCode: " + i); + VirtualKeyboardAndroidDelegate.this.NativeOnKeyDown(66, false); + VirtualKeyboardAndroidDelegate.this.NativeOnKeyUp(66, false); + VirtualKeyboardAndroidDelegate.this.mVisibleRequested = false; + VirtualKeyboardAndroidDelegate.this.NativeOnKeyboardHideHerself(); + Hide(); + } + + /* access modifiers changed from: protected */ + public void onExtTextChanged(CharSequence charSequence) { + if (!VirtualKeyboardAndroidDelegate.this.mCurrenText.equals(charSequence)) { + VirtualKeyboardAndroidDelegate.Log("onExtTextChanged NewText: \"" + ((Object) charSequence) + "\" Old Text:\"" + VirtualKeyboardAndroidDelegate.this.mCurrenText + "\""); + this.isExtChange = true; + setText(charSequence); + } + } + + public boolean onKeyDown(int i, KeyEvent keyEvent) { + VirtualKeyboardAndroidDelegate.Log("onKeyDown: " + i); + super.onKeyDown(i, keyEvent); + return !KeyboardAndroid.IsSystemKey(i); + } + + public boolean onKeyPreIme(int i, KeyEvent keyEvent) { + VirtualKeyboardAndroidDelegate.Log("onKeyPreIme: " + i); + if (i != 4) { + return super.onKeyPreIme(i, keyEvent); + } + VirtualKeyboardAndroidDelegate.this.mVisibleRequested = false; + VirtualKeyboardAndroidDelegate.this.NativeOnKeyboardHideHerself(); + Hide(); + return true; + } + + public boolean onKeyUp(int i, KeyEvent keyEvent) { + VirtualKeyboardAndroidDelegate.Log("onKeyUp: " + i); + super.onKeyUp(i, keyEvent); + if (i == 66) { + VirtualKeyboardAndroidDelegate.this.mVisibleRequested = false; + VirtualKeyboardAndroidDelegate.this.NativeOnKeyboardHideHerself(); + Hide(); + } + return !KeyboardAndroid.IsSystemKey(i); + } + + /* access modifiers changed from: protected */ + public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) { + VirtualKeyboardAndroidDelegate.Log("onTextChanged Start: " + i + " Before:" + i2 + " After: " + i3 + " FullText: \"" + ((Object) charSequence) + "\""); + super.onTextChanged(charSequence, i, i2, i3); + if (!this.isExtChange) { + VirtualKeyboardAndroidDelegate.this.NativeOnCursorMove(i + i2, i + i2); + for (int i4 = 0; i4 < i2; i4++) { + VirtualKeyboardAndroidDelegate.this.NativeOnKeyDown(67, false); + VirtualKeyboardAndroidDelegate.this.NativeOnKeyUp(67, false); + } + for (int i5 = i; i5 < i + i3; i5++) { + VirtualKeyboardAndroidDelegate.this.NativeOnCharacter(charSequence.charAt(i5)); + } + VirtualKeyboardAndroidDelegate.this.mCursorPos = i + i3; + VirtualKeyboardAndroidDelegate.this.mAnchor = i + i3; + } + VirtualKeyboardAndroidDelegate.this.mCurrenText = "" + ((Object) charSequence); + this.isExtChange = false; + } + + public void setToastText(CharSequence charSequence) { + } + } + + VirtualKeyboardAndroidDelegate() { + Log("VirtualKeyboardAndroidDelegate"); + this.mMainActivity = EASPHandler.mActivity; + this.mMainViewGroup = EASPHandler.mViewGroup; + this.mInputMethodManager = (InputMethodManager) this.mMainActivity.getSystemService("input_method"); + this.mPhysicalKeyboardVisible = this.mMainActivity.getResources().getConfiguration().hardKeyboardHidden == 1; + this.mRelativeLayoutParam = new RelativeLayout.LayoutParams(0, 60); + this.mCurrenText = ""; + this.mMainActivity.runOnUiThread(() -> { + VirtualKeyboardAndroidDelegate.this.mTextField = new TextField(); + VirtualKeyboardAndroidDelegate.this.mRelativeLayout = new RelativeLayout(VirtualKeyboardAndroidDelegate.this.mMainActivity); + VirtualKeyboardAndroidDelegate.this.mRelativeLayout.setGravity(53); + VirtualKeyboardAndroidDelegate.this.mRelativeLayout.addView(VirtualKeyboardAndroidDelegate.this.mTextField, VirtualKeyboardAndroidDelegate.this.mRelativeLayoutParam); + }); + } + + public static native int CppGetkEnterKeyLabelDefault(); + + public static native int CppGetkEnterKeyLabelDone(); + + public static native int CppGetkEnterKeyLabelGo(); + + public static native int CppGetkEnterKeyLabelNext(); + + public static native int CppGetkEnterKeyLabelSearch(); + + public static native int CppGetkEnterKeyLabelSend(); + + public static native int CppGetkLayoutDefault(); + + public static native int CppGetkLayoutDigits(); + + public static native int CppGetkLayoutEmail(); + + public static native int CppGetkLayoutPhone(); + + public static native int CppGetkLayoutUrl(); + + private void Hide() { + Log("Hide() from game thread"); + this.mMainActivity.runOnUiThread(new Runnable() { + /* class com.ea.easp.VirtualKeyboardAndroidDelegate.AnonymousClass2 */ + + public void run() { + if (VirtualKeyboardAndroidDelegate.this.mTextField != null) { + VirtualKeyboardAndroidDelegate.this.mTextField.Hide(); + } + } + }); + } + + /* access modifiers changed from: private */ + public static void Log(String str) { + Debug.Log.d(DEBUG_LOG_TAG, str); + } + + private void Show() { + Log("Show() from game thread"); + this.mMainActivity.runOnUiThread(new Runnable() { + /* class com.ea.easp.VirtualKeyboardAndroidDelegate.AnonymousClass3 */ + + public void run() { + if (VirtualKeyboardAndroidDelegate.this.mTextField != null) { + VirtualKeyboardAndroidDelegate.this.mTextField.Show(); + } + } + }); + } + + public static final int StdToRawEnterKeyLabel(int i) { + if (i == 0) { + return 1; + } + if (i == 1) { + return 2; + } + if (i == 2) { + return 5; + } + if (i == 3) { + return 3; + } + if (i == 4) { + return 4; + } + return i == 5 ? 6 : 1; + } + + public static final int StdToRawLayout(int i) { + if (i == 0) { + return 1; + } + if (i == 2) { + return 33; + } + if (i == 5) { + return 129; + } + if (i == 4) { + return 17; + } + if (i == 1) { + return 2; + } + return i == 3 ? 3 : 1; + } + + public boolean IsVisible() { + return this.mVisibleRequested && this.mTextField != null && this.mTextField.hasFocus(); + } + + public void OnPhysicalKeyboardVisibilityChanged(boolean z) { + this.mPhysicalKeyboardVisible = z; + if (this.mPhysicalKeyboardVisible) { + Log("Hide from visibility changed"); + Hide(); + } else if (this.mVisibleRequested) { + Log("Show from visibility changed"); + Show(); + } + } + + public void OnUpdate() { + } + + public void SetCursor(int i, int i2) { + Log("SetCursor from GL - pos: " + i + "; anchor: " + i2 + ";"); + if (!(this.mCursorPos == i && this.mAnchor == i2) && !this.mPhysicalKeyboardVisible) { + this.mCursorPos = i; + this.mAnchor = i2; + this.mMainActivity.runOnUiThread(new Runnable() { + /* class com.ea.easp.VirtualKeyboardAndroidDelegate.AnonymousClass4 */ + + public void run() { + if (VirtualKeyboardAndroidDelegate.this.mTextField != null) { + VirtualKeyboardAndroidDelegate.Log("SetCursor from UI - pos: " + VirtualKeyboardAndroidDelegate.this.mCursorPos + "; anchor: " + VirtualKeyboardAndroidDelegate.this.mAnchor + ";"); + VirtualKeyboardAndroidDelegate.this.mTextField.setSelection(VirtualKeyboardAndroidDelegate.this.mAnchor, VirtualKeyboardAndroidDelegate.this.mCursorPos); + VirtualKeyboardAndroidDelegate.this.mInputMethodManager.updateSelection(VirtualKeyboardAndroidDelegate.this.mTextField, VirtualKeyboardAndroidDelegate.this.mAnchor, VirtualKeyboardAndroidDelegate.this.mCursorPos, VirtualKeyboardAndroidDelegate.this.mAnchor, VirtualKeyboardAndroidDelegate.this.mCursorPos); + } + } + }); + } + } + + public void SetEnterKeyLabel(int i) { + if (this.mEnterkeyLabel != StdToRawEnterKeyLabel(i)) { + this.mEnterkeyLabel = StdToRawEnterKeyLabel(i); + UpdateDisplay(); + } + } + + public void SetLayout(int i) { + if (this.mKeyboardLayout != StdToRawLayout(i)) { + this.mKeyboardLayout = StdToRawLayout(i); + UpdateDisplay(); + } + } + + public void SetMaxTextLength(int i) { + this.mMaxTextLength = i; + } + + public void SetShiftEnabled(boolean z) { + int i = 4096; + if (this.mShiftFlag != (z ? 4096 : 0)) { + if (!z) { + i = 0; + } + this.mShiftFlag = i; + UpdateDisplay(); + } + } + + public void SetText(String str) { + Log("SetText() from game thread ( " + str + " )"); + this.mNewText = str; + if (this.mNewText == null) { + this.mNewText = ""; + } + this.mMainActivity.runOnUiThread(new Runnable() { + /* class com.ea.easp.VirtualKeyboardAndroidDelegate.AnonymousClass5 */ + + public void run() { + if (VirtualKeyboardAndroidDelegate.this.mTextField != null) { + VirtualKeyboardAndroidDelegate.this.mTextField.onExtTextChanged(VirtualKeyboardAndroidDelegate.this.mNewText); + } + } + }); + } + + public void Shutdown() { + UserSetVisible(false); + this.mMainViewGroup = null; + this.mRelativeLayout = null; + this.mTextField = null; + } + + public void UpdateDisplay() { + if (IsVisible()) { + Log("UpdateDisplay()"); + Hide(); + Show(); + } + } + + public void UserSetVisible(boolean z) { + this.mVisibleRequested = z; + if (!this.mVisibleRequested) { + Log("Hide from user set visible"); + Hide(); + } else if (!this.mPhysicalKeyboardVisible) { + Log("Show from user set visible"); + Show(); + } + } +} diff --git a/app/src/main/java/com/ea/easp/facebook/ExtendAccessTokenListener.java b/app/src/main/java/com/ea/easp/facebook/ExtendAccessTokenListener.java new file mode 100644 index 0000000..224d3f4 --- /dev/null +++ b/app/src/main/java/com/ea/easp/facebook/ExtendAccessTokenListener.java @@ -0,0 +1,2 @@ +package com.ea.easp.facebook;public interface ExtendAccessTokenListener { +} diff --git a/app/src/main/java/com/ea/easp/facebook/FacebookAgentJNI.java b/app/src/main/java/com/ea/easp/facebook/FacebookAgentJNI.java new file mode 100644 index 0000000..4dbda3b --- /dev/null +++ b/app/src/main/java/com/ea/easp/facebook/FacebookAgentJNI.java @@ -0,0 +1,348 @@ +package com.ea.easp.facebook; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.ea.easp.Debug; +import com.ea.easp.TaskLauncher; +import com.facebook.android.AsyncFacebookRunner; +import com.facebook.android.DialogError; +import com.facebook.android.Facebook; +import com.facebook.android.FacebookError; +import com.facebook.android.SessionEvents; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.MalformedURLException; + +public class FacebookAgentJNI { + private static final String kMODULE_TAG = "EASP jFBAgentJNI"; + private Activity mActivity; + private String mApplicationID; + private AsyncFacebookRunner mAsyncRunner; + private Facebook mFacebook; + private TaskLauncher mTaskLauncher; + + public class CommonDialogListener implements Facebook.DialogListener { + public CommonDialogListener() { + } + + @Override + public void onCancel() { + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(FacebookAgentJNI.this::onDialogCancel); + } + + @Override + public void onComplete(final Bundle parameters) { + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(() -> { + String[] strArr = new String[parameters.size()]; + String[] strArr2 = new String[parameters.size()]; + FacebookAgentJNI.convertBundlesStringKeyValueArray(parameters, strArr, strArr2); + FacebookAgentJNI.this.onDialogComplete(strArr, strArr2); + }); + } + + + @Override + public void onError(final DialogError dialogError) { + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(() -> FacebookAgentJNI.this.onDialogError(dialogError.getErrorCode(), dialogError.getFailingUrl(), dialogError.getMessage())); + } + + @Override // com.facebook.android.Facebook.DialogListener + public void onFacebookError(final FacebookError facebookError) { + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(() -> FacebookAgentJNI.this.onDialogFacebookError(facebookError.getErrorCode(), facebookError.getErrorType(), facebookError.getMessage())); + } + } + + private final class ExtendAccessTokenListener implements Facebook.ServiceListener, com.ea.easp.facebook.ExtendAccessTokenListener { + private ExtendAccessTokenListener() { + } + + @Override + public void onComplete(Bundle bundle) { + final String accessToken = bundle.getString("Facebook.ACCESS_TOKEN"); + final long accessTokenExpiresMS = bundle.getLong("Facebook.EXPIRES", 0); + Debug.Log.i(FacebookAgentJNI.kMODULE_TAG, "ExtendAccessTokenListener.onComplete(): bundle = " + bundle.toString()); + + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(new Runnable() { + @Override + public void run() { + FacebookAgentJNI.this.onExtendAccessTokenJNI(accessToken, accessTokenExpiresMS); + } + }); + } + + @Override // com.facebook.android.Facebook.ServiceListener + public void onError(Error error) { + Debug.Log.e(FacebookAgentJNI.kMODULE_TAG, "ExtendAccessTokenListener.onError(): e = " + error.toString()); + } + + @Override // com.facebook.android.Facebook.ServiceListener + public void onFacebookError(FacebookError facebookError) { + Debug.Log.e(FacebookAgentJNI.kMODULE_TAG, "ExtendAccessTokenListener.onFacebookError(): e = " + facebookError.toString()); + } + } + + private final class LoginDialogListener implements Facebook.DialogListener { + private LoginDialogListener() { + } + + @Override // com.facebook.android.Facebook.DialogListener + public void onCancel() { + SessionEvents.onLoginError("Action Canceled"); + } + + @Override // com.facebook.android.Facebook.DialogListener + public void onComplete(Bundle bundle) { + SessionEvents.onLoginSuccess(); + } + + @Override // com.facebook.android.Facebook.DialogListener + public void onError(DialogError dialogError) { + SessionEvents.onLoginError(dialogError.getMessage()); + } + + @Override // com.facebook.android.Facebook.DialogListener + public void onFacebookError(FacebookError facebookError) { + SessionEvents.onLoginError(facebookError.getMessage()); + } + } + + private class LogoutRequestListener implements AsyncFacebookRunner.RequestListener { + private LogoutRequestListener() { + } + + private final void onLogoutFinish() { + /* class com.ea.easp.facebook.FacebookAgentJNI.LogoutRequestListener.AnonymousClass1 */ + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(SessionEvents::onLogoutFinish); + } + + @Override // com.facebook.android.AsyncFacebookRunner.RequestListener + public void onComplete(String str, Object state) { + Debug.Log.i(FacebookAgentJNI.kMODULE_TAG, "LogoutRequestListener::onComplete()"); + onLogoutFinish(); + } + + @Override // com.facebook.android.BaseRequestListener, com.facebook.android.AsyncFacebookRunner.RequestListener + public void onFacebookError(FacebookError facebookError, Object state) { + Debug.Log.e(FacebookAgentJNI.kMODULE_TAG, "LogoutRequestListener::onFacebookError" + facebookError.getMessage()); + onLogoutFinish(); + } + + @Override // com.facebook.android.BaseRequestListener, com.facebook.android.AsyncFacebookRunner.RequestListener + public void onFileNotFoundException(FileNotFoundException fileNotFoundException, Object state) { + Debug.Log.e(FacebookAgentJNI.kMODULE_TAG, "LogoutRequestListener::onFileNotFoundException" + fileNotFoundException.getMessage()); + onLogoutFinish(); + } + + @Override // com.facebook.android.BaseRequestListener, com.facebook.android.AsyncFacebookRunner.RequestListener + public void onIOException(IOException iOException, Object state) { + Debug.Log.e(FacebookAgentJNI.kMODULE_TAG, "LogoutRequestListener::onIOException" + iOException.getMessage()); + onLogoutFinish(); + } + + @Override // com.facebook.android.BaseRequestListener, com.facebook.android.AsyncFacebookRunner.RequestListener + public void onMalformedURLException(MalformedURLException malformedURLException, Object state) { + Debug.Log.e(FacebookAgentJNI.kMODULE_TAG, "LogoutRequestListener::onMalformedURLException" + malformedURLException.getMessage()); + onLogoutFinish(); + } + + + } + + public class SampleAuthListener implements SessionEvents.AuthListener { + public SampleAuthListener() { + } + + @Override // com.facebook.android.SessionEvents.AuthListener + public void onAuthFail(final String mError) { + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(() -> FacebookAgentJNI.this.onAuthFailJNI(mError)); + } + + @Override // com.facebook.android.SessionEvents.AuthListener + public void onAuthSucceed() { + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(new Runnable() { + /* class com.ea.easp.facebook.FacebookAgentJNI.SampleAuthListener.AnonymousClass1 */ + + public void run() { + FacebookAgentJNI.this.onAuthSucceedJNI(FacebookAgentJNI.this.mFacebook.getAccessToken(), FacebookAgentJNI.this.mFacebook.getAccessExpires()); + } + }); + } + } + + public class SampleLogoutListener implements SessionEvents.LogoutListener { + public SampleLogoutListener() { + } + + @Override // com.facebook.android.SessionEvents.LogoutListener + public void onLogoutBegin() { + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(new Runnable() { + /* class com.ea.easp.facebook.FacebookAgentJNI.SampleLogoutListener.AnonymousClass1 */ + + public void run() { + FacebookAgentJNI.this.onLogoutBeginJNI(); + } + }); + } + + @Override // com.facebook.android.SessionEvents.LogoutListener + public void onLogoutFinish() { + FacebookAgentJNI.this.mTaskLauncher.runInGLThread(new Runnable() { + /* class com.ea.easp.facebook.FacebookAgentJNI.SampleLogoutListener.AnonymousClass2 */ + + public void run() { + FacebookAgentJNI.this.onLogoutFinishJNI(); + } + }); + } + } + + public FacebookAgentJNI(Activity activity, TaskLauncher taskLauncher) { + this.mActivity = activity; + this.mTaskLauncher = taskLauncher; + } + + /* access modifiers changed from: private */ + public static void convertBundlesStringKeyValueArray(Bundle bundle, String[] strArr, String[] strArr2) { + if (strArr == null || strArr2 == null) { + Debug.Log.e(kMODULE_TAG, "convertBundlesStringKeyValueArray(): bundleKeys and bundleValues must exist at this point."); + } else if (strArr.length == bundle.size() && strArr2.length == bundle.size()) { + int i = 0; + for (String str : bundle.keySet()) { + strArr[i] = str; + strArr2[i] = bundle.getString(str); + i++; + } + } else { + Debug.Log.e(kMODULE_TAG, "convertBundlesStringKeyValueArray(): bundleKeys and bundleValues must be empty."); + } + } + + private static Bundle convertStringKeyValueArrayToBundle(String[] strArr, String[] strArr2) { + Bundle bundle = new Bundle(); + if (strArr.length != strArr2.length) { + Debug.Log.e(kMODULE_TAG, "convertStringKeyValueArrayToBundle(): lengths of bundleKeys and bundleValues must be equal."); + } + for (int i = 0; i != strArr.length; i++) { + bundle.putString(strArr[i], strArr2[i]); + } + return bundle; + } + + public void authorizeCallback(int i, int i2, Intent intent) { + if (this.mFacebook != null) { + this.mFacebook.authorizeCallback(i, i2, intent); + } + } + + public void dialog(final String action, String[] strArr, String[] strArr2) { + + final Bundle parameters = convertStringKeyValueArrayToBundle(strArr, strArr2); + + this.mTaskLauncher.runInUIThread(new Runnable() { + + @Override + public void run() { + FacebookAgentJNI.this.initFacebookSDKIfNeeded(); + FacebookAgentJNI.this.mFacebook.dialog(FacebookAgentJNI.this.mActivity, action, parameters, new CommonDialogListener()); + } + }); + } + + public void extendAccessTokenIfNeeded() { + this.mTaskLauncher.runInUIThread(new Runnable() { + /* class com.ea.easp.facebook.FacebookAgentJNI.AnonymousClass1 */ + @Override + public void run() { + FacebookAgentJNI.this.initFacebookSDKIfNeeded(); + FacebookAgentJNI.this.mFacebook.extendAccessToken(FacebookAgentJNI.this.mActivity, new ExtendAccessTokenListener()); + } + }); + } + + public void facebookLogin(final String permissions) { + this.mTaskLauncher.runInUIThread(new Runnable() { + @Override + public void run() { + FacebookAgentJNI.this.initFacebookSDKIfNeeded(); + String[] split = permissions.split(","); + Debug.Log.i(FacebookAgentJNI.kMODULE_TAG, "request permissions:"); + for (int i = 0; i != split.length; i++) { + Debug.Log.i(FacebookAgentJNI.kMODULE_TAG, " " + split[i]); + } + FacebookAgentJNI.this.mFacebook.authorize(FacebookAgentJNI.this.mActivity, split, new LoginDialogListener()); + } + }); + } + + public void facebookLogout() { + this.mTaskLauncher.runInUIThread(new Runnable() { + @Override + public void run() { + if (FacebookAgentJNI.this.mAsyncRunner != null) { + FacebookAgentJNI.this.mAsyncRunner.logout(FacebookAgentJNI.this.mActivity, new LogoutRequestListener()); + } else { + Debug.Log.e(FacebookAgentJNI.kMODULE_TAG, "facebookLogout(): not logged in. Logout notification will not be sent."); + } + } + }); + } + + public void init() { + initJNI(); + } + + /* access modifiers changed from: package-private */ + public void initFacebookSDKIfNeeded() { + if (this.mFacebook == null) { + Debug.Log.d(kMODULE_TAG, "initFacebookSDKIfNeeded(): app id = " + this.mApplicationID); + this.mFacebook = new Facebook(this.mApplicationID); + this.mAsyncRunner = new AsyncFacebookRunner(this.mFacebook); + SessionEvents.addAuthListener(new SampleAuthListener()); + SessionEvents.addLogoutListener(new SampleLogoutListener()); + } + } + + public native void initJNI(); + + public native void onAuthFailJNI(String str); + + public native void onAuthSucceedJNI(String str, long j); + + public native void onDialogCancel(); + + public native void onDialogComplete(String[] strArr, String[] strArr2); + + public native void onDialogError(int i, String str, String str2); + + public native void onDialogFacebookError(int i, String str, String str2); + + public native void onExtendAccessTokenJNI(String str, long j); + + public native void onLogoutBeginJNI(); + + public native void onLogoutFinishJNI(); + + public void setAccessToken(final String accessToken, final long accessTokenExpiresMS) { + this.mTaskLauncher.runInUIThread(new Runnable() { + @Override + public void run() { + FacebookAgentJNI.this.initFacebookSDKIfNeeded(); + FacebookAgentJNI.this.mFacebook.setAccessToken(accessToken); + FacebookAgentJNI.this.mFacebook.setAccessExpires(accessTokenExpiresMS); + } + }); + } + + public void setApplicationID(String str) { + this.mApplicationID = str; + } + + public void shutdown() { + shutdownJNI(); + } + + public native void shutdownJNI(); +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/BillingReceiver.java b/app/src/main/java/com/ea/easp/mtx/market/BillingReceiver.java new file mode 100644 index 0000000..609ee9c --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/BillingReceiver.java @@ -0,0 +1,54 @@ +package com.ea.easp.mtx.market; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import com.ea.easp.Debug; +import com.ea.easp.mtx.market.Consts; + +public class BillingReceiver extends BroadcastReceiver { + private static final String TAG = "BillingReceiver"; + + private void checkResponseCode(Context context, long j, int i) { + Intent intent = new Intent(Consts.ACTION_RESPONSE_CODE); + intent.setClass(context, BillingService.class); + intent.putExtra(Consts.INAPP_REQUEST_ID, j); + intent.putExtra(Consts.INAPP_RESPONSE_CODE, i); + context.startService(intent); + } + + private void notify(Context context, String str) { + Intent intent = new Intent(Consts.ACTION_GET_PURCHASE_INFORMATION); + intent.setClass(context, BillingService.class); + intent.putExtra(Consts.NOTIFICATION_ID, str); + context.startService(intent); + } + + private void purchaseStateChanged(Context context, String str, String str2) { + Debug.Log.d(TAG, "purchaseStateChanged()..."); + if (str != null) { + Debug.Log.d(TAG, "signedData is \"" + str + "\""); + } + Intent intent = new Intent(Consts.ACTION_PURCHASE_STATE_CHANGED); + intent.setClass(context, BillingService.class); + intent.putExtra(Consts.INAPP_SIGNED_DATA, str); + intent.putExtra(Consts.INAPP_SIGNATURE, str2); + context.startService(intent); + Debug.Log.d(TAG, "...purchaseStateChanged()"); + } + + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + if (Consts.ACTION_PURCHASE_STATE_CHANGED.equals(action)) { + purchaseStateChanged(context, intent.getStringExtra(Consts.INAPP_SIGNED_DATA), intent.getStringExtra(Consts.INAPP_SIGNATURE)); + } else if (Consts.ACTION_NOTIFY.equals(action)) { + String stringExtra = intent.getStringExtra(Consts.NOTIFICATION_ID); + Debug.Log.i(TAG, "notifyId: " + stringExtra); + notify(context, stringExtra); + } else if (Consts.ACTION_RESPONSE_CODE.equals(action)) { + checkResponseCode(context, intent.getLongExtra(Consts.INAPP_REQUEST_ID, -1), intent.getIntExtra(Consts.INAPP_RESPONSE_CODE, Consts.ResponseCode.RESULT_ERROR.ordinal())); + } else { + Debug.Log.w(TAG, "unexpected action: " + action); + } + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/BillingService.java b/app/src/main/java/com/ea/easp/mtx/market/BillingService.java new file mode 100644 index 0000000..e33e7b1 --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/BillingService.java @@ -0,0 +1,27 @@ +package com.ea.easp.mtx.market; + +import android.content.Context; + +public interface BillingService { + + public interface IRequestPurchase { + String getProductId(); + } + + public interface IRestoreTransactions { + } + + void OnNonceSucceed(long j, Object obj); + + void OnVerifyMarketResponse(boolean z, String str, String str2, int i); + + void checkBillingSupported(Runnable runnable); + + void requestPurchase(String str, String str2, String str3, Runnable runnable); + + void restoreTransactions(long j, Runnable runnable); + + void setContext(Context context); + + void shutdown(); +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/Consts.java b/app/src/main/java/com/ea/easp/mtx/market/Consts.java new file mode 100644 index 0000000..dcba806 --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/Consts.java @@ -0,0 +1,57 @@ +package com.ea.easp.mtx.market; + +public class Consts { + public static final String ACTION_CONFIRM_NOTIFICATION = "com.ea.easp.mtx.market.CONFIRM_NOTIFICATION"; + public static final String ACTION_GET_PURCHASE_INFORMATION = "com.ea.easp.mtx.market.GET_PURCHASE_INFORMATION"; + public static final String ACTION_NOTIFY = "com.android.vending.billing.IN_APP_NOTIFY"; + public static final String ACTION_PURCHASE_STATE_CHANGED = "com.android.vending.billing.PURCHASE_STATE_CHANGED"; + public static final String ACTION_RESPONSE_CODE = "com.android.vending.billing.RESPONSE_CODE"; + public static final String ACTION_RESTORE_TRANSACTIONS = "com.ea.easp.mtx.market.RESTORE_TRANSACTIONS"; + public static final String BILLING_REQUEST_API_VERSION = "API_VERSION"; + public static final String BILLING_REQUEST_DEVELOPER_PAYLOAD = "DEVELOPER_PAYLOAD"; + public static final String BILLING_REQUEST_ITEM_ID = "ITEM_ID"; + public static final String BILLING_REQUEST_METHOD = "BILLING_REQUEST"; + public static final String BILLING_REQUEST_NONCE = "NONCE"; + public static final String BILLING_REQUEST_NOTIFY_IDS = "NOTIFY_IDS"; + public static final String BILLING_REQUEST_PACKAGE_NAME = "PACKAGE_NAME"; + public static long BILLING_RESPONSE_INVALID_REQUEST_ID = -1; + public static final String BILLING_RESPONSE_PURCHASE_INTENT = "PURCHASE_INTENT"; + public static final String BILLING_RESPONSE_REQUEST_ID = "REQUEST_ID"; + public static final String BILLING_RESPONSE_RESPONSE_CODE = "RESPONSE_CODE"; + public static final String INAPP_REQUEST_ID = "request_id"; + public static final String INAPP_RESPONSE_CODE = "response_code"; + public static final String INAPP_SIGNATURE = "inapp_signature"; + public static final String INAPP_SIGNED_DATA = "inapp_signed_data"; + public static final String MARKET_BILLING_SERVICE_ACTION = "com.android.vending.billing.MarketBillingService.BIND"; + public static final String NOTIFICATION_ID = "notification_id"; + public static int STORE_AMAZON = 2; + public static int STORE_ANDROID = 1; + public static int STORE_UNKNOWN = 0; + public static int STORE_VERIZON = 3; + + public enum PurchaseState { + PURCHASED, + CANCELED, + REFUNDED; + + public static PurchaseState valueOf(int i) { + PurchaseState[] values = values(); + return (i < 0 || i >= values.length) ? CANCELED : values[i]; + } + } + + public enum ResponseCode { + RESULT_OK, + RESULT_USER_CANCELED, + RESULT_SERVICE_UNAVAILABLE, + RESULT_BILLING_UNAVAILABLE, + RESULT_ITEM_UNAVAILABLE, + RESULT_DEVELOPER_ERROR, + RESULT_ERROR; + + public static ResponseCode valueOf(int i) { + ResponseCode[] values = values(); + return (i < 0 || i >= values.length) ? RESULT_ERROR : values[i]; + } + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/MarketJNI.java b/app/src/main/java/com/ea/easp/mtx/market/MarketJNI.java new file mode 100644 index 0000000..1bbcd3d --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/MarketJNI.java @@ -0,0 +1,339 @@ +package com.ea.easp.mtx.market; + +import android.app.Activity; +import android.content.Intent; +import com.ea.easp.Debug; +import com.ea.easp.TaskLauncher; +import com.ea.easp.mtx.market.amazon.AmazonBillingService; +import com.ea.easp.mtx.market.android.AndroidBillingService; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; + +public class MarketJNI { + static final int REQUEST_BILLING_SURRORTED = 0; + static final int REQUEST_PURCHASE = 1; + static final int REQUEST_RESTORE = 2; + private static final String TAG = "MarketJNI"; + private ActiveRequest mActiveRequest = ActiveRequest.NONE; + private Activity mActivity; + private BillingService mBillingService; + private MarketJNIPurchaseObserver mMarketJNIPurchaseObserver; + private int mNonceRequestNextID = 0; + private HashMap mSentNonceRequests = new HashMap<>(); + private StoreType mStoreType = StoreType.UNKNOWN; + private TaskLauncher mTaskLauncher; + + private enum ActiveRequest { + NONE, + PURCHASE, + RESTORE + } + + /* access modifiers changed from: private */ + public class MarketJNIPurchaseObserver extends PurchaseObserver { + public MarketJNIPurchaseObserver() { + super(MarketJNI.this.mActivity); + } + + private void notifyJNIAboutFailInGLThread(final int ErrorCode, final int RequestID, final String ErrorDescription) { + MarketJNI.this.mTaskLauncher.runInGLThread(new Runnable() { + @Override + public void run() { + MarketJNI.this.onRequestFailJNI(ErrorCode, RequestID, ErrorDescription); + } + }); + } + + @Override + public void onBillingSupported(final boolean mSupported) { + Debug.Log.i(MarketJNI.TAG, "supported: " + mSupported); + MarketJNI.this.mTaskLauncher.runInGLThread(new Runnable() { + @Override + public void run() { + MarketJNI.this.onBillingSupportedSucceedJNI(mSupported); + } + }); + } + + @Override + public void onPurchaseStateChange(final ArrayList mPurchases, + final boolean mVerified, + final String mSignedData, + final String mSignature) { + Debug.Log.i(MarketJNI.TAG, "onPurchaseStateChange() purchases size: " + mPurchases.size()); + MarketJNI.this.mTaskLauncher.runInGLThread(new Runnable() { + @Override + public void run() { + if (mPurchases.size() != 0) { + MarketJNI.this.purchasesListSizeJNI(mPurchases.size(), mSignedData, mSignature); + Iterator it = mPurchases.iterator(); + while (it.hasNext()) { + Security.VerifiedPurchase next = it.next(); + Debug.Log.d(MarketJNI.TAG, "purchaseState: " + next.purchaseState); + Debug.Log.d(MarketJNI.TAG, "notificationId:" + next.notificationId); + Debug.Log.d(MarketJNI.TAG, "productId:" + next.productId); + Debug.Log.d(MarketJNI.TAG, "orderId:" + next.orderId); + Debug.Log.d(MarketJNI.TAG, "developerPayload:" + next.developerPayload); + MarketJNI.this.onPurchaseStateChangeJNI(next.purchaseState.ordinal(), next.productId, next.purchaseTime, next.developerPayload); + } + } else if (!mVerified) { + Debug.Log.i(MarketJNI.TAG, "onPurchaseStateChange() purchases list is empty: treat it as error"); + MarketJNI.this.onRequestFailJNI(1, -999998, "purchase transaction signature were not verified, so list of purchases is empty."); + } else { + Debug.Log.i(MarketJNI.TAG, "onPurchaseStateChange() purchases list is empty, but transaction is verified, treat as success restoring."); + MarketJNI.this.purchasesListSizeJNI(-1, mSignedData, mSignature); + MarketJNI.this.onPurchaseStateChangeJNI(0, null, 0, null); + } + } + }); + } + + @Override + public void onRequestPurchaseResponse(BillingService.IRequestPurchase iRequestPurchase, Consts.ResponseCode responseCode) { + Debug.Log.d(MarketJNI.TAG, iRequestPurchase.getProductId() + ": " + responseCode); + if (responseCode == Consts.ResponseCode.RESULT_OK) { + Debug.Log.i(MarketJNI.TAG, "purchase request response is RESULT_OK"); + } else if (responseCode == Consts.ResponseCode.RESULT_USER_CANCELED) { + Debug.Log.i(MarketJNI.TAG, "user canceled purchase"); + notifyJNIAboutFailInGLThread(1, -999997, "dismissed purchase dialog"); + } else { + Debug.Log.i(MarketJNI.TAG, "purchase error: " + responseCode); + notifyJNIAboutFailInGLThread(1, -999996, "purchase error: " + responseCode); + } + } + + @Override // com.ea.easp.mtx.market.PurchaseObserver + public void onRestoreTransactionsResponse(BillingService.IRestoreTransactions iRestoreTransactions, Consts.ResponseCode responseCode) { + if (responseCode == Consts.ResponseCode.RESULT_OK) { + Debug.Log.i(MarketJNI.TAG, "restore request was successfully sent to server"); + } else if (responseCode == Consts.ResponseCode.RESULT_USER_CANCELED) { + Debug.Log.i(MarketJNI.TAG, "user canceled restore"); + notifyJNIAboutFailInGLThread(2, -999994, "user canceled restore"); + } else { + Debug.Log.d(MarketJNI.TAG, "RestoreTransactions error: " + responseCode); + notifyJNIAboutFailInGLThread(2, -999994, "RestoreTransactions error: " + responseCode); + } + } + } + + public enum StoreType { + UNKNOWN, + ANDROID, + AMAZON, + VERIZON + } + + public MarketJNI(Activity activity, TaskLauncher taskLauncher, StoreType storeType) { + this.mActivity = activity; + this.mTaskLauncher = taskLauncher; + this.mStoreType = storeType; + } + + /* access modifiers changed from: package-private */ + public int getNextNonceRequestID() { + int i = this.mNonceRequestNextID; + this.mNonceRequestNextID++; + return i; + } + + public void getNonce(Object obj) { + final int nextNonceRequestID = getNextNonceRequestID(); + this.mSentNonceRequests.put(nextNonceRequestID, obj); + + this.mTaskLauncher.runInGLThread(new Runnable() { + @Override + public void run() { + MarketJNI.this.getNonceJNI(nextNonceRequestID); + } + }); + } + + public native void getNonceJNI(int i); + + public void init() { + Debug.Log.i(TAG, "init(): MarketJNI init."); + initEASPMTXJNI(); + this.mMarketJNIPurchaseObserver = new MarketJNIPurchaseObserver(); + if (this.mStoreType == StoreType.AMAZON) { + Debug.Log.i(TAG, "init(): Creating AmazonBillingService."); + this.mBillingService = new AmazonBillingService(new SecurityJNI(this), this.mActivity); + } else if (this.mStoreType == StoreType.VERIZON) { + Debug.Log.i(TAG, "init(): Verizon billing not supported."); + } else if (this.mStoreType == StoreType.ANDROID) { + this.mBillingService = new AndroidBillingService(new SecurityJNI(this)); + } else { + Debug.Log.i(TAG, "init(): StoreType not set at MarketJNI initialization. Delaying instantiation."); + this.mBillingService = null; + } + if (this.mBillingService != null) { + this.mBillingService.setContext(this.mActivity); + } + ResponseHandler.register(this.mMarketJNIPurchaseObserver); + } + + public native void initEASPMTXJNI(); + + public void isBillingSupported() { + this.mTaskLauncher.runInUIThread(new Runnable() { + /* class com.ea.easp.mtx.market.MarketJNI.AnonymousClass1 */ + + /* access modifiers changed from: package-private */ + public Runnable makeErrorHandler() { + return new Runnable() { + /* class com.ea.easp.mtx.market.MarketJNI.AnonymousClass1.AnonymousClass1 */ + + public void run() { + Debug.Log.e(MarketJNI.TAG, "checkBillingSupported(): fail to connect to billing service"); + MarketJNI.this.mTaskLauncher.runInGLThread(new Runnable() { + /* class com.ea.easp.mtx.market.MarketJNI.AnonymousClass1.AnonymousClass1.AnonymousClass1 */ + + public void run() { + MarketJNI.this.onRequestFailJNI(0, -999998, "fail to connect to Android Market"); + } + }); + } + }; + } + + public void run() { + if (MarketJNI.this.mBillingService == null) { + throw new RuntimeException("Android billing service not set. Set with SetStoreType."); + } + MarketJNI.this.mBillingService.checkBillingSupported(makeErrorHandler()); + } + }); + } + + public native void onBillingSupportedSucceedJNI(boolean z); + + public void onNonceResult(boolean z, final long mNonce, final int mRequestDataKey) { + if (z) { + final Object mRequestData = this.mSentNonceRequests.get(mRequestDataKey); + this.mTaskLauncher.runInUIThread(new Runnable() { + @Override + public void run() { + if (MarketJNI.this.mBillingService == null) { + throw new RuntimeException("Android billing service not set. Set with SetStoreType."); + } + MarketJNI.this.mBillingService.OnNonceSucceed(mNonce, mRequestData); + } + }); + } else { + onRequestFailJNI(1, -999993, "fail to get nonce"); + } + this.mSentNonceRequests.remove(Integer.valueOf(mRequestDataKey)); + } + + public native void onPurchaseStateChangeJNI(int i, String str, long j, String str2); + + public native void onRequestFailJNI(int i, int i2, String str); + + public void onVerify(final boolean mVerified, final String mSignedData, final String mSignature, final int mRequestID) { + this.mTaskLauncher.runInUIThread(new Runnable() { + @Override + public void run() { + if (MarketJNI.this.mBillingService == null) { + throw new RuntimeException("Android billing service not set. Set with SetStoreType."); + } + MarketJNI.this.mBillingService.OnVerifyMarketResponse(mVerified, mSignedData, mSignature, mRequestID); + } + }); + } + + public void purchase(final String mProductID, final String mExtraParams, final String mPayload) { + this.mTaskLauncher.runInUIThread(new Runnable() { + + public Runnable makeErrorHandler() { + return () -> { + Debug.Log.e(MarketJNI.TAG, "purchase(): fail to connect to Market"); + MarketJNI.this.mTaskLauncher.runInGLThread(() -> MarketJNI.this.onRequestFailJNI(1, -999998, "fail to connect to Android Market")); + }; + } + + @Override + public void run() { + if (MarketJNI.this.mBillingService == null) { + throw new RuntimeException("Android billing service not set. Set with SetStoreType."); + } + MarketJNI.this.mBillingService.requestPurchase(mProductID, mExtraParams, mPayload, makeErrorHandler()); + } + }); + } + + public native void purchasesListSizeJNI(int i, String str, String str2); + + public void restoreTransactions(final long mNonce) { + this.mTaskLauncher.runInUIThread(new Runnable() { + + public Runnable makeErrorHandler() { + return new Runnable() { + @Override + public void run() { + Debug.Log.e(MarketJNI.TAG, "restoreTransactions(): fail to connect to Market"); + MarketJNI.this.mTaskLauncher.runInGLThread(new Runnable() { + /* class com.ea.easp.mtx.market.MarketJNI.AnonymousClass5R.AnonymousClass1.AnonymousClass1 */ + + public void run() { + MarketJNI.this.onRequestFailJNI(2, -999998, "fail to connect to Android Market"); + } + }); + } + }; + } + + @Override + public void run() { + if (MarketJNI.this.mBillingService == null) { + throw new RuntimeException("Android billing service not set. Set with SetStoreType."); + } + MarketJNI.this.mBillingService.restoreTransactions(mNonce, makeErrorHandler()); + } + }); + } + + public void setStoreType(int i) { + if (this.mStoreType != StoreType.UNKNOWN) { + Debug.Log.i(TAG, "setStoreType: StoreType already set!"); + } else if (this.mBillingService != null) { + Debug.Log.i(TAG, "setStoreType: BillingService already created!"); + } else { + if (StoreType.values()[i] == StoreType.AMAZON) { + Debug.Log.i(TAG, "setStoreType: Creating Amazon Billing Service."); + this.mBillingService = new AmazonBillingService(new SecurityJNI(this), this.mActivity); + } else if (StoreType.values()[i] == StoreType.ANDROID) { + Debug.Log.i(TAG, "setStoreType: Creating Android Billing Service."); + this.mBillingService = new AndroidBillingService(new SecurityJNI(this)); + } else { + Debug.Log.i(TAG, "setStoreType: StoreType not supported!"); + return; + } + this.mStoreType = StoreType.values()[i]; + this.mBillingService.setContext(this.mActivity); + } + } + + public void shutdown() { + ResponseHandler.unregister(this.mMarketJNIPurchaseObserver); + if (this.mBillingService != null) { + this.mBillingService.shutdown(); + Intent intent = new Intent(); + intent.setClass(this.mActivity, this.mBillingService.getClass()); + this.mActivity.stopService(intent); + } + shutdownEASPMTXJNI(); + } + + public native void shutdownEASPMTXJNI(); + + public void verify(final String mSignedData, final String mSignature, final int mRequestID, final int mStoreType) { + this.mTaskLauncher.runInGLThread(new Runnable() { + @Override + public void run() { + MarketJNI.this.verifyJNI(mSignedData, mSignature, mRequestID, mStoreType); + } + }); + } + + public native void verifyJNI(String SignedData, String Signature, int RequestID, int StoreType); +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/MarketJNIConsts.java b/app/src/main/java/com/ea/easp/mtx/market/MarketJNIConsts.java new file mode 100644 index 0000000..8c3e26d --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/MarketJNIConsts.java @@ -0,0 +1,12 @@ +package com.ea.easp.mtx.market; + +public class MarketJNIConsts { + static final int STORE_BUSY = -1000000; + static final int STORE_GENERAL_ERROR = -999999; + static final int STORE_MARKET_CONNECT_FAILED = -999998; + static final int STORE_MARKET_PURCHASE_CANCELED = -999997; + static final int STORE_MARKET_PURCHASE_FAILED = -999996; + static final int STORE_MARKET_PURCHASE_NONCE_GENERATION_FAILED = -999993; + static final int STORE_MARKET_RESTORE_CANCELLED = -999995; + static final int STORE_MARKET_RESTORE_FAILED = -999994; +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/PurchaseObserver.java b/app/src/main/java/com/ea/easp/mtx/market/PurchaseObserver.java new file mode 100644 index 0000000..817bae9 --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/PurchaseObserver.java @@ -0,0 +1,65 @@ +package com.ea.easp.mtx.market; + +import android.app.Activity; +import android.app.PendingIntent; +import android.content.Intent; +import android.content.IntentSender; +import com.ea.easp.Debug; +import com.ea.easp.mtx.market.BillingService; +import com.ea.easp.mtx.market.Consts; +import com.ea.easp.mtx.market.Security; +import java.lang.reflect.Method; +import java.util.ArrayList; + +public abstract class PurchaseObserver { + private static final Class[] START_INTENT_SENDER_SIG = {IntentSender.class, Intent.class, Integer.TYPE, Integer.TYPE, Integer.TYPE}; + private static final String TAG = "PurchaseObserver"; + private final Activity mActivity; + private Method mStartIntentSender; + private Object[] mStartIntentSenderArgs = new Object[5]; + + public PurchaseObserver(Activity activity) { + this.mActivity = activity; + initCompatibilityLayer(); + } + + private void initCompatibilityLayer() { + try { + this.mStartIntentSender = this.mActivity.getClass().getMethod("startIntentSender", START_INTENT_SENDER_SIG); + } catch (SecurityException e) { + this.mStartIntentSender = null; + } catch (NoSuchMethodException e2) { + this.mStartIntentSender = null; + } + } + + public abstract void onBillingSupported(boolean z); + + public abstract void onPurchaseStateChange(ArrayList arrayList, boolean z, String str, String str2); + + public abstract void onRequestPurchaseResponse(BillingService.IRequestPurchase iRequestPurchase, Consts.ResponseCode responseCode); + + public abstract void onRestoreTransactionsResponse(BillingService.IRestoreTransactions iRestoreTransactions, Consts.ResponseCode responseCode); + + /* access modifiers changed from: package-private */ + public void startBuyPageActivity(PendingIntent pendingIntent, Intent intent) { + if (this.mStartIntentSender != null) { + try { + this.mStartIntentSenderArgs[0] = pendingIntent.getIntentSender(); + this.mStartIntentSenderArgs[1] = intent; + this.mStartIntentSenderArgs[2] = 0; + this.mStartIntentSenderArgs[3] = 0; + this.mStartIntentSenderArgs[4] = 0; + this.mStartIntentSender.invoke(this.mActivity, this.mStartIntentSenderArgs); + } catch (Exception e) { + Debug.Log.e(TAG, "error starting activity", e); + } + } else { + try { + pendingIntent.send(this.mActivity, 0, intent); + } catch (PendingIntent.CanceledException e2) { + Debug.Log.e(TAG, "error starting activity", e2); + } + } + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/ResponseHandler.java b/app/src/main/java/com/ea/easp/mtx/market/ResponseHandler.java new file mode 100644 index 0000000..94ed6a9 --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/ResponseHandler.java @@ -0,0 +1,58 @@ +package com.ea.easp.mtx.market; + +import android.app.PendingIntent; +import android.content.Intent; +import com.ea.easp.Debug; +import com.ea.easp.mtx.market.BillingService; +import com.ea.easp.mtx.market.Consts; +import com.ea.easp.mtx.market.Security; +import java.util.ArrayList; + +public class ResponseHandler { + private static final String TAG = "ResponseHandler"; + private static PurchaseObserver sPurchaseObserver; + + public static void buyPageIntentResponse(PendingIntent pendingIntent, Intent intent) { + if (sPurchaseObserver == null) { + Debug.Log.w(TAG, "buyPageIntentResponse(): UI is not running"); + } else { + sPurchaseObserver.startBuyPageActivity(pendingIntent, intent); + } + } + + public static void checkBillingSupportedResponse(boolean z) { + if (sPurchaseObserver != null) { + sPurchaseObserver.onBillingSupported(z); + } + } + + public static void purchaseResponse(ArrayList arrayList, boolean z, String str, String str2) { + if (sPurchaseObserver != null) { + sPurchaseObserver.onPurchaseStateChange(arrayList, z, str, str2); + } + } + + public static synchronized void register(PurchaseObserver purchaseObserver) { + synchronized (ResponseHandler.class) { + sPurchaseObserver = purchaseObserver; + } + } + + public static void responseCodeReceived(BillingService.IRequestPurchase iRequestPurchase, Consts.ResponseCode responseCode) { + if (sPurchaseObserver != null) { + sPurchaseObserver.onRequestPurchaseResponse(iRequestPurchase, responseCode); + } + } + + public static void responseCodeReceived(BillingService.IRestoreTransactions iRestoreTransactions, Consts.ResponseCode responseCode) { + if (sPurchaseObserver != null) { + sPurchaseObserver.onRestoreTransactionsResponse(iRestoreTransactions, responseCode); + } + } + + public static synchronized void unregister(PurchaseObserver purchaseObserver) { + synchronized (ResponseHandler.class) { + sPurchaseObserver = null; + } + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/Security.java b/app/src/main/java/com/ea/easp/mtx/market/Security.java new file mode 100644 index 0000000..a029847 --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/Security.java @@ -0,0 +1,144 @@ +package com.ea.easp.mtx.market; + +import com.ea.easp.Debug; +import com.ea.easp.mtx.market.Consts; +import com.ea.easp.mtx.market.util.Base64; +import com.ea.easp.mtx.market.util.Base64DecoderException; +import java.security.InvalidKeyException; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.Signature; +import java.security.SignatureException; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.X509EncodedKeySpec; +import java.util.ArrayList; +import java.util.HashSet; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +public class Security { + private static final String KEY_FACTORY_ALGORITHM = "RSA"; + private static final SecureRandom RANDOM = new SecureRandom(); + private static final String SIGNATURE_ALGORITHM = "SHA1withRSA"; + private static final String TAG = "Security"; + private static HashSet sKnownNonces = new HashSet<>(); + + public static class VerifiedPurchase { + public String developerPayload; + public String notificationId; + public String orderId; + public String productId; + public Consts.PurchaseState purchaseState; + public long purchaseTime; + + public VerifiedPurchase(Consts.PurchaseState purchaseState2, String str, String str2, String str3, long j, String str4) { + this.purchaseState = purchaseState2; + this.notificationId = str; + this.productId = str2; + this.orderId = str3; + this.purchaseTime = j; + this.developerPayload = str4; + } + } + + public static long addNonce(long j) { + sKnownNonces.add(Long.valueOf(j)); + return j; + } + + public static ArrayList createVerifiedPurchasesList(String str, boolean z) { + if (str == null) { + Debug.Log.e(TAG, "data is null"); + return null; + } + Debug.Log.i(TAG, "signedData: " + str + ", verified " + z); + int i = 0; + try { + JSONObject jSONObject = new JSONObject(str); + long optLong = jSONObject.optLong("nonce"); + JSONArray optJSONArray = jSONObject.optJSONArray("orders"); + if (optJSONArray != null) { + i = optJSONArray.length(); + } + if (!isNonceKnown(optLong)) { + Debug.Log.w(TAG, "createVerifiedPurchasesList(): Nonce not found: " + optLong); + return null; + } + ArrayList arrayList = new ArrayList<>(); + for (int i2 = 0; i2 < i; i2++) { + try { + JSONObject jSONObject2 = optJSONArray.getJSONObject(i2); + Consts.PurchaseState valueOf = Consts.PurchaseState.valueOf(jSONObject2.getInt("purchaseState")); + String string = jSONObject2.getString("productId"); + jSONObject2.getString("packageName"); + long j = jSONObject2.getLong("purchaseTime"); + String optString = jSONObject2.optString("orderId", ""); + String optString2 = jSONObject2.optString("notificationId", null); + String optString3 = jSONObject2.optString("developerPayload", null); + if (valueOf != Consts.PurchaseState.PURCHASED || z) { + arrayList.add(new VerifiedPurchase(valueOf, optString2, string, optString, j, optString3)); + } + } catch (JSONException e) { + Debug.Log.e(TAG, "createVerifiedPurchasesList(): JSON exception: ", e); + arrayList = null; + } + } + removeNonce(optLong); + return arrayList; + } catch (JSONException e2) { + Debug.Log.e(TAG, "createVerifiedPurchasesList(): JSON malformed. Reason: " + e2.getMessage()); + return null; + } + } + + public static PublicKey generatePublicKey(String str) { + try { + return KeyFactory.getInstance(KEY_FACTORY_ALGORITHM).generatePublic(new X509EncodedKeySpec(Base64.decode(str))); + } catch (NoSuchAlgorithmException e) { + throw new RuntimeException(e); + } catch (InvalidKeySpecException e2) { + Debug.Log.e(TAG, "Invalid key specification."); + throw new IllegalArgumentException(e2); + } catch (Base64DecoderException e3) { + Debug.Log.e(TAG, "Base64 decoding failed."); + throw new IllegalArgumentException(e3); + } + } + + public static boolean isNonceKnown(long j) { + return sKnownNonces.contains(Long.valueOf(j)); + } + + public static void removeNonce(long j) { + sKnownNonces.remove(Long.valueOf(j)); + } + + public static boolean verify(PublicKey publicKey, String str, String str2) { + Debug.Log.i(TAG, "signature: " + str2); + try { + Signature instance = Signature.getInstance(SIGNATURE_ALGORITHM); + instance.initVerify(publicKey); + instance.update(str.getBytes()); + if (instance.verify(Base64.decode(str2))) { + return true; + } + Debug.Log.e(TAG, "Signature verification failed."); + return false; + } catch (NoSuchAlgorithmException e) { + Debug.Log.e(TAG, "NoSuchAlgorithmException."); + return false; + } catch (InvalidKeyException e2) { + Debug.Log.e(TAG, "Invalid key specification."); + return false; + } catch (SignatureException e3) { + Debug.Log.e(TAG, "Signature exception."); + return false; + } catch (Base64DecoderException e4) { + Debug.Log.e(TAG, "Base64 decoding failed."); + return false; + } + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/SecurityJNI.java b/app/src/main/java/com/ea/easp/mtx/market/SecurityJNI.java new file mode 100644 index 0000000..de788ac --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/SecurityJNI.java @@ -0,0 +1,18 @@ +package com.ea.easp.mtx.market; + +public class SecurityJNI { + private static final String TAG = "SecurityJNI"; + private MarketJNI mMarketJNI; + + SecurityJNI(MarketJNI marketJNI) { + this.mMarketJNI = marketJNI; + } + + public void getNonce(Object obj) { + this.mMarketJNI.getNonce(obj); + } + + public void verify(String str, String str2, int i, int i2) { + this.mMarketJNI.verify(str, str2, i, i2); + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/amazon/AmazonBillingService.java b/app/src/main/java/com/ea/easp/mtx/market/amazon/AmazonBillingService.java new file mode 100644 index 0000000..4fb508e --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/amazon/AmazonBillingService.java @@ -0,0 +1,249 @@ +package com.ea.easp.mtx.market.amazon; + +import android.app.Activity; +import android.content.Context; +import android.os.Bundle; +import android.os.RemoteException; + +import com.ea.easp.Debug; +import com.ea.easp.mtx.market.BillingService; +import com.ea.easp.mtx.market.Consts; +import com.ea.easp.mtx.market.ResponseHandler; +import com.ea.easp.mtx.market.Security; +import com.ea.easp.mtx.market.SecurityJNI; +import com.ea.nimble.Global; + +import org.json.JSONArray; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; + +public class AmazonBillingService implements BillingService, AmazonPurchasingObserver.AmazonPurchasingEventHandler { + private static final String TAG = "AmazonBillingService"; + private static SecurityJNI mSecurityJNI; + private static HashMap mSentRequests = new HashMap<>(); + private Context mContext = null; + private AmazonPurchasingObserver mObserver = null; + + @Override + public void onItemDataResponse(Object itemDataResponse) { + + } + + @Override + public void onPurchaseResponse(Object purchaseResponse) { + + } + + @Override + public void onPurchaseUpdatesResponse(Object purchaseUpdatesResponse) { + + } + + /* access modifiers changed from: package-private */ + public abstract class BillingRequest { + protected Runnable mErrorHandler = null; + protected String mRequestId; + + public BillingRequest(Runnable runnable) { + this.mErrorHandler = runnable; + } + + /* access modifiers changed from: protected */ + public boolean handleRunErrorWhenConnected(Exception exc) { + Debug.Log.e(AmazonBillingService.TAG, getClass() + " failed.", exc); + if (this.mErrorHandler == null) { + return false; + } + this.mErrorHandler.run(); + return false; + } + + /* access modifiers changed from: protected */ + public void logResponseCode(String str, Bundle bundle) { + Debug.Log.i(AmazonBillingService.TAG, str + " received " + Consts.ResponseCode.valueOf(bundle.getInt("RESPONSE_CODE")).toString()); + } + + /* access modifiers changed from: protected */ + public void onRemoteException(RemoteException remoteException) { + Debug.Log.w(AmazonBillingService.TAG, "remote billing service crashed"); + AmazonBillingService.this.mObserver = null; + } + + /* access modifiers changed from: protected */ + public void responseCodeReceived(Consts.ResponseCode responseCode) { + } + + /* access modifiers changed from: protected */ + public abstract String run() throws RemoteException; + + public boolean runRequest() { + try { + this.mRequestId = run(); + Debug.Log.d(AmazonBillingService.TAG, "request id: " + this.mRequestId); + if (this.mRequestId != null && !this.mRequestId.equals("")) { + AmazonBillingService.mSentRequests.put(this.mRequestId, this); + } + return true; + } catch (Exception e) { + Debug.Log.e(AmazonBillingService.TAG, "Exception : " + e); + handleRunErrorWhenConnected(e); + return false; + } + } + } + + class CheckBillingSupported extends BillingRequest { + public CheckBillingSupported(Runnable runnable) { + super(runnable); + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.amazon.AmazonBillingService.BillingRequest + public String run() throws RemoteException { + ResponseHandler.checkBillingSupportedResponse(true); + return Global.NOTIFICATION_DICTIONARY_RESULT_SUCCESS; + } + } + + /* access modifiers changed from: package-private */ + public class RequestPurchase extends BillingRequest implements BillingService.IRequestPurchase { + private final String mDeveloperPayload; + private final String mProductId; + + public RequestPurchase(AmazonBillingService amazonBillingService, String str, Runnable runnable) { + this(str, null, runnable); + } + + public RequestPurchase(String str, String str2, Runnable runnable) { + super(runnable); + this.mProductId = AmazonBillingService.this.mContext.getPackageName() + "." + str; + this.mDeveloperPayload = str2; + } + + public String getDeveloperPayload() { + return this.mDeveloperPayload; + } + + @Override // com.ea.easp.mtx.market.BillingService.IRequestPurchase + public String getProductId() { + return this.mProductId; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.amazon.AmazonBillingService.BillingRequest + public void responseCodeReceived(Consts.ResponseCode responseCode) { + ResponseHandler.responseCodeReceived(this, responseCode); + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.amazon.AmazonBillingService.BillingRequest + public String run() throws RemoteException { + return ""; + } + } + + class RestoreTransactions extends BillingRequest implements BillingService.IRestoreTransactions { + public RestoreTransactions(Runnable runnable) { + super(runnable); + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.amazon.AmazonBillingService.BillingRequest + public void onRemoteException(RemoteException remoteException) { + super.onRemoteException(remoteException); + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.amazon.AmazonBillingService.BillingRequest + public void responseCodeReceived(Consts.ResponseCode responseCode) { + ResponseHandler.responseCodeReceived(this, responseCode); + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.amazon.AmazonBillingService.BillingRequest + public String run() throws RemoteException { + return ""; + } + } + + public AmazonBillingService(SecurityJNI securityJNI, Context context) { + this.mContext = context; + this.mObserver = new AmazonPurchasingObserver((Activity) context, this); + mSecurityJNI = securityJNI; + } + + private void sendPurchases(String str, boolean z) { + try { + JSONObject jSONObject = new JSONObject(str); + String string = jSONObject.getString("requestId"); + jSONObject.getString("userId"); + JSONArray jSONArray = jSONObject.getJSONArray("receipts"); + BillingRequest billingRequest = mSentRequests.get(string); + ArrayList arrayList = new ArrayList(); + String str2 = ""; + if (billingRequest instanceof RequestPurchase) { + str2 = ((RequestPurchase) billingRequest).getDeveloperPayload(); + } + for (int i = 0; i < jSONArray.length(); i++) { + arrayList.add(new Security.VerifiedPurchase(Consts.PurchaseState.PURCHASED, "", jSONArray.getJSONObject(i).getString("sku").substring(this.mContext.getPackageName().length() + 1), "", 0, str2)); + } + ResponseHandler.purchaseResponse(arrayList, z, "", ""); + } catch (Exception e) { + ResponseHandler.purchaseResponse(null, false, "", ""); + } + } + + private void verifyReceipts(String str, String str2, Collection collection) { + try { + JSONObject jSONObject = new JSONObject(); + jSONObject.put("requestId", str); + jSONObject.put("userId", str2); + JSONArray jSONArray = new JSONArray(); + + jSONObject.put("receipts", jSONArray); + mSecurityJNI.verify(jSONObject.toString(), "", -1, Consts.STORE_AMAZON); + } catch (Exception e) { + ResponseHandler.purchaseResponse(null, false, "", ""); + } + } + + @Override // com.ea.easp.mtx.market.BillingService + public void OnNonceSucceed(long j, Object obj) { + } + + @Override // com.ea.easp.mtx.market.BillingService + public void OnVerifyMarketResponse(boolean z, String str, String str2, int i) { + Debug.Log.w(TAG, "OnVerifyMarketResponse, verified=" + z + " signature=" + str2 + " startId=" + i); + Debug.Log.w(TAG, "OnVerifyMarketResponse, signedData=" + str); + sendPurchases(str, z); + } + + @Override // com.ea.easp.mtx.market.BillingService + public void checkBillingSupported(Runnable runnable) { + new CheckBillingSupported(runnable).runRequest(); + } + + + + @Override // com.ea.easp.mtx.market.BillingService + public void requestPurchase(String str, String str2, String str3, Runnable runnable) { + new RequestPurchase(str, str3, runnable).runRequest(); + } + + @Override // com.ea.easp.mtx.market.BillingService + public void restoreTransactions(long j, Runnable runnable) { + new RestoreTransactions(runnable).runRequest(); + } + + @Override // com.ea.easp.mtx.market.BillingService + public void setContext(Context context) { + this.mContext = context; + } + + @Override // com.ea.easp.mtx.market.BillingService + public void shutdown() { + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/amazon/AmazonPurchasingObserver.java b/app/src/main/java/com/ea/easp/mtx/market/amazon/AmazonPurchasingObserver.java new file mode 100644 index 0000000..ed5cb71 --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/amazon/AmazonPurchasingObserver.java @@ -0,0 +1,46 @@ +package com.ea.easp.mtx.market.amazon; + +import android.app.Activity; + +/* access modifiers changed from: package-private */ +public class AmazonPurchasingObserver { + private AmazonPurchasingEventHandler mEventHandler = null; + + /* access modifiers changed from: package-private */ + public interface AmazonPurchasingEventHandler { + void onItemDataResponse(Object itemDataResponse); + + void onPurchaseResponse(Object purchaseResponse); + + void onPurchaseUpdatesResponse(Object purchaseUpdatesResponse); + } + + public AmazonPurchasingObserver(Activity activity, AmazonPurchasingEventHandler amazonPurchasingEventHandler) { + this.mEventHandler = amazonPurchasingEventHandler; + } + + public void onItemDataResponse(Object itemDataResponse) { + if (this.mEventHandler != null) { + this.mEventHandler.onItemDataResponse(itemDataResponse); + } + } + + // com.amazon.inapp.purchasing.PurchasingObserver, com.amazon.inapp.purchasing.BasePurchasingObserver + public void onPurchaseResponse(Object purchaseResponse) { + if (this.mEventHandler != null) { + this.mEventHandler.onPurchaseResponse(purchaseResponse); + } + } + + // com.amazon.inapp.purchasing.PurchasingObserver, com.amazon.inapp.purchasing.BasePurchasingObserver + public void onPurchaseUpdatesResponse(Object purchaseUpdatesResponse) { + if (this.mEventHandler != null) { + this.mEventHandler.onPurchaseUpdatesResponse(purchaseUpdatesResponse); + } + } + + // com.amazon.inapp.purchasing.PurchasingObserver, com.amazon.inapp.purchasing.BasePurchasingObserver + public void onSdkAvailable(boolean z) { + System.out.println((z ? "sandbox" : "production") + " mode"); + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/android/AndroidBillingService.java b/app/src/main/java/com/ea/easp/mtx/market/android/AndroidBillingService.java new file mode 100644 index 0000000..fd90c8a --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/android/AndroidBillingService.java @@ -0,0 +1,539 @@ +package com.ea.easp.mtx.market.android; + +import android.app.PendingIntent; +import android.app.Service; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.Bundle; +import android.os.IBinder; +import android.os.RemoteException; +import android.text.TextUtils; +import com.android.vending.billing.IMarketBillingService; +import com.ea.easp.Debug; +import com.ea.easp.mtx.market.BillingService; +import com.ea.easp.mtx.market.Consts; +import com.ea.easp.mtx.market.ResponseHandler; +import com.ea.easp.mtx.market.Security; +import com.ea.easp.mtx.market.SecurityJNI; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; + +public class AndroidBillingService extends Service implements ServiceConnection, BillingService { + private static final String TAG = "AndroidBillingService"; + private static LinkedList mPendingRequests = new LinkedList<>(); + private static SecurityJNI mSecurityJNI; + private static HashMap mSentRequests = new HashMap<>(); + private static IMarketBillingService mService; + + /* access modifiers changed from: package-private */ + public abstract class BillingRequest { + protected boolean mAddRequestToPendingQueue; + protected long mRequestId; + private final int mStartId; + + public BillingRequest(int i) { + this.mStartId = i; + } + + public boolean getNeedAddRequestToPendingQueue() { + return this.mAddRequestToPendingQueue; + } + + public int getStartId() { + return this.mStartId; + } + + /* access modifiers changed from: protected */ + public abstract boolean handleRunErrorWhenConnected(Exception exc); + + /* access modifiers changed from: protected */ + public void logResponseCode(String str, Bundle bundle) { + Debug.Log.i(AndroidBillingService.TAG, str + " received " + Consts.ResponseCode.valueOf(bundle.getInt("RESPONSE_CODE")).toString()); + } + + /* access modifiers changed from: protected */ + public Bundle makeRequestBundle(String str) { + Bundle bundle = new Bundle(); + bundle.putString(Consts.BILLING_REQUEST_METHOD, str); + bundle.putInt(Consts.BILLING_REQUEST_API_VERSION, 1); + bundle.putString(Consts.BILLING_REQUEST_PACKAGE_NAME, AndroidBillingService.this.getPackageName()); + return bundle; + } + + /* access modifiers changed from: protected */ + public void onRemoteException(RemoteException remoteException) { + Debug.Log.e(AndroidBillingService.TAG, "remote billing service crashed.", remoteException); + IMarketBillingService unused = AndroidBillingService.mService = null; + } + + /* access modifiers changed from: protected */ + public void responseCodeReceived(Consts.ResponseCode responseCode) { + } + + /* access modifiers changed from: protected */ + public abstract long run() throws Exception; + + public boolean runIfConnected() { + Debug.Log.d(AndroidBillingService.TAG, "runIfConnected(): " + getClass().getSimpleName()); + if (AndroidBillingService.mService != null) { + try { + this.mRequestId = run(); + Debug.Log.d(AndroidBillingService.TAG, "request id: " + this.mRequestId); + if (this.mRequestId >= 0) { + AndroidBillingService.mSentRequests.put(Long.valueOf(this.mRequestId), this); + } + return true; + } catch (RemoteException e) { + this.mAddRequestToPendingQueue = handleRunErrorWhenConnected(e); + onRemoteException(e); + } catch (Exception e2) { + this.mAddRequestToPendingQueue = handleRunErrorWhenConnected(e2); + Debug.Log.i(AndroidBillingService.TAG, "unbind service"); + AndroidBillingService.this.unbind(); + Debug.Log.i(AndroidBillingService.TAG, "set service pointer to null to be able rebind."); + IMarketBillingService unused = AndroidBillingService.mService = null; + } + } + return false; + } + + public boolean runRequest() { + this.mAddRequestToPendingQueue = true; + if (runIfConnected()) { + return true; + } + if (!this.mAddRequestToPendingQueue || !AndroidBillingService.this.bindToMarketBillingService()) { + return false; + } + AndroidBillingService.mPendingRequests.add(this); + return true; + } + } + + class CheckBillingSupported extends BillingRequest { + Runnable mErrorHandler; + + public CheckBillingSupported(Runnable runnable) { + super(-1); + this.mErrorHandler = runnable; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public boolean handleRunErrorWhenConnected(Exception exc) { + Debug.Log.e(AndroidBillingService.TAG, "CheckBillingSupported failed.", exc); + if (this.mErrorHandler == null) { + return false; + } + this.mErrorHandler.run(); + return false; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public long run() throws RemoteException { + int i = AndroidBillingService.mService.sendBillingRequest(makeRequestBundle("CHECK_BILLING_SUPPORTED")).getInt("RESPONSE_CODE", -1); + Debug.Log.i(AndroidBillingService.TAG, "CheckBillingSupported response code: " + Consts.ResponseCode.valueOf(i)); + ResponseHandler.checkBillingSupportedResponse(i == Consts.ResponseCode.RESULT_OK.ordinal()); + return Consts.BILLING_RESPONSE_INVALID_REQUEST_ID; + } + } + + /* access modifiers changed from: package-private */ + public class ConfirmNotifications extends BillingRequest { + final String[] mNotifyIds; + + public ConfirmNotifications(int i, String[] strArr) { + super(i); + this.mNotifyIds = strArr; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public boolean handleRunErrorWhenConnected(Exception exc) { + Debug.Log.e(AndroidBillingService.TAG, "ConfirmNotifications failed.", exc); + return true; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public long run() throws RemoteException { + Bundle makeRequestBundle = makeRequestBundle("CONFIRM_NOTIFICATIONS"); + makeRequestBundle.putStringArray(Consts.BILLING_REQUEST_NOTIFY_IDS, this.mNotifyIds); + Bundle sendBillingRequest = AndroidBillingService.mService.sendBillingRequest(makeRequestBundle); + logResponseCode("confirmNotifications", sendBillingRequest); + return sendBillingRequest.getLong(Consts.BILLING_RESPONSE_REQUEST_ID, Consts.BILLING_RESPONSE_INVALID_REQUEST_ID); + } + } + + /* access modifiers changed from: package-private */ + public class GetPurchaseInformation extends BillingRequest { + long mNonce; + final String[] mNotifyIds; + + public GetPurchaseInformation(long j, int i, String[] strArr) { + super(i); + this.mNotifyIds = strArr; + this.mNonce = j; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public boolean handleRunErrorWhenConnected(Exception exc) { + Debug.Log.e(AndroidBillingService.TAG, "GetPurchaseInformation failed.", exc); + return true; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public void onRemoteException(RemoteException remoteException) { + super.onRemoteException(remoteException); + Security.removeNonce(this.mNonce); + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public long run() throws RemoteException { + Security.addNonce(this.mNonce); + Bundle makeRequestBundle = makeRequestBundle("GET_PURCHASE_INFORMATION"); + makeRequestBundle.putLong(Consts.BILLING_REQUEST_NONCE, this.mNonce); + makeRequestBundle.putStringArray(Consts.BILLING_REQUEST_NOTIFY_IDS, this.mNotifyIds); + Bundle sendBillingRequest = AndroidBillingService.mService.sendBillingRequest(makeRequestBundle); + logResponseCode("getPurchaseInformation", sendBillingRequest); + return sendBillingRequest.getLong(Consts.BILLING_RESPONSE_REQUEST_ID, Consts.BILLING_RESPONSE_INVALID_REQUEST_ID); + } + } + + /* access modifiers changed from: private */ + public class NonceRequestDataGetPurchaseInformation { + public String mNotifyId; + public int mStartId; + + public NonceRequestDataGetPurchaseInformation(int i, String str) { + this.mStartId = i; + this.mNotifyId = str; + } + } + + class RequestPurchase extends BillingRequest implements BillingService.IRequestPurchase { + public final String mDeveloperPayload; + Runnable mErrorHandler; + public final String mProductId; + + public RequestPurchase(AndroidBillingService androidBillingService, String str, Runnable runnable) { + this(str, null, runnable); + } + + public RequestPurchase(String str, String str2, Runnable runnable) { + super(-1); + this.mProductId = str; + this.mDeveloperPayload = str2; + this.mErrorHandler = runnable; + } + + public String getDeveloperPayload() { + return this.mDeveloperPayload; + } + + @Override // com.ea.easp.mtx.market.BillingService.IRequestPurchase + public String getProductId() { + return this.mProductId; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public boolean handleRunErrorWhenConnected(Exception exc) { + Debug.Log.e(AndroidBillingService.TAG, "RequestPurchase failed.", exc); + if (this.mErrorHandler == null) { + return false; + } + this.mErrorHandler.run(); + return false; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public void responseCodeReceived(Consts.ResponseCode responseCode) { + ResponseHandler.responseCodeReceived(this, responseCode); + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public long run() throws Exception { + Bundle makeRequestBundle = makeRequestBundle("REQUEST_PURCHASE"); + makeRequestBundle.putString(Consts.BILLING_REQUEST_ITEM_ID, this.mProductId); + if (this.mDeveloperPayload != null) { + makeRequestBundle.putString(Consts.BILLING_REQUEST_DEVELOPER_PAYLOAD, this.mDeveloperPayload); + } + Bundle sendBillingRequest = AndroidBillingService.mService.sendBillingRequest(makeRequestBundle); + PendingIntent pendingIntent = (PendingIntent) sendBillingRequest.getParcelable(Consts.BILLING_RESPONSE_PURCHASE_INTENT); + if (pendingIntent == null) { + Debug.Log.e(AndroidBillingService.TAG, "Error with requestPurchase"); + throw new Exception("sendBillingRequest(): PURCHASE INTENT is null."); + } + ResponseHandler.buyPageIntentResponse(pendingIntent, new Intent()); + long j = sendBillingRequest.getLong(Consts.BILLING_RESPONSE_REQUEST_ID, Consts.BILLING_RESPONSE_INVALID_REQUEST_ID); + if (j >= 0) { + return j; + } + throw new Exception("sendBillingRequest(): invalid request ID"); + } + } + + class RestoreTransactions extends BillingRequest implements BillingService.IRestoreTransactions { + Runnable mErrorHandler; + long mNonce; + + public RestoreTransactions(long j, Runnable runnable) { + super(-1); + this.mNonce = j; + this.mErrorHandler = runnable; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public boolean handleRunErrorWhenConnected(Exception exc) { + Debug.Log.e(AndroidBillingService.TAG, "RestoreTransactions failed.", exc); + if (this.mErrorHandler == null) { + return false; + } + this.mErrorHandler.run(); + return false; + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public void onRemoteException(RemoteException remoteException) { + super.onRemoteException(remoteException); + Security.removeNonce(this.mNonce); + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public void responseCodeReceived(Consts.ResponseCode responseCode) { + ResponseHandler.responseCodeReceived(this, responseCode); + } + + /* access modifiers changed from: protected */ + @Override // com.ea.easp.mtx.market.android.AndroidBillingService.BillingRequest + public long run() throws Exception { + Security.addNonce(this.mNonce); + Bundle makeRequestBundle = makeRequestBundle("RESTORE_TRANSACTIONS"); + makeRequestBundle.putLong(Consts.BILLING_REQUEST_NONCE, this.mNonce); + Bundle sendBillingRequest = AndroidBillingService.mService.sendBillingRequest(makeRequestBundle); + logResponseCode("restoreTransactions", sendBillingRequest); + long j = sendBillingRequest.getLong(Consts.BILLING_RESPONSE_REQUEST_ID, Consts.BILLING_RESPONSE_INVALID_REQUEST_ID); + if (j >= 0) { + return j; + } + throw new Exception("sendBillingRequest(): invalid request ID"); + } + } + + public AndroidBillingService() { + } + + public AndroidBillingService(SecurityJNI securityJNI) { + mSecurityJNI = securityJNI; + } + + private boolean bindToMarketBillingService() { + try { + Debug.Log.i(TAG, "binding to Market billing service"); + if (bindService(new Intent(Consts.MARKET_BILLING_SERVICE_ACTION), this, Context.BIND_AUTO_CREATE)) { + return true; + } + Debug.Log.e(TAG, "Could not bind to service."); + return false; + } catch (SecurityException e) { + Debug.Log.e(TAG, "Security exception: " + e); + } + return false; + } + + private void checkResponseCode(long j, Consts.ResponseCode responseCode) { + BillingRequest billingRequest = mSentRequests.get(Long.valueOf(j)); + if (billingRequest != null) { + Debug.Log.d(TAG, billingRequest.getClass().getSimpleName() + ": " + responseCode); + billingRequest.responseCodeReceived(responseCode); + } + mSentRequests.remove(Long.valueOf(j)); + } + + private boolean confirmNotifications(int i, String[] strArr) { + return new ConfirmNotifications(i, strArr).runRequest(); + } + + private void createPurchasesFromJsonAndSendThemToHandler(boolean z, String str, String str2, int i) { + Debug.Log.d(TAG, "createPurchasesFromJsonAndSendThemToHandler()"); + ArrayList createVerifiedPurchasesList = Security.createVerifiedPurchasesList(str, z); + if (createVerifiedPurchasesList == null) { + Debug.Log.d(TAG, "...createPurchasesFromJsonAndSendThemToHandler(): purchases is null"); + return; + } + ArrayList arrayList = new ArrayList(); + Iterator it = createVerifiedPurchasesList.iterator(); + while (it.hasNext()) { + Security.VerifiedPurchase next = it.next(); + if (next.notificationId != null) { + arrayList.add(next.notificationId); + } + } + ResponseHandler.purchaseResponse(createVerifiedPurchasesList, z, str, str2); + if (!arrayList.isEmpty()) { + Debug.Log.d(TAG, "sending confirmation of receiving of " + arrayList.size() + " notifications()"); + confirmNotifications(i, (String[]) arrayList.toArray(new String[arrayList.size()])); + } + Debug.Log.d(TAG, "...createPurchasesFromJsonAndSendThemToHandler()"); + } + + private void getNonce(Object obj) { + if (mSecurityJNI != null) { + mSecurityJNI.getNonce(obj); + } else { + Debug.Log.e(TAG, "getNonce(): fail to send 'get nonce' request."); + } + } + + private boolean getPurchaseInformation(long j, int i, String[] strArr) { + return new GetPurchaseInformation(j, i, strArr).runRequest(); + } + + private void purchaseStateChanged(int i, String str, String str2) { + Debug.Log.d(TAG, "purchaseStateChanged()"); + if (str == null) { + Debug.Log.e(TAG, "purchaseStateChanged(): signedData is null"); + } else if (!TextUtils.isEmpty(str2)) { + verifyMarketResponse(str, str2, i); + } else { + Debug.Log.d(TAG, "signature is empty: \"" + str2 + "\""); + createPurchasesFromJsonAndSendThemToHandler(false, str, str2, i); + } + Debug.Log.d(TAG, "...purchaseStateChanged()"); + } + + private void runPendingRequests() { + int i = -1; + while (true) { + BillingRequest peek = mPendingRequests.peek(); + if (peek != null) { + if (peek.runIfConnected()) { + mPendingRequests.remove(); + if (i < peek.getStartId()) { + i = peek.getStartId(); + } + } else { + bindToMarketBillingService(); + return; + } + } else if (i >= 0) { + Debug.Log.i(TAG, "stopping service, startId: " + i); + stopSelf(i); + return; + } else { + return; + } + } + } + + private void verifyMarketResponse(String str, String str2, int i) { + if (mSecurityJNI != null) { + mSecurityJNI.verify(str, str2, i, Consts.STORE_ANDROID); + } else { + Debug.Log.e(TAG, "verifyMarketResponse(): fail to send transaction verification request."); + } + } + + @Override // com.ea.easp.mtx.market.BillingService + public void OnNonceSucceed(long j, Object obj) { + if (obj instanceof NonceRequestDataGetPurchaseInformation) { + NonceRequestDataGetPurchaseInformation nonceRequestDataGetPurchaseInformation = (NonceRequestDataGetPurchaseInformation) obj; + getPurchaseInformation(j, nonceRequestDataGetPurchaseInformation.mStartId, new String[]{nonceRequestDataGetPurchaseInformation.mNotifyId}); + return; + } + Debug.Log.e(TAG, "OnNonceSucceed(): unknown type of requestData"); + } + + @Override // com.ea.easp.mtx.market.BillingService + public void OnVerifyMarketResponse(boolean z, String str, String str2, int i) { + createPurchasesFromJsonAndSendThemToHandler(z, str, str2, i); + } + + @Override // com.ea.easp.mtx.market.BillingService + public void checkBillingSupported(Runnable runnable) { + new CheckBillingSupported(runnable).runRequest(); + } + + public void handleCommand(Intent intent, int i) { + if (intent == null) { + Debug.Log.d(TAG, "handleCommand() null intent"); + return; + } + String action = intent.getAction(); + Debug.Log.i(TAG, "handleCommand() action: " + action); + if (Consts.ACTION_CONFIRM_NOTIFICATION.equals(action)) { + String[] stringArrayExtra = intent.getStringArrayExtra(Consts.NOTIFICATION_ID); + Debug.Log.w(TAG, "Confirm notifications called from BillingService.handleCommand()"); + confirmNotifications(i, stringArrayExtra); + } else if (Consts.ACTION_GET_PURCHASE_INFORMATION.equals(action)) { + getNonce(new NonceRequestDataGetPurchaseInformation(i, intent.getStringExtra(Consts.NOTIFICATION_ID))); + } else if (Consts.ACTION_PURCHASE_STATE_CHANGED.equals(action)) { + purchaseStateChanged(i, intent.getStringExtra(Consts.INAPP_SIGNED_DATA), intent.getStringExtra(Consts.INAPP_SIGNATURE)); + } else if (Consts.ACTION_RESPONSE_CODE.equals(action)) { + checkResponseCode(intent.getLongExtra(Consts.INAPP_REQUEST_ID, -1), Consts.ResponseCode.valueOf(intent.getIntExtra(Consts.INAPP_RESPONSE_CODE, Consts.ResponseCode.RESULT_ERROR.ordinal()))); + } + } + + public IBinder onBind(Intent intent) { + return null; + } + + public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + Debug.Log.d(TAG, "Billing service connected"); + mService = IMarketBillingService.Stub.asInterface(iBinder); + runPendingRequests(); + } + + public void onServiceDisconnected(ComponentName componentName) { + Debug.Log.w(TAG, "Billing service disconnected"); + mService = null; + } + + public void onStart(Intent intent, int i) { + handleCommand(intent, i); + } + + @Override // com.ea.easp.mtx.market.BillingService + public void requestPurchase(String str, String str2, String str3, Runnable runnable) { + new RequestPurchase(str, str3, runnable).runRequest(); + } + + @Override // com.ea.easp.mtx.market.BillingService + public void restoreTransactions(long j, Runnable runnable) { + new RestoreTransactions(j, runnable).runRequest(); + } + + @Override // com.ea.easp.mtx.market.BillingService + public void setContext(Context context) { + attachBaseContext(context); + } + + @Override // com.ea.easp.mtx.market.BillingService + public void shutdown() { + Debug.Log.d(TAG, "shutdown()"); + unbind(); + stopSelf(); + } + + public void unbind() { + try { + unbindService(this); + } catch (IllegalArgumentException e) { + Debug.Log.d(TAG, "Billing service: unbind() failed"); + } + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/android/BillingReceiver.java b/app/src/main/java/com/ea/easp/mtx/market/android/BillingReceiver.java new file mode 100644 index 0000000..5c52217 --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/android/BillingReceiver.java @@ -0,0 +1,54 @@ +package com.ea.easp.mtx.market.android; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import com.ea.easp.Debug; +import com.ea.easp.mtx.market.Consts; + +public class BillingReceiver extends BroadcastReceiver { + private static final String TAG = "BillingReceiver"; + + private void checkResponseCode(Context context, long j, int i) { + Intent intent = new Intent(Consts.ACTION_RESPONSE_CODE); + intent.setClass(context, AndroidBillingService.class); + intent.putExtra(Consts.INAPP_REQUEST_ID, j); + intent.putExtra(Consts.INAPP_RESPONSE_CODE, i); + context.startService(intent); + } + + private void notify(Context context, String str) { + Intent intent = new Intent(Consts.ACTION_GET_PURCHASE_INFORMATION); + intent.setClass(context, AndroidBillingService.class); + intent.putExtra(Consts.NOTIFICATION_ID, str); + context.startService(intent); + } + + private void purchaseStateChanged(Context context, String str, String str2) { + Debug.Log.d(TAG, "purchaseStateChanged()..."); + if (str != null) { + Debug.Log.d(TAG, "signedData is \"" + str + "\""); + } + Intent intent = new Intent(Consts.ACTION_PURCHASE_STATE_CHANGED); + intent.setClass(context, AndroidBillingService.class); + intent.putExtra(Consts.INAPP_SIGNED_DATA, str); + intent.putExtra(Consts.INAPP_SIGNATURE, str2); + context.startService(intent); + Debug.Log.d(TAG, "...purchaseStateChanged()"); + } + + public void onReceive(Context context, Intent intent) { + String action = intent.getAction(); + if (Consts.ACTION_PURCHASE_STATE_CHANGED.equals(action)) { + purchaseStateChanged(context, intent.getStringExtra(Consts.INAPP_SIGNED_DATA), intent.getStringExtra(Consts.INAPP_SIGNATURE)); + } else if (Consts.ACTION_NOTIFY.equals(action)) { + String stringExtra = intent.getStringExtra(Consts.NOTIFICATION_ID); + Debug.Log.i(TAG, "notifyId: " + stringExtra); + notify(context, stringExtra); + } else if (Consts.ACTION_RESPONSE_CODE.equals(action)) { + checkResponseCode(context, intent.getLongExtra(Consts.INAPP_REQUEST_ID, -1), intent.getIntExtra(Consts.INAPP_RESPONSE_CODE, Consts.ResponseCode.RESULT_ERROR.ordinal())); + } else { + Debug.Log.w(TAG, "unexpected action: " + action); + } + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/util/Base64.java b/app/src/main/java/com/ea/easp/mtx/market/util/Base64.java new file mode 100644 index 0000000..54302e8 --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/util/Base64.java @@ -0,0 +1,196 @@ +package com.ea.easp.mtx.market.util; + +public class Base64 { + static final boolean $assertionsDisabled = (!Base64.class.desiredAssertionStatus()); + private static final byte EQUALS_SIGN = 61; + private static final byte WHITE_SPACE_ENC = -5; + private static final byte EQUALS_SIGN_ENC = -1; + private static final byte NEW_LINE = 10; + private static final byte[] ALPHABET = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47}; + private static final byte[] DECODABET = {-9, -9, -9, -9, -9, -9, -9, -9, -9, WHITE_SPACE_ENC, WHITE_SPACE_ENC, -9, -9, WHITE_SPACE_ENC, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, WHITE_SPACE_ENC, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, 62, -9, -9, -9, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, EQUALS_SIGN, -9, -9, -9, EQUALS_SIGN_ENC, -9, -9, -9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, NEW_LINE, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -9, -9, -9, -9, -9, -9, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -9, -9, -9, -9, -9}; + public static final boolean DECODE = false; + public static final boolean ENCODE = true; + private static final byte[] WEBSAFE_ALPHABET = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 45, 95}; + private static final byte[] WEBSAFE_DECODABET = {-9, -9, -9, -9, -9, -9, -9, -9, -9, WHITE_SPACE_ENC, WHITE_SPACE_ENC, -9, -9, WHITE_SPACE_ENC, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, WHITE_SPACE_ENC, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, 62, -9, -9, 52, 53, 54, 55, 56, 57, 58, 59, 60, EQUALS_SIGN, -9, -9, -9, EQUALS_SIGN_ENC, -9, -9, -9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, NEW_LINE, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -9, -9, -9, -9, 63, -9, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -9, -9, -9, -9, -9}; + + private Base64() { + } + + public static byte[] decode(String str) throws Base64DecoderException { + byte[] bytes = str.getBytes(); + return decode(bytes, 0, bytes.length); + } + + public static byte[] decode(byte[] bArr) throws Base64DecoderException { + return decode(bArr, 0, bArr.length); + } + + public static byte[] decode(byte[] bArr, int i, int i2) throws Base64DecoderException { + return decode(bArr, i, i2, DECODABET); + } + + public static byte[] decode(byte[] bArr, int i, int i2, byte[] bArr2) throws Base64DecoderException { + byte[] bArr3 = new byte[(((i2 * 3) / 4) + 2)]; + int i3 = 0; + byte[] bArr4 = new byte[4]; + int i4 = 0; + int i5 = 0; + while (true) { + if (i5 >= i2) { + break; + } + byte b = (byte) (bArr[i5 + i] & Byte.MAX_VALUE); + byte b2 = bArr2[b]; + if (b2 >= -5) { + if (b2 < -1) { + i4 = i4; + } else if (b == 61) { + int i6 = i2 - i5; + byte b3 = (byte) (bArr[(i2 - 1) + i] & Byte.MAX_VALUE); + if (i4 == 0 || i4 == 1) { + throw new Base64DecoderException("invalid padding byte '=' at byte offset " + i5); + } else if ((i4 == 3 && i6 > 2) || (i4 == 4 && i6 > 1)) { + throw new Base64DecoderException("padding byte '=' falsely signals end of encoded value at offset " + i5); + } else if (b3 != 61 && b3 != 10) { + throw new Base64DecoderException("encoded value has invalid trailing byte"); + } + } else { + i4++; + bArr4[i4] = b; + if (i4 == 4) { + i3 += decode4to3(bArr4, 0, bArr3, i3, bArr2); + i4 = 0; + } + } + i5++; + } else { + throw new Base64DecoderException("Bad Base64 input character at " + i5 + ": " + ((int) bArr[i5 + i]) + "(decimal)"); + } + } + if (i4 != 0) { + if (i4 == 1) { + throw new Base64DecoderException("single trailing character at offset " + (i2 - 1)); + } + int i7 = i4 + 1; + bArr4[i4] = EQUALS_SIGN; + i3 += decode4to3(bArr4, 0, bArr3, i3, bArr2); + } + byte[] bArr5 = new byte[i3]; + System.arraycopy(bArr3, 0, bArr5, 0, i3); + return bArr5; + } + + private static int decode4to3(byte[] bArr, int i, byte[] bArr2, int i2, byte[] bArr3) { + if (bArr[i + 2] == 61) { + bArr2[i2] = (byte) ((((bArr3[bArr[i]] << 24) >>> 6) | ((bArr3[bArr[i + 1]] << 24) >>> 12)) >>> 16); + return 1; + } else if (bArr[i + 3] == 61) { + int i3 = ((bArr3[bArr[i]] << 24) >>> 6) | ((bArr3[bArr[i + 1]] << 24) >>> 12) | ((bArr3[bArr[i + 2]] << 24) >>> 18); + bArr2[i2] = (byte) (i3 >>> 16); + bArr2[i2 + 1] = (byte) (i3 >>> 8); + return 2; + } else { + int i4 = ((bArr3[bArr[i]] << 24) >>> 6) | ((bArr3[bArr[i + 1]] << 24) >>> 12) | ((bArr3[bArr[i + 2]] << 24) >>> 18) | ((bArr3[bArr[i + 3]] << 24) >>> 24); + bArr2[i2] = (byte) (i4 >> 16); + bArr2[i2 + 1] = (byte) (i4 >> 8); + bArr2[i2 + 2] = (byte) i4; + return 3; + } + } + + public static byte[] decodeWebSafe(String str) throws Base64DecoderException { + byte[] bytes = str.getBytes(); + return decodeWebSafe(bytes, 0, bytes.length); + } + + public static byte[] decodeWebSafe(byte[] bArr) throws Base64DecoderException { + return decodeWebSafe(bArr, 0, bArr.length); + } + + public static byte[] decodeWebSafe(byte[] bArr, int i, int i2) throws Base64DecoderException { + return decode(bArr, i, i2, WEBSAFE_DECODABET); + } + + public static String encode(byte[] bArr) { + return encode(bArr, 0, bArr.length, ALPHABET, true); + } + + public static String encode(byte[] bArr, int i, int i2, byte[] bArr2, boolean z) { + byte[] encode = encode(bArr, i, i2, bArr2, Integer.MAX_VALUE); + int length = encode.length; + while (!z && length > 0 && encode[length - 1] == 61) { + length--; + } + return new String(encode, 0, length); + } + + public static byte[] encode(byte[] bArr, int i, int i2, byte[] bArr2, int i3) { + int i4 = ((i2 + 2) / 3) * 4; + byte[] bArr3 = new byte[((i4 / i3) + i4)]; + int i5 = 0; + int i6 = 0; + int i7 = i2 - 2; + int i8 = 0; + while (i5 < i7) { + int i9 = ((bArr[i5 + i] << 24) >>> 8) | ((bArr[(i5 + 1) + i] << 24) >>> 16) | ((bArr[(i5 + 2) + i] << 24) >>> 24); + bArr3[i6] = bArr2[i9 >>> 18]; + bArr3[i6 + 1] = bArr2[(i9 >>> 12) & 63]; + bArr3[i6 + 2] = bArr2[(i9 >>> 6) & 63]; + bArr3[i6 + 3] = bArr2[i9 & 63]; + i8 += 4; + if (i8 == i3) { + bArr3[i6 + 4] = NEW_LINE; + i6++; + i8 = 0; + } + i5 += 3; + i6 += 4; + } + if (i5 < i2) { + encode3to4(bArr, i5 + i, i2 - i5, bArr3, i6, bArr2); + if (i8 + 4 == i3) { + bArr3[i6 + 4] = NEW_LINE; + i6++; + } + i6 += 4; + } + if ($assertionsDisabled || i6 == bArr3.length) { + return bArr3; + } + throw new AssertionError(); + } + + private static byte[] encode3to4(byte[] bArr, int i, int i2, byte[] bArr2, int i3, byte[] bArr3) { + int i4 = 0; + int i5 = (i2 > 1 ? (bArr[i + 1] << 24) >>> 16 : 0) | (i2 > 0 ? (bArr[i] << 24) >>> 8 : 0); + if (i2 > 2) { + i4 = (bArr[i + 2] << 24) >>> 24; + } + int i6 = i5 | i4; + switch (i2) { + case 1: + bArr2[i3] = bArr3[i6 >>> 18]; + bArr2[i3 + 1] = bArr3[(i6 >>> 12) & 63]; + bArr2[i3 + 2] = EQUALS_SIGN; + bArr2[i3 + 3] = EQUALS_SIGN; + break; + case 2: + bArr2[i3] = bArr3[i6 >>> 18]; + bArr2[i3 + 1] = bArr3[(i6 >>> 12) & 63]; + bArr2[i3 + 2] = bArr3[(i6 >>> 6) & 63]; + bArr2[i3 + 3] = EQUALS_SIGN; + break; + case 3: + bArr2[i3] = bArr3[i6 >>> 18]; + bArr2[i3 + 1] = bArr3[(i6 >>> 12) & 63]; + bArr2[i3 + 2] = bArr3[(i6 >>> 6) & 63]; + bArr2[i3 + 3] = bArr3[i6 & 63]; + break; + } + return bArr2; + } + + public static String encodeWebSafe(byte[] bArr, boolean z) { + return encode(bArr, 0, bArr.length, WEBSAFE_ALPHABET, z); + } +} diff --git a/app/src/main/java/com/ea/easp/mtx/market/util/Base64DecoderException.java b/app/src/main/java/com/ea/easp/mtx/market/util/Base64DecoderException.java new file mode 100644 index 0000000..e6cdff5 --- /dev/null +++ b/app/src/main/java/com/ea/easp/mtx/market/util/Base64DecoderException.java @@ -0,0 +1,12 @@ +package com.ea.easp.mtx.market.util; + +public class Base64DecoderException extends Exception { + private static final long serialVersionUID = 1; + + public Base64DecoderException() { + } + + public Base64DecoderException(String str) { + super(str); + } +} diff --git a/app/src/main/java/com/ea/games/nfs13_na/C2DMReceiver.java b/app/src/main/java/com/ea/games/nfs13_na/C2DMReceiver.java new file mode 100644 index 0000000..23fe689 --- /dev/null +++ b/app/src/main/java/com/ea/games/nfs13_na/C2DMReceiver.java @@ -0,0 +1,84 @@ +package com.ea.games.nfs13_na; + +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.util.Log; + +import com.ea.ironmonkey.C2DMConstants; +import com.google.android.c2dm.C2DMBaseReceiver; + +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.List; + +public class C2DMReceiver extends C2DMBaseReceiver { + private static final String TAG = "C2DMReceiver"; + public static List unhandledMessages = new ArrayList(); + + public C2DMReceiver() { + super(C2DMConstants.SENDER_EMAIL); + Log.i(TAG, "C2DMReceiver Constuctor()"); + } + + private String extractPayload(Bundle bundle) { + for (String str : bundle.keySet()) { + if (str.startsWith("eamobile-message")) { + try { + return URLDecoder.decode(bundle.getString(str), "UTF-8"); + } catch (Exception e) { + return ""; + } + } + } + return ""; + } + + public void generateNotification(Context context, String str, String str2) { + int i = Build.VERSION.SDK_INT; + Log.i("Vj", "Vj:: osVersion - " + i); + Notification notification = new Notification(i < 10 ? R.drawable.iconb : R.drawable.iconw, str, System.currentTimeMillis()); + Intent intent = new Intent("android.intent.action.MAIN"); + intent.setClassName(C2DMConstants.SYSTEM_MSG_PACKAGE_RECIPIENT, C2DMConstants.SYSTEM_MSG_CLASS_RECIPIENT); + //notification.setLatestEventInfo(context, str, str2, PendingIntent.getActivity(context, 0, intent, 0)); + notification.flags |= 16; + ((NotificationManager) context.getSystemService("notification")).notify(0, notification); + } + + @Override // com.google.android.c2dm.C2DMBaseReceiver + public void onError(Context context, String str) { + Log.e(TAG, "C2DMReceiver onError() " + str); + Intent intent = new Intent(C2DMConstants.ACTION_ERROR); + intent.putExtra(C2DMConstants.EXTRA_ERROR_ID, str); + context.sendBroadcast(intent, null); + } + + @Override // com.google.android.c2dm.C2DMBaseReceiver + public void onMessage(Context context, Intent intent) { + Log.i(TAG, "C2DMReceiver onMessage()"); + Bundle extras = intent.getExtras(); + unhandledMessages.add(extras); + Intent intent2 = new Intent(C2DMConstants.ACTION_MESSAGE); + intent2.putExtras(extras); + context.sendBroadcast(intent2, null); + generateNotification(context, C2DMConstants.SYSTEM_MSG_TITLE, extractPayload(intent.getExtras())); + } + + @Override // com.google.android.c2dm.C2DMBaseReceiver + public void onRegistered(Context context, String str) { + Log.i(TAG, " onRegistered()"); + Intent intent = new Intent(C2DMConstants.ACTION_REGISTER); + intent.putExtra(C2DMConstants.EXTRA_REGISTRATION_ID, str); + context.sendBroadcast(intent, null); + } + + @Override // com.google.android.c2dm.C2DMBaseReceiver + public void onUnregistered(Context context) { + Log.i(TAG, "C2DMReceiver onUnregistered()"); + context.sendBroadcast(new Intent(C2DMConstants.ACTION_UNREGISTER), null); + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/Accelerometer.java b/app/src/main/java/com/ea/ironmonkey/Accelerometer.java new file mode 100644 index 0000000..e99691c --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/Accelerometer.java @@ -0,0 +1,135 @@ +package com.ea.ironmonkey; + +import android.hardware.Sensor; +import android.hardware.SensorEvent; +import android.hardware.SensorEventListener; +import android.hardware.SensorManager; +import com.google.android.gms.maps.model.BitmapDescriptorFactory; + +public class Accelerometer implements SensorEventListener { + private int bufferReadIndex; + private int bufferSize; + private int[] bufferTimesteps; + private float[] bufferValues; + private int bufferWriteIndex; + private long lastTimestamp = 0; + private int naturalOrientation; + private boolean registered; + private float samplesPerSecond; + private Sensor sensor; + private SensorManager sensorManager; + + public Accelerometer(SensorManager sensorManager2, Sensor sensor2, int i) { + this.sensorManager = sensorManager2; + this.sensor = sensor2; + this.naturalOrientation = i; + } + + private int getSensorDelay() { + return this.samplesPerSecond < 20.0f ? 3 : 1; + } + + private void register() { + if (!this.registered && this.samplesPerSecond > BitmapDescriptorFactory.HUE_RED) { + this.sensorManager.registerListener(this, this.sensor, getSensorDelay()); + this.registered = true; + } else if (this.registered && this.samplesPerSecond == BitmapDescriptorFactory.HUE_RED) { + this.sensorManager.unregisterListener(this); + this.registered = false; + } + } + + private void unregister() { + if (this.registered) { + this.sensorManager.unregisterListener(this); + this.registered = false; + } + } + + public int getBufferSize() { + return this.bufferSize; + } + + public float getFrequency() { + return this.samplesPerSecond; + } + + public int getSamples(int i, int[] iArr, float[] fArr) { + int i2 = 0; + synchronized (this) { + while (this.bufferReadIndex != this.bufferWriteIndex) { + if (this.bufferReadIndex >= this.bufferSize) { + this.bufferReadIndex = 0; + } + if (i2 >= i) { + break; + } + iArr[i2] = this.bufferTimesteps[this.bufferReadIndex]; + for (int i3 = 0; i3 < 3; i3++) { + fArr[(i2 * 3) + i3] = this.bufferValues[(this.bufferReadIndex * 3) + i3]; + } + i2++; + this.bufferReadIndex++; + } + } + return i2; + } + + public void onAccuracyChanged(Sensor sensor2, int i) { + } + + public void onSensorChanged(SensorEvent sensorEvent) { + int i = (int) ((sensorEvent.timestamp - this.lastTimestamp) / 1000000); + this.lastTimestamp = sensorEvent.timestamp; + synchronized (this) { + this.bufferWriteIndex++; + if (this.bufferWriteIndex >= this.bufferSize) { + this.bufferWriteIndex = 0; + } + if (this.bufferWriteIndex == this.bufferReadIndex) { + this.bufferReadIndex++; + } + this.bufferTimesteps[this.bufferWriteIndex] = i; + switch (this.naturalOrientation) { + case 0: + this.bufferValues[(this.bufferWriteIndex * 3) + 0] = -sensorEvent.values[0]; + this.bufferValues[(this.bufferWriteIndex * 3) + 1] = sensorEvent.values[1]; + break; + case 1: + this.bufferValues[(this.bufferWriteIndex * 3) + 0] = sensorEvent.values[1]; + this.bufferValues[(this.bufferWriteIndex * 3) + 1] = -sensorEvent.values[0]; + break; + case 2: + this.bufferValues[(this.bufferWriteIndex * 3) + 0] = sensorEvent.values[0]; + this.bufferValues[(this.bufferWriteIndex * 3) + 1] = -sensorEvent.values[1]; + break; + case 3: + this.bufferValues[(this.bufferWriteIndex * 3) + 0] = -sensorEvent.values[1]; + this.bufferValues[(this.bufferWriteIndex * 3) + 1] = sensorEvent.values[0]; + break; + } + this.bufferValues[(this.bufferWriteIndex * 3) + 2] = sensorEvent.values[2]; + } + } + + public void pause() { + unregister(); + } + + public void resume() { + register(); + } + + public void setBufferSize(int i) { + this.bufferSize = i; + this.bufferTimesteps = new int[i]; + this.bufferValues = new float[(i * 3)]; + this.bufferWriteIndex = 0; + this.bufferReadIndex = 0; + } + + public void setFrequency(float f) { + this.samplesPerSecond = f; + register(); + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/BitmapGraphics.java b/app/src/main/java/com/ea/ironmonkey/BitmapGraphics.java new file mode 100644 index 0000000..b3204a1 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/BitmapGraphics.java @@ -0,0 +1,50 @@ +package com.ea.ironmonkey; + +import android.graphics.Bitmap; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.PorterDuff; +import android.graphics.Typeface; + +public class BitmapGraphics { + private Bitmap bitmap; + private Canvas canvas = new Canvas(); + + public BitmapGraphics(int i, int i2) { + this.bitmap = Bitmap.createBitmap(i, i2, Bitmap.Config.ARGB_8888); + this.canvas.setBitmap(this.bitmap); + } + + private static Paint createPaint(Typeface typeface, float f) { + Paint paint = new Paint(); + paint.setTypeface(typeface); + paint.setTextSize(f); + paint.setColor(-1); + paint.setAntiAlias(true); + return paint; + } + + public static Paint createPaintFromFamilyName(String str, float f) { + return createPaint(Typeface.create(str, 0), f); + } + + public static Paint createPaintFromFile(String str, float f) { + return createPaint(Typeface.createFromFile(str), f); + } + + public void clear() { + this.canvas.drawColor(0, PorterDuff.Mode.CLEAR); + } + + public void drawString(Paint paint, String str, int i, int i2) { + this.canvas.drawText(str, (float) i, (float) i2, paint); + } + + public Bitmap getBitmap() { + return this.bitmap; + } + + public Canvas getCanvas() { + return this.canvas; + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/C2DMConstants.java b/app/src/main/java/com/ea/ironmonkey/C2DMConstants.java new file mode 100644 index 0000000..0b2a91d --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/C2DMConstants.java @@ -0,0 +1,15 @@ +package com.ea.ironmonkey; + +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.GameActivity"; + public static final String SYSTEM_MSG_PACKAGE_RECIPIENT = "com.ea.games.nfs13_na"; + public static final String SYSTEM_MSG_TITLE = "NFS Most Wanted"; +} diff --git a/app/src/main/java/com/ea/ironmonkey/ComposeMain.kt b/app/src/main/java/com/ea/ironmonkey/ComposeMain.kt new file mode 100644 index 0000000..18aeabf --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/ComposeMain.kt @@ -0,0 +1,44 @@ +package com.ea.ironmonkey + +import android.content.Context +import android.util.AttributeSet +import android.widget.FrameLayout +import android.widget.Toast +import androidx.activity.ComponentActivity +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.material3.Button +import androidx.compose.material3.OutlinedTextField +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.platform.ComposeView +import androidx.lifecycle.Lifecycle +import androidx.lifecycle.LifecycleOwner +import androidx.lifecycle.LifecycleRegistry + + +class ComposeFrameLayout @JvmOverloads constructor( + context: Context, attrs: AttributeSet? = null, + defStyleAttr: Int = 0 +) : FrameLayout(context, attrs, defStyleAttr) { + + init { + addView( + ComposeView(context).apply { + setContent { + Box{ + Button(onClick = { + Toast.makeText(context, "Hello!", Toast.LENGTH_LONG).show() + }) { + Text("ComposeButton") + } + } + } + } + ) + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/DrawFrameListener.java b/app/src/main/java/com/ea/ironmonkey/DrawFrameListener.java new file mode 100644 index 0000000..a0ed30e --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/DrawFrameListener.java @@ -0,0 +1,7 @@ +package com.ea.ironmonkey; + +import javax.microedition.khronos.opengles.GL10; + +public interface DrawFrameListener { + void onDrawFrame(GL10 gl10); +} diff --git a/app/src/main/java/com/ea/ironmonkey/GameActivity.kt b/app/src/main/java/com/ea/ironmonkey/GameActivity.kt new file mode 100644 index 0000000..4e57ffd --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/GameActivity.kt @@ -0,0 +1,662 @@ +package com.ea.ironmonkey + +import android.app.AlertDialog +import android.content.DialogInterface +import android.content.Intent +import android.content.pm.ActivityInfo +import android.hardware.SensorManager +import android.media.AudioManager +import android.opengl.GLES20 +import android.os.Build +import android.os.Bundle +import android.os.Handler +import android.os.PowerManager +import android.os.PowerManager.WakeLock +import android.os.Process +import android.util.DisplayMetrics +import android.view.KeyEvent +import android.view.ViewParent +import android.view.inputmethod.InputMethodManager +import android.widget.FrameLayout +import androidx.activity.ComponentActivity +import androidx.lifecycle.Lifecycle +import com.ea.EAIO.EAIO +import com.ea.EAMIO.StorageDirectory +import com.ea.easp.EASPHandler +import com.ea.games.nfs13_na.BuildConfig +import com.ea.nimble.ApplicationLifecycle +import com.eamobile.IDeviceData +import com.eamobile.IDownloadActivity +import com.eamobile.Language +import com.eamobile.download.DeviceData +import java.io.BufferedReader +import java.io.File +import java.io.FileReader +import java.io.IOException +import java.util.Locale +import javax.microedition.khronos.egl.EGLConfig +import javax.microedition.khronos.opengles.GL10 +import kotlin.math.min +import kotlin.math.sqrt +import kotlin.system.exitProcess + + +class GameActivity : ComponentActivity(), DrawFrameListener, IDeviceData, IDownloadActivity { + + init { + System.loadLibrary("nimble") + System.loadLibrary("app") + } + + private val lifecycleNames = arrayOf( + "LIFECYCLE_NONE", + "LIFECYCLE_CREATED", + "LIFECYCLE_STARTED", + "LIFECYCLE_RUNNING", + "LIFECYCLE_STOPPED", + "LIFECYCLE_DESTROYED" + ) + private var laststate = 0 + private var lifecycleOldSystem = 0 + private var easpHandler: EASPHandler? = null + private var splash: SplashScreen? = null + private var gameRenderer: GameRenderer? = null + var runLoop: RunLoop? = null + var gameGLSurfaceView: GameGLSurfaceView? = null + var accelerometer: Accelerometer? = null + private var handler: Handler? = null + private var mFrameLayout: FrameLayout? = null + private var mWakeLock: WakeLock? = null + private var splashDelay: Long = 0 + private var splashTimer: Long = 0 + + companion object { + + const val STATE_RESTORE_CONTEXT = 7 + const val STATE_GAME_START = 8 + private var oldState = 0 + + @JvmField + var state = 0 + + private var mAudioManager: AudioManager? = null + + //В нативном коде эти методы помечны как статические + @JvmStatic + fun GetDeviceName() = Build.MODEL + + @JvmStatic + fun GetApplicationVersion() = BuildConfig.VERSION_NAME + + @JvmStatic + fun GetDefaultLanguage() = Locale.getDefault().toString().substring(0, 2) + + @JvmStatic + val osVersion = Build.VERSION.RELEASE + } + + //Метод вызвывется из нативного кода поэтому нужно его существование + fun installWallpaper() {} + fun needInstallWallpaper() = false + fun openURL(str: String?) = Log.d("OpenURL", str) + fun openURLinBrowser(str: String?) = Log.d("OpenURLinBrowser", str) + fun getDisplayMetrics() = resources.displayMetrics + fun GetViewRoot() = window.decorView.getRootView().parent + fun CallGC() { + Log.d(this.localClassName, "Call garbage collector") + System.gc() + } + + private fun ForceHideVirtualKeyboard() { + val currentFocus = currentFocus + if (currentFocus != null) { + (getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager).hideSoftInputFromWindow( + currentFocus.windowToken, + 0 + ) + } + window.setSoftInputMode(3) + } + + + private fun wakeLockAcquire() { + val powerManager = getSystemService(POWER_SERVICE) as PowerManager + if (mWakeLock == null) { + mWakeLock = powerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK, this.localClassName) + } + + if (!mWakeLock!!.isHeld) { + try { + mWakeLock!!.acquire(10*60*1000L /*10 minutes*/) + } catch (e: SecurityException) { + Log.w(this.localClassName, "Missing WAKE_LOCK permission.") + } + } + } + + private fun wakeLockRelease() { + if (mWakeLock != null && mWakeLock!!.isHeld) { + try { + mWakeLock!!.release() + } catch (e: SecurityException) { + Log.w(this.localClassName, "Missing WAKE_LOCK permission.") + } + } + } + + fun IsSystemKey(key: Int): Boolean { + val systemKeys = intArrayOf( + Language.SPACE_UNAVAIL_TITLE, + Language.BTN_DOWNLOAD, + Language.BTN_EXIT, + Language.NETWORK_WARNING_TXT, + Language.UPDATES_FOUND_TITLE, + Language.UPDATES_FOUND_TXT, + Language.UNSUPPORTED_DEVICE_TITLE, + 91 + ) + for (systemKey: Int in systemKeys) if (key == systemKey) return false + return true + } + + fun ShowMessage(message: String, strArr: Array, finish: Boolean) { + Log.d(this.localClassName, "ShowMessage msg = $message finish = $finish") + + val dialog = AlertDialog.Builder(this) + dialog.setMessage(message) + dialog.setCancelable(false) + dialog.setPositiveButton(strArr[0]) { _: DialogInterface?, _: Int -> + if (finish) { + finish() + } + } + handler!!.postDelayed({ dialog.show() }, 20) + } + + fun calcPerformanceScore( + cpuUsage: Float, + processorCount: Int, + screenWidth: Int, + screenHeight: Int + ): Float { + // Log input parameters for debugging + Log.i( + this.localClassName, + "calculatePerformanceScore($cpuUsage, $processorCount, $screenWidth, $screenHeight)" + ) + + // Calculate CPU-related score + var cpuScore = 0.001f * cpuUsage * 3.0f + if (processorCount > 1) { + // If there is more than one processor, adjust the CPU score + cpuScore += 0.001f * cpuUsage * min(processorCount.toFloat(), 3f) * 0.5f + } + + // Calculate screen-related score + val screenScore = + sqrt((screenWidth * screenHeight).toDouble()) * 0.0010000000474974513 * 0.5 + + // Log CPU information + try { + val cpuInfo = BufferedReader(FileReader("/proc/cpuinfo")).readLine() + Log.i(this.localClassName, "CPU Info: $cpuInfo") + } catch (e: IOException) { + e.printStackTrace() + } + + // Log device model + val deviceModel = Build.MODEL + Log.i(this.localClassName, "Device Model: $deviceModel") + + // Calculate the final performance score and return it + return ((1.0f + cpuScore) / (1.0f + screenScore.toFloat())) / 3 + } + + fun getPerformanceScore(): Float { + var cpuFrequency = 0.0f + var processorCount = 0 + + // Read CPU information from file + val cpuInfo = readCpuFile("present") + if (cpuInfo.isNotEmpty()) { + val cpuList = parseCpuList(cpuInfo) + + // Iterate through the CPU list and get max frequency + for (cpuId: Int? in cpuList) { + val maxFreq = + readCpuFile(String.format("cpu%d/cpufreq/cpuinfo_max_freq", cpuId)) + if (maxFreq.isNotEmpty()) { + try { + cpuFrequency = maxFreq.toInt().toFloat() * 0.001f + break + } catch (e: NumberFormatException) { + e.printStackTrace() + } + } + } + processorCount = cpuList.size + } + + // Get screen metrics + val displayMetrics = DisplayMetrics() + windowManager.defaultDisplay.getMetrics(displayMetrics) + + // Calculate the performance score and return it + return calcPerformanceScore( + cpuFrequency, + processorCount, + displayMetrics.widthPixels, + displayMetrics.heightPixels + ) + } + + fun getTotalMemory(): Int { + var totalMemoryInMB = 0 + val memInfoFile = File("/proc/meminfo") + if (!memInfoFile.exists()) { + Log.d("mem", "Meminfo file not found") + return 0 + } + try { + val reader = BufferedReader(FileReader(memInfoFile)) + var line: String + while ((reader.readLine().also { line = it }) != null) { + val parts = + line.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() + if (parts.size != 2) { + continue + } + val key = parts[0].trim { it <= ' ' }.lowercase(Locale.getDefault()) + val value = parts[1].trim { it <= ' ' } + if (key != "memtotal") { + continue + } + val valueParts = + value.split(" ".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() + if (valueParts.isNotEmpty()) { + try { + totalMemoryInMB = valueParts[0].toInt() / 1024 + } catch (e: NumberFormatException) { + e.printStackTrace() + } + } + break // We found "MemTotal," so we can exit the loop + } + reader.close() + } catch (e: Exception) { + Log.e( + this.localClassName, + "Error reading system file: ${memInfoFile.absolutePath} (${e.message})" + ) + } + Log.d("mem", "Total Memory (MB): $totalMemoryInMB") + return totalMemoryInMB + } + + external fun nativeOnCreate() + external fun nativeOnDestroy() + external fun nativeOnPause() + external fun nativeOnPhysicalKeyDown(i: Int, i2: Int) + external fun nativeOnPhysicalKeyUp(i: Int, i2: Int) + external fun nativeOnPhysicalKeyboardVisibilityChanged(z: Boolean) + external fun nativeOnPhysicalNavigationVisibilityChanged(z: Boolean) + external fun nativeOnRestart() + external fun nativeOnResume() + external fun nativeOnStart() + external fun nativeOnStop() + external fun nativeRestoreContext(): Boolean + external fun nativeSurfaceChanged(gl10: GL10?, i: Int, i2: Int) + external fun nativeSurfaceCreated(gl10: GL10?, eGLConfig: EGLConfig?) + + public override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + easpHandler!!.onActivityResult(requestCode, resultCode, data) + ApplicationLifecycle.onActivityResult(requestCode, resultCode, data, this) + } + + override fun onBackPressed() { + //ApplicationLifecycle.onBackPressed() + } + + public override fun onCreate(bundle: Bundle?) { + Log.i("Debug", "onCreate") + Log.setEnable(true) + Log.i(this.localClassName, "onCreate") + Log.i(this.localClassName, "GameActivity.state = $state") + super.onCreate(bundle) + //instance = this + if (lifecycle.currentState == Lifecycle.State.DESTROYED) { + Log.w(this.localClassName, "onCreate called on destroyed app, finishing") + finish() + } else if (lifecycle.currentState >= Lifecycle.State.CREATED) { + Log.w( + this.localClassName, + "onCreate ignored, lifecycle is already ${lifecycle.currentState}" + ) + } else { + handler = Handler() + val window = window + //window.setFlags(1024, 1024) + requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE + requestWindowFeature(1) + Log.d("Model", Build.MODEL) + mAudioManager = getSystemService(AUDIO_SERVICE) as AudioManager + val sensorManager = getSystemService(SENSOR_SERVICE) as SensorManager + val defaultSensor = sensorManager.getDefaultSensor(1) + val rotation = getWindow().windowManager.defaultDisplay.rotation + if (defaultSensor != null) { + accelerometer = Accelerometer(sensorManager, defaultSensor, rotation) + } + gameGLSurfaceView = GameGLSurfaceView(this) + gameRenderer = GameRenderer(this) + gameRenderer!!.setDrawFrameListener(this) + gameGLSurfaceView!!.setRenderer(gameRenderer) + runLoop = RunLoop(gameGLSurfaceView) + mFrameLayout = FrameLayout(this) + mFrameLayout!!.addView(gameGLSurfaceView) + val view = ComposeFrameLayout(this) + mFrameLayout!!.addView(view) + setContentView(mFrameLayout!!) + Log.d(this.localClassName, "Init EAIO/EAMIO") + EAIO.Startup(this) + StorageDirectory.Startup(this) + if (easpHandler == null) { + Log.d(this.localClassName, "Init EASPHandler") + easpHandler = EASPHandler(this, mFrameLayout!!, gameGLSurfaceView!!) + easpHandler!!.onCreate() + } + ApplicationLifecycle.onActivityCreate(bundle, this) + Log.d(this.localClassName, "nativeOnCreate") + nativeOnCreate() + } + } + + public override fun onDestroy() { + Log.i("Debug", "onDestroy") + Log.i(this.localClassName, "onDestroy") + super.onDestroy() + if (lifecycleOldSystem >= 5) { + Log.w( + this.localClassName, + "onDestroy ignored, lifecycle is already " + lifecycleNames[lifecycleOldSystem] + ) + return + } + easpHandler!!.onDestroy() + if (state == 8) { + ApplicationLifecycle.onActivityDestroy(this) + nativeOnDestroy() + } + StorageDirectory.Shutdown() + EAIO.Shutdown() + exitProcess(0) + } + + + override fun onDownloadEvent(i: Int) { + + } + + override fun onDrawFrame(gl10: GL10) { + Log.i("state_in", "state = $state") + if (state != laststate) { + Log.d(this.localClassName, "onDrawFrame state=$state") + laststate = state + } + var isStarted = false + when (state) { + STATE_RESTORE_CONTEXT -> { + run { + Log.i("state_in splash is null", (this.splash == null).toString() + "") + if (this.splash == null) { + this.splash = SplashScreen(this) + this.splash!!.init( + gl10, + this.gameRenderer!!.width, + this.gameRenderer!!.height + ) + this.splashDelay = System.currentTimeMillis() + 2000 + } + if (this.splashDelay < System.currentTimeMillis() /*&& hasWindowFocus()*/) { + if (oldState != 8) { + state = oldState + } else { + this.splashTimer = System.currentTimeMillis() + 300 + state = 8 + } + } + } + run { + if (this.splashTimer < System.currentTimeMillis() && nativeRestoreContext()) { + nativeOnStart() + nativeOnResume() + this.gameRenderer!!.setDrawFrameListener(null) + isStarted = true + } + } + } + + STATE_GAME_START -> { + if (splashTimer < System.currentTimeMillis() && nativeRestoreContext()) { + nativeOnStart() + nativeOnResume() + gameRenderer!!.setDrawFrameListener(null) + isStarted = true + } + } + } + GLES20.glClearColor(1.0f, 1.0f, 1.0f, 1.0f) + GLES20.glClear(16640) + if (splash != null) { + splash!!.draw(gl10, gameRenderer!!.width, gameRenderer!!.height) + } + if (isStarted && splash != null) { + splash!!.destroy(gl10) + splash = null + } + } + + override fun onKeyDown(i: Int, keyEvent: KeyEvent): Boolean { + super.onKeyDown(i, keyEvent) + if (state != 8) { + return true + } + if ((i == 4 || i == 108) && keyEvent.repeatCount > 0) { + return true + } + val scanCode = keyEvent.scanCode + gameGLSurfaceView!!.queueEvent { nativeOnPhysicalKeyDown(i, scanCode) } + return IsSystemKey(i) + } + + override fun onKeyUp(i: Int, keyEvent: KeyEvent): Boolean { + super.onKeyUp(i, keyEvent) + if (state != 8) { + return true + } + val scanCode = keyEvent.scanCode + gameGLSurfaceView!!.queueEvent { nativeOnPhysicalKeyUp(i, scanCode) } + return IsSystemKey(i) + } + + public override fun onPause() { + super.onPause() + Log.i("Debug", "onPause") + Log.i(this.localClassName, "onPause state=$state") + mAudioManager!!.setStreamMute(3, true) + if (lifecycleOldSystem != 3) { + Log.w( + this.localClassName, + "onPause ignored, lifecycle is currently " + lifecycleNames[lifecycleOldSystem] + ) + return + } + gameGLSurfaceView!!.onPause() + + ApplicationLifecycle.onActivityPause(this) + nativeOnPause() + splash = null + } + + public override fun onRestart() { + Log.i("Debug", "onRestart") + Log.i(this.localClassName, "onRestart") + Log.i(this.localClassName, "TouchEvent, GameActivity.state = $state") + super.onRestart() + ApplicationLifecycle.onActivityRestart(this) + nativeOnRestart() + } + + override fun onResult(str: String, i: Int) { + Log.i("Debug", "onResult") + Log.w(this.localClassName, "onResult($str,$i)") + if (i != -1) { + finish() + Process.killProcess(Process.myPid()) + } else { + val file = File(File(str).getParent() + "/.nomedia") + if (!file.exists()) file.createNewFile() + handler!!.postDelayed({ this@GameActivity.setContentView((gameGLSurfaceView)!!) }, 20) + if (hasWindowFocus()) { + state = 8 + return + } + oldState = 8 + state = 8 + } + } + + public override fun onResume() { + Log.i("Debug", "onResume") + Log.i(this.localClassName, "onResume") + Log.i("check", "GameActivity.state = $state") + super.onResume() + if (state != 7) { + oldState = state + state = 8 + gameRenderer!!.setDrawFrameListener(this) + } + if (lifecycleOldSystem == 3) { + Log.w( + this.localClassName, + "onResume ignored, lifecycle is currently ${lifecycleNames[lifecycleOldSystem]}" + ) + return + } + gameGLSurfaceView!!.onResume() + ApplicationLifecycle.onActivityResume(this) + nativeOnResume() + } + + override fun onRetrievedDeviceData(deviceData: DeviceData) { + deviceData.setResolution(480, 800) + } + + public override fun onSaveInstanceState(bundle: Bundle) { + super.onSaveInstanceState(bundle) + ApplicationLifecycle.onActivitySaveInstanceState(bundle, this) + } + + public override fun onStart() { + System.gc() + Log.i("Debug", "onStart") + Log.i(this.localClassName, "onStart") + super.onStart() + Log.i(this.localClassName, "onStart 1") + wakeLockAcquire() + Log.i(this.localClassName, "onStart 2") + if (lifecycleOldSystem < 2 || lifecycleOldSystem >= 4) { + Log.i(this.localClassName, "onStart 3") + Log.i(this.localClassName, "nativeOnStart") + nativeOnStart() + Log.i(this.localClassName, "nativeOnStart - end") + Log.i(this.localClassName, "ApplicationLifecycle") + ApplicationLifecycle.onActivityStart(this) + } + Log.w( + this.localClassName, + "onStart ignored, lifecycle is already " + lifecycleNames[lifecycleOldSystem] + ) + } + + public override fun onStop() { + super.onStop() + Log.i("Debug", "onStop") + Log.i(this.localClassName, "onStop") + if (lifecycleOldSystem >= 4) { + Log.w( + this.localClassName, + "onStop ignored, lifecycle is already ${lifecycleNames[lifecycleOldSystem]}" + ) + return + } + wakeLockRelease() + nativeOnStop() + mAudioManager!!.setStreamMute(3, false) + mAudioManager!!.setStreamSolo(3, false) + if (mAudioManager!!.abandonAudioFocus(null) == 0) { + Log.e(this.localClassName, "abandonAudioFocus failed") + } + } + + override fun onWindowFocusChanged(hasFocus: Boolean) { + Log.i("Debug", "onWindowFocusChanged") + super.onWindowFocusChanged(hasFocus) + Log.i(this.localClassName, "onWindowsFocusChanged($hasFocus) state=$state") + if (hasFocus) { + mAudioManager!!.setStreamMute(3, false) + } else { + ForceHideVirtualKeyboard() + nativeOnPhysicalKeyDown(131, 0) + nativeOnPhysicalKeyUp(131, 0) + if (state == 8) { + mAudioManager!!.setStreamMute(3, true) + oldState = state + state = 7 + gameRenderer!!.setDrawFrameListener(this) + } + } + ApplicationLifecycle.onActivityWindowFocusChanged(hasFocus, this) + } + + fun parseCpuList(cpuInfo: String): List { + val arrayList = mutableListOf() + val split = cpuInfo.split(",".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() + for (str2: String in split) { + if (str2.contains("-")) { + val split2 = str2.split("-".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() + if (split2.size >= 2) { + try { + val parseInt = split2[0].toInt() + val parseInt2 = split2[1].toInt() + for (i in parseInt..parseInt2) { + arrayList.add(i) + } + } catch (_: NumberFormatException) { + } + } + } else { + try { + arrayList.add(str2.toInt()) + } catch (_: NumberFormatException) { + } + } + } + return arrayList + } + + fun readCpuFile(str: String): String { + val file = File("/sys/devices/system/cpu/$str") + runCatching { + return file.readLines()[0] + }.onFailure { + Log.e( + this.localClassName, + "Error reading system file: ${file.absoluteFile} (${it.message})" + ) + return "" + } + return "" + } + +} diff --git a/app/src/main/java/com/ea/ironmonkey/GameGLSurfaceView.java b/app/src/main/java/com/ea/ironmonkey/GameGLSurfaceView.java new file mode 100644 index 0000000..9ddf60d --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/GameGLSurfaceView.java @@ -0,0 +1,186 @@ +package com.ea.ironmonkey; + +import android.opengl.GLSurfaceView; +import android.os.Build; +import android.view.MotionEvent; + +import javax.microedition.khronos.egl.EGL10; +import javax.microedition.khronos.egl.EGLConfig; +import javax.microedition.khronos.egl.EGLContext; +import javax.microedition.khronos.egl.EGLDisplay; + +public class GameGLSurfaceView extends GLSurfaceView { + + private static final String TAG = "GameGLSurfaceView"; + private boolean enableHistoricalEvents = false; + private boolean kMotionEvent_GetSource = true; + private GameActivity mActivity = null; + + // TODO Разобраться с рендерингом игры + public GameGLSurfaceView(GameActivity gameActivity) { + + super(gameActivity); + + //MotionEvent motionEvent; + + this.mActivity = gameActivity; + try { + MotionEvent.class.getMethod("getSource"); + + this.kMotionEvent_GetSource = true; + } catch (Exception e) { + } + setGLESVersion2(); + setFocusable(true); + setFocusableInTouchMode(true); + if (Build.VERSION.SDK_INT >= 11) { + try { + Log.i(TAG, "setPreserveEGLContextOnPause"); + setPreserveEGLContextOnPause(false); + Log.e(TAG, "setPreserveEGLContextOnPause(false) success"); + } catch (Exception e2) { + Log.e(TAG, "setPreserveEGLContextOnPause failed"); + } + } + } + + /* access modifiers changed from: private */ + public static class ConfigChooser implements GLSurfaceView.EGLConfigChooser { + private static final int EGL_DEPTH_ENCODING_NONLINEAR_NV = 12515; + private static final int EGL_DEPTH_ENCODING_NV = 12514; + protected int mAlphaSize; + protected int mBlueSize; + protected int mDepthSize; + protected int mGreenSize; + protected int mRedSize; + protected int mStencilSize; + private int[] mValue = new int[1]; + + public ConfigChooser(int redSize, int greenSize, int blueSize, int alphaSize, int depthSize, int stencilSize) { + this.mRedSize = redSize; + this.mGreenSize = greenSize; + this.mBlueSize = blueSize; + this.mAlphaSize = alphaSize; + this.mDepthSize = depthSize; + this.mStencilSize = stencilSize; + } + + private int findConfigAttrib(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig eGLConfig, int i, int i2) { + return egl10.eglGetConfigAttrib(eGLDisplay, eGLConfig, i, this.mValue) ? this.mValue[0] : i2; + } + + public EGLConfig chooseConfig(EGL10 egl10, EGLDisplay eGLDisplay) { + int[] iArr = {12352, 4, 12324, 4, 12323, 4, 12322, 4, 12344}; + int[] iArr2 = new int[1]; + egl10.eglChooseConfig(eGLDisplay, iArr, null, 0, iArr2); + int i = iArr2[0]; + if (i <= 0) { + throw new IllegalArgumentException("No configs match configSpec"); + } + EGLConfig[] eGLConfigArr = new EGLConfig[i]; + egl10.eglChooseConfig(eGLDisplay, iArr, eGLConfigArr, i, iArr2); + return chooseConfig(egl10, eGLDisplay, eGLConfigArr); + } + + public EGLConfig chooseConfig(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig[] eGLConfigArr) { + + EGLConfig eGLConfig = null; + + while (eGLConfig == null) { + for (EGLConfig eGLConfig2 : eGLConfigArr) { + int findConfigAttrib = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12325, 0); + int findConfigAttrib2 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12326, 0); + if (findConfigAttrib >= this.mDepthSize && findConfigAttrib2 >= this.mStencilSize) { + int findConfigAttrib3 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12324, 0); + int findConfigAttrib4 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12323, 0); + int findConfigAttrib5 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12322, 0); + int findConfigAttrib6 = findConfigAttrib(egl10, eGLDisplay, eGLConfig2, 12321, 0); + if (findConfigAttrib3 == this.mRedSize && findConfigAttrib4 == this.mGreenSize && findConfigAttrib5 == this.mBlueSize && findConfigAttrib6 == this.mAlphaSize) { + eGLConfig = eGLConfig2; + if (findConfigAttrib(egl10, eGLDisplay, eGLConfig2, EGL_DEPTH_ENCODING_NV, 0) == 0) { + break; + } + } + } + } + if (eGLConfig == null) { + if (this.mDepthSize <= 0) { + return null; + } + this.mDepthSize -= 8; + } + } + Log.i(GameGLSurfaceView.TAG, "depth=" + findConfigAttrib(egl10, eGLDisplay, eGLConfig, 12325, 0) + " stencil=" + findConfigAttrib(egl10, eGLDisplay, eGLConfig, 12326, 0) + " red=" + findConfigAttrib(egl10, eGLDisplay, eGLConfig, 12324, 0) + " green=" + findConfigAttrib(egl10, eGLDisplay, eGLConfig, 12323, 0) + " blue=" + findConfigAttrib(egl10, eGLDisplay, eGLConfig, 12322, 0) + " alpha=" + findConfigAttrib(egl10, eGLDisplay, eGLConfig, 12321, 0) + " nonLinear=" + (findConfigAttrib(egl10, eGLDisplay, eGLConfig, EGL_DEPTH_ENCODING_NV, 0) == EGL_DEPTH_ENCODING_NONLINEAR_NV)); + return eGLConfig; + } + } + + + private native void nativeTouchPadEvent(int i, int i2, float f, float f2); + + private native void nativeTouchScreenEvent(int i, int i2, float f, float f2); + + private void setGLESVersion2() { + setEGLContextFactory(new GLSurfaceView.EGLContextFactory() { + + private static final int EGL_CONTEXT_CLIENT_VERSION = 12440; + + public EGLContext createContext(EGL10 egl10, EGLDisplay eGLDisplay, EGLConfig eGLConfig) { + return egl10.eglCreateContext(eGLDisplay, eGLConfig, EGL10.EGL_NO_CONTEXT, new int[]{EGL_CONTEXT_CLIENT_VERSION, 2, 12344}); + } + + public void destroyContext(EGL10 egl10, EGLDisplay eGLDisplay, EGLContext eGLContext) { + egl10.eglDestroyContext(eGLDisplay, eGLContext); + } + }); + setEGLConfigChooser(new ConfigChooser(5, 6, 5, 0, 24, 0)); + } + + @Override + public boolean performClick() { + Log.i(TAG, "performClick()..."); + return super.performClick(); + } + + @Override + public boolean onTouchEvent(MotionEvent motionEvent) { + int state = GameActivity.state; + Log.i(TAG, "TouchEvent, GameActivity.state = " + state); + motionEvent.getHistorySize(); + final int pointerCount = motionEvent.getPointerCount(); + final MotionEvent obtain = MotionEvent.obtain(motionEvent); + queueEvent(() -> { + Log.i(TAG, "queueEvent..."); + + if (GameGLSurfaceView.this.kMotionEvent_GetSource) { + + if (obtain.getSource() == 4098 || obtain.getSource() == 1048584) { + if (obtain.getAction() == MotionEvent.ACTION_MOVE) { + for (int i = 0; i < pointerCount; i++) { + Log.i(TAG, "TouchEvent 1"); + GameGLSurfaceView.this.nativeTouchScreenEvent(obtain.getAction(), obtain.getPointerId(i), obtain.getX(i), obtain.getY(i)); + } + return; + } + int actionIndex = obtain.getActionIndex(); + Log.i(TAG, "TouchEvent 2"); + GameGLSurfaceView.this.nativeTouchScreenEvent(obtain.getAction(), obtain.getPointerId(actionIndex), obtain.getX(actionIndex), obtain.getY(actionIndex)); + } + } else if (obtain.getAction() == MotionEvent.ACTION_MOVE) { + for (int i = 0; i < pointerCount; i++) { + Log.i(TAG, "TouchEvent 5"); + GameGLSurfaceView.this.nativeTouchScreenEvent(obtain.getAction(), obtain.getPointerId(i), obtain.getX(i), obtain.getY(i)); + } + } else { + int actionIndex3 = obtain.getActionIndex(); + Log.i(TAG, "TouchEvent 6"); + GameGLSurfaceView.this.nativeTouchScreenEvent(obtain.getAction(), obtain.getPointerId(actionIndex3), obtain.getX(actionIndex3), obtain.getY(actionIndex3)); + } + }); + return true; + } + + public void setEnableHistoricalEvents(boolean z) { + this.enableHistoricalEvents = z; + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/GameRenderer.kt b/app/src/main/java/com/ea/ironmonkey/GameRenderer.kt new file mode 100644 index 0000000..10732bb --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/GameRenderer.kt @@ -0,0 +1,42 @@ +package com.ea.ironmonkey + +import android.opengl.GLSurfaceView +import javax.microedition.khronos.egl.EGLConfig +import javax.microedition.khronos.opengles.GL10 + +//TODO Это тоже рендеринг +class GameRenderer(private val activity: GameActivity) : GLSurfaceView.Renderer { + var height = 0 + private set + var width = 0 + private set + private var drawFrameListener: DrawFrameListener? = null + override fun onDrawFrame(gl10: GL10) { + if (drawFrameListener != null) { + drawFrameListener!!.onDrawFrame(gl10) + } else { + activity.runLoop!!.onRunLoopTick() + } + } + + override fun onSurfaceChanged(gl10: GL10, width: Int, height: Int) { + if (gl10 !== gl) { + activity.nativeSurfaceChanged(gl10, width, height) + gl = gl10 + } + this.width = width + this.height = height + } + + override fun onSurfaceCreated(gl10: GL10, eGLConfig: EGLConfig) { + activity.nativeSurfaceCreated(gl10, eGLConfig) + } + + fun setDrawFrameListener(drawFrameListener2: DrawFrameListener?) { + drawFrameListener = drawFrameListener2 + } + + companion object { + var gl: GL10? = null + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/Log.java b/app/src/main/java/com/ea/ironmonkey/Log.java new file mode 100644 index 0000000..753ace0 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/Log.java @@ -0,0 +1,45 @@ +package com.ea.ironmonkey; + +public class Log { + private static boolean enable = false; + + public static void d(String str, String str2) { + if (enable) { + android.util.Log.d(str, str2); + } + } + + public static void e(String str, String str2) { + if (enable) { + android.util.Log.e(str, str2); + } + } + + public static void e(String str, String str2, Exception exc) { + if (enable) { + android.util.Log.e(str, str2, exc); + } + } + + public static void i(String str, String str2) { + if (enable) { + android.util.Log.i(str, str2); + } + } + + public static void setEnable(boolean z) { + enable = z; + } + + public static void v(String str, String str2) { + if (enable) { + android.util.Log.v(str, str2); + } + } + + public static void w(String str, String str2) { + if (enable) { + android.util.Log.w(str, str2); + } + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/MogaController.java b/app/src/main/java/com/ea/ironmonkey/MogaController.java new file mode 100644 index 0000000..8693386 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/MogaController.java @@ -0,0 +1,32 @@ +package com.ea.ironmonkey; + +import com.bda.controller.ControllerListener; +import com.bda.controller.KeyEvent; +import com.bda.controller.MotionEvent; +import com.bda.controller.StateEvent; + +public class MogaController implements ControllerListener { + /* access modifiers changed from: package-private */ + public native void nativeOnKeyEvent(KeyEvent keyEvent); + + /* access modifiers changed from: package-private */ + public native void nativeOnMotionEvent(MotionEvent motionEvent); + + /* access modifiers changed from: package-private */ + public native void nativeOnStateEvent(StateEvent stateEvent); + + @Override // com.bda.controller.ControllerListener + public void onKeyEvent(KeyEvent keyEvent) { + nativeOnKeyEvent(keyEvent); + } + + @Override // com.bda.controller.ControllerListener + public void onMotionEvent(MotionEvent motionEvent) { + nativeOnMotionEvent(motionEvent); + } + + @Override // com.bda.controller.ControllerListener + public void onStateEvent(StateEvent stateEvent) { + nativeOnStateEvent(stateEvent); + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/Receiver.java b/app/src/main/java/com/ea/ironmonkey/Receiver.java new file mode 100644 index 0000000..a89302f --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/Receiver.java @@ -0,0 +1,119 @@ +package com.ea.ironmonkey; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import com.ea.easp.TaskLauncher; +import com.ea.games.nfs13_na.C2DMReceiver; +import java.net.URLDecoder; +import java.util.Set; + +public class Receiver extends BroadcastReceiver { + private static final String TAG = "Receiver"; + private TaskLauncher taskLauncher_; + + public Receiver(TaskLauncher taskLauncher) { + Log.i(TAG, "Constuctor()"); + this.taskLauncher_ = taskLauncher; + initC2DMJNI(); + while (!C2DMReceiver.unhandledMessages.isEmpty()) { + handleMessage(C2DMReceiver.unhandledMessages.get(0)); + } + C2DMReceiver.unhandledMessages.clear(); + } + + private void handleError(final String errorID) { + this.taskLauncher_.runInGLThread(new Runnable() { + @Override + public void run() { + Receiver.this.onErrorJNI(errorID); + } + }); + } + + private void handleMessage(final Bundle messageParts) { + C2DMReceiver.unhandledMessages.remove(messageParts); + this.taskLauncher_.runInGLThread(new Runnable() { + @Override + public void run() { + String str; + if (messageParts != null) { + Set keySet = messageParts.keySet(); + Receiver.this.onMessagePartsCountJNI(messageParts.size()); + for (String str2 : keySet) { + try { + str = URLDecoder.decode(messageParts.getString(str2), "UTF-8"); + } catch (Exception e) { + str = ""; + Log.w(Receiver.TAG, "Receiver ERROR in DECODING the message"); + } + Receiver.this.onMessagePartJNI(str2, str); + } + return; + } + Log.w(Receiver.TAG, "C2DM MESSAGE HAS NO EXTRAS"); + } + }); + } + + private void handleRegistrationID(final String registrationID) { + this.taskLauncher_.runInGLThread(new Runnable() { + @Override + public void run() { + Receiver.this.onRegisterJNI(registrationID); + } + }); + } + + private native void initC2DMJNI(); + + /* access modifiers changed from: private */ + /* access modifiers changed from: public */ + private native void onErrorJNI(String str); + + /* access modifiers changed from: private */ + /* access modifiers changed from: public */ + private native void onMessagePartJNI(String str, String str2); + + /* access modifiers changed from: private */ + /* access modifiers changed from: public */ + private native void onMessagePartsCountJNI(int i); + + /* access modifiers changed from: private */ + /* access modifiers changed from: public */ + private native void onRegisterJNI(String str); + + /* access modifiers changed from: private */ + /* access modifiers changed from: public */ + private native void onUnRegisterJNI(); + + private native void shutdownC2DMJNI(); + + public void onDestroy() { + shutdownC2DMJNI(); + } + + public void onReceive(Context context, Intent intent) { + Log.i(TAG, "onReceive()..." + intent.getAction()); + String action = intent.getAction(); + if (C2DMConstants.ACTION_REGISTER.equals(action)) { + handleRegistrationID(intent.getStringExtra(C2DMConstants.EXTRA_REGISTRATION_ID)); + } else if (C2DMConstants.ACTION_UNREGISTER.equals(action)) { + this.taskLauncher_.runInGLThread(new Runnable() { + /* class com.ea.ironmonkey.Receiver.AnonymousClass1 */ + + public void run() { + Receiver.this.onUnRegisterJNI(); + } + }); + } else if (C2DMConstants.ACTION_MESSAGE.equals(action)) { + handleMessage(intent.getExtras()); + } else if (C2DMConstants.ACTION_ERROR.equals(action)) { + handleError(intent.getStringExtra(C2DMConstants.EXTRA_ERROR_ID)); + } else { + Log.w(TAG, "unexpected action: " + action); + } + Log.i(TAG, "...onReceive()"); + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/RunLoop.java b/app/src/main/java/com/ea/ironmonkey/RunLoop.java new file mode 100644 index 0000000..f9e48ef --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/RunLoop.java @@ -0,0 +1,48 @@ +package com.ea.ironmonkey; + +import android.opengl.GLSurfaceView; + +public class RunLoop { + public static final int STATE_RUNNING = 1; + public static final int STATE_STOPPED = 0; + private GLSurfaceView glSurfaceView; + private int state; + + public RunLoop(GLSurfaceView gLSurfaceView) { + this.glSurfaceView = gLSurfaceView; + updateRenderMode(); + } + + private native void nativeOnRunLoopTick(); + + private void setState(int i) { + this.state = i; + updateRenderMode(); + } + + private void updateRenderMode() { + Log.v("RunLoop", "RunLoop.state = " + this.state); + if(state == STATE_STOPPED) glSurfaceView.setRenderMode(STATE_STOPPED); + if(state == STATE_RUNNING) glSurfaceView.setRenderMode(STATE_RUNNING); + } + + public int getState() { + return this.state; + } + + public void join() { + setState(STATE_STOPPED); + } + + public void onRunLoopTick() { + if (state == STATE_RUNNING) nativeOnRunLoopTick(); + } + + public void start() { + setState(STATE_RUNNING); + } + + public void stop() { + setState(STATE_STOPPED); + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/SplashScreen.java b/app/src/main/java/com/ea/ironmonkey/SplashScreen.java new file mode 100644 index 0000000..991ce51 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/SplashScreen.java @@ -0,0 +1,177 @@ +package com.ea.ironmonkey; + +import android.app.Activity; +import android.graphics.Bitmap; +import android.graphics.BitmapFactory; +import android.opengl.GLES20; +import android.opengl.GLUtils; +import java.nio.Buffer; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.FloatBuffer; +import javax.microedition.khronos.opengles.GL10; + +public class SplashScreen { + private static final String TAG = "SplashScreen"; + private static final int floatSize = 4; + private Activity _activity; + private int _attPosition; + private int _attSampler; + private int _attTexCoord; + private int _fragmentShader; + private int _program; + private int[] _textureId; + private int _vertexShader; + + private final String fShaderStr = + "precision highp float; " + + "varying vec2 v_texCoord;" + + "uniform sampler2D s_texture;"+ + "void main(){" + + " gl_FragColor = texture2D( s_texture, v_texCoord );" + + "}"; + + 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"; + + public SplashScreen(Activity activity) { + this._activity = activity; + this._textureId = new int[1]; + } + + 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"); + 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; + } + Log.e(TAG, "LoadShader(" + i + ", " + str + ") - compile shader fail\n"); + GLES20.glDeleteShader(glCreateShader); + Log.e(TAG, GLES20.glGetShaderInfoLog(glCreateShader)); + return 0; + } + + 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"); + 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; + 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"); + return true; + } + + public void destroy(GL10 gl10) { + if (this._textureId[0] != 0) { + GLES20.glDeleteTextures(1, this._textureId, 0); + this._textureId[0] = 0; + } + if (this._program != 0) { + GLES20.glDeleteProgram(this._program); + this._program = 0; + } + if (this._vertexShader != 0) { + GLES20.glDeleteShader(this._vertexShader); + this._vertexShader = 0; + } + if (this._fragmentShader != 0) { + GLES20.glDeleteShader(this._fragmentShader); + this._fragmentShader = 0; + } + if (this.vBuffer != null) { + this.vBuffer.clear(); + this.vBuffer = null; + } + } + + public boolean draw(GL10 gl10, int i, int i2) { + float f; + if (this._textureId[0] == 0) { + return false; + } + float f2 = 0.8f; + if (i > i2) { + f = (((float) i2) / ((float) i)) * 0.8f; + } else { + f2 = 0.8f * (((float) i) / ((float) i2)); + f = 0.8f; + } + float[][] fArr = {new float[]{-f, -f2, 0.0f, 1.0f, f, -f2, 1.0f, 1.0f, -f, f2, 0.0f, 0.0f, f, f2, 1.0f, 0.0f}, new float[]{-f, -f2, 1.0f, 1.0f, f, -f2, 1.0f, 0.0f, -f, f2, 0.0f, 1.0f, f, f2, 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(GLES20.GL_TEXTURE_2D); + GLES20.glActiveTexture(33984); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 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); + return true; + } + + public void init(GL10 gl10, int i, int i2) { + if (!initRenderer()) { + destroy(gl10); + return; + } + GLES20.glGetError(); + GLES20.glGenTextures(1, this._textureId, 0); + GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, this._textureId[0]); + + BitmapFactory.Options options = new BitmapFactory.Options(); + options.inPreferredConfig = Bitmap.Config.ARGB_4444; + Bitmap bitmap = null; + try { + bitmap = BitmapFactory.decodeStream(this._activity.getAssets().open("splash.png"), null, options); + } catch (Exception e) { + Log.e(TAG, "loadBitmap ", e); + } + GLUtils.texImage2D(GLES20.GL_TEXTURE_2D, 0, bitmap, 0); + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR); + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR); + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); + GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); + bitmap.recycle(); + int glGetError = GLES20.glGetError(); + if (glGetError != 0) { + Log.e(TAG, "Texture Load GLError: " + glGetError); + destroy(gl10); + } + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/WebActivity.java b/app/src/main/java/com/ea/ironmonkey/WebActivity.java new file mode 100644 index 0000000..3daf17f --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/WebActivity.java @@ -0,0 +1,153 @@ +package com.ea.ironmonkey; + +import android.annotation.SuppressLint; +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_na.R; +import java.util.Locale; + +public class WebActivity extends Activity { + public static String m_Language; + private static volatile Runnable m_RunnableBuildAndShowHTML = null; + public static String m_URL; + public static boolean m_bWorkingState = false; + private Bitmap backButton; + private Bitmap backButtonPressed; + private ImageView backImage; + private String m_PageURL = null; + private ProgressBar m_progressBar = null; + final Handler progressHandler = new Handler() { + /* class com.ea.ironmonkey.WebActivity.AnonymousClass1 */ + + public void handleMessage(Message message) { + WebActivity.this.setProgress(message.arg1); + WebActivity.this.m_progressBar.setProgress(message.arg1); + } + }; + private WebView webview; + + /* access modifiers changed from: private */ + /* access modifiers changed from: public */ + private void BuildAndShowHTML() { + if (this.m_PageURL != null) { + this.webview.loadUrl(this.m_PageURL); + } + } + + 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() { + /* class com.ea.ironmonkey.WebActivity.AnonymousClass2 */ + + @SuppressLint("ClickableViewAccessibility") + public boolean onTouch(View view, MotionEvent motionEvent) { + if (motionEvent.getAction() == 0) { + WebActivity.this.backImage.setImageBitmap(WebActivity.this.backButtonPressed); + return false; + } else if (motionEvent.getAction() != 1) { + return false; + } else { + WebActivity.this.backImage.setImageBitmap(WebActivity.this.backButton); + return false; + } + } + }); + this.backImage.setOnClickListener(new View.OnClickListener() { + /* class com.ea.ironmonkey.WebActivity.AnonymousClass3 */ + + 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 th) { + } + } + this.webview.setWebChromeClient(new WebChromeClient() { + /* class com.ea.ironmonkey.WebActivity.AnonymousClass4 */ + + 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() { + /* class com.ea.ironmonkey.WebActivity.AnonymousClass5 */ + + public void onPageFinished(WebView webView, String str) { + WebActivity.this.m_progressBar.setVisibility(8); + } + + public void onReceivedError(WebView webView, int i, String str, String str2) { + Toast.makeText(WebActivity.this, "Error ! " + str, 0).show(); + } + }); + m_RunnableBuildAndShowHTML = new Runnable() { + /* class com.ea.ironmonkey.WebActivity.AnonymousClass6 */ + + public void run() { + WebActivity.this.BuildAndShowHTML(); + } + }; + runOnUiThread(m_RunnableBuildAndShowHTML); + } + + public boolean onKeyDown(int i, KeyEvent keyEvent) { + if (i != 4) { + return super.onKeyDown(i, keyEvent); + } + this.backImage.setImageBitmap(this.backButtonPressed); + return true; + } + + public boolean onKeyUp(int i, KeyEvent keyEvent) { + if (i != 4) { + return super.onKeyUp(i, keyEvent); + } + this.backImage.setImageBitmap(this.backButton); + m_bWorkingState = false; + finish(); + return true; + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/FileAdapter.java b/app/src/main/java/com/ea/ironmonkey/devmenu/FileAdapter.java new file mode 100644 index 0000000..99c4d32 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/FileAdapter.java @@ -0,0 +1,65 @@ +package com.ea.ironmonkey.devmenu; + +import static com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper.MAIN_TABLE_NAME; +import static com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper.PATH_TO_REPLACED_ELEMENT; + +import android.content.Context; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ArrayAdapter; +import android.widget.TextView; +import android.widget.TwoLineListItem; + +import com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper; +import com.ea.ironmonkey.devmenu.util.UtilitiesAndData; + +import java.io.File; +import java.util.List; + +class FileAdapter extends ArrayAdapter { + + private static int count = 0; + private List files; + private Context context; + private ReplacementDataBaseHelper dataBaseHelper; + private SQLiteDatabase database; + + public FileAdapter(Context context, List files) { + super(context, android.R.layout.simple_list_item_2, files); + dataBaseHelper = new ReplacementDataBaseHelper(context); + database = dataBaseHelper.getDatabase(); + this.context = context; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + + View view; + LayoutInflater inflater = (LayoutInflater) context.getSystemService( Context.LAYOUT_INFLATER_SERVICE ); + String name = getItem(position).getName(); + + Cursor query = database.query(MAIN_TABLE_NAME, new String[]{PATH_TO_REPLACED_ELEMENT}, + PATH_TO_REPLACED_ELEMENT + " = \"" + getItem(position).getAbsolutePath() + "\"" + , null, null, null, null); + + if (query.getCount() > 0) { + TwoLineListItem listItem = (TwoLineListItem) inflater.inflate(android.R.layout.simple_list_item_2, null, true); + listItem.getText1().setText(name); + listItem.getText2().setText("Заменен"); + view = listItem; + } else { + TextView textView = (TextView) inflater.inflate(android.R.layout.simple_list_item_1, null, true); + textView.setText(name); + view = textView; + } + query.close(); + return view; + } + + public List getFiles() { + return files; + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/MainActivity.java b/app/src/main/java/com/ea/ironmonkey/devmenu/MainActivity.java new file mode 100644 index 0000000..be36ee7 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/MainActivity.java @@ -0,0 +1,458 @@ +package com.ea.ironmonkey.devmenu; + +import static com.ea.ironmonkey.devmenu.util.UtilitiesAndData.OPEN_FILE_ON_REPLACE_REQUEST; +import static com.ea.ironmonkey.devmenu.util.UtilitiesAndData.copy; +import static com.ea.ironmonkey.devmenu.util.UtilitiesAndData.generateMD5; +import static com.ea.ironmonkey.devmenu.util.UtilitiesAndData.isFirstRun; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Intent; +import android.content.SharedPreferences; +import android.net.Uri; +import android.os.Bundle; +import android.os.Environment; +import android.preference.PreferenceManager; +import android.util.Log; +import android.view.Menu; +import android.view.MenuItem; +import android.widget.Button; +import android.widget.ListView; +import android.widget.RadioGroup; +import android.widget.TextView; +import android.widget.TwoLineListItem; + +import com.ea.games.nfs13_na.BuildConfig; +import com.ea.games.nfs13_na.R; +import com.ea.ironmonkey.GameActivity; +import com.ea.ironmonkey.devmenu.components.LongPressContextMenu; +import com.ea.ironmonkey.devmenu.util.ResultListener; +import com.ea.ironmonkey.devmenu.util.UtilitiesAndData; +import com.ea.nimble.Utility; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Random; + +//TODO сделать нормальный файл сохранения +//TODO сделать его нрмальное отображние + +//TODO сделать нормальное отслеживние файлов сохранений +//TODO сдлеать настройки отслеживания файла +//TODO сделать отображение текущего пути в проводнике +//TODO добавить иконки к проводику +//TODO сделать динамическое контекстное меню файла + +//TODO реализовать сохранение файлов в память телефона из внутреннего хранилища +public class MainActivity extends Activity{ + + private final String LOG_TAG = "InjectedActivity"; + + private String internalFiles; + private String externalFiles; + private ResultListener resultListener; + private ResultListener openResult = new ResultListener() {}; + private static Thread observerThread; + private String globalPath = ""; + private ListView fileList; + private Button backButton; + private static final int READ_FILE_REQUEST_CODE = 101; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + UtilitiesAndData.init(this); + internalFiles = UtilitiesAndData.getInternalStorage(); + externalFiles = UtilitiesAndData.getExternalStorage(); + + File replacements = new File(UtilitiesAndData.getReplacementsStorage()); + if(!replacements.exists()) replacements.mkdir(); + + File activityFlag = new File(externalFiles + File.separator + BuildConfig.DEV_MENU_ID); + // TODO доделать проверку первого запуска + if(isFirstRun()){ + File data = new File(UtilitiesAndData.getExternalStorage()); + if(!data.exists()){ + + File data1 = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/data/" + getPackageName() + "_"); + if(data1.exists()) { + String path = data1.getPath(); + data1.renameTo(new File(path.substring(0, path.length() - 2))); + activityFlag = data1; + } + } + try { + File temp = new File(UtilitiesAndData.getInternalStorage() + File.separator + "load"); + temp.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + if(!activityFlag.exists()){ + updateLanguage(); + runGame(); + return; + } + + setContentView(R.layout.custom); + + + String title = String.format(getString(R.string.dev_menu_title), /*BuildConfig.DEV_MENU_VERSION*/""); + + getActionBar().setTitle(title); + + fileList = (ListView) findViewById(R.id.FileList); + + fileList.setAdapter(new FileAdapter(this, asList(externalFiles))); + globalPath = externalFiles; + + RadioGroup group = (RadioGroup) findViewById(R.id.switcherFiles); + + fileList.setOnItemClickListener((parent, view, position, id) -> { + String chosenElem = + (view instanceof TwoLineListItem) ? + ((TwoLineListItem) view).getText1().getText().toString() : + ((TextView) view).getText().toString(); // получаем текст нажатого элемента + + File intermid = new File(globalPath + "/" + chosenElem); + if(intermid.isDirectory()) { + globalPath += "/" + chosenElem; + updateListView(); + } + else{ + openFile(intermid); + } + + }); + + fileList.setOnItemLongClickListener((parent, view, position, id) -> { + String chosenElem = + (view instanceof TwoLineListItem) ? + ((TwoLineListItem) view).getText1().getText().toString() : + ((TextView) view).getText().toString(); + + + LongPressContextMenu ninja = new LongPressContextMenu(this, globalPath + "/" + chosenElem); + return true; + }); + + group.setOnCheckedChangeListener((group1, checkedId) -> { + globalPath = (checkedId == R.id.externalStoreButton) ? externalFiles : internalFiles; + updateListView(); + }); + + backButton = (Button)findViewById(R.id.back_button); + + backButton.setOnClickListener(v -> { + if(!( globalPath.equals(internalFiles) | globalPath.equals(externalFiles) ) + & !globalPath.isEmpty() + & (new File(globalPath).exists())) { + globalPath = globalPath.substring(0, globalPath.lastIndexOf("/")); + updateListView(); + } + }); + + + //Настройка языка игры + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); + + } + + public void readAndSortNumbersFromFile(String fileName) { + List numbersList = new ArrayList<>(); + + try { + File file = new File(fileName); + BufferedReader bufferedReader = new BufferedReader(new FileReader(file)); + String line; + + while ((line = bufferedReader.readLine()) != null) { + try { + // Попытайтесь преобразовать строку в целое число и добавить его в список + int number = Integer.parseInt(line); + numbersList.add(number); + } catch (NumberFormatException e) { + // Если строка не является числом, проигнорируйте ее + Log.e("FileOperations", "Ошибка при чтении числа: " + line); + } + } + + bufferedReader.close(); + + // Отсортируйте числа в списке + Collections.sort(numbersList); + + } catch (IOException e) { + Log.e("Time", "Ошибка при чтении файла: " + e.getMessage()); + } + } + + @Override + public void onBackPressed() { + backButton.callOnClick(); + } + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + getMenuInflater().inflate(R.menu.options, menu); + return true; + } + + @Override + protected void onDestroy() { + super.onDestroy(); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + + switch (requestCode){ + case OPEN_FILE_ON_REPLACE_REQUEST:{ + resultListener.onResult(data); + }break; + + case READ_FILE_REQUEST_CODE:{ + openResult.onResult(data); + } + } + + } + + @SuppressLint("NonConstantResourceId") + @Override + public boolean onOptionsItemSelected(MenuItem item) { + + int itemId = item.getItemId(); + if (itemId == R.id.optionRunTheGame) { + updateLanguage(); + runGame(); + } else if (itemId == R.id.optionSettings) { + Intent goToSettings = new Intent(this, SettingsActivity.class); + startActivity(goToSettings); + } else if (itemId == R.id.optionDeleteData) { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(getString(R.string.remove_action_title)); + builder.setMessage(getString(R.string.sure_remove_all_data_title)); + builder.setPositiveButton(R.string.ok_title, (dialogInterface, i) -> { + File[] internals = new File(UtilitiesAndData.getInternalStorage()).listFiles(); + for (File internal : internals) { + if (!UtilitiesAndData.isExclusionName(internal.getName())) { + internal.delete(); + } + } + }); + builder.setNegativeButton(R.string.cancel_title, null); + builder.show(); + } else if (itemId == R.id.optionCheckRecovers) { + Intent goToRecovers = new Intent(this, RecoverListActivity.class); + startActivity(goToRecovers); + } + + return super.onOptionsItemSelected(item); + } + + public void openFile(File url) { + File tempFile = null; + Intent intent = new Intent(Intent.ACTION_VIEW); + + if(url.getAbsolutePath().contains(UtilitiesAndData.getInternalStorage())){ + Log.wtf(LOG_TAG, "WTF, man, you cant read my files!!!"); + + //Создаем временный файл, там где можем его прочитать + Random random = new Random(); + tempFile = new File(UtilitiesAndData.getExternalStorage() + File.separator + "temp_" + random.nextInt()); + + //Копируем тот файл который хотим посмотреть + copy(url.getAbsolutePath(), tempFile.getAbsolutePath()); + + //Сохраняем ссылку на окрытый файл, в случае его изменения + final File openedFile = url; + url = tempFile; + File finalTempFile = tempFile; + + //Создаем хеш файла для того чтобы его потом сравнить + final byte[] compTemp = generateMD5(finalTempFile); + + openResult = new ResultListener(){ + @Override + public void onResult(Object data) { + byte[] bytes = generateMD5(finalTempFile); + //Если хеши не одинаковы то заменяем одно на другое + if(!Arrays.equals(bytes, compTemp)) + copy(finalTempFile.getAbsolutePath(), openedFile.getAbsolutePath()); + finalTempFile.delete(); + } + }; + intent.putExtra("pathToTemp", tempFile.getAbsolutePath()); + } + // Create URI + Uri uri = Uri.fromFile(url); + + if (url.toString().contains(".doc") || url.toString().contains(".docx")) + intent.setDataAndType(uri, "application/msword"); + else if(url.toString().contains(".pdf")) { + intent.setDataAndType(uri, "application/pdf"); + } else if(url.toString().contains(".ppt") || url.toString().contains(".pptx")) { + intent.setDataAndType(uri, "application/vnd.ms-powerpoint"); + } else if(url.toString().contains(".xls") || url.toString().contains(".xlsx")) { + intent.setDataAndType(uri, "application/vnd.ms-excel"); + } else if(url.toString().contains(".zip") || url.toString().contains(".rar")) { + intent.setDataAndType(uri, "application/x-wav"); + } else if(url.toString().contains(".rtf")) { + intent.setDataAndType(uri, "application/rtf"); + } else if(url.toString().contains(".wav") || url.toString().contains(".mp3")) { + intent.setDataAndType(uri, "audio/x-wav"); + } else if(url.toString().contains(".gif")) { + intent.setDataAndType(uri, "image/gif"); + } else if(url.toString().contains(".jpg") || url.toString().contains(".jpeg") || url.toString().contains(".png")) { + intent.setDataAndType(uri, "image/jpeg"); + } else if(url.toString().contains(".txt")) { + intent.setDataAndType(uri, "text/plain"); + } else if(url.toString().contains(".3gp") || url.toString().contains(".mpg") || url.toString().contains(".mpeg") || url.toString().contains(".mpe") || url.toString().contains(".mp4") || url.toString().contains(".avi")) { + intent.setDataAndType(uri, "video/*"); + } else { + intent.setDataAndType(uri, "*/*"); + } + + //intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivityForResult(intent, READ_FILE_REQUEST_CODE); + + } + + private void runGame() { + + Intent GoToGame = new Intent(this, GameActivity.class); + startActivity(GoToGame); + + } + + // TODO Сделать номальную систему учета измения файлов + public static void observ(){ + File save = new File(UtilitiesAndData.getInternalStorage() + File.separator + "files/var/nfstr_save.sb"); + File fileOut = new File(UtilitiesAndData.getExternalStorage() + File.separator + "Log.txt"); + File pathToSave = new File(UtilitiesAndData.getExternalStorage() + File.separator + "saves"); + pathToSave.mkdir(); + if(!fileOut.exists()) { + try { + fileOut.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + } + SimpleDateFormat format = new SimpleDateFormat("yyyy.MM.dd HH:mm:ss", Locale.getDefault()); + UtilitiesAndData.setLogger(fileOut); + observerThread = new Thread(() -> { + int count = 1; + byte[] lastMD5 = new byte[10]; + while (true){ + byte[] md5 = generateMD5(save); + if(!Arrays.equals(md5, lastMD5)) { + UtilitiesAndData.printLog(format.format(new Date()) + " | " + Utility.bytesToHexString(md5) + "\n"); + File change = new File(pathToSave.getAbsolutePath() + File.separator + "nfs_save_change_"+ count +".sb"); + try { + change.createNewFile(); + copy(save, change); + } catch (IOException e) { + e.printStackTrace(); + } + } + lastMD5 = md5; + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + count++; + } + }); + observerThread.start(); + } + + private List asList(T[] a){ + return Arrays.asList(a); + } + + // TODO реализовать сокрытие лишних папок + private List asList(String path){ + return asList(new File(path).listFiles()); + } + + private void updateLanguage(){ + //Получаем текущий язык + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this); + String current_lang = preferences.getString(getString(R.string.current_lang), "00"); + if(current_lang.equals("00")) { + Log.e(LOG_TAG, "Not found currentLang preference("); + return; + } + if(current_lang.equals("sys")) + current_lang = Locale.getDefault().getLanguage(); + + byte[] current_lang_bytes = current_lang.getBytes(); + + //Открываем языковой файл и создаем поток чтения + File locale = new File(internalFiles + "/files/var/locale"); + FileInputStream inputStream; + + //Байтовое представление файла + byte[] bytes_locale = new byte[4]; + try { + + inputStream = new FileInputStream(locale); + inputStream.read(bytes_locale); + + } catch (FileNotFoundException e) { + Log.wtf(LOG_TAG, "No found locale((((("); + return; + }catch (IOException e){ + Log.wtf(LOG_TAG, "Couldn't read the locale file(((((("); + return; + } + try { + if ( + bytes_locale[2] != current_lang_bytes[0] & + bytes_locale[3] != current_lang_bytes[1] + ) { + bytes_locale[2] = current_lang_bytes[0]; + bytes_locale[3] = current_lang_bytes[1]; + } else return; + }catch (Exception e){ + return; + } + + FileOutputStream outputStream; + try { + outputStream = new FileOutputStream(locale, false); + outputStream.write(bytes_locale, 0, 4); + } catch (FileNotFoundException e) { + e.printStackTrace(); + }catch (IOException e){ + e.printStackTrace(); + } + + } + + public void setResultListener(ResultListener resultListener) { + this.resultListener = resultListener; + } + + public void updateListView(){ + fileList.setAdapter(new FileAdapter(getApplicationContext(), asList(globalPath))); + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/PuppetActivity.java b/app/src/main/java/com/ea/ironmonkey/devmenu/PuppetActivity.java new file mode 100644 index 0000000..c27e580 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/PuppetActivity.java @@ -0,0 +1,72 @@ +package com.ea.ironmonkey.devmenu; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +import com.ea.nimble.ApplicationLifecycle; + +//Активность-марионетка для проверки работы нативных методов жизненного цикла +public class PuppetActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + ApplicationLifecycle.onActivityCreate(savedInstanceState, this); + } + + @Override + protected void onResume() { + super.onResume(); + ApplicationLifecycle.onActivityResume(this); + } + + @Override + protected void onStart() { + super.onStart(); + ApplicationLifecycle.onActivityStart(this); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + ApplicationLifecycle.onActivityDestroy(this); + } + + @Override + public void onBackPressed() { + super.onBackPressed(); + ApplicationLifecycle.onBackPressed(); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + ApplicationLifecycle.onActivityResult(resultCode, requestCode, data, this); + } + + @Override + protected void onPause() { + super.onPause(); + ApplicationLifecycle.onActivityPause(this); + } + + @Override + protected void onRestart() { + super.onRestart(); + ApplicationLifecycle.onActivityRestart(this); + } + + @Override + protected void onStop() { + super.onStop(); + ApplicationLifecycle.onActivityStop(this); + } + + @Override + protected void onRestoreInstanceState(Bundle savedInstanceState) { + super.onRestoreInstanceState(savedInstanceState); + ApplicationLifecycle.onActivityRestoreInstanceState(savedInstanceState, this); + } + +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/RecoverListActivity.java b/app/src/main/java/com/ea/ironmonkey/devmenu/RecoverListActivity.java new file mode 100644 index 0000000..e745ba5 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/RecoverListActivity.java @@ -0,0 +1,91 @@ +package com.ea.ironmonkey.devmenu; + +import android.app.Activity; +import android.app.AlertDialog; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.os.Bundle; +import androidx.annotation.Nullable; +import android.widget.ArrayAdapter; +import android.widget.ListView; +import android.widget.TextView; + +import com.ea.games.nfs13_na.R; +import com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper; +import com.ea.ironmonkey.devmenu.util.UtilitiesAndData; + +import java.util.ArrayList; + +public class RecoverListActivity extends Activity { + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + boolean flag = true; + + getActionBar().setTitle(R.string.recover_file_title); + + ListView view = new ListView(this); + + SQLiteDatabase database = new ReplacementDataBaseHelper(this).getDatabase(); + + Cursor cursor = database.rawQuery("SELECT " + ReplacementDataBaseHelper.PATH_TO_REPLACED_ELEMENT + " FROM " + ReplacementDataBaseHelper.MAIN_TABLE_NAME, null); + + ArrayList arrayList = new ArrayList<>(); + + ArrayList fullNames = new ArrayList<>(); + ArrayList shortNames = new ArrayList<>(); + + while (cursor.moveToNext()) { + String string = cursor.getString(0); + fullNames.add(string); + int from = string.lastIndexOf("/files/"); + shortNames.add(string.substring(from)); + } + if(fullNames.isEmpty()){ + shortNames.add("Не чего заменять!!"); + flag = false; + } + boolean thereIsSmthToRecover = flag; + + ArrayAdapter adapter; + + view.setOnItemClickListener((parent, view1, position, id) -> { + if(thereIsSmthToRecover){ + + TextView textView = (TextView) view1; + String s = textView.getText().toString(); + + AlertDialog.Builder dialog = new AlertDialog.Builder(this); + + //TODO сделать нормальные строки + dialog.setTitle("Воостановить?"); + + dialog.setPositiveButton(R.string.ok_title, (dialog1, which) -> { + shortNames.remove(s); + view.setAdapter(new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, shortNames)); + String fullName = fullNames.get(position); + fullNames.remove(fullName); + UtilitiesAndData.recoverFile(fullName); + //System.out.println(); + //TODO Сделать воостановление + }); + + dialog.setNegativeButton(R.string.cancel_title, (dialog1, which) -> { + + }); + + dialog.show(); + } + }); + + adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, shortNames); + + view.setAdapter(adapter); + + setContentView(view); + cursor.close(); + + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/SettingsActivity.java b/app/src/main/java/com/ea/ironmonkey/devmenu/SettingsActivity.java new file mode 100644 index 0000000..9b1f21a --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/SettingsActivity.java @@ -0,0 +1,136 @@ +package com.ea.ironmonkey.devmenu; + +import android.annotation.TargetApi; +import android.app.AlertDialog; +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.view.MenuItem; + +import com.ea.games.nfs13_na.BuildConfig; +import com.ea.games.nfs13_na.R; +import com.ea.ironmonkey.devmenu.dialog.OpenFileDialog; +import com.ea.ironmonkey.devmenu.util.SaveManager; +import com.ea.ironmonkey.devmenu.dialog.SvmwCreatorDialog; +import com.ea.ironmonkey.devmenu.dialog.SvmwInspectorDialog; +import com.ea.ironmonkey.devmenu.util.UtilitiesAndData; +import com.ea.nimble.ApplicationLifecycle; + +import java.io.File; + +public class SettingsActivity extends PreferenceActivity { + + public static final String LOG_TAG = "SettingActivity"; + + private static final int PICKFILE_REQUEST_CODE = 128; + public static final int PICK_SVMW_REQUEST_CODE = 129; + public static final int PICK_SVMW_IN_CREATE = 228; + + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + addPreferencesFromResource(R.xml.settings_xml); + + ApplicationLifecycle.onActivityCreate(savedInstanceState, this); + + String title = String.format(getString(R.string.dev_menu_title), BuildConfig.DEV_MENU_VERSION); + getActionBar().setTitle(title); + + Preference chooseSaveFileButton = findPreference(getString(R.string.choose_save_file_title)); + Preference chooseSVMWfileButton = findPreference(getString(R.string.choose_svmw_file_title)); + Preference createSVMWfileButton = findPreference(getString(R.string.create_svmw_file_title)); + Preference turnOffTheDevMenuButton = findPreference(getString(R.string.switch_off_devmenu_title)); + + final Context myContext = this; + + turnOffTheDevMenuButton.setOnPreferenceClickListener(preference -> { + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setTitle(R.string.switch_off_devmenu_title); + builder.setMessage(R.string.msg_devmenu_off); + builder.setPositiveButton(R.string.ok_title, (dialog, which) -> UtilitiesAndData.getDevMenuSwitcher().delete()); + builder.setNegativeButton(R.string.cancel_title, null); + builder.show(); + return true; + }); + + chooseSaveFileButton.setOnPreferenceClickListener(preference -> { + + OpenFileDialog fileDialog = new OpenFileDialog(myContext); + fileDialog + .setFilter(".*\\.sb") + .setOpenDialogListener(fileName -> { + + File save = new File(fileName); + SaveManager manager = new SaveManager(this); + manager.loadSaveFile(save); + + }); + + fileDialog.show(); + + return true; + }); + + chooseSVMWfileButton.setOnPreferenceClickListener(preference -> { + + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.setType("file/*"); + startActivityForResult(intent, PICK_SVMW_REQUEST_CODE); + //TODO реализовать выбор svmw + return true; + }); + + //По нажатии на кнопку создания svmw файла осуществляется переход в диалог создания svmw + createSVMWfileButton.setOnPreferenceClickListener(preference -> { + + SvmwCreatorDialog dialog = new SvmwCreatorDialog(this); + dialog.show(); + + return true; + }); + + + + getActionBar().setDisplayHomeAsUpEnabled(true); + + + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if(data != null) { + switch (requestCode) { + case PICKFILE_REQUEST_CODE: { + String s = data.getData().toString(); + String s1 = s.replaceAll("file://", ""); + File file = new File(s1); + } + break; + case PICK_SVMW_REQUEST_CODE: { + String s = data.getData().toString(); + String s1 = s.replaceAll("file://", ""); + File file = new File(s1); + SvmwInspectorDialog inspectorDialog = new SvmwInspectorDialog(this, file); + inspectorDialog.show(); + } + break; + } + + } + } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + if (item.getItemId() == android.R.id.home) { + onBackPressed(); + return true; + } + return super.onOptionsItemSelected(item); + } + +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/components/DynamicOptionsListView.java b/app/src/main/java/com/ea/ironmonkey/devmenu/components/DynamicOptionsListView.java new file mode 100644 index 0000000..04e534f --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/components/DynamicOptionsListView.java @@ -0,0 +1,60 @@ +package com.ea.ironmonkey.devmenu.components; + +import android.content.Context; +import android.util.Log; +import android.widget.ArrayAdapter; +import android.widget.ListView; +import android.widget.TextView; + +import java.util.ArrayList; +import java.util.List; + +/** Динамический список для контекстного меню файла LongPressContextMenu */ +public class DynamicOptionsListView extends ListView { + + /** Названия позиций в контекстном меню */ + private List names = new ArrayList<>(); + private List actions = new ArrayList<>(); + private Context context; + + public DynamicOptionsListView(Context context) { + super(context); + this.context = context; + updateList(); + setOnItemClickListener((parent, view, position, id) -> { + try { + actions.get(position).action(); + }catch (IndexOutOfBoundsException e){ + Log.i("DynamicListView", "No found action to do( in position " + position); + } + }); + } + + private void updateList(){ + setAdapter( + new ArrayAdapter<>( + context, + android.R.layout.simple_list_item_1, + names + )); + } + + public void addOption(String title, OptionAction action){ + names.add(title); + actions.add(action); + updateList(); + } + + public void deleteOption(String title){ + boolean removeInt = names.remove(title); + actions.remove(removeInt); + updateList(); + } + + public String deleteOption(int position){ + String result = names.remove(position); + actions.remove(position); + updateList(); + return result; + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/components/FileAction.java b/app/src/main/java/com/ea/ironmonkey/devmenu/components/FileAction.java new file mode 100644 index 0000000..84f903b --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/components/FileAction.java @@ -0,0 +1,17 @@ +package com.ea.ironmonkey.devmenu.components; + +public interface FileAction { + + void actionReplaceFile(); + + void actionRecoverFile(); + + void actionRemoveFile(); + + void actionTrackTheFile(); + + void actionGetPropsOfFile(); + + void actionHideTheFile(); + //sfhsadfhsdjf +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/components/LongPressContextMenu.java b/app/src/main/java/com/ea/ironmonkey/devmenu/components/LongPressContextMenu.java new file mode 100644 index 0000000..2cbb72c --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/components/LongPressContextMenu.java @@ -0,0 +1,205 @@ +package com.ea.ironmonkey.devmenu.components; + +import static com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper.MAIN_TABLE_NAME; +import static com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper.NAME_OF_BACKUPED_ELEMENT; +import static com.ea.ironmonkey.devmenu.util.UtilitiesAndData.OPEN_FILE_ON_REPLACE_REQUEST; +import static com.ea.ironmonkey.devmenu.util.UtilitiesAndData.copy; +import static com.ea.ironmonkey.devmenu.util.UtilitiesAndData.getFileSize; + +import android.app.AlertDialog; +import android.content.ContentValues; +import android.content.Intent; +import android.database.sqlite.SQLiteDatabase; +import android.widget.Toast; + +import com.ea.games.nfs13_na.R; +import com.ea.ironmonkey.devmenu.MainActivity; +import com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper; +import com.ea.ironmonkey.devmenu.util.ResultListener; +import com.ea.ironmonkey.devmenu.util.UtilitiesAndData; + +import java.io.File; +import java.io.IOException; +import java.text.CharacterIterator; +import java.text.SimpleDateFormat; +import java.text.StringCharacterIterator; +import java.util.Date; +import java.util.Random; + +/** + * Контекстное меню управления данными + */ +public class LongPressContextMenu extends AlertDialog.Builder implements FileAction { + + private File chosenFile; + private MainActivity activity; + private static final String LOG_TAG = "LongPressContextMenu"; + + private AlertDialog show; + private ReplacementDataBaseHelper dataBaseHelper; + private SQLiteDatabase writableDatabase; + private ContentValues values; + + private File generateReplacementFile(){ + Random random = new Random(); + int index = random.nextInt(); + index = (index < 0) ? index * -1 : index; + String nameReplacedOriginal = "replacement_" + index + ""; + File original = new File(UtilitiesAndData.getReplacementsStorage() + File.separator + nameReplacedOriginal); + try { + original.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + return original; + } + + public static String humanReadableByteCountSI(long bytes) { + if (-1000 < bytes && bytes < 1000) { + return bytes + " B"; + } + CharacterIterator ci = new StringCharacterIterator("kMGTPE"); + while (bytes <= -999_950 || bytes >= 999_950) { + bytes /= 1000; + ci.next(); + } + return String.format("%.1f %cB", bytes / 1000.0, ci.current()); + } + + public LongPressContextMenu(MainActivity activity, String pathToChosenElem) { + super(activity); + this.activity = activity; + chosenFile = new File(pathToChosenElem); + DynamicOptionsListView optionsView = new DynamicOptionsListView(activity); + + this.dataBaseHelper = new ReplacementDataBaseHelper(activity); + this.writableDatabase = dataBaseHelper.getDatabase(); + this.values = new ContentValues(); + + optionsView.addOption(activity.getString(R.string.replace_file_title), this::actionReplaceFile); + optionsView.addOption(activity.getString(R.string.recover_file_title), this::actionRecoverFile); + optionsView.addOption(activity.getString(R.string.remove_file_title), this::actionRemoveFile); + optionsView.addOption(activity.getString(R.string.track_file_title), this::actionTrackTheFile); + optionsView.addOption(activity.getString(R.string.file_props_title), this::actionGetPropsOfFile); + optionsView.addOption(activity.getString(R.string.hide_file_title), this::actionHideTheFile); + + setView(optionsView); + setTitle(chosenFile.getName() + + " - " + + ((chosenFile.isDirectory()) ? + activity.getString(R.string.folder_title) : + activity.getString(R.string.file_title))); + + this.show = show(); + + } + + + @Override + public void actionReplaceFile() { + Intent chooseFile = new Intent(Intent.ACTION_GET_CONTENT); + chooseFile.addCategory(Intent.CATEGORY_OPENABLE); + chooseFile.setType("text/plain"); + activity.setResultListener(new ResultListener() { + @Override + public void onResult(Object object) { + //Реализовать замену и воостановление данных + Intent data; + if(object instanceof Intent) + data = (Intent) object; + else return; + + String selectedFileToReplace = ""; + selectedFileToReplace = data.getData().getPath(); + + //Создание файла куда будет складывться замена + File replacement = generateReplacementFile(); + + //Копирование выбранного оригинального файла в хранилище замен + //Иначе говоря, создание резервной копии + String path = chosenFile.getAbsolutePath(); + copy(path, replacement.getPath()); + + //Непосредственная замена + copy(selectedFileToReplace, path); + + values.put(NAME_OF_BACKUPED_ELEMENT, replacement.getName()); + values.put(ReplacementDataBaseHelper.PATH_TO_REPLACED_ELEMENT, path); + + //Запись в бд + writableDatabase.insert(MAIN_TABLE_NAME, null, values); + + writableDatabase.close(); + + activity.updateListView(); + show.cancel(); + //TODO Язык!!!! + Toast.makeText(activity, "Заменено!", Toast.LENGTH_LONG).show(); + } + }); + activity.startActivityForResult( + Intent.createChooser(chooseFile, "Choose a file"), + OPEN_FILE_ON_REPLACE_REQUEST + ); + } + + @Override + public void actionRecoverFile() { + String path = chosenFile.getAbsolutePath(); + UtilitiesAndData.recoverFile(path); + activity.updateListView(); + show.cancel(); + //дщд + } + + @Override + public void actionRemoveFile() { + AlertDialog.Builder dialog = new AlertDialog.Builder(activity); + dialog.setTitle(activity.getString(R.string.remove_file_title)); + String message = String.format(activity.getString(R.string.sure_remove_title), chosenFile.getName()); + dialog.setMessage(message); + + dialog.setPositiveButton(R.string.ok_title, (dialog1, which) -> { + UtilitiesAndData.deleteRecursive(chosenFile); + activity.updateListView(); + }); + dialog.setNegativeButton(R.string.cancel_title, null); + dialog.show(); + } + + @Override + public void actionTrackTheFile() {} + + @Override + public void actionGetPropsOfFile() { + AlertDialog.Builder dialog = new AlertDialog.Builder(activity); + dialog.setTitle(chosenFile.getName() + + " - " + + ((chosenFile.isDirectory()) ? + activity.getString(R.string.folder_title) : + activity.getString(R.string.file_title))); + + long lastModified = chosenFile.lastModified(); + Date date = new Date(lastModified); + + + SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss:SS"); + String formattedDate = sdf.format(date); + + long size = getFileSize(chosenFile); + + + dialog.setMessage( + activity.getString(R.string.file_lastmod_title) + "\n" + + formattedDate + "\n\n" + + activity.getString(R.string.file_size_title) + "\n" + + humanReadableByteCountSI(size) + " (" + size + " B)" + ); + dialog.show(); + } + + @Override + public void actionHideTheFile() { + + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/components/OptionAction.java b/app/src/main/java/com/ea/ironmonkey/devmenu/components/OptionAction.java new file mode 100644 index 0000000..7e22cb6 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/components/OptionAction.java @@ -0,0 +1,5 @@ +package com.ea.ironmonkey.devmenu.components; + +public interface OptionAction { + void action(); +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/dialog/OpenFileDialog.java b/app/src/main/java/com/ea/ironmonkey/devmenu/dialog/OpenFileDialog.java new file mode 100644 index 0000000..9dbc640 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/dialog/OpenFileDialog.java @@ -0,0 +1,246 @@ +package com.ea.ironmonkey.devmenu.dialog; + +import android.app.AlertDialog; +import android.content.Context; +import android.graphics.Paint; +import android.graphics.Point; +import android.graphics.Rect; +import android.graphics.drawable.Drawable; +import android.os.Environment; +import android.util.DisplayMetrics; +import android.util.TypedValue; +import android.view.Display; +import android.view.Gravity; +import android.view.View; +import android.view.ViewGroup; +import android.view.WindowManager; +import android.widget.ArrayAdapter; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.TextView; +import android.widget.Toast; + +import com.ea.games.nfs13_na.R; + +import java.io.File; +import java.io.FilenameFilter; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public class OpenFileDialog extends AlertDialog.Builder { + + private String currentPath = Environment.getExternalStorageDirectory().getPath(); + private FilenameFilter filenameFilter; + private List files = new ArrayList(); + private TextView title; + private ListView listView; + private int selectedIndex = -1; + + public OpenFileDialog(Context context) { + super(context); + title = createTitle(context); + changeTitle(); + LinearLayout linearLayout = createMainLayout(context); + linearLayout.addView(createBackItem(context)); + files.addAll(getFiles(currentPath)); + listView = createListView(context); + listView.setAdapter(new FileAdapter(context, files)); + linearLayout.addView(listView); + setCustomTitle(title) + .setView(linearLayout) + .setPositiveButton(R.string.ok_title, (dialog, which) -> { + if (selectedIndex > -1 && listener != null) { + listener.OnSelectedFile(listView.getItemAtPosition(selectedIndex).toString()); + } + }) + .setNegativeButton(R.string.cancel_title, null); + } + + @Override + public AlertDialog show() { + files.addAll(getFiles(currentPath)); + listView.setAdapter(new FileAdapter(getContext(), files)); + return super.show(); + } + + private List asList(T[] a){ + return Arrays.asList(a); + } + + private List getFiles(String directoryPath){ + File directory = new File(directoryPath); + List fileList = asList(directory.listFiles(filenameFilter)); + Collections.sort(fileList, (file, file2) -> { + if (file.isDirectory() && file2.isFile()) + return -1; + else if (file.isFile() && file2.isDirectory()) + return 1; + else + return file.getPath().compareTo(file2.getPath()); + }); + return fileList; + } + + private TextView createTextView(Context context, int style) { + TextView textView = new TextView(context); + textView.setTextAppearance(context, style); + int itemHeight = getItemHeight(context); + textView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, itemHeight)); + textView.setMinHeight(itemHeight); + textView.setGravity(Gravity.CENTER_VERTICAL); + textView.setPadding(15, 0, 0, 0); + return textView; + } + + private int getItemHeight(Context context) { + TypedValue value = new TypedValue(); + DisplayMetrics metrics = new DisplayMetrics(); + context.getTheme().resolveAttribute(android.R.attr.rowHeight, value, true); + getDefaultDisplay(context).getMetrics(metrics); + return (int)TypedValue.complexToDimension(value.data, metrics); + } + + public int getTextWidth(String text, Paint paint) { + Rect bounds = new Rect(); + paint.getTextBounds(text, 0, text.length(), bounds); + return bounds.left + bounds.width() + 80; + } + + private void changeTitle() { + String titleText = currentPath; + int screenWidth = getScreenSize(getContext()).x; + int maxWidth = (int) (screenWidth * 0.99); + if (getTextWidth(titleText, title.getPaint()) > maxWidth) { + while (getTextWidth("..." + titleText, title.getPaint()) > maxWidth) + { + int start = titleText.indexOf("/", 2); + if (start > 0) + titleText = titleText.substring(start); + else + titleText = titleText.substring(2); + } + title.setText("..." + titleText); + } else { + title.setText(titleText); + } + } + + private TextView createTitle(Context context) { + TextView textView = new TextView(context); + textView.setTextAppearance(context, android.R.style.TextAppearance_DeviceDefault_DialogWindowTitle); + int itemHeight = getItemHeight(context); + textView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, itemHeight)); + textView.setMinHeight(itemHeight); + textView.setGravity(Gravity.CENTER_VERTICAL); + textView.setPadding(15, 0, 0, 0); + textView.setText(currentPath); + return textView; + } + + private void RebuildFiles(ArrayAdapter adapter) { + try{ + List fileList = getFiles(currentPath); + files.clear(); + selectedIndex = -1; + files.addAll(fileList); + adapter.notifyDataSetChanged(); + changeTitle(); + } catch (NullPointerException e){ + Toast.makeText(getContext(), android.R.string.unknownName, Toast.LENGTH_SHORT).show(); + } + } + + public OpenFileDialog setFilter(final String filter) { + filenameFilter = (file, fileName) -> { + File tempFile = new File(String.format("%s/%s", file.getPath(), fileName)); + if (tempFile.isFile()) + return tempFile.getName().matches(filter); + return true; + }; + return this; + } + + private ListView createListView(Context context) { + ListView listView = new ListView(context); + listView.setOnItemClickListener((adapterView, view, index, l) -> { + FileAdapter adapter = (FileAdapter) adapterView.getAdapter(); + File file = adapter.getItem(index); + if (file.isDirectory()) { + currentPath = file.getPath(); + RebuildFiles(adapter); + } else { + if (index != selectedIndex) + selectedIndex = index; + else + selectedIndex = -1; + adapter.notifyDataSetChanged(); + } + }); + return listView; + } + + private static Display getDefaultDisplay(Context context) { + return ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay(); + } + + private static Point getScreenSize(Context context) { + Point screeSize = new Point(); + getDefaultDisplay(context).getSize(screeSize); + return screeSize; + } + + private LinearLayout createMainLayout(Context context) { + LinearLayout linearLayout = new LinearLayout(context); + linearLayout.setOrientation(LinearLayout.VERTICAL); + linearLayout.setMinimumHeight(750); + return linearLayout; + } + + private TextView createBackItem(Context context) { + TextView textView = createTextView(context, android.R.style.TextAppearance_DeviceDefault_Small); + Drawable drawable = getContext().getResources().getDrawable(android.R.drawable.ic_menu_directions); + drawable.setBounds(0, 0, 60, 60); + textView.setCompoundDrawables(drawable, null, null, null); + textView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); + textView.setOnClickListener(view -> { + File file = new File(currentPath); + File parentDirectory = file.getParentFile(); + if (parentDirectory != null) { + currentPath = parentDirectory.getPath(); + RebuildFiles(((FileAdapter) listView.getAdapter())); + } + }); + return textView; + } + + class FileAdapter extends ArrayAdapter { + + public FileAdapter(Context context, List files) { + super(context, android.R.layout.simple_list_item_1, files); + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + TextView view = (TextView) super.getView(position, convertView, parent); + File file = getItem(position); + view.setText(file.getName()); + if (selectedIndex == position) + view.setBackgroundColor(getContext().getResources().getColor(android.R.color.holo_blue_light)); + else + view.setBackgroundColor(getContext().getResources().getColor(android.R.color.background_dark)); + return view; + } + } + + public interface OpenDialogListener{ + void OnSelectedFile(String fileName); + } + private OpenDialogListener listener; + + public OpenFileDialog setOpenDialogListener(OpenDialogListener listener) { + this.listener = listener; + return this; + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/dialog/SvmwCreatorDialog.java b/app/src/main/java/com/ea/ironmonkey/devmenu/dialog/SvmwCreatorDialog.java new file mode 100644 index 0000000..7c33c4f --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/dialog/SvmwCreatorDialog.java @@ -0,0 +1,95 @@ +package com.ea.ironmonkey.devmenu.dialog; + +import android.app.Activity; +import android.app.AlertDialog; +import android.content.Context; +import android.content.Intent; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.Toast; + +import com.ea.games.nfs13_na.R; +import com.ea.ironmonkey.devmenu.util.SaveManager; +import com.ea.ironmonkey.devmenu.util.UtilitiesAndData; + +import java.io.File; +import java.io.IOException; + +/** + * Диалог для содания бандлов + * Сам умеет их создавать + */ +public class SvmwCreatorDialog extends AlertDialog { + + private EditText nameEdit; + private EditText desEdit; + private CheckBox isUseCurSaveBox; + private View mainView; + + private boolean useCurrentSave; + + private SaveManager manager; + private Context context; + + private File svmwPath; + + public SvmwCreatorDialog(Activity activity) { + super(activity); + context = activity.getApplicationContext(); + svmwPath = new File(UtilitiesAndData.getExternalStorage() + File.separator + "svmw"); + svmwPath.mkdir(); + setTitle("Создание SVMW"); + ImageButton a; + + Button s; + mainView = LayoutInflater + .from(context) + .inflate(R.layout.saves, null, false); + + nameEdit = (EditText) mainView.findViewById(R.id.name_svmw); + desEdit = (EditText) mainView.findViewById(R.id.des_svmw); + + isUseCurSaveBox = (CheckBox) mainView.findViewById(R.id.isUseCurrentSave); + manager = new SaveManager(context); + + //Конпка создания + setButton(context.getText(R.string.create_svmw_file_title), (dialog, witch) -> { + String name = getTextFrom(nameEdit); + String des = getTextFrom(desEdit); + if(name.isEmpty() | des.isEmpty()){ + Toast.makeText(context, context.getText(R.string.toast_strings_must_be_entered), Toast.LENGTH_LONG).show(); + return; + } + File to = new File(svmwPath.getAbsolutePath() + File.separator + name + ".svmw"); + try { + to.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + manager.createBundleFile(des, to, UtilitiesAndData.getSaveFile()); + }); + //Кнопка отмены + setButton2(context.getText(R.string.cancel_title), (OnClickListener) null); + //Кнопка выбора отдельного файла + setButton3(context.getString(R.string.choose_svmw_file_title), (dialog, witch) -> { + Intent intent = new Intent(Intent.ACTION_GET_CONTENT); + intent.setType("file/*"); + getOwnerActivity().startActivityForResult(intent, 228); + }); + + isUseCurSaveBox.setOnCheckedChangeListener((buttonView, isChecked) -> getButton(AlertDialog.BUTTON3).setEnabled(!isChecked)); + + + // Если включена опция "Использовать текущее сохранение" то заюлокировтаь кнопку выбора файла сохранения + + setView(mainView); + } + + private String getTextFrom(EditText editText){ + return editText.getText().toString(); + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/dialog/SvmwInspectorDialog.java b/app/src/main/java/com/ea/ironmonkey/devmenu/dialog/SvmwInspectorDialog.java new file mode 100644 index 0000000..292b6e7 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/dialog/SvmwInspectorDialog.java @@ -0,0 +1,66 @@ +package com.ea.ironmonkey.devmenu.dialog; + +import android.app.AlertDialog; +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.TextView; +import android.widget.Toast; + +import com.ea.games.nfs13_na.R; +import com.ea.ironmonkey.devmenu.util.SaveManager; + +import java.io.File; +import java.util.Date; + +/** + * Диалог выбора и просмотра информации об svmw файле + */ +public class SvmwInspectorDialog extends AlertDialog { + + private SaveManager manager; + private View mainView; + private boolean isWork; + private TextView description; + private TextView time; + + public SvmwInspectorDialog(Context context, File svmw) { + super(context); + manager = new SaveManager(context); + //Если пришедший файл - svmw иницализируем работу с ним если нет + // то выходим + // и ничего интересного не показываем(( + isWork = manager.isSvmwFile(svmw); + if(isWork){ + + setTitle("Файл - " + svmw.getName()); + + mainView = LayoutInflater + .from(context) + .inflate(R.layout.inspector, null, false); + + description = (TextView) mainView.findViewById(R.id.description); + description.setText(manager.getDescriptionOf(svmw)); + + time = (TextView) mainView.findViewById(R.id.date); + Date dateOfCreate = manager.getDateOfCreateOf(svmw); + String format = SaveManager.dateFormat.format(dateOfCreate); + time.setText(time.getText() + ": " + format); + + setButton(context.getString(R.string.title_load_svmw), (dialog, which) -> { + manager.loadBundleFile(svmw); + }); + setButton2(context.getString(R.string.cancel_title), (OnClickListener) null); + + setView(mainView); + + + }else Toast.makeText(context, "Это не svmw!", Toast.LENGTH_LONG).show(); + + } + + @Override + public void show() { + if(isWork) super.show(); + } +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/util/Observer.java b/app/src/main/java/com/ea/ironmonkey/devmenu/util/Observer.java new file mode 100644 index 0000000..af1353b --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/util/Observer.java @@ -0,0 +1,110 @@ +package com.ea.ironmonkey.devmenu.util; + +import android.util.Log; + +public class Observer { + + private static final String LOG_TAG = "Observer"; + + public static void onCallingMethod(Method... states){ + StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); + + Log.i(LOG_TAG, "info{"); + if(states.length != 0){ + Log.i(LOG_TAG, "States of method:"); + for(Method mthd : states){ + Log.i(LOG_TAG, "\t" + mthd.title); + } + Log.i(LOG_TAG, "\n"); + } + for(int i = 1; i < stackTrace.length; i++) { + Log.i(LOG_TAG, "\t" + stackTrace[i]); + } + Log.i(LOG_TAG, "}"); + } + + private interface MethodCallingCounter{ + + + void call(); + + } + + /** Перечисление состояний методов при из анализе и изменении, доработке */ + public enum Method implements MethodCallingCounter{ + /** Состояние невозможгости декомпиляции */ + IMPOSSIBLE_TO_DECOMPILE("Impossible to decompile"){ + @Override + public void call() { + + } + }, + + /** Уровни подозртельности работы методов при их воостановлении после + декомпиляции, или их доработке и изменеии. + + /** Зеленая зона. Небольшие подозрения */ + SUSPICIOUS_METHOD("Suspicious method"){ + @Override + public void call() { + + } + }, + + /** Желтая зона. уже более подозрительны метод, что ставит под вопрос корректоность отрработки некторого функционала */ + VERY_SUSPICIOUS_METHOD("Very suspicious Method") { + @Override + public void call() { + + } + }, + + /** Красная зона. Опасный метод который может привести к фатальным ошибкам */ + HAZARD_METHOD("Hazard method") { + @Override + public void call() { + + } + }, + + + /** Уровни воостонавливаемости кода */ + HARD_TO_RECOVER_LOGIC("Hard to recover logic of method") { + @Override + public void call() { + + } + }, + + ON_CATCHING_EXCEPTION("on catching exception") { + @Override + public void call() { + + } + }, + + RETURN_NULL("Method returns null") { + @Override + public void call() { + + } + }, + + SOME_PACKAGE_IS_DELETED("Some package is deleted"){ + @Override + public void call() { + + } + }; + + private String title; + + Method(String title) { + this.title = title; + //this.call(); + } + + } + +} + diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/util/ReplacementDataBaseHelper.java b/app/src/main/java/com/ea/ironmonkey/devmenu/util/ReplacementDataBaseHelper.java new file mode 100644 index 0000000..417c0f2 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/util/ReplacementDataBaseHelper.java @@ -0,0 +1,34 @@ +package com.ea.ironmonkey.devmenu.util; + +import android.content.Context; +import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteOpenHelper; + +public class ReplacementDataBaseHelper extends SQLiteOpenHelper { + + public static final String MAIN_TABLE_NAME = "Replacements"; + public static final String PATH_TO_REPLACED_ELEMENT = "Path"; + public static final String NAME_OF_BACKUPED_ELEMENT = "Original_element"; + private static final int DATABASE_VERSION = 1; + + public SQLiteDatabase getDatabase() { + return database; + } + + private SQLiteDatabase database; + + + public ReplacementDataBaseHelper(Context context) { + super(context, MAIN_TABLE_NAME + ".db", (SQLiteDatabase.CursorFactory) (db, masterQuery, editTable, query) -> null, DATABASE_VERSION); + database = context.openOrCreateDatabase(MAIN_TABLE_NAME + ".db", Context.MODE_PRIVATE, null); + database.execSQL("CREATE TABLE IF NOT EXISTS " + MAIN_TABLE_NAME + " (_id INTEGER PRIMARY KEY AUTOINCREMENT, " + + PATH_TO_REPLACED_ELEMENT + " TEXT," + + NAME_OF_BACKUPED_ELEMENT + " TEXT);"); + } + + @Override + public void onCreate(SQLiteDatabase db) {} + + @Override + public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {} +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/util/ResultListener.java b/app/src/main/java/com/ea/ironmonkey/devmenu/util/ResultListener.java new file mode 100644 index 0000000..2bb8f7c --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/util/ResultListener.java @@ -0,0 +1,7 @@ +package com.ea.ironmonkey.devmenu.util; + +public interface ResultListener { + + default void onResult(Object data){} + +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/util/SaveManager.java b/app/src/main/java/com/ea/ironmonkey/devmenu/util/SaveManager.java new file mode 100644 index 0000000..07518e6 --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/util/SaveManager.java @@ -0,0 +1,186 @@ +package com.ea.ironmonkey.devmenu.util; + +import android.content.Context; +import android.util.Log; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.charset.StandardCharsets; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * Менедженер создания и загрузки сохранений в игру
+ * Создает bundle-файлы .svmw и загружает их
+ * Умеет загружать обчные .sb сохранения в игру + */ +public class SaveManager { + + private Context context; + private static final String LOG_TAG = "SaveManager"; + private static final byte[] svmw_header = "SVMW".getBytes(StandardCharsets.UTF_8); + private static final byte[] save_header = "SBIN".getBytes(StandardCharsets.UTF_8); + public static final String dateFormatStr = "dd.MM.yy:hh:mm:ss"; + public static final SimpleDateFormat dateFormat = new SimpleDateFormat(dateFormatStr); + + public SaveManager(Context context) { + this.context = context; + } + + public File createBundleFile(String description, File fileToSave, File save) { + + if (fileToSave.exists()) fileToSave.delete(); + + try { + fileToSave.createNewFile(); + FileOutputStream fos = new FileOutputStream(fileToSave); + + Date date = new Date(); + + Long time = date.getTime(); + + ByteBuffer bb = ByteBuffer.allocate(Long.SIZE); + bb.order(ByteOrder.LITTLE_ENDIAN); + bb.putLong(time); + bb.flip(); + //bb. + String curDate = dateFormat.format(new Date()); + + fos.write(svmw_header); + fos.write(curDate.getBytes(StandardCharsets.UTF_8)); + fos.write(description.getBytes(StandardCharsets.UTF_8)); + fos.write(UtilitiesAndData.fileAsByteArray(save)); + } catch (IOException e) { + Log.i("lol", fileToSave.getAbsolutePath()); + //fileToSave.getAbsolutePath() + e.printStackTrace(); + } + + return fileToSave; + } + + public void loadBundleFile(File svmw) { + + if(isSvmwFile(svmw)){ + byte[] byteFile = UtilitiesAndData.fileAsByteArray(svmw); + int headerInByteFile = UtilitiesAndData.findHeaderInByteFile(byteFile, save_header); + byte[] result = new byte[byteFile.length - headerInByteFile]; + System.arraycopy(byteFile, headerInByteFile, result, 0, result.length); + File dest = new File("/data/data/" + context.getPackageName() + "/files/var/nfstr_save.sb"); + if(!dest.exists()) { + try { + dest.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + } + try { + FileOutputStream fos = new FileOutputStream(dest); + fos.write(result); + } catch (IOException e) { + e.printStackTrace(); + } + } + + } + + public String getDescriptionOf(File svmw){ + if(isSvmwFile(svmw)){ + int offset = svmw_header.length + dateFormatStr.length(); + byte[] byteFile = UtilitiesAndData.fileAsByteArray(svmw); + int headerInByteFile = UtilitiesAndData.findHeaderInByteFile(byteFile, save_header); + return new String(byteFile, offset, headerInByteFile - offset, StandardCharsets.UTF_8); + } + Log.i(LOG_TAG, "getDescription(), this is not a svmw file((( Return empty description((("); + return ""; + } + + public Date getDateOfCreateOf(File svmw){ + if(isSvmwFile(svmw)){ + int offset = svmw_header.length; + byte[] byteFile = UtilitiesAndData.fileAsByteArray(svmw); + + String s = new String(byteFile, offset, dateFormatStr.length(), StandardCharsets.UTF_8); + + try { + return dateFormat.parse(s); + } catch (ParseException e) { + e.printStackTrace(); + } + } + Log.i(LOG_TAG, "getDateOfCreateOf, this is not a svmw file((( Return null date((("); + return null; + } + + public void loadSaveFile(File save) { + if(isSaveFile(save)){ + copySave(save); + } + } + + public boolean isSaveFile(File save) { + if(!save.exists() | isEmptyFile(save)) return false; + byte[] arr = UtilitiesAndData.fileAsByteArray(save); + for (int i = 0; i < save_header.length; i++) + if (save_header[i] != arr[i]) return false; + return true; + } + + public boolean isSvmwFile(File svmw) { + if(!svmw.exists() | isEmptyFile(svmw)) return false; + byte[] arr = UtilitiesAndData.fileAsByteArray(svmw); + for (int i = 0; i < svmw_header.length; i++) + if (svmw_header[i] != arr[i]) return false; + return true; + } + + + public boolean isEmptyFile(File file){ + return UtilitiesAndData.fileAsByteArray(file).length == 0; + } + + + public void copySave(File save){ + + File source = save; + + File dest = new File("/data/data/" + context.getPackageName() + "/files/var/nfstr_save.sb"); + + + if(!dest.exists()) { + try { + dest.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + InputStream is = null; + OutputStream os = null; + try { + is = new FileInputStream(source); + os = new FileOutputStream(dest); + byte[] buffer = new byte[1024]; + int length; + while ((length = is.read(buffer)) > 0) { + os.write(buffer, 0, length); + } + is.close(); + os.close(); + } catch (FileNotFoundException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + +} diff --git a/app/src/main/java/com/ea/ironmonkey/devmenu/util/UtilitiesAndData.java b/app/src/main/java/com/ea/ironmonkey/devmenu/util/UtilitiesAndData.java new file mode 100644 index 0000000..378a0af --- /dev/null +++ b/app/src/main/java/com/ea/ironmonkey/devmenu/util/UtilitiesAndData.java @@ -0,0 +1,290 @@ +package com.ea.ironmonkey.devmenu.util; + +import static com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper.MAIN_TABLE_NAME; +import static com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper.NAME_OF_BACKUPED_ELEMENT; +import static com.ea.ironmonkey.devmenu.util.ReplacementDataBaseHelper.PATH_TO_REPLACED_ELEMENT; + +import android.content.Context; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.os.Environment; +import android.util.Log; +import org.apache.commons.codec.digest.DigestUtils; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +public class UtilitiesAndData { + + private static Context context; + private static FileOutputStream stream; + public static final int OPEN_FILE_ON_REPLACE_REQUEST = 100; + public static final int READ_FILE_REQUEST_CODE = 101; + + private static final String LOG_TAG = "UtilitiesAndData"; + + public static void init(Context context){ + UtilitiesAndData.context = context; + } + + public static void setLogger(File file){ + if(file.exists()){ + try { + stream = new FileOutputStream(file); + } catch (FileNotFoundException e) { + Log.wtf(LOG_TAG, "cant create out stream((("); + e.printStackTrace(); + } + } + } + + public static void deleteRecursive(File fileOrDirectory) { + if (fileOrDirectory.isDirectory()) + for (File child : fileOrDirectory.listFiles()) + deleteRecursive(child); + + fileOrDirectory.delete(); + } + + public static boolean isLoggerEnabled(){ + return stream != null; + } + + public static void printLog(String msg){ + try{ + if(isLoggerEnabled()) + stream.write(msg.getBytes(StandardCharsets.UTF_8)); + } catch (IOException e) { + Log.wtf(LOG_TAG, "cant write to stream((("); + e.printStackTrace(); + } + } + + public static String getInternalStorage(){ + return "/data/data/" + context.getPackageName(); + } + + public static String getExternalStorage(){ + return Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/data/" + context.getPackageName() + "/files"; + } + + public static File getDevMenuSwitcher(){ + return new File(UtilitiesAndData.getExternalStorage() + File.separator + "DevMenu"); + } + + public static File getSaveFile(){ + File save = new File(getInternalStorage() + File.separator + "files" + File.separator + "var" + File.separator + "nfstr_save.sb"); + if(!save.exists()) { + try { + save.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + } + return save; + } + + public static String getReplacementsStorage(){ + return getInternalStorage() + File.separator + "replace"; + } + + public static boolean isFirstRun(){ + File temp = new File(getInternalStorage() + File.separator + "load"); + try { + if(!temp.exists()){ + temp.createNewFile(); + return true; + } + } catch (IOException e) { + e.printStackTrace(); + } + return false; + } + + private static final String[] exclusionNamesArr = { + + "replace", + "lib", + "databases" + + }; + + public static void copy(File from, File to){ + copy(from.getAbsolutePath(), to.getAbsolutePath()); + } + + public static void copy(String from, String to) { + File source = new File(from); + + File dest = new File(to); + + + if (!dest.exists()) { + try { + dest.createNewFile(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + InputStream is = null; + OutputStream os = null; + try { + is = new FileInputStream(source); + os = new FileOutputStream(dest); + Math.max(getFileSize(source), getFileSize(dest)); + byte[] buffer = new byte[1024]; + int length; + while ((length = is.read(buffer)) > 0) { + os.write(buffer, 0, length); + } + is.close(); + os.close(); + } catch (FileNotFoundException e) { + Log.e("lol", e.toString()); + e.printStackTrace(); + } catch (IOException e) { + Log.e("lol1", e.toString()); + e.printStackTrace(); + } + } + + public static long getFileSize(final File file) { + if (file == null || !file.exists()) + return 0; + if (!file.isDirectory()) + return file.length(); + final List dirs = new LinkedList<>(); + dirs.add(file); + long result = 0; + while (!dirs.isEmpty()) { + final File dir = dirs.remove(0); + if (!dir.exists()) + continue; + final File[] listFiles = dir.listFiles(); + if (listFiles == null || listFiles.length == 0) + continue; + for (final File child : listFiles) { + result += child.length(); + if (child.isDirectory()) + dirs.add(child); + } + } + return result; + } + + private static final Set exclusionNames = new HashSet<>(Arrays.asList(exclusionNamesArr)); + + public static boolean isExclusionName(String name){ + return exclusionNames.contains(name); + } + + + public static void recoverFile(String path){ + ReplacementDataBaseHelper dataBaseHelper = new ReplacementDataBaseHelper(context); + SQLiteDatabase writableDatabase = dataBaseHelper.getDatabase(); + Cursor query = writableDatabase.rawQuery("SELECT " + PATH_TO_REPLACED_ELEMENT + " , " + NAME_OF_BACKUPED_ELEMENT + " FROM " + MAIN_TABLE_NAME + " WHERE " + PATH_TO_REPLACED_ELEMENT + " = \"" + path + "\"", null); + if(query.getCount() == 1) { + query.moveToFirst(); + //Путь к заменяемому файлу + String pathToReplace = query.getString(query.getColumnIndex(PATH_TO_REPLACED_ELEMENT)); + //Имя бэкапа + String nameFile = query.getString(query.getColumnIndex(NAME_OF_BACKUPED_ELEMENT)); + + //Файл замены + File toReplace = new File(pathToReplace); + + //Файл бэкапа + File backup = new File(UtilitiesAndData.getReplacementsStorage() + File.separator + nameFile); + + copy(backup, toReplace); + + writableDatabase.delete(MAIN_TABLE_NAME, PATH_TO_REPLACED_ELEMENT + " = ?", new String[]{path}); + backup.delete(); + } + + query.close(); + } + + public static byte[] generateMD5(File file){ + try { + return DigestUtils.md5(new FileInputStream(file)); + } catch (IOException e) { + e.printStackTrace(); + } + return new byte[1]; + } + + public static void getInfoAboutFile(File file){ + Log.i(LOG_TAG, "Info about File -> " + file.getAbsolutePath()); + if(file.exists()){ + if(file.isFile()) { + Log.i(LOG_TAG, "isCanRead = " + file.canRead()); + Log.i(LOG_TAG, "isCanWrite = " + file.canWrite()); + Log.i(LOG_TAG, "isCanExecute = " + file.canExecute()); + }else + Log.i(LOG_TAG, "its dir!"); + }else + Log.wtf(LOG_TAG, "it does not exists!"); + } + + public static byte[] fileAsByteArray(File file){ + byte[] b = new byte[(int) file.length()]; + try { + FileInputStream fileInputStream = new FileInputStream(file); + fileInputStream.read(b); + } catch (Exception e) { + return null; + } + return b; + } + + public static void saveBytesToFile(byte[] bytes, File saveTo){ + try{ + saveTo.createNewFile(); + FileOutputStream outputStream = new FileOutputStream(saveTo); + outputStream.write(bytes); + } catch (IOException e) { + e.printStackTrace(); + } + } + + public static int findHeaderInByteFile(byte[] byteFile, byte[] header){ + int[] pf = prefix(header); + int index = 0; + for (int i = 0; i < byteFile.length; i++){ + while (index > 0 && header[index] != byteFile[i]) index = pf[index - 1]; + if (header[index] == byteFile[i]) index++; + if (index == header.length) return i - index + 1; + } + return -1; + } + + /** + * Префикс функция для алгоритма КМП + */ + private static int[] prefix(byte[] s) { + int[] result = new int[s.length]; + result[0] = 0; + int index = 0; + + for (int i = 1; i < s.length; i++) { + while (index >= 0 && s[index] != s[i]) { index--; } + index++; + result[i] = index; + } + + return result; + } + +} diff --git a/app/src/main/java/com/ea/nimble/ApplicationEnvironment.java b/app/src/main/java/com/ea/nimble/ApplicationEnvironment.java new file mode 100644 index 0000000..15c96a6 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ApplicationEnvironment.java @@ -0,0 +1,34 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.Activity + */ +package com.ea.nimble; + +import android.app.Activity; +import com.ea.nimble.ApplicationEnvironmentImpl; +import com.ea.nimble.BaseCore; +import com.ea.nimble.IApplicationEnvironment; + +public class ApplicationEnvironment { + public static final String COMPONENT_ID = "com.ea.nimble.applicationEnvironment"; + public static final String NOTIFICATION_AGE_COMPLIANCE_REFRESHED = "nimble.notification.age_compliance_refreshed"; + + public static IApplicationEnvironment getComponent() { + return BaseCore.getInstance().getApplicationEnvironment(); + } + + public static Activity getCurrentActivity() { + return ApplicationEnvironmentImpl.getCurrentActivity(); + } + + public static boolean isMainApplicationRunning() { + return ApplicationEnvironmentImpl.isMainApplicationRunning(); + } + + public static void setCurrentActivity(Activity activity) { + ApplicationEnvironmentImpl.setCurrentActivity(activity); + } +} + diff --git a/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java b/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java new file mode 100644 index 0000000..dcbb653 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ApplicationEnvironmentImpl.java @@ -0,0 +1,583 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.accounts.Account + * android.accounts.AccountManager + * android.app.Activity + * android.content.Context + * android.content.pm.PackageManager$NameNotFoundException + * android.net.wifi.WifiManager + * android.os.Build + * android.os.Build$VERSION + * android.telephony.TelephonyManager + * android.util.Log + * android.util.Patterns + */ +package com.ea.nimble; + +import android.accounts.Account; +import android.accounts.AccountManager; +import android.app.Activity; +import android.content.Context; +import android.content.pm.PackageManager; +import android.net.wifi.WifiInfo; +import android.net.wifi.WifiManager; +import android.os.Build; +import android.telephony.TelephonyManager; +import android.util.Log; +import android.util.Patterns; + +import com.ea.nimble.Log.Helper; +import com.google.android.gms.ads.identifier.AdvertisingIdClient; +import com.google.android.gms.common.GooglePlayServicesNotAvailableException; +import com.google.android.gms.common.GooglePlayServicesRepairableException; + +import java.io.File; +import java.io.IOException; +import java.io.Serializable; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.Locale; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class ApplicationEnvironmentImpl +extends Component +implements IApplicationEnvironment, +LogSource { + private static final int MILLIS_IN_AN_HOUR = 3600000; + private static final String NIMBLE_APPLICATIONENVIRONMENT_PERSISTENCE_GAME_SPECIFIED_ID = "nimble_applicationenvironment_game_specified_id"; + private static final String PERSISTENCE_AGE_REQUIREMENTS = "ageRequirement"; + private static final String PERSISTENCE_LANGUAGE = "language"; + private static final String PERSISTENCE_TIME_RETRIEVED = "timeRetrieved"; + private static final String SYNERGY_API_GET_AGE_REQUIREMENTS = "/rest/agerequirements/ip"; + private static boolean isMainApplicationRunning = false; + private static Activity s_currentActivity = null; + private Context m_context; + private BaseCore m_core; + private String m_gameSpecifiedPlayerId; + private boolean m_googleAdvertiserInfoLoaded; + private String m_googleAdvertisingId; + private boolean m_googleLimitAdTrackingEnabled; + private String m_language; + private String m_packageId; + private String m_version; + + ApplicationEnvironmentImpl(BaseCore fileArray) { + int n2 = 0; + this.m_googleAdvertisingId = ""; + this.m_googleLimitAdTrackingEnabled = true; + this.m_googleAdvertiserInfoLoaded = false; + if (s_currentActivity == null) { + throw new AssertionError("Cannot create a ApplicationEnvironment without a valid current activity"); + } + this.m_core = fileArray; + this.m_context = s_currentActivity.getApplicationContext(); + this.m_language = null; + File documentPath = new File(this.getDocumentPath()); + File tempPath = new File(this.getTempPath()); + if (!documentPath.exists()) { + if (!documentPath.mkdirs()) throw new AssertionError("APP_ENV: Cannot create necessary folder"); + } + Log.i("lol", tempPath.getAbsolutePath()); + if (!tempPath.exists() && !tempPath.mkdirs()) { + throw new AssertionError("APP_ENV: Cannot create necessary folder"); + } + File[] files = tempPath.listFiles(); + int n3 = files.length; + while (n2 < n3) { + tempPath = files[n2]; + tempPath.delete(); + Log.d("Nimble", "APP_ENV: Delete temp file " + tempPath.getName()); + ++n2; + } + } + + static /* synthetic */ String access$002(ApplicationEnvironmentImpl applicationEnvironmentImpl, String string2) { + applicationEnvironmentImpl.m_googleAdvertisingId = string2; + return string2; + } + + static /* synthetic */ boolean access$102(ApplicationEnvironmentImpl applicationEnvironmentImpl, boolean bl2) { + applicationEnvironmentImpl.m_googleLimitAdTrackingEnabled = bl2; + return bl2; + } + + static /* synthetic */ boolean access$202(ApplicationEnvironmentImpl applicationEnvironmentImpl, boolean bl2) { + applicationEnvironmentImpl.m_googleAdvertiserInfoLoaded = bl2; + return bl2; + } + + private static boolean commandExists(String string2) { + String path = System.getenv("PATH"); + if (path == null) { + return false; + } + String[] split = path.split(Pattern.quote(File.pathSeparator)); + int n2 = split.length; + int n3 = 0; + while (n3 < n2) { + if (new File(split[n3], string2).exists()) { + return true; + } + ++n3; + } + return false; + } + + public static Activity getCurrentActivity() { + return s_currentActivity; + } + + private String getDeviceLanguage() { + return Locale.getDefault().toString(); + } + + public static boolean isMainApplicationRunning() { + return isMainApplicationRunning; + } + + /* + * Enabled unnecessary exception pruning + */ + private void retrieveGoogleAdvertiserId() { + synchronized (this) { + this.m_googleAdvertiserInfoLoaded = false; + Thread thread = new Thread(new Runnable(){ + + /* + * Enabled unnecessary exception pruning + */ + @Override + public void run() { + block12: { + Helper.LOGV(this, "APP_ENV: Running thread to get Google Advertising ID"); + if (ApplicationEnvironment.getCurrentActivity() != null) { + AdvertisingIdClient.Info info2 = null; + try { + if (ApplicationEnvironment.isMainApplicationRunning()) { + info2 = null; + info2 = AdvertisingIdClient.getAdvertisingIdInfo(ApplicationEnvironment.getCurrentActivity()); + } + if (info2 != null) { + Helper.LOGD(this, "APP_ENV: Setting values for Google Advertising ID and isLimitAdTrackingEnabled flag"); + ApplicationEnvironmentImpl.access$002(ApplicationEnvironmentImpl.this, info2.getId()); + ApplicationEnvironmentImpl.access$102(ApplicationEnvironmentImpl.this, info2.isLimitAdTrackingEnabled()); + break block12; + } + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID - AdvertisingIdInfo is null"); + } + catch (IOException iOException) { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID - Unrecoverable error connecting to Google Play Services"); + } + catch (GooglePlayServicesRepairableException googlePlayServicesRepairableException) { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID - Recoverable error connecting to Google Play Services"); + } + catch (GooglePlayServicesNotAvailableException googlePlayServicesNotAvailableException) { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID - Google Play Services not available on this device"); + } + catch (IllegalStateException illegalStateException) { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID - Illegal State Exception " + illegalStateException.getMessage()); + } + catch (Exception exception) { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID - General Exception " + exception.getMessage()); + } + } else { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID because there is no current activity"); + } + } + ApplicationEnvironmentImpl.access$202(ApplicationEnvironmentImpl.this, true); + } + }); + try { + thread.start(); + } + catch (VerifyError verifyError) { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID because this device is not supported"); + this.m_googleAdvertiserInfoLoaded = true; + } + catch (Throwable throwable) { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID because this device is not supported"); + this.m_googleAdvertiserInfoLoaded = true; + } + return; + } + } + + private void setApplicationLanguageCode(String object, boolean bl2) { + if ((object = this.validatedLanguageCode((String)object, bl2)) == null) { + return; + } + if (this.m_language != null && this.m_language.equals(object)) { + if (bl2) { + Helper.LOGD(this, "Setting the same language %s, skipping assignment", this.m_language); + return; + } + } else { + this.m_language = object; + Helper.LOGI(this, "Successfully set language to %s.", this.m_language); + Utility.sendBroadcast("nimble.notification.LanguageChanged", null); + } + if (bl2) return; + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.applicationEnvironment", Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent != null) { + Helper.LOGD(this, "Saving language data to persistence."); + persistenceForNimbleComponent.setValue(PERSISTENCE_LANGUAGE, (Serializable)((Object)this.m_language)); + return; + } + Helper.LOGE(this, "Could not get application environment persistence object to save to."); + } + + public static void setCurrentActivity(Activity activity) { + isMainApplicationRunning = true; + s_currentActivity = activity; + } + + private String validatedLanguageCode(String string2, boolean bl2) { + if (!Utility.validString(string2)) { + Helper.LOGI(this, "AppEnv: Language parameter is null or empty; keeping language at previous value."); + return null; + } + string2 = string2.replace('_', '-'); + Object object = Pattern.compile("^([a-z]{2,3})?(-([A-Z][a-z]{3}))?(-([A-Z]{2}))?(-.*)*$").matcher(string2); + if (!((Matcher)object).find()) { + Helper.LOGE(this, "Malformed language code " + string2 + " cannot be validated; backend system will likely treat it as en-US."); + return string2; + } + String string3 = ((Matcher)object).group(1); + if (Utility.validString(string3) && !Arrays.asList(Locale.getISOLanguages()).contains(string3)) { + Helper.LOGE(this, "Unknown language code " + string3 + " in language code " + string2 + "; backend system will likely treat it as en-US."); + } + if (!Utility.validString((String)(object = ((Matcher)object).group(5)))) return string2; + if (Arrays.asList(Locale.getISOCountries()).contains(object)) return string2; + Helper.LOGE(this, "Unknown region code " + (String)object + " in language code " + string2 + "; backend system will likely treat it as en-US."); + return string2; + } + + @Override + public int getAgeCompliance() { + Persistence persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.applicationEnvironment", Persistence.Storage.CACHE); + Serializable serializable = persistence.getValue(PERSISTENCE_TIME_RETRIEVED); + if (serializable != null) { + if ((int)(new Date().getTime() - (Long)serializable) / 3600000 <= 24) return (Integer)persistence.getValue(PERSISTENCE_AGE_REQUIREMENTS); + Helper.LOGI(this, "getAgeCompliance- Stored value is older than 24 hours. Call refreshAgeCompliance to retrieve minAgeCompliance", new Object[]{null}); + return -1; + } + Helper.LOGI(this, "getAgeCompliance- No stored value in persistance. Call refreshAgeCompliance to retrieve minAgeCompliance.", new Object[]{null}); + return -1; + } + + @Override + public String getApplicationBundleId() { + if (this.m_packageId != null) return this.m_packageId; + Context context = this.getApplicationContext(); + if (context == null) return this.m_packageId; + this.m_packageId = context.getPackageName(); + return this.m_packageId; + } + + @Override + public Context getApplicationContext() { + return this.m_context; + } + + @Override + public String getApplicationLanguageCode() { + return this.m_language; + } + + @Override + public String getApplicationName() { + Context context = this.getApplicationContext(); + if (context != null) return context.getPackageManager().getApplicationLabel(context.getApplicationInfo()).toString(); + return null; + } + + @Override + public String getApplicationVersion() { + if (this.m_version != null) return this.m_version; + Context context = this.getApplicationContext(); + if (context == null) { + return null; + } + try { + this.m_version = context.getPackageManager().getPackageInfo((String)context.getPackageName(), (int)0).versionName; + return this.m_version; + } + catch (PackageManager.NameNotFoundException nameNotFoundException) { + Helper.LOGE(this, "Package name %s not found", context.getPackageName()); + return null; + } + } + + @Override + public String getCachePath() { + return "/data/data/" + m_context.getPackageName() + File.separator + "cache" + File.separator + "Nimble" + File.separator + this.m_core.getConfiguration().toString(); + } + + @Override + public String getCarrier() { + Context context = this.getApplicationContext(); + if (context != null) return ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getNetworkOperator(); + return null; + } + + @Override + public String getComponentId() { + return "com.ea.nimble.applicationEnvironment"; + } + + @Override + public String getDeviceBrand() { + return Build.BRAND; + } + + @Override + public String getDeviceCodename() { + return Build.DEVICE; + } + + @Override + public String getDeviceFingerprint() { + return Build.FINGERPRINT; + } + + @Override + public String getDeviceManufacturer() { + return Build.MANUFACTURER; + } + + @Override + public String getDeviceModel() { + return Build.MODEL; + } + + @Override + public String getDeviceString() { + return Build.MANUFACTURER + Build.MODEL; + } + + @Override + public String getDocumentPath() { + Context object = this.getApplicationContext(); + if (object == null) { + String s = System.getProperty("user.dir") + File.separator + "doc"; + return s + File.separator + "Nimble" + File.separator + this.m_core.getConfiguration().toString(); + } + String path = object.getFilesDir().getPath(); + return path + File.separator + "Nimble" + File.separator + this.m_core.getConfiguration().toString(); + } + + @Override + public String getGameSpecifiedPlayerId() { + return this.m_gameSpecifiedPlayerId; + } + + @Override + public String getGoogleAdvertisingId() { + long l2 = System.currentTimeMillis(); + while (!this.m_googleAdvertiserInfoLoaded) { + if (System.currentTimeMillis() - l2 > 5000L) { + this.m_googleAdvertiserInfoLoaded = true; + continue; + } + try { + Thread.sleep(1L); + } + catch (InterruptedException interruptedException) { + Helper.LOGI(this, "Blocking call to getGoogleAdvertisingId was interrupted prematurely."); + } + } + return this.m_googleAdvertisingId; + } + + @Override + public String getGoogleEmail() { + int n2 = 0; + AccountManager accountArray = AccountManager.get(this.getApplicationContext()); + Account[] accountsByType = accountArray.getAccountsByType("com.google"); + if (accountsByType.length > 0) { + return accountsByType[0].name; + } + Pattern emailAddress = Patterns.EMAIL_ADDRESS; + Account[] accounts = accountArray.getAccounts(); + int n3 = accounts.length; + while (n2 < n3) { + Account account = accounts[n2]; + if (emailAddress.matcher(account.name).matches()) { + return account.name; + } + ++n2; + } + return null; + } + + @Override + public boolean getIadAttribution() { + return false; + } + + @Override + public String getLogSourceTitle() { + return "AppEnv"; + } + + @Override + public String getMACAddress() { + Context context = this.getApplicationContext(); + if (context == null) { + return null; + } + WifiInfo wifi = ((WifiManager) context.getSystemService(Context.WIFI_SERVICE)).getConnectionInfo(); + if ( null != wifi ) return wifi.getMacAddress(); + return null; + } + + @Override + public String getOsVersion() { + return String.valueOf(Build.VERSION.SDK_INT); + } + + @Override + public String getShortApplicationLanguageCode() { + if (this.m_language == null) return this.m_language; + int n2 = this.m_language.indexOf(45); + if (n2 == -1) return this.m_language; + return this.m_language.substring(0, n2); + } + + @Override + public String getTempPath() { + return this.getCachePath() + File.separator + "temp"; + } + + @Override + public boolean isAppCracked() { + Helper.LOGDS("FraudDetection", "Returning false for isAppCracked() since it hasn't been implemented yet"); + return false; + } + + @Override + public boolean isDeviceRooted() { + String string2 = Build.TAGS; + if (string2 != null && string2.contains("test-keys")) { + return true; + } + if (new File("/system/app/Superuser.apk").exists()) return true; + if (ApplicationEnvironmentImpl.commandExists("su")) return true; + return false; + } + + @Override + public boolean isLimitAdTrackingEnabled() { + return this.m_googleLimitAdTrackingEnabled; + } + + @Override + public void refreshAgeCompliance() { + if (Network.getComponent().getStatus() != Network.Status.OK) { + Error error = new Error(Error.Code.NETWORK_NO_CONNECTION, "No network connection, Min Age cannot update."); + HashMap hashMap = new HashMap(); + hashMap.put("result", (Serializable)((Object)"0")); + hashMap.put("error", error); + Utility.sendBroadcastSerializable("nimble.notification.age_compliance_refreshed", hashMap); + return; + } + Object object = (SynergyRequest.SynergyRequestPreparingCallback) synergyRequest -> { + synergyRequest.baseUrl = SynergyEnvironment.getComponent().getServerUrlWithKey("geoip.url"); + synergyRequest.send(); + }; + SynergyNetworkConnectionCallback synergyNetworkConnectionCallback = new SynergyNetworkConnectionCallback(){ + + @Override + public void callback(SynergyNetworkConnectionHandle object) { + HashMap hashMap = new HashMap<>(); + if (object.getResponse().getError() == null) { + Integer n2 = (Integer)object.getResponse().getJsonData().get("code"); + + } else { + Helper.LOGD(this, "LOG_CALLBACK_ERROR : %s", object.getResponse().getError().getMessage()); + hashMap.put("result", (Serializable)((Object)"0")); + hashMap.put("error", object.getResponse().getError()); + } + Utility.sendBroadcastSerializable("nimble.notification.age_compliance_refreshed", hashMap); + } + }; + object = new SynergyRequest(SYNERGY_API_GET_AGE_REQUIREMENTS, IHttpRequest.Method.GET, (SynergyRequest.SynergyRequestPreparingCallback)object); + SynergyNetwork.getComponent().sendRequest((SynergyRequest)object, synergyNetworkConnectionCallback); + } + + @Override + protected void restore() { + Object object = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.applicationEnvironment", Persistence.Storage.DOCUMENT); + if (object == null) { + this.setApplicationLanguageCode(this.getDeviceLanguage(), true); + Helper.LOGWS("ApplicationEnvironment", "Persistence is null - Couldn't read Game Specified Player ID or Language from Persistence"); + return; + } + if (!Utility.validString(this.m_gameSpecifiedPlayerId)) { + Helper.LOGDS("ApplicationEnvironment", "Current game specified player ID is empty, reload from persistence"); + this.m_gameSpecifiedPlayerId = ((Persistence)object).getStringValue(NIMBLE_APPLICATIONENVIRONMENT_PERSISTENCE_GAME_SPECIFIED_ID); + } + if (Utility.validString((String)(object = ((Persistence)object).getStringValue(PERSISTENCE_LANGUAGE)))) { + Helper.LOGD(this, "Restored language %s from persistence.", this.m_language); + return; + } + Helper.LOGD(this, "Unable to restore language from persistence. Setting language to device language."); + this.setApplicationLanguageCode(this.getDeviceLanguage(), true); + } + + @Override + protected void resume() { + try { + this.retrieveGoogleAdvertiserId(); + return; + } + catch (VerifyError verifyError) {} + finally { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID because this device is not supported"); + return; + } + } + + @Override + public void setApplicationBundleId(String string2) { + this.m_packageId = string2; + } + + @Override + public void setApplicationLanguageCode(String string2) { + this.setApplicationLanguageCode(string2, false); + } + + @Override + public void setGameSpecifiedPlayerId(String object) { + this.m_gameSpecifiedPlayerId = object; + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.applicationEnvironment", Persistence.Storage.DOCUMENT); + if (object == null) { + Helper.LOGWS("ApplicationEnvironment", "Persistence is null - Couldn't save Game Specified Player ID to Persistence"); + return; + } + persistenceForNimbleComponent.setValue(NIMBLE_APPLICATIONENVIRONMENT_PERSISTENCE_GAME_SPECIFIED_ID, (Serializable)((Object)this.m_gameSpecifiedPlayerId)); + } + + @Override + protected void setup() { + this.m_context = s_currentActivity.getApplicationContext(); + try { + this.retrieveGoogleAdvertiserId(); + } + catch (VerifyError verifyError) {} + finally { + Helper.LOGW(this, "APP_ENV: Cannot get Google Advertising ID because this device is not supported"); + } + } + + @Override + protected void teardown() { + this.m_context = null; + } +} + diff --git a/app/src/main/java/com/ea/nimble/ApplicationLifecycle.java b/app/src/main/java/com/ea/nimble/ApplicationLifecycle.java new file mode 100644 index 0000000..22e26ec --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ApplicationLifecycle.java @@ -0,0 +1,78 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.Activity + * android.content.Intent + * android.os.Bundle + */ +package com.ea.nimble; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.BaseCore; +import com.ea.nimble.IApplicationLifecycle; + +public class ApplicationLifecycle { + public static final String COMPONENT_ID = "com.ea.nimble.applicationlifecycle"; + + public static IApplicationLifecycle getComponent() { + return BaseCore.getInstance().getApplicationLifecycle(); + } + + public static void onActivityCreate(Bundle bundle, Activity activity) { + ApplicationEnvironment.setCurrentActivity(activity); + ApplicationLifecycle.getComponent().notifyActivityCreate(bundle, activity); + } + + public static void onActivityDestroy(Activity activity) { + ApplicationLifecycle.getComponent().notifyActivityDestroy(activity); + } + + public static void onActivityPause(Activity activity) { + ApplicationLifecycle.getComponent().notifyActivityPause(activity); + } + + public static void onActivityRestart(Activity activity) { + ApplicationLifecycle.getComponent().notifyActivityRestart(activity); + } + + public static void onActivityRestoreInstanceState(Bundle bundle, Activity activity) { + ApplicationLifecycle.getComponent().notifyActivityRestoreInstanceState(bundle, activity); + } + + public static void onActivityResult(int n2, int n3, Intent intent, Activity activity) { + ApplicationLifecycle.getComponent().notifyActivityResult(n2, n3, intent, activity); + } + + public static void onActivityResume(Activity activity) { + ApplicationLifecycle.getComponent().notifyActivityResume(activity); + } + + public static void onActivityRetainNonConfigurationInstance() { + ApplicationLifecycle.getComponent().notifyActivityRetainNonConfigurationInstance(); + } + + public static void onActivitySaveInstanceState(Bundle bundle, Activity activity) { + ApplicationLifecycle.getComponent().notifyActivitySaveInstanceState(bundle, activity); + } + + public static void onActivityStart(Activity activity) { + ApplicationLifecycle.getComponent().notifyActivityStart(activity); + } + + public static void onActivityStop(Activity activity) { + ApplicationLifecycle.getComponent().notifyActivityStop(activity); + } + + public static void onActivityWindowFocusChanged(boolean bl2, Activity activity) { + ApplicationLifecycle.getComponent().notifyActivityWindowFocusChanged(bl2, activity); + } + + public static boolean onBackPressed() { + return ApplicationLifecycle.getComponent().handleBackPressed(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/ApplicationLifecycleImpl.java b/app/src/main/java/com/ea/nimble/ApplicationLifecycleImpl.java new file mode 100644 index 0000000..079fa29 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ApplicationLifecycleImpl.java @@ -0,0 +1,392 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.annotation.SuppressLint + * android.app.Activity + * android.content.Intent + * android.os.Build$VERSION + * android.os.Bundle + */ +package com.ea.nimble; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; + +import java.util.ArrayList; +import java.util.Iterator; + +class ApplicationLifecycleImpl +extends Component +implements IApplicationLifecycle, +LogSource { + private static final boolean RESTART_ON_CONFIG_CHANGE; + private ArrayList m_activityEventCallbacks; + private ArrayList m_activityLifecycleCallbacks; + private ArrayList m_applicationLifecycleCallbacks; + private BaseCore m_core; + private int m_createdActivityCount; + private int m_runningActivityCount; + private State m_state; + + static { + boolean bl2 = Build.VERSION.SDK_INT < 11; + RESTART_ON_CONFIG_CHANGE = bl2; + } + + ApplicationLifecycleImpl(BaseCore baseCore) { + this.m_core = baseCore; + this.m_state = State.INIT; + this.m_createdActivityCount = 0; + this.m_runningActivityCount = 0; + this.m_activityLifecycleCallbacks = new ArrayList(); + this.m_activityEventCallbacks = new ArrayList(); + this.m_applicationLifecycleCallbacks = new ArrayList(); + } + + private void notifyApplicationLaunch(Intent intent) { + Log.Helper.LOGD(this, "Application launch"); + Iterator iterator = this.m_applicationLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onApplicationLaunch(intent); + } + } + + private void notifyApplicationQuit() { + Iterator iterator = this.m_applicationLifecycleCallbacks.iterator(); + while (true) { + if (!iterator.hasNext()) { + Log.Helper.LOGD(this, "Application quit"); + return; + } + iterator.next().onApplicationQuit(); + } + } + + private void notifyApplicationResume() { + Log.Helper.LOGD(this, "Application resume"); + Iterator iterator = this.m_applicationLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onApplicationResume(); + } + } + + private void notifyApplicationSuspend() { + Iterator iterator = this.m_applicationLifecycleCallbacks.iterator(); + while (true) { + if (!iterator.hasNext()) { + Log.Helper.LOGD(this, "Application suspend"); + return; + } + iterator.next().onApplicationSuspend(); + } + } + + @Override + public String getComponentId() { + return "com.ea.nimble.applicationlifecycle"; + } + + @Override + public String getLogSourceTitle() { + return "AppLifecycle"; + } + + @Override + public boolean handleBackPressed() { + boolean bl2 = true; + for (ActivityEventCallbacks m_activityEventCallback : this.m_activityEventCallbacks) { + if (m_activityEventCallback.onBackPressed()) continue; + bl2 = false; + } + return bl2; + } + + @Override + public void notifyActivityCreate(Bundle bundle, Activity activity) { + Log.Helper.LOGV(this, "Activity %s CREATE", activity.getLocalClassName()); + if (this.m_state == State.INIT || this.m_state == State.QUIT) { + Log.Helper.LOGD(this, "Activity created clearly with state %s", this.m_state.toString()); + this.m_core.onApplicationLaunch(activity.getIntent()); + for (ActivityLifecycleCallbacks m_activityLifecycleCallback : this.m_activityLifecycleCallbacks) { + m_activityLifecycleCallback.onActivityCreated(activity, bundle); + } + this.notifyApplicationLaunch(activity.getIntent()); + this.m_createdActivityCount = 1; + this.m_state = State.LAUNCH; + if (this.m_runningActivityCount != 0) { + Log.Helper.LOGE(this, "Invalid running acitivity count %d", this.m_runningActivityCount); + this.m_runningActivityCount = 0; + } + } else if (this.m_state == State.CONFIG_CHANGE) { + if (ApplicationEnvironment.getCurrentActivity() != activity) { + Log.Helper.LOGE(this, "Activity created with state CONFIG_CHANGE but different activity %s and %s", ApplicationEnvironment.getCurrentActivity().getLocalClassName(), activity.getLocalClassName()); + } else { + Log.Helper.LOGD(this, "Activity created from CONFIG_CHANGE, activity configuration changed"); + } + if (RESTART_ON_CONFIG_CHANGE) { + this.m_core.onApplicationResume(); + } + Iterator iterator = this.m_activityLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivityCreated(activity, bundle); + } + if (this.m_runningActivityCount != 0) { + Log.Helper.LOGE(this, "Invalid running acitivity count %d", this.m_runningActivityCount); + this.m_runningActivityCount = 0; + } + } else if (this.m_state == State.PAUSE) { + Log.Helper.LOGD(this, "Activity created from PAUSE, normal activity switch"); + for (ActivityLifecycleCallbacks m_activityLifecycleCallback : this.m_activityLifecycleCallbacks) { + m_activityLifecycleCallback.onActivityCreated(activity, bundle); + } + ++this.m_createdActivityCount; + } else if (this.m_state == State.SUSPEND) { + Log.Helper.LOGD(this, "Activity created from SUSPEND, external activity switch; (new) app restart"); + this.m_core.onApplicationResume(); + this.m_state = State.RESUME; + Iterator iterator = this.m_activityLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivityCreated(activity, bundle); + } + ++this.m_createdActivityCount; + if (this.m_runningActivityCount != 0) { + Log.Helper.LOGE(this, "Invalid running acitivity count %d", this.m_runningActivityCount); + this.m_runningActivityCount = 0; + } + } else { + Log.Helper.LOGE(this, "Activity created with %s state, shouldn't happen", this.m_state.toString()); + } + Log.Helper.LOGV(this, "State after created %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount); + } + + @Override + public void notifyActivityDestroy(Activity activity) { + Log.Helper.LOGV(this, "Activity %s DESTROY", activity.getLocalClassName()); + for (ActivityLifecycleCallbacks m_activityLifecycleCallback : this.m_activityLifecycleCallbacks) { + m_activityLifecycleCallback.onActivityDestroyed(activity); + } + if (this.m_state != State.CONFIG_CHANGE) { + if (this.m_state != State.SUSPEND && this.m_state != State.RUN) { + Log.Helper.LOGE(this, "Activity destroy on invalid state %s", this.m_state.toString()); + } + --this.m_createdActivityCount; + if (this.m_createdActivityCount == 0) { + this.m_state = State.QUIT; + this.notifyApplicationQuit(); + this.m_core.onApplicationQuit(); + } + } + Log.Helper.LOGV(this, "State after destroy %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount); + } + + @Override + public void notifyActivityPause(Activity activity) { + Log.Helper.LOGV(this, "Activity %s PAUSE", activity.getLocalClassName()); + Iterator iterator = this.m_activityLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivityPaused(activity); + } + if (this.m_state != State.RUN) { + Log.Helper.LOGE(this, "Activity pause on invalid state %s", activity.getLocalClassName()); + } + this.m_state = State.PAUSE; + Log.Helper.LOGV(this, "State after pause %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount); + } + + @Override + public void notifyActivityRestart(Activity activity) { + Log.Helper.LOGV(this, "Activity %s RESTART", activity.getLocalClassName()); + ApplicationEnvironment.setCurrentActivity(activity); + if (this.m_state == State.PAUSE) { + Log.Helper.LOGD(this, "Activity restart from PAUSE, normal activity switch"); + } else if (this.m_state == State.SUSPEND) { + this.m_core.onApplicationResume(); + this.m_state = State.RESUME; + Log.Helper.LOGD(this, "Activity restart from SUSPEND, external activity switch; (new) app restart"); + } else { + Log.Helper.LOGE(this, "Activity restart with invalid state %s", this.m_state.toString()); + } + Log.Helper.LOGV(this, "State after restart %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount); + } + + @Override + public void notifyActivityRestoreInstanceState(Bundle bundle, Activity activity) { + Log.Helper.LOGV(this, "Activity %s RESTORE_STATE", activity.getLocalClassName()); + } + + @Override + public void notifyActivityResult(int n2, int n3, Intent intent, Activity activity) { + Iterator iterator = this.m_activityEventCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivityResult(activity, n2, n3, intent); + } + } + + @Override + public void notifyActivityResume(Activity activity) { + Log.Helper.LOGV(this, "Activity %s RESUME", activity.getLocalClassName()); + ApplicationEnvironment.setCurrentActivity(activity); + Iterator iterator = this.m_activityLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivityResumed(activity); + } + if (this.m_state != State.PAUSE) { + Log.Helper.LOGE(this, "Activity resume on invalid state %s", this.m_state.toString()); + Log.Helper.LOGE(this, "Please double check if the game's activity hooks ApplicationLifecycle.onActivityRestart() correctly."); + } + this.m_state = State.RUN; + Log.Helper.LOGV(this, "State after resume %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount); + } + + @Override + public void notifyActivityRetainNonConfigurationInstance() { + if (!RESTART_ON_CONFIG_CHANGE) return; + if (this.m_state != State.SUSPEND) { + Log.Helper.LOGW(this, "configuration change should happen between onStop() and onDestroy(), but state is %s", this.m_state.toString()); + } + this.m_state = State.CONFIG_CHANGE; + } + + @Override + public void notifyActivitySaveInstanceState(Bundle bundle, Activity activity) { + Log.Helper.LOGV(this, "Activity %s SAVE_STATE", activity.getLocalClassName()); + Iterator iterator = this.m_activityLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivitySaveInstanceState(activity, bundle); + } + } + + @Override + public void notifyActivityStart(Activity activity) { + Log.Helper.LOGV(this, "Activity %s START", activity.getLocalClassName()); + ApplicationEnvironment.setCurrentActivity(activity); + if (this.m_state == State.LAUNCH) { + this.m_state = State.PAUSE; + Log.Helper.LOGD(this, "Activity start with LAUNCH state, normal app start"); + } else if (this.m_state == State.RESUME) { + Iterator iterator = this.m_activityLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivityStarted(activity); + } + this.notifyApplicationResume(); + this.m_state = State.PAUSE; + Log.Helper.LOGD(this, "Activity start with RESUME state, set to PAUSE"); + } else if (this.m_state == State.CONFIG_CHANGE) { + Iterator iterator = this.m_activityLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivityStarted(activity); + } + if (RESTART_ON_CONFIG_CHANGE) { + this.notifyApplicationResume(); + } + this.m_state = State.PAUSE; + Log.Helper.LOGD(this, "Activity start with CONFIG_CHANGE state, set to PAUSE"); + } else if (this.m_state == State.PAUSE) { + Log.Helper.LOGD(this, "Activity start with PAUSE state, normal activity switch"); + } else { + Iterator iterator = this.m_activityLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivityStarted(activity); + } + Log.Helper.LOGE(this, "Activity start with invalid state %s", this.m_state.toString()); + } + ++this.m_runningActivityCount; + Log.Helper.LOGV(this, "State after start %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount); + } + + @Override + @SuppressLint(value={"NewApi"}) + public void notifyActivityStop(Activity activity) { + Log.Helper.LOGV(this, "Activity %s STOP", activity.getLocalClassName()); + Iterator iterator = this.m_activityLifecycleCallbacks.iterator(); + while (iterator.hasNext()) { + iterator.next().onActivityStopped(activity); + } + --this.m_runningActivityCount; + if (!RESTART_ON_CONFIG_CHANGE && activity.isChangingConfigurations()) { + this.m_state = State.CONFIG_CHANGE; + } else { + if (this.m_runningActivityCount == 0) { + if (this.m_state != State.PAUSE && this.m_state != State.SUSPEND) { + Log.Helper.LOGW(this, "Interesting case %s, HIGHLIGHT!!", new Object[]{this.m_state}); + } + this.m_state = State.SUSPEND; + if (!activity.isFinishing()) { + this.notifyApplicationSuspend(); + this.m_core.onApplicationSuspend(); + } + } else if (this.m_state == State.PAUSE) { + this.m_state = State.SUSPEND; + if (!activity.isFinishing()) { + Log.Helper.LOGW(this, "running activity count may be messed"); + this.notifyApplicationSuspend(); + this.m_core.onApplicationSuspend(); + } + } else if (this.m_state != State.RUN) { + Log.Helper.LOGE(this, "Activity stop on invalid state %s", this.m_state.toString()); + } + if (ApplicationEnvironment.getCurrentActivity() == activity) { + ApplicationEnvironment.setCurrentActivity(null); + } + } + Log.Helper.LOGV(this, "State after stop %s (%d, %d)", this.m_state.toString(), this.m_createdActivityCount, this.m_runningActivityCount); + } + + @Override + public void notifyActivityWindowFocusChanged(boolean bl2, Activity object) { + } + + @Override + public void registerActivityEventCallbacks(IApplicationLifecycle.ActivityEventCallbacks activityEventCallbacks) { + this.m_activityEventCallbacks.add(activityEventCallbacks); + } + + @Override + public void registerActivityLifecycleCallbacks(IApplicationLifecycle.ActivityLifecycleCallbacks activityLifecycleCallbacks) { + this.m_activityLifecycleCallbacks.add(activityLifecycleCallbacks); + } + + @Override + public void registerApplicationLifecycleCallbacks(IApplicationLifecycle.ApplicationLifecycleCallbacks applicationLifecycleCallbacks) { + this.m_applicationLifecycleCallbacks.add(applicationLifecycleCallbacks); + } + + @Override + protected void teardown() { + this.m_activityLifecycleCallbacks.clear(); + this.m_activityEventCallbacks.clear(); + this.m_applicationLifecycleCallbacks.clear(); + } + + @Override + public void unregisterActivityEventCallbacks(IApplicationLifecycle.ActivityEventCallbacks activityEventCallbacks) { + this.m_activityEventCallbacks.remove(activityEventCallbacks); + } + + @Override + public void unregisterActivityLifecycleCallbacks(IApplicationLifecycle.ActivityLifecycleCallbacks activityLifecycleCallbacks) { + this.m_activityLifecycleCallbacks.remove(activityLifecycleCallbacks); + } + + @Override + public void unregisterApplicationLifecycleCallbacks(IApplicationLifecycle.ApplicationLifecycleCallbacks applicationLifecycleCallbacks) { + this.m_applicationLifecycleCallbacks.remove(applicationLifecycleCallbacks); + } + + private static enum State { + INIT, + LAUNCH, + RESUME, + RUN, + PAUSE, + SUSPEND, + QUIT, + CONFIG_CHANGE; + + } +} + diff --git a/app/src/main/java/com/ea/nimble/BackgroundNetworkConnection.java b/app/src/main/java/com/ea/nimble/BackgroundNetworkConnection.java new file mode 100644 index 0000000..26ad2b8 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/BackgroundNetworkConnection.java @@ -0,0 +1,16 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +public class BackgroundNetworkConnection +extends NetworkConnection { + public BackgroundNetworkConnection(NetworkImpl networkImpl, HttpRequest httpRequest, IOperationalTelemetryDispatch iOperationalTelemetryDispatch) { + super(networkImpl, httpRequest, iOperationalTelemetryDispatch); + } + + @Override + public void cancelForAppSuspend() { + } +} + diff --git a/app/src/main/java/com/ea/nimble/Base.java b/app/src/main/java/com/ea/nimble/Base.java new file mode 100644 index 0000000..d78b109 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Base.java @@ -0,0 +1,39 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.BaseCore; +import com.ea.nimble.Component; +import com.ea.nimble.NimbleConfiguration; + +public class Base { + public static Component getComponent(String string2) { + return BaseCore.getInstance().activeValidate().getComponentManager().getComponent(string2); + } + + public static Component[] getComponentList(String string2) { + return BaseCore.getInstance().activeValidate().getComponentManager().getComponentList(string2); + } + + public static NimbleConfiguration getConfiguration() { + return BaseCore.getInstance().getConfiguration(); + } + + public static void registerComponent(Component component, String string2) { + BaseCore.getInstance().getComponentManager().registerComponent(component, string2); + } + + public static void restartWithConfiguration(NimbleConfiguration nimbleConfiguration) { + BaseCore.getInstance().activeValidate().restartWithConfiguration(nimbleConfiguration); + } + + public static void setupNimble() { + BaseCore.getInstance().setup(); + } + + public static void teardownNimble() { + BaseCore.getInstance().teardown(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/BaseCore.java b/app/src/main/java/com/ea/nimble/BaseCore.java new file mode 100644 index 0000000..2f654bc --- /dev/null +++ b/app/src/main/java/com/ea/nimble/BaseCore.java @@ -0,0 +1,371 @@ +package com.ea.nimble; + +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.content.pm.Signature; +import android.os.Handler; +import android.os.Looper; + +import java.io.ByteArrayInputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.util.Map; + +import javax.security.auth.x500.X500Principal; + +public class BaseCore implements IApplicationLifecycle.ApplicationLifecycleCallbacks { + public static final String NIMBLE_COMPONENT_LIST = "setting::components"; + public static final String NIMBLE_LOG_SETTING = "setting::log"; + public static final String NIMBLE_SERVER_CONFIG = "com.ea.nimble.configuration"; + protected static BaseCore s_core; + protected static boolean s_coreDestroyed = false; + protected ApplicationEnvironmentImpl m_applicationEnvironment; + protected IApplicationLifecycle m_applicationLifecycle; + protected ComponentManager m_componentManager; + protected NimbleConfiguration m_configuration; + protected LogImpl m_log; + protected PersistenceServiceImpl m_persistenceService; + protected State m_state; + + public static class AnonymousClass2 { + static final int[] $SwitchMap$com$ea$nimble$BaseCore$State = new int[State.values().length]; + + static { + try { + $SwitchMap$com$ea$nimble$BaseCore$State[State.INACTIVE.ordinal()] = 1; + } catch (NoSuchFieldError e) { + } + try { + $SwitchMap$com$ea$nimble$BaseCore$State[State.MANUAL_TEARDOWN.ordinal()] = 2; + } catch (NoSuchFieldError e2) { + } + try { + $SwitchMap$com$ea$nimble$BaseCore$State[State.DESTROY.ordinal()] = 3; + } catch (NoSuchFieldError e3) { + } + try { + $SwitchMap$com$ea$nimble$BaseCore$State[State.AUTO_SETUP.ordinal()] = 4; + } catch (NoSuchFieldError e4) { + } + try { + $SwitchMap$com$ea$nimble$BaseCore$State[State.MANUAL_SETUP.ordinal()] = 5; + } catch (NoSuchFieldError e5) { + } + try { + $SwitchMap$com$ea$nimble$BaseCore$State[State.QUITTING.ordinal()] = 6; + } catch (NoSuchFieldError e6) { + } + } + } + + /* loaded from: stdlib.jar:com/ea/nimble/BaseCore$State.class */ + public enum State { + INACTIVE, + AUTO_SETUP, + MANUAL_SETUP, + MANUAL_TEARDOWN, + QUITTING, + DESTROY + } + + BaseCore() { + } + + private void destroy() { + Log.Helper.LOGD(this, "NIMBLE DESTROY for Android will keep Core and Static components alive", new Object[0]); + } + + public static BaseCore getInstance() { + if (s_core == null) { + if (s_coreDestroyed) { + throw new AssertionError("Cannot revive destroyed BaseCore, please utilizesetupNimble() and tearDownNimble() explicitly to extend longevity to match your expectation."); + } + android.util.Log.d(Global.NIMBLE_ID, String.format("NIMBLE VERSION %s (Build %s)", "1.23.14.1217", "1.23.14.1217")); + s_core = new BaseCore(); + s_core.initialize(); + } + return s_core; + } + + private void initialize() { + this.m_state = State.INACTIVE; + loadConfiguration(); + this.m_componentManager = new ComponentManager(); + this.m_applicationLifecycle = new ApplicationLifecycleImpl(this); + this.m_applicationEnvironment = new ApplicationEnvironmentImpl(this); + this.m_log = (LogImpl) Log.getComponent(); + this.m_log.connectToCore(this); + this.m_persistenceService = new PersistenceServiceImpl(); + NetworkImpl networkImpl = new NetworkImpl(); + SynergyEnvironmentImpl synergyEnvironmentImpl = new SynergyEnvironmentImpl(this); + SynergyNetworkImpl synergyNetworkImpl = new SynergyNetworkImpl(); + SynergyIdManagerImpl synergyIdManagerImpl = new SynergyIdManagerImpl(); + OperationalTelemetryDispatchImpl operationalTelemetryDispatchImpl = new OperationalTelemetryDispatchImpl(); + this.m_componentManager.registerComponent(this.m_applicationEnvironment, ApplicationEnvironment.COMPONENT_ID); + this.m_componentManager.registerComponent(this.m_log, Log.COMPONENT_ID); + this.m_componentManager.registerComponent(this.m_persistenceService, PersistenceService.COMPONENT_ID); + this.m_componentManager.registerComponent(networkImpl, "com.ea.nimble.network"); + this.m_componentManager.registerComponent(synergyIdManagerImpl, SynergyIdManager.COMPONENT_ID); + this.m_componentManager.registerComponent(synergyEnvironmentImpl, SynergyEnvironment.COMPONENT_ID); + this.m_componentManager.registerComponent(synergyNetworkImpl, SynergyNetwork.COMPONENT_ID); + this.m_componentManager.registerComponent(operationalTelemetryDispatchImpl, OperationalTelemetryDispatch.COMPONENT_ID); + for (String str : getSettings(NIMBLE_COMPONENT_LIST).values()) { + try { + Method declaredMethod = Class.forName(str).getDeclaredMethod("initialize", new Class[0]); + declaredMethod.setAccessible(true); + declaredMethod.invoke(null, new Object[0]); + } catch (ClassNotFoundException e) { + Log.Helper.LOGD(this, "Component " + str + " not found", new Object[0]); + } catch (IllegalAccessException e2) { + Log.Helper.LOGE(this, "Method " + str + ".initialize() is not accessible", new Object[0]); + } catch (IllegalArgumentException e3) { + Log.Helper.LOGE(this, "Method " + str + ".initialize() should take no arguments", new Object[0]); + } catch (NoSuchMethodException e4) { + Log.Helper.LOGE(this, "No method " + str + ".initialize()", new Object[0]); + } catch (NullPointerException e5) { + Log.Helper.LOGE(this, "Method " + str + ".initialize() should be static", new Object[0]); + } catch (InvocationTargetException e6) { + Log.Helper.LOGE(this, "Method " + str + ".initialize() threw an exception", new Object[0]); + e6.printStackTrace(); + } + } + try { + if (!isAppSigned(ApplicationEnvironment.getComponent().getApplicationContext())) { + android.util.Log.e(Global.NIMBLE_ID, "This application is NOT signed with a valid certificate. MTX may not work correctly with this application"); + } else { + android.util.Log.i(Global.NIMBLE_ID, "This application is signed with a valid certificate."); + } + } catch (Exception e7) { + android.util.Log.e(Global.NIMBLE_ID, String.format("Unable to verify application signature. Message: %s", e7.getMessage())); + } + } + + protected static void injectMock(BaseCore baseCore) { + if (baseCore == null) { + s_core = null; + s_coreDestroyed = false; + return; + } + s_core = baseCore; + s_coreDestroyed = false; + } + + private boolean isAppSigned(Context context) { + return true; + } + + private void loadConfiguration() { + try { + String string = ApplicationEnvironment.getCurrentActivity().getPackageManager().getApplicationInfo(ApplicationEnvironment.getCurrentActivity().getPackageName(), 128).metaData.getString(NIMBLE_SERVER_CONFIG); + if (Utility.validString(string)) { + this.m_configuration = NimbleConfiguration.fromName(string); + if (this.m_configuration != NimbleConfiguration.UNKNOWN) { + if (this.m_configuration != NimbleConfiguration.CUSTOMIZED) { + return; + } + } + } + } catch (Exception e) { + } + android.util.Log.e(Global.NIMBLE_ID, "WARNING! Cannot find valid NimbleConfiguration from AndroidManifest.xml"); + this.m_configuration = NimbleConfiguration.LIVE; + } + + public BaseCore activeValidate() { + switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[this.m_state.ordinal()]) { + case 1: + Log.Helper.LOGF(this, "Access NimbleBaseCore before setup, call setupNimble() explicitly to activate it.", new Object[0]); + return null; + case 2: + Log.Helper.LOGF(this, "Access NimbleBaseCore after clean up, call setupNimble() explicitly again to activate it.", new Object[0]); + return null; + case 3: + Log.Helper.LOGF(this, "Accessing component after destroy, only static components are available right now.", new Object[0]); + return null; + default: + return this; + } + } + + public IApplicationEnvironment getApplicationEnvironment() { + return this.m_applicationEnvironment; + } + + public IApplicationLifecycle getApplicationLifecycle() { + return this.m_applicationLifecycle; + } + + public ComponentManager getComponentManager() { + return this.m_componentManager; + } + + public NimbleConfiguration getConfiguration() { + return this.m_configuration; + } + + public ILog getLog() { + return this.m_log; + } + + public IPersistenceService getPersistenceService() { + return this.m_persistenceService; + } + + public Map getSettings(String str) { + int identifier; + if (str == NIMBLE_LOG_SETTING) { + int identifier2 = ApplicationEnvironment.getComponent().getApplicationContext().getResources().getIdentifier("nimble_log", "xml", ApplicationEnvironment.getCurrentActivity().getPackageName()); + if (identifier2 == 0) { + return null; + } + return Utility.parseXmlFile(identifier2); + } else if (str != NIMBLE_COMPONENT_LIST || (identifier = ApplicationEnvironment.getComponent().getApplicationContext().getResources().getIdentifier("components", "xml", ApplicationEnvironment.getCurrentActivity().getPackageName())) == 0) { + return null; + } else { + return Utility.parseXmlFile(identifier); + } + } + + public boolean isActive() { + return this.m_state == State.AUTO_SETUP || this.m_state == State.MANUAL_SETUP; + } + + @Override // com.ea.nimble.IApplicationLifecycle.ApplicationLifecycleCallbacks + public void onApplicationLaunch(Intent intent) { + if (this.m_state == State.INACTIVE || this.m_state == State.DESTROY) { + this.m_componentManager.setup(); + Utility.sendBroadcast(Global.NOTIFICATION_COMPONENT_INDEPENDENT_SETUP_FINISHED, null); + this.m_state = State.AUTO_SETUP; + try { + this.m_componentManager.restore(); + } catch (AssertionError e) { + this.m_state = State.INACTIVE; + throw e; + } + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ApplicationLifecycleCallbacks + public void onApplicationQuit() { + switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[this.m_state.ordinal()]) { + case 1: + Log.Helper.LOGF(this, "No app start before app quit, something must be wrong.", new Object[0]); + return; + case 2: + default: + return; + case 3: + case 6: + Log.Helper.LOGF(this, "Double app quit, something must be wrong.", new Object[0]); + return; + case 4: + this.m_componentManager.suspend(); + return; + case 5: + this.m_componentManager.suspend(); + return; + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ApplicationLifecycleCallbacks + public void onApplicationResume() { + if (this.m_state == State.MANUAL_SETUP || this.m_state == State.AUTO_SETUP) { + this.m_componentManager.resume(); + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ApplicationLifecycleCallbacks + public void onApplicationSuspend() { + if (this.m_state == State.MANUAL_SETUP || this.m_state == State.AUTO_SETUP) { + this.m_componentManager.suspend(); + } + } + + public void restartWithConfiguration(final NimbleConfiguration nimbleConfiguration) { + Log.Helper.LOGE(this, ">>>>>>>>>>>>>>>>>>>>>>", new Object[0]); + Log.Helper.LOGE(this, "restartWithConfiguration should not be used in an integration. This function is for QA testing purposes.", new Object[0]); + Log.Helper.LOGE(this, ">>>>>>>>>>>>>>>>>>>>>>", new Object[0]); + 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 + /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */ + @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, null); + BaseCore.this.m_componentManager.restore(); + return; + case 6: + break; + default: + return; + } + Log.Helper.LOGF(this, "Cannot restart Nimble when app is quiting", new Object[0]); + } + }); + } + } + + public void setup() { + switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[this.m_state.ordinal()]) { + case 1: + case 2: + this.m_componentManager.setup(); + this.m_state = State.MANUAL_SETUP; + Utility.sendBroadcast(Global.NOTIFICATION_COMPONENT_INDEPENDENT_SETUP_FINISHED, null); + this.m_componentManager.restore(); + return; + case 3: + case 5: + case 6: + Log.Helper.LOGF(this, "Multiple setupNimble() calls without teardownNimble().", new Object[0]); + return; + case 4: + this.m_state = State.MANUAL_SETUP; + return; + default: + return; + } + } + + /* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */ + public void teardown() { + switch (AnonymousClass2.$SwitchMap$com$ea$nimble$BaseCore$State[this.m_state.ordinal()]) { + case 1: + case 4: + Log.Helper.LOGF(this, "Cannot teardownNimble() before setupNimble().", new Object[0]); + break; + case 2: + case 3: + break; + case 5: + this.m_componentManager.cleanup(); + this.m_state = State.MANUAL_TEARDOWN; + this.m_componentManager.teardown(); + return; + case 6: + this.m_state = State.DESTROY; + destroy(); + return; + default: + return; + } + Log.Helper.LOGF(this, "Multiple teardownNimble() calls without setupNibmle().", new Object[0]); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/ea/nimble/ByteBufferIOStream.java b/app/src/main/java/com/ea/nimble/ByteBufferIOStream.java new file mode 100644 index 0000000..12dd844 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ByteBufferIOStream.java @@ -0,0 +1,305 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.ListIterator; + +public class ByteBufferIOStream { + protected static final int SEGMENT_SIZE = 4096; + protected int m_availableSegment = 0; + protected LinkedList m_buffer = new LinkedList<>(); + protected boolean m_closed = false; + protected ByteBufferInputStream m_input = new ByteBufferInputStream(); + protected ByteBufferOutputStream m_output = new ByteBufferOutputStream(); + protected int m_readPosition = 0; + protected int m_writePosition = 0; + + public ByteBufferIOStream() { + this(1); + } + + public ByteBufferIOStream(int n2) { + int n3 = n2; + if (n2 <= 0) { + n3 = 1; + } + n3 = (n3 - 1) / 4096; + n2 = 0; + while (n2 < n3 + 1) { + this.m_buffer.add(new byte[4096]); + ++n2; + } + } + + public void appendSegmentToBuffer(byte[] byArray, int n2) throws IOException { + if (this.m_writePosition == 0 && byArray.length == 4096) { + ListIterator listIterator = this.m_buffer.listIterator(); + for (int i2 = 0; i2 < this.m_availableSegment; ++i2) { + listIterator.next(); + } + listIterator.add(byArray); + if (n2 != 4096) { + this.m_writePosition = n2; + return; + } + ++this.m_availableSegment; + return; + } + this.getOutputStream().write(byArray, 0, n2); + } + + public int available() throws IOException { + return this.m_input.available(); + } + + public void clear() { + this.m_closed = false; + this.m_availableSegment = 0; + this.m_writePosition = 0; + this.m_readPosition = 0; + } + + protected void closeIOStream() { + this.m_closed = true; + } + + public InputStream getInputStream() { + return this.m_input; + } + + public OutputStream getOutputStream() { + return this.m_output; + } + + public byte[] growBufferBySegment() throws IOException { + if (this.m_writePosition != 0) { + throw new IOException("Bad location to grow buffer"); + } + ListIterator listIterator = this.m_buffer.listIterator(); + int n2 = 0; + while (true) { + if (n2 >= this.m_availableSegment) { + byte[] byArray = new byte[4096]; + listIterator.add(byArray); + ++this.m_availableSegment; + return byArray; + } + listIterator.next(); + ++n2; + } + } + + public byte[] prepareSegment() { + if (this.m_availableSegment + 1 >= this.m_buffer.size()) { + return new byte[4096]; + } + if (this.m_buffer.size() != 0) return this.m_buffer.removeLast(); + return null; + } + + protected class ByteBufferInputStream + extends InputStream { + protected ByteBufferInputStream() { + } + + @Override + public int available() throws IOException { + if (!ByteBufferIOStream.this.m_closed) return ByteBufferIOStream.this.m_availableSegment * 4096 + ByteBufferIOStream.this.m_writePosition - ByteBufferIOStream.this.m_readPosition; + throw new IOException("ByteBufferIOStream is closed"); + } + + @Override + public void close() throws IOException { + ByteBufferIOStream.this.closeIOStream(); + } + + @Override + public boolean markSupported() { + return false; + } + + @Override + public int read() throws IOException { + if (this.available() <= 0) { + throw new IOException("Nothing to read in ByteBufferIOStream"); + } + byte by2 = ByteBufferIOStream.this.m_buffer.getFirst()[ByteBufferIOStream.this.m_readPosition]; + ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this; + ++byteBufferIOStream.m_readPosition; + if (ByteBufferIOStream.this.m_readPosition < 4096) return by2; + ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll()); + ByteBufferIOStream.this.m_readPosition = 0; + byteBufferIOStream = ByteBufferIOStream.this; + --byteBufferIOStream.m_availableSegment; + return by2; + } + + @Override + public int read(byte[] byArray) throws IOException { + return this.read(byArray, 0, byArray.length); + } + + @Override + public int read(byte[] object, int n2, int n3) throws IOException { + if (n2 < 0) throw new IndexOutOfBoundsException("The reading range of out of buffer boundary."); + if (n3 < 0) throw new IndexOutOfBoundsException("The reading range of out of buffer boundary."); + if (n2 + n3 > ((byte[])object).length) { + throw new IndexOutOfBoundsException("The reading range of out of buffer boundary."); + } + int n4 = this.available(); + if (n4 <= 0) { + return -1; + } + int n5 = n3; + if (n3 > n4) { + n5 = n4; + } + if (n5 < (n3 = 4096 - ByteBufferIOStream.this.m_readPosition)) { + System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), ByteBufferIOStream.this.m_readPosition, object, n2, n5); + ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this; + byteBufferIOStream.m_readPosition += n5; + return n5; + } + System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), ByteBufferIOStream.this.m_readPosition, object, n2, n3); + ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll()); + n4 = n5 - n3; + n2 += n3; + int n6 = n4 / 4096; + n3 = 0; + while (true) { + if (n3 >= n6) { + System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), 0, object, n2, n4); + ByteBufferIOStream.this.m_readPosition = n4; + ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this; + byteBufferIOStream.m_availableSegment -= n6 + 1; + return n5; + } + System.arraycopy(ByteBufferIOStream.this.m_buffer.getFirst(), 0, object, n2, 4096); + ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll()); + n4 -= 4096; + n2 += 4096; + ++n3; + } + } + + @Override + public long skip(long l2) throws IOException { + int n2; + int n3 = this.available(); + if (n3 <= 0) { + return 0L; + } + long l3 = l2; + if (l2 > (long)n3) { + l3 = n3; + } + if ((n3 = (int)l3) < (n2 = 4096 - ByteBufferIOStream.this.m_readPosition)) { + ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this; + byteBufferIOStream.m_readPosition += n3; + return l3; + } + ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll()); + n2 = n3 - n2; + int n4 = n2 / 4096; + n3 = 0; + while (true) { + if (n3 >= n4) { + ByteBufferIOStream.this.m_readPosition = n2; + ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this; + byteBufferIOStream.m_availableSegment -= n4 + 1; + return l3; + } + ByteBufferIOStream.this.m_buffer.add(ByteBufferIOStream.this.m_buffer.poll()); + n2 -= 4096; + ++n3; + } + } + } + + protected class ByteBufferOutputStream + extends OutputStream { + protected ByteBufferOutputStream() { + } + + @Override + public void close() throws IOException { + ByteBufferIOStream.this.closeIOStream(); + } + + @Override + public void write(int n2) throws IOException { + if (ByteBufferIOStream.this.m_closed) { + throw new IOException("ByteBufferIOStream is closed"); + } + ByteBufferIOStream.this.m_buffer.getFirst()[ByteBufferIOStream.this.m_writePosition] = (byte)n2; + ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this; + ++byteBufferIOStream.m_writePosition; + if (ByteBufferIOStream.this.m_writePosition != 4096) return; + ByteBufferIOStream.this.m_writePosition = 0; + byteBufferIOStream = ByteBufferIOStream.this; + ++byteBufferIOStream.m_availableSegment; + } + + @Override + public void write(byte[] byArray) throws IOException { + this.write(byArray, 0, byArray.length); + } + + @Override + public void write(byte[] object, int n2, int n3) throws IOException { + int n4; + if (n2 < 0) throw new IndexOutOfBoundsException("The writing range is out of buffer boundary."); + if (n3 < 0) throw new IndexOutOfBoundsException("The writing range is out of buffer boundary."); + if (n2 + n3 > ((byte[])object).length) { + throw new IndexOutOfBoundsException("The writing range is out of buffer boundary."); + } + if (ByteBufferIOStream.this.m_closed) { + throw new IOException("ByteBufferIOStream is closed"); + } + int n5 = 4096 - ByteBufferIOStream.this.m_writePosition; + Iterator iterator = ByteBufferIOStream.this.m_buffer.iterator(); + for (n4 = 0; n4 < ByteBufferIOStream.this.m_availableSegment; ++n4) { + iterator.next(); + } + if (n3 < n5) { + System.arraycopy(object, n2, iterator.next(), ByteBufferIOStream.this.m_writePosition, n3); + ByteBufferIOStream byteBufferIOStream = ByteBufferIOStream.this; + byteBufferIOStream.m_writePosition += n3; + return; + } + System.arraycopy(object, n2, iterator.next(), ByteBufferIOStream.this.m_writePosition, n5); + n4 = n2 + n5; + Object object2 = ByteBufferIOStream.this; + ++((ByteBufferIOStream)object2).m_availableSegment; + ByteBufferIOStream.this.m_writePosition = 0; + n2 = n3 -= n5; + n3 = n4; + while (n2 > 0) { + if (iterator.hasNext()) { + object2 = (byte[])iterator.next(); + } else { + object2 = new byte[4096]; + ByteBufferIOStream.this.m_buffer.add((byte[])object2); + } + if (n2 < 4096) { + System.arraycopy(object, n3, object2, 0, n2); + ByteBufferIOStream.this.m_writePosition = n2; + n2 = 0; + continue; + } + System.arraycopy(object, n3, object2, 0, 4096); + n2 -= 4096; + n3 += 4096; + object2 = ByteBufferIOStream.this; + ++((ByteBufferIOStream)object2).m_availableSegment; + } + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/Component.java b/app/src/main/java/com/ea/nimble/Component.java new file mode 100644 index 0000000..6509932 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Component.java @@ -0,0 +1,27 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +public abstract class Component { + protected void cleanup() { + } + + public abstract String getComponentId(); + + protected void restore() { + } + + protected void resume() { + } + + protected void setup() { + } + + protected void suspend() { + } + + protected void teardown() { + } +} + diff --git a/app/src/main/java/com/ea/nimble/ComponentManager.java b/app/src/main/java/com/ea/nimble/ComponentManager.java new file mode 100644 index 0000000..b16fe0b --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ComponentManager.java @@ -0,0 +1,151 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Component; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Utility; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.ListIterator; +import java.util.Map; + +class ComponentManager +implements LogSource { + private Map m_components = new LinkedHashMap(); + private Stage m_stage = Stage.CREATE; + + ComponentManager() { + } + + void cleanup() { + ListIterator listIterator = new ArrayList(this.m_components.values()).listIterator(this.m_components.size()); + while (true) { + if (!listIterator.hasPrevious()) { + this.m_stage = Stage.CREATE; + return; + } + listIterator.previous().cleanup(); + } + } + + Component getComponent(String string2) { + return this.m_components.get(string2); + } + + Component[] getComponentList(String string2) { + ArrayList arrayList = new ArrayList(this.m_components.size()); + Iterator> iterator = this.m_components.entrySet().iterator(); + while (iterator.hasNext()) { + Map.Entry entry = iterator.next(); + if (!entry.getKey().startsWith(string2)) continue; + arrayList.add(entry.getValue()); + } + return arrayList.toArray(new Component[arrayList.size()]); + } + + @Override + public String getLogSourceTitle() { + return "Component"; + } + + void registerComponent(Component component, String string2) { + if (!Utility.validString(string2)) { + Log.Helper.LOGF(this, "Cannot register component without valid componentId", new Object[0]); + return; + } + if (component == null) { + Log.Helper.LOGF(this, "Try to register invalid component with id: " + string2, new Object[0]); + return; + } + Component component2 = this.m_components.get(string2); + if (component2 == null) { + Log.Helper.LOGI(this, "Register module: " + string2, new Object[0]); + } else { + Log.Helper.LOGI(this, "Register module(overwrite): " + string2, new Object[0]); + } + this.m_components.put(string2, component); + if (this.m_stage.compareTo(Stage.SETUP) < 0) return; + if (component2 != null) { + if (this.m_stage.compareTo(Stage.SETUP) >= 0) { + if (this.m_stage.compareTo(Stage.SUSPEND) >= 0) { + component2.resume(); + } + component2.cleanup(); + } + component2.teardown(); + } + component.setup(); + if (this.m_stage.compareTo(Stage.READY) < 0) return; + component.restore(); + if (this.m_stage.compareTo(Stage.SUSPEND) < 0) return; + component.suspend(); + } + + void restore() { + Iterator iterator = this.m_components.values().iterator(); + while (true) { + if (!iterator.hasNext()) { + this.m_stage = Stage.READY; + return; + } + iterator.next().restore(); + } + } + + void resume() { + Iterator iterator = this.m_components.values().iterator(); + while (true) { + if (!iterator.hasNext()) { + this.m_stage = Stage.READY; + return; + } + iterator.next().resume(); + } + } + + void setup() { + Iterator iterator = this.m_components.values().iterator(); + while (true) { + if (!iterator.hasNext()) { + this.m_stage = Stage.SETUP; + return; + } + iterator.next().setup(); + } + } + + void suspend() { + ListIterator listIterator = new ArrayList(this.m_components.values()).listIterator(this.m_components.size()); + while (true) { + if (!listIterator.hasPrevious()) { + this.m_stage = Stage.SUSPEND; + return; + } + listIterator.previous().suspend(); + } + } + + void teardown() { + ListIterator listIterator = new ArrayList(this.m_components.values()).listIterator(this.m_components.size()); + while (true) { + if (!listIterator.hasPrevious()) { + this.m_stage = Stage.CREATE; + return; + } + listIterator.previous().teardown(); + } + } + + private static enum Stage { + CREATE, + SETUP, + READY, + SUSPEND; + + } +} + diff --git a/app/src/main/java/com/ea/nimble/EASPDataLoader.java b/app/src/main/java/com/ea/nimble/EASPDataLoader.java new file mode 100644 index 0000000..62a4dcb --- /dev/null +++ b/app/src/main/java/com/ea/nimble/EASPDataLoader.java @@ -0,0 +1,178 @@ +package com.ea.nimble; + +import android.content.Context; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +/* loaded from: stdlib.jar:com/ea/nimble/EASPDataLoader.class */ +public class EASPDataLoader { + + /* loaded from: stdlib.jar:com/ea/nimble/EASPDataLoader$EASPDataBuffer.class */ + public static class EASPDataBuffer { + public ByteBuffer m_decryptedByteBuffer; + public String m_version; + + public EASPDataBuffer(String str, ByteBuffer byteBuffer) { + this.m_version = str; + this.m_decryptedByteBuffer = byteBuffer; + } + } + + /* loaded from: stdlib.jar:com/ea/nimble/EASPDataLoader$LogEvent.class */ + public static class LogEvent { + public int m_EAUID; + public long m_dateTimeInNanoseconds; + public int m_indexInsideSession; + public int m_keyType01; + public int m_keyType02; + public int m_keyType03; + public String m_randomPart; + public long m_timestamp; + public int m_type; + public int m_userLevel; + public String m_value01; + public String m_value02; + public String m_value03; + } + + public static boolean deleteDatFile(String str) { + File file = new File(str); + if (!file.exists()) { + return true; + } + return file.delete(); + } + + public static String getTrackingDatFilePath() { + Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); + return (applicationContext == null ? System.getProperty("user.dir") + File.separator + "doc" : applicationContext.getFilesDir().getPath()) + File.separator + "EASP" + File.separator + "Tracking" + File.separator + "tracking.dat"; + } + + public static EASPDataBuffer loadDatFile(String str) throws Exception { + Throwable th; + Exception e; + if (str == null || str.length() == 0) { + Log.Helper.LOGDS("Legacy", "Empty path passed to loadLegacyEASPDatFile"); + throw new NullPointerException(); + } + File file = new File(str); + if (!file.exists()) { + Log.Helper.LOGDS("Legacy", "Couldn't find EASP data file, " + str); + throw new FileNotFoundException("Non-existent or empty file, " + str + "."); + } + Log.Helper.LOGDS("Legacy", "Attempt to read EASP data file, %s, size %d.", str, file.length()); + FileInputStream fileInputStream = null; + BufferedInputStream bufferedInputStream = null; + try { + fileInputStream = new FileInputStream(file); + bufferedInputStream = new BufferedInputStream(fileInputStream); + byte[] bArr = new byte[(int) file.length()]; + int read = bufferedInputStream.read(bArr); + Cipher instance = Cipher.getInstance("AES/CBC/NoPadding"); + instance.init(2, new SecretKeySpec(new byte[]{-25, -17, -122, 91, 109, -87, 10, 61, 57, 50, 14, -5, -108, 24, -28, -25, -58, 20, 24, Byte.MAX_VALUE, 59, -107, -123, -38, 101, 43, -82, 117, 27, -62, -102, 55}, "AES"), new IvParameterSpec(bArr, 8, 16)); + ByteBuffer wrap = ByteBuffer.wrap(instance.doFinal(bArr, 24, read - 24)); + wrap.order(ByteOrder.LITTLE_ENDIAN); + EASPDataBuffer eASPDataBuffer = new EASPDataBuffer(readString(wrap), wrap.slice().order(ByteOrder.LITTLE_ENDIAN)); + try { + fileInputStream.close(); + bufferedInputStream.close(); + } catch (IOException e2) { + Log.Helper.LOGES("Legacy", "Exception closing file stream, for file, %s.", str); + } + return eASPDataBuffer; + + } catch (Exception e4) { + Log.Helper.LOGES("Legacy", "Exception reading EASP data file, %s: %s", str, e4.toString()); + e4.printStackTrace(); + } + + return null; + + } + + public static String loadEADeviceId() { + try { + EASPDataBuffer loadDatFile = loadDatFile(ApplicationEnvironment.getComponent().getApplicationContext().getFilesDir().getPath() + "/EASP/commoninfo.dat"); + if (!loadDatFile.m_version.equals("1.00.02")) { + return null; + } + ByteBuffer byteBuffer = loadDatFile.m_decryptedByteBuffer; + readString(byteBuffer); + readBooleanByte(byteBuffer); + return readString(byteBuffer); + } catch (Exception e) { + Log.Helper.LOGES("Legacy", "Exception when trying to load EASP data: %s", e); + return null; + } + } + + public static boolean readBooleanByte(ByteBuffer byteBuffer) { + return byteBuffer.get() != 0; + } + + public static LogEvent readLogEvent(ByteBuffer byteBuffer) throws IOException { + LogEvent logEvent = new LogEvent(); + try { + if (!readBooleanByte(byteBuffer)) { + return null; + } + logEvent.m_type = byteBuffer.getInt(); + logEvent.m_indexInsideSession = byteBuffer.getInt(); + logEvent.m_dateTimeInNanoseconds = byteBuffer.getLong(); + logEvent.m_EAUID = byteBuffer.getInt(); + logEvent.m_randomPart = readString(byteBuffer); + logEvent.m_keyType01 = byteBuffer.getInt(); + logEvent.m_value01 = readString(byteBuffer); + logEvent.m_keyType02 = byteBuffer.getInt(); + logEvent.m_value02 = readString(byteBuffer); + logEvent.m_timestamp = byteBuffer.getLong(); + logEvent.m_keyType03 = byteBuffer.getInt(); + logEvent.m_value03 = readString(byteBuffer); + logEvent.m_userLevel = byteBuffer.getInt(); + return logEvent; + } catch (IOException e) { + Log.Helper.LOGES("Legacy", "Exception reading LogEvent: " + e, new Object[0]); + throw e; + } + } + + public static String readString(ByteBuffer byteBuffer) throws IOException { + Exception e; + int i = byteBuffer.getInt(); + if (i <= 0) { + return null; + } + if (i > byteBuffer.remaining()) { + Log.Helper.LOGES("Legacy", "String length greater than buffer remaining bytes.", new Object[0]); + throw new IOException("String length uint32 corrupt, longer than remaining bytes."); + } + byte[] bArr = new byte[i]; + byteBuffer.get(bArr, 0, i); + String str = null; + try { + String str2 = new String(bArr, "UTF-8"); + try { + Log.Helper.LOGDS("Legacy", "Read string (%s)", str2); + return str2; + } catch (Exception e2) { + e = e2; + str = str2; + Log.Helper.LOGES("Legacy", "Read string exception: " + e); + return str; + } + } catch (Exception e3) { + e = e3; + } + return ""; + } +} diff --git a/app/src/main/java/com/ea/nimble/Encryptor.java b/app/src/main/java/com/ea/nimble/Encryptor.java new file mode 100644 index 0000000..695eebf --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Encryptor.java @@ -0,0 +1,57 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.annotation.SuppressLint + * android.os.Build$VERSION + */ +package com.ea.nimble; + +import android.annotation.SuppressLint; + +import com.ea.ironmonkey.devmenu.util.Observer; + +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.security.GeneralSecurityException; + +import javax.crypto.Cipher; +import javax.crypto.CipherInputStream; +import javax.crypto.CipherOutputStream; + +class Encryptor { + private static int ENCRYPTION_KEY_LENGHT = 128; + private static int ENCRYPTION_KEY_ROUND = 997; + private Cipher m_decryptor; + private Cipher m_encryptor; + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Could not resolve type clashes + * Unable to fully structure code + */ + @SuppressLint(value={"NewApi"}) + private void initialize() throws GeneralSecurityException { + Observer.onCallingMethod(); + } + + public ObjectInputStream encryptInputStream(InputStream inputStream) throws IOException, GeneralSecurityException { + if (this.m_encryptor != null) { + if (this.m_encryptor != null) return new ObjectInputStream(new CipherInputStream(inputStream, this.m_decryptor)); + } + this.initialize(); + return new ObjectInputStream(new CipherInputStream(inputStream, this.m_decryptor)); + } + + public ObjectOutputStream encryptOutputStream(OutputStream outputStream) throws IOException, GeneralSecurityException { + if (this.m_encryptor != null) { + if (this.m_encryptor != null) return new ObjectOutputStream(new CipherOutputStream(outputStream, this.m_encryptor)); + } + this.initialize(); + return new ObjectOutputStream(new CipherOutputStream(outputStream, this.m_encryptor)); + } +} + diff --git a/app/src/main/java/com/ea/nimble/EnvironmentDataContainer.java b/app/src/main/java/com/ea/nimble/EnvironmentDataContainer.java new file mode 100644 index 0000000..ab3d1ec --- /dev/null +++ b/app/src/main/java/com/ea/nimble/EnvironmentDataContainer.java @@ -0,0 +1,325 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +class EnvironmentDataContainer +implements ISynergyEnvironment, +LogSource, +Externalizable { + private static final int SYNERGY_DIRECTOR_RESPONSE_APP_VERSION_OK = 0; + private static final int SYNERGY_DIRECTOR_RESPONSE_APP_VERSION_UPGRADE_RECOMMENDED = 1; + private static final int SYNERGY_DIRECTOR_RESPONSE_APP_VERSION_UPGRADE_REQUIRED = 2; + private String m_applicationLanguageCode = "en"; + private String m_eaDeviceId; + private Map m_getDirectionResponseDictionary = new HashMap(); + private Long m_lastDirectorResponseTimestamp; + private Map m_serverUrls; + private String m_synergyAnonymousId; + + @Override + public Error checkAndInitiateSynergyEnvironmentUpdate() { + return null; + } + + @Override + public String getEADeviceId() { + return this.m_eaDeviceId; + } + + @Override + public String getEAHardwareId() { + if (this.m_getDirectionResponseDictionary == null) return null; + if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("hwId"); + return null; + } + + Map getGetDirectionResponseDictionary() { + return this.m_getDirectionResponseDictionary; + } + + @Override + public String getGosMdmAppKey() { + if (this.m_getDirectionResponseDictionary == null) return null; + if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("mdmAppKey"); + return null; + } + + /* + * Unable to fully structure code + */ + public Set getKeysOfDifferences(ISynergyEnvironment var1_1) { + HashSet var2_3 = new HashSet(); + if (var1_1 == null) { + + if (Utility.stringsAreEquivalent(this.getEADeviceId(), var1_1.getEADeviceId())){ + var2_3.add("ENVIRONMENT_KEY_EADEVICEID"); + } + if (!Utility.stringsAreEquivalent(this.getEAHardwareId(), var1_1.getEAHardwareId())) { + var2_3.add("ENVIRONMENT_KEY_EAHARDWAREID"); + } + if (!Utility.stringsAreEquivalent(this.getSynergyId(), var1_1.getSynergyId())) { + var2_3.add("ENVIRONMENT_KEY_SYNERGYID"); + } + if (!Utility.stringsAreEquivalent(this.getSellId(), var1_1.getSellId())) { + var2_3.add("ENVIRONMENT_KEY_SELLID"); + } + if (!Utility.stringsAreEquivalent(this.getProductId(), var1_1.getProductId())) { + var2_3.add("ENVIRONMENT_KEY_PRODUCTID"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.drm"), var1_1.getServerUrlWithKey("synergy.drm"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_DRM"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.director"), var1_1.getServerUrlWithKey("synergy.director"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_DIRECTOR"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.m2u"), var1_1.getServerUrlWithKey("synergy.m2u"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_MESSAGE_TO_USER"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.product"), var1_1.getServerUrlWithKey("synergy.product"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_PRODUCT"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.tracking"), var1_1.getServerUrlWithKey("synergy.tracking"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_TRACKING"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.user"), var1_1.getServerUrlWithKey("synergy.user"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_USER"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("geoip.url"), var1_1.getServerUrlWithKey("geoip.url"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_CENTRAL_IP_GEOLOCATION"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("synergy.s2s"), var1_1.getServerUrlWithKey("synergy.s2s"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_SYNERGY_S2S"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("friends.url"), var1_1.getServerUrlWithKey("friends.url"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_ORIGIN_FRIENDS"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("eadp.friends.host"), var1_1.getServerUrlWithKey("eadp.friends.host"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_EADP_FRIENDS_HOST"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("avatars.url"), var1_1.getServerUrlWithKey("avatars.url"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_ORIGIN_AVATAR"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("origincasualapp.url"), var1_1.getServerUrlWithKey("origincasualapp.url"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_ORIGIN_CASUAL_APP"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("origincasualserver.url"), var1_1.getServerUrlWithKey("origincasualserver.url"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_ORIGIN_CASUAL_SERVER"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("akamai.url"), var1_1.getServerUrlWithKey("akamai.url"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_AKAMAI"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("dmg.url"), var1_1.getServerUrlWithKey("dmg.url"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_DYNAMIC_MORE_GAMES"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("mayhem.url"), var1_1.getServerUrlWithKey("mayhem.url"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_MAYHEM"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("nexus.connect"), var1_1.getServerUrlWithKey("nexus.connect"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_KEY_IDENTITY_CONNECT"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("nexus.proxy"), var1_1.getServerUrlWithKey("nexus.proxy"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_KEY_IDENTITY_PROXY"); + } + if (!Utility.stringsAreEquivalent(this.getServerUrlWithKey("nexus.portal"), var1_1.getServerUrlWithKey("nexus.portal"))) { + var2_3.add("ENVIRONMENT_KEY_SERVER_URL_KEY_IDENTITY_PORTAL"); + } + if (this.getLatestAppVersionCheckResult() != var1_1.getLatestAppVersionCheckResult()) { + var2_3.add("ENVIRONMENT_KEY_APP_VERSION_CHECK_RESULT"); + } + } + + if (var2_3.size() <= 0) return null; + return var2_3; + } + + @Override + public int getLatestAppVersionCheckResult() { + int n2 = 0; + if (this.m_getDirectionResponseDictionary == null) return -1; + if (this.m_getDirectionResponseDictionary.isEmpty()) { + return -1; + } + Object object = this.m_getDirectionResponseDictionary.get("appUpgrade"); + if (object instanceof Integer) { + n2 = (Integer)object; + } else if (object instanceof String) { + n2 = Integer.parseInt((String)object); + } + switch (n2) { + default: { + return 0; + } + case 0: { + return 0; + } + case 1: { + return 1; + } + case 2: + } + return 2; + } + + @Override + public String getLogSourceTitle() { + return "SynergyEnv"; + } + + Long getMostRecentDirectorResponseTimestamp() { + return this.m_lastDirectorResponseTimestamp; + } + + @Override + public String getNexusClientId() { + if (this.m_getDirectionResponseDictionary == null) return null; + if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("clientId"); + return null; + } + + @Override + public String getNexusClientSecret() { + if (this.m_getDirectionResponseDictionary == null) return null; + if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("clientSecret"); + return null; + } + + @Override + public String getProductId() { + if (this.m_getDirectionResponseDictionary == null) return null; + if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("productId"); + return null; + } + + @Override + public String getSellId() { + if (this.m_getDirectionResponseDictionary == null) return null; + if (!this.m_getDirectionResponseDictionary.isEmpty()) return (String)this.m_getDirectionResponseDictionary.get("sellId"); + return null; + } + + @Override + public String getServerUrlWithKey(String string2) { + if (this.m_serverUrls != null) return this.m_serverUrls.get(string2); + return null; + } + + Map getServerUrls() { + return this.m_serverUrls; + } + + String getSynergyAnonymousId() { + return this.m_synergyAnonymousId; + } + + @Override + public String getSynergyDirectorServerUrl(NimbleConfiguration nimbleConfiguration) { + return SynergyEnvironment.getComponent().getSynergyDirectorServerUrl(nimbleConfiguration); + } + + @Override + public String getSynergyId() { + return this.m_synergyAnonymousId; + } + + @Override + public int getTrackingPostInterval() { + if (this.m_getDirectionResponseDictionary == null) return -1; + if (this.m_getDirectionResponseDictionary.isEmpty()) { + return -1; + } + Integer n2 = (Integer)this.m_getDirectionResponseDictionary.get("telemetryFreq"); + if (n2 == null) return -1; + return n2; + } + + @Override + public boolean isDataAvailable() { + return true; + } + + @Override + public boolean isUpdateInProgress() { + return false; + } + + @Override + public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException { + this.m_getDirectionResponseDictionary = (Map)objectInput.readObject(); + if (this.m_getDirectionResponseDictionary.isEmpty()) { + this.m_getDirectionResponseDictionary = null; + } + this.m_serverUrls = (Map)objectInput.readObject(); + if (this.m_serverUrls.isEmpty()) { + this.m_serverUrls = null; + } + this.m_eaDeviceId = (String)objectInput.readObject(); + if (this.m_eaDeviceId.length() == 0) { + this.m_eaDeviceId = null; + } + this.m_synergyAnonymousId = (String)objectInput.readObject(); + if (this.m_synergyAnonymousId.length() == 0) { + this.m_synergyAnonymousId = null; + } + this.m_lastDirectorResponseTimestamp = objectInput.readLong(); + if (this.m_lastDirectorResponseTimestamp == 0L) { + this.m_lastDirectorResponseTimestamp = null; + } + this.m_applicationLanguageCode = (String)objectInput.readObject(); + if (this.m_applicationLanguageCode.length() != 0) return; + this.m_applicationLanguageCode = null; + } + + void setEADeviceId(String string2) { + this.m_eaDeviceId = string2; + } + + void setGetDirectionResponseDictionary(Map map) { + if (map != null) { + map.put("sellId", ((Integer)map.get("sellId")).toString()); + map.put("productId", ((Integer)map.get("productId")).toString()); + map.put("hwId", ((Integer)map.get("hwId")).toString()); + this.m_getDirectionResponseDictionary = map; + return; + } + this.m_getDirectionResponseDictionary = new HashMap(); + } + + void setMostRecentDirectorResponseTimestamp(Long l2) { + this.m_lastDirectorResponseTimestamp = l2; + } + + void setServerUrls(Map map) { + this.m_serverUrls = map; + } + + void setSynergyAnonymousId(String string2) { + this.m_synergyAnonymousId = string2; + } + + @Override + public void writeExternal(ObjectOutput objectOutput) throws IOException { + Object object = this.m_getDirectionResponseDictionary == null ? new HashMap() : this.m_getDirectionResponseDictionary; + objectOutput.writeObject(object); + object = this.m_serverUrls == null ? new HashMap() : this.m_serverUrls; + objectOutput.writeObject(object); + object = this.m_eaDeviceId == null ? "" : this.m_eaDeviceId; + objectOutput.writeObject(object); + object = this.m_synergyAnonymousId == null ? "" : this.m_synergyAnonymousId; + objectOutput.writeObject(object); + long l2 = this.m_lastDirectorResponseTimestamp == null ? 0L : this.m_lastDirectorResponseTimestamp; + objectOutput.writeLong(l2); + object = this.m_applicationLanguageCode == null ? "" : this.m_applicationLanguageCode; + objectOutput.writeObject(object); + } +} + diff --git a/app/src/main/java/com/ea/nimble/Error.java b/app/src/main/java/com/ea/nimble/Error.java new file mode 100644 index 0000000..8821da1 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Error.java @@ -0,0 +1,180 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Parcel + * android.os.Parcelable + * android.os.Parcelable$Creator + */ +package com.ea.nimble; + +import android.os.Parcel; +import android.os.Parcelable; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.PrintWriter; +import java.io.Serializable; +import java.io.StringWriter; + +public class Error +extends Exception +implements Parcelable, +Externalizable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator(){ + + public Error createFromParcel(Parcel parcel) { + return new Error(parcel); + } + + public Error[] newArray(int n2) { + return new Error[n2]; + } + }; + public static final String ERROR_DOMAIN = "NimbleError"; + private static final long serialVersionUID = 1L; + private int m_code; + private String m_domain; + + public Error() { + } + + public Error(Parcel parcel) { + this.readFromParcel(parcel); + } + + public Error(Code code, String string2) { + this(code, string2, null); + } + + public Error(Code code, String string2, Throwable throwable) { + this(ERROR_DOMAIN, code.intValue(), string2, throwable); + } + + public Error(String string2, int n2, String string3) { + this(string2, n2, string3, null); + } + + public Error(String string2, int n2, String string3, Throwable throwable) { + super(string3, throwable); + this.m_domain = string2; + this.m_code = n2; + } + + public int describeContents() { + return 0; + } + + public int getCode() { + return this.m_code; + } + + public String getDomain() { + return this.m_domain; + } + + public boolean isError(Code code) { + if (this.m_code != code.intValue()) return false; + return true; + } + + @Override + public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException { + this.m_domain = objectInput.readUTF(); + this.m_code = objectInput.readInt(); + this.initCause((Throwable)objectInput.readObject()); + } + + public void readFromParcel(Parcel parcel) { + this.m_domain = parcel.readString(); + this.m_code = parcel.readInt(); + this.initCause((Throwable)parcel.readSerializable()); + } + + @Override + public String toString() { + StringBuilder stringBuilder = new StringBuilder(); + if (this.m_domain != null && this.m_domain.length() > 0) { + stringBuilder.append(this.m_domain).append("("); + } else { + stringBuilder.append("Error").append("("); + } + stringBuilder.append(this.m_code).append(")"); + Object object = this.getLocalizedMessage(); + if (object != null && ((String)object).length() > 0) { + stringBuilder.append(": ").append((String)object); + } + if ((object = this.getCause()) == null) return stringBuilder.toString(); + stringBuilder.append("\nCaused by: "); + StringWriter stringWriter = new StringWriter(); + ((Throwable)object).printStackTrace(new PrintWriter(stringWriter)); + stringBuilder.append(stringWriter.toString()); + return stringBuilder.toString(); + } + + @Override + public void writeExternal(ObjectOutput objectOutput) throws IOException { + if (this.m_domain != null && this.m_domain.length() > 0) { + objectOutput.writeUTF(this.m_domain); + } else { + objectOutput.writeUTF(""); + } + objectOutput.writeInt(this.m_code); + objectOutput.writeObject(this.getCause()); + } + + public void writeToParcel(Parcel parcel, int n2) { + if (this.m_domain != null && this.m_domain.length() > 0) { + parcel.writeString(this.m_domain); + } else { + parcel.writeString(""); + } + parcel.writeInt(this.m_code); + Throwable throwable = this.getCause(); + if (throwable != null) { + parcel.writeSerializable((Serializable)throwable); + return; + } + parcel.writeSerializable((Serializable)((Object)"")); + } + + public static enum Code { + UNKNOWN(0), + SYSTEM_UNEXPECTED(100), + NOT_READY(101), + UNSUPPORTED(102), + NOT_AVAILABLE(103), + NOT_IMPLEMENTED(104), + INVALID_ARGUMENT(301), + MISSING_CALLBACK(300), + NETWORK_UNSUPPORTED_CONNECTION_TYPE(1001), + NETWORK_NO_CONNECTION(1002), + NETWORK_UNREACHABLE(1003), + NETWORK_OVERSIZE_DATA(1004), + NETWORK_OPERATION_CANCELLED(1005), + NETWORK_INVALID_SERVER_RESPONSE(1006), + NETWORK_TIMEOUT(1007), + NETWORK_CONNECTION_ERROR(1010), + SYNERGY_SERVER_FULL(2001), + SYNERGY_GET_DIRECTION_TIMEOUT(2002), + SYNERGY_GET_EA_DEVICE_ID_FAILURE(2003), + SYNERGY_VALIDATE_EA_DEVICE_ID_FAILURE(2004), + SYNERGY_GET_ANONYMOUS_ID_FAILURE(2005), + SYNERGY_ENVIRONMENT_UPDATE_FAILURE(2006), + SYNERGY_PURCHASE_VERIFICATION_FAILURE(2007), + SYNERGY_GET_NONCE_FAILURE(2008), + SYNERGY_GET_AGE_COMPLIANCE_FAILURE(2009); + + private int m_value; + + private Code(int n3) { + this.m_value = n3; + } + + public int intValue() { + return this.m_value; + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/Facebook.java b/app/src/main/java/com/ea/nimble/Facebook.java new file mode 100644 index 0000000..d93efb5 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Facebook.java @@ -0,0 +1,21 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Base; +import com.ea.nimble.FacebookImpl; +import com.ea.nimble.IFacebook; + +public class Facebook { + public static final String COMPONENT_ID = "com.ea.nimble.facebook"; + + public static IFacebook getComponent() { + return (IFacebook)((Object)Base.getComponent(COMPONENT_ID)); + } + + private static void initialize() { + Base.registerComponent(new FacebookImpl(), COMPONENT_ID); + } +} + diff --git a/app/src/main/java/com/ea/nimble/FacebookCallback.java b/app/src/main/java/com/ea/nimble/FacebookCallback.java new file mode 100644 index 0000000..b6cc81b --- /dev/null +++ b/app/src/main/java/com/ea/nimble/FacebookCallback.java @@ -0,0 +1,11 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.IFacebook; + +public interface FacebookCallback { + public void callback(IFacebook var1, boolean var2, Exception var3); +} + diff --git a/app/src/main/java/com/ea/nimble/FacebookImpl.java b/app/src/main/java/com/ea/nimble/FacebookImpl.java new file mode 100644 index 0000000..e7932cf --- /dev/null +++ b/app/src/main/java/com/ea/nimble/FacebookImpl.java @@ -0,0 +1,380 @@ +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.facebook.AccessToken; +import com.facebook.AccessTokenSource; +import com.facebook.FacebookException; +import com.facebook.FacebookOperationCanceledException; +import com.facebook.HttpMethod; +import com.facebook.Request; +import com.facebook.Response; +import com.facebook.Session; +import com.facebook.SessionState; +import com.facebook.UiLifecycleHelper; +import com.facebook.internal.Utility; +import com.facebook.model.GraphObject; +import com.facebook.model.GraphUser; +import com.facebook.widget.WebDialog; +import com.google.android.gms.plus.PlusShare; + +import org.json.JSONException; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; + +/* loaded from: stdlib.jar:com/ea/nimble/FacebookImpl.class */ +class FacebookImpl extends Component implements IApplicationLifecycle.ActivityEventCallbacks, IApplicationLifecycle.ActivityLifecycleCallbacks, IFacebook, LogSource { + static boolean bHasSeenOpening; + private static Session.StatusCallback m_sessionCallback; + private HashMap m_fbHelpers; + private static String TAG = "Facebook"; + private static List m_callbackQueue = new ArrayList(); + private Map userInfo = null; + private AtomicBoolean isUserGraphReady = new AtomicBoolean(true); + + private String getFacebookSDKVersion() { + try { + return String.valueOf(getClass().getClassLoader().loadClass("com.facebook.FacebookSdkVersion").getField("BUILD").get(null)); + } catch (ClassNotFoundException e) { + Log.Helper.LOGW(TAG, "Unable to get FB SDK version."); + return null; + } catch (IllegalAccessException e2) { + Log.Helper.LOGW(TAG, "Unable to get FB SDK version."); + return null; + } catch (IllegalArgumentException e3) { + Log.Helper.LOGW(TAG, "Unable to get FB SDK version."); + return null; + } catch (NoSuchFieldException e4) { + Log.Helper.LOGW(TAG, "Unable to get FB SDK version."); + return null; + } + } + + /* JADX INFO: Access modifiers changed from: protected */ + @Override // com.ea.nimble.Component + public void cleanup() { + ApplicationLifecycle.getComponent().unregisterActivityLifecycleCallbacks(this); + ApplicationLifecycle.getComponent().unregisterActivityEventCallbacks(this); + } + + @Override // com.ea.nimble.IFacebook + public String getAccessToken() { + Session activeSession = Session.getActiveSession(); + if (activeSession != null) { + return activeSession.getAccessToken(); + } + return null; + } + + @Override // com.ea.nimble.IFacebook + public String getApplicationId() { + Session activeSession = Session.getActiveSession(); + if (activeSession != null) { + return activeSession.getApplicationId(); + } + return null; + } + + @Override // com.ea.nimble.Component + public String getComponentId() { + return Facebook.COMPONENT_ID; + } + + @Override // com.ea.nimble.IFacebook + public Date getExpirationDate() { + Session activeSession = Session.getActiveSession(); + if (activeSession != null) { + return activeSession.getExpirationDate(); + } + return null; + } + + @Override // com.ea.nimble.IFacebook + public Map getGraphUser() { + if (this.isUserGraphReady.get()) { + return this.userInfo; + } + return null; + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "Facebook"; + } + + @Override // com.ea.nimble.IFacebook + public boolean hasOpenSession() { + Session activeSession = Session.getActiveSession(); + if (activeSession != null) { + return activeSession.isOpened(); + } + return false; + } + + @Override // com.ea.nimble.IFacebook + public void login(List list, IFacebook.FacebookCallback facebookCallback) { + Session activeSession = Session.getActiveSession(); + if (activeSession != null) { + if (!activeSession.isOpened() || !Utility.isSubset(list, activeSession.getPermissions())) { + activeSession.removeCallback(m_sessionCallback); + } else { + facebookCallback.callback(this, true, null); + return; + } + } + Activity currentActivity = ApplicationEnvironment.getCurrentActivity(); + Session session = new Session(currentActivity); + Session.setActiveSession(session); + Session.OpenRequest openRequest = new Session.OpenRequest(currentActivity); + openRequest.setPermissions(list); + if (facebookCallback != null) { + m_callbackQueue.add(facebookCallback); + } + openRequest.setCallback(m_sessionCallback); + session.openForRead(openRequest); + } + + @Override // com.ea.nimble.IFacebook + public void logout() { + Session activeSession = Session.getActiveSession(); + if (activeSession != null) { + activeSession.closeAndClearTokenInformation(); + Session.setActiveSession((Session) null); + } + this.userInfo = null; + this.isUserGraphReady.set(false); + } + + @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks + public void onActivityCreated(Activity activity, Bundle bundle) { + UiLifecycleHelper uiLifecycleHelper = this.m_fbHelpers.get(activity); + UiLifecycleHelper uiLifecycleHelper2 = uiLifecycleHelper; + if (uiLifecycleHelper == null) { + uiLifecycleHelper2 = new UiLifecycleHelper(activity, m_sessionCallback); + this.m_fbHelpers.put(activity, uiLifecycleHelper2); + } + uiLifecycleHelper2.onCreate(bundle); + if (!Utility.isNullOrEmpty(getAccessToken()) && !hasOpenSession()) { + Activity currentActivity = ApplicationEnvironment.getCurrentActivity(); + Session session = new Session(currentActivity); + Session.setActiveSession(session); + session.openForRead(new Session.OpenRequest(currentActivity)); + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks + public void onActivityDestroyed(Activity activity) { + UiLifecycleHelper uiLifecycleHelper = this.m_fbHelpers.get(activity); + if (uiLifecycleHelper != null) { + uiLifecycleHelper.onDestroy(); + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks + public void onActivityPaused(Activity activity) { + UiLifecycleHelper uiLifecycleHelper = this.m_fbHelpers.get(activity); + if (uiLifecycleHelper != null) { + uiLifecycleHelper.onPause(); + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks + public void onActivityResult(Activity activity, int i, int i2, Intent intent) { + UiLifecycleHelper uiLifecycleHelper = this.m_fbHelpers.get(activity); + if (uiLifecycleHelper != null) { + uiLifecycleHelper.onActivityResult(i, i2, intent); + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks + public void onActivityResumed(Activity activity) { + UiLifecycleHelper uiLifecycleHelper = this.m_fbHelpers.get(activity); + if (uiLifecycleHelper != null) { + uiLifecycleHelper.onResume(); + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ActivityLifecycleCallbacks + public void onActivitySaveInstanceState(Activity activity, Bundle bundle) { + UiLifecycleHelper uiLifecycleHelper = this.m_fbHelpers.get(activity); + if (uiLifecycleHelper != null) { + uiLifecycleHelper.onSaveInstanceState(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 onWindowFocusChanged(boolean z) { + } + + @Override // com.ea.nimble.IFacebook + public void refreshSession(final String str, Date date) { + if (!str.equals(getAccessToken()) || (date != null && date.after(getExpirationDate()))) { + Log.Helper.LOGI(this, "Refresh Facebook token from %s to %s", getAccessToken(), str); + new Session(ApplicationEnvironment.getCurrentActivity()).open(AccessToken.createFromExistingAccessToken(str, date, new Date(), AccessTokenSource.CLIENT_TOKEN, Session.getActiveSession().getPermissions()), new Session.StatusCallback() { // from class: com.ea.nimble.FacebookImpl.2 + public void call(Session session, SessionState sessionState, Exception exc) { + if (exc == null && (sessionState == SessionState.OPENED || sessionState == SessionState.OPENED_TOKEN_UPDATED)) { + Session.getActiveSession().close(); + Session.setActiveSession(session); + return; + } + Log.Helper.LOGE(this, "Invalid Facebook accessToken " + str + " from Origin"); + } + }); + } + } + + @Override + public void restore() { + ApplicationLifecycle.getComponent().registerActivityEventCallbacks(this); + ApplicationLifecycle.getComponent().registerActivityLifecycleCallbacks(this); + } + + public void retrieveCurrentUserProfile(IFacebook.FacebookFriendsCallback facebookFriendsCallback) { + } + + @Override // com.ea.nimble.IFacebook + public void retrieveFriends(final int i, final int i2, final IFacebook.FacebookFriendsCallback facebookFriendsCallback) { + if (facebookFriendsCallback != null) { + new Handler(Looper.getMainLooper()).post(new Runnable() { // from class: com.ea.nimble.FacebookImpl.4 + @Override // java.lang.Runnable + public void run() { + Bundle bundle = new Bundle(); + bundle.putInt("offset", i); + bundle.putInt("limit", i2); + bundle.putString("fields", "name,id,picture.type(normal)"); + Request.executeBatchAsync(new Request[]{new Request(Session.getActiveSession(), "me/friends", bundle, HttpMethod.GET, new Request.Callback() { // from class: com.ea.nimble.FacebookImpl.4.1 + public void onCompleted(Response response) { + Log.Helper.LOGD(this, response.toString()); + if (response.getError() != null) { + facebookFriendsCallback.callback(Facebook.getComponent(), null, new NimbleFacebookError(NimbleFacebookError.Code.FBSERVER_ERROR, response.getError().toString())); + return; + } + GraphObject graphObject = response.getGraphObject(); + if (graphObject != null) { + try { + facebookFriendsCallback.callback(Facebook.getComponent(), graphObject.getInnerJSONObject().getJSONArray("data"), null); + } catch (JSONException e) { + Log.Helper.LOGE(this, "JSON Exception encountered when parsing the facebook FQL query"); + facebookFriendsCallback.callback(Facebook.getComponent(), null, new NimbleFacebookError(NimbleFacebookError.Code.RESPONSE_PARSE_ERROR.intValue(), e.toString())); + } + } else { + facebookFriendsCallback.callback(Facebook.getComponent(), null, null); + } + } + })}); + } + }); + } + } + + @Override // com.ea.nimble.IFacebook + public void sendAppRequest(final String str, final String str2, final String str3, final IFacebook.FacebookCallback facebookCallback) { + ApplicationEnvironment.getCurrentActivity().runOnUiThread(new Runnable() { // from class: com.ea.nimble.FacebookImpl.3 + @Override // java.lang.Runnable + public void run() { + Activity currentActivity = ApplicationEnvironment.getCurrentActivity(); + Bundle bundle = new Bundle(); + bundle.putString(PlusShare.KEY_CONTENT_DEEP_LINK_METADATA_TITLE, str2); + bundle.putString("message", str3); + bundle.putString("to", str); + WebDialog.Builder builder = new WebDialog.Builder(currentActivity, Session.getActiveSession(), "apprequests", bundle); + builder.setOnCompleteListener(new WebDialog.OnCompleteListener() { // from class: com.ea.nimble.FacebookImpl.3.1 + public void onComplete(Bundle bundle2, FacebookException facebookException) { + IFacebook.FacebookCallback facebookCallback2 = facebookCallback; + FacebookImpl facebookImpl = FacebookImpl.this; + boolean z = facebookException == null; + if (facebookException == null || (facebookException instanceof FacebookOperationCanceledException)) { + facebookException = null; + } + facebookCallback2.callback(facebookImpl, z, facebookException); + } + }); + WebDialog build = builder.build(); + build.getWindow().setFlags(1024, 1024); + build.show(); + } + }); + } + + /* JADX INFO: Access modifiers changed from: protected */ + @Override // com.ea.nimble.Component + public void setup() { + Log.Helper.LOGV(TAG, "Currently using FB SDK version " + getFacebookSDKVersion() + "."); + try { + Class.forName("android.os.AsyncTask"); + } catch (ClassNotFoundException e) { + } + this.m_fbHelpers = new HashMap<>(); + bHasSeenOpening = false; + m_sessionCallback = new Session.StatusCallback() { // from class: com.ea.nimble.FacebookImpl.1 + public void call(Session session, SessionState sessionState, Exception exc) { + IFacebook.FacebookCallback facebookCallback; + boolean z; + if (sessionState == SessionState.OPENED || sessionState == SessionState.OPENED_TOKEN_UPDATED) { + Request.executeMeRequestAsync(session, new Request.GraphUserCallback() { // from class: com.ea.nimble.FacebookImpl.1.1 + public void onCompleted(GraphUser graphUser, Response response) { + Log.Helper.LOGI(this, "Facebook GraphUser data received"); + if (response.getError() != null || graphUser == null) { + Log.Helper.LOGE(this, "Failed to retrieve graph user info"); + return; + } + Log.Helper.LOGI(this, "Facebook graph user info successfully retrieved"); + FacebookImpl.this.userInfo = graphUser.asMap(); + try { + FacebookImpl.this.userInfo.put("avatar", "https://graph.facebook.com/" + FacebookImpl.this.userInfo.get("id").toString() + "/picture"); + FacebookImpl.this.isUserGraphReady.set(true); + } catch (Exception e2) { + Log.Helper.LOGE(this, "Failed to get facebook user id"); + FacebookImpl.this.isUserGraphReady.set(true); + } + } + }); + } + if (sessionState == SessionState.CLOSED || sessionState == SessionState.OPENED || sessionState == SessionState.OPENED_TOKEN_UPDATED) { + com.ea.nimble.Utility.sendBroadcast(IFacebook.NIMBLE_NOTIFICATION_FACEBOOK_STATUS_CHANGED, null); + } + if (sessionState == SessionState.OPENING || sessionState == SessionState.CLOSED) { + FacebookImpl.bHasSeenOpening = true; + } else if ((sessionState != SessionState.CLOSED_LOGIN_FAILED || FacebookImpl.bHasSeenOpening) && FacebookImpl.m_callbackQueue != null) { + if (FacebookImpl.m_callbackQueue.size() >= 1 && FacebookImpl.m_callbackQueue.size() <= 1 && (facebookCallback = (IFacebook.FacebookCallback) FacebookImpl.m_callbackQueue.get(0)) != null) { + FacebookImpl facebookImpl = FacebookImpl.this; + if (exc == null) { + z = true; + if (sessionState != SessionState.OPENED) { + if (sessionState == SessionState.OPENED_TOKEN_UPDATED) { + z = true; + } + } + facebookCallback.callback(facebookImpl, z, exc); + } + z = false; + facebookCallback.callback(facebookImpl, z, exc); + } + FacebookImpl.m_callbackQueue.clear(); + } + } + }; + } +} diff --git a/app/src/main/java/com/ea/nimble/Global.java b/app/src/main/java/com/ea/nimble/Global.java new file mode 100644 index 0000000..5e7d895 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Global.java @@ -0,0 +1,31 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +public class Global { + public static final String NIMBLE_AUTHENTICATOR_ANONYMOUS = "anonymous"; + public static final String NIMBLE_AUTHENTICATOR_FACEBOOK = "facebook"; + public static final String NIMBLE_AUTHENTICATOR_ORIGIN = "origin"; + public static final String NIMBLE_DOMAIN = "com.ea.nimble"; + public static final String NIMBLE_ID = "Nimble"; + public static final String NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID = "authenticatorId"; + public static final String NIMBLE_IDENTITY_DICTIONARY_KEY_PIDMAP_ID = "pidMapId"; + public static final String NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE = "nimble.notification.identity.authentication.update"; + public static final String NIMBLE_NOTIFICATION_IDENTITY_MAIN_AUTHENTICATOR_CHANGE = "nimble.notification.identity.main.authenticator.change"; + public static final String NIMBLE_NOTIFICATION_IDENTITY_PERSONA_INFO_UPDATE = "nimble.notification.identity.authenticator.persona.info.update"; + public static final String NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE = "nimble.notification.identity.authenticator.pid.info.update"; + public static final String NIMBLE_NOTIFICATION_IDENTITY_USER_INFO_UPDATE = "nimble.notification.identity.authenticator.user.info.update"; + public static final String NIMBLE_RELEASE_VERSION = "1.23.14.1217"; + public static final String NIMBLE_SDK_VERSION = "1.23.14.1217"; + public static final String NOTIFICATION_COMPONENT_INDEPENDENT_SETUP_FINISHED = "nimble.notification.componentIndependentSetupFinished"; + public static final String NOTIFICATION_DICTIONARY_KEY_DETAIL_ERROR = "detailError"; + public static final String NOTIFICATION_DICTIONARY_KEY_ERROR = "error"; + public static final String NOTIFICATION_DICTIONARY_KEY_RESULT = "result"; + public static final String NOTIFICATION_DICTIONARY_RESULT_FAIL = "0"; + public static final String NOTIFICATION_DICTIONARY_RESULT_SUCCESS = "1"; + public static final String NOTIFICATION_LANGUAGE_CHANGE = "nimble.notification.LanguageChanged"; + public static final String NOTIFICATION_LOGIN_STATUS_CHANGE = "nimble.notification.LoginStatusChanged"; + public static final String NOTIFICATION_NETWORK_STATUS_CHANGE = "nimble.notification.networkStatusChanged"; +} + diff --git a/app/src/main/java/com/ea/nimble/HttpError.java b/app/src/main/java/com/ea/nimble/HttpError.java new file mode 100644 index 0000000..b0a6048 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/HttpError.java @@ -0,0 +1,21 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Error; + +class HttpError +extends Error { + public static final String ERROR_DOMAIN = "HttpError"; + private static final long serialVersionUID = 1L; + + public HttpError(int n2, String string2) { + super(ERROR_DOMAIN, n2, string2, null); + } + + public HttpError(int n2, String string2, Throwable throwable) { + super(ERROR_DOMAIN, n2, string2, throwable); + } +} + diff --git a/app/src/main/java/com/ea/nimble/HttpRequest.java b/app/src/main/java/com/ea/nimble/HttpRequest.java new file mode 100644 index 0000000..1b8506e --- /dev/null +++ b/app/src/main/java/com/ea/nimble/HttpRequest.java @@ -0,0 +1,75 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.IHttpRequest; +import java.io.ByteArrayOutputStream; +import java.net.URL; +import java.util.EnumSet; +import java.util.HashMap; + +public class HttpRequest +implements IHttpRequest { + private static int DEFAULT_NETWORK_TIMEOUT = 30; + public ByteArrayOutputStream data; + public HashMap headers; + public IHttpRequest.Method method = IHttpRequest.Method.GET; + public EnumSet overwritePolicy; + public boolean runInBackground; + public String targetFilePath; + public double timeout; + public URL url = null; + + public HttpRequest() { + this.data = new ByteArrayOutputStream(); + this.headers = new HashMap(); + this.overwritePolicy = IHttpRequest.OverwritePolicy.SMART; + this.timeout = DEFAULT_NETWORK_TIMEOUT; + } + + public HttpRequest(URL uRL) { + this(); + this.url = uRL; + } + + @Override + public byte[] getData() { + return this.data.toByteArray(); + } + + public HashMap getHeaders() { + return this.headers; + } + + @Override + public IHttpRequest.Method getMethod() { + return this.method; + } + + @Override + public EnumSet getOverwritePolicy() { + return this.overwritePolicy; + } + + @Override + public boolean getRunInBackground() { + return this.runInBackground; + } + + @Override + public String getTargetFilePath() { + return this.targetFilePath; + } + + @Override + public double getTimeout() { + return this.timeout; + } + + @Override + public URL getUrl() { + return this.url; + } +} + diff --git a/app/src/main/java/com/ea/nimble/HttpResponse.java b/app/src/main/java/com/ea/nimble/HttpResponse.java new file mode 100644 index 0000000..30291f2 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/HttpResponse.java @@ -0,0 +1,79 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.ByteBufferIOStream; +import com.ea.nimble.IHttpResponse; +import java.io.InputStream; +import java.net.URL; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class HttpResponse +implements IHttpResponse { + public ByteBufferIOStream data; + public long downloadedContentLength = 0L; + public Exception error; + public long expectedContentLength = 0L; + public HashMap headers = new HashMap(); + public boolean isCompleted = false; + public long lastModified = -1L; + public int statusCode = 0; + public URL url = null; + + public HttpResponse() { + this.data = new ByteBufferIOStream(); + } + + @Override + public InputStream getDataStream() { + return this.data.getInputStream(); + } + + @Override + public long getDownloadedContentLength() { + return this.downloadedContentLength; + } + + @Override + public Exception getError() { + return this.error; + } + + @Override + public long getExpectedContentLength() { + return this.expectedContentLength; + } + + @Override + public Map getHeaders() { + return this.headers; + } + + @Override + public Date getLastModified() { + if (this.lastModified == 0L) { + return new Date(); + } + if (this.lastModified <= 0L) return null; + return new Date(this.lastModified); + } + + @Override + public int getStatusCode() { + return this.statusCode; + } + + @Override + public URL getUrl() { + return this.url; + } + + @Override + public boolean isCompleted() { + return this.isCompleted; + } +} + diff --git a/app/src/main/java/com/ea/nimble/IApplicationEnvironment.java b/app/src/main/java/com/ea/nimble/IApplicationEnvironment.java new file mode 100644 index 0000000..80868ad --- /dev/null +++ b/app/src/main/java/com/ea/nimble/IApplicationEnvironment.java @@ -0,0 +1,72 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.Context + */ +package com.ea.nimble; + +import android.content.Context; + +public interface IApplicationEnvironment { + public int getAgeCompliance(); + + public String getApplicationBundleId(); + + public Context getApplicationContext(); + + public String getApplicationLanguageCode(); + + public String getApplicationName(); + + public String getApplicationVersion(); + + public String getCachePath(); + + public String getCarrier(); + + public String getDeviceBrand(); + + public String getDeviceCodename(); + + public String getDeviceFingerprint(); + + public String getDeviceManufacturer(); + + public String getDeviceModel(); + + public String getDeviceString(); + + public String getDocumentPath(); + + public String getGameSpecifiedPlayerId(); + + public String getGoogleAdvertisingId(); + + public String getGoogleEmail(); + + public boolean getIadAttribution(); + + public String getMACAddress(); + + public String getOsVersion(); + + public String getShortApplicationLanguageCode(); + + public String getTempPath(); + + public boolean isAppCracked(); + + public boolean isDeviceRooted(); + + public boolean isLimitAdTrackingEnabled(); + + public void refreshAgeCompliance(); + + public void setApplicationBundleId(String var1); + + public void setApplicationLanguageCode(String var1); + + public void setGameSpecifiedPlayerId(String var1); +} + diff --git a/app/src/main/java/com/ea/nimble/IApplicationLifecycle.java b/app/src/main/java/com/ea/nimble/IApplicationLifecycle.java new file mode 100644 index 0000000..47dd9cb --- /dev/null +++ b/app/src/main/java/com/ea/nimble/IApplicationLifecycle.java @@ -0,0 +1,88 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.Activity + * android.content.Intent + * android.os.Bundle + */ +package com.ea.nimble; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; + +public interface IApplicationLifecycle { + boolean handleBackPressed(); + + void notifyActivityCreate(Bundle var1, Activity var2); + + void notifyActivityDestroy(Activity var1); + + void notifyActivityPause(Activity var1); + + void notifyActivityRestart(Activity var1); + + void notifyActivityRestoreInstanceState(Bundle var1, Activity var2); + + void notifyActivityResult(int var1, int var2, Intent var3, Activity var4); + + void notifyActivityResume(Activity var1); + + void notifyActivityRetainNonConfigurationInstance(); + + void notifyActivitySaveInstanceState(Bundle var1, Activity var2); + + void notifyActivityStart(Activity var1); + + void notifyActivityStop(Activity var1); + + void notifyActivityWindowFocusChanged(boolean var1, Activity var2); + + void registerActivityEventCallbacks(ActivityEventCallbacks var1); + + void registerActivityLifecycleCallbacks(ActivityLifecycleCallbacks var1); + + void registerApplicationLifecycleCallbacks(ApplicationLifecycleCallbacks var1); + + void unregisterActivityEventCallbacks(ActivityEventCallbacks var1); + + void unregisterActivityLifecycleCallbacks(ActivityLifecycleCallbacks var1); + + void unregisterApplicationLifecycleCallbacks(ApplicationLifecycleCallbacks var1); + + interface ActivityEventCallbacks { + void onActivityResult(Activity var1, int var2, int var3, Intent var4); + + boolean onBackPressed(); + + void onWindowFocusChanged(boolean var1); + } + + interface ActivityLifecycleCallbacks { + void onActivityCreated(Activity var1, Bundle var2); + + void onActivityDestroyed(Activity var1); + + void onActivityPaused(Activity var1); + + void onActivityResumed(Activity var1); + + void onActivitySaveInstanceState(Activity var1, Bundle var2); + + void onActivityStarted(Activity var1); + + void onActivityStopped(Activity var1); + } + + interface ApplicationLifecycleCallbacks { + void onApplicationLaunch(Intent var1); + + void onApplicationQuit(); + + void onApplicationResume(); + + void onApplicationSuspend(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/IFacebook.java b/app/src/main/java/com/ea/nimble/IFacebook.java new file mode 100644 index 0000000..7a16515 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/IFacebook.java @@ -0,0 +1,50 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * org.json.JSONArray + */ +package com.ea.nimble; + +import com.ea.nimble.Error; +import java.util.Date; +import java.util.List; +import java.util.Map; +import org.json.JSONArray; + +public interface IFacebook { + public static final String NIMBLE_NOTIFICATION_FACEBOOK_STATUS_CHANGED = "nimble.notification.facebook.statuschanged"; + + public String getAccessToken(); + + public String getApplicationId(); + + public Date getExpirationDate(); + + public Map getGraphUser(); + + public boolean hasOpenSession(); + + public void login(List var1, FacebookCallback var2); + + public void logout(); + + public void refreshSession(String var1, Date var2); + + public void retrieveFriends(int var1, int var2, FacebookFriendsCallback var3); + + public void sendAppRequest(String var1, String var2, String var3, FacebookCallback var4); + + public static interface FacebookCallback { + public void callback(IFacebook var1, boolean var2, Exception var3); + } + + public static interface FacebookFriendsCallback { + public void callback(IFacebook var1, JSONArray var2, Error var3); + } + + public static interface FqlRequestCallBack { + public void requestComplete(JSONArray var1, Error var2); + } +} + diff --git a/app/src/main/java/com/ea/nimble/IHttpRequest.java b/app/src/main/java/com/ea/nimble/IHttpRequest.java new file mode 100644 index 0000000..6d93eaf --- /dev/null +++ b/app/src/main/java/com/ea/nimble/IHttpRequest.java @@ -0,0 +1,60 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import java.net.URL; +import java.util.EnumSet; +import java.util.Map; + +public interface IHttpRequest { + byte[] getData(); + + Map getHeaders(); + + Method getMethod(); + + EnumSet getOverwritePolicy(); + + boolean getRunInBackground(); + + String getTargetFilePath(); + + double getTimeout(); + + URL getUrl(); + + static enum Method { + GET("GET"), + HEAD("HEAD"), + POST("POST"), + PUT("PUT"), + DELETE("DELETE"), + UNRECOGNIZED("UNRECOGNIZED"); + + private String title; + + Method(String title) { + this.title = title; + } + + public String toString() { + return title; + } + } + + enum OverwritePolicy { + RESUME_DOWNLOAD, + DATE_CHECK, + LENGTH_CHECK; + + static final EnumSet OVERWRITE; + static final EnumSet SMART; + + static { + OVERWRITE = EnumSet.noneOf(OverwritePolicy.class); + SMART = EnumSet.allOf(OverwritePolicy.class); + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/IHttpResponse.java b/app/src/main/java/com/ea/nimble/IHttpResponse.java new file mode 100644 index 0000000..875496b --- /dev/null +++ b/app/src/main/java/com/ea/nimble/IHttpResponse.java @@ -0,0 +1,30 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import java.io.InputStream; +import java.net.URL; +import java.util.Date; +import java.util.Map; + +public interface IHttpResponse { + public InputStream getDataStream(); + + public long getDownloadedContentLength(); + + public Exception getError(); + + public long getExpectedContentLength(); + + public Map getHeaders(); + + public Date getLastModified(); + + public int getStatusCode(); + + public URL getUrl(); + + public boolean isCompleted(); +} + diff --git a/app/src/main/java/com/ea/nimble/ILog.java b/app/src/main/java/com/ea/nimble/ILog.java new file mode 100644 index 0000000..0046b56 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ILog.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +public interface ILog { + String getLogFilePath(); + + int getThresholdLevel(); + + void setThresholdLevel(int var1); + + void writeWithSource(int var1, Object var2, String var3, Object ... var4); + + void writeWithTitle(int var1, String var2, String var3, Object ... var4); +} + diff --git a/app/src/main/java/com/ea/nimble/INetwork.java b/app/src/main/java/com/ea/nimble/INetwork.java new file mode 100644 index 0000000..64dc6ea --- /dev/null +++ b/app/src/main/java/com/ea/nimble/INetwork.java @@ -0,0 +1,31 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.HttpRequest; +import com.ea.nimble.IOperationalTelemetryDispatch; +import com.ea.nimble.Network; +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import java.net.URL; +import java.util.HashMap; + +public interface INetwork { + public void forceRedetectNetworkStatus(); + + public Network.Status getStatus(); + + public boolean isNetworkWifi(); + + public NetworkConnectionHandle sendDeleteRequest(URL var1, HashMap var2, NetworkConnectionCallback var3); + + public NetworkConnectionHandle sendGetRequest(URL var1, HashMap var2, NetworkConnectionCallback var3); + + public NetworkConnectionHandle sendPostRequest(URL var1, HashMap var2, byte[] var3, NetworkConnectionCallback var4); + + public NetworkConnectionHandle sendRequest(HttpRequest var1, NetworkConnectionCallback var2); + + public NetworkConnectionHandle sendRequest(HttpRequest var1, NetworkConnectionCallback var2, IOperationalTelemetryDispatch var3); +} + diff --git a/app/src/main/java/com/ea/nimble/IOperationalTelemetryDispatch.java b/app/src/main/java/com/ea/nimble/IOperationalTelemetryDispatch.java new file mode 100644 index 0000000..c62c097 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/IOperationalTelemetryDispatch.java @@ -0,0 +1,24 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.OperationalTelemetryEvent; +import java.util.List; +import java.util.Map; + +public interface IOperationalTelemetryDispatch { + public static final String EVENTTYPE_NETWORK_METRICS = "com.ea.nimble.network"; + public static final String EVENTTYPE_TRACKING_SYNERGY_PAYLOADS = "com.ea.nimble.trackingimpl.synergy"; + public static final int NIMBLE_DEFAULT_MAX_OT_EVENT_COUNT = 100; + public static final String NOTIFICATION_OT_EVENT_THRESHOLD_WARNING = "nimble.notification.ot.eventthresholdwarning"; + + public List getEvents(String var1); + + public int getMaxEventCount(String var1); + + public void logEvent(String var1, Map var2); + + public void setMaxEventCount(String var1, int var2); +} + diff --git a/app/src/main/java/com/ea/nimble/IPersistenceService.java b/app/src/main/java/com/ea/nimble/IPersistenceService.java new file mode 100644 index 0000000..f758dd9 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/IPersistenceService.java @@ -0,0 +1,18 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Persistence; +import com.ea.nimble.PersistenceService; + +public interface IPersistenceService { + public void cleanPersistenceReference(String var1, Persistence.Storage var2); + + public Persistence getPersistence(String var1, Persistence.Storage var2); + + public void migratePersistence(String var1, Persistence.Storage var2, String var3, PersistenceService.PersistenceMergePolicy var4); + + public void removePersistence(String var1, Persistence.Storage var2); +} + diff --git a/app/src/main/java/com/ea/nimble/ISynergyEnvironment.java b/app/src/main/java/com/ea/nimble/ISynergyEnvironment.java new file mode 100644 index 0000000..6797dd2 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ISynergyEnvironment.java @@ -0,0 +1,48 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Error; +import com.ea.nimble.NimbleConfiguration; + +public interface ISynergyEnvironment { + public static final int NETWORK_CONNECTION_NONE = 1; + public static final int NETWORK_CONNECTION_UNKNOWN = 0; + public static final int NETWORK_CONNECTION_WIFI = 2; + public static final int NETWORK_CONNECTION_WIRELESS = 3; + public static final int SYNERGY_APP_VERSION_OK = 0; + public static final int SYNERGY_APP_VERSION_UPDATE_RECOMMENDED = 1; + public static final int SYNERGY_APP_VERSION_UPDATE_REQUIRED = 2; + + public Error checkAndInitiateSynergyEnvironmentUpdate(); + + public String getEADeviceId(); + + public String getEAHardwareId(); + + public String getGosMdmAppKey(); + + public int getLatestAppVersionCheckResult(); + + public String getNexusClientId(); + + public String getNexusClientSecret(); + + public String getProductId(); + + public String getSellId(); + + public String getServerUrlWithKey(String var1); + + public String getSynergyDirectorServerUrl(NimbleConfiguration var1); + + public String getSynergyId(); + + public int getTrackingPostInterval(); + + public boolean isDataAvailable(); + + public boolean isUpdateInProgress(); +} + diff --git a/app/src/main/java/com/ea/nimble/ISynergyIdManager.java b/app/src/main/java/com/ea/nimble/ISynergyIdManager.java new file mode 100644 index 0000000..e5c3540 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ISynergyIdManager.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.SynergyIdManagerError; + +public interface ISynergyIdManager { + public String getAnonymousSynergyId(); + + public String getSynergyId(); + + public SynergyIdManagerError login(String var1, String var2); + + public SynergyIdManagerError logout(String var1); +} + diff --git a/app/src/main/java/com/ea/nimble/ISynergyNetwork.java b/app/src/main/java/com/ea/nimble/ISynergyNetwork.java new file mode 100644 index 0000000..dee64de --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ISynergyNetwork.java @@ -0,0 +1,20 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.SynergyNetworkConnectionCallback; +import com.ea.nimble.SynergyNetworkConnectionHandle; +import com.ea.nimble.SynergyRequest; +import java.util.Map; + +public interface ISynergyNetwork { + public SynergyNetworkConnectionHandle sendGetRequest(String var1, String var2, Map var3, SynergyNetworkConnectionCallback var4); + + public SynergyNetworkConnectionHandle sendPostRequest(String var1, String var2, Map var3, Map var4, SynergyNetworkConnectionCallback var5); + + public SynergyNetworkConnectionHandle sendPostRequest(String var1, String var2, Map var3, Map var4, SynergyNetworkConnectionCallback var5, Map var6); + + public void sendRequest(SynergyRequest var1, SynergyNetworkConnectionCallback var2); +} + diff --git a/app/src/main/java/com/ea/nimble/ISynergyRequest.java b/app/src/main/java/com/ea/nimble/ISynergyRequest.java new file mode 100644 index 0000000..24ddbc5 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ISynergyRequest.java @@ -0,0 +1,20 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.IHttpRequest; +import java.util.Map; + +public interface ISynergyRequest { + public String getApi(); + + public String getBaseUrl(); + + public IHttpRequest getHttpRequest(); + + public Map getJsonData(); + + public Map getUrlParameters(); +} + diff --git a/app/src/main/java/com/ea/nimble/ISynergyResponse.java b/app/src/main/java/com/ea/nimble/ISynergyResponse.java new file mode 100644 index 0000000..070d0b8 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/ISynergyResponse.java @@ -0,0 +1,18 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.IHttpResponse; +import java.util.Map; + +public interface ISynergyResponse { + public Exception getError(); + + public IHttpResponse getHttpResponse(); + + public Map getJsonData(); + + public boolean isCompleted(); +} + diff --git a/app/src/main/java/com/ea/nimble/Log.java b/app/src/main/java/com/ea/nimble/Log.java new file mode 100644 index 0000000..01178f2 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Log.java @@ -0,0 +1,84 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.ILog; +import com.ea.nimble.LogImpl; + +public class Log { + public static final String COMPONENT_ID = "com.ea.nimble.NimbleLog"; + public static final int LEVEL_DEBUG = 200; + public static final int LEVEL_ERROR = 500; + public static final int LEVEL_FATAL = 600; + public static final int LEVEL_INFO = 300; + public static final int LEVEL_SILENT = 700; + public static final int LEVEL_VERBOSE = 100; + public static final int LEVEL_WARN = 400; + private static ILog s_instance; + + public static ILog getComponent() { + synchronized (Log.class) { + if (s_instance == null) { + s_instance = new LogImpl(); + } + ILog iLog = s_instance; + return iLog; + } + } + + public static class Helper { + public static void LOG(int n2, String string2, Object ... objectArray) { + Log.getComponent().writeWithTitle(n2, null, string2, objectArray); + } + + public static void LOGD(Object object, String string2, Object ... objectArray) { + Log.getComponent().writeWithSource(200, object, string2, objectArray); + } + + public static void LOGDS(String string2, String string3, Object ... objectArray) { + Log.getComponent().writeWithTitle(200, string2, string3, objectArray); + } + + public static void LOGE(Object object, String string2, Object ... objectArray) { + Log.getComponent().writeWithSource(500, object, string2, objectArray); + } + + public static void LOGES(String string2, String string3, Object ... objectArray) { + Log.getComponent().writeWithTitle(500, string2, string3, objectArray); + } + + public static void LOGF(Object object, String string2, Object ... objectArray) { + Log.getComponent().writeWithSource(600, object, string2, objectArray); + } + + public static void LOGFS(String string2, String string3, Object ... objectArray) { + Log.getComponent().writeWithTitle(600, string2, string3, objectArray); + } + + public static void LOGI(Object object, String string2, Object ... objectArray) { + Log.getComponent().writeWithSource(300, object, string2, objectArray); + } + + public static void LOGIS(String string2, String string3, Object ... objectArray) { + Log.getComponent().writeWithTitle(300, string2, string3, objectArray); + } + + public static void LOGV(Object object, String string2, Object ... objectArray) { + Log.getComponent().writeWithSource(100, object, string2, objectArray); + } + + public static void LOGVS(String string2, String string3, Object ... objectArray) { + Log.getComponent().writeWithTitle(100, string2, string3, objectArray); + } + + public static void LOGW(Object object, String string2, Object ... objectArray) { + Log.getComponent().writeWithSource(400, object, string2, objectArray); + } + + public static void LOGWS(String string2, String string3, Object ... objectArray) { + Log.getComponent().writeWithTitle(400, string2, string3, objectArray); + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/LogImpl.java b/app/src/main/java/com/ea/nimble/LogImpl.java new file mode 100644 index 0000000..3654d71 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/LogImpl.java @@ -0,0 +1,473 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Environment + * android.util.Log + */ +package com.ea.nimble; + +import android.os.Environment; +import android.util.Log; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; + +public class LogImpl +extends Component +implements ILog { + private static final int DEFAULT_CHECK_INTERVAL = 3600; + private static final int DEFAULT_CONSOLE_OUTPUT_LIMIT = 4000; + private static final int DEFAULT_MESSAGE_LENGTH_LIMIT = 1000; + private static final int DEFAULT_SIZE_LIMIT = 1024; + private ArrayList m_cache = new ArrayList(); + private BaseCore m_core; + private File m_filePath = null; + private DateFormat m_format = null; + private Timer m_guardTimer = null; + private int m_interval = 0; + private int m_level = 0; + private FileOutputStream m_logFileStream = null; + private int m_messageLengthLimit; + private int m_sizeLimit; + + LogImpl() { + } + + private void clearLog() { + try { + this.m_logFileStream.close(); + this.m_logFileStream = new FileOutputStream(this.m_filePath, false); + return; + } + catch (IOException iOException) { + Log.e((String)"Nimble", (String)"LOG: Can't clear log file"); + return; + } + } + + private void configure() { + boolean z = this.m_level == 0; + Map settings = this.m_core.getSettings(BaseCore.NIMBLE_LOG_SETTING); + if (settings == null) { + int parseLevel = parseLevel(null); + if (parseLevel != this.m_level) { + this.m_level = parseLevel; + Log.i(Global.NIMBLE_ID, String.format("LOG: Default Log level(%d) without log configuration file", Integer.valueOf(this.m_level))); + return; + } + return; + } + int parseLevel2 = parseLevel(settings.get("Level")); + if (parseLevel2 != this.m_level) { + this.m_level = parseLevel2; + Log.i(Global.NIMBLE_ID, String.format("LOG: Log level(%d)", Integer.valueOf(this.m_level))); + } + if (this.m_level <= 100) { + this.m_messageLengthLimit = 0; + } else { + String str = settings.get("MessageLengthLimit"); + if (str == null) { + this.m_messageLengthLimit = 1000; + } else { + try { + this.m_messageLengthLimit = Integer.parseInt(str); + if (this.m_messageLengthLimit < 0) { + this.m_messageLengthLimit = 1000; + } + } catch (NumberFormatException e) { + this.m_messageLengthLimit = 1000; + } + } + } + String str2 = settings.get("File"); + if (Utility.validString(str2)) { + String str3 = settings.get("Location"); + String str4 = ApplicationEnvironment.getComponent().getCachePath() + File.separator + str2; + String str5 = str4; + if (Utility.validString(str3)) { + str5 = str4; + if (str3.equalsIgnoreCase("external")) { + str5 = str4; + if (Environment.getExternalStorageState().equals("mounted")) { + String name = ApplicationEnvironment.getCurrentActivity().getClass().getPackage().getName(); + try { + name = ApplicationEnvironment.getCurrentActivity().getPackageManager().getPackageInfo(ApplicationEnvironment.getCurrentActivity().getPackageName(), 0).packageName; + } catch (Exception e2) { + } + File file = new File(Environment.getExternalStorageDirectory(), name); + boolean exists = file.exists(); + boolean z2 = exists; + if (!exists) { + z2 = file.mkdir(); + } + str5 = str4; + if (z2) { + str5 = file + File.separator + str2; + } + } + } + } + File file2 = new File(str5); + if (file2 != this.m_filePath) { + this.m_filePath = file2; + try { + this.m_logFileStream = new FileOutputStream(this.m_filePath, true); + Log.d(Global.NIMBLE_ID, "LOG: File path: " + this.m_filePath.toString()); + } catch (FileNotFoundException e3) { + Log.e(Global.NIMBLE_ID, "LOG: Can't create log file at " + str5); + this.m_filePath = null; + return; + } + } + String str6 = settings.get("DateFormat"); + if (str6 == null || str6.length() <= 0) { + this.m_format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault()); + } else { + this.m_format = new SimpleDateFormat(str6, Locale.getDefault()); + } + try { + this.m_interval = Integer.parseInt(settings.get("FileCheckInterval")); + if (this.m_interval <= 0) { + this.m_interval = DEFAULT_CHECK_INTERVAL; + } + } catch (NumberFormatException e4) { + this.m_interval = DEFAULT_CHECK_INTERVAL; + } + try { + this.m_sizeLimit = Integer.parseInt(settings.get("MaxFileSize")); + if (this.m_sizeLimit <= 0) { + this.m_sizeLimit = DEFAULT_SIZE_LIMIT; + } + } catch (NumberFormatException e5) { + this.m_sizeLimit = DEFAULT_SIZE_LIMIT; + } + GuardTask guardTask = new GuardTask(); + guardTask.run(); + this.m_guardTimer = new Timer(guardTask); + this.m_guardTimer.schedule((double) this.m_interval, true); + } else if (z || this.m_filePath != null) { + this.m_filePath = null; + this.m_logFileStream = null; + this.m_interval = 0; + Log.i(Global.NIMBLE_ID, "LOG: Disable log to file since no filename provided"); + } + } + + private void flushCache() { + Iterator iterator = this.m_cache.iterator(); + while (true) { + if (!iterator.hasNext()) { + this.m_cache = null; + return; + } + LogRecord logRecord = iterator.next(); + this.writeLine(logRecord.level, logRecord.message); + } + } + + private String[] formatLine(String string2, String stringArray) { + int n2; + stringArray = string2 + ">" + (String)stringArray; + int n3 = n2 = stringArray.length(); + string2 = stringArray; + if (n2 > this.m_messageLengthLimit) { + n3 = n2; + string2 = stringArray; + if (this.m_messageLengthLimit != 0) { + n3 = n2 - this.m_messageLengthLimit; + string2 = stringArray.substring(0, this.m_messageLengthLimit) + String.format("... and %d chars more", n3); + } + } + String[] strings = new String[(int) Math.ceil((double) n3 / 4000.0)]; + n2 = 0; + while (n2 < n3) { + strings[n2 / 4000] = n2 + 4000 < n3 ? string2.substring(n2, n2 + 4000) : string2.substring(n2); + n2 += 4000; + } + return strings; + } + + private void outputMessageToFile(String string2) { + String string3 = System.getProperty("line.separator"); + if (this.m_logFileStream == null) return; + try { + string2 = this.m_format.format(new Date()) + " " + string2 + string3; + this.m_logFileStream.write(string2.getBytes()); + this.m_logFileStream.flush(); + return; + } + catch (IOException iOException) { + Log.e((String)"Nimble", (String)("Error writing to log file: " + iOException.toString())); + return; + } + } + + private int parseLevel(String string2) { + block9: { + try { + int n2; + if (Utility.validString(string2) && (n2 = Integer.parseInt(string2)) != 0) { + return n2; + } + } + catch (NumberFormatException numberFormatException) { + if (string2.equalsIgnoreCase("verbose")) { + return 100; + } + if (string2.equalsIgnoreCase("debug")) { + return 200; + } + if (string2.equalsIgnoreCase("info")) { + return 300; + } + if (string2.equalsIgnoreCase("warn")) { + return 400; + } + if (string2.equalsIgnoreCase("error")) { + return 500; + } + if (string2.equalsIgnoreCase("fatal")) { + return 600; + } + if (!string2.equalsIgnoreCase("silent")) break block9; + return 700; + } + } + if (this.m_core.getConfiguration() == NimbleConfiguration.INTEGRATION) return 100; + if (this.m_core.getConfiguration() != NimbleConfiguration.STAGE) return 500; + return 100; + } + + private void write(int n2, String string2, String object) { + string2 = Utility.validString(string2) ? string2 + "> " + object : " " + object; + if (this.m_cache != null) { + LogRecord logRecord = new LogRecord();//object + logRecord.level = n2; + logRecord.message = string2; + this.m_cache.add(logRecord); + return; + } + this.writeLine(n2, string2); + } + + private void writeLine(int n2, String string2) { + block15: { + String string3; + int n3 = 0; + int n4 = 0; + int n5 = 0; + int n6 = 0; + switch (n2) { + default: { + int n7; + String[] stringArray = this.formatLine(String.format("NIM(%d)", n2), string2); + string3 = stringArray[0]; + for (n7 = 0; n7 < stringArray.length - 1; ++n7) { + Log.e((String)"Nimble", (String)string3); + this.outputMessageToFile(string3); + string3 = stringArray[n7 + 1]; + } + break; + } + case 100: { + for (String string4 : this.formatLine("NIM_VERBOSE", string2)) { + Log.v((String)"Nimble", (String)string4); + this.outputMessageToFile(string4); + } + break block15; + } + case 200: { + int n7; + String[] stringArray = this.formatLine("NIM_DEBUG", string2); + n4 = stringArray.length; + for (n7 = n3; n7 < n4; ++n7) { + String string5 = stringArray[n7]; + Log.d((String)"Nimble", (String)string5); + this.outputMessageToFile(string5); + } + break block15; + } + case 300: { + int n7; + String[] stringArray = this.formatLine("NIM_INFO", string2); + n3 = stringArray.length; + for (n7 = n4; n7 < n3; ++n7) { + String string6 = stringArray[n7]; + Log.i((String)"Nimble", (String)string6); + this.outputMessageToFile(string6); + } + break block15; + } + case 400: { + int n7; + String[] stringArray = this.formatLine("NIM_WARN", string2); + n3 = stringArray.length; + for (n7 = n5; n7 < n3; ++n7) { + String string7 = stringArray[n7]; + Log.w((String)"Nimble", (String)string7); + this.outputMessageToFile(string7); + } + break block15; + } + case 500: { + int n7; + String[] stringArray = this.formatLine("NIM_ERROR", string2); + n3 = stringArray.length; + for (n7 = n6; n7 < n3; ++n7) { + String string8 = stringArray[n7]; + Log.e((String)"Nimble", (String)string8); + this.outputMessageToFile(string8); + } + break block15; + } + case 600: { + int n7; + String[] stringArray = this.formatLine("NIM_FATAL", string2); + String string9 = stringArray[0]; + for (n7 = 0; n7 < stringArray.length - 1; ++n7) { + Log.e((String)"Nimble", (String)string9); + this.outputMessageToFile(string9); + string9 = stringArray[n7 + 1]; + } + Log.wtf((String)"Nimble", (String)string9); + this.outputMessageToFile(string9); + break block15; + } + } + Log.wtf((String)"Nimble", (String)string3); + this.outputMessageToFile(string3); + } + if (n2 < 600) return; + if (this.m_core.getConfiguration() == NimbleConfiguration.INTEGRATION) throw new AssertionError((Object)string2); + if (this.m_core.getConfiguration() != NimbleConfiguration.STAGE) return; + throw new AssertionError((Object)string2); + } + + protected void connectToCore(BaseCore baseCore) { + this.m_core = baseCore; + this.configure(); + this.flushCache(); + } + + protected void disconnectFromCore() { + this.m_core = null; + } + + @Override + public String getComponentId() { + return "com.ea.nimble.NimbleLog"; + } + + @Override + public String getLogFilePath() { + return this.m_filePath.toString(); + } + + @Override + public int getThresholdLevel() { + return this.m_level; + } + + @Override + public void resume() { + if (this.m_guardTimer == null) return; + this.m_guardTimer.fire(); + this.m_guardTimer.resume(); + } + + @Override + public void setThresholdLevel(int n2) { + this.m_level = n2; + } + + @Override + public void setup() { + this.configure(); + } + + @Override + public void suspend() { + if (this.m_guardTimer == null) return; + this.m_guardTimer.pause(); + } + + @Override // com.ea.nimble.Component + public void teardown() { + if (this.m_guardTimer != null) { + this.m_guardTimer.cancel(); + this.m_guardTimer = null; + } + if (this.m_logFileStream != null) { + try { + this.m_logFileStream.close(); + } catch (IOException e) { + Log.e(Global.NIMBLE_ID, "LOG: Can't close log file"); + } + this.m_logFileStream = null; + } + } + + @Override + public void writeWithSource(int n2, Object object, String string2, Object ... objectArray) { + if (n2 < this.m_level) return; + if (!Utility.validString(string2)) { + return; + } + if (objectArray.length > 0) { + string2 = String.format(string2, objectArray); + } + if (object instanceof LogSource) { + this.write(n2, ((LogSource)object).getLogSourceTitle(), string2); + return; + } + if (this.m_level <= 100 && object != null) { + this.write(n2, object.getClass().getName(), string2); + return; + } + this.write(n2, null, string2); + } + + @Override + public void writeWithTitle(int n2, String string2, String string3, Object ... objectArray) { + if (n2 < this.m_level) return; + if (!Utility.validString(string3)) { + return; + } + if (objectArray.length > 0) { + string3 = String.format(string3, objectArray); + } + this.write(n2, string2, string3); + } + + private class GuardTask + implements Runnable { + private GuardTask() { + } + + @Override + public void run() { + if (LogImpl.this.m_filePath == null) return; + if (LogImpl.this.m_filePath.length() <= (long)(LogImpl.this.m_sizeLimit * 1024)) return; + LogImpl.this.clearLog(); + } + } + + private class LogRecord { + public int level; + public String message; + + private LogRecord() { + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/LogSource.java b/app/src/main/java/com/ea/nimble/LogSource.java new file mode 100644 index 0000000..197da4f --- /dev/null +++ b/app/src/main/java/com/ea/nimble/LogSource.java @@ -0,0 +1,9 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +public interface LogSource { + public String getLogSourceTitle(); +} + diff --git a/app/src/main/java/com/ea/nimble/Network.java b/app/src/main/java/com/ea/nimble/Network.java new file mode 100644 index 0000000..4c38966 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Network.java @@ -0,0 +1,72 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Iterator; +import java.util.Map; + +public class Network { + public static final String COMPONENT_ID = "com.ea.nimble.network"; + + public static String generateParameterString(Map object) { + if (object == null) { + return null; + } + if (object.size() == 0) return null; + String string2 = ""; + Iterator> iterator = object.entrySet().iterator(); + return ""; + } + + public static URL generateURL(String string2, Map object) { + if ("".equals(string2)) { + Log.Helper.LOGWS("Network", "Base url is blank, return null"); + return null; + } + if (Network.generateParameterString(object) == null) { + Log.Helper.LOGWS("Network", "Generated URL with only base url = %s", string2); + } else { + string2 = string2 + "?" + object; + Log.Helper.LOGVS("Network", "Generated URL = %s", string2); + } + try { + return new URL(string2); + } + catch (MalformedURLException malformedURLException) { + Log.Helper.LOGFS("Network", "Malformed URL from %s", string2); + return null; + } + } + + public static INetwork getComponent() { + return (INetwork)((Object)Base.getComponent(COMPONENT_ID)); + } + + public enum Status { + UNKNOWN, + NONE, + DEAD, + OK; + + + public String toString() { + switch (this.ordinal()) { + default: { + return "NET UNKNOWN"; + } + case 1: { + return "NET NONE"; + } + case 2: { + return "NET DEAD"; + } + case 3: + } + return "NET OK"; + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/NetworkConnection.java b/app/src/main/java/com/ea/nimble/NetworkConnection.java new file mode 100644 index 0000000..d5f8cce --- /dev/null +++ b/app/src/main/java/com/ea/nimble/NetworkConnection.java @@ -0,0 +1,895 @@ +package com.ea.nimble; + +import android.text.TextUtils; + +import com.ea.ironmonkey.devmenu.util.Observer; +import com.google.ads.AdSize; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InterruptedIOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.io.UnsupportedEncodingException; +import java.net.HttpURLConnection; +import java.net.SocketTimeoutException; +import java.net.UnknownHostException; +import java.nio.channels.FileChannel; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Stack; + +public class NetworkConnection implements LogSource, NetworkConnectionHandle, Runnable { + private static int MAXIMUM_RAW_DATA_LENGTH = 1048576; + static int s_loggingIdCount = 100; + private NetworkConnectionCallback m_completionCallback; + private Date m_connectionStartTimestamp; + private NetworkConnectionCallback m_headerCallback; + private String m_loggingId; + private NetworkImpl m_manager; + private IOperationalTelemetryDispatch m_otDispatch; + private NetworkConnectionCallback m_progressCallback; + private HttpRequest m_request; + private String m_requestDataForLog; + private HttpResponse m_response; + private StringBuilder m_responseDataForLog; + private Thread m_thread; + + public NetworkConnection(NetworkImpl networkImpl, HttpRequest httpRequest) { + this(networkImpl, httpRequest, null); + } + + public NetworkConnection(NetworkImpl networkImpl, HttpRequest httpRequest, IOperationalTelemetryDispatch iOperationalTelemetryDispatch) { + this.m_manager = networkImpl; + this.m_thread = null; + this.m_request = httpRequest; + this.m_response = new HttpResponse(); + this.m_headerCallback = null; + this.m_progressCallback = null; + this.m_completionCallback = null; + this.m_connectionStartTimestamp = null; + this.m_otDispatch = iOperationalTelemetryDispatch; + this.m_loggingId = String.valueOf(s_loggingIdCount); + int i = s_loggingIdCount; + s_loggingIdCount = i + 1; + if (i >= 1000) { + s_loggingIdCount = 100; + } + } + + private String beautifyJSONString(String str) { + if (str == null || str.length() <= 0) { + return str; + } + String property = System.getProperty("line.separator"); + StringBuilder sb = new StringBuilder(str.length() + 2048); + Stack stack = new Stack(); + int i = 0; + boolean z = false; + boolean z2 = true; + for (int i2 = 0; i2 < str.length(); i2++) { + char charAt = str.charAt(i2); + z2 = z2; + i = i; + z = z; + switch (charAt) { + case '\t': + case AdSize.LANDSCAPE_AD_HEIGHT /* 32 */: + z2 = z2; + i = i; + z = z; + if (!z) { + sb.append(charAt); + z2 = z2; + i = i; + z = z; + break; + } else { + break; + } + case '\n': + case 13 /* 13 */: + break; + case ',': + sb.append(charAt).append(property).append(multiplyStringNTimes("\t", i)); + z = true; + z2 = true; + i = i; + break; + case '[': + case '{': + if (!z2) { + sb.append(property).append(multiplyStringNTimes("\t", i)); + } + i++; + stack.push(Character.valueOf(charAt)); + sb.append(charAt).append(property).append(multiplyStringNTimes("\t", i)); + z = true; + z2 = true; + break; + case ']': + case '}': + i--; + char charValue = ((Character) stack.pop()).charValue(); + if ((charAt != '}' || charValue == '{') && (charAt != ']' || charValue == '[')) { + sb.append(property).append(multiplyStringNTimes("\t", i)).append(charAt); + z = true; + z2 = z2; + break; + } else { + Log.Helper.LOGE(this, "JSONString expect valid closing brackets but found none"); + return str; + } + default: + sb.append(charAt); + z = false; + z2 = false; + i = i; + break; + } + } + if (stack.isEmpty()) { + return sb.toString(); + } + Log.Helper.LOGE(this, "JSONString did not close it's brackets, invalid json"); + return str; + } + + + private void downloadToBuffer(java.net.HttpURLConnection r7) throws java.io.IOException { + Observer.onCallingMethod(); + } + + private void downloadToBufferWithError(java.net.HttpURLConnection r7) { + Observer.onCallingMethod(); + } + + /* JADX WARN: Finally extract failed */ + private void downloadToFile(HttpURLConnection httpURLConnection) throws IOException { + if (!skipDownloadForOverwritePolicy(httpURLConnection)) { + File file = new File(this.m_request.targetFilePath); + File file2 = new File(ApplicationEnvironment.getComponent().getCachePath() + File.separator + file.getName()); + boolean z = file2.exists() && this.m_request.overwritePolicy.contains(IHttpRequest.OverwritePolicy.RESUME_DOWNLOAD); + InputStream inputStream = httpURLConnection.getInputStream(); + FileOutputStream fileOutputStream = new FileOutputStream(file2, z); + byte[] bArr = new byte[65536]; + Log.Helper.LOGI(this, "Started File Download for " + file.toString()); + while (true) { + try { + int read = inputStream.read(bArr); + if (read < 0) { + break; + } else if (read == 0) { + Thread.yield(); + } else { + fileOutputStream.write(bArr, 0, read); + this.m_response.downloadedContentLength += (long) read; + if (this.m_progressCallback != null) { + this.m_progressCallback.callback(this); + } + } + } catch (Throwable th) { + inputStream.close(); + fileOutputStream.close(); + throw th; + } + } + inputStream.close(); + fileOutputStream.close(); + if (file.exists() && !file.delete()) { + Log.Helper.LOGE(this, "Failed to delete existed target file " + file); + } + if (!file2.renameTo(file)) { + Log.Helper.LOGI(this, "Failed to move temp file " + file2 + " to target file " + file); + Log.Helper.LOGI(this, "Using fallback, and copying file instead " + file2 + "to target file " + file); + if (!file.exists()) { + file.createNewFile(); + } + FileChannel fileChannel = null; + FileChannel fileChannel2 = null; + FileChannel fileChannel3 = null; + FileChannel fileChannel4 = null; + try { + try { + FileChannel channel = new FileInputStream(file2).getChannel(); + FileChannel channel2 = new FileOutputStream(file).getChannel(); + fileChannel4 = channel2; + fileChannel2 = channel; + fileChannel3 = channel2; + fileChannel = channel; + channel2.transferFrom(channel, 0, channel.size()); + if (channel != null) { + channel.close(); + } + if (channel2 != null) { + channel2.close(); + } + if (file2.exists()) { + file2.delete(); + } + } catch (Exception e) { + fileChannel3 = fileChannel4; + fileChannel = fileChannel2; + Log.Helper.LOGE(this, "ERROR while copying file, " + e); + if (fileChannel2 != null) { + fileChannel2.close(); + } + if (fileChannel4 != null) { + fileChannel4.close(); + } + if (file2.exists()) { + file2.delete(); + } + } + } catch (Throwable th2) { + if (fileChannel != null) { + fileChannel.close(); + } + if (fileChannel3 != null) { + fileChannel3.close(); + } + if (file2.exists()) { + file2.delete(); + } + throw th2; + } + } + } + } + + private void finish() { + this.m_response.isCompleted = true; + logOperationalTelemetryResponse(); + if (this.m_completionCallback != null) { + this.m_completionCallback.callback(this); + } + synchronized (this) { + notifyAll(); + } + this.m_manager.removeConnection(this); + } + + private void httpRecv(HttpURLConnection httpURLConnection) throws IOException, Error { + InputStream errorStream; + try { + errorStream = httpURLConnection.getInputStream(); + } catch (Exception e) { + try { + errorStream = httpURLConnection.getErrorStream(); + } catch (Exception e2) { + throw new Error(Error.Code.NETWORK_CONNECTION_ERROR, "Exception when getting error stream from HTTP connection.", e2); + } + } + this.m_response.url = httpURLConnection.getURL(); + try { + this.m_response.statusCode = httpURLConnection.getResponseCode(); + this.m_response.expectedContentLength = (long) httpURLConnection.getContentLength(); + this.m_response.lastModified = httpURLConnection.getLastModified(); + for (Map.Entry> entry : httpURLConnection.getHeaderFields().entrySet()) { + this.m_response.headers.put(entry.getKey(), TextUtils.join(", ", entry.getValue())); + } + boolean z = this.m_response.expectedContentLength > ((long) MAXIMUM_RAW_DATA_LENGTH); + boolean validString = Utility.validString(this.m_request.targetFilePath); + if (!z || validString) { + this.m_response.downloadedContentLength = 0; + if (this.m_headerCallback != null) { + this.m_headerCallback.callback(this); + } + if (validString && errorStream != null) { + downloadToFile(httpURLConnection); + } else if (this.m_response.expectedContentLength != 0) { + if (this.m_response.data == null) { + this.m_response.data = new ByteBufferIOStream((int) this.m_response.expectedContentLength); + } else { + this.m_response.data.clear(); + } + if (this.m_response.statusCode == 200) { + downloadToBuffer(httpURLConnection); + } else { + downloadToBufferWithError(httpURLConnection); + } + } + if (!(this.m_response.statusCode == 200 || (validString && this.m_response.statusCode == 206))) { + throw new HttpError(this.m_response.statusCode, "Request " + this + " failed for HTTP error"); + } + return; + } + throw new Error(Error.Code.NETWORK_OVERSIZE_DATA, "Request " + this + " is oversize, please provide a local file path to download it as file."); + } finally { + if (errorStream != null) { + errorStream.close(); + } + logCommunication(); + } + } + + /* JADX WARN: Multi-variable type inference failed */ + /* JADX WARN: Type inference failed for: r6v0, types: [java.net.HttpURLConnection] */ + /* JADX WARN: Type inference failed for: r8v1, types: [java.io.OutputStream] */ + /* JADX WARN: Type inference failed for: r8v10, types: [java.lang.Object, java.lang.String] */ + /* JADX WARN: Type inference failed for: r8v11 */ + /* JADX WARN: Type inference failed for: r8v2 */ + /* JADX WARN: Type inference failed for: r8v3 */ + /* JADX WARN: Type inference failed for: r8v7 */ + /* JADX WARN: Type inference failed for: r8v8 */ + private void httpSend(HttpURLConnection httpURLConnection) throws IOException { + String str; + this.m_connectionStartTimestamp = new Date(); + if (this.m_request.headers != null) { + Iterator it = this.m_request.headers.keySet().iterator(); + while (it.hasNext()) { + str = it.next(); + httpURLConnection.setRequestProperty(str, this.m_request.headers.get(str)); + } + } + if (this.m_request.getMethod() == IHttpRequest.Method.POST || this.m_request.getMethod() == IHttpRequest.Method.PUT) { + byte[] byteArray = this.m_request.data.toByteArray(); + if (byteArray == null || byteArray.length <= 0) { + logRequest(); + return; + } + try { + prepareRequestLog(byteArray); + logRequest(); + httpURLConnection.setDoOutput(true); + httpURLConnection.setFixedLengthStreamingMode(byteArray.length); + OutputStream outputStream = null; + try { + OutputStream outputStream2 = httpURLConnection.getOutputStream(); + outputStream = outputStream2; + outputStream2.write(byteArray); + if (outputStream2 != null) { + outputStream2.close(); + } + } catch (Exception e) { + StringWriter stringWriter = new StringWriter(); + e.printStackTrace(new PrintWriter(stringWriter)); + Log.Helper.LOGE(this, "Exception in network connection:" + stringWriter.toString()); + if (outputStream != null) { + outputStream.close(); + } + } + } catch (Throwable th) { + } + } else { + logRequest(); + } + } + + private void logCommunication() { + if (Log.getComponent().getThresholdLevel() <= 100) { + int i = 4096; + if (this.m_requestDataForLog != null) { + i = 4096 + this.m_requestDataForLog.length(); + } + int i2 = i; + if (this.m_responseDataForLog != null) { + i2 = i + this.m_responseDataForLog.length(); + } + StringBuilder sb = new StringBuilder(i2); + sb.append(String.format("\n>>>> CONNECTION ID %s FINISHED >>>>>>>>>>>>>>\n", this.m_loggingId)); + sb.append("\n>>>> REQUEST >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); + sb.append("REQUEST: ").append(this.m_request.method.toString()); + sb.append(' ').append(this.m_request.url.toString()).append('\n'); + boolean z = false; + boolean z2 = false; + if (this.m_request.headers != null) { + z2 = false; + if (this.m_request.headers.size() > 0) { + Iterator it = this.m_request.headers.keySet().iterator(); + while (true) { + z2 = z; + if (!it.hasNext()) { + break; + } + String next = it.next(); + if (next != null) { + sb.append("REQ HEADER: ").append(next); + String safeString = Utility.safeString(this.m_request.headers.get(next)); + sb.append(" VALUE: ").append(safeString).append('\n'); + if (next.equals("Content-Type") && (safeString.contains("application/json") || safeString.contains("text/json"))) { + z = true; + } + } + } + } + } + if (this.m_requestDataForLog != null && this.m_requestDataForLog.length() > 0) { + sb.append("REQ BODY:\n"); + String str = this.m_requestDataForLog.toString(); + String str2 = str; + if (z2) { + str2 = beautifyJSONString(str); + } + sb.append(str2).append('\n'); + } + sb.append("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n"); + sb.append(">>>> RESPONSE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); + sb.append("RESP URL: ").append(this.m_response.url.toString()).append('\n'); + sb.append("RESP STATUS: ").append(this.m_response.statusCode).append('\n'); + boolean z3 = false; + boolean z4 = false; + if (this.m_response.headers != null) { + z4 = false; + if (this.m_response.headers.size() > 0) { + Iterator it2 = this.m_response.headers.keySet().iterator(); + while (true) { + z4 = z3; + if (!it2.hasNext()) { + break; + } + String next2 = it2.next(); + if (next2 != null) { + sb.append("RESP HEADER: ").append(next2); + String safeString2 = Utility.safeString(this.m_response.headers.get(next2)); + sb.append(" VALUE: ").append(safeString2).append('\n'); + if (next2.equals("Content-Type") && (safeString2.contains("application/json") || safeString2.contains("text/json"))) { + z3 = true; + } + } + } + } + } + sb.append("RESP BODY:\n"); + String str3 = ": there is no response body for this call"; + try { + if (this.m_responseDataForLog != null) { + str3 = this.m_responseDataForLog.toString(); + } + } catch (Exception e) { + Log.Helper.LOGE(this, "Attempting to process the response body failed."); + str3 = ": there is no response body for this call"; + if (this.m_response != null) { + str3 = ": there is no response body for this call"; + if (this.m_response.getError() != null) { + str3 = ": there is no response body for this call"; + if (this.m_response.getError().getMessage() != null) { + str3 = this.m_response.getError().getMessage(); + } + } + } + } + String str4 = str3; + if (z4) { + str4 = beautifyJSONString(str3); + } + sb.append(str4).append('\n'); + sb.append("<<<< CONNECTION FINISHED <<<<<<<<<<<<<<<<<<<<<"); + Log.Helper.LOGV(this, sb.toString()); + } + } + + private void logRequest() { + if (Log.getComponent().getThresholdLevel() <= 100) { + int i = 2048; + if (this.m_requestDataForLog != null) { + i = 2048 + this.m_requestDataForLog.length(); + } + StringBuilder sb = new StringBuilder(i); + sb.append(String.format("\n>>>> CONNECTION ID %s BEGIN >>>>>>>>>>>>>>>>>\n", this.m_loggingId)); + sb.append("REQUEST: ").append(this.m_request.method.toString()); + sb.append(' ').append(this.m_request.url.toString()).append('\n'); + boolean z = false; + boolean z2 = false; + if (this.m_request.headers != null) { + z2 = false; + if (this.m_request.headers.size() > 0) { + Iterator it = this.m_request.headers.keySet().iterator(); + while (true) { + z2 = z; + if (!it.hasNext()) { + break; + } + String next = it.next(); + sb.append("REQ HEADER: ").append(next); + String str = this.m_request.headers.get(next); + sb.append(" VALUE: ").append(str).append('\n'); + if (next.equals("Content-Type") && (str.contains("application/json") || str.contains("text/json"))) { + z = true; + } + } + } + } + if (this.m_requestDataForLog != null && this.m_requestDataForLog.length() > 0) { + sb.append("REQ BODY:\n"); + String str2 = this.m_requestDataForLog.toString(); + String str3 = str2; + if (z2) { + str3 = beautifyJSONString(str2); + } + sb.append(str3).append('\n'); + } + sb.append("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"); + Log.Helper.LOGV(this, sb.toString()); + } + } + + private String multiplyStringNTimes(String str, int i) { + StringBuilder sb = new StringBuilder(str.length() * i); + for (int i2 = 0; i2 < i; i2++) { + sb.append(str); + } + return sb.toString(); + } + + private void prepareRequestLog(byte[] bArr) { + if (Log.getComponent().getThresholdLevel() <= 100) { + try { + this.m_requestDataForLog = new String(bArr, "UTF-8"); + } catch (UnsupportedEncodingException e) { + this.m_requestDataForLog = null; + } + } + } + + private void prepareResponseLog() { + if (Log.getComponent().getThresholdLevel() <= 100) { + this.m_responseDataForLog = new StringBuilder(this.m_response.expectedContentLength > 0 ? (int) this.m_response.expectedContentLength : 4096); + } + } + + private void prepareResponseLog(byte[] bArr, int i, int i2) { + if (Log.getComponent().getThresholdLevel() <= 100 && this.m_responseDataForLog != null) { + try { + this.m_responseDataForLog.append(new String(bArr, i, i2, "UTF-8")); + } catch (UnsupportedEncodingException e) { + this.m_responseDataForLog = null; + } + } + } + + /* JADX WARN: Code restructure failed: missing block: B:10:0x003a, code lost: + if (r5.m_request.overwritePolicy.contains(com.ea.nimble.IHttpRequest.OverwritePolicy.LENGTH_CHECK) == false) goto L_0x003d; + */ + /* + Code decompiled incorrectly, please refer to instructions dump. + To view partially-correct code enable 'Show inconsistent code' option in preferences + */ + private boolean skipDownloadForOverwritePolicy(java.net.HttpURLConnection r6) { + /* + r5 = this; + r0 = 1 + r8 = r0 + java.io.File r0 = new java.io.File + r1 = r0 + r2 = r5 + com.ea.nimble.HttpRequest r2 = r2.m_request + java.lang.String r2 = r2.targetFilePath + r1.(r2) + r6 = r0 + r0 = r6 + boolean r0 = r0.exists() + if (r0 != 0) goto L_0x001c + r0 = 0 + r7 = r0 + L_0x001a: + r0 = r7 + return r0 + L_0x001c: + r0 = r6 + long r0 = r0.length() + r1 = r5 + com.ea.nimble.HttpResponse r1 = r1.m_response + long r1 = r1.expectedContentLength + int r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1)) + if (r0 == 0) goto L_0x003d + r0 = r8 + r7 = r0 + r0 = r5 + com.ea.nimble.HttpRequest r0 = r0.m_request + java.util.EnumSet r0 = r0.overwritePolicy + com.ea.nimble.IHttpRequest$OverwritePolicy r1 = com.ea.nimble.IHttpRequest.OverwritePolicy.LENGTH_CHECK + boolean r0 = r0.contains(r1) + if (r0 != 0) goto L_0x001a + L_0x003d: + r0 = r8 + r7 = r0 + r0 = r6 + long r0 = r0.lastModified() + r1 = r5 + com.ea.nimble.HttpResponse r1 = r1.m_response + long r1 = r1.lastModified + int r0 = (r0 > r1 ? 1 : (r0 == r1 ? 0 : -1)) + if (r0 < 0) goto L_0x001a + r0 = r8 + r7 = r0 + r0 = r5 + com.ea.nimble.HttpRequest r0 = r0.m_request + java.util.EnumSet r0 = r0.overwritePolicy + com.ea.nimble.IHttpRequest$OverwritePolicy r1 = com.ea.nimble.IHttpRequest.OverwritePolicy.DATE_CHECK + boolean r0 = r0.contains(r1) + if (r0 == 0) goto L_0x001a + r0 = 1 + return r0 + */ + throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.NetworkConnection.skipDownloadForOverwritePolicy(java.net.HttpURLConnection):boolean"); + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public void cancel() { + synchronized (this) { + if (this.m_thread != null) { + this.m_thread.interrupt(); + } else { + finishWithError(new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "Network connection " + toString() + " is cancelled")); + } + } + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public void cancelForAppSuspend() { + cancel(); + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public void finishWithError(Exception exc) { + if (this.m_response.isCompleted) { + Log.Helper.LOGI(this, "Finished connection %s skipped an error %s", toString(), exc.toString()); + return; + } + Log.Helper.LOGW(this, "Running connection number %s with name %s failed for error %s", this.m_loggingId, toString(), exc.toString()); + this.m_response.error = exc; + finish(); + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public NetworkConnectionCallback getCompletionCallback() { + return this.m_completionCallback; + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public NetworkConnectionCallback getHeaderCallback() { + return this.m_headerCallback; + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "Network"; + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public NetworkConnectionCallback getProgressCallback() { + return this.m_progressCallback; + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public HttpRequest getRequest() { + return this.m_request; + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public HttpResponse getResponse() { + return this.m_response; + } + + void logOperationalTelemetryResponse() { + if (this.m_request == null || this.m_request.url == null) { + Log.Helper.LOGE(this, "Empty request object and/or request URL for OT logging."); + } else if (this.m_response == null) { + Log.Helper.LOGE(this, "Empty response object for OT logging."); + } else if (!BaseCore.getInstance().isActive()) { + Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging."); + } else { + if (this.m_otDispatch == null) { + this.m_otDispatch = OperationalTelemetryDispatch.getComponent(); + if (this.m_otDispatch == null) { + Log.Helper.LOGV(this, "OperationalTelemetry Component not active for operational telemetry logging."); + return; + } + } + HashMap hashMap = new HashMap(); + String protocol = this.m_request.url.getProtocol(); + String path = this.m_request.url.getPath(); + String query = this.m_request.url.getQuery(); + String host = this.m_request.url.getHost(); + int i = this.m_response.statusCode; + String url = this.m_request.url.toString(); + String str = Global.NOTIFICATION_DICTIONARY_RESULT_FAIL; + if (this.m_connectionStartTimestamp != null) { + try { + Date date = new Date(); + str = Global.NOTIFICATION_DICTIONARY_RESULT_FAIL; + if (date != null) { + str = String.valueOf(date.getTime() - this.m_connectionStartTimestamp.getTime()); + } + } catch (Exception e) { + Log.Helper.LOGE(this, "Unable to allocate new Date object to calculate response time."); + str = Global.NOTIFICATION_DICTIONARY_RESULT_FAIL; + } + } + Exception error = this.m_response.getError(); + boolean z = false; + if (error != null) { + if (error instanceof Error) { + Error error2 = (Error) error; + int code = error2.getCode(); + hashMap.put("NIMBLE_ERROR_DOMAIN", error2.getDomain()); + hashMap.put("NIMBLE_ERROR_CODE", String.valueOf(code)); + z = error2.getDomain().equals(Error.ERROR_DOMAIN) && code == Error.Code.NETWORK_TIMEOUT.intValue(); + } else { + hashMap.put("NIMBLE_ERROR_DOMAIN", error.getClass().getName()); + z = false; + } + } + hashMap.put("CONNECTIONID", this.m_loggingId); + hashMap.put("URL_ABSOLUTE", url); + hashMap.put("URL_PROTOCOL", protocol); + hashMap.put("URL_PATH", path); + hashMap.put("URL_QUERY", query); + hashMap.put("URL_HOST", host); + hashMap.put("RESPONSE_TIME_MS", str); + hashMap.put("HTTP_STATUS_CODE", String.valueOf(i)); + hashMap.put("REQUEST_TIMED_OUT", String.valueOf(z)); + this.m_otDispatch.logEvent("com.ea.nimble.network", hashMap); + } + } + + @Override // java.lang.Runnable + public void run() { + try { + try { + try { + try { + try { + try { + try { + if (this.m_response.isCompleted) { + synchronized (this) { + try { + this.m_thread = null; + } catch (Throwable th) { + throw th; + } + } + } else if (Thread.interrupted()) { + throw new InterruptedIOException(); + } else { + synchronized (this) { + try { + this.m_thread = Thread.currentThread(); + } catch (Throwable th2) { + throw th2; + } + } + 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"); + if (Thread.interrupted()) { + throw new InterruptedIOException(); + } + httpSend(httpURLConnection); + if (Thread.interrupted()) { + throw new InterruptedIOException(); + } + httpRecv(httpURLConnection); + finish(); + synchronized (this) { + try { + this.m_thread = null; + } catch (Throwable th3) { + throw th3; + } + } + } + } catch (Throwable th4) { + synchronized (this) { + try { + this.m_thread = null; + throw th4; + } catch (Throwable th5) { + throw th5; + } + } + } + } catch (InterruptedIOException e) { + finishWithError(new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "Connection " + toString() + " is cancelled", e)); + synchronized (this) { + try { + this.m_thread = null; + } catch (Throwable th6) { + throw th6; + } + } + } + } catch (Error e2) { + finishWithError(e2); + synchronized (this) { + try { + this.m_thread = null; + } catch (Throwable th7) { + throw th7; + } + } + } + } catch (SocketTimeoutException e3) { + finishWithError(new Error(Error.Code.NETWORK_TIMEOUT, "Connection " + toString() + " timed out", e3)); + synchronized (this) { + try { + this.m_thread = null; + } catch (Throwable th8) { + throw th8; + } + } + } + } 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) { + try { + this.m_thread = null; + } catch (Throwable th9) { + throw th9; + } + } + } + } 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) { + try { + this.m_thread = null; + } catch (Throwable th10) { + throw th10; + } + } + } + } catch (IOException e6) { + finishWithError(new Error(Error.Code.NETWORK_CONNECTION_ERROR, "Connection " + toString() + " failed with I/O exception", e6)); + synchronized (this) { + try { + this.m_thread = null; + } catch (Throwable th11) { + throw th11; + } + } + } catch (Exception e7) { + finishWithError(new Error(Error.Code.SYSTEM_UNEXPECTED, "Unexpected error.", e7)); + synchronized (this) { + try { + this.m_thread = null; + } catch (Throwable th12) { + throw th12; + } + } + } + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public void setCompletionCallback(NetworkConnectionCallback networkConnectionCallback) { + this.m_completionCallback = networkConnectionCallback; + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public void setHeaderCallback(NetworkConnectionCallback networkConnectionCallback) { + this.m_headerCallback = networkConnectionCallback; + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public void setProgressCallback(NetworkConnectionCallback networkConnectionCallback) { + this.m_progressCallback = networkConnectionCallback; + } + + @Override // com.ea.nimble.NetworkConnectionHandle + public void waitOn() { + synchronized (this) { + while (!this.m_response.isCompleted) { + try { + wait(); + } catch (InterruptedException e) { + } + } + } + } +} diff --git a/app/src/main/java/com/ea/nimble/NetworkConnectionCallback.java b/app/src/main/java/com/ea/nimble/NetworkConnectionCallback.java new file mode 100644 index 0000000..a1b2a99 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/NetworkConnectionCallback.java @@ -0,0 +1,11 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.NetworkConnectionHandle; + +public interface NetworkConnectionCallback { + public void callback(NetworkConnectionHandle var1); +} + diff --git a/app/src/main/java/com/ea/nimble/NetworkConnectionHandle.java b/app/src/main/java/com/ea/nimble/NetworkConnectionHandle.java new file mode 100644 index 0000000..141bf0f --- /dev/null +++ b/app/src/main/java/com/ea/nimble/NetworkConnectionHandle.java @@ -0,0 +1,31 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.IHttpRequest; +import com.ea.nimble.IHttpResponse; +import com.ea.nimble.NetworkConnectionCallback; + +public interface NetworkConnectionHandle { + public void cancel(); + + public NetworkConnectionCallback getCompletionCallback(); + + public NetworkConnectionCallback getHeaderCallback(); + + public NetworkConnectionCallback getProgressCallback(); + + public IHttpRequest getRequest(); + + public IHttpResponse getResponse(); + + public void setCompletionCallback(NetworkConnectionCallback var1); + + public void setHeaderCallback(NetworkConnectionCallback var1); + + public void setProgressCallback(NetworkConnectionCallback var1); + + public void waitOn(); +} + diff --git a/app/src/main/java/com/ea/nimble/NetworkImpl.java b/app/src/main/java/com/ea/nimble/NetworkImpl.java new file mode 100644 index 0000000..620c818 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/NetworkImpl.java @@ -0,0 +1,486 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + * android.content.IntentFilter + * android.net.ConnectivityManager + */ +package com.ea.nimble; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; + +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; + +public class NetworkImpl +extends Component +implements INetwork, +LogSource { + private static final String BACKUP_NETWORK_REACHABILITY_CHECK_URL = "http://www.ea.com"; + private static final int DETECTION_TIMEOUT = 30; + private static final String MAIN_NETWORK_REACHABILITY_CHECK_URL = "http://cdn.skum.eamobile.com"; + private static final int[] PING_INTERVAL = new int[]{5, 10, 30, 60}; + private static final int QUICK_DETECTION_TIMEOUT = 5; + private final int MAX_CONCURRENT_THREADS; + private ExecutorService m_asyncTaskManager; + private ConnectivityReceiver m_connectivityReceiver; + private NetworkConnection m_detectionConnection; + private boolean m_isWifi; + private DetectionState m_networkDetectionState; + private int m_pingIndex; + private List m_queue; + private Network.Status m_status; + private Timer m_timer; + private LinkedList m_waitingToExecuteQueue; + + public NetworkImpl() { + this.MAX_CONCURRENT_THREADS = 4; + Log.Helper.LOGV(this, "constructor, start task manager and monitor the connectivity"); + this.m_connectivityReceiver = null; + this.m_status = Network.Status.UNKNOWN; + this.m_detectionConnection = null; + this.m_networkDetectionState = DetectionState.NONE; + this.m_pingIndex = 0; + this.m_queue = new ArrayList(); + this.startWork(); + } + + static /* synthetic */ Timer access$302(NetworkImpl networkImpl, Timer timer) { + networkImpl.m_timer = timer; + return timer; + } + + private void detect(boolean bl2) { + if (this.m_detectionConnection != null) { + if (!bl2) { + return; + } + NetworkConnection networkConnection = this.m_detectionConnection; + this.m_detectionConnection = null; + networkConnection.cancel(); + } + this.stopPing(); + if (this.reachabilityCheck()) { + if (this.m_status != Network.Status.DEAD) { + this.setStatus(Network.Status.OK); + } + this.m_networkDetectionState = DetectionState.VERIFY_REACHABLE_MAIN; + } else { + if (this.m_status == Network.Status.UNKNOWN) { + this.setStatus(Network.Status.NONE); + } + this.m_networkDetectionState = DetectionState.VERIFY_UNREACHABLE_MAIN; + } + this.verifyReachability(MAIN_NETWORK_REACHABILITY_CHECK_URL, 5.0); + } + + /* + * Enabled unnecessary exception pruning + */ + private void onReachabilityVerification(NetworkConnectionHandle object) { + synchronized (this) { + Exception exception = object.getResponse().getError(); + if (exception == null) { + Log.Helper.LOGD(this, "network verified reachable."); + this.setStatus(Network.Status.OK); + this.m_detectionConnection = null; + } else { + if (object != this.m_detectionConnection) return; + this.m_detectionConnection = null; + Log.Helper.LOGD(this, "network verified unreachable, ERROR %s for detection state %s", object.getResponse().getError(), this.m_networkDetectionState); + if ( + //TODO В этом месте ложится при targetSdk 30 + exception instanceof Error/* && + ((Error)((Error)exception)).getDomain().equals("NimbleError") && + ((Error)object).isError(Error.Code.NETWORK_OPERATION_CANCELLED)*/) { + Log.Helper.LOGW(this, "Network detection verification connection get cancelled for unknown reason (maybe reasonable for Android)"); + } + switch (this.m_networkDetectionState.ordinal()) { + case 1: { + this.m_networkDetectionState = DetectionState.VERIFY_REACHABLE_BACKUP; + this.verifyReachability(BACKUP_NETWORK_REACHABILITY_CHECK_URL, 30.0); + break; + } + case 2: { + this.setStatus(Network.Status.NONE); + break; + } + case 3: { + this.m_networkDetectionState = DetectionState.PING; + if (this.m_status == Network.Status.DEAD) { + this.startPing(); + break; + } + this.setStatus(Network.Status.DEAD); + this.m_pingIndex = 0; + this.startPing(); + break; + } + case 4: { + ++this.m_pingIndex; + this.startPing(); + break; + } + } + } + return; + } + } + + private boolean reachabilityCheck() { + this.m_isWifi = false; + Context context = ApplicationEnvironment.getComponent().getApplicationContext(); + if (context == null) { + return false; + } + if ((context.getSystemService(Context.CONNECTIVITY_SERVICE)) == null) return false; + if (!BaseCore.getInstance().isActive()) { + Log.Helper.LOGD(this, "BaseCore not active yet. Postpone reachability check."); + return false; + } + this.m_isWifi = true; + return true; + } + + private void registerNetworkListener() { + if (this.m_connectivityReceiver != null) return; + Log.Helper.LOGD(this, "Register network reachability listener."); + this.m_connectivityReceiver = new ConnectivityReceiver(); + IntentFilter intentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"); + ApplicationEnvironment.getComponent().getApplicationContext().registerReceiver((BroadcastReceiver)this.m_connectivityReceiver, intentFilter); + } + + private void setStatus(Network.Status status) { + Log.Helper.LOGI(this, "Status change %s -> %s", this.m_status, status); + if (status == this.m_status) return; + this.m_status = status; + Utility.sendBroadcast("nimble.notification.networkStatusChanged", null); + } + + private void startPing() { + if (this.m_pingIndex >= PING_INTERVAL.length) { + this.m_pingIndex = PING_INTERVAL.length - 1; + } + this.m_timer = new Timer(new TimerTask()); + this.m_timer.schedule(PING_INTERVAL[this.m_pingIndex], false); + } + + /* + * Enabled unnecessary exception pruning + */ + private void startWork() { + synchronized (this) { + Object object = this.m_asyncTaskManager; + if (object != null) { + return; + } + this.detect(true); + this.registerNetworkListener(); + this.m_asyncTaskManager = Executors.newFixedThreadPool(4); + if (this.m_waitingToExecuteQueue == null) return; + if (this.m_waitingToExecuteQueue.isEmpty()) return; + Log.Helper.LOGW(this, "NetworkConnections waiting to execute on new AsyncTaskManager. Executing."); + while (!this.m_waitingToExecuteQueue.isEmpty()) { + object = this.m_waitingToExecuteQueue.poll(); + Log.Helper.LOGW(this, "Executing request URL: " + ((NetworkConnection)object).getRequest().url.toString()); + this.m_asyncTaskManager.execute((Runnable)object); + } + } + } + + private void stopPing() { + if (this.m_timer == null) return; + this.m_timer.cancel(); + this.m_timer = null; + } + + /* + * Enabled unnecessary exception pruning + * Converted monitor instructions to comments + */ + private void stopWork() { + // MONITORENTER : this + this.m_detectionConnection = null; + this.stopPing(); + this.unregisterNetworkListener(); + // MONITOREXIT : this + if (this.m_asyncTaskManager == null) { + return; + } + try { + Iterator iterator = this.m_asyncTaskManager.shutdownNow().iterator(); + while (iterator.hasNext()) { + ((NetworkConnection)iterator.next()).cancelForAppSuspend(); + } + this.m_asyncTaskManager.awaitTermination(60L, TimeUnit.SECONDS); + } + catch (InterruptedException interruptedException) { + this.m_asyncTaskManager.shutdownNow(); + Thread.currentThread().interrupt(); + } + this.m_asyncTaskManager = null; + } + + /* + * Unable to fully structure code + */ + private void unregisterNetworkListener() { + if (this.m_connectivityReceiver == null) return; + try { + ApplicationEnvironment.getComponent().getApplicationContext().unregisterReceiver((BroadcastReceiver)this.m_connectivityReceiver); +lbl4: + // 2 sources + + while (true) { + this.m_connectivityReceiver = null; + return; + } + } + catch (IllegalArgumentException var1_1) { + Log.Helper.LOGE(this, "Unable to unregister network reachability listener even it does exists"); + } + } + + private void verifyReachability(String string2, double d2) { + block3: { + try { + HttpRequest httpRequest = new HttpRequest(new URL(string2)); + httpRequest.timeout = d2; + httpRequest.method = IHttpRequest.Method.GET; + this.m_detectionConnection = new NetworkConnection(this, httpRequest); + this.m_detectionConnection.setCompletionCallback(new NetworkConnectionCallback(){ + + @Override + public void callback(NetworkConnectionHandle networkConnectionHandle) { + NetworkImpl.this.onReachabilityVerification(networkConnectionHandle); + } + }); + if (this.m_asyncTaskManager != null && !this.m_asyncTaskManager.isShutdown()) break block3; + } + catch (MalformedURLException malformedURLException) { + Log.Helper.LOGE(this, "Invalid url: " + string2); + return; + } + Log.Helper.LOGW(this, "AsyncTaskManager is not ready. Queueing networkconnection until AsyncTaskManager is started."); + if (this.m_waitingToExecuteQueue == null) { + this.m_waitingToExecuteQueue = new LinkedList(); + } + this.m_waitingToExecuteQueue.addFirst(this.m_detectionConnection); + return; + } + this.m_asyncTaskManager.execute(this.m_detectionConnection); + } + + @Override + public void cleanup() { + this.stopWork(); + Log.Helper.LOGV(this, "cleanup"); + } + + @Override + public void forceRedetectNetworkStatus() { + synchronized (this) { + this.detect(true); + return; + } + } + + @Override + public String getComponentId() { + return "com.ea.nimble.network"; + } + + @Override + public String getLogSourceTitle() { + return "Network"; + } + + @Override + public Network.Status getStatus() { + return this.m_status; + } + + @Override + public boolean isNetworkWifi() { + return this.m_isWifi; + } + + void removeConnection(NetworkConnection networkConnection) { + synchronized (this) { + this.m_queue.remove(networkConnection); + return; + } + } + + @Override + public void resume() { + Log.Helper.LOGV(this, "resume"); + synchronized (this) { + this.detect(true); + this.registerNetworkListener(); + return; + } + } + + @Override + public NetworkConnectionHandle sendDeleteRequest(URL object, HashMap hashMap, NetworkConnectionCallback networkConnectionCallback) { + HttpRequest httpRequest = new HttpRequest(object); + httpRequest.method = IHttpRequest.Method.DELETE; + httpRequest.headers = hashMap; + return this.sendRequest(httpRequest, networkConnectionCallback); + } + + @Override + public NetworkConnectionHandle sendGetRequest(URL object, HashMap hashMap, NetworkConnectionCallback networkConnectionCallback) { + HttpRequest httpRequest = new HttpRequest(object); + httpRequest.method = IHttpRequest.Method.GET; + httpRequest.headers = hashMap; + return this.sendRequest(httpRequest, networkConnectionCallback); + } + + @Override + public NetworkConnectionHandle sendPostRequest(URL object, HashMap hashMap, byte[] byArray, NetworkConnectionCallback networkConnectionCallback) { + HttpRequest httpRequest = new HttpRequest(object); + httpRequest.method = IHttpRequest.Method.POST; + httpRequest.headers = hashMap; + try { + httpRequest.data.write(byArray); + return this.sendRequest(httpRequest, networkConnectionCallback); + } + catch (Exception exception) { + exception.printStackTrace(); + return this.sendRequest(httpRequest, networkConnectionCallback); + } + } + + @Override + public NetworkConnectionHandle sendRequest(HttpRequest httpRequest, NetworkConnectionCallback networkConnectionCallback) { + return this.sendRequest(httpRequest, networkConnectionCallback, null); + } + + /* + * Enabled unnecessary exception pruning + * Converted monitor instructions to comments + */ + @Override + public NetworkConnectionHandle sendRequest( + HttpRequest httpRequest, + NetworkConnectionCallback networkConnectionCallback, + IOperationalTelemetryDispatch object) { + + NetworkConnection networkConnection = + httpRequest.runInBackground ? + new BackgroundNetworkConnection(this, httpRequest, (IOperationalTelemetryDispatch) object) : + new NetworkConnection(this, httpRequest, (IOperationalTelemetryDispatch) object); + + networkConnection.setCompletionCallback(networkConnectionCallback); + if (httpRequest.url == null || !Utility.validString(httpRequest.url.toString())) { + networkConnection.finishWithError(new Error(Error.Code.INVALID_ARGUMENT, "Sending request without valid url")); + return networkConnection; + } + if (this.m_status != Network.Status.OK) { + networkConnection.finishWithError(new Error(Error.Code.NETWORK_NO_CONNECTION, "No network connection, network status " + this.m_status.toString())); + return networkConnection; + } + // MONITORENTER : this + this.m_queue.add(networkConnection); + // MONITOREXIT : this + if (this.m_asyncTaskManager != null && !this.m_asyncTaskManager.isShutdown()) { + this.m_asyncTaskManager.execute(networkConnection); + return networkConnection; + } + if (this.m_asyncTaskManager != null) { + Log.Helper.LOGW(this, "AsyncTaskManager shutdown. Queueing networkconnection until AsyncTaskManager is started."); + } else { + Log.Helper.LOGW(this, "AsyncTaskManager is not ready. Queueing networkconnection until AsyncTaskManager is started."); + } + if (this.m_waitingToExecuteQueue == null) { + this.m_waitingToExecuteQueue = new LinkedList(); + } + this.m_waitingToExecuteQueue.add(networkConnection); + return networkConnection; + } + + @Override + public void setup() { + Log.Helper.LOGV(this, "setup"); + this.startWork(); + } + + /* + * Enabled unnecessary exception pruning + */ + @Override + public void suspend() { + synchronized (this) { + this.stopPing(); + this.unregisterNetworkListener(); + synchronized (this) { + Iterator iterator = new ArrayList(this.m_queue).iterator(); + while (true) { + if (!iterator.hasNext()) { + // MONITOREXIT @DISABLED, blocks:[4, 6, 7] lbl8 : MonitorExitStatement: MONITOREXIT : this + // MONITOREXIT @DISABLED, blocks:[4, 5, 6, 7] lbl9 : MonitorExitStatement: MONITOREXIT : this + Log.Helper.LOGV(this, "suspend"); + return; + } + ((NetworkConnection)iterator.next()).cancelForAppSuspend(); + } + } + } + } + + private class ConnectivityReceiver + extends BroadcastReceiver { + private ConnectivityReceiver() { + } + + public void onReceive(Context object, Intent intent) { + Log.Helper.LOGD((Object)this, "Network reachability changed!"); + + synchronized (new Object()) { + NetworkImpl.this.detect(true); + } + } + } + + private static enum DetectionState { + NONE, + VERIFY_REACHABLE_MAIN, + VERIFY_UNREACHABLE_MAIN, + VERIFY_REACHABLE_BACKUP, + PING; + + } + + private class TimerTask + implements Runnable { + private TimerTask() { + } + + @Override + public void run() { + NetworkImpl networkImpl = NetworkImpl.this; + synchronized (networkImpl) { + NetworkImpl.access$302(NetworkImpl.this, null); + NetworkImpl.this.verifyReachability(NetworkImpl.MAIN_NETWORK_REACHABILITY_CHECK_URL, 30.0); + return; + } + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/NimbleConfiguration.java b/app/src/main/java/com/ea/nimble/NimbleConfiguration.java new file mode 100644 index 0000000..dadf0f5 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/NimbleConfiguration.java @@ -0,0 +1,47 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +public enum NimbleConfiguration { + UNKNOWN, + INTEGRATION, + STAGE, + LIVE, + CUSTOMIZED; + + + public static NimbleConfiguration fromName(String string2) { + if (string2.equals("int")) { + return INTEGRATION; + } + if (string2.equals("stage")) { + return STAGE; + } + if (string2.equals("live")) { + return LIVE; + } + if (!string2.equals("custom")) return UNKNOWN; + return CUSTOMIZED; + } + + public String toString() { + switch (this.ordinal()) { + default: { + return "unknown"; + } + case 1: { + return "int"; + } + case 2: { + return "stage"; + } + case 3: { + return "live"; + } + case 4: + } + return "custom"; + } +} + diff --git a/app/src/main/java/com/ea/nimble/NimbleFacebookError.java b/app/src/main/java/com/ea/nimble/NimbleFacebookError.java new file mode 100644 index 0000000..e3bd84e --- /dev/null +++ b/app/src/main/java/com/ea/nimble/NimbleFacebookError.java @@ -0,0 +1,45 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Error; + +public class NimbleFacebookError +extends Error { + public static final String NIMBLE_FACEBOOK_ERROR_DOMAIN = "NimbleFacebookError"; + private static final long serialVersionUID = 1L; + + public NimbleFacebookError(int n2, String string2) { + super(NIMBLE_FACEBOOK_ERROR_DOMAIN, n2, string2, null); + } + + public NimbleFacebookError(int n2, String string2, Throwable throwable) { + super(NIMBLE_FACEBOOK_ERROR_DOMAIN, n2, string2, throwable); + } + + public NimbleFacebookError(Code code, String string2) { + super(NIMBLE_FACEBOOK_ERROR_DOMAIN, code.intValue(), string2, null); + } + + public boolean isError(int n2) { + if (this.getCode() != n2) return false; + return true; + } + + public static enum Code { + FBSERVER_ERROR(90000), + RESPONSE_PARSE_ERROR(90001); + + private int m_value; + + private Code(int n3) { + this.m_value = n3; + } + + public int intValue() { + return this.m_value; + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatch.java b/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatch.java new file mode 100644 index 0000000..5aad8f3 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatch.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Base; +import com.ea.nimble.IOperationalTelemetryDispatch; + +public class OperationalTelemetryDispatch { + public static final String COMPONENT_ID = "com.ea.nimble.operationaltelemetrydispatch"; + public static final String LOG_TAG = "OTDispatch"; + + public static IOperationalTelemetryDispatch getComponent() { + return (IOperationalTelemetryDispatch)((Object)Base.getComponent(COMPONENT_ID)); + } +} + diff --git a/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatchImpl.java b/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatchImpl.java new file mode 100644 index 0000000..a2cd60e --- /dev/null +++ b/app/src/main/java/com/ea/nimble/OperationalTelemetryDispatchImpl.java @@ -0,0 +1,154 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +class OperationalTelemetryDispatchImpl +extends Component +implements IOperationalTelemetryDispatch, +LogSource { + private Map m_maxEventQueueSizeDict; + private List m_networkMetricsArray = new ArrayList(); + private List m_networkPayloadsArray = new ArrayList(); + + public OperationalTelemetryDispatchImpl() { + this.m_maxEventQueueSizeDict = new HashMap(); + this.m_maxEventQueueSizeDict.put("com.ea.nimble.network", 100); + this.m_maxEventQueueSizeDict.put("com.ea.nimble.trackingimpl.synergy", 100); + } + + private boolean canLogEvent(String list) { + return true; + } + + /* + * Enabled unnecessary exception pruning + */ + private void purgeOldestEvent(List list) { + synchronized (this) { + if (list.size() == 0) { + Log.Helper.LOGD(this, "purgeOldestEvent called with empty event array."); + return; + } + OperationalTelemetryEvent operationalTelemetryEvent = null; + Iterator iterator = list.iterator(); + while (true) { + if (!iterator.hasNext()) { + if (operationalTelemetryEvent == null) return; + list.remove(operationalTelemetryEvent); + return; + } + OperationalTelemetryEvent operationalTelemetryEvent2 = iterator.next(); + if (operationalTelemetryEvent != null && !operationalTelemetryEvent2.getLoggedTime().before(operationalTelemetryEvent.getLoggedTime())) continue; + operationalTelemetryEvent = operationalTelemetryEvent2; + } + } + } + + /* + * Enabled unnecessary exception pruning + */ + private void trimEventQueue(String list) { + } + + private void updateEventThresholdListeners() { + HashMap hashMap; + int n2 = this.getMaxEventCount("com.ea.nimble.network"); + if (n2 > 0) { + n2 = (int)((double)n2 * 0.75); + if (this.m_networkMetricsArray.size() >= n2) { + hashMap = new HashMap(); + hashMap.put("eventType", "com.ea.nimble.network"); + Utility.sendBroadcast("nimble.notification.ot.eventthresholdwarning", hashMap); + Log.Helper.LOGV(this, "updateEventThresholdListeners, notifying listeners event queue is approaching threshold."); + } + } + if ((n2 = this.getMaxEventCount("com.ea.nimble.trackingimpl.synergy")) <= 0) return; + n2 = (int)((double)n2 * 0.75); + if (this.m_networkPayloadsArray.size() < n2) return; + hashMap = new HashMap(); + hashMap.put("eventType", "com.ea.nimble.trackingimpl.synergy"); + Utility.sendBroadcast("nimble.notification.ot.eventthresholdwarning", hashMap); + Log.Helper.LOGV(this, "updateEventThresholdListeners, notifying listeners event queue is approaching threshold."); + } + + @Override + protected void cleanup() { + } + + @Override + public String getComponentId() { + return "com.ea.nimble.operationaltelemetrydispatch"; + } + + /* + * Enabled unnecessary exception pruning + */ + @Override + public List getEvents(String string2) { + if (!Utility.validString(string2)) { + Log.Helper.LOGE(this, "getEvents called with null or empty eventType."); + return null; + } + List list = null; + synchronized (this) { + if (string2.equals("com.ea.nimble.network")) { + list = this.m_networkMetricsArray; + this.m_networkMetricsArray = new ArrayList(); + } else if (string2.equals("com.ea.nimble.trackingimpl.synergy")) { + list = this.m_networkPayloadsArray; + this.m_networkPayloadsArray = new ArrayList(); + } + } + if (list != null) return Collections.unmodifiableList(list); + Log.Helper.LOGE(this, "getEvents, unsupported OT eventType, " + string2 + "."); + return Collections.unmodifiableList(list); + } + + @Override + public String getLogSourceTitle() { + return "OTDispatch"; + } + + @Override + public int getMaxEventCount(String object) { + return 0; + } + + /* + * Enabled unnecessary exception pruning + * Converted monitor instructions to comments + */ + @Override + public void logEvent(String string2, Map object) {} + + @Override + protected void restore() { + } + + @Override + protected void resume() { + } + + @Override + public void setMaxEventCount(String string2, int n2) { + if (!Utility.validString(string2)) { + Log.Helper.LOGE(this, "setMaxEventCount called with null or empty eventType."); + return; + } + this.m_maxEventQueueSizeDict.put(string2, n2); + this.trimEventQueue(string2); + } + + @Override + protected void suspend() { + } +} + diff --git a/app/src/main/java/com/ea/nimble/OperationalTelemetryEvent.java b/app/src/main/java/com/ea/nimble/OperationalTelemetryEvent.java new file mode 100644 index 0000000..99d25d7 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/OperationalTelemetryEvent.java @@ -0,0 +1,16 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import java.util.Date; +import java.util.Map; + +public interface OperationalTelemetryEvent { + public Map getEventDictionary(); + + public String getEventType(); + + public Date getLoggedTime(); +} + diff --git a/app/src/main/java/com/ea/nimble/OperationalTelemetryEventImpl.java b/app/src/main/java/com/ea/nimble/OperationalTelemetryEventImpl.java new file mode 100644 index 0000000..c09935e --- /dev/null +++ b/app/src/main/java/com/ea/nimble/OperationalTelemetryEventImpl.java @@ -0,0 +1,41 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.OperationalTelemetryEvent; +import java.util.Date; +import java.util.Map; + +class OperationalTelemetryEventImpl +implements OperationalTelemetryEvent { + private Map m_eventDictionary; + private String m_eventType; + private Date m_loggedTime; + + public OperationalTelemetryEventImpl(String string2, Map map, Date date) { + this.m_eventType = string2; + this.m_eventDictionary = map; + this.m_loggedTime = date; + } + + @Override + public Map getEventDictionary() { + return this.m_eventDictionary; + } + + @Override + public String getEventType() { + return this.m_eventType; + } + + @Override + public Date getLoggedTime() { + return this.m_loggedTime; + } + + public String toString() { + return String.format("OperationalTelemetryEvent(%s)-(%s) > %s", this.getEventType(), this.getLoggedTime(), this.getEventDictionary()); + } +} + diff --git a/app/src/main/java/com/ea/nimble/Persistence.java b/app/src/main/java/com/ea/nimble/Persistence.java new file mode 100644 index 0000000..d0ba7ba --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Persistence.java @@ -0,0 +1,405 @@ +package com.ea.nimble; + +import android.app.backup.BackupManager; +import android.content.Context; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InvalidClassException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +/* loaded from: stdlib.jar:com/ea/nimble/Persistence.class */ +public class Persistence implements LogSource { + private static int PERSISTENCE_VERSION = -1; + static final Object s_dataLock = new Object(); + private boolean m_backUp; + private boolean m_changed; + private Map m_content; + private boolean m_encryption; + private Encryptor m_encryptor; + private String m_identifier; + private Storage m_storage; + private Timer m_synchronizeTimer; + + public static class AnonymousClass2 { + static final int[] $SwitchMap$com$ea$nimble$Persistence$Storage = new int[Storage.values().length]; + static final int[] $SwitchMap$com$ea$nimble$PersistenceService$PersistenceMergePolicy = new int[10]; + + /* loaded from: stdlib.jar:com/ea/nimble/Persistence$Storage.class */ + } + + public enum Storage { + DOCUMENT, + CACHE, + TEMP + } + + public Persistence(Persistence persistence, String str) { + this.m_synchronizeTimer = new Timer(new Runnable() { // from class: com.ea.nimble.Persistence.1 + @Override // java.lang.Runnable + public void run() { + Persistence.this.synchronize(); + } + }); + this.m_content = new HashMap(persistence.m_content); + this.m_identifier = str; + this.m_storage = persistence.m_storage; + this.m_encryptor = persistence.m_encryptor; + this.m_encryption = persistence.m_encryption; + this.m_backUp = persistence.m_backUp; + flagChange(); + } + + public Persistence(String str, Storage storage, Encryptor encryptor) { + this.m_synchronizeTimer = new Timer(new Runnable() { // from class: com.ea.nimble.Persistence.1 + @Override // java.lang.Runnable + public void run() { + Persistence.this.synchronize(); + } + }); + this.m_content = new HashMap(); + this.m_identifier = str; + this.m_storage = storage; + this.m_encryptor = encryptor; + this.m_encryption = false; + this.m_backUp = false; + this.m_changed = false; + } + + private void clearSynchronizeTimer() { + synchronized (s_dataLock) { + this.m_synchronizeTimer.cancel(); + } + } + + private void flagChange() { + this.m_changed = true; + synchronized (s_dataLock) { + clearSynchronizeTimer(); + this.m_synchronizeTimer.schedule(0.5d, false); + } + } + + /* JADX WARN: Removed duplicated region for block: B:10:0x0068 */ + /* + 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 r7) { + return new File(""); + } + + /* JADX WARN: Removed duplicated region for block: B:13:0x008f */ + /* JADX WARN: Removed duplicated region for block: B:16:0x00bb */ + /* + Code decompiled incorrectly, please refer to instructions dump. + To view partially-correct code enable 'Show inconsistent code' option in preferences + */ + public static java.io.File getPersistenceDirectory(com.ea.nimble.Persistence.Storage r7, android.content.Context r8) { + /* + Method dump skipped, instructions count: 241 + To view this dump change 'Code comments level' option to 'DEBUG' + */ + throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.Persistence.getPersistenceDirectory(com.ea.nimble.Persistence$Storage, android.content.Context):java.io.File"); + } + + public static String getPersistencePath(String str, Storage storage) { + File persistenceDirectory = getPersistenceDirectory(storage); + if (persistenceDirectory == null) { + return null; + } + return persistenceDirectory + File.separator + str + ".dat"; + } + + public static String getPersistencePath(String str, Storage storage, Context context) { + File persistenceDirectory = getPersistenceDirectory(storage, context); + if (persistenceDirectory == null) { + return null; + } + return persistenceDirectory + File.separator + str + ".dat"; + } + + private void loadPersistenceData(boolean z, Context context) { + Throwable th; + FileInputStream fileInputStream = null; + String persistencePath = context == null ? getPersistencePath(this.m_identifier, this.m_storage) : getPersistencePath(this.m_identifier, this.m_storage, context); + if (persistencePath != null) { + File file = new File(persistencePath); + if (!file.exists() || file.length() == 0) { + Log.Helper.LOGD(this, "No persistence file for id[%s] to restore from storage %s", this.m_identifier, this.m_storage.toString()); + return; + } + try { + Log.Helper.LOGD(this, "Loading persistence file size %d", file.length()); + fileInputStream = null; + try { + fileInputStream = new FileInputStream(file); + } catch (Exception e) { + e = e; + } + } catch (Throwable th2) { + th = th2; + } + try { + ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream); + if (objectInputStream.readInt() != PERSISTENCE_VERSION) { + throw new InvalidClassException("com.ea.nimble.Persistence", "Persistence version doesn't match"); + } + this.m_encryption = objectInputStream.readBoolean(); + this.m_backUp = objectInputStream.readBoolean(); + if (!z) { + BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream); + ObjectInputStream encryptInputStream = this.m_encryption ? this.m_encryptor.encryptInputStream(bufferedInputStream) : new ObjectInputStream(bufferedInputStream); + this.m_content = (Map) encryptInputStream.readObject(); + Log.Helper.LOGD(this, "Persistence file for id[%s] restored from storage %s", this.m_identifier, this.m_storage.toString()); + encryptInputStream.close(); + } + objectInputStream.close(); + if (fileInputStream != null) { + try { + fileInputStream.close(); + } catch (IOException e2) { + } + } + } catch (Exception e3) { + Log.Helper.LOGE(this, "Can't read persistence (%s) file, %s: %s", this.m_identifier, persistencePath, e3.toString()); + e3.printStackTrace(); + if (fileInputStream != null) { + try { + fileInputStream.close(); + } catch (IOException e4) { + } + } + } catch (Throwable th3) { + if (fileInputStream != null) { + try { + fileInputStream.close(); + } catch (IOException e5) { + } + } + } + } + } + + private void putValue(String str, Serializable serializable) throws IOException { + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + ObjectOutputStream objectOutputStream = new ObjectOutputStream(byteArrayOutputStream); + objectOutputStream.writeObject(serializable); + objectOutputStream.close(); + byte[] byteArray = byteArrayOutputStream.toByteArray(); + if (!byteArray.equals(this.m_content.get(str))) { + this.m_content.put(str, byteArray); + flagChange(); + } + } + + private void savePersistenceData() { + String persistencePath = getPersistencePath(this.m_identifier, this.m_storage); + if (persistencePath != null) { + File file = new File(persistencePath); + + try (FileOutputStream fileOutputStream = new FileOutputStream(file); + ObjectOutputStream objectOutputStream = new ObjectOutputStream( + this.m_encryption ? this.m_encryptor.encryptOutputStream( + new BufferedOutputStream(fileOutputStream)) : + new BufferedOutputStream(fileOutputStream))) { + + objectOutputStream.writeInt(PERSISTENCE_VERSION); + objectOutputStream.writeBoolean(this.m_encryption); + objectOutputStream.writeBoolean(this.m_backUp); + objectOutputStream.writeObject(this.m_content); + + Log.Helper.LOGD(this, "Synchronize persistence for id[%s] in storage %s", this.m_identifier, this.m_storage.toString()); + Log.Helper.LOGD(this, "Saving persistence file size %d", file.length()); + + } catch (Exception e) { + Log.Helper.LOGE(this, "Fail to save persistence file for id[%s] in storage %s: %s", this.m_identifier, this.m_storage.toString(), e.toString()); + } + } + } + + public void addEntries(Object... objArr) { + synchronized (s_dataLock) { + String str = null; + for (int i = 0; i < objArr.length; i++) { + if (i % 2 == 0) { + try { + str = (String) objArr[i]; + if (!Utility.validString(str)) { + throw new RuntimeException("Invalid key"); + } + } catch (Exception e) { + Log.Helper.LOGF(this, "Invalid key in NimblePersistence.addEntries at index %d, not a string", Integer.valueOf(i)); + return; + } + } else { + try { + putValue(str, (Serializable) objArr[i]); + } catch (Exception e2) { + Log.Helper.LOGF(this, "Invalid value in NimblePersistence.addEntries for key %s at index %d", str, Integer.valueOf(i)); + return; + } + } + } + } + } + + public void addEntriesFromMap(Map map) { + synchronized (s_dataLock) { + for (String str : map.keySet()) { + if (!Utility.validString(str)) { + Log.Helper.LOGE(this, "Invalid key %s in NimblePersistence.addEntriesInDictionary, not a string, skip it", str); + } else { + Serializable serializable = map.get(str); + if (serializable != null) { + try { + putValue(str, serializable); + } catch (IOException e) { + } + } + Log.Helper.LOGE(this, "Invalid value in NimblePersistence.addEntries for key %s", str); + } + } + } + } + + public void clean() { + synchronized (s_dataLock) { + File file = new File(getPersistencePath(this.m_identifier, this.m_storage)); + if (file.exists() && !file.delete()) { + Log.Helper.LOGE(this, "Fail to clean persistence file for id[%s] in storage %s", this.m_identifier, this.m_storage.toString()); + } + } + } + + public boolean getBackUp() { + return this.m_backUp; + } + + public boolean getEncryption() { + return this.m_encryption; + } + + public String getIdentifier() { + return this.m_identifier; + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "Persistence"; + } + + public Storage getStorage() { + return this.m_storage; + } + + public String getStringValue(String str) { + Serializable value = getValue(str); + try { + return (String) value; + } catch (ClassCastException e) { + Log.Helper.LOGF(this, "Invalid value type for getStringValueCall, value is " + value.getClass().getName()); + return null; + } + } + + public Serializable getValue(String str) { + synchronized (s_dataLock) { + byte[] bArr = this.m_content.get(str); + if (bArr == null) { + return null; + } + try { + return (Serializable) new ObjectInputStream(new ByteArrayInputStream(bArr)).readObject(); + } catch (Exception e) { + Log.Helper.LOGD(this, "PERSIST: Exception getting value, " + str + ":" + e); + return null; + } + } + } + + public void merge(Persistence persistence, PersistenceService.PersistenceMergePolicy persistenceMergePolicy) { + switch (AnonymousClass2.$SwitchMap$com$ea$nimble$PersistenceService$PersistenceMergePolicy[persistenceMergePolicy.ordinal()]) { + case 1: + this.m_content = new HashMap(persistence.m_content); + return; + case 2: + this.m_content.putAll(persistence.m_content); + return; + case 3: + for (String str : persistence.m_content.keySet()) { + if (this.m_content.get(str) == null) { + this.m_content.put(str, persistence.m_content.get(str)); + } + } + return; + default: + return; + } + } + + public void restore(boolean z, Context context) { + synchronized (s_dataLock) { + loadPersistenceData(z, context); + } + } + + public void setBackUp(boolean z) { + if (this.m_storage != Storage.DOCUMENT) { + Log.Helper.LOGF(this, "Error: Backup flag not supported for storage: " + this.m_storage); + } else { + this.m_backUp = z; + } + } + + public void setEncryption(boolean z) { + if (z != this.m_encryption) { + this.m_encryption = z; + flagChange(); + } + } + + public void setValue(String str, Serializable serializable) { + synchronized (s_dataLock) { + if (!Utility.validString(str)) { + Log.Helper.LOGF(this, "NimblePersistence cannot accept an invalid string " + str + " as key"); + } else if (serializable == null) { + if (this.m_content.get(str) != null) { + this.m_content.remove(str); + flagChange(); + } + } else { + try { + putValue(str, serializable); + } catch (IOException e) { + Log.Helper.LOGF(this, "NimblePersistence cannot archive value " + serializable.toString()); + } + } + } + } + + public void synchronize() { + synchronized (s_dataLock) { + if (!this.m_changed) { + Log.Helper.LOGD(this, "Not synchronizing to persistence for id[%s] since there is no change", this.m_identifier); + return; + } + clearSynchronizeTimer(); + savePersistenceData(); + if (this.m_backUp) { + new BackupManager(ApplicationEnvironment.getComponent().getApplicationContext()).dataChanged(); + } + } + } + +} diff --git a/app/src/main/java/com/ea/nimble/PersistenceService.java b/app/src/main/java/com/ea/nimble/PersistenceService.java new file mode 100644 index 0000000..9ba61de --- /dev/null +++ b/app/src/main/java/com/ea/nimble/PersistenceService.java @@ -0,0 +1,116 @@ +package com.ea.nimble; + +import android.app.backup.BackupAgent; +import android.app.backup.BackupDataInput; +import android.app.backup.BackupDataOutput; +import android.content.Context; +import android.os.ParcelFileDescriptor; + +import com.ea.ironmonkey.devmenu.util.Observer; + +import java.io.FileOutputStream; +import java.io.IOException; + +/* loaded from: stdlib.jar:com/ea/nimble/PersistenceService.class */ +public class PersistenceService { + private static final String APPLICATION_PERSISTENCE_ID = "[APPLICATION]"; + public static final String COMPONENT_ID = "com.ea.nimble.persistence"; + private static final String NIMBLE_COMPONENT_PERSISTENCE_ID_TEMPLATE = "[COMPONENT]%s"; + + /* loaded from: stdlib.jar:com/ea/nimble/PersistenceService$PersistenceBackupAgent.class */ + public static class PersistenceBackupAgent extends BackupAgent { + @Override // android.app.backup.BackupAgent + public void onBackup(ParcelFileDescriptor parcelFileDescriptor, BackupDataOutput backupDataOutput, ParcelFileDescriptor parcelFileDescriptor2) throws IOException { + synchronized (Persistence.s_dataLock) { + PersistenceService.writeBackup(parcelFileDescriptor, backupDataOutput, parcelFileDescriptor2, this); + } + } + + @Override // android.app.backup.BackupAgent + public void onRestore(BackupDataInput backupDataInput, int i, ParcelFileDescriptor parcelFileDescriptor) throws IOException { + synchronized (Persistence.s_dataLock) { + PersistenceService.readBackup(backupDataInput, i, parcelFileDescriptor, this); + } + } + } + + /* loaded from: stdlib.jar:com/ea/nimble/PersistenceService$PersistenceMergePolicy.class */ + public enum PersistenceMergePolicy { + OVERWRITE, + SOURCE_FIRST, + TARGET_FIRST + } + + public static void cleanReferenceToPersistence(String str, Persistence.Storage storage) { + if (!Utility.validString(str)) { + Log.Helper.LOGF("Persistence", "Invalid componentId " + str + " for component persistence", new Object[0]); + } else { + getComponent().cleanPersistenceReference(String.format(NIMBLE_COMPONENT_PERSISTENCE_ID_TEMPLATE, str), storage); + } + } + + public static Persistence getAppPersistence(Persistence.Storage storage) { + return getComponent().getPersistence(APPLICATION_PERSISTENCE_ID, storage); + } + + public static IPersistenceService getComponent() { + return BaseCore.getInstance().getPersistenceService(); + } + + public static Persistence getPersistenceForNimbleComponent(String str, Persistence.Storage storage) { + if (Utility.validString(str)) { + return getComponent().getPersistence(String.format(NIMBLE_COMPONENT_PERSISTENCE_ID_TEMPLATE, str), storage); + } + Log.Helper.LOGF("Persistence", "Invalid componentId " + str + " for component persistence", new Object[0]); + return null; + } + + static void readBackup(BackupDataInput backupDataInput, int i, ParcelFileDescriptor parcelFileDescriptor, Context context) throws IOException { + Throwable th; + while (backupDataInput.readNextHeader()) { + String key = backupDataInput.getKey(); + int dataSize = backupDataInput.getDataSize(); + byte[] bArr = new byte[dataSize]; + backupDataInput.readEntityData(bArr, 0, dataSize); + FileOutputStream fileOutputStream = null; + try { + FileOutputStream fileOutputStream2 = new FileOutputStream(Persistence.getPersistencePath(key, Persistence.Storage.DOCUMENT, context)); + try { + fileOutputStream2.write(bArr); + if (fileOutputStream2 != null) { + fileOutputStream2.close(); + } + } catch (Throwable th2) { + th = th2; + fileOutputStream = fileOutputStream2; + if (fileOutputStream != null) { + fileOutputStream.close(); + } + throw th; + } + } catch (Throwable th3) { + th = th3; + } + } + if (ApplicationEnvironment.isMainApplicationRunning()) { + for (Persistence persistence : ((PersistenceServiceImpl) getComponent()).m_persistences.values()) { + if (persistence.getBackUp()) { + persistence.restore(false, null); + } + } + } + } + + public static void removePersistenceForNimbleComponent(String str, Persistence.Storage storage) { + if (!Utility.validString(str)) { + Log.Helper.LOGF("Persistence", "Invalid componentId " + str + " for component persistence", new Object[0]); + } else { + getComponent().removePersistence(String.format(NIMBLE_COMPONENT_PERSISTENCE_ID_TEMPLATE, str), storage); + } + } + + + static void writeBackup(android.os.ParcelFileDescriptor r6, android.app.backup.BackupDataOutput r7, android.os.ParcelFileDescriptor r8, android.content.Context r9) throws java.io.IOException { + Observer.onCallingMethod(); + } +} diff --git a/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java b/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java new file mode 100644 index 0000000..f2c3f86 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/PersistenceServiceImpl.java @@ -0,0 +1,149 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import java.io.File; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +public class PersistenceServiceImpl +extends Component +implements IPersistenceService, +LogSource { + private Encryptor m_encryptor; + protected ConcurrentMap m_persistences; + + /* + * Enabled unnecessary exception pruning + */ + private Persistence loadPersistenceById(String object, Persistence.Storage storage) { + Object object2 = Persistence.s_dataLock; + synchronized (object2) { + String string2 = (String)object + "-" + storage.toString(); + Persistence persistence = (Persistence)this.m_persistences.get(string2); + if (persistence != null) { + return persistence; + } + if (!new File(Persistence.getPersistencePath(object, storage)).exists()) { + return null; + } + Persistence persistence1 = new Persistence(object, storage, this.m_encryptor); + persistence1.restore(false, null); + this.m_persistences.put(string2, persistence1); + return persistence1; + } + } + + private void synchronize() { + for (Persistence persistence : this.m_persistences.values()) { + persistence.synchronize(); + } + } + + @Override + public void cleanPersistenceReference(String string2, Persistence.Storage storage) { + if (!Utility.validString(string2)) { + Log.Helper.LOGF(this, "Invalid identifier " + string2 + " for persistence"); + return; + } + Object object = Persistence.s_dataLock; + synchronized (object) { + this.m_persistences.remove(string2 + "-" + storage.toString()); + return; + } + } + + @Override + public String getComponentId() { + return "com.ea.nimble.persistence"; + } + + @Override + public String getLogSourceTitle() { + return "Persistence"; + } + + /* + * Enabled unnecessary exception pruning + */ + @Override + public Persistence getPersistence(String string2, Persistence.Storage storage) { + if (!Utility.validString(string2)) { + Log.Helper.LOGF(this, "Invalid identifier " + string2 + " for persistence"); + return null; + } + Object object = Persistence.s_dataLock; + synchronized (object) { + Persistence persistence = this.loadPersistenceById(string2, storage); + if (persistence != null) { + return persistence; + } + persistence = new Persistence(string2, storage, this.m_encryptor); + this.m_persistences.put(string2 + "-" + storage.toString(), persistence); + return persistence; + } + } + + /* + * Enabled unnecessary exception pruning + */ + @Override + public void migratePersistence(String object, Persistence.Storage object2, String string2, PersistenceService.PersistenceMergePolicy persistenceMergePolicy) { + if (!Utility.validString((String)object) || !Utility.validString(string2)) { + Log.Helper.LOGF(this, "Invalid identifiers " + (String)object + " or " + string2 + " for component persistence"); + return; + } + Persistence.Storage object3 = (Persistence.Storage) Persistence.s_dataLock; + synchronized (object3) { + String string3 = string2 + "-" + ((Enum)object2).toString(); + Persistence persistence = this.loadPersistenceById(object, object2); + if (persistence == null) { + if (persistenceMergePolicy != PersistenceService.PersistenceMergePolicy.OVERWRITE) return; + this.m_persistences.remove(string3); + new File(Persistence.getPersistencePath(string2, object2)).delete(); + return; + } + Persistence persistence2 = this.loadPersistenceById(string2, object2); + if (persistence2 == null) { + Persistence persistence1 = new Persistence(persistence, string2); + this.m_persistences.put(string3, persistence); + persistence1.synchronize(); + } else { + persistence2.merge(persistence, persistenceMergePolicy); + } + } + } + + @Override + public void removePersistence(String string2, Persistence.Storage storage) { + if (!Utility.validString(string2)) { + Log.Helper.LOGF(this, "Invalid identifier " + string2 + " for persistence"); + return; + } + this.cleanPersistenceReference(string2, storage); + } + + @Override + public void setup() { + this.m_persistences = new ConcurrentHashMap<>(); + this.m_encryptor = new Encryptor(); + } + + @Override + public void suspend() { + this.synchronize(); + } + + @Override + public void teardown() { + this.synchronize(); + Object object = Persistence.s_dataLock; + synchronized (object) { + this.m_persistences = null; + this.m_encryptor = null; + return; + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/QA.java b/app/src/main/java/com/ea/nimble/QA.java new file mode 100644 index 0000000..ee7b7c0 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/QA.java @@ -0,0 +1,13 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Persistence; + +public class QA { + static String getPersistencePath(String string2, Persistence.Storage storage) { + return Persistence.getPersistencePath(string2, storage); + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyEnvironment.java b/app/src/main/java/com/ea/nimble/SynergyEnvironment.java new file mode 100644 index 0000000..36e158f --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyEnvironment.java @@ -0,0 +1,42 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Base; +import com.ea.nimble.ISynergyEnvironment; + +public class SynergyEnvironment { + public static final String COMPONENT_ID = "com.ea.nimble.synergyEnvironment"; + public static final int INVALID_INT_VALUE = -1; + public static final String NOTIFICATION_APP_VERSION_CHECK_FINISHED = "nimble.environment.notification.app_version_check_finished"; + public static final String NOTIFICATION_RESTORED_FROM_PERSISTENT = "nimble.environment.notification.restored_from_persistent"; + public static final String NOTIFICATION_STARTUP_ENVIRONMENT_DATA_CHANGED = "nimble.environment.notification.startup_environment_data_changed"; + public static final String NOTIFICATION_STARTUP_REQUESTS_FINISHED = "nimble.environment.notification.startup_requests_finished"; + public static final String NOTIFICATION_STARTUP_REQUESTS_STARTED = "nimble.environment.notification.startup_requests_started"; + public static final String SERVER_URL_KEY_AKAMAI = "akamai.url"; + public static final String SERVER_URL_KEY_DYNAMIC_MORE_GAMES = "dmg.url"; + public static final String SERVER_URL_KEY_EADP_FRIENDS_HOST = "eadp.friends.host"; + public static final String SERVER_URL_KEY_ENS = "ens.url"; + public static final String SERVER_URL_KEY_IDENTITY_CONNECT = "nexus.connect"; + public static final String SERVER_URL_KEY_IDENTITY_PORTAL = "nexus.portal"; + public static final String SERVER_URL_KEY_IDENTITY_PROXY = "nexus.proxy"; + public static final String SERVER_URL_KEY_MAYHEM = "mayhem.url"; + public static final String SERVER_URL_KEY_ORIGIN_AVATAR = "avatars.url"; + public static final String SERVER_URL_KEY_ORIGIN_CASUAL_APP = "origincasualapp.url"; + public static final String SERVER_URL_KEY_ORIGIN_CASUAL_SERVER = "origincasualserver.url"; + public static final String SERVER_URL_KEY_ORIGIN_FRIENDS = "friends.url"; + public static final String SERVER_URL_KEY_SYNERGY_CENTRAL_IP_GEOLOCATION = "geoip.url"; + public static final String SERVER_URL_KEY_SYNERGY_DIRECTOR = "synergy.director"; + public static final String SERVER_URL_KEY_SYNERGY_DRM = "synergy.drm"; + public static final String SERVER_URL_KEY_SYNERGY_MESSAGE_TO_USER = "synergy.m2u"; + public static final String SERVER_URL_KEY_SYNERGY_PRODUCT = "synergy.product"; + public static final String SERVER_URL_KEY_SYNERGY_S2S = "synergy.s2s"; + public static final String SERVER_URL_KEY_SYNERGY_TRACKING = "synergy.tracking"; + public static final String SERVER_URL_KEY_SYNERGY_USER = "synergy.user"; + + public static ISynergyEnvironment getComponent() { + return (ISynergyEnvironment)((Object)Base.getComponent(COMPONENT_ID)); + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyEnvironmentImpl.java b/app/src/main/java/com/ea/nimble/SynergyEnvironmentImpl.java new file mode 100644 index 0000000..e2968c8 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyEnvironmentImpl.java @@ -0,0 +1,400 @@ +package com.ea.nimble; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.preference.PreferenceManager; + +import java.io.Serializable; +import java.util.HashMap; + +/* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentImpl.class */ +public class SynergyEnvironmentImpl extends Component implements ISynergyEnvironment, LogSource { + private static final String PERSISTENCE_DATA_ID = "environmentData"; + public static final int SYNERGY_APP_VERSION_OK = 0; + public static final int SYNERGY_APP_VERSION_UPDATE_RECOMMENDED = 1; + public static final int SYNERGY_APP_VERSION_UPDATE_REQUIRED = 2; + private static final String SYNERGY_INT_SERVER_URL = "https://director-int.sn.eamobile.com"; + private static final String SYNERGY_LIVE_SERVER_URL = "https://syn-dir.sn.eamobile.com"; + private static final String SYNERGY_STAGE_SERVER_URL = "https://director-stage.sn.eamobile.com"; + public static final double SYNERGY_UPDATE_RATE_LIMIT_PERIOD_IN_SECONDS = 60.0d; + public static final double SYNERGY_UPDATE_REFRESH_PERIOD_IN_SECONDS = 300.0d; + private BaseCore m_core; + private EnvironmentDataContainer m_environmentDataContainer; + private EnvironmentDataContainer m_previousValidEnvironmentDataContainer; + private Long m_synergyEnvironmentUpdateRateLimitTriggerTimestamp; + private SynergyEnvironmentUpdater m_synergyStartupObject; + private BroadcastReceiver m_networkStatusChangeReceiver = null; + private boolean m_dataLoadedOnComponentSetup = false; + + /* renamed from: com.ea.nimble.SynergyEnvironmentImpl$3 reason: invalid class name */ + /* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentImpl$3.class */ + static /* synthetic */ class AnonymousClass3 { + static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$NimbleConfiguration = new int[NimbleConfiguration.values().length]; + + static { + try { + $SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.INTEGRATION.ordinal()] = 1; + } catch (NoSuchFieldError e) { + } + try { + $SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.STAGE.ordinal()] = 2; + } catch (NoSuchFieldError e2) { + } + try { + $SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.LIVE.ordinal()] = 3; + } catch (NoSuchFieldError e3) { + } + try { + $SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.CUSTOMIZED.ordinal()] = 4; + } catch (NoSuchFieldError e4) { + } + } + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public SynergyEnvironmentImpl(BaseCore baseCore) { + this.m_core = baseCore; + } + + private void clearSynergyEnvironmentUpdateRateLimiting() { + this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp = null; + } + + private boolean isInSynergyEnvironmentUpdateRateLimitingPeriod() { + return this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp != null && ((double) (System.currentTimeMillis() - this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp.longValue())) <= 60000.0d; + } + + private boolean restoreEnvironmentDataFromPersistent(boolean z) { + boolean z2 = true; + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(SynergyEnvironment.COMPONENT_ID, Persistence.Storage.CACHE); + if (persistenceForNimbleComponent != null) { + Serializable value = persistenceForNimbleComponent.getValue(PERSISTENCE_DATA_ID); + if (value == null) { + Log.Helper.LOGD(this, "Environment persistence data value not found in persistence object. Probably first install.", new Object[0]); + } else { + try { + this.m_environmentDataContainer = (EnvironmentDataContainer) value; + Log.Helper.LOGD(this, "Restored environment data from persistent. Restored data timestamp, %s", this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp()); + if (this.m_environmentDataContainer.getEADeviceId() == null) { + this.m_environmentDataContainer.setEADeviceId(EASPDataLoader.loadEADeviceId()); + } + if (!z) { + Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_RESTORED_FROM_PERSISTENT, null); + return true; + } + } catch (ClassCastException e) { + Log.Helper.LOGE(this, "Environment persistence data value is not the expected type.", new Object[0]); + } + return z2; + } + } else { + Log.Helper.LOGE(this, "Could not get environment persistence object to restore from", new Object[0]); + } + this.m_environmentDataContainer = null; + z2 = false; + return z2; + } + + /* JADX INFO: Access modifiers changed from: private */ + public void saveEnvironmentDataToPersistent() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(SynergyEnvironment.COMPONENT_ID, Persistence.Storage.CACHE); + if (persistenceForNimbleComponent != null) { + Log.Helper.LOGD(this, "Saving environment data to persistent.", new Object[0]); + persistenceForNimbleComponent.setValue(PERSISTENCE_DATA_ID, this.m_environmentDataContainer); + persistenceForNimbleComponent.synchronize(); + return; + } + Log.Helper.LOGE(this, "Could not get environment persistence object to save to.", new Object[0]); + } + + /* JADX INFO: Access modifiers changed from: private */ + public void startSynergyEnvironmentUpdate() { + if (isUpdateInProgress()) { + Log.Helper.LOGD(this, "Attempt made to start Synergy environment update while a previous one is active. Exiting.", new Object[0]); + } else if (Network.getComponent().getStatus() == Network.Status.OK) { + this.m_synergyStartupObject = new SynergyEnvironmentUpdater(this.m_core); + this.m_previousValidEnvironmentDataContainer = this.m_environmentDataContainer; + HashMap hashMap = new HashMap(); + hashMap.put(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, Global.NOTIFICATION_DICTIONARY_RESULT_SUCCESS); + Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_STARTUP_REQUESTS_STARTED, hashMap); + this.m_synergyStartupObject.startSynergyStartupSequence(this.m_previousValidEnvironmentDataContainer, new SynergyEnvironmentUpdater.CompletionCallback() { // from class: com.ea.nimble.SynergyEnvironmentImpl.2 + @Override // com.ea.nimble.SynergyEnvironmentUpdater.CompletionCallback + public void callback(Exception exc) { + if (exc != null) { + Log.Helper.LOGE(this, "StartupError(%s)", exc); + if (exc instanceof Error) { + Error error = (Error) exc; + if (error.isError(Error.Code.SYNERGY_GET_DIRECTION_TIMEOUT) || error.isError(Error.Code.SYNERGY_SERVER_FULL)) { + Log.Helper.LOGD(this, "GetDirection request timed out or ServerUnavailable signal received. Start rate limiting of /getDirection call.", new Object[0]); + SynergyEnvironmentImpl.this.startSynergyEnvironmentUpdateRateLimiting(); + } + } else if (SynergyEnvironmentImpl.this.m_synergyStartupObject == null || SynergyEnvironmentImpl.this.m_synergyStartupObject.getEnvironmentDataContainer() == null) { + Log.Helper.LOGD(this, "Synergy Environment Update object or dataContainer null at callback. More than one update was being peroformed", new Object[0]); + } + HashMap hashMap2 = new HashMap(); + hashMap2.put(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, Global.NOTIFICATION_DICTIONARY_RESULT_FAIL); + hashMap2.put("error", exc.toString()); + if (!ApplicationEnvironment.isMainApplicationRunning() || ApplicationEnvironment.getCurrentActivity() == null) { + Log.Helper.LOGI(this, "App is not running in forground, discard the NOTIFICATION_STARTUP_REQUESTS_FINISHED notification", new Object[0]); + } else { + Log.Helper.LOGD(this, "App is running in forground, send the NOTIFICATION_STARTUP_REQUESTS_FINISHED notification", new Object[0]); + Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_STARTUP_REQUESTS_FINISHED, hashMap2); + } + } else if (SynergyEnvironmentImpl.this.m_synergyStartupObject == null || SynergyEnvironmentImpl.this.m_synergyStartupObject.getEnvironmentDataContainer() == null) { + Log.Helper.LOGD(this, "Synergy Environment Update object or dataContainer null at callback. More than one update was being peroformed", new Object[0]); + } else { + SynergyEnvironmentImpl.this.m_environmentDataContainer = SynergyEnvironmentImpl.this.m_synergyStartupObject.getEnvironmentDataContainer(); + SynergyEnvironmentImpl.this.saveEnvironmentDataToPersistent(); + if (SynergyEnvironmentImpl.this.m_environmentDataContainer.getKeysOfDifferences(SynergyEnvironmentImpl.this.m_previousValidEnvironmentDataContainer) != null) { + Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_STARTUP_ENVIRONMENT_DATA_CHANGED, null); + } + HashMap hashMap3 = new HashMap(); + hashMap3.put(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, Global.NOTIFICATION_DICTIONARY_RESULT_SUCCESS); + if (!ApplicationEnvironment.isMainApplicationRunning() || ApplicationEnvironment.getCurrentActivity() == null) { + Log.Helper.LOGI(this, "App is not running in forground, discard the NOTIFICATION_STARTUP_REQUESTS_FINISHED notification", new Object[0]); + } else { + Log.Helper.LOGD(this, "App is running in forground, send the NOTIFICATION_STARTUP_REQUESTS_FINISHED notification", new Object[0]); + Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_STARTUP_REQUESTS_FINISHED, hashMap3); + } + } + SynergyEnvironmentImpl.this.m_synergyStartupObject = null; + } + }); + } else if (this.m_networkStatusChangeReceiver == null) { + this.m_networkStatusChangeReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.SynergyEnvironmentImpl.1 + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + if (intent.getAction().equals(Global.NOTIFICATION_NETWORK_STATUS_CHANGE) && Network.getComponent().getStatus() == Network.Status.OK) { + Log.Helper.LOGD(this, "Network restored. Starting Synergy environment update.", new Object[0]); + Utility.unregisterReceiver(SynergyEnvironmentImpl.this.m_networkStatusChangeReceiver); + SynergyEnvironmentImpl.this.m_networkStatusChangeReceiver = null; + SynergyEnvironmentImpl.this.startSynergyEnvironmentUpdate(); + } + } + }; + Log.Helper.LOGD(this, "Network not available to perform environment update. Setting receiver to listen for network status change.", new Object[0]); + Utility.registerReceiver(Global.NOTIFICATION_NETWORK_STATUS_CHANGE, this.m_networkStatusChangeReceiver); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void startSynergyEnvironmentUpdateRateLimiting() { + this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp = Long.valueOf(System.currentTimeMillis()); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public Error checkAndInitiateSynergyEnvironmentUpdate() { + if (isUpdateInProgress()) { + return new Error(Error.Code.SYNERGY_ENVIRONMENT_UPDATE_FAILURE, "Update in progress."); + } + if (this.m_environmentDataContainer != null && this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp() != null) { + return new Error(Error.Code.SYNERGY_ENVIRONMENT_UPDATE_FAILURE, "Environment data already cached."); + } + if (isInSynergyEnvironmentUpdateRateLimitingPeriod()) { + Log.Helper.LOGD(this, "Attempt to re-initiate Synergy environment update blocked by rate limiting. %.2f seconds of rate limiting left", Double.valueOf(60.0d - (((double) (System.currentTimeMillis() - this.m_synergyEnvironmentUpdateRateLimitTriggerTimestamp.longValue())) / 1000.0d))); + return new Error(Error.Code.SYNERGY_ENVIRONMENT_UPDATE_FAILURE, "Synergy environment update rate limit in effect."); + } + startSynergyEnvironmentUpdate(); + return null; + } + + @Override // com.ea.nimble.Component + public void cleanup() { + Log.Helper.LOGD(this, "cleanup", new Object[0]); + if (this.m_synergyStartupObject != null) { + this.m_synergyStartupObject.cancel(); + this.m_synergyStartupObject = null; + } + if (this.m_networkStatusChangeReceiver != null) { + Utility.unregisterReceiver(this.m_networkStatusChangeReceiver); + this.m_networkStatusChangeReceiver = null; + } + saveEnvironmentDataToPersistent(); + this.m_environmentDataContainer = null; + } + + @Override // com.ea.nimble.Component + public String getComponentId() { + return SynergyEnvironment.COMPONENT_ID; + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getEADeviceId() { + checkAndInitiateSynergyEnvironmentUpdate(); + if (this.m_environmentDataContainer == null) { + return null; + } + return this.m_environmentDataContainer.getEADeviceId(); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getEAHardwareId() { + checkAndInitiateSynergyEnvironmentUpdate(); + if (this.m_environmentDataContainer == null) { + return null; + } + return this.m_environmentDataContainer.getEAHardwareId(); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getGosMdmAppKey() { + checkAndInitiateSynergyEnvironmentUpdate(); + if (this.m_environmentDataContainer == null) { + return null; + } + return this.m_environmentDataContainer.getGosMdmAppKey(); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public int getLatestAppVersionCheckResult() { + if (this.m_environmentDataContainer == null) { + return 0; + } + return this.m_environmentDataContainer.getLatestAppVersionCheckResult(); + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "SynergyEnv"; + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getNexusClientId() { + checkAndInitiateSynergyEnvironmentUpdate(); + if (this.m_environmentDataContainer == null) { + return null; + } + return this.m_environmentDataContainer.getNexusClientId(); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getNexusClientSecret() { + checkAndInitiateSynergyEnvironmentUpdate(); + if (this.m_environmentDataContainer == null) { + return null; + } + return this.m_environmentDataContainer.getNexusClientSecret(); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getProductId() { + checkAndInitiateSynergyEnvironmentUpdate(); + if (this.m_environmentDataContainer == null) { + return null; + } + return this.m_environmentDataContainer.getProductId(); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getSellId() { + checkAndInitiateSynergyEnvironmentUpdate(); + if (this.m_environmentDataContainer == null) { + return null; + } + return this.m_environmentDataContainer.getSellId(); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getServerUrlWithKey(String str) { + checkAndInitiateSynergyEnvironmentUpdate(); + if (this.m_environmentDataContainer == null) { + return null; + } + return this.m_environmentDataContainer.getServerUrlWithKey(str); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getSynergyDirectorServerUrl(NimbleConfiguration nimbleConfiguration) { + switch (AnonymousClass3.$SwitchMap$com$ea$nimble$NimbleConfiguration[nimbleConfiguration.ordinal()]) { + case 1: + return SYNERGY_INT_SERVER_URL; + case 2: + return SYNERGY_STAGE_SERVER_URL; + case 3: + return SYNERGY_LIVE_SERVER_URL; + case 4: + return PreferenceManager.getDefaultSharedPreferences(ApplicationEnvironment.getComponent().getApplicationContext()).getString("NimbleCustomizedSynergyServerEndpointUrl", SYNERGY_LIVE_SERVER_URL); + default: + Log.Helper.LOGF(this, "Request for Synergy Director server URL with unknown NimbleConfiguration, %d.", nimbleConfiguration); + return SYNERGY_LIVE_SERVER_URL; + } + } + + @Override // com.ea.nimble.ISynergyEnvironment + public String getSynergyId() { + checkAndInitiateSynergyEnvironmentUpdate(); + if (this.m_environmentDataContainer == null) { + return null; + } + return this.m_environmentDataContainer.getSynergyId(); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public int getTrackingPostInterval() { + if (this.m_environmentDataContainer == null) { + return -1; + } + return this.m_environmentDataContainer.getTrackingPostInterval(); + } + + @Override // com.ea.nimble.ISynergyEnvironment + public boolean isDataAvailable() { + return this.m_environmentDataContainer != null; + } + + @Override // com.ea.nimble.ISynergyEnvironment + public boolean isUpdateInProgress() { + return this.m_synergyStartupObject != null; + } + + @Override // com.ea.nimble.Component + public void restore() { + Log.Helper.LOGD(this, "restore", new Object[0]); + if (this.m_dataLoadedOnComponentSetup) { + this.m_dataLoadedOnComponentSetup = false; + Utility.sendBroadcast(SynergyEnvironment.NOTIFICATION_RESTORED_FROM_PERSISTENT, null); + } else { + restoreEnvironmentDataFromPersistent(false); + } + if (this.m_environmentDataContainer == null || this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp() == null || ((double) (System.currentTimeMillis() - this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp().longValue())) / 1000.0d > 300.0d) { + startSynergyEnvironmentUpdate(); + } else { + checkAndInitiateSynergyEnvironmentUpdate(); + } + } + + @Override // com.ea.nimble.Component + public void resume() { + Log.Helper.LOGD(this, "resume", new Object[0]); + clearSynergyEnvironmentUpdateRateLimiting(); + if (this.m_environmentDataContainer == null || this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp() == null || ((double) (System.currentTimeMillis() - this.m_environmentDataContainer.getMostRecentDirectorResponseTimestamp().longValue())) / 1000.0d > 300.0d) { + startSynergyEnvironmentUpdate(); + } + } + + @Override // com.ea.nimble.Component + public void setup() { + Log.Helper.LOGD(this, "setup", new Object[0]); + this.m_dataLoadedOnComponentSetup = restoreEnvironmentDataFromPersistent(true); + } + + @Override // com.ea.nimble.Component + public void suspend() { + Log.Helper.LOGD(this, "suspend", new Object[0]); + if (this.m_synergyStartupObject != null) { + this.m_synergyStartupObject.cancel(); + this.m_synergyStartupObject = null; + } + if (this.m_networkStatusChangeReceiver != null) { + Utility.unregisterReceiver(this.m_networkStatusChangeReceiver); + this.m_networkStatusChangeReceiver = null; + } + saveEnvironmentDataToPersistent(); + } + + @Override // com.ea.nimble.Component + public void teardown() { + this.m_environmentDataContainer = null; + } +} diff --git a/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java b/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java new file mode 100644 index 0000000..8176532 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyEnvironmentUpdater.java @@ -0,0 +1,403 @@ +package com.ea.nimble; + +import android.content.Context; +import android.content.pm.PackageManager; +import android.preference.PreferenceManager; +import android.provider.Settings; +import android.telephony.TelephonyManager; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/* JADX INFO: Access modifiers changed from: package-private */ +/* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentUpdater.class */ +public class SynergyEnvironmentUpdater implements LogSource { + private static final int GET_ANONUID_MAX_RETRY_ATTEMPTS = 3; + private static final int GET_DIRECTION_MAX_RETRY_ATTEMPTS = 3; + private static final int GET_EADEVICEID_MAX_RETRY_ATTEMPTS = 3; + private static final int SYNERGY_DIRECTOR_RESPONSE_ERROR_CODE_SERVERS_FULL = -70002; + private static final int SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_CLEAR_CLIENT_CACHED_EADEVICEID = -20094; + private static final int SYNERGY_USER_VALIDATE_EADEVICEID_RESPONSE_ERROR_CODE_VALIDATION_FAILED = -20093; + private static final int VALIDATE_EADEVICEID_MAX_RETRY_ATTEMPTS = 3; + private BaseCore m_core; + private long m_getAnonUIDRetryCount; + private long m_getDirectionRetryCount; + private EnvironmentDataContainer m_environmentForSynergyStartUp = new EnvironmentDataContainer(); + private CompletionCallback m_completionCallback = null; + private EnvironmentDataContainer m_previousValidEnvironmentData = null; + private SynergyNetworkConnectionHandle m_synergyNetworkConnectionHandle = null; + private long m_validateEADeviceIDRetryCount = 0; + private long m_getEADeviceIDRetryCount = 0; + + /* JADX INFO: Access modifiers changed from: package-private */ + /* renamed from: com.ea.nimble.SynergyEnvironmentUpdater$5 reason: invalid class name */ + /* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentUpdater$5.class */ + public static /* synthetic */ class AnonymousClass5 { + static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$NimbleConfiguration = new int[NimbleConfiguration.values().length]; + + static { + try { + $SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.INTEGRATION.ordinal()] = 1; + } catch (NoSuchFieldError e) { + } + try { + $SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.STAGE.ordinal()] = 2; + } catch (NoSuchFieldError e2) { + } + try { + $SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.LIVE.ordinal()] = 3; + } catch (NoSuchFieldError e3) { + } + try { + $SwitchMap$com$ea$nimble$NimbleConfiguration[NimbleConfiguration.CUSTOMIZED.ordinal()] = 4; + } catch (NoSuchFieldError e4) { + } + } + } + + /* JADX INFO: Access modifiers changed from: package-private */ + /* loaded from: stdlib.jar:com/ea/nimble/SynergyEnvironmentUpdater$CompletionCallback.class */ + public interface CompletionCallback { + void callback(Exception exc); + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public SynergyEnvironmentUpdater(BaseCore baseCore) { + this.m_core = baseCore; + } + + static /* synthetic */ long access$1008(SynergyEnvironmentUpdater synergyEnvironmentUpdater) { + long j = synergyEnvironmentUpdater.m_getEADeviceIDRetryCount; + synergyEnvironmentUpdater.m_getEADeviceIDRetryCount = 1 + j; + return j; + } + + static /* synthetic */ long access$1108(SynergyEnvironmentUpdater synergyEnvironmentUpdater) { + long j = synergyEnvironmentUpdater.m_validateEADeviceIDRetryCount; + synergyEnvironmentUpdater.m_validateEADeviceIDRetryCount = 1 + j; + return j; + } + + static /* synthetic */ long access$1208(SynergyEnvironmentUpdater synergyEnvironmentUpdater) { + long j = synergyEnvironmentUpdater.m_getAnonUIDRetryCount; + synergyEnvironmentUpdater.m_getAnonUIDRetryCount = 1 + j; + return j; + } + + static /* synthetic */ long access$708(SynergyEnvironmentUpdater synergyEnvironmentUpdater) { + long j = synergyEnvironmentUpdater.m_getDirectionRetryCount; + synergyEnvironmentUpdater.m_getDirectionRetryCount = 1 + j; + return j; + } + + /* JADX INFO: Access modifiers changed from: private */ + public void callSynergyGetAnonUid() { + String anonymousSynergyId = SynergyIdManager.getComponent().getAnonymousSynergyId(); + if (anonymousSynergyId != null) { + Log.Helper.LOGD(this, "Not getting anonymous ID from Synergy since it was loaded from persistence"); + this.m_environmentForSynergyStartUp.setSynergyAnonymousId(anonymousSynergyId); + onStartUpSequenceFinished(null); + return; + } + HashMap hashMap = new HashMap(); + hashMap.put("apiVer", "1.0.0"); + hashMap.put("updatePriority", "false"); + hashMap.put("hwId", this.m_environmentForSynergyStartUp.getEAHardwareId()); + if (Utility.validString(this.m_environmentForSynergyStartUp.getEADeviceId())) { + hashMap.put("eadeviceid", this.m_environmentForSynergyStartUp.getEADeviceId()); + this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_USER), "/user/api/android/getAnonUid", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.4 + @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, "GETANON Success"); + SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setSynergyAnonymousId(synergyNetworkConnectionHandle.getResponse().getJsonData().get("uid").toString()); + SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(null); + } else if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_getAnonUIDRetryCount >= 3) { + SynergyEnvironmentUpdater.this.m_getAnonUIDRetryCount = 0; + Log.Helper.LOGD(this, "GETANON Error, (%s)", synergyNetworkConnectionHandle.getResponse().getError().toString()); + SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_ANONYMOUS_ID_FAILURE, "Synergy \"get anonymous id\" call failed.", error)); + } else { + SynergyEnvironmentUpdater.access$1208(SynergyEnvironmentUpdater.this); + Log.Helper.LOGD(this, "GetAnonUid, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_getAnonUIDRetryCount)); + SynergyEnvironmentUpdater.this.callSynergyGetAnonUid(); + } + } + }); + return; + } + Log.Helper.LOGE(this, "getAnonUid got an invalid EA Device ID."); + onStartUpSequenceFinished(new Error(Error.Code.INVALID_ARGUMENT, "EA Device ID is invalid")); + } + + /* JADX INFO: Access modifiers changed from: private */ + public void callSynergyGetDirection() { + String applicationBundleId = ApplicationEnvironment.getComponent().getApplicationBundleId(); + String deviceString = ApplicationEnvironment.getComponent().getDeviceString(); + String deviceCodename = ApplicationEnvironment.getComponent().getDeviceCodename(); + String deviceManufacturer = ApplicationEnvironment.getComponent().getDeviceManufacturer(); + String deviceModel = ApplicationEnvironment.getComponent().getDeviceModel(); + String deviceBrand = ApplicationEnvironment.getComponent().getDeviceBrand(); + String deviceFingerprint = ApplicationEnvironment.getComponent().getDeviceFingerprint(); + if (!Utility.validString(applicationBundleId)) { + Log.Helper.LOGE(this, "GETDIRECTION bundleId is invalid"); + onStartUpSequenceFinished(new Error(Error.Code.INVALID_ARGUMENT, "bundleId is invalid")); + } else if (!Utility.validString(deviceString)) { + Log.Helper.LOGE(this, "GETDIRECTION deviceString is invalid"); + onStartUpSequenceFinished(new Error(Error.Code.INVALID_ARGUMENT, "deviceString is invalid")); + } else { + HashMap hashMap = new HashMap<>(); + hashMap.put("packageId", applicationBundleId); + hashMap.put("deviceString", deviceString); + hashMap.put("deviceCodename", deviceCodename); + hashMap.put("manufacturer", deviceManufacturer); + hashMap.put("model", deviceModel); + hashMap.put("brand", deviceBrand); + hashMap.put("fingerprint", deviceFingerprint); + hashMap.put("serverEnvironment", getSynergyServerEnvironmentName()); + hashMap.put("sdkVersion", "1.23.14.1217"); + hashMap.put("apiVer", "1.0.0"); + this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(this.m_environmentForSynergyStartUp.getSynergyDirectorServerUrl(Base.getConfiguration()), "/director/api/android/getDirectionByPackage", hashMap, new SynergyNetworkConnectionCallback() { // from class: com.ea.nimble.SynergyEnvironmentUpdater.1 + /* JADX WARN: Type inference failed for: r1v24, types: [java.lang.Object] */ + /* JADX WARN: Type inference failed for: r2v10, types: [java.lang.Object] */ + @Override // com.ea.nimble.SynergyNetworkConnectionCallback + public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + Log.Helper.LOGD(this, "GETDIRECTION FINISHED"); + SynergyEnvironmentUpdater.this.m_synergyNetworkConnectionHandle = null; + Exception error = synergyNetworkConnectionHandle.getResponse().getError(); + if (error == null) { + SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setMostRecentDirectorResponseTimestamp(System.currentTimeMillis()); + SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setGetDirectionResponseDictionary(synergyNetworkConnectionHandle.getResponse().getJsonData()); + List list = (List) SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.getGetDirectionResponseDictionary().get("serverData"); + SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setServerUrls(new HashMap()); + if (list != null) { + for (Map map : list) { + SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.getServerUrls().put((String) map.get("key"), (String)map.get("value")); + } + } + if (SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.getServerUrls().size() == 0) { + SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.NOT_AVAILABLE, "No Synergy server URLs available.")); + } else if (SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData == null || !Utility.validString(SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData.getEADeviceId())) { + String loadEADeviceId = EASPDataLoader.loadEADeviceId(); + if (loadEADeviceId != null) { + SynergyEnvironmentUpdater.this.callSynergyValidateEADeviceId(loadEADeviceId); + } else { + SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); + } + } else { + SynergyEnvironmentUpdater.this.callSynergyValidateEADeviceId(SynergyEnvironmentUpdater.this.m_previousValidEnvironmentData.getEADeviceId()); + } + } else if (!(error instanceof SynergyServerError)) { + boolean isTimeoutError = SynergyEnvironmentUpdater.this.isTimeoutError(error); + if (isTimeoutError || SynergyEnvironmentUpdater.this.m_getDirectionRetryCount >= 3) { + SynergyEnvironmentUpdater.this.m_getDirectionRetryCount = 0; + if (isTimeoutError) { + SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_DIRECTION_TIMEOUT, "Synergy /getDirectionByPackage request timed out.", error)); + } else { + SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(error); + } + } else { + SynergyEnvironmentUpdater.access$708(SynergyEnvironmentUpdater.this); + Log.Helper.LOGD(this, "GetDirection, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_getDirectionRetryCount)); + SynergyEnvironmentUpdater.this.callSynergyGetDirection(); + } + } else if (((SynergyServerError) error).isError(SynergyEnvironmentUpdater.SYNERGY_DIRECTOR_RESPONSE_ERROR_CODE_SERVERS_FULL)) { + SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_SERVER_FULL, "Synergy ServerUnavailable signal received.", error)); + } + } + }); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void callSynergyGetEADeviceId() { + int phoneType; + String string; + String SHA256HashString; + EnvironmentDataContainer environmentDataContainer = this.m_environmentForSynergyStartUp; + HashMap hashMap = new HashMap(); + hashMap.put("apiVer", "1.0.0"); + hashMap.put("hwId", environmentDataContainer.getEAHardwareId()); + String mACAddress = ApplicationEnvironment.getComponent().getMACAddress(); + if (Utility.validString(mACAddress) && (SHA256HashString = Utility.SHA256HashString(mACAddress)) != null) { + hashMap.put("macHash", SHA256HashString); + } + IApplicationEnvironment component = ApplicationEnvironment.getComponent(); + Context context = null; + if (component != null) { + context = component.getApplicationContext(); + } + if (!(context == null || (string = Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id")) == null)) { + hashMap.put("androidId", string); + } + if (context != null) { + TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); + PackageManager packageManager = context.getPackageManager(); + if (!(telephonyManager == null || packageManager.checkPermission("android.permission.READ_PHONE_STATE", context.getPackageName()) != 0 || (phoneType = telephonyManager.getPhoneType()) == 0)) { + String deviceId = telephonyManager.getDeviceId(); + if (Utility.validString(deviceId)) { + String str = "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) { + Log.Helper.LOGD(this, "GetEADeviceID Success"); + SynergyEnvironmentUpdater.this.m_environmentForSynergyStartUp.setEADeviceId((String) synergyNetworkConnectionHandle.getResponse().getJsonData().get("deviceId")); + SynergyEnvironmentUpdater.this.callSynergyGetAnonUid(); + } else if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount >= 3) { + SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount = 0; + 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())); + } else { + SynergyEnvironmentUpdater.access$1008(SynergyEnvironmentUpdater.this); + Log.Helper.LOGD(this, "GetEADeviceID, call failed. Making retry attempt number %d.", Long.valueOf(SynergyEnvironmentUpdater.this.m_getEADeviceIDRetryCount)); + SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); + } + } + }); + } + + /* JADX INFO: Access modifiers changed from: private */ + public void callSynergyValidateEADeviceId(final String str) { + int phoneType; + String string; + String SHA256HashString; + EnvironmentDataContainer environmentDataContainer = this.m_environmentForSynergyStartUp; + HashMap hashMap = new HashMap(); + hashMap.put("apiVer", "1.0.0"); + hashMap.put("hwId", environmentDataContainer.getEAHardwareId()); + hashMap.put("eadeviceid", str); + String mACAddress = ApplicationEnvironment.getComponent().getMACAddress(); + if (Utility.validString(mACAddress) && (SHA256HashString = Utility.SHA256HashString(mACAddress)) != null) { + hashMap.put("macHash", SHA256HashString); + } + IApplicationEnvironment component = ApplicationEnvironment.getComponent(); + Context context = null; + if (component != null) { + context = component.getApplicationContext(); + } + if (!(context == null || (string = Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id")) == null)) { + hashMap.put("androidId", string); + } + if (context != null) { + TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService("phone"); + PackageManager packageManager = context.getPackageManager(); + if (!(telephonyManager == null || packageManager.checkPermission("android.permission.READ_PHONE_STATE", context.getPackageName()) != 0 || (phoneType = telephonyManager.getPhoneType()) == 0)) { + String deviceId = telephonyManager.getDeviceId(); + if (Utility.validString(deviceId)) { + String str2 = "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"); + 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."); + SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); + return; + } else 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."); + SynergyEnvironmentUpdater.this.callSynergyGetEADeviceId(); + return; + } + } + if (SynergyEnvironmentUpdater.this.isTimeoutError(error) || SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount >= 3) { + SynergyEnvironmentUpdater.this.m_validateEADeviceIDRetryCount = 0; + SynergyEnvironmentUpdater.this.onStartUpSequenceFinished(new Error(Error.Code.SYNERGY_GET_EA_DEVICE_ID_FAILURE, "ValidateEADeviceId call failed", error)); + return; + } + 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); + } + }); + } + + private String getSynergyServerEnvironmentName() { + switch (AnonymousClass5.$SwitchMap$com$ea$nimble$NimbleConfiguration[this.m_core.getConfiguration().ordinal()]) { + case 1: + case 2: + case 3: + return this.m_core.getConfiguration().toString(); + case 4: + return PreferenceManager.getDefaultSharedPreferences(ApplicationEnvironment.getComponent().getApplicationContext()).getString("NimbleCustomizedSynergyServerEnvironmentName", "live"); + default: + Log.Helper.LOGF(this, "Request for Synergy server environment name with unknown NimbleConfiguration %s", this.m_core.getConfiguration().toString()); + return "live"; + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public boolean isTimeoutError(Exception exc) { + return (exc instanceof Error) && ((Error) exc).isError(Error.Code.NETWORK_TIMEOUT); + } + + /* JADX INFO: Access modifiers changed from: private */ + public void onStartUpSequenceFinished(Exception exc) { + if (this.m_completionCallback != null) { + this.m_completionCallback.callback(exc); + } else { + Log.Helper.LOGW(this, "Startup sequence finished, but no completion callback set."); + } + } + + public void cancel() { + SynergyNetworkConnectionHandle synergyNetworkConnectionHandle = this.m_synergyNetworkConnectionHandle; + if (synergyNetworkConnectionHandle != null) { + Log.Helper.LOGD(this, "Canceling network connection."); + synergyNetworkConnectionHandle.cancel(); + this.m_synergyNetworkConnectionHandle = null; + } + onStartUpSequenceFinished(new Error(Error.Code.NETWORK_OPERATION_CANCELLED, "Synergy startup sequence canceled.")); + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public EnvironmentDataContainer getEnvironmentDataContainer() { + return this.m_environmentForSynergyStartUp; + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "SynergyEnv"; + } + + public void startSynergyStartupSequence(EnvironmentDataContainer environmentDataContainer, CompletionCallback completionCallback) { + this.m_completionCallback = completionCallback; + this.m_previousValidEnvironmentData = environmentDataContainer; + if (Network.getComponent().getStatus() != Network.Status.OK) { + onStartUpSequenceFinished(new Error(Error.Code.NETWORK_NO_CONNECTION, "Device is not connected to Wifi or wireless.")); + } else { + callSynergyGetDirection(); + } + } +} diff --git a/app/src/main/java/com/ea/nimble/SynergyIdManager.java b/app/src/main/java/com/ea/nimble/SynergyIdManager.java new file mode 100644 index 0000000..4e5ca35 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyIdManager.java @@ -0,0 +1,19 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.ISynergyIdManager; +import com.ea.nimble.SynergyIdManagerImpl; + +public class SynergyIdManager { + public static final String COMPONENT_ID = "com.ea.nimble.synergyidmanager"; + public static final String LOG_TAG = "SynergyID"; + public static final String NOTIFICATION_ANONYMOUS_SYNERGY_ID_CHANGED = "nimble.synergyidmanager.notification.anonymous_synergy_id_changed"; + public static final String NOTIFICATION_SYNERGY_ID_CHANGED = "nimble.synergyidmanager.notification.synergy_id_changed"; + + public static ISynergyIdManager getComponent() { + return SynergyIdManagerImpl.getComponent(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java b/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java new file mode 100644 index 0000000..f2a8195 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyIdManagerError.java @@ -0,0 +1,38 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Error; + +public class SynergyIdManagerError +extends Error { + public static final String ERROR_DOMAIN = "NimbleSynergyIdManager"; + private static final long serialVersionUID = 1L; + + public SynergyIdManagerError(int n2, String string2) { + super(ERROR_DOMAIN, n2, string2, null); + } + + public SynergyIdManagerError(int n2, String string2, Throwable throwable) { + super(ERROR_DOMAIN, n2, string2, throwable); + } + + public static enum Code { + AUTHENTICATOR_CONFLICT(5000), + UNEXPECTED_LOGIN_STATE(5001), + INVALID_ID(5002), + MISSING_AUTHENTICATOR(5003); + + private int m_value; + + private Code(int n3) { + this.m_value = n3; + } + + public int intValue() { + return this.m_value; + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyIdManagerImpl.java b/app/src/main/java/com/ea/nimble/SynergyIdManagerImpl.java new file mode 100644 index 0000000..0e80a00 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyIdManagerImpl.java @@ -0,0 +1,231 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + */ +package com.ea.nimble; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +import java.io.Serializable; +import java.util.HashMap; + +class SynergyIdManagerImpl +extends Component +implements ISynergyIdManager, +LogSource { + private static final String ANONYMOUS_ID_PERSISTENCE_DATA_ID = "anonymousId"; + private static final String AUTHENTICATOR_PERSISTENCE_DATA_ID = "authenticator"; + private static final String CURRENT_ID_PERSISTENCE_DATA_ID = "currentId"; + private static final String SYNERGY_ID_MANAGER_ANONYMOUS_ID_PERSISTENCE_ID = "com.ea.nimble.synergyidmanager.anonymousId"; + private static final String VERSION_PERSISTENCE_DATA_ID = "dataVersion"; + private String m_anonymousSynergyId; + private String m_authenticatorIdentifier; + private String m_currentSynergyId; + private BroadcastReceiver m_receiver = new SynergyIdManagerReceiver(); + + SynergyIdManagerImpl() { + } + + public static ISynergyIdManager getComponent() { + return (ISynergyIdManager)((Object)Base.getComponent("com.ea.nimble.synergyidmanager")); + } + + private void onSynergyEnvironmentStartupRequestsFinished() { + if (SynergyEnvironment.getComponent() != null) { + Log.Helper.LOGD(this, "onSynergyEnvironmentStartupRequestsFinished - Process the notification, everything looks okay"); + this.setAnonymousSynergyId(SynergyEnvironment.getComponent().getSynergyId()); + if (Utility.validString(this.m_currentSynergyId)) return; + this.setCurrentSynergyId(this.m_anonymousSynergyId); + return; + } + Log.Helper.LOGI(this, "onSynergyEnvironmentStartupRequestsFinished - Aborted because we were unable to get SynergyEnvironment"); + } + + private void restoreFromPersistent() { + Persistence persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.synergyidmanager", Persistence.Storage.CACHE); + if (persistence != null) { + Log.Helper.LOGD("Loaded persistence data version, %s.", persistence.getStringValue(VERSION_PERSISTENCE_DATA_ID)); + this.m_currentSynergyId = persistence.getStringValue(CURRENT_ID_PERSISTENCE_DATA_ID); + this.m_authenticatorIdentifier = persistence.getStringValue(AUTHENTICATOR_PERSISTENCE_DATA_ID); + Log.Helper.LOGD(this, "Loaded Synergy ID, %s, with authenticator, %s.", this.m_currentSynergyId, this.m_authenticatorIdentifier); + } else { + Log.Helper.LOGE(this, "Could not get persistence object to load from."); + } + if ((persistence = PersistenceService.getPersistenceForNimbleComponent(SYNERGY_ID_MANAGER_ANONYMOUS_ID_PERSISTENCE_ID, Persistence.Storage.DOCUMENT)) != null) { + Log.Helper.LOGD(this, "Loaded persistence data version, %s.", Utility.safeString(persistence.getStringValue(VERSION_PERSISTENCE_DATA_ID))); + this.m_anonymousSynergyId = persistence.getStringValue(ANONYMOUS_ID_PERSISTENCE_DATA_ID); + Log.Helper.LOGD(this, "Loaded anonymous Synergy ID, %s.", Utility.safeString(this.m_anonymousSynergyId)); + return; + } + Log.Helper.LOGE(this, "Could not get anonymous Synergy ID persistence object to load from."); + } + + private void saveDataToPersistent() { + Persistence persistence = PersistenceService.getPersistenceForNimbleComponent(SYNERGY_ID_MANAGER_ANONYMOUS_ID_PERSISTENCE_ID, Persistence.Storage.DOCUMENT); + if (persistence != null) { + Log.Helper.LOGD("Saving anonymous Synergy ID, %s, to persistent.", this.m_anonymousSynergyId); + persistence.setValue(VERSION_PERSISTENCE_DATA_ID, (Serializable)((Object)"1.0.0")); + persistence.setValue(ANONYMOUS_ID_PERSISTENCE_DATA_ID, (Serializable)((Object)this.m_anonymousSynergyId)); + persistence.setBackUp(true); + persistence.synchronize(); + } else { + Log.Helper.LOGE(this, "Could not get anonymous Synergy ID persistence object to save to."); + } + if ((persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.synergyidmanager", Persistence.Storage.CACHE)) != null) { + Log.Helper.LOGD(this, "Saving current Synergy ID, %s, and authenticator, %s, to persistent.", this.m_currentSynergyId, this.m_authenticatorIdentifier); + persistence.setValue(VERSION_PERSISTENCE_DATA_ID, (Serializable)((Object)"1.0.0")); + persistence.setValue(CURRENT_ID_PERSISTENCE_DATA_ID, (Serializable)((Object)this.m_currentSynergyId)); + persistence.setValue(AUTHENTICATOR_PERSISTENCE_DATA_ID, (Serializable)((Object)this.m_authenticatorIdentifier)); + persistence.synchronize(); + return; + } + Log.Helper.LOGE(this, "Could not get persistence object to save to."); + } + + private void setAnonymousSynergyId(String object) { + if (Utility.validString(this.m_anonymousSynergyId) && !Utility.validString((String)object)) { + Log.Helper.LOGE(this, "Attempt to set invalid anonymous Synergy ID over existing ID, %s. Ignoring attempt.", this.m_anonymousSynergyId); + return; + } + String string2 = this.m_anonymousSynergyId; + this.m_anonymousSynergyId = object; + this.saveDataToPersistent(); + if (Utility.validString(string2) && (Utility.validString(string2) && !string2.equals(this.m_anonymousSynergyId) || Utility.validString(this.m_anonymousSynergyId) && !this.m_anonymousSynergyId.equals(string2))) { + HashMap hashMap = new HashMap<>(); + hashMap.put("previousSynergyId", Utility.safeString(string2)); + hashMap.put("currentSynergyId", Utility.safeString(this.m_anonymousSynergyId)); + Utility.sendBroadcast("nimble.synergyidmanager.notification.anonymous_synergy_id_changed", hashMap); + } + if (this.m_authenticatorIdentifier != null) return; + this.setCurrentSynergyId(this.m_anonymousSynergyId); + } + + private void setCurrentSynergyId(String object) { + if (Utility.validString(this.m_currentSynergyId) && !Utility.validString((String)object)) { + Log.Helper.LOGE(this, "Attempt to set invalid current Synergy ID over existing ID, %s. Ignoring attempt.", this.m_currentSynergyId); + return; + } + String string2 = this.m_currentSynergyId; + this.m_currentSynergyId = object; + this.saveDataToPersistent(); + if (!Utility.validString(string2)) return; + if (!Utility.validString(string2) || string2.equals(this.m_currentSynergyId)) { + if (!Utility.validString(this.m_currentSynergyId)) return; + if (this.m_currentSynergyId.equals(string2)) return; + } + HashMap hashMap = new HashMap<>(); + hashMap.put("previousSynergyId", Utility.safeString(string2)); + hashMap.put("currentSynergyId", Utility.safeString(this.m_currentSynergyId)); + Utility.sendBroadcast("nimble.synergyidmanager.notification.synergy_id_changed", hashMap); + } + + private void sleep() { + Utility.unregisterReceiver(this.m_receiver); + this.saveDataToPersistent(); + } + + private void wakeup() { + this.restoreFromPersistent(); + if (!Utility.validString(this.m_anonymousSynergyId)) { + this.setAnonymousSynergyId(SynergyEnvironment.getComponent().getSynergyId()); + } + if (!Utility.validString(this.m_currentSynergyId)) { + this.setCurrentSynergyId(this.m_anonymousSynergyId); + } + Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_receiver); + } + + @Override + protected void cleanup() { + this.sleep(); + } + + @Override + public String getAnonymousSynergyId() { + if (!Utility.validString(this.m_anonymousSynergyId)) return SynergyEnvironment.getComponent().getSynergyId(); + return this.m_anonymousSynergyId; + } + + @Override + public String getComponentId() { + return "com.ea.nimble.synergyidmanager"; + } + + @Override + public String getLogSourceTitle() { + return "SynergyId"; + } + + @Override + public String getSynergyId() { + if (!Utility.validString(this.m_currentSynergyId)) return this.getAnonymousSynergyId(); + return this.m_currentSynergyId; + } + + @Override + public SynergyIdManagerError login(String string2, String string3) { + if (this.m_authenticatorIdentifier != null) { + return new SynergyIdManagerError(SynergyIdManagerError.Code.UNEXPECTED_LOGIN_STATE.intValue(), "Already logged in with authenticator, " + this.m_authenticatorIdentifier); + } + if (!Utility.validString(string2)) return new SynergyIdManagerError(SynergyIdManagerError.Code.INVALID_ID.intValue(), "Synergy ID must be numeric digits."); + if (!Utility.isOnlyDecimalCharacters(string2)) { + return new SynergyIdManagerError(SynergyIdManagerError.Code.INVALID_ID.intValue(), "Synergy ID must be numeric digits."); + } + if (!Utility.validString(string3)) { + return new SynergyIdManagerError(SynergyIdManagerError.Code.MISSING_AUTHENTICATOR.intValue(), "Authenticator string required for login API."); + } + this.m_authenticatorIdentifier = string3; + this.setCurrentSynergyId(string2); + return null; + } + + @Override + public SynergyIdManagerError logout(String string2) { + if (this.m_authenticatorIdentifier == null) { + return new SynergyIdManagerError(SynergyIdManagerError.Code.UNEXPECTED_LOGIN_STATE.intValue(), "Already logged out."); + } + if (!Utility.validString(string2)) { + return new SynergyIdManagerError(SynergyIdManagerError.Code.MISSING_AUTHENTICATOR.intValue(), "Authenticator string required for logout API."); + } + if (!this.m_authenticatorIdentifier.equals(string2)) { + return new SynergyIdManagerError(SynergyIdManagerError.Code.AUTHENTICATOR_CONFLICT.intValue(), "Logout must be performed by the same authenticator that logged in, " + this.m_authenticatorIdentifier); + } + this.setCurrentSynergyId(this.m_anonymousSynergyId); + this.m_authenticatorIdentifier = null; + return null; + } + + @Override + protected void restore() { + this.wakeup(); + } + + @Override + protected void resume() { + this.wakeup(); + } + + @Override + protected void suspend() { + this.sleep(); + } + + private class SynergyIdManagerReceiver + extends BroadcastReceiver { + private SynergyIdManagerReceiver() { + } + + public void onReceive(Context context, Intent intent) { + if (!ApplicationEnvironment.isMainApplicationRunning()) return; + if (ApplicationEnvironment.getCurrentActivity() == null) return; + SynergyIdManagerImpl.this.onSynergyEnvironmentStartupRequestsFinished(); + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyNetwork.java b/app/src/main/java/com/ea/nimble/SynergyNetwork.java new file mode 100644 index 0000000..12f0564 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyNetwork.java @@ -0,0 +1,16 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.ISynergyNetwork; +import com.ea.nimble.SynergyNetworkImpl; + +public class SynergyNetwork { + public static final String COMPONENT_ID = "com.ea.nimble.synergynetwork"; + + public static ISynergyNetwork getComponent() { + return SynergyNetworkImpl.getComponent(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyNetworkConnection.java b/app/src/main/java/com/ea/nimble/SynergyNetworkConnection.java new file mode 100644 index 0000000..f92eeb5 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyNetworkConnection.java @@ -0,0 +1,243 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.BaseCore; +import com.ea.nimble.HttpResponse; +import com.ea.nimble.IOperationalTelemetryDispatch; +import com.ea.nimble.ISynergyRequest; +import com.ea.nimble.ISynergyResponse; +import com.ea.nimble.Log; +import com.ea.nimble.Network; +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.OperationalTelemetryDispatch; +import com.ea.nimble.OperationalTelemetryEvent; +import com.ea.nimble.SynergyNetworkConnectionCallback; +import com.ea.nimble.SynergyNetworkConnectionHandle; +import com.ea.nimble.SynergyRequest; +import com.ea.nimble.SynergyResponse; +import java.util.List; +import java.util.Map; + +class SynergyNetworkConnection +implements SynergyNetworkConnectionHandle { + private SynergyNetworkConnectionCallback m_completionCallback; + private SynergyNetworkConnectionCallback m_headerCallback; + private NetworkConnectionHandle m_networkHandle = null; + private SynergyOperationalTelemetryDispatch m_otDispatch; + private SynergyNetworkConnectionCallback m_progressCallback; + private SynergyRequest m_request; + private SynergyResponse m_response; + + public SynergyNetworkConnection(SynergyRequest synergyRequest, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { + this.m_request = synergyRequest; + this.m_response = new SynergyResponse(); + this.m_otDispatch = new SynergyOperationalTelemetryDispatch(); + this.m_headerCallback = null; + this.m_progressCallback = null; + this.m_completionCallback = synergyNetworkConnectionCallback; + } + + static /* synthetic */ NetworkConnectionHandle access$102(SynergyNetworkConnection synergyNetworkConnection, NetworkConnectionHandle networkConnectionHandle) { + synergyNetworkConnection.m_networkHandle = networkConnectionHandle; + return networkConnectionHandle; + } + + private void parseDataFromNetworkHandle() { + if (this.m_networkHandle == null) return; + this.m_response.httpResponse = this.m_networkHandle.getResponse(); + this.m_response.parseData(); + } + + private void updateNetworkHeaderHandler() { + if (this.m_headerCallback == null) { + this.m_networkHandle.setHeaderCallback(null); + return; + } + this.m_networkHandle.setHeaderCallback(new NetworkConnectionCallback(){ + + @Override + public void callback(NetworkConnectionHandle networkConnectionHandle) { + SynergyNetworkConnection.this.m_headerCallback.callback(SynergyNetworkConnection.this); + } + }); + } + + private void updateNetworkProgressHandler() { + if (this.m_progressCallback == null) { + this.m_networkHandle.setProgressCallback(null); + return; + } + this.m_networkHandle.setProgressCallback(new NetworkConnectionCallback(){ + + @Override + public void callback(NetworkConnectionHandle networkConnectionHandle) { + SynergyNetworkConnection.this.m_progressCallback.callback(SynergyNetworkConnection.this); + } + }); + } + + @Override + public void cancel() { + if (this.m_networkHandle == null) return; + this.m_networkHandle.cancel(); + } + + public void errorPriorToSend(Exception exception) { + HttpResponse httpResponse = new HttpResponse(); + httpResponse.error = exception; + httpResponse.isCompleted = true; + this.m_response.httpResponse = httpResponse; + if (this.m_completionCallback == null) return; + this.m_completionCallback.callback(this); + } + + @Override + public SynergyNetworkConnectionCallback getCompletionCallback() { + return this.m_completionCallback; + } + + @Override + public SynergyNetworkConnectionCallback getHeaderCallback() { + return this.m_headerCallback; + } + + public NetworkConnectionHandle getNetworkConnectionHandle() { + return this.m_networkHandle; + } + + @Override + public SynergyNetworkConnectionCallback getProgressCallback() { + return this.m_progressCallback; + } + + @Override + public ISynergyRequest getRequest() { + return this.m_request; + } + + @Override + public ISynergyResponse getResponse() { + return this.m_response; + } + + void send() { + try { + this.m_request.build(); + this.m_networkHandle = Network.getComponent().sendRequest(this.m_request.httpRequest, new NetworkConnectionCallback(){ + + @Override + public void callback(NetworkConnectionHandle networkConnectionHandle) { + if (SynergyNetworkConnection.this.m_networkHandle == null) { + SynergyNetworkConnection.access$102(SynergyNetworkConnection.this, networkConnectionHandle); + } + SynergyNetworkConnection.this.parseDataFromNetworkHandle(); + networkConnectionHandle.setHeaderCallback(null); + networkConnectionHandle.setProgressCallback(null); + networkConnectionHandle.setCompletionCallback(null); + if (SynergyNetworkConnection.this.m_completionCallback == null) return; + SynergyNetworkConnection.this.m_completionCallback.callback(SynergyNetworkConnection.this); + } + }, this.m_otDispatch); + this.m_response.httpResponse = this.m_networkHandle.getResponse(); + this.updateNetworkHeaderHandler(); + this.updateNetworkProgressHandler(); + return; + } + catch (Exception exception) { + this.errorPriorToSend(exception); + return; + } + } + + @Override + public void setCompletionCallback(SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { + this.m_completionCallback = synergyNetworkConnectionCallback; + } + + @Override + public void setHeaderCallback(SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { + this.m_headerCallback = synergyNetworkConnectionCallback; + if (this.m_networkHandle == null) return; + this.updateNetworkHeaderHandler(); + } + + public void setNetworkConnectionHandle(NetworkConnectionHandle networkConnectionHandle) { + this.m_networkHandle = networkConnectionHandle; + } + + @Override + public void setProgressCallback(SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { + this.m_progressCallback = synergyNetworkConnectionCallback; + if (this.m_networkHandle == null) return; + this.updateNetworkProgressHandler(); + } + + public void start() { + this.m_request.prepare(this); + } + + @Override + public void waitOn() { + if (this.m_networkHandle == null) return; + this.m_networkHandle.waitOn(); + } + + private class SynergyOperationalTelemetryDispatch + implements IOperationalTelemetryDispatch { + private SynergyOperationalTelemetryDispatch() { + } + + @Override + public List getEvents(String string2) { + if (!BaseCore.getInstance().isActive()) { + Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]); + return null; + } + IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent(); + if (iOperationalTelemetryDispatch == null) return null; + return iOperationalTelemetryDispatch.getEvents(string2); + } + + @Override + public int getMaxEventCount(String string2) { + if (!BaseCore.getInstance().isActive()) { + Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]); + return -1; + } + IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent(); + if (iOperationalTelemetryDispatch == null) return -1; + return iOperationalTelemetryDispatch.getMaxEventCount(string2); + } + + @Override + public void logEvent(String string2, Map map) { + if (!BaseCore.getInstance().isActive()) { + Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]); + return; + } + IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent(); + if (iOperationalTelemetryDispatch == null) return; + SynergyNetworkConnection.this.parseDataFromNetworkHandle(); + Map map2 = SynergyNetworkConnection.this.m_response.getJsonData(); + if (map2 != null && map2.containsKey("resultCode")) { + map.put("SYNERGY_RESULT_CODE", ((Integer)map2.get("resultCode")).toString()); + } + iOperationalTelemetryDispatch.logEvent(string2, map); + } + + @Override + public void setMaxEventCount(String string2, int n2) { + if (!BaseCore.getInstance().isActive()) { + Log.Helper.LOGV(this, "BaseCore not active for operational telemetry logging.", new Object[0]); + return; + } + IOperationalTelemetryDispatch iOperationalTelemetryDispatch = OperationalTelemetryDispatch.getComponent(); + if (iOperationalTelemetryDispatch == null) return; + iOperationalTelemetryDispatch.setMaxEventCount(string2, n2); + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionCallback.java b/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionCallback.java new file mode 100644 index 0000000..3367f3a --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionCallback.java @@ -0,0 +1,11 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.SynergyNetworkConnectionHandle; + +public interface SynergyNetworkConnectionCallback { + public void callback(SynergyNetworkConnectionHandle var1); +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionHandle.java b/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionHandle.java new file mode 100644 index 0000000..0577d30 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyNetworkConnectionHandle.java @@ -0,0 +1,31 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.ISynergyRequest; +import com.ea.nimble.ISynergyResponse; +import com.ea.nimble.SynergyNetworkConnectionCallback; + +public interface SynergyNetworkConnectionHandle { + public void cancel(); + + public SynergyNetworkConnectionCallback getCompletionCallback(); + + public SynergyNetworkConnectionCallback getHeaderCallback(); + + public SynergyNetworkConnectionCallback getProgressCallback(); + + public ISynergyRequest getRequest(); + + public ISynergyResponse getResponse(); + + public void setCompletionCallback(SynergyNetworkConnectionCallback var1); + + public void setHeaderCallback(SynergyNetworkConnectionCallback var1); + + public void setProgressCallback(SynergyNetworkConnectionCallback var1); + + public void waitOn(); +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java b/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java new file mode 100644 index 0000000..b5f0d5c --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyNetworkImpl.java @@ -0,0 +1,140 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + */ +package com.ea.nimble; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +import java.util.ArrayList; +import java.util.Locale; +import java.util.Map; +import java.util.UUID; + +public class SynergyNetworkImpl +extends Component +implements ISynergyNetwork { + private ArrayList m_pendingRequests = null; + private String m_sessionId; + private BroadcastReceiver m_synergyEnvironmentNotifyReceiver = null; + + SynergyNetworkImpl() { + } + + private String generateSessionId() { + return UUID.randomUUID().toString().replace("-", "").toLowerCase(Locale.US); + } + + public static ISynergyNetwork getComponent() { + return (ISynergyNetwork)(Base.getComponent("com.ea.nimble.synergynetwork")); + } + + private SynergyNetworkConnectionHandle sendSynergyRequest(SynergyRequest object, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { + SynergyNetworkConnection synergyNetworkConnection = new SynergyNetworkConnection(object, synergyNetworkConnectionCallback); + synergyNetworkConnection.start(); + return synergyNetworkConnection; + } + + @Override + public void cleanup() { + if (this.m_synergyEnvironmentNotifyReceiver != null) { + Utility.unregisterReceiver(this.m_synergyEnvironmentNotifyReceiver); + this.m_synergyEnvironmentNotifyReceiver = null; + } + this.m_pendingRequests.clear(); + } + + @Override + public String getComponentId() { + return "com.ea.nimble.synergynetwork"; + } + + String getSessionId() { + return this.m_sessionId; + } + + @Override + public void restore() { + if (SynergyEnvironment.getComponent().isDataAvailable()) return; + this.m_synergyEnvironmentNotifyReceiver = new BroadcastReceiver(){ + + public void onReceive(Context object, Intent intent) { + + for (SynergyNetworkConnection m_pendingRequest : SynergyNetworkImpl.this.m_pendingRequests) + if (intent.getStringExtra("result").equals("0")) + m_pendingRequest.errorPriorToSend(new Error(Error.Code.SYNERGY_ENVIRONMENT_UPDATE_FAILURE, "Failed to retrieve Environment data from Synergy")); + else + m_pendingRequest.start(); + + SynergyNetworkImpl.this.m_pendingRequests.clear(); + } + }; + Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_synergyEnvironmentNotifyReceiver); + } + + @Override + protected void resume() { + this.m_sessionId = this.generateSessionId(); + } + + @Override + public SynergyNetworkConnectionHandle sendGetRequest(String string2, String object, Map map, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { + SynergyRequest synergyRequest = new SynergyRequest(object, IHttpRequest.Method.GET, null); + synergyRequest.baseUrl = string2; + synergyRequest.urlParameters = map; + return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback); + } + + @Override + public SynergyNetworkConnectionHandle sendPostRequest(String string2, String object, Map map, Map map2, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback) { + SynergyRequest synergyRequest = new SynergyRequest(object, IHttpRequest.Method.POST, null); + synergyRequest.baseUrl = string2; + synergyRequest.urlParameters = map; + synergyRequest.jsonData = map2; + return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback); + } + + @Override + public SynergyNetworkConnectionHandle sendPostRequest(String string2, String object, Map map, Map map2, SynergyNetworkConnectionCallback synergyNetworkConnectionCallback, Map map3) { + SynergyRequest synergyRequest = new SynergyRequest((String) object, IHttpRequest.Method.POST, null); + synergyRequest.baseUrl = string2; + synergyRequest.urlParameters = map; + synergyRequest.jsonData = map2; + if (map3 == null) return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback); + synergyRequest.httpRequest.headers.putAll(map3); + return this.sendSynergyRequest(synergyRequest, synergyNetworkConnectionCallback); + } + + @Override + public void sendRequest(SynergyRequest object, SynergyNetworkConnectionCallback object2) { + ISynergyEnvironment iSynergyEnvironment = SynergyEnvironment.getComponent(); + if (iSynergyEnvironment.isDataAvailable()) { + this.sendSynergyRequest(object, object2); + return; + } + SynergyNetworkConnection synergyNetworkConnection = new SynergyNetworkConnection(object, object2); + if (iSynergyEnvironment.isUpdateInProgress()) { + this.m_pendingRequests.add(synergyNetworkConnection); + return; + } + Error error = iSynergyEnvironment.checkAndInitiateSynergyEnvironmentUpdate(); + if (error == null) { + this.m_pendingRequests.add(synergyNetworkConnection); + return; + } + synergyNetworkConnection.errorPriorToSend((Exception)object2); + } + + @Override + public void setup() { + this.m_pendingRequests = new ArrayList(); + this.m_sessionId = this.generateSessionId(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyRequest.java b/app/src/main/java/com/ea/nimble/SynergyRequest.java new file mode 100644 index 0000000..2075556 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyRequest.java @@ -0,0 +1,121 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +public class SynergyRequest +implements ISynergyRequest { + public String api; + public String baseUrl; + public HttpRequest httpRequest; + public Map jsonData; + private SynergyNetworkConnection m_connection; + public SynergyRequestPreparingCallback prepareRequestCallback; + public Map urlParameters; + + public SynergyRequest(String string2, IHttpRequest.Method method, SynergyRequestPreparingCallback synergyRequestPreparingCallback) { + this.api = string2; + this.httpRequest = new HttpRequest(); + this.prepareRequestCallback = synergyRequestPreparingCallback; + this.urlParameters = null; + this.jsonData = null; + this.httpRequest.method = method; + this.httpRequest.headers.put("Content-Type", "application/json"); + this.httpRequest.headers.put("SDK-VERSION", "1.23.14.1217"); + this.httpRequest.headers.put("SDK-TYPE", "Nimble"); + this.httpRequest.headers.put("EAM-USER-ID", SynergyIdManager.getComponent().getSynergyId()); + this.httpRequest.headers.put("EA-SELL-ID", SynergyEnvironment.getComponent().getSellId()); + this.httpRequest.headers.put("EAM-SESSION", ((SynergyNetworkImpl)SynergyNetwork.getComponent()).getSessionId()); + } + + void build() throws Error { + if (!Utility.validString(this.baseUrl) || !Utility.validString(this.api)) { + throw new Error(Error.Code.INVALID_ARGUMENT, String.format("Invalid synergy request parameter (%s, %s) to build http request url", this.baseUrl, this.api)); + } + IApplicationEnvironment object = ApplicationEnvironment.getComponent(); + HashMap object2 = new HashMap(); + object2.put("appVer", object.getApplicationVersion()); + object2.put("appLang", object.getShortApplicationLanguageCode()); + object2.put("localization", object.getApplicationLanguageCode()); + object2.put("deviceLanguage", Locale.getDefault().getLanguage()); + object2.put("deviceLocale", Locale.getDefault().toString()); + String eaHardwareId = SynergyEnvironment.getComponent().getEAHardwareId(); + if (Utility.validString(eaHardwareId)) { + object2.put("hwId", eaHardwareId); + } + if (this.urlParameters != null) { + object2.putAll(this.urlParameters); + } + this.httpRequest.url = Network.generateURL(this.baseUrl + this.api, object2); + if (this.httpRequest.method != IHttpRequest.Method.POST) { + if (this.httpRequest.method != IHttpRequest.Method.PUT) return; + } + if (this.jsonData == null) return; + if (this.jsonData.size() <= 0) return; + String s = Utility.convertObjectToJSONString(this.jsonData); + this.httpRequest.data = new ByteArrayOutputStream(); + try { + this.httpRequest.data.write(s.getBytes()); + } + catch (IOException iOException) { + throw new Error(Error.Code.INVALID_ARGUMENT, "Error converting jsonData in SynergyRequest to a data stream", iOException); + } + } + + @Override + public String getApi() { + return this.api; + } + + @Override + public String getBaseUrl() { + return this.baseUrl; + } + + @Override + public HttpRequest getHttpRequest() { + return this.httpRequest; + } + + @Override + public Map getJsonData() { + return this.jsonData; + } + + public IHttpRequest.Method getMethod() { + return this.httpRequest.getMethod(); + } + + @Override + public Map getUrlParameters() { + return this.urlParameters; + } + + void prepare(SynergyNetworkConnection synergyNetworkConnection) { + this.m_connection = synergyNetworkConnection; + if (this.prepareRequestCallback != null) { + this.prepareRequestCallback.prepareRequest(this); + return; + } + this.send(); + } + + public void send() { + this.m_connection.send(); + } + + public void setMethod(IHttpRequest.Method method) { + this.httpRequest.method = method; + } + + public static interface SynergyRequestPreparingCallback { + public void prepareRequest(SynergyRequest var1); + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyResponse.java b/app/src/main/java/com/ea/nimble/SynergyResponse.java new file mode 100644 index 0000000..4b3c49c --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyResponse.java @@ -0,0 +1,72 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * org.json.JSONObject + */ +package com.ea.nimble; + +import com.ea.nimble.Error; +import com.ea.nimble.IHttpResponse; +import com.ea.nimble.ISynergyResponse; +import com.ea.nimble.SynergyServerError; +import com.ea.nimble.Utility; +import java.util.Map; +import org.json.JSONObject; + +public class SynergyResponse +implements ISynergyResponse { + public Error error = null; + public IHttpResponse httpResponse = null; + public Map jsonData = null; + + @Override + public Exception getError() { + if (this.error != null) return this.error; + if (this.httpResponse != null) return this.httpResponse.getError(); + return this.error; + } + + @Override + public IHttpResponse getHttpResponse() { + return this.httpResponse; + } + + @Override + public Map getJsonData() { + return this.jsonData; + } + + @Override + public boolean isCompleted() { + if (this.httpResponse != null) return this.httpResponse.isCompleted(); + return false; + } + + public void parseData() { + if (this.jsonData != null) { + return; + } + if (this.httpResponse != null && this.httpResponse.getError() == null) { + String string2 = ""; + try { + String string3; + string2 = string3 = Utility.readStringFromStream(this.httpResponse.getDataStream()); + this.jsonData = Utility.convertJSONObjectToMap(new JSONObject(string3)); + if (!this.jsonData.containsKey("resultCode")) return; + int n2 = (Integer)this.jsonData.get("resultCode"); + if (n2 >= 0) return; + this.error = new SynergyServerError(n2, (String)this.jsonData.get("message")); + return; + } + catch (Exception exception) { + this.jsonData = null; + this.error = new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Unparseable synergy json response " + string2); + return; + } + } + this.jsonData = null; + this.error = null; + } +} + diff --git a/app/src/main/java/com/ea/nimble/SynergyServerError.java b/app/src/main/java/com/ea/nimble/SynergyServerError.java new file mode 100644 index 0000000..b20e3a8 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/SynergyServerError.java @@ -0,0 +1,47 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble; + +import com.ea.nimble.Error; + +public class SynergyServerError +extends Error { + public static final String ERROR_DOMAIN = "SynergyServerError"; + private static final long serialVersionUID = 1L; + + public SynergyServerError() { + } + + public SynergyServerError(int n2, String string2) { + super(ERROR_DOMAIN, n2, string2, null); + } + + public SynergyServerError(int n2, String string2, Throwable throwable) { + super(ERROR_DOMAIN, n2, string2, throwable); + } + + public boolean isError(int n2) { + if (this.getCode() != n2) return false; + return true; + } + + public static enum Code { + ERROR_NONCE_VERIFICATION(-30013), + ERROR_SIGNATURE_VERIFICATION(-30014), + ERROR_NOT_SUPPORTED_RECEIPT_TYPE(-30015), + AMAZON_SERVER_CONNECTION_ERROR(-30016), + APPLE_SERVER_CONNECTION_ERROR(10001); + + private int m_value; + + private Code(int n3) { + this.m_value = n3; + } + + public int intValue() { + return this.m_value; + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/Timer.java b/app/src/main/java/com/ea/nimble/Timer.java new file mode 100644 index 0000000..fd555ec --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Timer.java @@ -0,0 +1,136 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.os.Handler + * android.os.Looper + * android.os.SystemClock + */ +package com.ea.nimble; + +import android.os.Handler; +import android.os.Looper; +import android.os.SystemClock; +import com.ea.nimble.Log; + +public class Timer { + private static Handler s_handler = new Handler(Looper.getMainLooper()); + private long m_fireTime; + private long m_pauseTime; + private boolean m_paused; + private boolean m_running; + private Runnable m_task; + private Runnable m_taskToRun; + private long m_timeInterval; + + public Timer(Runnable runnable) { + this.m_task = runnable; + this.m_running = false; + this.m_paused = false; + } + + static /* synthetic */ boolean access$102(Timer timer, boolean bl2) { + timer.m_running = bl2; + return bl2; + } + + static /* synthetic */ long access$302(Timer timer, long l2) { + timer.m_fireTime = l2; + return l2; + } + + public void cancel() { + if (!this.m_running) return; + if (!this.m_paused) { + s_handler.removeCallbacks(this.m_taskToRun); + } + this.m_running = false; + } + + public void fire() { + this.cancel(); + this.m_task.run(); + if (!(this.m_taskToRun instanceof RepeatingTask)) return; + if (this.m_paused) { + this.m_fireTime = this.m_pauseTime + this.m_timeInterval; + return; + } + this.m_fireTime = SystemClock.uptimeMillis() + this.m_timeInterval; + s_handler.postDelayed(this.m_taskToRun, this.m_timeInterval); + this.m_running = true; + } + + public boolean isPaused() { + return this.m_paused; + } + + public boolean isRunning() { + return this.m_running; + } + + public void pause() { + if (this.m_paused) return; + if (!this.m_running) return; + this.m_pauseTime = SystemClock.uptimeMillis(); + s_handler.removeCallbacks(this.m_taskToRun); + this.m_paused = true; + } + + public void resume() { + if (!this.m_paused) return; + if (!this.m_running) return; + this.m_fireTime += SystemClock.uptimeMillis() - this.m_pauseTime; + s_handler.postAtTime(this.m_taskToRun, this.m_fireTime); + this.m_paused = false; + } + + public void schedule(double d2, boolean bl2) { + this.cancel(); + if (d2 < 0.1) { + if (bl2) { + Log.Helper.LOGES(null, "Timer scheduled to repeat for %.2f seconds, running only once", d2); + } + if (Looper.myLooper() == Looper.getMainLooper()) { + this.m_task.run(); + return; + } + s_handler.post(this.m_task); + return; + } + this.m_timeInterval = (long)(1000.0 * d2); + this.m_fireTime = SystemClock.uptimeMillis() + this.m_timeInterval; + this.m_taskToRun = bl2 ? new RepeatingTask() : new SingleRunTask(); + s_handler.postDelayed(this.m_taskToRun, this.m_timeInterval); + this.m_running = true; + } + + private class RepeatingTask + implements Runnable { + private RepeatingTask() { + } + + @Override + public void run() { + if (Timer.this.m_paused) return; + if (!Timer.this.m_running) return; + Timer.this.m_task.run(); + Timer.access$302(Timer.this, SystemClock.uptimeMillis() + Timer.this.m_fireTime); + s_handler.postDelayed((Runnable)this, Timer.this.m_timeInterval); + } + } + + private class SingleRunTask + implements Runnable { + private SingleRunTask() { + } + + @Override + public void run() { + if (Timer.this.m_paused) return; + if (!Timer.this.m_running) return; + Timer.access$102(Timer.this, false); + Timer.this.m_task.run(); + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/Utility.java b/app/src/main/java/com/ea/nimble/Utility.java new file mode 100644 index 0000000..0a199a2 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/Utility.java @@ -0,0 +1,275 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + * android.content.IntentFilter + * android.support.v4.content.LocalBroadcastManager + * org.json.JSONArray + * org.json.JSONException + * org.json.JSONObject + */ +package com.ea.nimble; + +import android.content.BroadcastReceiver; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.res.XmlResourceParser; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import com.google.gson.GsonBuilder; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.io.StringWriter; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.TimeZone; + +public final class Utility { + private Utility() { + } + + public static String SHA256HashString(String object) { + MessageDigest object2; + if (object == null) { + return null; + } + try { + object2 = MessageDigest.getInstance("SHA-256"); + object2.reset(); + } + catch (NoSuchAlgorithmException noSuchAlgorithmException) { + Log.Helper.LOGES(null, "Can't find SHA-256 algorithm"); + return null; + } + byte[] digest = object2.digest(object.getBytes()); + StringBuffer stringBuffer = new StringBuffer(); + int n2 = 0; + + while (n2 < digest.length) { + stringBuffer.append(Integer.toString((digest[n2] & 0xFF) + 256, 16).substring(1)); + ++n2; + } + return stringBuffer.toString(); + } + + public static String bytesToHexString(byte[] byArray) { + char[] cArray = "0123456789ABCDEF".toCharArray(); + char[] cArray2 = new char[byArray.length * 2]; + int n2 = 0; + while (n2 < byArray.length) { + int n3 = byArray[n2] & 0xFF; + cArray2[n2 * 2] = cArray[n3 >> 4]; + cArray2[n2 * 2 + 1] = cArray[n3 & 0xF]; + ++n2; + } + return new String(cArray2); + } + + public static List convertJSONArrayToList(JSONArray jSONArray) { + ArrayList arrayList = new ArrayList<>(); + if (jSONArray != null) + for (int i=0;i convertJSONObjectStringToMap(String object) { + try { + return Utility.convertJSONObjectToMap(new JSONObject(object)); + } + catch (JSONException jSONException) { + jSONException.printStackTrace(); + return new HashMap(); + } + } + + public static Map convertJSONObjectToMap(JSONObject jSONObject) { + + Map map = new HashMap(); + Iterator keys = jSONObject.keys(); + while(keys.hasNext()) { + String key = keys.next(); + Object value = null; + try { + value = jSONObject.get(key); + } catch (JSONException e) { + e.printStackTrace(); + return null; + } + if (value instanceof JSONArray) { + value = convertJSONArrayToList((JSONArray) value); + } else if (value instanceof JSONObject) { + value = convertJSONObjectToMap((JSONObject) value); + } + map.put(key, value); + } return map; + } + + public static String convertObjectToJSONString(Object object) { + return new GsonBuilder().disableHtmlEscaping().create().toJson(object); + } + + public static boolean getTestResult() { + if (5 + 5 != 10) return false; + return true; + } + + public static String getUTCDateStringFormat(Date date) { + if (date == null) { + return ""; + } + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.US); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return simpleDateFormat.format(date); + } + + public static boolean isOnlyDecimalCharacters(String string2) { + if (string2 == null) { + return false; + } + int n2 = 0; + while (n2 < string2.length()) { + if (!Character.isDigit(string2.charAt(n2))) return false; + ++n2; + } + return true; + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled unnecessary exception pruning + */ + public static LinkedHashMap parseXmlFile(int i) { + XmlResourceParser xmlResourceParser = null; + LinkedHashMap linkedHashMap; + try { + xmlResourceParser = null; + XmlResourceParser xmlResourceParser2 = null; + try { + XmlResourceParser xml = ApplicationEnvironment.getComponent().getApplicationContext().getResources().getXml(i); + LinkedHashMap linkedHashMap2 = new LinkedHashMap(); + String str = null; + int eventType = xml.getEventType(); + while (eventType != 1) { + if (eventType == 2) { + str = xml.getName(); + } else { + str = str; + if (eventType == 4) { + linkedHashMap2.put(str, xml.getText()); + str = str; + } + } + eventType = xml.next(); + } + xmlResourceParser2 = xml; + xmlResourceParser = xml; + xml.close(); + linkedHashMap = linkedHashMap2; + xml.close(); + return linkedHashMap2; + } catch (Exception e) { + Log.Helper.LOGES(null, "Error reading xml file: " + e.toString()); + if (xmlResourceParser2 != null) { + xmlResourceParser2.close(); + } + linkedHashMap = null; + } + return linkedHashMap; + } catch (Throwable th) { + if (xmlResourceParser != null) { + xmlResourceParser.close(); + } + throw th; + } + } + + public static String readStringFromStream(InputStream closeable) throws IOException { + int n2; + byte[] cArray = new byte[8192]; + StringWriter stringWriter = new StringWriter(); + while ((n2 = closeable.read(cArray, 0, 4096)) > 0) { + stringWriter.write(Arrays.toString(cArray), 0, n2); + } + return stringWriter.toString(); + } + + public static void registerReceiver(String string2, BroadcastReceiver broadcastReceiver) { + IntentFilter intentFilter = new IntentFilter(string2); + LocalBroadcastManager + .getInstance( + ApplicationEnvironment + .getComponent() + .getApplicationContext() + ) + .registerReceiver(broadcastReceiver, intentFilter); + } + + public static String safeString(String string2) { + String string3 = string2; + if (string2 != null) return string3; + return ""; + } + + public static void sendBroadcast(String string2, Map map) { + LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()); + Intent intent = new Intent(string2); + if (map != null) { + for (String string3 : map.keySet()) { + intent.putExtra(string3, map.get(string3)); + } + } + localBroadcastManager.sendBroadcast(intent); + } + + public static void sendBroadcastSerializable(String string2, Map map) { + LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()); + Intent intent = new Intent(string2); + if (map != null) { + for (String string3 : map.keySet()) { + intent.putExtra(string3, map.get(string3)); + } + } + localBroadcastManager.sendBroadcast(intent); + } + + public static boolean stringsAreEquivalent(String string2, String string3) { + if (string2 != null && string3 != null) { + return string2.compareTo(string3) == 0; + } + if (string2 == string3) return true; + return false; + } + + public static void unregisterReceiver(BroadcastReceiver broadcastReceiver) { + LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()).unregisterReceiver(broadcastReceiver); + } + + public static boolean validString(String string2) { + if (string2 == null) return false; + if (string2.length() <= 0) return false; + return true; + } +} + diff --git a/app/src/main/java/com/ea/nimble/bridge/BaseNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/BaseNativeCallback.java new file mode 100644 index 0000000..bd712e7 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/bridge/BaseNativeCallback.java @@ -0,0 +1,69 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + * android.os.Bundle + */ +package com.ea.nimble.bridge; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.SynergyNetworkConnectionCallback; +import com.ea.nimble.SynergyNetworkConnectionHandle; +import com.ea.nimble.SynergyRequest; +import java.util.HashMap; +import java.util.Map; + +public class BaseNativeCallback +extends BroadcastReceiver +implements NetworkConnectionCallback, +SynergyNetworkConnectionCallback, +SynergyRequest.SynergyRequestPreparingCallback { + private int m_id; + + public BaseNativeCallback(int n2) { + this.m_id = n2; + } + + public static native void nativeCallback(int var0, Object ... var1); + + public static native void nativeFinalize(int var0); + + @Override + public void callback(NetworkConnectionHandle networkConnectionHandle) { + BaseNativeCallback.nativeCallback(this.m_id, networkConnectionHandle); + } + + @Override + public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + BaseNativeCallback.nativeCallback(this.m_id, synergyNetworkConnectionHandle); + } + + public void finalize() { + BaseNativeCallback.nativeFinalize(this.m_id); + } + + public void onReceive(Context object, Intent intent) { + Map hashMap = new HashMap<>(); + Bundle bundle = intent.getExtras(); + if (bundle != null) { + for (String string2 : bundle.keySet()) { + hashMap.put(string2, bundle.get(string2)); + } + } + BaseNativeCallback.nativeCallback(this.m_id, intent.getAction(), hashMap); + } + + @Override + public void prepareRequest(SynergyRequest synergyRequest) { + BaseNativeCallback.nativeCallback(this.m_id, synergyRequest); + } +} + diff --git a/app/src/main/java/com/ea/nimble/bridge/FacebookNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/FacebookNativeCallback.java new file mode 100644 index 0000000..85991fd --- /dev/null +++ b/app/src/main/java/com/ea/nimble/bridge/FacebookNativeCallback.java @@ -0,0 +1,26 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.bridge; + +import com.ea.nimble.IFacebook; +import com.ea.nimble.bridge.BaseNativeCallback; + +public class FacebookNativeCallback +implements IFacebook.FacebookCallback { + private int m_id; + + public FacebookNativeCallback(int n2) { + this.m_id = n2; + } + + @Override + public void callback(IFacebook iFacebook, boolean bl2, Exception exception) { + BaseNativeCallback.nativeCallback(this.m_id, iFacebook, bl2, exception); + } + + public void finalize() { + BaseNativeCallback.nativeFinalize(this.m_id); + } +} + diff --git a/app/src/main/java/com/ea/nimble/bridge/FriendsNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/FriendsNativeCallback.java new file mode 100644 index 0000000..98ca015 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/bridge/FriendsNativeCallback.java @@ -0,0 +1,45 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.bridge; + +import com.ea.nimble.Error; +import com.ea.nimble.friends.INimbleOriginFriendsService; +import com.ea.nimble.friends.NimbleFriendsList; +import com.ea.nimble.friends.NimbleFriendsRefreshCallback; +import com.ea.nimble.friends.NimbleFriendsRefreshResult; +import com.ea.nimble.friends.NimbleFriendsRefreshScope; +import com.ea.nimble.friends.NimbleUser; + +import java.util.ArrayList; + +public class FriendsNativeCallback +implements INimbleOriginFriendsService.NimbleFriendInvitationCallback, +INimbleOriginFriendsService.NimbleUserSearchCallback, +NimbleFriendsRefreshCallback { + private int m_id; + + public FriendsNativeCallback(int n2) { + this.m_id = n2; + } + + public void finalize() { + BaseNativeCallback.nativeFinalize(this.m_id); + } + + @Override + public void onCallback(NimbleFriendsList nimbleFriendsList, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshResult nimbleFriendsRefreshResult) { + BaseNativeCallback.nativeCallback(this.m_id, nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } + + @Override + public void onCallback(ArrayList arrayList, Error error) { + BaseNativeCallback.nativeCallback(this.m_id, arrayList, error); + } + + @Override + public void onCallback(boolean bl2, Error error) { + BaseNativeCallback.nativeCallback(this.m_id, bl2, error); + } +} + diff --git a/app/src/main/java/com/ea/nimble/bridge/IdentityGenericAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/bridge/IdentityGenericAuthenticationConductor.java new file mode 100644 index 0000000..3f6f10c --- /dev/null +++ b/app/src/main/java/com/ea/nimble/bridge/IdentityGenericAuthenticationConductor.java @@ -0,0 +1,33 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.bridge; + +import com.ea.nimble.bridge.BaseNativeCallback; +import com.ea.nimble.identity.INimbleIdentityGenericAuthenticationConductor; +import com.ea.nimble.identity.INimbleIdentityGenericLoginResolver; +import com.ea.nimble.identity.INimbleIdentityGenericLogoutResolver; + +public class IdentityGenericAuthenticationConductor +implements INimbleIdentityGenericAuthenticationConductor { + private int m_id; + + public IdentityGenericAuthenticationConductor(int n2) { + this.m_id = n2; + } + + public void finalize() { + BaseNativeCallback.nativeFinalize(this.m_id); + } + + @Override + public void handleLogin(INimbleIdentityGenericLoginResolver iNimbleIdentityGenericLoginResolver) { + BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityGenericLoginResolver); + } + + @Override + public void handleLogout(INimbleIdentityGenericLogoutResolver iNimbleIdentityGenericLogoutResolver) { + BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityGenericLogoutResolver, null); + } +} + diff --git a/app/src/main/java/com/ea/nimble/bridge/IdentityMigrationAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/bridge/IdentityMigrationAuthenticationConductor.java new file mode 100644 index 0000000..48c5f5c --- /dev/null +++ b/app/src/main/java/com/ea/nimble/bridge/IdentityMigrationAuthenticationConductor.java @@ -0,0 +1,38 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.bridge; + +import com.ea.nimble.bridge.BaseNativeCallback; +import com.ea.nimble.identity.INimbleIdentityMigrationAuthenticationConductor; +import com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver; +import com.ea.nimble.identity.INimbleIdentityPendingMigrationResolver; + +public class IdentityMigrationAuthenticationConductor +implements INimbleIdentityMigrationAuthenticationConductor { + private int m_id; + + public IdentityMigrationAuthenticationConductor(int n2) { + this.m_id = n2; + } + + public void finalize() { + BaseNativeCallback.nativeFinalize(this.m_id); + } + + @Override + public void handleLogin(INimbleIdentityMigrationLoginResolver iNimbleIdentityMigrationLoginResolver) { + BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityMigrationLoginResolver); + } + + @Override + public void handleLogout() { + BaseNativeCallback.nativeCallback(this.m_id, new Object[0]); + } + + @Override + public void handlePendingMigration(INimbleIdentityPendingMigrationResolver iNimbleIdentityPendingMigrationResolver) { + BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityPendingMigrationResolver, null); + } +} + diff --git a/app/src/main/java/com/ea/nimble/bridge/IdentityNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/IdentityNativeCallback.java new file mode 100644 index 0000000..ae21a25 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/bridge/IdentityNativeCallback.java @@ -0,0 +1,43 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * org.json.JSONObject + */ +package com.ea.nimble.bridge; + +import com.ea.nimble.Error; +import com.ea.nimble.bridge.BaseNativeCallback; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import org.json.JSONObject; + +public class IdentityNativeCallback +implements INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback, +INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback, +INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback { + private int m_id; + + public IdentityNativeCallback(int n2) { + this.m_id = n2; + } + + public void finalize() { + BaseNativeCallback.nativeFinalize(this.m_id); + } + + @Override + public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { + BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityAuthenticator, error); + } + + @Override + public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String string2, String string3, String string4, Error error) { + BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityAuthenticator, string2, string3, string4, error); + } + + @Override + public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, JSONObject jSONObject, Error error) { + BaseNativeCallback.nativeCallback(this.m_id, iNimbleIdentityAuthenticator, jSONObject, error); + } +} + diff --git a/app/src/main/java/com/ea/nimble/bridge/IdentityPlainAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/bridge/IdentityPlainAuthenticationConductor.java new file mode 100644 index 0000000..fe19984 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/bridge/IdentityPlainAuthenticationConductor.java @@ -0,0 +1,31 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.bridge; + +import com.ea.nimble.bridge.BaseNativeCallback; +import com.ea.nimble.identity.INimbleIdentityPlainAuthenticationConductor; + +public class IdentityPlainAuthenticationConductor +implements INimbleIdentityPlainAuthenticationConductor { + private int m_id; + + public IdentityPlainAuthenticationConductor(int n2) { + this.m_id = n2; + } + + public void finalize() { + BaseNativeCallback.nativeFinalize(this.m_id); + } + + @Override + public void handleLogin() { + BaseNativeCallback.nativeCallback(this.m_id, new Object[0]); + } + + @Override + public void handleLogout() { + BaseNativeCallback.nativeCallback(this.m_id, new Object[]{null}); + } +} + diff --git a/app/src/main/java/com/ea/nimble/bridge/MTXNativeCallback.java b/app/src/main/java/com/ea/nimble/bridge/MTXNativeCallback.java new file mode 100644 index 0000000..99515a0 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/bridge/MTXNativeCallback.java @@ -0,0 +1,44 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.bridge; + +import com.ea.nimble.bridge.BaseNativeCallback; +import com.ea.nimble.mtx.INimbleMTX; +import com.ea.nimble.mtx.NimbleMTXTransaction; + +public class MTXNativeCallback +implements INimbleMTX.FinalizeTransactionCallback, +INimbleMTX.ItemGrantedCallback, +INimbleMTX.PurchaseTransactionCallback { + private int m_id; + + public MTXNativeCallback(int n2) { + this.m_id = n2; + } + + public void finalize() { + BaseNativeCallback.nativeFinalize(this.m_id); + } + + @Override + public void finalizeComplete(NimbleMTXTransaction nimbleMTXTransaction) { + BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction); + } + + @Override + public void itemGrantedComplete(NimbleMTXTransaction nimbleMTXTransaction) { + BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction); + } + + @Override + public void purchaseComplete(NimbleMTXTransaction nimbleMTXTransaction) { + BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction, true); + } + + @Override + public void unverifiedReceiptReceived(NimbleMTXTransaction nimbleMTXTransaction) { + BaseNativeCallback.nativeCallback(this.m_id, nimbleMTXTransaction, false); + } +} + diff --git a/app/src/main/java/com/ea/nimble/friends/INimbleFriends.java b/app/src/main/java/com/ea/nimble/friends/INimbleFriends.java new file mode 100644 index 0000000..d1d5798 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/INimbleFriends.java @@ -0,0 +1,9 @@ +package com.ea.nimble.friends; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleFriends.class */ +public interface INimbleFriends { + public static final int IDENTITY_FRIEND_INFO_REQUEST_LIMIT = 20; + public static final String NIMBLE_NOTIFICATION_FRIENDS_LIST_UPDATE = "nimble.notification.friends.update"; + + NimbleFriendsList getFriendsList(String str, boolean z); +} diff --git a/app/src/main/java/com/ea/nimble/friends/INimbleOriginFriendsService.java b/app/src/main/java/com/ea/nimble/friends/INimbleOriginFriendsService.java new file mode 100644 index 0000000..6e19071 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/INimbleOriginFriendsService.java @@ -0,0 +1,36 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Error; +import java.util.ArrayList; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleOriginFriendsService.class */ +public interface INimbleOriginFriendsService { + + /* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleOriginFriendsService$NimbleFriendInvitationCallback.class */ + public interface NimbleFriendInvitationCallback { + void onCallback(boolean z, Error error); + } + + /* loaded from: stdlib.jar:com/ea/nimble/friends/INimbleOriginFriendsService$NimbleUserSearchCallback.class */ + public interface NimbleUserSearchCallback { + void onCallback(ArrayList arrayList, Error error); + } + + void acceptFriendInvitation(String str, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); + + void declineFriendInvitation(String str, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); + + void listFriendInvitationsReceived(NimbleUserSearchCallback nimbleUserSearchCallback); + + void listFriendInvitationsSent(NimbleUserSearchCallback nimbleUserSearchCallback); + + void searchUserByDisplayName(String str, NimbleUserSearchCallback nimbleUserSearchCallback); + + void searchUserByEmail(String str, NimbleUserSearchCallback nimbleUserSearchCallback); + + void sendFriendInvitation(String str, String str2, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); + + void sendInvitationOverEmail(ArrayList arrayList, String str, String str2, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); + + void sendInvitationOverSMS(ArrayList arrayList, String str, NimbleFriendInvitationCallback nimbleFriendInvitationCallback); +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java b/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java new file mode 100644 index 0000000..471b6e1 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFacebookUser.java @@ -0,0 +1,20 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Global; +import com.ea.nimble.friends.NimbleUser; +import com.google.android.gms.plus.PlusShare; +import java.util.Date; +import org.json.JSONObject; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFacebookUser.class */ +class NimbleFacebookUser extends NimbleUser { + /* JADX INFO: Access modifiers changed from: package-private */ + public NimbleFacebookUser(JSONObject jSONObject) { + this.authenticatorId = Global.NIMBLE_AUTHENTICATOR_FACEBOOK; + this.userId = jSONObject.optString("id"); + this.displayName = jSONObject.optString("name"); + this.imageUrl = jSONObject.optJSONObject("picture").optJSONObject("data").optString(PlusShare.KEY_CALL_TO_ACTION_URL); + this.refreshTimestamp = new Date(); + setPlayedCurrentGame(NimbleUser.PlayedCurrentGameFlag.PLAYED); + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriends.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriends.java new file mode 100644 index 0000000..221ebe1 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriends.java @@ -0,0 +1,12 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Base; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriends.class */ +public class NimbleFriends { + public static final String NIMBLE_COMPONENT_ID_FRIENDS = "com.ea.nimble.friends"; + + public static INimbleFriends getComponent() { + return (INimbleFriends) Base.getComponent(NIMBLE_COMPONENT_ID_FRIENDS); + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java new file mode 100644 index 0000000..c3da3ec --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsError.java @@ -0,0 +1,66 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Error; +import com.google.android.gms.games.GamesActivityResultCodes; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsError.class */ +public class NimbleFriendsError extends Error { + public static final String NIMBLE_FRIENDS_ERROR_DOMAIN = "NimbleFriendsError"; + private static final long serialVersionUID = 1; + + /* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsError$Code.class */ + public enum Code { + NIMBLE_FRIENDS_FACEBOOK_NOT_AVAILABLE(90000), + NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE(90001), + NIMBLE_FRIENDS_FACEBOOK_USER_NOT_LOGGED_IN(90002), + NIMBLE_FRIENDS_EMAIL_NOT_AVAILABLE(90003), + NIMBLE_FRIENDS_SMS_NOT_AVAILABLE(90004), + NIMBLE_FRIENDS_EMAIL_LAST_REQUEST_NOT_FINISHED(90005), + NIMBLE_FRIENDS_SMS_LAST_REQUEST_NOT_FINISHED(90006), + NIMBLE_FRIENDS_SMS_NOT_SENT_OUT(90007), + NIMBLE_FRIENDS_NO_TARGETS_PROVIDED(90008), + NIMBLE_FRIENDS_SERVER_RETURNED_ERROR(90009), + 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(10006), + NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE(10007), + NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY(10008), + NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED(10009), + NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED(10010), + NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN(10011), + NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST(10012), + NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST(10012), + NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE(10013), + NIMBLE_FRIENDS_REFRESH_SCOPE_EMPTY_HTTP_RESPONSE(10014), + 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_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR(10018), + NIMBLE_FRIENDS_UNKNOWN_ERROR(0); + + private int m_value; + + Code(int i) { + this.m_value = i; + } + + public int intValue() { + return this.m_value; + } + } + + public NimbleFriendsError(int i, String str) { + super(NIMBLE_FRIENDS_ERROR_DOMAIN, i, str, null); + } + + public NimbleFriendsError(int i, String str, Throwable th) { + super(NIMBLE_FRIENDS_ERROR_DOMAIN, i, str, th); + } + + public NimbleFriendsError(Code code, String str) { + super(NIMBLE_FRIENDS_ERROR_DOMAIN, code.intValue(), str, null); + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsImpl.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsImpl.java new file mode 100644 index 0000000..a701165 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsImpl.java @@ -0,0 +1,105 @@ +package com.ea.nimble.friends; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import com.ea.nimble.Base; +import com.ea.nimble.Component; +import com.ea.nimble.Global; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Utility; +import com.ea.nimble.identity.INimbleIdentity; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import java.util.Hashtable; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsImpl.class */ +public class NimbleFriendsImpl extends Component implements LogSource, INimbleFriends { + private Hashtable m_friends = new Hashtable<>(); + private BroadcastReceiver m_authenticatorLoginChangeReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.friends.NimbleFriendsImpl.1 + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + INimbleIdentityAuthenticator authenticatorById; + if (intent != null && intent.getExtras() != null && intent.getAction() != null && intent.getAction().equalsIgnoreCase(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE)) { + String string = intent.getExtras().getString(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID); + if (Utility.validString(string) && (authenticatorById = ((INimbleIdentity) Base.getComponent("com.ea.nimble.identity")).getAuthenticatorById(string)) != null) { + if (authenticatorById.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (NimbleFriendsImpl.this.m_friends.get(string) != null) { + return; + } + if (Global.NIMBLE_AUTHENTICATOR_FACEBOOK == string) { + NimbleFriendsImpl.this.m_friends.put(string, new NimbleFriendsListFacebook()); + } else if (Global.NIMBLE_AUTHENTICATOR_ORIGIN == string) { + NimbleFriendsImpl.this.m_friends.put(string, new NimbleFriendsListOrigin()); + } + } else if (NimbleFriendsImpl.this.m_friends.get(string) != null) { + ((NimbleFriendsListImpl) NimbleFriendsImpl.this.m_friends.get(string)).clear(); + NimbleFriendsImpl.this.m_friends.remove(string); + } + } + } + } + }; + + private static void initialize() { + Base.registerComponent(new NimbleFriendsImpl(), NimbleFriends.NIMBLE_COMPONENT_ID_FRIENDS); + } + + @Override // com.ea.nimble.Component + public void cleanup() { + Log.Helper.LOGV(this, "Component cleanup", new Object[0]); + try { + Utility.unregisterReceiver(this.m_authenticatorLoginChangeReceiver); + } catch (Exception e) { + } + } + + @Override // com.ea.nimble.Component + public String getComponentId() { + return NimbleFriends.NIMBLE_COMPONENT_ID_FRIENDS; + } + + @Override // com.ea.nimble.friends.INimbleFriends + public NimbleFriendsList getFriendsList(String str, boolean z) { + NimbleFriendsList friendsList; + synchronized (this) { + friendsList = this.m_friends.get(str) != null ? this.m_friends.get(str).getFriendsList(z) : null; + } + return friendsList; + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "NimbleFriendsService"; + } + + @Override // com.ea.nimble.Component + public void restore() { + Log.Helper.LOGV(this, "Component restore", new Object[0]); + } + + @Override // com.ea.nimble.Component + public void resume() { + Log.Helper.LOGV(this, "Component resume", new Object[0]); + } + + @Override // com.ea.nimble.Component + public void setup() { + Log.Helper.LOGD(this, "Component setup", new Object[0]); + try { + Utility.registerReceiver(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE, this.m_authenticatorLoginChangeReceiver); + } catch (Exception e) { + } + } + + @Override // com.ea.nimble.Component + public void suspend() { + Log.Helper.LOGV(this, "Component suspend", new Object[0]); + } + + /* JADX INFO: Access modifiers changed from: protected */ + @Override // com.ea.nimble.Component + public void teardown() { + Log.Helper.LOGV(this, "Component teardown", new Object[0]); + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsList.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsList.java new file mode 100644 index 0000000..26a554c --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsList.java @@ -0,0 +1,65 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.friends.NimbleFriendsError; +import java.util.ArrayList; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsList.class */ +public class NimbleFriendsList { + private NimbleFriendsListImpl m_friendsListImpl; + private FriendsListType m_type; + + /* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsList$FriendsListType.class */ + public enum FriendsListType { + ALL_FRIENDS, + CURRENT_GAME_FRIENDS + } + + public NimbleFriendsList(NimbleFriendsListImpl nimbleFriendsListImpl, FriendsListType friendsListType) { + this.m_friendsListImpl = nimbleFriendsListImpl; + this.m_type = friendsListType; + } + + public NimbleUser getFriendProfile(String str) { + if (this.m_friendsListImpl != null) { + return this.m_friendsListImpl.m_friends.get(str); + } + return null; + } + + public ArrayList getFriends() { + if (this.m_friendsListImpl != null) { + return this.m_type == FriendsListType.CURRENT_GAME_FRIENDS ? this.m_friendsListImpl.m_playedFriendsList : this.m_friendsListImpl.m_friendsList; + } + return null; + } + + public int getRefreshPageSize() { + if (this.m_friendsListImpl != null) { + return this.m_friendsListImpl.getPageSize(); + } + return -1; + } + + public int getTotalFriendCount() { + return this.m_type == FriendsListType.CURRENT_GAME_FRIENDS ? this.m_friendsListImpl.m_totalPlayedFriends : this.m_friendsListImpl.m_totalFriends; + } + + FriendsListType getType() { + return this.m_type; + } + + public void refreshFriendsList(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) { + synchronized (this) { + if (this.m_friendsListImpl != null) { + this.m_friendsListImpl.refreshFriendsList(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, this.m_type); + } else if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsError nimbleFriendsError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_PROVIDER_NOT_AVAILABLE, "Specified Friends provider is not available. Failed to refresh Friends list."); + NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); + nimbleFriendsRefreshResult.m_error = nimbleFriendsError; + nimbleFriendsRefreshResult.m_success = false; + nimbleFriendsRefreshResult.m_userList = null; + nimbleFriendsRefreshCallback.onCallback(null, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } + } + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListFacebook.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListFacebook.java new file mode 100644 index 0000000..31a1831 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListFacebook.java @@ -0,0 +1,99 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Base; +import com.ea.nimble.Error; +import com.ea.nimble.Global; +import com.ea.nimble.IFacebook; +import com.ea.nimble.Log; +import com.ea.nimble.friends.NimbleFriendsError; +import com.ea.nimble.friends.NimbleFriendsList; +import java.util.List; +import org.json.JSONArray; +import org.json.JSONObject; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsListFacebook.class */ +public class NimbleFriendsListFacebook extends NimbleFriendsListImpl { + private static final String FACEBOOK_COMPONENT_ID = "com.ea.nimble.facebook"; + + /* JADX INFO: Access modifiers changed from: package-private */ + public NimbleFriendsListFacebook() { + this.LOG_SOURCE_TITLE = "NimbleFriendsListFacebook"; + this.m_authenticatorId = Global.NIMBLE_AUTHENTICATOR_FACEBOOK; + Log.Helper.LOGV(this, "Constructed", new Object[0]); + this.m_pageSize = 1000; + this.m_nimbleFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.ALL_FRIENDS); + this.m_nimblePlayedFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS); + } + + @Override // com.ea.nimble.friends.NimbleFriendsListImpl + protected NimbleUser createNimbleUser(JSONObject jSONObject) { + return new NimbleFacebookUser(jSONObject); + } + + @Override // com.ea.nimble.friends.NimbleFriendsListImpl, com.ea.nimble.LogSource + public /* bridge */ /* synthetic */ String getLogSourceTitle() { + return super.getLogSourceTitle(); + } + + @Override // com.ea.nimble.friends.NimbleFriendsListImpl + protected void refreshFriendsListBasicInfo(final int i, final int i2, String str, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + Log.Helper.LOGE(this, "Facebook no longer supports getting friends with ALL_FRIENDS flag", new Object[0]); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FRIENDS_LIST_TYPE_UNSUPPORTED, "Facebook no longer supports getting friends with ALL_FRIENDS flag", friendsListType); + } else if (!isNimbleComponentAvailable("com.ea.nimble.facebook") || !((IFacebook) Base.getComponent("com.ea.nimble.facebook")).hasOpenSession()) { + Log.Helper.LOGE(this, "Unable to refresh friends from Facebook because NimbleFacebook is either unavailable or the session is not open", new Object[0]); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FACEBOOK_USER_NOT_LOGGED_IN, "Unable to refresh friends from Facebook because NimbleFacebook is either unavailable or the session is not open", friendsListType); + } else { + ((IFacebook) Base.getComponent("com.ea.nimble.facebook")).retrieveFriends(i, i2, new IFacebook.FacebookFriendsCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListFacebook.1 + @Override // com.ea.nimble.IFacebook.FacebookFriendsCallback + public void callback(IFacebook iFacebook, JSONArray jSONArray, Error error) { + if (error != null) { + Log.Helper.LOGE(this, String.format("Error in retrieving friends list from Facebook. Error :%s", error.toString()), new Object[0]); + if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); + nimbleFriendsRangeRefreshResult.m_success = false; + nimbleFriendsRangeRefreshResult.m_error = error; + nimbleFriendsRangeRefreshResult.m_userList = null; + nimbleFriendsRangeRefreshResult.m_startIndex = i; + nimbleFriendsRangeRefreshResult.m_size = i2; + nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; + if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { + nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + } else { + nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + } + } + } else { + if (jSONArray == null || jSONArray.length() <= 0) { + Log.Helper.LOGD(NimbleFriendsListFacebook.this, "No friends retrieved from Facebook even though the operation was successful", new Object[0]); + if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult2 = new NimbleFriendsRangeRefreshResult(); + nimbleFriendsRangeRefreshResult2.m_success = true; + nimbleFriendsRangeRefreshResult2.m_error = null; + nimbleFriendsRangeRefreshResult2.m_userList = null; + nimbleFriendsRangeRefreshResult2.m_startIndex = i; + nimbleFriendsRangeRefreshResult2.m_size = i2; + nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = false; + if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { + nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); + return; + } else { + nimbleFriendsRefreshCallback.onCallback(NimbleFriendsListFacebook.this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); + return; + } + } + } + Log.Helper.LOGD(this, "Successfully retrieved friends for specified scope from Facebook. Proceeding with NimbleFriendList update", new Object[0]); + NimbleFriendsListFacebook.this.updateFriendsListBasicInfo(jSONArray, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); + } + } + }); + } + } + + @Override // com.ea.nimble.friends.NimbleFriendsListImpl + protected void refreshFriendsListImageUrl(List list, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { + Log.Helper.LOGI(this, "Facebook Friends Service does not support ImageUri refresh because Facebook friends already have Image URI information", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_TYPE_UNSUPPORTED, "Facebook Friends Service does not support ImageUri refresh because Facebook friends already have Image URI information", friendsListType); + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListImpl.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListImpl.java new file mode 100644 index 0000000..a7e1fac --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListImpl.java @@ -0,0 +1,635 @@ +package com.ea.nimble.friends; + +import android.annotation.SuppressLint; + +import com.ea.nimble.Base; +import com.ea.nimble.Error; +import com.ea.nimble.Global; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Network; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.Utility; +import com.ea.nimble.identity.INimbleIdentity; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; + +import org.json.JSONArray; +import org.json.JSONObject; + +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.List; + +@SuppressLint({"DefaultLocale"}) +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsListImpl.class */ +public abstract class NimbleFriendsListImpl implements LogSource { + protected NimbleFriendsList m_nimbleFriendsList; + protected NimbleFriendsList m_nimblePlayedFriendsList; + protected Hashtable m_friends = new Hashtable<>(); + protected ArrayList m_friendsList = new ArrayList<>(); + protected ArrayList m_playedFriendsList = new ArrayList<>(); + protected int m_totalFriends = -1; + protected int m_totalPlayedFriends = -1; + protected String LOG_SOURCE_TITLE = "NimbleFriendsListImpl"; + protected int m_pageSize = 100; + protected String m_authenticatorId = ""; + + public NimbleFriendsListImpl() { + Log.Helper.LOGV(this, "No default implementation for NimbleFriendsListImpl - Must construct a typed-NimbleFriendsListImpl", new Object[0]); + } + + private Error environmentCheck() { + Log.Helper.LOGV(this, "Environment Check -->", new Object[0]); + if (Network.getComponent().getStatus() != Network.Status.OK) { + Log.Helper.LOGD(this, "Environment Check - Network unavailable", new Object[0]); + return new Error(Error.Code.NETWORK_NO_CONNECTION, "Friends component cannot do updates without network"); + } else if (SynergyEnvironment.getComponent().isDataAvailable()) { + return null; + } else { + Log.Helper.LOGD(this, "Environment Check - Synergy Environment Not Ready", new Object[0]); + return new Error(Error.Code.SYNERGY_GET_DIRECTION_TIMEOUT, "Friends component is still in initialization and not ready for operation"); + } + } + + public void clear() { + synchronized (this) { + if (this.m_friends != null) { + this.m_friends.clear(); + } + if (this.m_friendsList != null) { + this.m_friendsList.clear(); + } + if (this.m_playedFriendsList != null) { + this.m_playedFriendsList.clear(); + } + this.m_totalFriends = -1; + this.m_totalPlayedFriends = -1; + } + } + + protected abstract NimbleUser createNimbleUser(JSONObject jSONObject); + + public NimbleFriendsList getFriendsList(boolean z) { + synchronized (this) { + if (z) { + Log.Helper.LOGV(this, "Returning NimbleFriendsList with playedCurrentGameOnly flag returned", new Object[0]); + return this.m_nimblePlayedFriendsList; + } + Log.Helper.LOGV(this, "Returning NimbleFriendsList with all friends", new Object[0]); + return this.m_nimbleFriendsList; + } + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return this.LOG_SOURCE_TITLE; + } + + public int getPageSize() { + return this.m_pageSize; + } + + void invokeCallbackWithBasicScopeError(NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, Error error, NimbleFriendsList.FriendsListType friendsListType) { + if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); + nimbleFriendsRangeRefreshResult.m_success = false; + nimbleFriendsRangeRefreshResult.m_error = error; + nimbleFriendsRangeRefreshResult.m_userList = null; + nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); + nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange(); + nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + return; + } + nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + } + } + + void invokeCallbackWithBasicScopeError(NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsError.Code code, String str, NimbleFriendsList.FriendsListType friendsListType) { + if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsError nimbleFriendsError = new NimbleFriendsError(code, str); + NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); + nimbleFriendsRangeRefreshResult.m_success = false; + nimbleFriendsRangeRefreshResult.m_error = nimbleFriendsError; + nimbleFriendsRangeRefreshResult.m_userList = null; + nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); + nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange(); + nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + return; + } + nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + } + } + + void invokeCallbackWithScopeError(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, Error error, NimbleFriendsList.FriendsListType friendsListType) { + if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); + nimbleFriendsRefreshResult.m_success = false; + nimbleFriendsRefreshResult.m_error = error; + nimbleFriendsRefreshResult.m_userList = null; + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } else { + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } + } + } + + void invokeCallbackWithScopeError(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsError.Code code, String str, NimbleFriendsList.FriendsListType friendsListType) { + if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsError nimbleFriendsError = new NimbleFriendsError(code, str); + NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); + nimbleFriendsRefreshResult.m_success = false; + nimbleFriendsRefreshResult.m_error = nimbleFriendsError; + nimbleFriendsRefreshResult.m_userList = null; + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } else { + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } + } + } + + protected boolean isNimbleComponentAvailable(String str) { + boolean z = false; + if (Base.getComponent(str) != null) { + z = true; + } + return z; + } + + @SuppressLint({"DefaultLocale"}) + public void refreshFriendsList(NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsList.FriendsListType friendsListType) { + int i; + Object obj; + String str; + int i2; + String str2; + Log.Helper.LOGV(this, "refreshFriendsList API called", new Object[0]); + Error environmentCheck = environmentCheck(); + if (environmentCheck == null) { + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + Log.Helper.LOGV(this, "Refresh API called for All Friends List", new Object[0]); + i = 0; + obj = "ALL_FRIENDS"; + if (this.m_friendsList != null) { + i = 0; + obj = "ALL_FRIENDS"; + if (this.m_friendsList.size() > 0) { + i = this.m_friendsList.size() - 1; + obj = "ALL_FRIENDS"; + } + } + } else { + Log.Helper.LOGV(this, "Refresh API called for Played Current Game Friends List", new Object[0]); + i = 0; + obj = "CURRENT_GAME_FRIENDS"; + if (this.m_playedFriendsList != null) { + i = 0; + obj = "CURRENT_GAME_FRIENDS"; + if (this.m_playedFriendsList.size() > 0) { + i = this.m_playedFriendsList.size() - 1; + obj = "CURRENT_GAME_FRIENDS"; + } + } + } + if (nimbleFriendsRefreshScope == null) { + Log.Helper.LOGW(this, "NimbleFriendsRefreshScope is null. Unable to process the request", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID, "NimbleFriendsRefreshScope is null. Unable to process the request", friendsListType); + } else if (nimbleFriendsRefreshScope instanceof NimbleFriendsRefreshBasicInfo) { + NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo = (NimbleFriendsRefreshBasicInfo) nimbleFriendsRefreshScope; + int startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); + int range = nimbleFriendsRefreshBasicInfo.getRange(); + if (nimbleFriendsRefreshBasicInfo.getNextPage()) { + Log.Helper.LOGV(this, "Refresh API is called to get the next page of friends", new Object[0]); + int i3 = this.m_pageSize; + if (friendsListType != NimbleFriendsList.FriendsListType.ALL_FRIENDS || this.m_friendsList == null || this.m_friendsList.size() <= 0) { + i2 = 0; + str2 = ""; + if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { + i2 = 0; + str2 = ""; + if (this.m_playedFriendsList != null) { + i2 = 0; + str2 = ""; + if (this.m_playedFriendsList.size() > 0) { + str2 = this.m_playedFriendsList.get(i); + i2 = i; + } + } + } + } else { + str2 = this.m_friendsList.get(i); + i2 = i; + } + Log.Helper.LOGD(this, String.format("Refreshing next page for Type = %s, Start Index = %d, Range = %d, Last UID: %s", obj, Integer.valueOf(i2), Integer.valueOf(i3), str2), new Object[0]); + refreshFriendsListBasicInfo(i2, i3, str2, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); + } else if (startIndex <= 0) { + Log.Helper.LOGD(this, String.format("Start Index is less than or equal to 0 - get friends from 0 to page size for Type = %s", obj), new Object[0]); + refreshFriendsListBasicInfo(0, this.m_pageSize, "", friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); + } else if (range > this.m_pageSize || range <= 0) { + String format = String.format("Range (%d) either exceeds Page Size (%d) or is less than 1. Unable to process this request.", Integer.valueOf(range), Integer.valueOf(this.m_pageSize)); + Log.Helper.LOGW(this, format, new Object[0]); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, format, friendsListType); + } else if (startIndex - i >= 1) { + String format2 = String.format("Start Index (%d) higher than currentsize (%d). Unable to process this request.", Integer.valueOf(startIndex), Integer.valueOf(i)); + Log.Helper.LOGW(this, format2, new Object[0]); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID_START_INDEX, format2, friendsListType); + } else if (startIndex + range > i + 1) { + String format3 = String.format("Range (%d) exceeds Available Size (%d). Unable to process this request.", Integer.valueOf(range), Integer.valueOf(i)); + Log.Helper.LOGW(this, format3, new Object[0]); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, format3, friendsListType); + } else if (startIndex > 0) { + if (friendsListType != NimbleFriendsList.FriendsListType.ALL_FRIENDS || this.m_friendsList == null || this.m_friendsList.size() <= 0 || startIndex >= this.m_friendsList.size()) { + str = ""; + if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { + str = ""; + if (this.m_playedFriendsList != null) { + str = ""; + if (this.m_playedFriendsList.size() > 0) { + str = ""; + if (startIndex < this.m_playedFriendsList.size()) { + str = this.m_playedFriendsList.get(startIndex - 1); + } + } + } + } + } else { + str = this.m_friendsList.get(startIndex - 1); + } + if (str.length() > 0) { + Log.Helper.LOGD(this, String.format("Refreshing friends by range for Type = %s, Start Index = %d, Range = %d, Last UID = %s", obj, Integer.valueOf(startIndex), Integer.valueOf(range), str), new Object[0]); + refreshFriendsListBasicInfo(startIndex, range, str, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); + return; + } + String format4 = String.format("Unable to process refresh request because we are unable to retrieve the last UID before start index %d.", Integer.valueOf(startIndex)); + Log.Helper.LOGW(this, format4, new Object[0]); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_INVALID, format4, friendsListType); + } else { + Log.Helper.LOGD(this, String.format("Refreshing friends by range for Type = %s, Range = %d with starting index at 0 and no last UID", obj, Integer.valueOf(range)), new Object[0]); + refreshFriendsListBasicInfo(0, range, "", friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshBasicInfo); + } + } else if (nimbleFriendsRefreshScope instanceof NimbleFriendsRefreshIdentityInfo) { + ArrayList targetedFriendIds = ((NimbleFriendsRefreshIdentityInfo) nimbleFriendsRefreshScope).getTargetedFriendIds(); + if (targetedFriendIds == null || targetedFriendIds.size() <= 0) { + Log.Helper.LOGW(this, "No user IDs provided for NimbleFriendsRefreshIdentityInfo scope. Unable to process request", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST, "No user IDs provided for NimbleFriendsRefreshIdentityInfo scope. Unable to process request", friendsListType); + } else if (targetedFriendIds.size() > 20 || targetedFriendIds.size() > i + 1) { + Log.Helper.LOGW(this, "Number of user IDs provided for NimbleFriendsRefreshIdentityInfo exceeds allowed limits. Unable to process request", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, "Number of user IDs provided for NimbleFriendsRefreshIdentityInfo exceeds allowed limits. Unable to process request", friendsListType); + } else { + Log.Helper.LOGD(this, "Refreshing identity info of %d friends of type %s", Integer.valueOf(targetedFriendIds.size()), obj); + refreshFriendsListIdentityInfo(targetedFriendIds, friendsListType, nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback); + } + } else if (nimbleFriendsRefreshScope instanceof NimbleFriendsRefreshImageUrl) { + ArrayList targetedFriendIds2 = ((NimbleFriendsRefreshImageUrl) nimbleFriendsRefreshScope).getTargetedFriendIds(); + if (targetedFriendIds2 == null || targetedFriendIds2.size() <= 0) { + Log.Helper.LOGW(this, "No user IDs provided for NimbleFriendsRefreshImageUrl scope. Unable to process request", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_NO_USER_IDS_LIST, "No user IDs provided for NimbleFriendsRefreshImageUrl scope. Unable to process request", friendsListType); + } else if (targetedFriendIds2.size() > i + 1 || targetedFriendIds2.size() > 20) { + Log.Helper.LOGW(this, "Number of user IDs provided for NimbleFriendsRefreshImageUrl is more than the page size. Unable to process request", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_RANGE_EXCEED_LIMIT, "Number of user IDs provided for NimbleFriendsRefreshImageUrl is more than the page size. Unable to process request", friendsListType); + } else { + Log.Helper.LOGD(this, "Refreshing image url of %d friends of type %s", Integer.valueOf(targetedFriendIds2.size()), obj); + refreshFriendsListImageUrl(targetedFriendIds2, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshScope); + } + } + } else if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); + nimbleFriendsRefreshResult.m_error = environmentCheck; + nimbleFriendsRefreshResult.m_success = false; + nimbleFriendsRefreshResult.m_userList = null; + nimbleFriendsRefreshCallback.onCallback(null, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } + } + + protected abstract void refreshFriendsListBasicInfo(int i, int i2, String str, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo); + + protected void refreshFriendsListIdentityInfo(ArrayList arrayList, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshScope nimbleFriendsRefreshScope, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) { + Log.Helper.LOGD(this, "Preparing to make the call to C&I to get the pid info", new Object[0]); + if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { + Log.Helper.LOGE(this, "Unable to refresh friends Identity information because NimbleIdentity is not available", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to refresh friends Identity information because NimbleIdentity is not available", friendsListType); + return; + } + try { + INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); + if (iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + String format = String.format("Authenticator (%s) is not logged in or is unavailable", this.m_authenticatorId); + Log.Helper.LOGE(this, format, new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, format, friendsListType); + return; + } + iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestIdentityForFriends(arrayList, new INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback() { // from class: com.ea.nimble.friends.NimbleFriendsListImpl.1 + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback + public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, JSONObject jSONObject, Error error) { + if (error != null) { + Log.Helper.LOGE(this, "Server error when retrieving Pid Info. Error: " + error.toString(), new Object[0]); + NimbleFriendsListImpl.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_ERROR, error.toString(), friendsListType); + return; + } + Log.Helper.LOGD(this, "No errors when retrieving Pid Info response from C&I server", new Object[0]); + ArrayList parseJSONObjectToArrayOfUserInfo = NimbleFriendsUtility.parseJSONObjectToArrayOfUserInfo(jSONObject); + if (parseJSONObjectToArrayOfUserInfo == null || parseJSONObjectToArrayOfUserInfo.size() == 0) { + Log.Helper.LOGW(this, "Response for Pid Info request is empty. No Pids were updated for this request. It is probably because the selected friends do not have any Pids associated with them", new Object[0]); + NimbleFriendsListImpl.this.invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE, "Response for Pid Info request is empty. No Pids were updated for this request. It is probably because the selected friends do not have any Pids associated with them", friendsListType); + return; + } + Log.Helper.LOGD(this, "Successfully retrieved non-empty updated pid info from Identity server.", new Object[0]); + NimbleFriendsListImpl.this.updateFriendsListIdentityInfo(parseJSONObjectToArrayOfUserInfo, friendsListType, nimbleFriendsRefreshCallback, nimbleFriendsRefreshScope); + } + }); + } catch (Exception e) { + String format2 = String.format("Authenticator (%s) does not support Identity Refresh for Friends List", this.m_authenticatorId); + Log.Helper.LOGE(this, format2, new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED, format2, friendsListType); + } + } + + protected abstract void refreshFriendsListImageUrl(List list, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope); + + protected void sendUpdateNotification() { + HashMap hashMap = new HashMap(); + if (Base.getComponent("com.ea.nimble.identity") != null) { + hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, this.m_authenticatorId); + } else { + hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, this.m_authenticatorId); + } + Utility.sendBroadcast(INimbleFriends.NIMBLE_NOTIFICATION_FRIENDS_LIST_UPDATE, hashMap); + } + + protected void d(ArrayList arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { + boolean z; + synchronized (this) { + ArrayList arrayList2 = new ArrayList<>(); + if (this.m_friends == null || this.m_friends.size() <= 0) { + Log.Helper.LOGE(this, "Current Friends list is empty. Unable to process the PID update", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY, "Current Friends list is empty. Unable to process the PID update", friendsListType); + } else if (arrayList == null || arrayList.size() <= 0) { + Log.Helper.LOGE(this, "Updated users array for Avatar info is empty", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE, "Updated users array for Avatar info is empty", friendsListType); + } else { + for (int i = 0; i < arrayList.size(); i++) { + NimbleUser nimbleUser = this.m_friends.get(arrayList.get(i).getUserId()); + String imageUrl = arrayList.get(i).getImageUrl(); + if (nimbleUser != null) { + String imageUrl2 = nimbleUser.getImageUrl(); + if (!Utility.validString(imageUrl2) && Utility.validString(imageUrl)) { + z = true; + } else if (!Utility.validString(imageUrl2) || Utility.validString(imageUrl)) { + z = false; + if (Utility.validString(imageUrl2)) { + z = false; + if (Utility.validString(imageUrl)) { + z = false; + if (!imageUrl2.equalsIgnoreCase(imageUrl)) { + z = true; + } + } + } + } else { + z = true; + } + if (z) { + NimbleUser nimbleUser2 = new NimbleUser(nimbleUser); + nimbleUser2.setImageUrl(imageUrl); + this.m_friends.put(nimbleUser2.getUserId(), nimbleUser2); + arrayList2.add(nimbleUser2); + } + } + } + if (arrayList2.size() == 0) { + Log.Helper.LOGD(this, "No Avatar Info updates were made to the Friends List", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED, "No Avatar Info updates were made to the Friends List", friendsListType); + } else { + Log.Helper.LOGD(this, String.format("%d Friends were updated for Avatar Info", Integer.valueOf(arrayList2.size())), new Object[0]); + sendUpdateNotification(); + if (nimbleFriendsRefreshCallback != null) { + Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]); + NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); + nimbleFriendsRefreshResult.m_success = true; + nimbleFriendsRefreshResult.m_error = null; + nimbleFriendsRefreshResult.m_userList = arrayList2; + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } else { + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } + } + } + } + } + } + + protected void updateFriendsListBasicInfo(ArrayList arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { + synchronized (this) { + ArrayList arrayList2 = new ArrayList<>(); + if (arrayList == null || arrayList.size() <= 0) { + Log.Helper.LOGD(this, "Even though the retrieval of Friends list was successful, the retrieved Friend list is empty", new Object[0]); + if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); + nimbleFriendsRangeRefreshResult.m_success = true; + nimbleFriendsRangeRefreshResult.m_error = null; + nimbleFriendsRangeRefreshResult.m_userList = null; + nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); + nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange(); + nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + } else { + nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + } + } + } else { + Log.Helper.LOGV(this, "Retrieved " + arrayList.size() + "friends.", new Object[0]); + for (int i = 0; i < arrayList.size(); i++) { + if (arrayList.get(i) != null) { + updateInternalCache(arrayList.get(i), friendsListType, arrayList2); + } + } + if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { + this.m_totalPlayedFriends = this.m_playedFriendsList.size(); + } else { + this.m_totalFriends = this.m_friendsList.size(); + } + if (nimbleFriendsRefreshCallback != null) { + Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]); + NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult2 = new NimbleFriendsRangeRefreshResult(); + nimbleFriendsRangeRefreshResult2.m_success = true; + nimbleFriendsRangeRefreshResult2.m_error = null; + nimbleFriendsRangeRefreshResult2.m_userList = arrayList2; + nimbleFriendsRangeRefreshResult2.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); + nimbleFriendsRangeRefreshResult2.m_size = nimbleFriendsRefreshBasicInfo.getRange(); + if (arrayList2.size() > 0) { + nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = true; + } else { + nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = false; + } + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); + } else { + nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalPlayedFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); + } + } + Log.Helper.LOGD(this, "Friends list was upodated, send the update notification", new Object[0]); + sendUpdateNotification(); + } + } + } + + protected void updateFriendsListBasicInfo(JSONArray jSONArray, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { + synchronized (this) { + ArrayList arrayList = new ArrayList<>(); + if (jSONArray == null || jSONArray.length() <= 0) { + Log.Helper.LOGD(this, "Even though the retrieval of Friends list was successful, the retrieved Friend list is empty", new Object[0]); + if (nimbleFriendsRefreshCallback != null) { + NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult = new NimbleFriendsRangeRefreshResult(); + nimbleFriendsRangeRefreshResult.m_success = true; + nimbleFriendsRangeRefreshResult.m_error = null; + nimbleFriendsRangeRefreshResult.m_userList = null; + nimbleFriendsRangeRefreshResult.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); + nimbleFriendsRangeRefreshResult.m_size = nimbleFriendsRefreshBasicInfo.getRange(); + nimbleFriendsRangeRefreshResult.m_friendListEndInRefresh = false; + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + } else { + nimbleFriendsRangeRefreshResult.m_totalFriendCount = this.m_totalPlayedFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult); + } + } + } else { + Log.Helper.LOGV(this, "Retrieved " + jSONArray.length() + "friends.", new Object[0]); + for (int i = 0; i < jSONArray.length(); i++) { + if (jSONArray.optJSONObject(i) != null) { + updateInternalCache(createNimbleUser(jSONArray.optJSONObject(i)), friendsListType, arrayList); + } + } + if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { + this.m_totalPlayedFriends = this.m_playedFriendsList.size(); + } else { + this.m_totalFriends = this.m_friendsList.size(); + } + if (nimbleFriendsRefreshCallback != null) { + Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]); + NimbleFriendsRangeRefreshResult nimbleFriendsRangeRefreshResult2 = new NimbleFriendsRangeRefreshResult(); + nimbleFriendsRangeRefreshResult2.m_success = true; + nimbleFriendsRangeRefreshResult2.m_error = null; + nimbleFriendsRangeRefreshResult2.m_userList = arrayList; + nimbleFriendsRangeRefreshResult2.m_startIndex = nimbleFriendsRefreshBasicInfo.getStartIndex(); + nimbleFriendsRangeRefreshResult2.m_size = nimbleFriendsRefreshBasicInfo.getRange(); + if (arrayList.size() > 0) { + nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = true; + } else { + nimbleFriendsRangeRefreshResult2.m_friendListEndInRefresh = false; + } + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); + } else { + nimbleFriendsRangeRefreshResult2.m_totalFriendCount = this.m_totalPlayedFriends; + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshBasicInfo, nimbleFriendsRangeRefreshResult2); + } + } + Log.Helper.LOGD(this, "Friends list was upodated, send the update notification", new Object[0]); + sendUpdateNotification(); + } + } + } + + protected void updateFriendsListIdentityInfo(ArrayList arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { + synchronized (this) { + ArrayList arrayList2 = new ArrayList<>(); + if (this.m_friends == null || this.m_friends.size() <= 0) { + Log.Helper.LOGE(this, "Current Friends list is empty. Unable to process the PID update", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_EMPTY, "Current Friends list is empty. Unable to process the PID update", friendsListType); + } else if (arrayList == null || arrayList.size() <= 0) { + Log.Helper.LOGE(this, "Updated friends array is empty", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_IDENTITY_SERVER_EMPTY_RESPONSE, "Updated friends array is empty", friendsListType); + } else { + for (int i = 0; i < arrayList.size(); i++) { + NimbleUser nimbleUser = this.m_friends.get(arrayList.get(i).getExternalRefValue()); + if (nimbleUser != null && nimbleUser.getPid() == null) { + NimbleUser nimbleUser2 = new NimbleUser(nimbleUser); + nimbleUser2.setPid(arrayList.get(i).getPidId()); + nimbleUser2.setPersonaId(arrayList.get(i).getPersonaId()); + this.m_friends.put(arrayList.get(i).getExternalRefValue(), nimbleUser2); + arrayList2.add(nimbleUser2); + } + } + if (arrayList2.size() == 0) { + Log.Helper.LOGD(this, "No Pid Info updates were made to the Friends List", new Object[0]); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_FRIENDS_LIST_NOT_UPDATED, "No Pid Info updates were made to the Friends List", friendsListType); + } else { + Log.Helper.LOGD(this, String.format("%d Friends were updated for Identity Scope", Integer.valueOf(arrayList2.size())), new Object[0]); + sendUpdateNotification(); + if (nimbleFriendsRefreshCallback != null) { + Log.Helper.LOGD(this, "Friends list was updated. Invoking the callback", new Object[0]); + NimbleFriendsRefreshResult nimbleFriendsRefreshResult = new NimbleFriendsRefreshResult(); + nimbleFriendsRefreshResult.m_success = true; + nimbleFriendsRefreshResult.m_error = null; + nimbleFriendsRefreshResult.m_userList = arrayList2; + if (friendsListType == NimbleFriendsList.FriendsListType.ALL_FRIENDS) { + nimbleFriendsRefreshCallback.onCallback(this.m_nimbleFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } else { + nimbleFriendsRefreshCallback.onCallback(this.m_nimblePlayedFriendsList, nimbleFriendsRefreshScope, nimbleFriendsRefreshResult); + } + } + } + } + } + } + + protected void updateInternalCache(NimbleUser nimbleUser, NimbleFriendsList.FriendsListType friendsListType, ArrayList arrayList) { + if (this.m_friends == null || nimbleUser == null || nimbleUser.getUserId() == null) { + Log.Helper.LOGI(this, "updateInternalCache - Cannot update internal cache because the friend map or the new friend is null", new Object[0]); + return; + } + boolean z = true; + if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { + z = false; + } + if (this.m_friends.get(nimbleUser.getUserId()) == null) { + if (z) { + nimbleUser.addedToAllFriends = true; + this.m_friendsList.add(nimbleUser.getUserId()); + if (nimbleUser.getPlayedCurrentGame() == NimbleUser.PlayedCurrentGameFlag.PLAYED) { + this.m_playedFriendsList.add(nimbleUser.getUserId()); + } + } else { + nimbleUser.addedToAllFriends = false; + this.m_playedFriendsList.add(nimbleUser.getUserId()); + } + this.m_friends.put(nimbleUser.getUserId(), nimbleUser); + arrayList.add(nimbleUser); + return; + } + NimbleUser nimbleUser2 = this.m_friends.get(nimbleUser.getUserId()); + if (z && !nimbleUser2.addedToAllFriends) { + nimbleUser.addedToAllFriends = true; + this.m_friends.put(nimbleUser.getUserId(), nimbleUser); + this.m_friendsList.add(nimbleUser.getUserId()); + } + if (nimbleUser2.isUserUpdated(nimbleUser)) { + nimbleUser.setPersonaId(nimbleUser2.getPersonaId()); + nimbleUser.setPid(nimbleUser2.getPid()); + nimbleUser.addedToAllFriends = nimbleUser2.addedToAllFriends; + nimbleUser.setRefreshTimestamp(new Date()); + this.m_friends.put(nimbleUser.getUserId(), nimbleUser); + arrayList.add(nimbleUser); + } + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java new file mode 100644 index 0000000..43dd5d0 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsListOrigin.java @@ -0,0 +1,418 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Base; +import com.ea.nimble.Error; +import com.ea.nimble.Global; +import com.ea.nimble.HttpRequest; +import com.ea.nimble.IHttpRequest; +import com.ea.nimble.Log; +import com.ea.nimble.Network; +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.Utility; +import com.ea.nimble.identity.INimbleIdentity; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import com.ea.nimble.identity.NimbleIdentityPidInfo; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserFactory; + +import java.io.InputStream; +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.Scanner; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/.class */ +public class NimbleFriendsListOrigin extends NimbleFriendsListImpl { + private NimbleFriendsError lastError = null; + private static String GET_FRIENDS_URI_PARAMS = "/friends/2/users/%s/friends?start=%d&size=%d&names=%s"; + private static String GET_FRIENDS_AVATAR_URI = "/avatar/user/%s/avatars"; + + /* JADX INFO: Access modifiers changed from: package-private */ + public NimbleFriendsListOrigin() { + this.LOG_SOURCE_TITLE = ""; + this.m_authenticatorId = Global.NIMBLE_AUTHENTICATOR_ORIGIN; + Log.Helper.LOGV(this, "Constructed"); + this.m_pageSize = 20; + this.m_nimbleFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.ALL_FRIENDS); + this.m_nimblePlayedFriendsList = new NimbleFriendsList(this, NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS); + } + + private String getMdmAppKey() { + return SynergyEnvironment.getComponent().getGosMdmAppKey(); + } + + private String getOriginAvatarsUrlFromSynergy() { + String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_ORIGIN_AVATAR); + if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { + return null; + } + String str = serverUrlWithKey; + if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') { + str = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); + } + return str; + } + + private String getOriginFriendsUrlFromSynergy() { + String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_EADP_FRIENDS_HOST); + if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { + return null; + } + String str = serverUrlWithKey; + if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') { + str = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); + } + return str; + } + + private HttpRequest makeGetFriendsAvatarInfoRequest(String str, String str2, List list) { + MalformedURLException e; + String originAvatarsUrlFromSynergy = getOriginAvatarsUrlFromSynergy(); + if (str == null || str.length() <= 0 || list == null || list.size() <= 0 || list.size() > 20 || originAvatarsUrlFromSynergy == null || originAvatarsUrlFromSynergy.length() <= 0) { + return null; + } + HttpRequest httpRequest = null; + StringBuilder sb = new StringBuilder(); + for (String str3 : list) { + sb.append(str3); + sb.append(";"); + } + sb.deleteCharAt(sb.length() - 1); + try { + HttpRequest httpRequest2 = new HttpRequest(new URL(originAvatarsUrlFromSynergy + String.format(GET_FRIENDS_AVATAR_URI, sb.toString()))); + httpRequest2.method = IHttpRequest.Method.GET; + HashMap hashMap = new HashMap<>(); + hashMap.put("AuthToken", str); + httpRequest2.headers = hashMap; + return httpRequest2; + } catch (MalformedURLException e3) { + e = e3; + } + return new HttpRequest(); + } + + private HttpRequest makeGetFriendsRequest(int i, int i2, boolean z, String str, String str2, String str3) { + MalformedURLException e; + 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"); + return null; + } else if (originFriendsUrlFromSynergy == null || originFriendsUrlFromSynergy.length() <= 0) { + Log.Helper.LOGE(this, "Failed to create GOS friends request because GOS request URL is null or invalid"); + return null; + } else if (mdmAppKey == null || mdmAppKey.length() <= 0) { + Log.Helper.LOGE(this, "Failed to create GOS friends request because MDM App Key is null or invalid"); + return null; + } else 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"); + return null; + } else { + String str4 = str2 + " " + str; + HttpRequest httpRequest = null; + try { + HttpRequest httpRequest2 = new HttpRequest(new URL(originFriendsUrlFromSynergy + (z ? String.format(GET_FRIENDS_URI_PARAMS, str3, Integer.valueOf(i), Integer.valueOf(i2), "true") : String.format(GET_FRIENDS_URI_PARAMS, str3, Integer.valueOf(i), Integer.valueOf(i2), "false")))); + httpRequest2.method = IHttpRequest.Method.GET; + HashMap hashMap = new HashMap<>(); + hashMap.put("Authorization", str4); + hashMap.put("X-Application-Key", mdmAppKey); + hashMap.put("X-Api-Version", "2"); + httpRequest2.headers = hashMap; + return httpRequest2; + } catch (MalformedURLException e3) { + e = e3; + } + } + return new HttpRequest(); + } + + /* JADX INFO: Access modifiers changed from: private */ + public ArrayList parseAvatarInfoXml(NetworkConnectionHandle networkConnectionHandle) throws Error { + Exception e; + this.lastError = null; + int statusCode = networkConnectionHandle.getResponse().getStatusCode(); + if (statusCode != 200) { + switch (statusCode) { + case Log.LEVEL_WARN /* 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 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(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); + NimbleUser nimbleUser = null; + ArrayList arrayList = null; + for (int eventType = newPullParser.getEventType(); eventType != 1; eventType = newPullParser.next()) { + switch (eventType) { + case 0: + try { + arrayList = new ArrayList<>(); + break; + } catch (Exception e2) { + e = e2; + Log.Helper.LOGE(this, String.format("Parsing of GOS Avatar Info XML raised an exception. Details: %s", e.getMessage())); + 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; + } + case 2: + String name = newPullParser.getName(); + if (name.equalsIgnoreCase("user")) { + nimbleUser = new NimbleUser(); + try { + nimbleUser.setAuthenticatorId(Global.NIMBLE_AUTHENTICATOR_ORIGIN); + break; + } catch (Exception e3) { + e = e3; + Log.Helper.LOGE(this, String.format("Parsing of GOS Avatar Info XML raised an exception. Details: %s", e.getMessage())); + 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; + } + } else if (nimbleUser == null) { + continue; + } else if (name.equalsIgnoreCase("userId")) { + String nextText = newPullParser.nextText(); + nimbleUser.setUserId(nextText); + nimbleUser.setPid(nextText); + continue; + } else if (name.equalsIgnoreCase("link")) { + nimbleUser.setImageUrl(newPullParser.nextText()); + continue; + } else { + continue; + } + case 3: + if (newPullParser.getName().equalsIgnoreCase("user") && nimbleUser != null) { + arrayList.add(nimbleUser); + nimbleUser = null; + continue; + } + break; + } + } + return arrayList; + } catch (Exception e4) { + e = e4; + } + return new ArrayList<>(); + } + + /* JADX INFO: Access modifiers changed from: private */ + public ArrayList parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error { + InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); + this.lastError = null; + if (dataStream == null || dataStream.toString().length() == 0) { + throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); + } + Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A"); + String str = ""; + if (useDelimiter.hasNext()) { + str = useDelimiter.next(); + } + useDelimiter.close(); + ArrayList arrayList = new ArrayList<>(); + if (str == null || str.length() <= 0) { + Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends."); + this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends."); + return arrayList; + } + try { + JSONObject jSONObject = new JSONObject(str); + ArrayList arrayList2 = arrayList; + if (jSONObject != null) { + if (jSONObject.optJSONObject("error") == null) { + JSONArray optJSONArray = jSONObject.optJSONArray("entries"); + if (optJSONArray != null && optJSONArray.length() > 0) { + int i = 0; + while (true) { + arrayList2 = arrayList; + if (i >= optJSONArray.length()) { + break; + } + JSONObject jSONObject2 = optJSONArray.getJSONObject(i); + if (jSONObject2 != null) { + NimbleUser createNimbleUser = createNimbleUser(jSONObject2); + if (createNimbleUser.getUserId() != null && createNimbleUser.getUserId().length() > 0) { + arrayList.add(createNimbleUser); + } + } + i++; + } + } else if (optJSONArray == null || optJSONArray.length() != 0) { + JSONObject jSONObject3 = jSONObject.getJSONObject("error"); + if (jSONObject3 != null) { + int optInt = jSONObject3.optInt("code", -1); + String optString = jSONObject3.optString("type", ""); + Log.Helper.LOGE(this, String.format("Server error when retrieving GOS Friends. Code = %d, Message = %s", Integer.valueOf(optInt), optString)); + this.lastError = new NimbleFriendsError(optInt, optString); + return arrayList; + } + Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends."); + this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends."); + return arrayList; + } else { + Log.Helper.LOGD(this, "GOS response indicates there are no friends for this Origin user"); + this.lastError = null; + return arrayList; + } + } else { + JSONObject optJSONObject = jSONObject.optJSONObject("error"); + String optString2 = optJSONObject.optString("type"); + int optInt2 = optJSONObject.optInt("code", -1); + if (optString2 != null && optString2.length() > 0) { + this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, String.format("Code: %d, Type: %s", Integer.valueOf(optInt2), optString2)); + } + arrayList2 = null; + } + } + return arrayList2; + } catch (JSONException e) { + Log.Helper.LOGE(this, String.format("Exception when parsing JSON response. Error: %s", e.getMessage())); + this.lastError = new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_SERVER_RESPONSE_ERROR, e.getMessage()); + return arrayList; + } + } + + /* 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) { + try { + HttpRequest makeGetFriendsAvatarInfoRequest = makeGetFriendsAvatarInfoRequest(str, str2, list); + if (makeGetFriendsAvatarInfoRequest == null) { + Log.Helper.LOGE(this, "Failed to create HTTP Request for GOS getAvatarInfo"); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for GOS getAvatarInfo", friendsListType); + return; + } + Network.getComponent().sendRequest(makeGetFriendsAvatarInfoRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.friends..4 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + + } + }); + } catch (Exception e) { + Log.Helper.LOGE(this, String.format("Exception raised when creating GoS Avatar URL refresh request. Exception: %s", e.getMessage())); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_ERROR_PARSING_HTTP_RESPONSE, "Failed to process request for Avatar Info"), 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) { + try { + HttpRequest makeGetFriendsRequest = makeGetFriendsRequest(i, i2, true, str, str2, str3); + if (makeGetFriendsRequest == null) { + try { + Log.Helper.LOGE(this, "Failed to create HTTP Request for GOS getFriendsList"); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for GOS getFriendsList", friendsListType); + } catch (Exception e) { + String format = String.format("Authenticator (%s) does not support Identity Refresh for Friends List", this.m_authenticatorId); + Log.Helper.LOGE(this, format); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_SUPPORTED, format, friendsListType); + } + } else { + Network.getComponent().sendRequest(makeGetFriendsRequest, networkConnectionHandle -> { }); + } + } catch (Exception e2) { + } + } + + @Override // com.ea.nimble.friends.NimbleFriendsListImpl + protected NimbleUser createNimbleUser(JSONObject jSONObject) { + NimbleUser nimbleUser = new NimbleUser(); + try { + nimbleUser.setAuthenticatorId(this.m_authenticatorId); + nimbleUser.setDisplayName(jSONObject.optString("displayName", "")); + nimbleUser.setFriendType(jSONObject.optString("friendType", "")); + nimbleUser.setUserId(String.valueOf(jSONObject.optLong("userId"))); + nimbleUser.setPersonaId(String.valueOf(jSONObject.optLong("personaId"))); + nimbleUser.setPid(String.valueOf(jSONObject.optLong("userId"))); + if (jSONObject.optLong("timestamp", 0) != 0) { + nimbleUser.setRefreshTimestamp(new Date(jSONObject.optLong("timestamp") * 1000)); + } + return nimbleUser; + } catch (Exception e) { + Log.Helper.LOGW(this, String.format("Exception when parsing JSON for Friends. Message: %s", e.getMessage())); + return nimbleUser; + } + } + + @Override // com.ea.nimble.friends.NimbleFriendsListImpl, com.ea.nimble.LogSource + public /* bridge */ /* synthetic */ String getLogSourceTitle() { + return super.getLogSourceTitle(); + } + + @Override // com.ea.nimble.friends.NimbleFriendsListImpl + protected void refreshFriendsListBasicInfo(final int i, final int i2, String str, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshBasicInfo nimbleFriendsRefreshBasicInfo) { + if (friendsListType == NimbleFriendsList.FriendsListType.CURRENT_GAME_FRIENDS) { + Log.Helper.LOGE(this, "Origin Friends Service does not support getting friends with PlayedCurrentGame flag"); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_SCOPE_FRIENDS_LIST_TYPE_UNSUPPORTED, "Origin Friends Service does not support getting friends with PlayedCurrentGame flag", friendsListType); + } else if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { + Log.Helper.LOGE(this, "Unable to refresh friends Identity information because NimbleIdentity is not available"); + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to refresh friends Identity information because NimbleIdentity is not available", friendsListType); + } else { + INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); + NimbleIdentityPidInfo pidInfo = iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).getPidInfo(); + String str2 = null; + if (pidInfo != null) { + str2 = pidInfo.getPid(); + } + if (!Utility.validString(str2)) { + invokeCallbackWithBasicScopeError(nimbleFriendsRefreshBasicInfo, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available.", friendsListType); + } else { + // from class: com.ea.nimble.friends..1 +// com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback + iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestAccessToken((iNimbleIdentityAuthenticator, str3, str4, error) -> { + + }); + } + } + } + + @Override // com.ea.nimble.friends.NimbleFriendsListImpl + protected void refreshFriendsListIdentityInfo(ArrayList arrayList, NimbleFriendsList.FriendsListType friendsListType, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback) { + Log.Helper.LOGI(this, "Origin Friends Service does not support IdentityInfo refresh because Origin friends already have Identity information"); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_TYPE_UNSUPPORTED, "Origin Friends Service does not support IdentityInfo refresh because Origin friends already have Identity information", friendsListType); + } + + @Override // com.ea.nimble.friends.NimbleFriendsListImpl + protected void refreshFriendsListImageUrl(final List list, final NimbleFriendsList.FriendsListType friendsListType, final NimbleFriendsRefreshCallback nimbleFriendsRefreshCallback, final NimbleFriendsRefreshScope nimbleFriendsRefreshScope) { + if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { + Log.Helper.LOGE(this, "Unable to refresh friends Avatar information because NimbleIdentity is not available"); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to refresh friends Avatar information because NimbleIdentity is not available", friendsListType); + return; + } + INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); + if (iNimbleIdentity == null) { + Log.Helper.LOGE(this, "Identity Component not found. Not able to get friends Avatars."); + invokeCallbackWithScopeError(nimbleFriendsRefreshScope, nimbleFriendsRefreshCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Identity Component not found. Not able to get friends Avatars.", friendsListType); + return; + } + iNimbleIdentity.getAuthenticatorById(this.m_authenticatorId).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends..3 + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback + public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str, String str2, Error error) { + + } + }); + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.java new file mode 100644 index 0000000..037ec34 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.java @@ -0,0 +1,25 @@ +package com.ea.nimble.friends; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRangeRefreshResult.class */ +public class NimbleFriendsRangeRefreshResult extends NimbleFriendsRefreshResult { + protected boolean m_friendListEndInRefresh; + protected int m_size; + protected int m_startIndex; + protected int m_totalFriendCount; + + public int getRefreshSize() { + return this.m_size; + } + + public int getRefreshStartIndex() { + return this.m_startIndex; + } + + public int getTotalFriendCount() { + return this.m_totalFriendCount; + } + + public boolean isFriendListEndInRefresh() { + return this.m_friendListEndInRefresh; + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.java new file mode 100644 index 0000000..f26aaf3 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.java @@ -0,0 +1,39 @@ +package com.ea.nimble.friends; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshBasicInfo.class */ +public class NimbleFriendsRefreshBasicInfo extends NimbleFriendsRefreshScope { + private boolean m_nextPage; + private int m_range; + private int m_startIndex; + + public NimbleFriendsRefreshBasicInfo() { + this.m_startIndex = -1; + this.m_range = -1; + this.m_nextPage = false; + this.m_nextPage = true; + } + + public NimbleFriendsRefreshBasicInfo(int i, int i2) { + this.m_startIndex = -1; + this.m_range = -1; + this.m_nextPage = false; + this.m_startIndex = i; + this.m_range = i2; + this.m_nextPage = false; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public boolean getNextPage() { + return this.m_nextPage; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public int getRange() { + return this.m_range; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public int getStartIndex() { + return this.m_startIndex; + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshCallback.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshCallback.java new file mode 100644 index 0000000..0c27943 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshCallback.java @@ -0,0 +1,6 @@ +package com.ea.nimble.friends; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshCallback.class */ +public interface NimbleFriendsRefreshCallback { + void onCallback(NimbleFriendsList nimbleFriendsList, NimbleFriendsRefreshScope nimbleFriendsRefreshScope, NimbleFriendsRefreshResult nimbleFriendsRefreshResult); +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.java new file mode 100644 index 0000000..0827909 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.java @@ -0,0 +1,16 @@ +package com.ea.nimble.friends; + +import java.util.ArrayList; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshIdentityInfo.class */ +public class NimbleFriendsRefreshIdentityInfo extends NimbleFriendsRefreshScope { + private ArrayList userIds; + + public NimbleFriendsRefreshIdentityInfo(ArrayList arrayList) { + this.userIds = arrayList; + } + + public ArrayList getTargetedFriendIds() { + return this.userIds; + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.java new file mode 100644 index 0000000..1ad50d3 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.java @@ -0,0 +1,16 @@ +package com.ea.nimble.friends; + +import java.util.ArrayList; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshImageUrl.class */ +public class NimbleFriendsRefreshImageUrl extends NimbleFriendsRefreshScope { + private ArrayList userIds; + + public NimbleFriendsRefreshImageUrl(ArrayList arrayList) { + this.userIds = arrayList; + } + + public ArrayList getTargetedFriendIds() { + return this.userIds; + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshResult.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshResult.java new file mode 100644 index 0000000..89e9de6 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshResult.java @@ -0,0 +1,24 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Error; +import java.util.ArrayList; +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshResult.class */ +public class NimbleFriendsRefreshResult { + protected Error m_error; + protected boolean m_success; + protected ArrayList m_userList = new ArrayList<>(); + + public Error getError() { + return this.m_error; + } + + public List getUpdatedFriends() { + return this.m_userList; + } + + public boolean isSuccess() { + return this.m_success; + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshScope.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshScope.java new file mode 100644 index 0000000..01bb391 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsRefreshScope.java @@ -0,0 +1,5 @@ +package com.ea.nimble.friends; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsRefreshScope.class */ +public abstract class NimbleFriendsRefreshScope { +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleFriendsUtility.java b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsUtility.java new file mode 100644 index 0000000..8b55cfe --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleFriendsUtility.java @@ -0,0 +1,86 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Base; +import com.ea.nimble.Error; +import com.ea.nimble.NetworkConnectionHandle; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Scanner; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleFriendsUtility.class */ +class NimbleFriendsUtility { + NimbleFriendsUtility() { + } + + protected static JSONArray cutJSONArray(JSONArray jSONArray, int i) { + return null; + } + + protected static boolean isNimbleComponentAvailable(String str) { + boolean z = false; + if (Base.getComponent(str) != null) { + z = true; + } + return z; + } + + public static HashMap parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error { + InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); + if (dataStream == null || dataStream.toString().length() == 0) { + throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); + } + Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A"); + String str = ""; + if (useDelimiter.hasNext()) { + str = useDelimiter.next(); + } + useDelimiter.close(); + HashMap hashMap = null; + if (str != null) { + hashMap = null; + if (str.length() > 0) { + hashMap = (HashMap) new GsonBuilder().serializeNulls().create().fromJson(str, new TypeToken>() { // from class: com.ea.nimble.friends.NimbleFriendsUtility.1 + }.getType()); + } + } + return hashMap; + } + + /* JADX INFO: Access modifiers changed from: protected */ + public static ArrayList parseJSONObjectToArrayOfUserInfo(JSONObject jSONObject) { + ArrayList arrayList = null; + if (jSONObject != null) { + if (jSONObject.optJSONObject("pidInfos") == null) { + arrayList = null; + } else { + JSONArray optJSONArray = jSONObject.optJSONObject("pidInfos").optJSONArray("pidInfo"); + arrayList = null; + if (optJSONArray != null) { + ArrayList arrayList2 = new ArrayList<>(); + int i = 0; + while (true) { + arrayList = arrayList2; + if (i >= optJSONArray.length()) { + break; + } + try { + UserInfoFromIdentity userInfoFromIdentity = new UserInfoFromIdentity(optJSONArray.getJSONObject(i)); + if (!(userInfoFromIdentity.getPidId() == null || userInfoFromIdentity.getPidId() == "" || userInfoFromIdentity.getExternalRefValue() == null || userInfoFromIdentity.getExternalRefValue() == "")) { + arrayList2.add(userInfoFromIdentity); + } + } catch (JSONException e) { + } + i++; + } + } + } + } + return arrayList; + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsService.java b/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsService.java new file mode 100644 index 0000000..d121493 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsService.java @@ -0,0 +1,12 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Base; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleOriginFriendsService.class */ +public class NimbleOriginFriendsService { + public static final String NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN = "com.ea.nimble.friends.originfriendsservice"; + + public static INimbleOriginFriendsService getComponent() { + return (INimbleOriginFriendsService) Base.getComponent(NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN); + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java b/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java new file mode 100644 index 0000000..55c1d7a --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleOriginFriendsServiceImpl.java @@ -0,0 +1,1209 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Base; +import com.ea.nimble.Component; +import com.ea.nimble.Error; +import com.ea.nimble.Global; +import com.ea.nimble.HttpRequest; +import com.ea.nimble.IHttpRequest; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Network; +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.identity.INimbleIdentity; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import com.ea.nimble.identity.NimbleIdentityPidInfo; + +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Scanner; + +public class NimbleOriginFriendsServiceImpl extends Component implements LogSource, INimbleOriginFriendsService { + private static final String GET_RECEIVED_INVITATION_LIST_URI = "/friends/2/users/%s/invitations/inbound"; + private static final String GET_SENT_INVITATION_LIST_URI = "/friends/2/users/%s/invitations/outbound"; + private static final String POST_SEND_FRIEND_INVITATION_URI = "/friends/2/users/%s/invitations/outbound/%s"; + private static final String RESPOND_TO_FRIEND_INVITATION_URI = "/friends/2/users/%s/invitations/inbound/%s"; + private static final String SEARCH_USER_BY_DISPLAY_NAME_URI = "/proxy/identity/personas?displayName=%s*"; + private static final String SEARCH_USER_BY_EMAIL_URI = "/proxy/identity/pids?email=%s"; + private static int SMS_REQUEST_CODE = 6697; + private static int EMAIL_REQUEST_CODE = 6698; + + public enum UserSearchCriteria { + EMAIL, + DISPLAY_NAME + } + + private NimbleUser createNimbleUserFromGosJson(JSONObject jSONObject) { + NimbleUser nimbleUser = new NimbleUser(); + try { + nimbleUser.setAuthenticatorId(Global.NIMBLE_AUTHENTICATOR_ORIGIN); + nimbleUser.setDisplayName(jSONObject.optString("displayName", "")); + nimbleUser.setFriendType(jSONObject.optString("friendType", "")); + nimbleUser.setUserId(String.valueOf(jSONObject.optLong("userId", 0))); + nimbleUser.setPersonaId(String.valueOf(jSONObject.optLong("personaId", 0))); + nimbleUser.setPid(String.valueOf(jSONObject.optLong("userId", 0))); + if (jSONObject.optLong("timestamp", 0) != 0) { + nimbleUser.setRefreshTimestamp(new Date(jSONObject.optLong("timestamp") * 1000)); + } + return nimbleUser; + } catch (Exception e) { + Log.Helper.LOGW(this, String.format("Exception when parsing JSON response. Message: %s", e.getMessage())); + return null; + } + } + + private NimbleUser createNimbleUserFromNexusJson(JSONObject jSONObject) { + NimbleUser nimbleUser = new NimbleUser(); + try { + nimbleUser.setAuthenticatorId(Global.NIMBLE_AUTHENTICATOR_ORIGIN); + nimbleUser.setDisplayName(jSONObject.optString("displayName", "")); + nimbleUser.setFriendType(""); + nimbleUser.setUserId(String.valueOf(jSONObject.optLong("pidId", 0))); + nimbleUser.setPersonaId(String.valueOf(jSONObject.optLong("personaId", 0))); + nimbleUser.setPid(String.valueOf(jSONObject.optLong("pidId", 0))); + if (jSONObject.optLong("timestamp", 0) != 0) { + nimbleUser.setRefreshTimestamp(new Date(jSONObject.optLong("timestamp") * 1000)); + } + return nimbleUser; + } catch (Exception e) { + Log.Helper.LOGW(this, String.format("Exception when parsing JSON response. Message: %s", e.getMessage())); + return null; + } + } + + protected static String getIdentityProxyUrlFromSynergy() { + String str; + String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_IDENTITY_PROXY); + if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { + str = null; + } else { + str = serverUrlWithKey; + if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') { + return serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); + } + } + return str; + } + + private String getMdmAppKey() { + return SynergyEnvironment.getComponent().getGosMdmAppKey(); + } + + private String getOriginFriendsUrlFromSynergy() { + String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_EADP_FRIENDS_HOST); + if (serverUrlWithKey == null || serverUrlWithKey.length() <= 0) { + return null; + } + String str = serverUrlWithKey; + if (serverUrlWithKey.charAt(serverUrlWithKey.length() - 1) == '/') { + str = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); + } + return str; + } + + private static void initialize() { + Base.registerComponent(new NimbleOriginFriendsServiceImpl(), NimbleOriginFriendsService.NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN); + } + + /* JADX INFO: Access modifiers changed from: private */ + public void invokeFriendInvitationCallbackWithCode(INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback, NimbleFriendsError.Code code, String str) { + if (nimbleFriendInvitationCallback == null) { + Log.Helper.LOGW(this, "Unable to invoke an error callback for Friends services because callback is null"); + } else { + nimbleFriendInvitationCallback.onCallback(false, new NimbleFriendsError(code, str)); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void invokeFriendInvitationCallbackWithError(INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback, Error error) { + if (nimbleFriendInvitationCallback == null) { + Log.Helper.LOGW(this, "Unable to invoke an error callback for Friends services because callback is null"); + } else { + nimbleFriendInvitationCallback.onCallback(false, error); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void invokeFriendInvitationCallbackWithSuccess(INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { + if (nimbleFriendInvitationCallback == null) { + Log.Helper.LOGW(this, "Unable to invoke a success callback for Friends services because callback is null"); + } else { + nimbleFriendInvitationCallback.onCallback(true, null); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void invokeUserSearchCallbackWithCode(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback, NimbleFriendsError.Code code, String str) { + if (nimbleUserSearchCallback == null) { + Log.Helper.LOGW(this, "Unable to invoke an error callback for Friends services because callback is null"); + } else { + nimbleUserSearchCallback.onCallback(null, new NimbleFriendsError(code, str)); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void invokeUserSearchCallbackWithError(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback, Error error) { + if (nimbleUserSearchCallback == null) { + Log.Helper.LOGW(this, "Unable to invoke an error callback for Friends services because callback is null"); + } else { + nimbleUserSearchCallback.onCallback(null, error); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void invokeUserSearchCallbackWithSuccess(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback, ArrayList arrayList) { + if (nimbleUserSearchCallback == null) { + Log.Helper.LOGW(this, "Unable to invoke a success callback for Friends services because callback is null"); + } else { + nimbleUserSearchCallback.onCallback(arrayList, null); + } + } + + private boolean isNimbleComponentAvailable(String str) { + boolean z = false; + if (Base.getComponent(str) != null) { + z = true; + } + return z; + } + + private HttpRequest makeFriendInvitationRequest(String str, String str2, String str3, String str4, INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { + Exception e; + MalformedURLException e2; + 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"); + return null; + } else 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"); + return null; + } else 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"); + return null; + } else 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"); + return null; + } else 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"); + return null; + } else { + HttpRequest httpRequest = null; + HttpRequest httpRequest2 = 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 httpRequest3 = new HttpRequest(new URL(str5)); + try { + httpRequest3.method = IHttpRequest.Method.POST; + byte[] bytes = stringBuffer.toString().getBytes("UTF-8"); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); + byteArrayOutputStream.write(bytes); + httpRequest3.data = byteArrayOutputStream; + HashMap hashMap = new HashMap<>(); + hashMap.put("X-AuthToken", str2); + hashMap.put("X-Application-Key", mdmAppKey); + hashMap.put("X-Api-Version", "2"); + httpRequest3.headers = hashMap; + return httpRequest3; + } catch (MalformedURLException e3) { + e2 = e3; + httpRequest2 = httpRequest3; + Log.Helper.LOGE(this, "Exception when creating HTTP request URL for send friend invitation. Exception: " + e2.getMessage()); + return httpRequest2; + } catch (Exception e4) { + e = e4; + httpRequest = httpRequest3; + Log.Helper.LOGE(this, "Exception when creating HTTP request URL for send friend invitation. Exception: " + e.getMessage()); + return httpRequest; + } + } catch (MalformedURLException e5) { + e2 = e5; + } catch (Exception e6) { + e = e6; + } + } + return new HttpRequest(); + } + + private HttpRequest makeGetFriendInvitationListRequest(String str, String str2, String str3) { + Exception e; + MalformedURLException e2; + 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"); + return null; + } else if (mdmAppKey == null || mdmAppKey.length() <= 0) { + Log.Helper.LOGW(this, "Cannot make HTTP request because MDM app key is empty or null"); + return null; + } else if (str3 == null || str3.length() <= 0) { + Log.Helper.LOGW(this, "Cannot make HTTP request friends API URI is empty or null"); + return null; + } else if (str2 == null || str2.length() <= 0) { + Log.Helper.LOGW(this, "Cannot make HTTP request because access token is null or empty"); + return null; + } else if (str == null || str.length() <= 0) { + Log.Helper.LOGW(this, "Cannot make HTTP request because user's nucleus ID is null or empty"); + return null; + } else { + HttpRequest httpRequest = null; + HttpRequest httpRequest2 = null; + try { + HttpRequest httpRequest3 = new HttpRequest(new URL(originFriendsUrlFromSynergy + String.format(str3, str))); + try { + httpRequest3.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"); + httpRequest3.headers = hashMap; + return httpRequest3; + } catch (Exception e4) { + e = e4; + httpRequest = httpRequest3; + Log.Helper.LOGE(this, "Exception when creating HTTP request URL. Exception: " + e.getMessage()); + return httpRequest; + } + } catch (MalformedURLException e5) { + e2 = e5; + } catch (Exception e6) { + e = e6; + } + } + return new HttpRequest(); + } + + private HttpRequest makeRespondToFriendInvitationRequest(boolean z, String str, String str2, String str3) { + Exception e; + 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"); + return null; + } else 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"); + return null; + } else 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"); + return null; + } else 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"); + return null; + } else 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"); + return null; + } else { + HttpRequest httpRequest = null; + HttpRequest httpRequest2 = null; + try { + HttpRequest httpRequest3 = new HttpRequest(new URL(originFriendsUrlFromSynergy + String.format(RESPOND_TO_FRIEND_INVITATION_URI, str, str2))); + try { + if (z) { + httpRequest3.method = IHttpRequest.Method.POST; + } else { + httpRequest3.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"); + httpRequest3.headers = hashMap; + return httpRequest3; + } catch (Exception e3) { + e = e3; + httpRequest = httpRequest3; + Log.Helper.LOGE(this, "Exception when creating HTTP request URL for responding to Friends request. Exception: " + e.getMessage()); + return httpRequest; + } + } catch (MalformedURLException e4) { + e = e4; + } catch (Exception e5) { + e = e5; + } + } + return new HttpRequest(); + } + + private HttpRequest makeSearchUserRequest(String str, String str2, String str3, UserSearchCriteria userSearchCriteria) { + Exception e; + MalformedURLException e2; + 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"); + return null; + } else if (str == null || str.length() <= 0) { + Log.Helper.LOGW(this, "Cannot make user search HTTP request because AccessToken is empty or null"); + return null; + } else if (str2 == null || str2.length() <= 0) { + Log.Helper.LOGW(this, "Cannot make user search HTTP request TokenType is empty or null"); + return null; + } else if (str3 == null || str3.length() <= 0) { + Log.Helper.LOGW(this, "Cannot make user searchHTTP request because searchCriteria is null or empty"); + return null; + } else { + HttpRequest httpRequest = null; + HttpRequest httpRequest2 = null; + String str4 = identityProxyUrlFromSynergy + (userSearchCriteria == UserSearchCriteria.EMAIL ? String.format(SEARCH_USER_BY_EMAIL_URI, str3) : String.format(SEARCH_USER_BY_DISPLAY_NAME_URI, str3)); + String str5 = str2 + " " + str; + try { + HttpRequest httpRequest3 = new HttpRequest(new URL(str4)); + try { + httpRequest3.method = IHttpRequest.Method.GET; + HashMap hashMap = new HashMap<>(); + hashMap.put("Authorization", str5); + hashMap.put("X-Include-Underage", "true"); + hashMap.put("X-Expand-Results", "true"); + httpRequest3.headers = hashMap; + return httpRequest3; + } catch (Exception e4) { + e = e4; + httpRequest = httpRequest3; + Log.Helper.LOGE(this, "Exception when creating search user HTTP request URL. Exception: " + e.getMessage()); + return httpRequest; + } + } catch (MalformedURLException e5) { + e2 = e5; + } catch (Exception e6) { + e = e6; + } + } + return new HttpRequest(); + } + + /* JADX INFO: Access modifiers changed from: private */ + public ArrayList parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error { + InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); + if (dataStream == null || dataStream.toString().length() == 0) { + throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); + } + Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A"); + String str = ""; + if (useDelimiter.hasNext()) { + str = useDelimiter.next(); + } + useDelimiter.close(); + ArrayList arrayList = new ArrayList<>(); + if (str == null || str.length() <= 0) { + Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends."); + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends."); + } + try { + JSONObject jSONObject = new JSONObject(str); + ArrayList arrayList2 = arrayList; + if (jSONObject != null) { + try { + 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) { + arrayList2 = null; + } else { + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, String.format("Code: %d, Type: %s", Integer.valueOf(optInt), optString)); + } + } else { + JSONArray optJSONArray = jSONObject.optJSONArray("entries"); + if (optJSONArray == null) { + JSONObject jSONObject2 = jSONObject.getJSONObject("error"); + if (jSONObject2 != null) { + int optInt2 = jSONObject2.optInt("code", -1); + String optString2 = jSONObject2.optString("type", ""); + Log.Helper.LOGE(this, String.format("Server error when retrieving GOS Friends. Code = %d, Message = %s", Integer.valueOf(optInt2), optString2)); + throw new NimbleFriendsError(optInt2, optString2); + } + Log.Helper.LOGE(this, "Generic Server error when retrieving GOS Friends."); + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving GOS Friends."); + } else if (optJSONArray.length() <= 0) { + Log.Helper.LOGD(this, "No invitations found for your selected criteria"); + return arrayList; + } else { + arrayList2 = arrayList; + if (optJSONArray != null) { + arrayList2 = arrayList; + if (optJSONArray.length() > 0) { + int i = 0; + while (true) { + arrayList2 = arrayList; + if (i >= optJSONArray.length()) { + break; + } + JSONObject jSONObject3 = optJSONArray.getJSONObject(i); + if (jSONObject3 != null) { + NimbleUser createNimbleUserFromGosJson = createNimbleUserFromGosJson(jSONObject3); + if (createNimbleUserFromGosJson.getUserId() != null && createNimbleUserFromGosJson.getUserId().length() > 0) { + arrayList.add(createNimbleUserFromGosJson); + } + } + i++; + } + } + } + } + } + } catch (JSONException e) { + e = e; + Log.Helper.LOGE(this, String.format("Exception when parsing JSON response. Error: %s", e.getMessage())); + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); + } + } + return arrayList2; + } catch (JSONException e2) { + } + return new ArrayList<>(); + } + + /* JADX INFO: Access modifiers changed from: private */ + public ArrayList parseUserSearchByDisplayNameResponse(NetworkConnectionHandle networkConnectionHandle) throws Error { + NimbleUser createNimbleUserFromNexusJson; + InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); + if (dataStream == null || dataStream.toString().length() == 0) { + throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); + } + Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A"); + String str = ""; + if (useDelimiter.hasNext()) { + str = useDelimiter.next(); + } + useDelimiter.close(); + ArrayList arrayList = new ArrayList<>(); + if (str == null || str.length() <= 0) { + Log.Helper.LOGE(this, "Generic Server error when retrieving search user response."); + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving search user response."); + } + try { + JSONObject jSONObject = new JSONObject(str); + ArrayList arrayList2 = arrayList; + if (jSONObject != null) { + if (jSONObject.optJSONObject("error") != null) { + String jSONObject2 = jSONObject.optJSONObject("error").toString(); + if (jSONObject2 == null || jSONObject2.length() <= 0) { + arrayList2 = null; + } else { + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, jSONObject2); + } + } else { + JSONObject optJSONObject = jSONObject.optJSONObject("personas"); + if (optJSONObject != null) { + JSONArray optJSONArray = optJSONObject.optJSONArray("persona"); + if (optJSONArray != null && optJSONArray.length() > 0) { + int i = 0; + while (true) { + arrayList2 = arrayList; + if (i >= optJSONArray.length()) { + break; + } + JSONObject optJSONObject2 = optJSONArray.optJSONObject(i); + if (!(optJSONObject2 == null || (createNimbleUserFromNexusJson = createNimbleUserFromNexusJson(optJSONObject2)) == null)) { + arrayList.add(createNimbleUserFromNexusJson); + } + i++; + } + } else { + Log.Helper.LOGD(this, "Search response indicates that no user was found with the display name prefix that you searched for."); + return arrayList; + } + } else { + Log.Helper.LOGE(this, "Unable to parse response from server - no personas object found"); + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Unable to parse response from server - no personas object found"); + } + } + } + return arrayList2; + } catch (JSONException e2) { + } + return new ArrayList<>(); + } + + /* JADX INFO: Access modifiers changed from: private */ + public ArrayList parseUserSearchByEmailResponse(NetworkConnectionHandle networkConnectionHandle) throws Error { + NimbleUser createNimbleUserFromNexusJson; + InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); + if (dataStream == null || dataStream.toString().length() == 0) { + throw new NimbleFriendsError(networkConnectionHandle.getResponse().getStatusCode(), networkConnectionHandle.getResponse().getError().getMessage()); + } + Scanner useDelimiter = new Scanner(dataStream).useDelimiter("\\A"); + String str = ""; + if (useDelimiter.hasNext()) { + str = useDelimiter.next(); + } + useDelimiter.close(); + ArrayList arrayList = new ArrayList<>(); + if (str == null || str.length() <= 0) { + Log.Helper.LOGE(this, "Generic Server error when retrieving search user response."); + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Generic Server error when retrieving search user response."); + } + try { + JSONObject jSONObject = new JSONObject(str); + ArrayList arrayList2 = arrayList; + if (jSONObject != null) { + if (jSONObject.optJSONObject("error") != null) { + String jSONObject2 = jSONObject.optJSONObject("error").toString(); + if (jSONObject2 == null || jSONObject2.length() <= 0) { + arrayList2 = null; + } else { + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, jSONObject2); + } + } else { + JSONObject optJSONObject = jSONObject.optJSONObject("pids"); + if (optJSONObject != null) { + JSONArray optJSONArray = optJSONObject.optJSONArray("pid"); + if (optJSONArray != null && optJSONArray.length() > 0) { + int i = 0; + while (true) { + arrayList2 = arrayList; + if (i >= optJSONArray.length()) { + break; + } + JSONObject optJSONObject2 = optJSONArray.optJSONObject(i); + if (!(optJSONObject2 == null || (createNimbleUserFromNexusJson = createNimbleUserFromNexusJson(optJSONObject2)) == null)) { + arrayList.add(createNimbleUserFromNexusJson); + } + i++; + } + } else { + Log.Helper.LOGD(this, "Search response indicates that no user was found with the email address that you searched for."); + return arrayList; + } + } else { + Log.Helper.LOGE(this, "Unable to parse response from server - no pids object found"); + throw new NimbleFriendsError(NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, "Unable to parse response from server - no pids object found"); + } + } + } + return arrayList2; + } catch (JSONException e2) { + } + return new ArrayList<>(); + } + + private void processInivtationListRequest(final String str, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { + if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { + Log.Helper.LOGE(this, "Unable to process request because NimbleIdentity is not available"); + 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(); + String str2 = null; + if (pidInfo != null) { + str2 = pidInfo.getPid(); + } + if (str2 == null || str2.length() <= 0) { + invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available."); + } else { + String finalStr = str2; + 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 str3, String str4, Error error) { + if (error != null) { + Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot process request."); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, error); + return; + } + NimbleOriginFriendsServiceImpl.this.sendGetFriendInvitationListRequest(finalStr, str3, str, nimbleUserSearchCallback); + } + }); + } + } + + private void processRespondToFriendInvitationRequest(final boolean z, final String str, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { + if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { + Log.Helper.LOGE(this, "Unable to process request for responding to friend invitation because NimbleIdentity is not available"); + invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to process request for responding to friend invitation because NimbleIdentity is not available"); + return; + } + INimbleIdentity iNimbleIdentity = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); + NimbleIdentityPidInfo pidInfo = iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).getPidInfo(); + String str2 = null; + if (pidInfo != null) { + str2 = pidInfo.getPid(); + } + if (str2 == null || str2.length() <= 0) { + invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available."); + } else { + String finalStr = str2; + iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.2 + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback + public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str3, String str4, Error error) { + if (error != null) { + Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot process request for responding to friend invitation."); + NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, error); + return; + } + NimbleOriginFriendsServiceImpl.this.sendRespondToFriendInvitationRequest(z, finalStr, str, str3, nimbleFriendInvitationCallback); + } + }); + } + } + + private void processSearchUserRequest(final String str, final UserSearchCriteria userSearchCriteria, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { + if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { + Log.Helper.LOGE(this, "Unable to process request because NimbleIdentity is not available"); + invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to process request because NimbleIdentity is not available"); + return; + } + ((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) { + Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot process request."); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, error); + return; + } + NimbleOriginFriendsServiceImpl.this.sendSearchUserRequest(str2, str3, str, userSearchCriteria, nimbleUserSearchCallback); + } + }); + } + + private void processSendFriendInvitationRequest(final String str, final String str2, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { + if (!isNimbleComponentAvailable("com.ea.nimble.identity")) { + Log.Helper.LOGE(this, "Unable to send friend request because NimbleIdentity is not available"); + invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_IDENTITY_NOT_AVAILABLE, "Unable to send friend 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(); + String str3 = null; + if (pidInfo != null) { + str3 = pidInfo.getPid(); + } + if (str3 == null || str3.length() <= 0) { + invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_REFRESH_AUTHENTICATOR_NOT_LOGGED_IN, "Origin PID for the current user is not available."); + } else { + String finalStr = str3; + iNimbleIdentity.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ORIGIN).requestAccessToken(new INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback() { // from class: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.1 + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback + public void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str4, String str5, Error error) { + if (error != null) { + Log.Helper.LOGE(this, "Failed to refresh AccessToken - cannot send friend invitation request."); + NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithError(nimbleFriendInvitationCallback, error); + return; + } + NimbleOriginFriendsServiceImpl.this.sendFriendInvitationRequest(finalStr, str4, str, str2, nimbleFriendInvitationCallback); + } + }); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void sendFriendInvitationRequest(String str, String str2, String str3, String str4, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { + 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"); + invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for sending friend invitation"); + return; + } + 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); + return; + } + Log.Helper.LOGD(this, "Server responded with an error for send friend invitation request"); + NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_RETURNED_ERROR, "Server responded with an error for send friend invitation request"); + } catch (Exception e) { + Log.Helper.LOGE(this, e.getMessage()); + NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); + } + } + }); + } catch (Exception e) { + Log.Helper.LOGE(this, e.getMessage()); + invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void sendGetFriendInvitationListRequest(String str, String str2, String str3, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { + 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"); + invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for retrieving outbound friend invitation list"); + return; + } + 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"); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_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"); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseBodyJSONData); + } else { + Log.Helper.LOGD(this, "Successful in retrieving invitation list from GOS"); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseBodyJSONData); + } + } catch (Error e) { + Log.Helper.LOGE(this, "Error parsing response from GOS" + e.getMessage()); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, e); + } catch (Exception e2) { + Log.Helper.LOGE(this, e2.getMessage()); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e2.getMessage()); + } + } + }); + } catch (Exception e) { + Log.Helper.LOGE(this, e.getMessage()); + invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void sendRespondToFriendInvitationRequest(boolean z, String str, String str2, String str3, final INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { + 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"); + invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for respoding to friend invitation"); + return; + } + 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); + return; + } + Log.Helper.LOGD(this, "Error processing the respond to friend invitation request"); + NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_SERVER_RETURNED_ERROR, "Error processing the respond to friend invitation request"); + } catch (Exception e) { + Log.Helper.LOGE(this, e.getMessage()); + NimbleOriginFriendsServiceImpl.this.invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); + } + } + }); + } catch (Exception e) { + Log.Helper.LOGE(this, e.getMessage()); + invokeFriendInvitationCallbackWithCode(nimbleFriendInvitationCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, e.getMessage()); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + public void sendSearchUserRequest(String str, String str2, String str3, final UserSearchCriteria userSearchCriteria, final INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { + try { + HttpRequest makeSearchUserRequest = makeSearchUserRequest(str, str2, str3, userSearchCriteria); + if (makeSearchUserRequest == null) { + Log.Helper.LOGE(this, "Failed to create HTTP Request for user search"); + invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_FAILED_TO_CREATE_GOS_REQUEST, "Failed to create HTTP Request for user search"); + return; + } + 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"); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_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."); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithSuccess(nimbleUserSearchCallback, parseUserSearchByEmailResponse); + } else { + Log.Helper.LOGD(this, "Found users with matching email or display name prefix"); + 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()); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithError(nimbleUserSearchCallback, e); + } catch (Exception e2) { + String str4 = "Error parsing response for user search by email or displayName request" + e2.getMessage(); + Log.Helper.LOGE(this, str4); + NimbleOriginFriendsServiceImpl.this.invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, str4); + } + } + }); + } catch (Exception e) { + String str4 = "Error parsing response for user search by email or displayName request" + e.getMessage(); + Log.Helper.LOGE(this, str4); + invokeUserSearchCallbackWithCode(nimbleUserSearchCallback, NimbleFriendsError.Code.NIMBLE_FRIENDS_ORIGIN_SERVICES_SERVER_RESPONSE_ERROR, str4); + } + } + + @Override // com.ea.nimble.friends.INimbleOriginFriendsService + public void acceptFriendInvitation(String str, INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { + if (nimbleFriendInvitationCallback == null) { + Log.Helper.LOGE(this, "Cannot process acceptFriendInvitation request because callback is null"); + return; + } + Log.Helper.LOGD(this, "Request: acceptFriendInvitation"); + processRespondToFriendInvitationRequest(true, str, nimbleFriendInvitationCallback); + } + + @Override // com.ea.nimble.Component + public void cleanup() { + Log.Helper.LOGV(this, "Component cleanup"); + } + + @Override // com.ea.nimble.friends.INimbleOriginFriendsService + public void declineFriendInvitation(String str, INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { + if (nimbleFriendInvitationCallback == null) { + Log.Helper.LOGE(this, "Cannot process declineFriendInvitation request because callback is null"); + return; + } + Log.Helper.LOGD(this, "Request: declineFriendInvitation"); + processRespondToFriendInvitationRequest(false, str, nimbleFriendInvitationCallback); + } + + @Override // com.ea.nimble.Component + public String getComponentId() { + return NimbleOriginFriendsService.NIMBLE_COMPONENT_ID_FRIENDS_ORIGIN; + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "NimbleOriginFriendsService"; + } + + @Override // com.ea.nimble.friends.INimbleOriginFriendsService + public void listFriendInvitationsReceived(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { + if (nimbleUserSearchCallback == null) { + Log.Helper.LOGE(this, "Cannot process listFriendInvitationReceived request because callback is null"); + return; + } + Log.Helper.LOGD(this, "Request: listFriendInvitationReceived"); + processInivtationListRequest(GET_RECEIVED_INVITATION_LIST_URI, nimbleUserSearchCallback); + } + + @Override // com.ea.nimble.friends.INimbleOriginFriendsService + public void listFriendInvitationsSent(INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { + if (nimbleUserSearchCallback == null) { + Log.Helper.LOGE(this, "Cannot process listFriendInvitationSent request because callback is null"); + return; + } + Log.Helper.LOGD(this, "Request: listFriendInvitationSent"); + processInivtationListRequest(GET_SENT_INVITATION_LIST_URI, nimbleUserSearchCallback); + } + + @Override // com.ea.nimble.Component + public void restore() { + Log.Helper.LOGV(this, "Component restore"); + } + + @Override // com.ea.nimble.Component + public void resume() { + Log.Helper.LOGV(this, "Component resume"); + } + + @Override // com.ea.nimble.friends.INimbleOriginFriendsService + public void searchUserByDisplayName(String str, INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { + if (nimbleUserSearchCallback == null) { + Log.Helper.LOGE(this, "Cannot process searchUserByDisplayName request because callback is null"); + return; + } + Log.Helper.LOGD(this, String.format("searchUserByDisplayName API called with namePrefix = %s", str)); + processSearchUserRequest(str, UserSearchCriteria.DISPLAY_NAME, nimbleUserSearchCallback); + } + + @Override // com.ea.nimble.friends.INimbleOriginFriendsService + public void searchUserByEmail(String str, INimbleOriginFriendsService.NimbleUserSearchCallback nimbleUserSearchCallback) { + if (nimbleUserSearchCallback == null) { + Log.Helper.LOGE(this, "Cannot process searchUserByEmail request because callback is null"); + return; + } + Log.Helper.LOGD(this, String.format("searchUserByEmail API called with email = %s", str)); + processSearchUserRequest(str, UserSearchCriteria.EMAIL, nimbleUserSearchCallback); + } + + @Override // com.ea.nimble.friends.INimbleOriginFriendsService + public void sendFriendInvitation(String str, String str2, INimbleOriginFriendsService.NimbleFriendInvitationCallback nimbleFriendInvitationCallback) { + if (nimbleFriendInvitationCallback == null) { + Log.Helper.LOGE(this, "Cannot process sendFriendInvitation request because callback is null"); + return; + } + Log.Helper.LOGD(this, "Request: sendFriendInvitation"); + processSendFriendInvitationRequest(str, str2, nimbleFriendInvitationCallback); + } + + /* JADX WARN: Code restructure failed: missing block: B:16:0x0052, code lost: + if (r9.length() <= 0) goto L_0x0055; + */ + /* JADX WARN: Code restructure failed: missing block: B:21:0x0063, code lost: + if (r10.length() <= 0) goto L_0x0066; + */ + @Override // com.ea.nimble.friends.INimbleOriginFriendsService + /* + Code decompiled incorrectly, please refer to instructions dump. + To view partially-correct code enable 'Show inconsistent code' option in preferences + */ + public void sendInvitationOverEmail(java.util.ArrayList r8, java.lang.String r9, java.lang.String r10, com.ea.nimble.friends.INimbleOriginFriendsService.NimbleFriendInvitationCallback r11) { + /* + r7 = this; + r0 = r8 + if (r0 == 0) goto L_0x000b + r0 = r8 + int r0 = r0.size() + if (r0 > 0) goto L_0x0031 + L_0x000b: + r0 = r7 + java.lang.String r1 = "Target user emails is null or empty. Cannot send email invite." + r2 = 0 + java.lang.Object[] r2 = new java.lang.Object[r2] + com.ea.nimble.Log.Helper.LOGE(r0, r1, r2) + r0 = r11 + if (r0 == 0) goto L_0x0030 + r0 = r11 + r1 = 0 + com.ea.nimble.friends.NimbleFriendsError r2 = new com.ea.nimble.friends.NimbleFriendsError + r3 = r2 + com.ea.nimble.friends.NimbleFriendsError$Code r4 = com.ea.nimble.friends.NimbleFriendsError.Code.NIMBLE_FRIENDS_NO_TARGETS_PROVIDED + java.lang.String r5 = "Target user emails is null or empty. Cannot send email invite." + r3.(r4, r5) + r0.onCallback(r1, r2) + L_0x0030: + return + L_0x0031: + r0 = 0 + r12 = r0 + r0 = r8 + if (r0 == 0) goto L_0x0048 + r0 = r8 + r1 = r8 + int r1 = r1.size() + java.lang.String[] r1 = new java.lang.String[r1] + java.lang.Object[] r0 = r0.toArray(r1) + java.lang.String[] r0 = (java.lang.String[]) r0 + r12 = r0 + L_0x0048: + r0 = r9 + if (r0 == 0) goto L_0x0055 + r0 = r9 + r8 = r0 + r0 = r9 + int r0 = r0.length() + if (r0 > 0) goto L_0x0059 + L_0x0055: + java.lang.String r0 = "Please accept my friend invitation" + r8 = r0 + L_0x0059: + r0 = r10 + if (r0 == 0) goto L_0x0066 + r0 = r10 + r9 = r0 + r0 = r10 + int r0 = r0.length() + if (r0 > 0) goto L_0x006a + L_0x0066: + java.lang.String r0 = "Hi, I'll appreciate if you can accept my friend invitation." + r9 = r0 + L_0x006a: + android.content.Intent r0 = new android.content.Intent + r1 = r0 + java.lang.String r2 = "android.intent.action.SEND" + r1.(r2) + r10 = r0 + r0 = r10 + java.lang.String r1 = "message/rfc822" + android.content.Intent r0 = r0.setType(r1) + r0 = r10 + java.lang.String r1 = "android.intent.extra.EMAIL" + r2 = r12 + android.content.Intent r0 = r0.putExtra(r1, r2) + r0 = r10 + java.lang.String r1 = "android.intent.extra.SUBJECT" + r2 = r8 + android.content.Intent r0 = r0.putExtra(r1, r2) + r0 = r10 + java.lang.String r1 = "android.intent.extra.TEXT" + r2 = r9 + android.content.Intent r0 = r0.putExtra(r1, r2) + android.app.Activity r0 = com.ea.nimble.ApplicationEnvironment.getCurrentActivity() // Catch: Exception -> 0x00b8 + r1 = r10 + java.lang.String r2 = "Send mail using:" + android.content.Intent r1 = android.content.Intent.createChooser(r1, r2) // Catch: Exception -> 0x00b8 + int r2 = com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.EMAIL_REQUEST_CODE // Catch: Exception -> 0x00b8 + r0.startActivityForResult(r1, r2) // Catch: Exception -> 0x00b8 + L_0x00a9: + r0 = r11 + if (r0 == 0) goto L_0x0030 + r0 = r11 + r1 = 1 + r2 = 0 + r0.onCallback(r1, r2) + return + L_0x00b8: + r8 = move-exception + r0 = r7 + java.lang.String r1 = "Can not send email on this device" + r2 = 0 + java.lang.Object[] r2 = new java.lang.Object[r2] + com.ea.nimble.Log.Helper.LOGE(r0, r1, r2) + r0 = r11 + if (r0 == 0) goto L_0x00a9 + r0 = r11 + r1 = 0 + com.ea.nimble.friends.NimbleFriendsError r2 = new com.ea.nimble.friends.NimbleFriendsError + r3 = r2 + com.ea.nimble.friends.NimbleFriendsError$Code r4 = com.ea.nimble.friends.NimbleFriendsError.Code.NIMBLE_FRIENDS_EMAIL_NOT_AVAILABLE + java.lang.String r5 = "Email is not available on this device" + r3.(r4, r5) + r0.onCallback(r1, r2) + return + */ + throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.sendInvitationOverEmail(java.util.ArrayList, java.lang.String, java.lang.String, com.ea.nimble.friends.INimbleOriginFriendsService$NimbleFriendInvitationCallback):void"); + } + + /* JADX WARN: Code restructure failed: missing block: B:17:0x0081, code lost: + if (r9.length() <= 0) goto L_0x0084; + */ + @Override // com.ea.nimble.friends.INimbleOriginFriendsService + /* + Code decompiled incorrectly, please refer to instructions dump. + To view partially-correct code enable 'Show inconsistent code' option in preferences + */ + public void sendInvitationOverSMS(java.util.ArrayList r8, java.lang.String r9, com.ea.nimble.friends.INimbleOriginFriendsService.NimbleFriendInvitationCallback r10) { + /* + r7 = this; + r0 = r8 + if (r0 == 0) goto L_0x000b + r0 = r8 + int r0 = r0.size() + if (r0 > 0) goto L_0x002f + L_0x000b: + r0 = r7 + java.lang.String r1 = "Target phone numbers is null or empty. Cannot send SMS invite." + r2 = 0 + java.lang.Object[] r2 = new java.lang.Object[r2] + com.ea.nimble.Log.Helper.LOGE(r0, r1, r2) + r0 = r10 + if (r0 == 0) goto L_0x002e + r0 = r10 + r1 = 0 + com.ea.nimble.friends.NimbleFriendsError r2 = new com.ea.nimble.friends.NimbleFriendsError + r3 = r2 + com.ea.nimble.friends.NimbleFriendsError$Code r4 = com.ea.nimble.friends.NimbleFriendsError.Code.NIMBLE_FRIENDS_NO_TARGETS_PROVIDED + java.lang.String r5 = "Target phone numbers is null or empty. Cannot send SMS invite." + r3.(r4, r5) + r0.onCallback(r1, r2) + L_0x002e: + return + L_0x002f: + java.lang.StringBuilder r0 = new java.lang.StringBuilder + r1 = r0 + r1.() + r11 = r0 + r0 = r11 + java.lang.String r1 = "smsto:" + java.lang.StringBuilder r0 = r0.append(r1) + r0 = r8 + java.util.Iterator r0 = r0.iterator() + r8 = r0 + L_0x0046: + r0 = r8 + boolean r0 = r0.hasNext() + if (r0 == 0) goto L_0x006a + r0 = r11 + r1 = r8 + java.lang.Object r1 = r1.next() + java.lang.String r1 = (java.lang.String) r1 + java.lang.StringBuilder r0 = r0.append(r1) + r0 = r11 + java.lang.String r1 = ";" + java.lang.StringBuilder r0 = r0.append(r1) + goto L_0x0046 + L_0x006a: + r0 = r11 + r1 = r11 + int r1 = r1.length() + r2 = 1 + int r1 = r1 - r2 + java.lang.StringBuilder r0 = r0.deleteCharAt(r1) + r0 = r9 + if (r0 == 0) goto L_0x0084 + r0 = r9 + r8 = r0 + r0 = r9 + int r0 = r0.length() + if (r0 > 0) goto L_0x0088 + L_0x0084: + java.lang.String r0 = "Hi, I'll appreciate if you can accept my friend invitation." + r8 = r0 + L_0x0088: + android.content.Intent r0 = new android.content.Intent + r1 = r0 + java.lang.String r2 = "android.intent.action.SENDTO" + r3 = r11 + java.lang.String r3 = r3.toString() + android.net.Uri r3 = android.net.Uri.parse(r3) + r1.(r2, r3) + r9 = r0 + r0 = r9 + java.lang.String r1 = "sms_body" + r2 = r8 + android.content.Intent r0 = r0.putExtra(r1, r2) + android.app.Activity r0 = com.ea.nimble.ApplicationEnvironment.getCurrentActivity() // Catch: Exception -> 0x00c1 + r1 = r9 + java.lang.String r2 = "Send sms using:" + android.content.Intent r1 = android.content.Intent.createChooser(r1, r2) // Catch: Exception -> 0x00c1 + int r2 = com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.SMS_REQUEST_CODE // Catch: Exception -> 0x00c1 + r0.startActivityForResult(r1, r2) // Catch: Exception -> 0x00c1 + L_0x00b4: + r0 = r10 + if (r0 == 0) goto L_0x002e + r0 = r10 + r1 = 1 + r2 = 0 + r0.onCallback(r1, r2) + return + L_0x00c1: + r8 = move-exception + r0 = r7 + java.lang.String r1 = "Can not send sms on this device" + r2 = 0 + java.lang.Object[] r2 = new java.lang.Object[r2] + com.ea.nimble.Log.Helper.LOGE(r0, r1, r2) + r0 = r10 + if (r0 == 0) goto L_0x00b4 + r0 = r10 + r1 = 0 + com.ea.nimble.friends.NimbleFriendsError r2 = new com.ea.nimble.friends.NimbleFriendsError + r3 = r2 + com.ea.nimble.friends.NimbleFriendsError$Code r4 = com.ea.nimble.friends.NimbleFriendsError.Code.NIMBLE_FRIENDS_SMS_NOT_AVAILABLE + java.lang.String r5 = "Sms is not available on this device" + r3.(r4, r5) + r0.onCallback(r1, r2) + return + */ + throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.friends.NimbleOriginFriendsServiceImpl.sendInvitationOverSMS(java.util.ArrayList, java.lang.String, com.ea.nimble.friends.INimbleOriginFriendsService$NimbleFriendInvitationCallback):void"); + } + + @Override // com.ea.nimble.Component + public void setup() { + Log.Helper.LOGD(this, "Component setup"); + } + + @Override // com.ea.nimble.Component + public void suspend() { + Log.Helper.LOGV(this, "Component suspend"); + } + + /* JADX INFO: Access modifiers changed from: protected */ + @Override // com.ea.nimble.Component + public void teardown() { + Log.Helper.LOGV(this, "Component teardown"); + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/NimbleUser.java b/app/src/main/java/com/ea/nimble/friends/NimbleUser.java new file mode 100644 index 0000000..3bc8cd2 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/NimbleUser.java @@ -0,0 +1,233 @@ +package com.ea.nimble.friends; + +import com.ea.nimble.Global; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.TimeZone; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleUser.class */ +public class NimbleUser { + protected boolean addedToAllFriends; + protected String authenticatorId; + protected String displayName; + protected Map extraInfo; + protected String friendType; + protected String imageUrl; + protected String personaId; + protected String pid; + protected PlayedCurrentGameFlag playedCurrentGame; + protected Date refreshTimestamp; + protected String userId; + + /* loaded from: stdlib.jar:com/ea/nimble/friends/NimbleUser$PlayedCurrentGameFlag.class */ + public enum PlayedCurrentGameFlag { + NOT_AVAILABLE, + PLAYED, + NOT_PLAYED + } + + public NimbleUser() { + this.playedCurrentGame = PlayedCurrentGameFlag.NOT_AVAILABLE; + this.addedToAllFriends = false; + } + + public NimbleUser(NimbleUser nimbleUser) { + this.playedCurrentGame = PlayedCurrentGameFlag.NOT_AVAILABLE; + this.addedToAllFriends = false; + this.displayName = nimbleUser.getDisplayName(); + this.authenticatorId = nimbleUser.getAuthenticatorId(); + this.userId = nimbleUser.getUserId(); + this.pid = nimbleUser.getPid(); + this.personaId = nimbleUser.getPersonaId(); + this.playedCurrentGame = nimbleUser.getPlayedCurrentGame(); + this.imageUrl = nimbleUser.getImageUrl(); + this.refreshTimestamp = nimbleUser.getRefreshTimestamp(); + this.friendType = nimbleUser.getFriendType(); + this.addedToAllFriends = nimbleUser.addedToAllFriends; + if (nimbleUser.getExtraInfo() == null) { + this.extraInfo = null; + } else { + this.extraInfo = new HashMap(nimbleUser.getExtraInfo()); + } + } + + public String getAuthenticatorId() { + return this.authenticatorId; + } + + public String getDisplayName() { + return this.displayName; + } + + public Map getExtraInfo() { + return this.extraInfo; + } + + public String getFriendType() { + return this.friendType; + } + + public String getImageUrl() { + return (this.authenticatorId == null || !this.authenticatorId.equals(Global.NIMBLE_AUTHENTICATOR_FACEBOOK) || this.userId == null || this.userId.length() <= 0) ? this.imageUrl : String.format("https://graph.facebook.com/%s/picture?type=normal", this.userId); + } + + public String getPersonaId() { + return this.personaId; + } + + public String getPid() { + return this.pid; + } + + public PlayedCurrentGameFlag getPlayedCurrentGame() { + return this.playedCurrentGame; + } + + public Date getRefreshTimestamp() { + return this.refreshTimestamp; + } + + public String getUserId() { + return this.userId; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public boolean isUserUpdated(NimbleUser nimbleUser) { + if (nimbleUser == null) { + return false; + } + boolean z = false; + if (nimbleUser.getDisplayName() != null) { + z = false; + if (nimbleUser.getDisplayName() != "") { + if (getDisplayName() == null) { + z = true; + } else { + z = false; + if (!nimbleUser.getDisplayName().equals(getDisplayName())) { + z = true; + } + } + } + } + boolean z2 = z; + if (nimbleUser.getPid() != null) { + z2 = z; + if (nimbleUser.getPid() != "") { + if (getPid() == null) { + z2 = true; + } else { + z2 = z; + if (!nimbleUser.getPid().equals(getPid())) { + z2 = true; + } + } + } + } + boolean z3 = z2; + if (nimbleUser.getPersonaId() != null) { + z3 = z2; + if (nimbleUser.getPersonaId() != "") { + if (getPersonaId() == null) { + z3 = true; + } else { + z3 = z2; + if (!nimbleUser.getPersonaId().equals(getPersonaId())) { + z3 = true; + } + } + } + } + boolean z4 = z3; + if (nimbleUser.getImageUrl() != null) { + z4 = z3; + if (nimbleUser.getImageUrl() != "") { + if (getImageUrl() == null) { + z4 = true; + } else { + z4 = z3; + if (!nimbleUser.getImageUrl().equals(getImageUrl())) { + z4 = true; + } + } + } + } + boolean z5 = z4; + if (nimbleUser.getPlayedCurrentGame() != null) { + if (getPlayedCurrentGame() == null) { + z5 = true; + } else { + z5 = z4; + if (!nimbleUser.getPlayedCurrentGame().equals(getPlayedCurrentGame())) { + z5 = true; + } + } + } + return z5; + } + + /* JADX INFO: Access modifiers changed from: protected */ + public void setAuthenticatorId(String str) { + this.authenticatorId = str; + } + + /* JADX INFO: Access modifiers changed from: protected */ + public void setDisplayName(String str) { + this.displayName = str; + } + + protected void setExtraInfo(Map map) { + this.extraInfo = map; + } + + /* JADX INFO: Access modifiers changed from: protected */ + public void setFriendType(String str) { + this.friendType = str; + } + + /* JADX INFO: Access modifiers changed from: protected */ + public void setImageUrl(String str) { + this.imageUrl = str; + } + + /* JADX INFO: Access modifiers changed from: protected */ + public void setPersonaId(String str) { + this.personaId = str; + } + + /* JADX INFO: Access modifiers changed from: protected */ + public void setPid(String str) { + this.pid = str; + } + + protected void setPlayedCurrentGame(PlayedCurrentGameFlag playedCurrentGameFlag) { + this.playedCurrentGame = playedCurrentGameFlag; + } + + /* JADX INFO: Access modifiers changed from: protected */ + public void setRefreshTimestamp(Date date) { + this.refreshTimestamp = date; + } + + /* JADX INFO: Access modifiers changed from: protected */ + public void setUserId(String str) { + this.userId = str; + } + + public String toString() { + String str; + String str2 = this.playedCurrentGame == PlayedCurrentGameFlag.PLAYED ? "YES" : this.playedCurrentGame == PlayedCurrentGameFlag.NOT_PLAYED ? "NO" : this.playedCurrentGame == PlayedCurrentGameFlag.NOT_AVAILABLE ? "NOT AVAILABLE" : "UNKNOWN"; + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS", Locale.US); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles")); + str = simpleDateFormat.format(this.refreshTimestamp); + } catch (Exception e) { + str = ""; + } + new String(); + return ("displayName(" + getDisplayName() + ") friendId(" + getUserId() + ") pid(" + this.pid + ") personaId(" + getPersonaId() + ") imageUrl(" + getImageUrl() + ") authenticatorId(" + getAuthenticatorId() + ") playedCurrentGame(" + str2 + ")refreshTimestamp(" + str + ")") + "ExtraInfo(" + (getExtraInfo() == null ? "" : getExtraInfo().toString()) + ") \n"; + } +} diff --git a/app/src/main/java/com/ea/nimble/friends/UserInfoFromIdentity.java b/app/src/main/java/com/ea/nimble/friends/UserInfoFromIdentity.java new file mode 100644 index 0000000..480a033 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/friends/UserInfoFromIdentity.java @@ -0,0 +1,28 @@ +package com.ea.nimble.friends; + +import org.json.JSONObject; + +/* loaded from: stdlib.jar:com/ea/nimble/friends/UserInfoFromIdentity.class */ +class UserInfoFromIdentity { + private String externalRefValue; + private String personaId; + private String pidId; + + public UserInfoFromIdentity(JSONObject jSONObject) { + this.pidId = jSONObject.optString("pidId"); + this.personaId = jSONObject.optString("personaId"); + this.externalRefValue = jSONObject.optString("externalRefValue"); + } + + public String getExternalRefValue() { + return this.externalRefValue; + } + + public String getPersonaId() { + return this.personaId; + } + + public String getPidId() { + return this.pidId; + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorAnonymous.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorAnonymous.java new file mode 100644 index 0000000..d79808e --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/AuthenticatorAnonymous.java @@ -0,0 +1,239 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Base; +import com.ea.nimble.Error; +import com.ea.nimble.Global; +import com.ea.nimble.Log; +import com.ea.nimble.Network; +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.Persistence; +import com.ea.nimble.PersistenceService; +import com.ea.nimble.Timer; +import com.ea.nimble.Utility; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import com.ea.nimble.identity.NimbleIdentityError; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/AuthenticatorAnonymous.class */ +public class AuthenticatorAnonymous extends AuthenticatorBase { + private static final String ANONYMOUS_USER_NAME = "Guest"; + private static final double INITIAL_RETRY_TIME = 1.0d; + private static final double MAX_RETRY_TIME = 300.0d; + private static final String PID_TYPE = "mobile_upid"; + private static final String URL_TEMPLATE_ANONYMOUS_LOGIN = "%s/connect/auth?mobile_login_type=mobile_game_UPID&mobile_UPIDToken=%s&client_id=%s&response_type=code&redirect_uri=nucleus:rest"; + private static final String URL_TEMPLATE_ANONYMOUS_UPIDTOKEN = "%s/connect/upidtoken?client_id=%s"; + private String m_upidToken = ""; + private double m_currentRetryTime = INITIAL_RETRY_TIME; + private Timer m_retryTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorAnonymous.1 + @Override // java.lang.Runnable + public void run() { + AuthenticatorAnonymous.this.onRetryTimerExpired(); + } + }); + + private AuthenticatorAnonymous() { + this.TAG = "AuthenticatorAnonymous"; + } + + public void exchangeUpidTokenForAuthCode() { + synchronized (this) { + URL url = null; + try { + NimbleIdentityConfig configuration = getConfiguration(); + url = new URL(String.format(URL_TEMPLATE_ANONYMOUS_LOGIN, configuration.getConnectServerUrl(), this.m_upidToken, configuration.getClientId())); + } catch (MalformedURLException e) { + } + this.m_authenticateRequest = Network.getComponent().sendGetRequest(url, new HashMap<>(), new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorAnonymous.3 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + try { + Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); + String str = (String) parseBodyJSONData.get("code"); + if (!Utility.validString(str)) { + AuthenticatorAnonymous.this.closeAuthentication(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Cannot read login OAuth code data from server response data " + parseBodyJSONData)); + return; + } + synchronized (this) { + AuthenticatorAnonymous.this.exchangeAuthCodeToToken(str); + } + } catch (Error e2) { + AuthenticatorAnonymous.this.closeAuthentication(e2); + } + } + }); + } + } + + private void getUpidToken() { + synchronized (this) { + URL url = null; + try { + NimbleIdentityConfig configuration = getConfiguration(); + url = new URL(String.format(URL_TEMPLATE_ANONYMOUS_UPIDTOKEN, configuration.getConnectServerUrl(), configuration.getClientId())); + } catch (MalformedURLException e) { + } + this.m_authenticateRequest = Network.getComponent().sendGetRequest(url, new HashMap<>(), new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorAnonymous.2 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + Exception error = networkConnectionHandle.getResponse().getError(); + if (error != null) { + AuthenticatorAnonymous.this.closeAuthentication(error instanceof Error ? (Error) error : new Error(Error.Code.NETWORK_CONNECTION_ERROR, "Connection error", error)); + } + String str = null; + try { + str = Utility.readStringFromStream(networkConnectionHandle.getResponse().getDataStream()); + } catch (IOException e2) { + } + if (!Utility.validString(str)) { + AuthenticatorAnonymous.this.closeAuthentication(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Cannot read UPID token from server response")); + return; + } + synchronized (this) { + AuthenticatorAnonymous.this.m_upidToken = str; + AuthenticatorAnonymous.this.saveUpidToken(); + AuthenticatorAnonymous.this.exchangeUpidTokenForAuthCode(); + } + } + }); + } + } + + private static void initialize() { + Log.Helper.LOGVS("AuthenticatorAnonymous", "Initializing...", new Object[0]); + AuthenticatorAnonymous authenticatorAnonymous = new AuthenticatorAnonymous(); + Base.registerComponent(authenticatorAnonymous, authenticatorAnonymous.getComponentId()); + } + + private void loadUpidToken() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent == null) { + this.m_upidToken = null; + return; + } + this.m_upidToken = persistenceForNimbleComponent.getStringValue("UpidToken"); + if (this.m_upidToken == null) { + this.m_upidToken = persistenceForNimbleComponent.getStringValue("upid_token"); + } + } + + private void login(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + synchronized (this) { + this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING; + if (nimbleIdentityAuthenticatorCallback != null) { + this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + Log.Helper.LOGDS(this.TAG, "Anonymous Login", new Object[0]); + if (Utility.validString(this.m_upidToken)) { + Log.Helper.LOGVS(this.TAG, "Found cached UPID token %s, use it for login", this.m_upidToken); + exchangeUpidTokenForAuthCode(); + } else { + Log.Helper.LOGVS(this.TAG, "Request a new User PID token", new Object[0]); + getUpidToken(); + } + } + } + + public void onRetryTimerExpired() { + Log.Helper.LOGDS(this.TAG, "Retry timer expired. Attempting login now", new Object[0]); + login(null); + } + + public void saveUpidToken() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent != null) { + if (!persistenceForNimbleComponent.getBackUp()) { + persistenceForNimbleComponent.setBackUp(true); + } + persistenceForNimbleComponent.setValue("UpidToken", this.m_upidToken); + persistenceForNimbleComponent.synchronize(); + } + } + + /* JADX INFO: Access modifiers changed from: package-private */ + @Override // com.ea.nimble.identity.AuthenticatorBase + public void autoLogin() { + Log.Helper.LOGIS(this.TAG, "Anonymous authenticator Autologin.", new Object[0]); + this.m_autoLoginAttempt = true; + login(null); + } + + /* JADX INFO: Access modifiers changed from: protected */ + @Override // com.ea.nimble.identity.AuthenticatorBase + public void closeAuthentication(Error error) { + if (error == null || !this.m_autoLoginAttempt) { + this.m_currentRetryTime = INITIAL_RETRY_TIME; + this.m_retryTimer.cancel(); + super.closeAuthentication(error); + return; + } + double d = this.m_currentRetryTime; + this.m_currentRetryTime = Math.min(this.m_currentRetryTime * 2.0d, 300.0d); + Log.Helper.LOGDS(this.TAG, "Auto login failed. Retrying in %.1f seconds", Double.valueOf(d)); + this.m_retryTimer.schedule(d, false); + } + + /* JADX INFO: Access modifiers changed from: protected */ + @Override // com.ea.nimble.identity.AuthenticatorBase + public void completeMigration() { + Log.Helper.LOGDS(this.TAG, "Complete migration called for Anonymous authenticator", new Object[0]); + cleanAtLogout(null); + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public String getAuthenticatorId() { + return Global.NIMBLE_AUTHENTICATOR_ANONYMOUS; + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + Log.Helper.LOGWS(this.TAG, "Anonymous authenticator is self-maintained, explicitly calling login on the anonymous authenticator does nothing.", new Object[0]); + if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(this, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNSUPPORTED_ACTION, "Anonymous authenticator is self-maintained, explicitly calling login on the anonymous authenticator does nothing.")); + } + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void logout(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + Log.Helper.LOGWS(this.TAG, "Anonymous authenticator is self-maintained, explicitly calling logout on the anonymous authenticator does nothing.", new Object[0]); + NimbleIdentityError nimbleIdentityError = new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNSUPPORTED_ACTION, "Anonymous authenticator is self-maintained, explicitly calling logout on the anonymous authenticator does nothing."); + if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(null, nimbleIdentityError); + } + } + + public void logoutInternal(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + Log.Helper.LOGIS(this.TAG, "Anonymous authenticator logout internal.", new Object[0]); + if (NimbleIdentityImpl.getComponent().getLoggedInAuthenticators().size() == 1) { + Log.Helper.LOGWS(this.TAG, "Attempting to logout the anonymous authenticator but it is the only one logged in. Aborting", new Object[0]); + return; + } + cancelAuthentication(); + cleanAtLogout(nimbleIdentityAuthenticatorCallback); + } + + @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.identity.INimbleIdentityAuthenticator + public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) { + requestIdentityForFriends(PID_TYPE, arrayList, nimbleIdentityFriendsIdentityInfoCallback); + } + + @Override // com.ea.nimble.identity.AuthenticatorBase + public void restoreAuthenticator(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + this.m_userInfo.setUserName(ANONYMOUS_USER_NAME); + this.m_userInfo.setDisplayName(ANONYMOUS_USER_NAME); + loadUpidToken(); + super.restoreAuthenticator(nimbleIdentityAuthenticatorCallback); + } + + @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.Component + public void suspend() { + super.suspend(); + this.m_retryTimer.cancel(); + this.m_currentRetryTime = INITIAL_RETRY_TIME; + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java new file mode 100644 index 0000000..ea245ca --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/AuthenticatorBase.java @@ -0,0 +1,1202 @@ +package com.ea.nimble.identity; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +import com.ea.nimble.Base; +import com.ea.nimble.Component; +import com.ea.nimble.Error; +import com.ea.nimble.Global; +import com.ea.nimble.HttpRequest; +import com.ea.nimble.IHttpRequest; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Network; +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.Persistence; +import com.ea.nimble.PersistenceService; +import com.ea.nimble.Timer; +import com.ea.nimble.Utility; +import com.ea.nimble.tracking.ITracking; +import com.ea.nimble.tracking.Tracking; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/AuthenticatorBase.class */ +public abstract class AuthenticatorBase extends Component implements LogSource, INimbleIdentityAuthenticator { + private static final String AUTHORIZATION_KEY = "Authorization"; + private static final String DATA_CONTENT_TYPE_KEY = "Content-type"; + private static final String DATA_CONTENT_TYPE_VALUE = "application/x-www-form-urlencoded"; + private static final String DATA_TEMPLATE_LOGIN_WITH_OAUTH_CODE = "grant_type=authorization_code&code=%s&client_id=%s&client_secret=%s&redirect_uri=nucleus:rest"; + private static final String DATA_TEMPLATE_LOGIN_WITH_REFRESH_TOKEN = "grant_type=refresh_token&refresh_token=%s&client_id=%s&client_secret=%s&redirect_uri=nucleus:rest"; + private static final double DEFAULT_RETRY_INTERVAL = 60.0d; + private static final double EXPIRY_MARGIN_FOR_TIMER = 5.0d; + public static final String NIMBLE_IDENTITY_PERSISTENCE_TOKEN_SUFFIX = "nimble_identity_access_token"; + private static final String REQUEST_HEADER_PERSONA_INFO_EXTRA_FLAG = "X-Expand-Results"; + private static final String REQUEST_HEADER_PID_INFO_EXTRA_FLAG = "X-Include-Underage"; + private static final String REQUEST_HEADER_REFRESH_TOKEN_EXTRA_FLAG = "X-Include-RT-Time"; + private static final String REQUEST_HEADER_TRUE_VALUE = "true"; + private static final String URL_TEMPALTE_GET_IDENTITY_INFO_FOR_FRIENDS = "/proxy/identity/pids/personaextref/bulk"; + private static final String URL_TEMPLATE_GET_PERSONA_INFO = "%s/proxy/identity/pids/me/personas"; + private static final String URL_TEMPLATE_GET_PID_INFO = "%s/proxy/identity/pids/me"; + private static final String URL_TEMPLATE_LOGIN = "%s/connect/token"; + private static final String URL_TEMPLATE_LOGOUT = "%s/connect/clearsid?client_id=%s&access_token=%s"; + private static final String URL_TEMPLATE_REQUEST_SERVER_AUTHENTICATION_OAUTH_CODE = "%s/connect/auth?client_id=%s&response_type=code&access_token=%s&redirect_uri=nucleus:rest"; + protected NetworkConnectionHandle m_authenticateRequest; + protected boolean m_autoLoginAttempt; + private NetworkConnectionHandle m_personaRequest; + private ArrayList m_personas; + private NimbleIdentityPidInfo m_pidInfo; + private NetworkConnectionHandle m_pidInfoRequest; + private NimbleIdentityToken m_token; + protected INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState m_state = INimbleIdentityAuthenticator.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<>(); + private Timer m_tokenRefreshTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorBase.1 + @Override // java.lang.Runnable + public void run() { + AuthenticatorBase.this.onTokenRefreshTimer(); + } + }); + private Timer m_userProfileRefreshTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorBase.2 + @Override // java.lang.Runnable + public void run() { + AuthenticatorBase.this.onUserProfileRefreshTimer(); + } + }); + private Timer m_pidInfoRefreshTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorBase.3 + @Override // java.lang.Runnable + public void run() { + AuthenticatorBase.this.onPidInfoRefreshTimer(); + } + }); + private Timer m_personaRefreshTimer = new Timer(new Runnable() { // from class: com.ea.nimble.identity.AuthenticatorBase.4 + @Override // java.lang.Runnable + public void run() { + AuthenticatorBase.this.onPersonaRefreshTimer(); + } + }); + protected String TAG = "AuthenticatorBase"; + private BroadcastReceiver m_networkChangeReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.AuthenticatorBase.5 + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + AuthenticatorBase.this.onNetworkChange(); + } + }; + protected BroadcastReceiver m_identityConfigChangeReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.AuthenticatorBase.6 + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + AuthenticatorBase.this.onConfigurationChange(); + } + }; + + /* loaded from: stdlib.jar:com/ea/nimble/identity/AuthenticatorBase$INimbleIdentityInternalServiceRequestCallback.class */ + interface INimbleIdentityInternalServiceRequestCallback { + void onServiceComplete(Error error); + } + + /* JADX WARN: Type inference failed for: r0v42, types: [double] */ + /* JADX WARN: Type inference failed for: r9v1 */ + /* JADX WARN: Type inference failed for: r9v2 */ + /* JADX WARN: Type inference failed for: r9v3 */ + /* JADX WARN: Type inference failed for: r9v5 */ + /* JADX WARN: Unknown variable types count: 2 */ + /* + Code decompiled incorrectly, please refer to instructions dump. + To view partially-correct code enable 'Show inconsistent code' option in preferences + */ + public void closePersonaUpdate(com.ea.nimble.Error r8) { + /* + Method dump skipped, instructions count: 213 + To view this dump change 'Code comments level' option to 'DEBUG' + */ + throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.identity.AuthenticatorBase.closePersonaUpdate(com.ea.nimble.Error):void"); + } + + public void closePidInfoUpdate(Error error) { + ArrayList arrayList; + if (error == null) { + Log.Helper.LOGVS(this.TAG, "Updating pid information succeed!", new Object[0]); + } else { + Log.Helper.LOGES(this.TAG, "Fail to get pid information from Identity server for error %s", error); + } + synchronized (this) { + this.m_pidInfoRequest = null; + if (getConfiguration().getAutoRefresh() && this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (error == null) { + this.m_pidInfoRefreshTimer.schedule((((double) (this.m_pidInfo.getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); + } else { + this.m_pidInfoRefreshTimer.schedule(60.0d, false); + } + } + arrayList = this.m_pidInfoCallbacks; + this.m_pidInfoCallbacks = new ArrayList<>(); + } + Iterator it = arrayList.iterator(); + while (it.hasNext()) { + it.next().onCallback(this, error); + } + } + + private Error environmentCheck() { + Error error; + synchronized (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); + } + error = new Error(Error.Code.NETWORK_NO_CONNECTION, "Idenitity cannot work without network."); + } else { + NimbleIdentityConfig configuration = getConfiguration(); + error = (configuration == null || !configuration.isReady()) ? new Error(Error.Code.NOT_READY, "Identity is still in initialization and not ready for operation.") : NimbleIdentityImpl.getComponent().getAuthenticationConductor() == null ? new Error(Error.Code.NOT_READY, "No authentication conductor has been set yet.") : null; + } + } + return error; + } + + private void loadPidInfo() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent != null) { + this.m_pidInfo = (NimbleIdentityPidInfo) persistenceForNimbleComponent.getValue("pidInfo"); + if (this.m_pidInfo != null) { + Log.Helper.LOGDS(this.TAG, "Restored existing pidInfo (pid = %s) for %s authenticator from persistence.", this.m_pidInfo.getPid(), getAuthenticatorId()); + HashMap hashMap = new HashMap(); + hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); + Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE, hashMap); + return; + } + Log.Helper.LOGDS(this.TAG, "The previous Exception in Persistence while getting NimbleIdentityPidInfo can be safely ignored. A cached value for pidInfo does not exist or was stored in an older format. This value will instead be retrieved from the server.", new Object[0]); + } + } + + private void loadState() { + Boolean bool; + 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_NONE; + Log.Helper.LOGVS(this.TAG, "Loaded state: NONE", new Object[0]); + return; + } + this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE; + Log.Helper.LOGVS(this.TAG, "Loaded state: OFFLINE", new Object[0]); + } + + private void loadToken() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent == null) { + this.m_token = null; + return; + } + this.m_token = (NimbleIdentityToken) persistenceForNimbleComponent.getValue("token"); + Log.Helper.LOGVS(this.TAG, "Loading token: " + this.m_token, new Object[0]); + } + + public void onConfigurationChange() { + Log.Helper.LOGVS(this.TAG, "Identity resumes after configuration changed.", new Object[0]); + resume(); + } + + public void onNetworkChange() { + if (Network.getComponent().getStatus() == Network.Status.OK) { + Log.Helper.LOGDS(this.TAG, "Identity resumes after network recovered.", new Object[0]); + resume(); + return; + } + if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + cancelAuthentication(); + } + if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { + setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); + } + } + + public void onPersonaRefreshTimer() { + refreshPersonas(null); + } + + public void onPidInfoRefreshTimer() { + refreshPidInfo(null); + } + + public void onTokenRefreshTimer() { + this.m_tokenRefreshTimer.cancel(); + refreshToken(); + } + + public void onTokenResponse(NetworkConnectionHandle networkConnectionHandle) { + if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE) { + try { + Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); + NimbleIdentityToken nimbleIdentityToken = new NimbleIdentityToken(parseBodyJSONData); + if (!Utility.validString(nimbleIdentityToken.getAccessToken()) || !Utility.validString(nimbleIdentityToken.getRefreshToken())) { + closeAuthentication(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse token from server response data " + parseBodyJSONData)); + return; + } + this.m_pidInfoCallbacks.add(new INimbleIdentityAuthenticator.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); + } + }); + synchronized (this) { + this.m_token = nimbleIdentityToken; + saveToken(); + updateUserProfile(); + updatePidInfo(); + updatePersonas(); + } + } catch (Error e) { + closeAuthentication(e); + } + } + } + + public void onUserProfileRefreshTimer() { + refreshUserProfile(null); + } + + private void prepare(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + synchronized (this) { + Error environmentCheck = environmentCheck(); + if (environmentCheck != null) { + if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(this, environmentCheck); + } + } else if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING || this.m_token == null || this.m_token.getRefreshTokenExpiryTime().before(new Date())) { + if (nimbleIdentityAuthenticatorCallback != null) { + this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + autoLogin(); + } + } else if (!this.m_token.getAccessTokenExpiryTime().after(new Date())) { + if (nimbleIdentityAuthenticatorCallback != null) { + this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + refreshToken(); + } else if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(this, null); + } + } + } + + private void refreshToken() { + ByteArrayOutputStream byteArrayOutputStream; + synchronized (this) { + Log.Helper.LOGVS(this.TAG, "Refreshing token to get access token.", new Object[0]); + if (this.m_tokenRefreshTimer.isRunning()) { + this.m_tokenRefreshTimer.cancel(); + } + setState(INimbleIdentityAuthenticator.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 = new URL(String.format(URL_TEMPLATE_LOGIN, configuration.getConnectServerUrl())); + try { + byte[] bytes = format.getBytes("UTF-8"); + byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); + try { + byteArrayOutputStream.write(bytes); + } catch (IOException e) { + } + } catch (IOException e2) { + byteArrayOutputStream = null; + } + } catch (IOException e3) { + byteArrayOutputStream = null; + } + HashMap hashMap = new HashMap<>(); + hashMap.put(DATA_CONTENT_TYPE_KEY, DATA_CONTENT_TYPE_VALUE); + hashMap.put(REQUEST_HEADER_REFRESH_TOKEN_EXTRA_FLAG, REQUEST_HEADER_TRUE_VALUE); + HttpRequest httpRequest = new HttpRequest(url); + httpRequest.method = IHttpRequest.Method.POST; + httpRequest.headers = hashMap; + httpRequest.data = byteArrayOutputStream; + httpRequest.runInBackground = true; + this.m_authenticateRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.13 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + if (networkConnectionHandle.getResponse().getError() != null) { + AuthenticatorBase.this.autoLogin(); + } else { + AuthenticatorBase.this.onTokenResponse(networkConnectionHandle); + } + } + }); + } + } + + public void refreshUserProfile(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + synchronized (this) { + Error environmentCheck = environmentCheck(); + if (environmentCheck == null) { + Log.Helper.LOGVS(this.TAG, "Ready to refresh user profile", new Object[0]); + if (this.m_userProfileRefreshTimer.isRunning()) { + this.m_userProfileRefreshTimer.cancel(); + } + if (nimbleIdentityAuthenticatorCallback != null) { + this.m_pidInfoCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + updateUserProfile(); + } else if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(this, environmentCheck); + } + } + } + + private void resume(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + synchronized (this) { + if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { + Log.Helper.LOGIS(this.TAG, "Skipping autoLogin for state NONE", new Object[0]); + } else { + if (nimbleIdentityAuthenticatorCallback != null) { + this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + if (environmentCheck() != null) { + Log.Helper.LOGIS(this.TAG, "Authenticator %s resume failing - environment not ready.", getAuthenticatorId()); + } else if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + Log.Helper.LOGIS(this.TAG, "Skipping autoLogin for state GOING", new Object[0]); + } else { + if (this.m_token != null) { + if (this.m_token.getAccessTokenExpiryTime().after(new Date())) { + closeAuthentication(null); + getPidInfo(); + getPersonas(); + getUserInfo(); + } else if (this.m_token.getRefreshTokenExpiryTime().after(new Date())) { + refreshToken(); + } + } + autoLogin(); + } + } + } + } + + private void savePidInfo() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent != null && this.m_pidInfo != null) { + persistenceForNimbleComponent.setValue("pidInfo", this.m_pidInfo); + persistenceForNimbleComponent.synchronize(); + Log.Helper.LOGDS(this.TAG, "Saved current pidInfo (pid = %s) for %s authenticator to persistence.", this.m_pidInfo.getPid(), getAuthenticatorId()); + } + } + + private void saveState() { + 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; + 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); + } + } + + private void saveToken() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent != null) { + Log.Helper.LOGVS(this.TAG, "Saving token: " + this.m_token, new Object[0]); + persistenceForNimbleComponent.setValue("token", this.m_token); + } + } + + public void updatePersonas() { + if (this.m_personaRequest != null) { + Log.Helper.LOGVS(this.TAG, "Persona update in progress, skipping", new Object[0]); + return; + } + Log.Helper.LOGVS(this.TAG, "Updating persona info", new Object[0]); + URL url = null; + try { + url = new URL(String.format(URL_TEMPLATE_GET_PERSONA_INFO, getConfiguration().getProxyServerUrl())); + } catch (MalformedURLException e) { + } + String format = String.format("%s %s", this.m_token.getType(), this.m_token.getAccessToken()); + HashMap hashMap = new HashMap<>(); + hashMap.put(AUTHORIZATION_KEY, format); + hashMap.put(REQUEST_HEADER_PERSONA_INFO_EXTRA_FLAG, REQUEST_HEADER_TRUE_VALUE); + HttpRequest httpRequest = new HttpRequest(url); + httpRequest.method = IHttpRequest.Method.GET; + httpRequest.headers = hashMap; + this.m_personaRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.16 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + try { + Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); + Map map = (Map) parseBodyJSONData.get("personas"); + if (map == null) { + AuthenticatorBase.this.closePersonaUpdate(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse persona information from server response data " + parseBodyJSONData)); + } + List list = (List) map.get("persona"); + if (list == null) { + AuthenticatorBase.this.closePersonaUpdate(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse persona information from server response data " + parseBodyJSONData)); + } + ArrayList arrayList = new ArrayList(); + Date date = new Date(System.currentTimeMillis() + ((long) (AuthenticatorBase.this.getConfiguration().getExpiryInterval() * 1000.0d))); + for (Map map2 : list) { + arrayList.add(new NimbleIdentityPersona(map2, date)); + } + Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Update personas successfully with new data", new Object[0]); + synchronized (this) { + AuthenticatorBase.this.m_personas = arrayList; + } + AuthenticatorBase.this.closePersonaUpdate(null); + HashMap hashMap2 = new HashMap(); + hashMap2.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, AuthenticatorBase.this.getAuthenticatorId()); + Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_PERSONA_INFO_UPDATE, hashMap2); + } catch (Error e2) { + AuthenticatorBase.this.closePersonaUpdate(e2); + } + } + }); + } + + public void updatePidInfo() { + if (this.m_pidInfoRequest != null) { + Log.Helper.LOGVS(this.TAG, "Pid info update in progress, skipping", new Object[0]); + return; + } + Log.Helper.LOGVS(this.TAG, "Updating pid info", new Object[0]); + URL url = null; + try { + url = new URL(String.format(URL_TEMPLATE_GET_PID_INFO, getConfiguration().getProxyServerUrl())); + } catch (MalformedURLException e) { + } + String format = String.format("%s %s", this.m_token.getType(), this.m_token.getAccessToken()); + HashMap hashMap = new HashMap<>(); + hashMap.put(AUTHORIZATION_KEY, format); + hashMap.put(REQUEST_HEADER_PID_INFO_EXTRA_FLAG, REQUEST_HEADER_TRUE_VALUE); + HttpRequest httpRequest = new HttpRequest(url); + httpRequest.method = IHttpRequest.Method.GET; + httpRequest.headers = hashMap; + this.m_pidInfoRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.15 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + try { + Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); + Date date = new Date(System.currentTimeMillis() + ((long) (AuthenticatorBase.this.getConfiguration().getExpiryInterval() * 1000.0d))); + NimbleIdentityPidInfo nimbleIdentityPidInfo = new NimbleIdentityPidInfo(parseBodyJSONData, date); + if (!Utility.validString(nimbleIdentityPidInfo.getPid())) { + AuthenticatorBase.this.closePidInfoUpdate(new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse valid pid information from server response data " + parseBodyJSONData)); + } else if (nimbleIdentityPidInfo.equals(AuthenticatorBase.this.m_pidInfo)) { + Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Update pid info succesfully, but nothing change.", new Object[0]); + AuthenticatorBase.this.m_pidInfo.setExpiryTime(date); + AuthenticatorBase.this.closePidInfoUpdate(null); + } else { + Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Update pid info successfully with new data.", new Object[0]); + NimbleIdentityUserInfo nimbleIdentityUserInfo = AuthenticatorBase.this.m_userInfo == null ? new NimbleIdentityUserInfo() : AuthenticatorBase.this.m_userInfo.clone(); + nimbleIdentityUserInfo.setPid(nimbleIdentityPidInfo.getPid()); + if (Utility.validString(nimbleIdentityPidInfo.getDob())) { + nimbleIdentityUserInfo.setDateOfBirth(nimbleIdentityPidInfo.getDob()); + } + synchronized (AuthenticatorBase.this) { + AuthenticatorBase.this.m_pidInfo = nimbleIdentityPidInfo; + AuthenticatorBase.this.m_userInfo = nimbleIdentityUserInfo; + } + AuthenticatorBase.this.closePidInfoUpdate(null); + HashMap hashMap2 = new HashMap(); + hashMap2.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, AuthenticatorBase.this.getAuthenticatorId()); + hashMap2.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_PIDMAP_ID, NimbleIdentityImpl.getComponent().getPidMapInternal()); + Utility.sendBroadcastSerializable(Global.NIMBLE_NOTIFICATION_IDENTITY_USER_INFO_UPDATE, hashMap2); + Utility.sendBroadcastSerializable(Global.NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE, hashMap2); + } + } catch (Error e2) { + AuthenticatorBase.this.closePidInfoUpdate(e2); + } + } + }); + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public abstract void autoLogin(); + + public void cancelAuthentication() { + if (this.m_pidInfoRequest != null) { + this.m_pidInfoRequest.cancel(); + this.m_pidInfoRequest = null; + } + if (this.m_personaRequest != null) { + this.m_personaRequest.cancel(); + this.m_personaRequest = null; + } + if (this.m_state == INimbleIdentityAuthenticator.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); + } + } + + protected void cleanAtLogout(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + synchronized (this) { + if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + URL url = null; + try { + NimbleIdentityConfig configuration = getConfiguration(); + url = new URL(String.format(URL_TEMPLATE_LOGOUT, configuration.getConnectServerUrl(), configuration.getClientId(), this.m_token.getAccessToken())); + } catch (MalformedURLException e) { + } + HttpRequest httpRequest = new HttpRequest(url); + httpRequest.method = IHttpRequest.Method.GET; + Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.17 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + if (networkConnectionHandle.getResponse().getError() != null) { + } + if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(AuthenticatorBase.this, null); + } + } + }); + if (this.m_tokenRefreshTimer.isRunning()) { + this.m_tokenRefreshTimer.cancel(); + } + if (this.m_pidInfoRefreshTimer.isRunning()) { + this.m_pidInfoRefreshTimer.cancel(); + } + if (this.m_personaRefreshTimer.isRunning()) { + this.m_personaRefreshTimer.cancel(); + } + this.m_token = null; + saveToken(); + String pid = this.m_pidInfo != null ? this.m_pidInfo.getPid() : null; + boolean z = this.m_pidInfo != null; + this.m_pidInfo = null; + boolean z2 = this.m_personas != null; + this.m_personas = null; + setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); + Log.Helper.LOGDS(this.TAG, "Logout of authenticator " + getAuthenticatorId(), new Object[0]); + if (z) { + HashMap hashMap = new HashMap(); + hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); + Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_PID_INFO_UPDATE, hashMap); + } + if (z2) { + HashMap hashMap2 = new HashMap(); + hashMap2.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); + Utility.sendBroadcast(Global.NIMBLE_NOTIFICATION_IDENTITY_PERSONA_INFO_UPDATE, hashMap2); + } + Component component = Base.getComponent(Tracking.COMPONENT_ID); + if (!(component == null || pid == null)) { + ITracking iTracking = (ITracking) component; + HashMap hashMap3 = new HashMap(); + hashMap3.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_PIDMAP_LOGOUT, NimbleIdentityImpl.getComponent().getPidMapInternal().toString()); + HashMap hashMap4 = new HashMap(); + hashMap4.put(getAuthenticatorId(), pid); + hashMap3.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE, Utility.convertObjectToJSONString(hashMap4)); + iTracking.logEvent(Tracking.NIMBLE_TRACKING_EVENT_IDENTITY_LOGOUT, hashMap3); + } + NimbleIdentityAuthenticationConductorHandler authenticationConductor = NimbleIdentityImpl.getComponent().getAuthenticationConductor(); + if (authenticationConductor != null) { + authenticationConductor.handleLogout(this); + } + } else if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + setState(INimbleIdentityAuthenticator.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); + } + NimbleIdentityAuthenticationConductorHandler authenticationConductor2 = NimbleIdentityImpl.getComponent().getAuthenticationConductor(); + if (authenticationConductor2 != null) { + authenticationConductor2.handleLogout(this); + } + } else { + setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE); + } + } + } + + @Override // com.ea.nimble.Component + public void cleanup() { + Utility.unregisterReceiver(this.m_networkChangeReceiver); + Utility.unregisterReceiver(this.m_identityConfigChangeReceiver); + } + + public void closeAuthentication(Error error) { + ArrayList arrayList; + synchronized (this) { + this.m_authenticateRequest = null; + if (error == null) { + Log.Helper.LOGVS(this.TAG, "Authentication succeed!", new Object[0]); + Log.Helper.LOGWS(this.TAG, "\n\n\nAuthentication succeeded for %s\n\n\n", getAuthenticatorId()); + Component component = Base.getComponent(Tracking.COMPONENT_ID); + if (component != null) { + ITracking iTracking = (ITracking) component; + HashMap hashMap = new HashMap(); + HashMap hashMap2 = new HashMap(); + HashMap pidMapInternal = NimbleIdentityImpl.getComponent().getPidMapInternal(); + for (String str : pidMapInternal.keySet()) { + if (str != null && !str.equals(getAuthenticatorId())) { + hashMap2.put(str, pidMapInternal.get(str)); + } + } + hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_PIDMAP_LOGIN, Utility.convertObjectToJSONString(hashMap2)); + HashMap hashMap3 = new HashMap(); + NimbleIdentityPidInfo pidInfo = getPidInfo(); + if (pidInfo != null) { + hashMap3.put(getAuthenticatorId(), Utility.safeString(pidInfo.getPid())); + } else { + hashMap3.put(getAuthenticatorId(), ""); + } + 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); + if (getConfiguration().getAutoRefresh()) { + this.m_tokenRefreshTimer.schedule((((double) (this.m_token.getAccessTokenExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); + } + NimbleIdentityImpl component2 = NimbleIdentityImpl.getComponent(); + if (component2 != null) { + NimbleIdentityAuthenticationConductorHandler authenticationConductor = component2.getAuthenticationConductor(); + if (authenticationConductor != null) { + authenticationConductor.handleLogin(this, this.m_autoLoginAttempt); + } else { + Log.Helper.LOGWS(this.TAG, "\n\n\n@@@@@@@@@@@@@@@@Attempting to login with no conductor registered!~!!!!!@@@@@@@@@@@@@\n\n\n", new Object[0]); + } + } + } else { + Log.Helper.LOGES(this.TAG, "Authentication failed with error %s.", error); + cleanAtLogout(null); + } + arrayList = this.m_authenticateCallbacks; + this.m_authenticateCallbacks = new ArrayList<>(); + } + this.m_autoLoginAttempt = false; + Iterator it = arrayList.iterator(); + while (it.hasNext()) { + it.next().onCallback(this, error); + } + } + + protected void closeUserInfoUpdate(Error error, boolean z) { + ArrayList arrayList; + if (error == null) { + Log.Helper.LOGVS(this.TAG, "Updating user profile succeed!", new Object[0]); + } else { + Log.Helper.LOGES(this.TAG, "Fail to get user profile for error %s", error); + } + synchronized (this) { + if (z) { + if (getConfiguration().getAutoRefresh() && this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (error != null || this.m_userInfo.getExpiryTime() == null) { + this.m_userProfileRefreshTimer.schedule(60.0d, false); + } else { + this.m_userProfileRefreshTimer.schedule((((double) (this.m_userInfo.getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); + } + } + } + arrayList = this.m_userInfoCallbacks; + this.m_userInfoCallbacks = new ArrayList<>(); + } + Iterator it = arrayList.iterator(); + while (it.hasNext()) { + it.next().onCallback(this, error); + } + } + + public void completeMigration() { + Log.Helper.LOGDS(this.TAG, "AuthenticatorBase complete migration called - has no implementation", new Object[0]); + } + + public void enableAutoRefresh(boolean z) { + synchronized (this) { + if (!z) { + if (this.m_tokenRefreshTimer.isRunning()) { + this.m_tokenRefreshTimer.cancel(); + } + if (this.m_pidInfoRefreshTimer.isRunning()) { + this.m_pidInfoRefreshTimer.cancel(); + } + if (this.m_personaRefreshTimer.isRunning()) { + this.m_personaRefreshTimer.cancel(); + } + } else if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + if (!this.m_tokenRefreshTimer.isRunning() && this.m_authenticateRequest == null && this.m_token != null) { + this.m_tokenRefreshTimer.schedule((((double) (this.m_token.getAccessTokenExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); + } + if (!(this.m_userProfileRefreshTimer.isRunning() || this.m_userInfo == null || this.m_userInfo.getExpiryTime() == null)) { + this.m_userProfileRefreshTimer.schedule((((double) (this.m_userInfo.getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); + } + if (!this.m_pidInfoRefreshTimer.isRunning() && this.m_pidInfoRequest == null && this.m_pidInfo != null) { + this.m_pidInfoRefreshTimer.schedule((((double) (this.m_pidInfo.getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); + } + if (!this.m_personaRefreshTimer.isRunning() && this.m_personaRequest == null && this.m_personas != null && this.m_personas.size() > 0) { + this.m_personaRefreshTimer.schedule((((double) (this.m_personas.get(0).getExpiryTime().getTime() - System.currentTimeMillis())) / 1000.0d) - EXPIRY_MARGIN_FOR_TIMER, false); + } + } + } + } + + protected void exchangeAuthCodeToToken(String str) { + Log.Helper.LOGVS(this.TAG, "Use oauth code to get token.", new Object[0]); + NimbleIdentityConfig configuration = getConfiguration(); + exchangeDataForToken(String.format(DATA_TEMPLATE_LOGIN_WITH_OAUTH_CODE, str, configuration.getClientId(), configuration.getClientSecret())); + } + + protected void exchangeDataForToken(String str) { + ByteArrayOutputStream byteArrayOutputStream; + URL url = null; + try { + URL url2 = new URL(String.format(URL_TEMPLATE_LOGIN, getConfiguration().getConnectServerUrl())); + try { + byte[] bytes = str.getBytes("UTF-8"); + ByteArrayOutputStream byteArrayOutputStream2 = new ByteArrayOutputStream(bytes.length); + try { + byteArrayOutputStream2.write(bytes); + url = url2; + byteArrayOutputStream = byteArrayOutputStream2; + } catch (IOException e) { + byteArrayOutputStream = byteArrayOutputStream2; + url = url2; + } + } catch (IOException e2) { + url = url2; + byteArrayOutputStream = null; + } + } catch (IOException e3) { + byteArrayOutputStream = null; + } + HashMap hashMap = new HashMap<>(); + hashMap.put(DATA_CONTENT_TYPE_KEY, DATA_CONTENT_TYPE_VALUE); + hashMap.put(REQUEST_HEADER_REFRESH_TOKEN_EXTRA_FLAG, REQUEST_HEADER_TRUE_VALUE); + HttpRequest httpRequest = new HttpRequest(url); + httpRequest.method = IHttpRequest.Method.POST; + httpRequest.headers = hashMap; + httpRequest.data = byteArrayOutputStream; + httpRequest.runInBackground = true; + synchronized (this) { + this.m_authenticateRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.12 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + AuthenticatorBase.this.onTokenResponse(networkConnectionHandle); + } + }); + } + } + + public NimbleIdentityToken getAccessToken() { + return this.m_token; + } + + @Override // com.ea.nimble.Component + public String getComponentId() { + return INimbleIdentityAuthenticator.AUTHENTICATOR_COMPONENT_PREFIX + getAuthenticatorId(); + } + + protected NimbleIdentityConfig getConfiguration() { + return NimbleIdentityImpl.getComponent().getConfiguration(); + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return this.TAG; + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public NimbleIdentityPersona getPersonaByNamespace(String str, long j) { + List personas = getPersonas(); + if (personas == null) { + return null; + } + for (NimbleIdentityPersona nimbleIdentityPersona : personas) { + if (nimbleIdentityPersona.getPersonaId() == j) { + if (nimbleIdentityPersona.getNamespaceName() != null && nimbleIdentityPersona.getNamespaceName().equals(str)) { + return nimbleIdentityPersona; + } + Log.Helper.LOGWS(this.TAG, "Try to get persona with persona id %d, but namespace %s doesn't match the asked for %s", Long.valueOf(nimbleIdentityPersona.getPersonaId()), nimbleIdentityPersona.getNamespaceName(), str); + return null; + } + } + return null; + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public NimbleIdentityPersona getPersonaByNamespace(String str, String str2) { + List personas = getPersonas(); + if (personas == null) { + return null; + } + for (NimbleIdentityPersona nimbleIdentityPersona : personas) { + if (nimbleIdentityPersona.getNamespaceName() != null && nimbleIdentityPersona.getNamespaceName().equals(str) && nimbleIdentityPersona.getName() != null && nimbleIdentityPersona.getName().equals(str2)) { + return nimbleIdentityPersona; + } + } + return null; + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public List getPersonas() { + ArrayList arrayList; + 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())))) { + updatePersonas(); + } + } + return arrayList; + } + + /* JADX WARN: Code restructure failed: missing block: B:7:0x002b, code lost: + if (r4.m_pidInfo.getExpiryTime().before(new java.util.Date()) != false) goto L_0x002e; + */ + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + /* + Code decompiled incorrectly, please refer to instructions dump. + To view partially-correct code enable 'Show inconsistent code' option in preferences + */ + public com.ea.nimble.identity.NimbleIdentityPidInfo getPidInfo() { + /* + r4 = this; + r0 = r4 + com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo + r6 = r0 + r0 = r6 + r5 = r0 + r0 = r4 + com.ea.nimble.identity.INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState r0 = r0.m_state + com.ea.nimble.identity.INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState r1 = com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS + if (r0 != r1) goto L_0x0061 + r0 = r4 + com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo + if (r0 == 0) goto L_0x002e + r0 = r6 + r5 = r0 + r0 = r4 + com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo + java.util.Date r0 = r0.getExpiryTime() + java.util.Date r1 = new java.util.Date + r2 = r1 + r2.() + boolean r0 = r0.before(r1) + if (r0 == 0) goto L_0x0061 + L_0x002e: + r0 = r4 + monitor-enter(r0) + r0 = r4 + com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo // Catch: all -> 0x0067 + r5 = r0 + r0 = r4 + com.ea.nimble.identity.INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState r0 = r0.m_state // Catch: all -> 0x0067 + com.ea.nimble.identity.INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState r1 = com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS // Catch: all -> 0x0067 + if (r0 != r1) goto L_0x005f + r0 = r4 + com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo // Catch: all -> 0x0067 + if (r0 == 0) goto L_0x005a + r0 = r4 + com.ea.nimble.identity.NimbleIdentityPidInfo r0 = r0.m_pidInfo // Catch: all -> 0x0067 + java.util.Date r0 = r0.getExpiryTime() // Catch: all -> 0x0067 + java.util.Date r1 = new java.util.Date // Catch: all -> 0x0067 + r2 = r1 + r2.() // Catch: all -> 0x0067 + boolean r0 = r0.before(r1) // Catch: all -> 0x0067 + if (r0 == 0) goto L_0x005f + L_0x005a: + r0 = r4 + r1 = 0 + r0.refreshPidInfo(r1) // Catch: all -> 0x0067 + L_0x005f: + r0 = r4 + monitor-exit(r0) // Catch: all -> 0x0067 + L_0x0061: + r0 = r4 + r0.savePidInfo() + r0 = r5 + return r0 + L_0x0067: + r5 = move-exception + r0 = r4 + monitor-exit(r0) // Catch: all -> 0x0067 + r0 = r5 + throw r0 + */ + throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.identity.AuthenticatorBase.getPidInfo():com.ea.nimble.identity.NimbleIdentityPidInfo"); + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState getState() { + return this.m_state; + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public NimbleIdentityUserInfo getUserInfo() { + NimbleIdentityUserInfo nimbleIdentityUserInfo; + synchronized (this) { + nimbleIdentityUserInfo = this.m_userInfo; + if (this.m_userInfo == null || (this.m_userInfo.getExpiryTime() != null && this.m_userInfo.getExpiryTime().before(new Date()))) { + refreshUserProfile(null); + } + if (this.m_pidInfo == null || this.m_pidInfo.getExpiryTime().before(new Date())) { + refreshPidInfo(null); + } + } + return nimbleIdentityUserInfo; + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void refreshPersonas(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + Log.Helper.LOGDS(this.TAG, "Refreshing persona info", new Object[0]); + prepare(new INimbleIdentityAuthenticator.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) { + Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Ready to refresh persona info", new Object[0]); + synchronized (this) { + if (AuthenticatorBase.this.m_personaRefreshTimer.isRunning()) { + AuthenticatorBase.this.m_personaRefreshTimer.cancel(); + } + if (nimbleIdentityAuthenticatorCallback != null) { + AuthenticatorBase.this.m_personaCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + AuthenticatorBase.this.updatePersonas(); + } + return; + } + if (AuthenticatorBase.this.getConfiguration().getAutoRefresh() && AuthenticatorBase.this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + AuthenticatorBase.this.m_personaRefreshTimer.schedule(60.0d, false); + } + if (nimbleIdentityAuthenticatorCallback != null) { + Log.Helper.LOGWS(AuthenticatorBase.this.TAG, "Persona refresh failed early because of error %s", error); + nimbleIdentityAuthenticatorCallback.onCallback(AuthenticatorBase.this, error); + } + } + }); + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void refreshPidInfo(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + Log.Helper.LOGDS(this.TAG, "Refreshing pid Info", new Object[0]); + prepare(new INimbleIdentityAuthenticator.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) { + Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Ready to refresh pid info", new Object[0]); + synchronized (this) { + if (AuthenticatorBase.this.m_pidInfoRefreshTimer.isRunning()) { + AuthenticatorBase.this.m_pidInfoRefreshTimer.cancel(); + } + if (nimbleIdentityAuthenticatorCallback != null) { + AuthenticatorBase.this.m_pidInfoCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + AuthenticatorBase.this.updatePidInfo(); + } + return; + } + if (AuthenticatorBase.this.getConfiguration().getAutoRefresh() && AuthenticatorBase.this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + AuthenticatorBase.this.m_pidInfoRefreshTimer.schedule(60.0d, false); + } + if (nimbleIdentityAuthenticatorCallback != null) { + Log.Helper.LOGWS(AuthenticatorBase.this.TAG, "Persona refresh failed early because of error %s", error); + nimbleIdentityAuthenticatorCallback.onCallback(AuthenticatorBase.this, error); + } + } + }); + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void refreshUserInfo(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + refreshPidInfo(new INimbleIdentityAuthenticator.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) { + Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Received null callback in refreshUserInfo", new Object[0]); + } else if (error == null) { + AuthenticatorBase.this.refreshUserProfile(nimbleIdentityAuthenticatorCallback); + } else { + nimbleIdentityAuthenticatorCallback.onCallback(iNimbleIdentityAuthenticator, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_REFRESH_USER_INFO_FROM_PID_INFO.intValue(), "Fail to refresh user info from pid info", error)); + } + } + }); + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void requestAccessToken(final INimbleIdentityAuthenticator.NimbleAuthenticatorAccessTokenCallback nimbleAuthenticatorAccessTokenCallback) { + if (nimbleAuthenticatorAccessTokenCallback == null) { + Log.Helper.LOGW(this, "requestAccessToken API called without a callback. Aborting token refresh", new Object[0]); + return; + } + Log.Helper.LOGD(this, "requestAccessToken API called, proceeding with token refresh", new Object[0]); + if (this.m_token == null) { + nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(this, "", "", new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNAUTHENTICATED, "No tokens found for your authenticator")); + } else if (!Utility.validString(this.m_token.getAccessToken())) { + nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(this, "", "", new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNAUTHENTICATED, "No tokens found for your authenticator")); + } else if (this.m_token.getAccessTokenExpiryTime().after(new Date())) { + nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(this, this.m_token.getAccessToken(), this.m_token.getType(), null); + } else { + prepare(new INimbleIdentityAuthenticator.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) { + nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(AuthenticatorBase.this, AuthenticatorBase.this.m_token.getAccessToken(), AuthenticatorBase.this.m_token.getType(), null); + } else { + nimbleAuthenticatorAccessTokenCallback.AccessTokenCallback(AuthenticatorBase.this, "", "", error); + } + } + }); + } + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void requestAuthCode(final String str, final String str2, final INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback) { + if (nimbleIdentityServerAuthCodeCallback == null) { + Log.Helper.LOGWS(this.TAG, "Request server authentication oAuth code without callback, no way to get result", new Object[0]); + return; + } + 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 + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback + public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { + if (error == null) { + Log.Helper.LOGVS(AuthenticatorBase.this.TAG, "Ready to request server auth code for serverId %s and scope %s", str, str2); + URL url = null; + try { + String format = String.format(AuthenticatorBase.URL_TEMPLATE_REQUEST_SERVER_AUTHENTICATION_OAUTH_CODE, AuthenticatorBase.this.getConfiguration().getConnectServerUrl(), str, AuthenticatorBase.this.m_token.getAccessToken()); + String str3 = format; + if (Utility.validString(str2)) { + str3 = String.format("%s&scope=%s", format, str2); + } + url = new URL(str3); + } catch (MalformedURLException e) { + } + Network.getComponent().sendGetRequest(url, new HashMap<>(), new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.10.1 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + try { + Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); + String str4 = (String) parseBodyJSONData.get("code"); + if (!Utility.validString(str4)) { + Error error2 = new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, String.format("Fail to parse oAuth code from server response data %s", parseBodyJSONData)); + Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Request for server auth code failed for error %s", error2); + nimbleIdentityServerAuthCodeCallback.onCallback(AuthenticatorBase.this, null, str, str2, error2); + return; + } + Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Request for server auth code succeed with auth code: %s", str4); + nimbleIdentityServerAuthCodeCallback.onCallback(AuthenticatorBase.this, str4, str, str2, null); + } catch (Error e2) { + Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Request for server auth code failed for error %s", e2); + nimbleIdentityServerAuthCodeCallback.onCallback(AuthenticatorBase.this, null, str, str2, e2); + } + } + }); + return; + } + Log.Helper.LOGDS(AuthenticatorBase.this.TAG, "Fail to get server authentication oauth code because of error %s", error); + nimbleIdentityServerAuthCodeCallback.onCallback(AuthenticatorBase.this, null, str, str2, error); + } + }); + } + + protected void requestIdentityForFriends(String str, ArrayList arrayList, final INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) { + ByteArrayOutputStream byteArrayOutputStream = null; + if (nimbleIdentityFriendsIdentityInfoCallback == null) { + Log.Helper.LOGES(this.TAG, "requestIdentityForFriends called with no way to notify caller", new Object[0]); + return; + } + HashMap hashMap = new HashMap(); + hashMap.put("pidType", str); + hashMap.put("clientId", getConfiguration().getClientId()); + hashMap.put("values", arrayList); + String convertObjectToJSONString = Utility.convertObjectToJSONString(hashMap); + synchronized (this) { + try { + URL url = null; + try { + url = new URL(String.format("%s%s", getConfiguration().getProxyServerUrl(), URL_TEMPALTE_GET_IDENTITY_INFO_FOR_FRIENDS)); + try { + byte[] bytes = convertObjectToJSONString.getBytes("UTF-8"); + byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); + try { + byteArrayOutputStream.write(bytes); + } catch (IOException e) { + } catch (Throwable th) { + th = th; + throw th; + } + } catch (IOException e2) { + byteArrayOutputStream = null; + } catch (Throwable th2) { + } + } catch (IOException e3) { + byteArrayOutputStream = null; + } + String format = String.format("%s %s", this.m_token.getType(), this.m_token.getAccessToken()); + HashMap hashMap2 = new HashMap<>(); + hashMap2.put(AUTHORIZATION_KEY, format); + hashMap2.put("Content-Type", "text/plain;charset=UTF-8"); + HttpRequest httpRequest = new HttpRequest(url); + httpRequest.method = IHttpRequest.Method.POST; + httpRequest.headers = hashMap2; + httpRequest.data = byteArrayOutputStream; + Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorBase.14 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + try { + nimbleIdentityFriendsIdentityInfoCallback.onCallback(AuthenticatorBase.this, NimbleIdentityUtility.parseJsonResponse(networkConnectionHandle), null); + } catch (Error e4) { + nimbleIdentityFriendsIdentityInfoCallback.onCallback(AuthenticatorBase.this, null, e4); + } + } + }); + } catch (Throwable th3) { + } + } + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) throws Exception { + throw new Exception("Authenticator " + getAuthenticatorId() + " doesn't support identity information for friends"); + } + + public void restoreAuthenticator(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_UNAVAILABLE) { + loadState(); + if (this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_NONE) { + loadToken(); + loadPidInfo(); + } + Utility.registerReceiver(Global.NOTIFICATION_NETWORK_STATUS_CHANGE, this.m_networkChangeReceiver); + Utility.registerReceiver("nimble.notification.identity.configuration.change", this.m_identityConfigChangeReceiver); + resume(nimbleIdentityAuthenticatorCallback); + } + } + + @Override // com.ea.nimble.Component + public void resume() { + resume(null); + } + + public void setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState nimbleIdentityAuthenticationState) { + if (nimbleIdentityAuthenticationState != this.m_state) { + this.m_state = nimbleIdentityAuthenticationState; + saveState(); + HashMap hashMap = new HashMap(); + hashMap.put(Global.NIMBLE_IDENTITY_DICTIONARY_KEY_AUTHENTICATOR_ID, getAuthenticatorId()); + Utility.sendBroadcastSerializable(Global.NIMBLE_NOTIFICATION_IDENTITY_AUTHENTICATION_UPDATE, hashMap); + } + } + + @Override // com.ea.nimble.Component + public void suspend() { + cancelAuthentication(); + } + + protected void updateUserProfile() { + this.m_userInfo.setExpiryTime(null); + closeUserInfoUpdate(null, false); + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java new file mode 100644 index 0000000..ad1a387 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/AuthenticatorFacebook.java @@ -0,0 +1,233 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Base; +import com.ea.nimble.Error; +import com.ea.nimble.Facebook; +import com.ea.nimble.Global; +import com.ea.nimble.HttpRequest; +import com.ea.nimble.IFacebook; +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 com.facebook.FacebookOperationCanceledException; +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: stdlib.jar:com/ea/nimble/identity/AuthenticatorFacebook.class */ +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&display=mobilegame/login&fb_token=%s&redirect_uri=nucleus:rest"; + private String m_overrideBirthday; + + private AuthenticatorFacebook() { + this.TAG = "AuthenticatorFacebook"; + } + + /* JADX INFO: Access modifiers changed from: private */ + public void exchangeFacebookAccessTokenForAuthCode(String str) { + synchronized (this) { + URL url = null; + try { + NimbleIdentityConfig configuration = getConfiguration(); + url = new URL(String.format(URL_TEMPLATE_FACEBOOK_LOGIN, configuration.getConnectServerUrl(), configuration.getClientId(), str)); + } catch (MalformedURLException e) { + } + HttpRequest httpRequest = new HttpRequest(url); + httpRequest.runInBackground = true; + this.m_authenticateRequest = Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.AuthenticatorFacebook.2 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + if (AuthenticatorFacebook.this.m_state != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE) { + 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)); + } else { + AuthenticatorFacebook.this.exchangeAuthCodeToToken(str2); + } + } catch (Error e2) { + AuthenticatorFacebook.this.closeAuthentication(e2); + } + } + } + }); + } + } + + private static void initialize() { + Log.Helper.LOGVS("AuthenticatorFacebook", "Initializing...", new Object[0]); + AuthenticatorFacebook authenticatorFacebook = new AuthenticatorFacebook(); + Base.registerComponent(authenticatorFacebook, authenticatorFacebook.getComponentId()); + } + + private void loginFacebook(IFacebook iFacebook, List list, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + synchronized (this) { + setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); + if (nimbleIdentityAuthenticatorCallback != null) { + this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + } + iFacebook.login(list, new IFacebook.FacebookCallback() { // from class: com.ea.nimble.identity.AuthenticatorFacebook.1 + @Override // com.ea.nimble.IFacebook.FacebookCallback + public void callback(IFacebook iFacebook2, boolean z, Exception exc) { + if (!z) { + AuthenticatorFacebook.this.closeAuthentication((exc == null || (exc instanceof FacebookOperationCanceledException)) ? new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_USER_CANCELLED, "Facebook login is cancelled by user") : exc instanceof Error ? (Error) exc : new Error(Error.Code.UNKNOWN, "Unknown error type from Facebook", exc)); + } else if (!Utility.validString(iFacebook2.getAccessToken())) { + AuthenticatorFacebook.this.closeAuthentication(new Error(Error.Code.SYSTEM_UNEXPECTED, "Facebook SDK gives login success without a valid Facebook token")); + } else { + synchronized (this) { + AuthenticatorFacebook.this.exchangeFacebookAccessTokenForAuthCode(iFacebook2.getAccessToken()); + } + } + } + }); + } + + /* JADX INFO: Access modifiers changed from: package-private */ + @Override // com.ea.nimble.identity.AuthenticatorBase + public void autoLogin() { + Log.Helper.LOGIS(this.TAG, "Facebook Authenticator AutoLogin", new Object[0]); + this.m_autoLoginAttempt = true; + IFacebook iFacebook = (IFacebook) Base.getComponent(Facebook.COMPONENT_ID); + if (iFacebook == null) { + closeAuthentication(new Error(Error.Code.SYSTEM_UNEXPECTED, "Cannot auto login with FacebookAuthenticator since it is disabled for no NimbleFacebook component")); + } else if (Utility.validString(iFacebook.getAccessToken())) { + synchronized (this) { + this.m_state = INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING; + exchangeFacebookAccessTokenForAuthCode(iFacebook.getAccessToken()); + } + } else { + closeAuthentication(new Error(Error.Code.SYSTEM_UNEXPECTED, "Cannot auto login with FacebookAuthenticator since Facebook SDK doesn't have any session existing")); + } + } + + /* JADX INFO: Access modifiers changed from: protected */ + @Override // com.ea.nimble.identity.AuthenticatorBase + public void cancelAuthentication() { + if (this.m_state == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING && this.m_authenticateRequest == null) { + super.cancelAuthentication(); + setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); + return; + } + super.cancelAuthentication(); + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public String getAuthenticatorId() { + return Global.NIMBLE_AUTHENTICATOR_FACEBOOK; + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + Log.Helper.LOGIS(this.TAG, "Facebook Authenticator Login", new Object[0]); + IFacebook iFacebook = (IFacebook) Base.getComponent(Facebook.COMPONENT_ID); + if (iFacebook == 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")); + } + } else if (nimbleIdentityLoginParams == null) { + loginFacebook(iFacebook, null, nimbleIdentityAuthenticatorCallback); + } else if (nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.FacebookClientLoginParams) { + loginFacebook(iFacebook, ((NimbleIdentityLoginParams.FacebookClientLoginParams) nimbleIdentityLoginParams).getFacebookPermissions(), nimbleIdentityAuthenticatorCallback); + } else if (nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.FacebookAccessTokenLoginParams) { + NimbleIdentityLoginParams.FacebookAccessTokenLoginParams facebookAccessTokenLoginParams = (NimbleIdentityLoginParams.FacebookAccessTokenLoginParams) nimbleIdentityLoginParams; + if (Utility.validString(facebookAccessTokenLoginParams.getFacebookAccessToken())) { + synchronized (this) { + setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); + if (nimbleIdentityAuthenticatorCallback != null) { + this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + iFacebook.refreshSession(facebookAccessTokenLoginParams.getFacebookAccessToken(), facebookAccessTokenLoginParams.getExpiryDate()); + exchangeFacebookAccessTokenForAuthCode(facebookAccessTokenLoginParams.getFacebookAccessToken()); + } + } else if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(this, new Error(Error.Code.INVALID_ARGUMENT, "Invalid Facebook access token for Facebook token")); + } + } else if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(this, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_LOGINPARAMS, "Unrecognized login parameters")); + } + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void logout(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + Log.Helper.LOGIS(this.TAG, "Facebook Authenticator is logging out", new Object[0]); + IFacebook iFacebook = (IFacebook) Base.getComponent(Facebook.COMPONENT_ID); + if (iFacebook == 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.logout(); + cleanAtLogout(nimbleIdentityAuthenticatorCallback); + } + + @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.identity.INimbleIdentityAuthenticator + public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) throws Exception { + requestIdentityForFriends(PID_TYPE, arrayList, nimbleIdentityFriendsIdentityInfoCallback); + } + + @Override // com.ea.nimble.identity.AuthenticatorBase + public void restoreAuthenticator(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + if (((IFacebook) Base.getComponent(Facebook.COMPONENT_ID)) == 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); + } + + /* JADX INFO: Access modifiers changed from: protected */ + @Override // com.ea.nimble.Component + public void setup() { + this.m_overrideBirthday = null; + } + + @Override // com.ea.nimble.identity.AuthenticatorBase + protected void updateUserProfile() { + IFacebook iFacebook = (IFacebook) Base.getComponent(Facebook.COMPONENT_ID); + if (iFacebook == 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.getGraphUser(); + NimbleIdentityUserInfo nimbleIdentityUserInfo = this.m_userInfo == null ? new NimbleIdentityUserInfo() : this.m_userInfo.clone(); + if (graphUser != null) { + nimbleIdentityUserInfo.setUserId((String) graphUser.get("id")); + nimbleIdentityUserInfo.setDisplayName((String) graphUser.get("name")); + nimbleIdentityUserInfo.setUserName((String) graphUser.get("username")); + nimbleIdentityUserInfo.setAvatarUri(String.format(URL_TEMPLATE_FACEBOOK_IMAGE_URL, nimbleIdentityUserInfo.getUserId())); + String str = (String) graphUser.get("birthday"); + if (Utility.validString(str) && (!Utility.validString(nimbleIdentityUserInfo.getDateOfBirth()) || nimbleIdentityUserInfo.getDateOfBirth().equals(this.m_overrideBirthday))) { + this.m_overrideBirthday = str; + nimbleIdentityUserInfo.setDateOfBirth(str); + } + nimbleIdentityUserInfo.setEmail((String) graphUser.get("email")); + nimbleIdentityUserInfo.setExpiryTime(new Date(System.currentTimeMillis() + ((long) (getConfiguration().getExpiryInterval() * 1000.0d)))); + synchronized (this) { + this.m_userInfo = nimbleIdentityUserInfo; + } + 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); + } + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/AuthenticatorOrigin.java b/app/src/main/java/com/ea/nimble/identity/AuthenticatorOrigin.java new file mode 100644 index 0000000..95423bb --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/AuthenticatorOrigin.java @@ -0,0 +1,87 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Base; +import com.ea.nimble.Error; +import com.ea.nimble.Global; +import com.ea.nimble.Log; +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.util.ArrayList; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/AuthenticatorOrigin.class */ +class AuthenticatorOrigin extends AuthenticatorBase { + private static final String DATA_TEMPLATE_LOGIN_WITH_ORIGIN_PASSWORD = "grant_type=password&client_id=%s&client_secret=%s&username=%s&password=%s&redirect_uri=nucleus:rest"; + private static final String PID_TYPE = "mobile_origin"; + + private AuthenticatorOrigin() { + this.TAG = "AuthenticatorOrigin"; + } + + private static void initialize() { + Log.Helper.LOGIS("AuthenticatorOrigin", "Initializing...", new Object[0]); + AuthenticatorOrigin authenticatorOrigin = new AuthenticatorOrigin(); + Base.registerComponent(authenticatorOrigin, authenticatorOrigin.getComponentId()); + } + + private void loginOrigin(String str, String str2, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + NimbleIdentityConfig configuration = getConfiguration(); + exchangeDataForToken(String.format(DATA_TEMPLATE_LOGIN_WITH_ORIGIN_PASSWORD, configuration.getClientId(), configuration.getClientSecret(), str, str2)); + } + + /* JADX INFO: Access modifiers changed from: package-private */ + @Override // com.ea.nimble.identity.AuthenticatorBase + public void autoLogin() { + closeAuthentication(new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_SESSION_EXPIRED, "Cannot auto login for origin after session expired")); + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public String getAuthenticatorId() { + return Global.NIMBLE_AUTHENTICATOR_ORIGIN; + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + if (nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.OriginCredentialsLoginParams) { + NimbleIdentityLoginParams.OriginCredentialsLoginParams originCredentialsLoginParams = (NimbleIdentityLoginParams.OriginCredentialsLoginParams) nimbleIdentityLoginParams; + if (Utility.validString(originCredentialsLoginParams.getUsername()) && Utility.validString(originCredentialsLoginParams.getPassword())) { + synchronized (this) { + setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); + if (nimbleIdentityAuthenticatorCallback != null) { + this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + loginOrigin(originCredentialsLoginParams.getUsername(), originCredentialsLoginParams.getPassword(), nimbleIdentityAuthenticatorCallback); + } + } else if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(this, new Error(Error.Code.INVALID_ARGUMENT, "Invalid username/password for Origin login")); + } + } else if (nimbleIdentityLoginParams instanceof NimbleIdentityLoginParams.OriginOAuthCodeLoginParams) { + NimbleIdentityLoginParams.OriginOAuthCodeLoginParams originOAuthCodeLoginParams = (NimbleIdentityLoginParams.OriginOAuthCodeLoginParams) nimbleIdentityLoginParams; + if (Utility.validString(originOAuthCodeLoginParams.getOauthCode())) { + synchronized (this) { + setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING); + if (nimbleIdentityAuthenticatorCallback != null) { + this.m_authenticateCallbacks.add(nimbleIdentityAuthenticatorCallback); + } + exchangeAuthCodeToToken(originOAuthCodeLoginParams.getOauthCode()); + } + } else if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(this, new Error(Error.Code.INVALID_ARGUMENT, "Invalid auth code for Origin login")); + } + } else if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(this, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_LOGINPARAMS, "Unrecognized login parameters")); + } + } + + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator + public void logout(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + cancelAuthentication(); + cleanAtLogout(nimbleIdentityAuthenticatorCallback); + } + + @Override // com.ea.nimble.identity.AuthenticatorBase, com.ea.nimble.identity.INimbleIdentityAuthenticator + public void requestIdentityForFriends(ArrayList arrayList, INimbleIdentityAuthenticator.NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) { + requestIdentityForFriends(PID_TYPE, arrayList, nimbleIdentityFriendsIdentityInfoCallback); + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentity.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentity.java new file mode 100644 index 0000000..eabce34 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentity.java @@ -0,0 +1,39 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import java.util.List; +import java.util.Map; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentity.class */ +public interface INimbleIdentity { + public static final String EXTRA_NIMBLE_IDENTITY_AUTOREFRESH_VALUE = "nimble.identity.extra.autorefresh.value"; + public static final String MIGRATION_PERSISTENCE_ID = "nimble.notification.identity.migraiton"; + public static final String NIMBLE_COMPONENT_ID_IDENTITY = "com.ea.nimble.identity"; + public static final String NIMBLE_NOTIFICATION_IDENTITY_UPDATE = "nimble.notification.identity.update"; + public static final String NOTIFICATION_NIMBLE_IDENTITY_AUTOREFRESH_CHANGE = "nimble.identity.notification.autorefresh_changed"; + + /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentity$NimbleIdentityState.class */ + public enum NimbleIdentityState { + NIMBLE_IDENTITY_READY, + NIMBLE_IDENTITY_AUTHENTICATING, + NIMBLE_IDENTITY_UNAVAILABLE + } + + INimbleIdentityAuthenticator getAuthenticatorById(String str); + + List getAuthenticators(); + + boolean getAutoRefreshFlag(); + + List getLoggedInAuthenticators(); + + Map getPidMap(); + + NimbleIdentityState getState(); + + void requestServerAuthCodeForLegacyOriginToken(String str, String str2, String str3, INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback); + + void setAuthenticationConductor(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor); + + void setAutoRefreshFlag(boolean z); +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticationConductor.java new file mode 100644 index 0000000..26f8f3b --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticationConductor.java @@ -0,0 +1,5 @@ +package com.ea.nimble.identity; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticationConductor.class */ +public interface INimbleIdentityAuthenticationConductor { +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticator.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticator.java new file mode 100644 index 0000000..8a43694 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityAuthenticator.java @@ -0,0 +1,70 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Error; +import java.util.ArrayList; +import java.util.List; +import org.json.JSONObject; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator.class */ +public interface INimbleIdentityAuthenticator { + public static final String AUTHENTICATOR_COMPONENT_PREFIX = "com.ea.nimble.identity.authenticator."; + + /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleAuthenticatorAccessTokenCallback.class */ + public interface NimbleAuthenticatorAccessTokenCallback { + void AccessTokenCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str, String str2, Error error); + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleIdentityAuthenticationState.class */ + public enum NimbleIdentityAuthenticationState { + NIMBLE_IDENTITY_AUTHENTICATION_UNAVAILABLE, + NIMBLE_IDENTITY_AUTHENTICATION_NONE, + NIMBLE_IDENTITY_AUTHENTICATION_GOING, + NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS, + NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleIdentityAuthenticatorCallback.class */ + public interface NimbleIdentityAuthenticatorCallback { + void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error); + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleIdentityFriendsIdentityInfoCallback.class */ + public interface NimbleIdentityFriendsIdentityInfoCallback { + void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, JSONObject jSONObject, Error error); + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityAuthenticator$NimbleIdentityServerAuthCodeCallback.class */ + public interface NimbleIdentityServerAuthCodeCallback { + void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str, String str2, String str3, Error error); + } + + String getAuthenticatorId(); + + NimbleIdentityPersona getPersonaByNamespace(String str, long j); + + NimbleIdentityPersona getPersonaByNamespace(String str, String str2); + + List getPersonas(); + + NimbleIdentityPidInfo getPidInfo(); + + NimbleIdentityAuthenticationState getState(); + + NimbleIdentityUserInfo getUserInfo(); + + void login(NimbleIdentityLoginParams nimbleIdentityLoginParams, NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); + + void logout(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); + + void refreshPersonas(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); + + void refreshPidInfo(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); + + void refreshUserInfo(NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); + + void requestAccessToken(NimbleAuthenticatorAccessTokenCallback nimbleAuthenticatorAccessTokenCallback); + + void requestAuthCode(String str, String str2, NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback); + + void requestIdentityForFriends(ArrayList arrayList, NimbleIdentityFriendsIdentityInfoCallback nimbleIdentityFriendsIdentityInfoCallback) throws Exception; +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericAuthenticationConductor.java new file mode 100644 index 0000000..ae2cdd5 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericAuthenticationConductor.java @@ -0,0 +1,8 @@ +package com.ea.nimble.identity; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityGenericAuthenticationConductor.class */ +public interface INimbleIdentityGenericAuthenticationConductor extends INimbleIdentityAuthenticationConductor { + void handleLogin(INimbleIdentityGenericLoginResolver iNimbleIdentityGenericLoginResolver); + + void handleLogout(INimbleIdentityGenericLogoutResolver iNimbleIdentityGenericLogoutResolver); +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLoginResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLoginResolver.java new file mode 100644 index 0000000..bacaac0 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLoginResolver.java @@ -0,0 +1,17 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityGenericLoginResolver.class */ +public interface INimbleIdentityGenericLoginResolver { + List getLoggedInAuthenticatorIds(); + + String getLoggingInAuthenticatorId(); + + void highlight(); + + void ignore(); + + void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLogoutResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLogoutResolver.java new file mode 100644 index 0000000..e0cb3ad --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityGenericLogoutResolver.java @@ -0,0 +1,12 @@ +package com.ea.nimble.identity; + +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityGenericLogoutResolver.class */ +public interface INimbleIdentityGenericLogoutResolver { + String getLoggingOutAuthenticatorId(); + + List getStillLoggedInAuthenticatorIds(); + + void resolve(String str); +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationAuthenticationConductor.java new file mode 100644 index 0000000..8aa88c9 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationAuthenticationConductor.java @@ -0,0 +1,10 @@ +package com.ea.nimble.identity; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityMigrationAuthenticationConductor.class */ +public interface INimbleIdentityMigrationAuthenticationConductor extends INimbleIdentityAuthenticationConductor { + void handleLogin(INimbleIdentityMigrationLoginResolver iNimbleIdentityMigrationLoginResolver); + + void handleLogout(); + + void handlePendingMigration(INimbleIdentityPendingMigrationResolver iNimbleIdentityPendingMigrationResolver); +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLoginResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLoginResolver.java new file mode 100644 index 0000000..004cf7d --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLoginResolver.java @@ -0,0 +1,17 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityMigrationLoginResolver.class */ +public interface INimbleIdentityMigrationLoginResolver { + List getLoggedInAuthenticatorIds(); + + String getLoggingInAuthenticatorId(); + + void ignore(); + + void migrate(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); + + void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLogoutResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLogoutResolver.java new file mode 100644 index 0000000..74b3c18 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityMigrationLogoutResolver.java @@ -0,0 +1,12 @@ +package com.ea.nimble.identity; + +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityMigrationLogoutResolver.class */ +public interface INimbleIdentityMigrationLogoutResolver { + String getLoggingOutAuthenticatorId(); + + List getStillLoggedInAuthenticatorIds(); + + void resolve(String str); +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPendingMigrationResolver.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPendingMigrationResolver.java new file mode 100644 index 0000000..998aaf4 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPendingMigrationResolver.java @@ -0,0 +1,12 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.identity.INimbleIdentityAuthenticator; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityPendingMigrationResolver.class */ +public interface INimbleIdentityPendingMigrationResolver { + String getMigrationSourceAuthenticatorId(); + + String getMigrationTargetAuthenticatorId(); + + void resume(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback); +} diff --git a/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPlainAuthenticationConductor.java b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPlainAuthenticationConductor.java new file mode 100644 index 0000000..8b3bed5 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/INimbleIdentityPlainAuthenticationConductor.java @@ -0,0 +1,8 @@ +package com.ea.nimble.identity; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/INimbleIdentityPlainAuthenticationConductor.class */ +public interface INimbleIdentityPlainAuthenticationConductor extends INimbleIdentityAuthenticationConductor { + void handleLogin(); + + void handleLogout(); +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentity.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentity.java new file mode 100644 index 0000000..099e3a5 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentity.java @@ -0,0 +1,12 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Base; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentity.class */ +public class NimbleIdentity { + public static final String COMPONENT_ID = "com.ea.nimble.identity"; + + public static INimbleIdentity getComponent() { + return (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityAuthenticationConductorHandler.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityAuthenticationConductorHandler.java new file mode 100644 index 0000000..ad67629 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityAuthenticationConductorHandler.java @@ -0,0 +1,8 @@ +package com.ea.nimble.identity; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityAuthenticationConductorHandler.class */ +interface NimbleIdentityAuthenticationConductorHandler { + void handleLogin(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, boolean z); + + void handleLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator); +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityConfig.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityConfig.java new file mode 100644 index 0000000..61780ed --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityConfig.java @@ -0,0 +1,105 @@ +package com.ea.nimble.identity; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.Utility; + +/* JADX INFO: Access modifiers changed from: package-private */ +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityConfig.class */ +public class NimbleIdentityConfig implements LogSource { + private static final double DEFAULT_DATA_EXPIRY_INTERVAL = 3600.0d; + private static final String META_DATA_TAG_CLIENT_ID = "com.ea.nimble.identity.client_id"; + private static final String META_DATA_TAG_CLIENT_SECRET = "com.ea.nimble.identity.client_secret"; + static final String NOTIFICATION_IDENTITY_CONFIGURATION_CHANGE = "nimble.notification.identity.configuration.change"; + private boolean m_autoRefresh; + private String m_clientId; + private String m_clientSecret; + private String m_connectServerUrl; + private String m_portalServerUrl; + private String m_proxyServerUrl; + private boolean m_ready; + private double m_expiryInterval = DEFAULT_DATA_EXPIRY_INTERVAL; + private BroadcastReceiver m_receiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.NimbleIdentityConfig.1 + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + NimbleIdentityConfig.this.onUpdate(); + } + }; + + /* JADX WARN: Code restructure failed: missing block: B:22:0x00ac, code lost: + if (r0.length() <= 0) goto L_0x00af; + */ + /* JADX WARN: Code restructure failed: missing block: B:33:0x00fe, code lost: + if (r0.length() <= 0) goto L_0x0101; + */ + /* + Code decompiled incorrectly, please refer to instructions dump. + To view partially-correct code enable 'Show inconsistent code' option in preferences + */ + public void onUpdate() { + /* + Method dump skipped, instructions count: 438 + To view this dump change 'Code comments level' option to 'DEBUG' + */ + throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.identity.NimbleIdentityConfig.onUpdate():void"); + } + + public boolean getAutoRefresh() { + return this.m_autoRefresh; + } + + public String getClientId() { + return this.m_clientId; + } + + public String getClientSecret() { + return this.m_clientSecret; + } + + public String getConnectServerUrl() { + return this.m_connectServerUrl; + } + + public double getExpiryInterval() { + return this.m_expiryInterval; + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "Identity"; + } + + public String getPortalServerUrl() { + return this.m_portalServerUrl; + } + + public String getProxyServerUrl() { + return this.m_proxyServerUrl; + } + + public void initialize() { + this.m_ready = false; + this.m_autoRefresh = false; + if (SynergyEnvironment.getComponent().isDataAvailable()) { + onUpdate(); + } + Utility.registerReceiver(SynergyEnvironment.NOTIFICATION_STARTUP_ENVIRONMENT_DATA_CHANGED, this.m_receiver); + Log.Helper.LOGV(this, "Configuration initiailized", new Object[0]); + } + + public boolean isReady() { + return this.m_ready; + } + + public void setAutoRefresh(boolean z) { + this.m_autoRefresh = z; + } + + void uninitialize() { + Utility.unregisterReceiver(this.m_receiver); + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java new file mode 100644 index 0000000..2444ccf --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityError.java @@ -0,0 +1,75 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Error; +import com.ea.nimble.tracking.NimbleTrackingS2SImpl; + +import java.util.Map; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityError.class */ +public class NimbleIdentityError extends Error { + public static final String NIMBLE_IDENTITY_ERROR_DOMAIN = "NimbleIdentityError"; + private static final long serialVersionUID = 1; + + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityError$NimbleIdentityErrorCode.class */ + public enum NimbleIdentityErrorCode { + NIMBLE_IDENTITY_ERROR_USER_CANCELLED(100), + NIMBLE_IDENTITY_ERROR_UNSUPPORTED_ACTION(NimbleTrackingS2SImpl.EVENT_APPSTARTED_AFTERINSTALL), + NIMBLE_IDENTITY_ERROR_UNAUTHENTICATED(1001), + NIMBLE_IDENTITY_ERROR_SESSION_EXPIRED(1002), + NIMBLE_IDENTITY_ERROR_INVALID_LOGINPARAMS(1003), + 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(1502), + NIMBLE_IDENTITY_ERROR_INVALID_OAUTH_INFO(1503), + 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(Integer.MAX_VALUE); + + private int m_value; + + NimbleIdentityErrorCode(int i) { + this.m_value = i; + } + + public int intValue() { + return this.m_value; + } + } + + public NimbleIdentityError(int i, String str) { + super(NIMBLE_IDENTITY_ERROR_DOMAIN, i, str, null); + } + + public NimbleIdentityError(int i, String str, Throwable th) { + super(Error.ERROR_DOMAIN, i, str, th); + } + + public NimbleIdentityError(NimbleIdentityErrorCode nimbleIdentityErrorCode, String str) { + super(NIMBLE_IDENTITY_ERROR_DOMAIN, nimbleIdentityErrorCode.intValue(), str, null); + } + + public static NimbleIdentityError createWithData(Map map) { + String str = (String) map.get("error"); + NimbleIdentityErrorCode parseErrorCode = parseErrorCode(str); + String str2 = (String) map.get("error_description"); + String str3 = str2; + if (str2 == null) { + str3 = str; + } + return new NimbleIdentityError(parseErrorCode, str3); + } + + private static NimbleIdentityErrorCode parseErrorCode(String str) { + return str.equals("invalid_request") ? NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_REQUEST : str.equals("invalid_oauth_info") ? NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_INVALID_OAUTH_INFO : NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_UNKNOWN; + } + + public boolean isError(int i) { + return getCode() == i; + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericAuthenticationConductorHandler.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericAuthenticationConductorHandler.java new file mode 100644 index 0000000..f34b5f2 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericAuthenticationConductorHandler.java @@ -0,0 +1,25 @@ +package com.ea.nimble.identity; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityGenericAuthenticationConductorHandler.class */ +class NimbleIdentityGenericAuthenticationConductorHandler implements NimbleIdentityAuthenticationConductorHandler { + private NimbleIdentityGenericLoginResolver loginResolver; + private NimbleIdentityGenericLogoutResolver logoutResolver; + private INimbleIdentityGenericAuthenticationConductor m_conductor; + + /* JADX INFO: Access modifiers changed from: package-private */ + public NimbleIdentityGenericAuthenticationConductorHandler(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor) { + this.m_conductor = (INimbleIdentityGenericAuthenticationConductor) iNimbleIdentityAuthenticationConductor; + } + + @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler + public void handleLogin(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, boolean z) { + this.loginResolver = new NimbleIdentityGenericLoginResolver(iNimbleIdentityAuthenticator); + this.m_conductor.handleLogin(this.loginResolver); + } + + @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler + public void handleLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { + this.logoutResolver = new NimbleIdentityGenericLogoutResolver(iNimbleIdentityAuthenticator); + this.m_conductor.handleLogout(this.logoutResolver); + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLoginResolver.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLoginResolver.java new file mode 100644 index 0000000..d67ba03 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLoginResolver.java @@ -0,0 +1,51 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Global; +import com.ea.nimble.Log; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import java.util.ArrayList; +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityGenericLoginResolver.class */ +class NimbleIdentityGenericLoginResolver implements INimbleIdentityGenericLoginResolver { + private INimbleIdentityAuthenticator m_authenticator; + private String m_authenticatorId; + private ArrayList m_loggedInAuthenticatorIds; + + public NimbleIdentityGenericLoginResolver(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { + if (iNimbleIdentityAuthenticator != null) { + this.m_authenticator = iNimbleIdentityAuthenticator; + this.m_authenticatorId = iNimbleIdentityAuthenticator.getAuthenticatorId(); + this.m_loggedInAuthenticatorIds = new ArrayList<>(); + for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2 : NimbleIdentity.getComponent().getLoggedInAuthenticators()) { + this.m_loggedInAuthenticatorIds.add(iNimbleIdentityAuthenticator2.getAuthenticatorId()); + } + } + } + + @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver + public List getLoggedInAuthenticatorIds() { + return this.m_loggedInAuthenticatorIds; + } + + @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver + public String getLoggingInAuthenticatorId() { + return this.m_authenticatorId; + } + + @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver + public void highlight() { + NimbleIdentityImpl.getComponent().highlight(this.m_authenticator); + } + + @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver + public void ignore() { + Log.Helper.LOGI(this, "Game decided to resolve login of %s by ignoring", this.m_authenticatorId); + } + + @Override // com.ea.nimble.identity.INimbleIdentityGenericLoginResolver + public void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); + component.switchAuthenticators(nimbleIdentityAuthenticatorCallback, this.m_authenticator, component.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)); + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLogoutResolver.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLogoutResolver.java new file mode 100644 index 0000000..24fa5c0 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityGenericLogoutResolver.java @@ -0,0 +1,36 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Utility; +import java.util.ArrayList; +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityGenericLogoutResolver.class */ +public class NimbleIdentityGenericLogoutResolver implements INimbleIdentityGenericLogoutResolver { + private String m_authenticatorId; + private ArrayList m_stillLoggedInAuthenticatorIds = new ArrayList<>(); + + public NimbleIdentityGenericLogoutResolver(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { + this.m_authenticatorId = iNimbleIdentityAuthenticator.getAuthenticatorId(); + for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2 : NimbleIdentity.getComponent().getLoggedInAuthenticators()) { + this.m_stillLoggedInAuthenticatorIds.add(iNimbleIdentityAuthenticator2.getAuthenticatorId()); + } + } + + @Override // com.ea.nimble.identity.INimbleIdentityGenericLogoutResolver + public String getLoggingOutAuthenticatorId() { + return this.m_authenticatorId; + } + + @Override // com.ea.nimble.identity.INimbleIdentityGenericLogoutResolver + public List getStillLoggedInAuthenticatorIds() { + return this.m_stillLoggedInAuthenticatorIds; + } + + @Override // com.ea.nimble.identity.INimbleIdentityGenericLogoutResolver + public void resolve(String str) { + INimbleIdentityAuthenticator authenticatorById; + if (Utility.validString(str) && (authenticatorById = NimbleIdentityImpl.getComponent().getAuthenticatorById(str)) != null) { + NimbleIdentityImpl.getComponent().resolveLogout(authenticatorById); + } + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java new file mode 100644 index 0000000..3aca7f7 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityImpl.java @@ -0,0 +1,558 @@ +package com.ea.nimble.identity; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import com.ea.nimble.Base; +import com.ea.nimble.Component; +import com.ea.nimble.Error; +import com.ea.nimble.Global; +import com.ea.nimble.HttpRequest; +import com.ea.nimble.IHttpRequest; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Network; +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.Persistence; +import com.ea.nimble.PersistenceService; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.Utility; +import com.ea.nimble.identity.INimbleIdentity; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import com.ea.nimble.identity.NimbleIdentityError; +import com.ea.nimble.tracking.ITracking; +import com.ea.nimble.tracking.Tracking; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.UUID; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityImpl.class */ +public class NimbleIdentityImpl extends Component implements LogSource, INimbleIdentity { + private static final String DATA_TEMPLATE_MIGRATE = "?client_id=%s&tuid=%s"; + private static final String REQUEST_HEADER_CONTENT_TYPE_KEY = "Content-type"; + private static final String REQUEST_HEADER_CONTENT_TYPE_VALUE = "application/x-www-form-urlencoded"; + private static final String REQUEST_HEADER_SOURCE_AT_KEY = "X-SOURCE-ACCESS-TOKEN"; + private static final String REQUEST_HEADER_TARGET_AT_KEY = "X-TARGET-ACCESS-TOKEN"; + private static final String URL_TEMPLATE_MIGRATE = "%s/connect/migrate"; + private static final String URL_TEMPLATE_REQUEST_SERVER_AUTHENTICATION_OAUTH_CODE = "%s/connect/auth?client_id=%s&response_type=code&access_token=%s&redirect_uri=nucleus:rest"; + private INimbleIdentityAuthenticationConductor m_authenticationConductor; + private NimbleIdentityAuthenticationConductorHandler m_authenticationConductorHandler; + private INimbleIdentityAuthenticator m_mainAuthenticator; + private INimbleIdentity.NimbleIdentityState m_state = INimbleIdentity.NimbleIdentityState.NIMBLE_IDENTITY_UNAVAILABLE; + private HashMap m_authenticators = new HashMap<>(); + private NimbleIdentityConfig m_configuration = new NimbleIdentityConfig(); + private HashMap m_pidMap = new HashMap<>(); + private final BroadcastReceiver m_authenticationUpdateReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.1 + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + NimbleIdentityImpl.this.onAuthenticatorStateChange(); + } + }; + private final BroadcastReceiver m_pidInfoUpdateReceiver = new BroadcastReceiver() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.2 + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + NimbleIdentityImpl.this.onPidInfoUpdate(); + } + }; + + private NimbleIdentityImpl() { + } + + private String getAndValidateTokenForMigration(String str) { + String accessToken = getAuthenticatorBaseById(str).getAccessToken().getAccessToken(); + String str2 = accessToken; + if (!Utility.validString(accessToken)) { + str2 = null; + } + return str2; + } + + public static NimbleIdentityImpl getComponent() { + return (NimbleIdentityImpl) Base.getComponent("com.ea.nimble.identity"); + } + + private static void initialize() { + Base.registerComponent(new NimbleIdentityImpl(), "com.ea.nimble.identity"); + } + + private String loadMainAuthenticator() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent != null) { + return persistenceForNimbleComponent.getStringValue("mainAuthenticatorId"); + } + return null; + } + + public void onAuthenticatorStateChange() { + synchronized (this) { + Iterator it = this.m_authenticators.values().iterator(); + while (true) { + if (it.hasNext()) { + if (it.next().getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + setState(INimbleIdentity.NimbleIdentityState.NIMBLE_IDENTITY_AUTHENTICATING); + break; + } + } else { + setState(INimbleIdentity.NimbleIdentityState.NIMBLE_IDENTITY_READY); + break; + } + } + } + } + + public void onPidInfoUpdate() { + HashMap hashMap = new HashMap<>(); + for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator : this.m_authenticators.values()) { + NimbleIdentityPidInfo pidInfo = iNimbleIdentityAuthenticator.getPidInfo(); + if (pidInfo != null) { + hashMap.put(iNimbleIdentityAuthenticator.getAuthenticatorId(), pidInfo.getPid()); + } + } + synchronized (this) { + this.m_pidMap = hashMap; + } + } + + private void saveMainAuthenticator(String str) { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(getComponentId(), Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent != null) { + persistenceForNimbleComponent.setValue("mainAuthenticatorId", str); + } + } + + private Error validateMigrationIds(String str, String str2) { + if (str == null || str.length() <= 0) { + Log.Helper.LOGE(this, "Source authenticator ID is either null or empty", new Object[0]); + return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_SOURCE_INVALID, "Source authenticator ID is either null or empty"); + } else if (str2 == null || str2.length() <= 0) { + Log.Helper.LOGE(this, "Target authenticator ID is either null or empty", new Object[0]); + return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_TARGET_INVALID, "Target authenticator ID is either null or empty"); + } else if (!str.equals(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)) { + Log.Helper.LOGE(this, "Source authenticator must be anonymous", new Object[0]); + return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_SOURCE_INVALID, "Source authenticator must be anonymous"); + } else if (str2.equals(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)) { + Log.Helper.LOGE(this, "Target authenticator cannot be anonymous", new Object[0]); + return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_TARGET_INVALID, "Target authenticator cannot be anonymous"); + } else { + INimbleIdentityAuthenticator authenticatorById = getAuthenticatorById(str); + if (authenticatorById == null || authenticatorById.getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + Log.Helper.LOGE(this, "Source authenticator is not logged in", new Object[0]); + return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_NOT_AUTHENTICATED, "Source authenticator is not logged in"); + } + INimbleIdentityAuthenticator authenticatorById2 = getAuthenticatorById(str2); + if (authenticatorById2 != null && authenticatorById2.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + return null; + } + Log.Helper.LOGE(this, "Target authenticator is not logged in", new Object[0]); + return new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_NOT_AUTHENTICATED, "Target authenticator is not logged in"); + } + } + + @Override // com.ea.nimble.Component + public void cleanup() { + Utility.unregisterReceiver(this.m_authenticationUpdateReceiver); + Utility.unregisterReceiver(this.m_pidInfoUpdateReceiver); + } + + public void completeMigration(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2, INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + Log.Helper.LOGD(this, "Account migration successful", new Object[0]); + Component component = Base.getComponent(Tracking.COMPONENT_ID); + if (component != null) { + ITracking iTracking = (ITracking) component; + HashMap hashMap = new HashMap(); + HashMap hashMap2 = new HashMap(); + hashMap2.put(iNimbleIdentityAuthenticator.getAuthenticatorId(), iNimbleIdentityAuthenticator.getPidInfo().getPid()); + hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE, Utility.convertObjectToJSONString(hashMap2)); + HashMap hashMap3 = new HashMap(); + hashMap3.put(iNimbleIdentityAuthenticator2.getAuthenticatorId(), iNimbleIdentityAuthenticator2.getPidInfo().getPid()); + hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_TARGET, Utility.convertObjectToJSONString(hashMap3)); + hashMap.put(Tracking.NIMBLE_TRACKING_KEY_MIGRATION_GAME_TRIGGERED, Global.NOTIFICATION_DICTIONARY_RESULT_FAIL); + iTracking.logEvent(Tracking.NIMBLE_TRACKING_EVENT_IDENTITY_MIGRATION, hashMap); + } + setMainAuthenticator(iNimbleIdentityAuthenticator2); + getAuthenticatorBaseById(iNimbleIdentityAuthenticator.getAuthenticatorId()).completeMigration(); + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.identity", Persistence.Storage.DOCUMENT); + persistenceForNimbleComponent.setValue(INimbleIdentity.MIGRATION_PERSISTENCE_ID, null); + persistenceForNimbleComponent.synchronize(); + if (nimbleIdentityAuthenticatorCallback != null) { + nimbleIdentityAuthenticatorCallback.onCallback(iNimbleIdentityAuthenticator2, null); + } + } + + public NimbleIdentityAuthenticationConductorHandler getAuthenticationConductor() { + return this.m_authenticationConductorHandler; + } + + public AuthenticatorBase getAuthenticatorBaseById(String str) { + INimbleIdentityAuthenticator iNimbleIdentityAuthenticator = this.m_authenticators.get(str); + if (iNimbleIdentityAuthenticator == null || !(iNimbleIdentityAuthenticator instanceof AuthenticatorBase)) { + return null; + } + return (AuthenticatorBase) iNimbleIdentityAuthenticator; + } + + @Override // com.ea.nimble.identity.INimbleIdentity + public INimbleIdentityAuthenticator getAuthenticatorById(String str) { + INimbleIdentityAuthenticator iNimbleIdentityAuthenticator = null; + if (this.m_authenticationConductor != null) { + iNimbleIdentityAuthenticator = this.m_authenticators.get(str); + } + return iNimbleIdentityAuthenticator; + } + + @Override // com.ea.nimble.identity.INimbleIdentity + public List getAuthenticators() { + if (this.m_authenticationConductor == null) { + return null; + } + return new LinkedList(this.m_authenticators.values()); + } + + @Override // com.ea.nimble.identity.INimbleIdentity + public boolean getAutoRefreshFlag() { + return this.m_configuration.getAutoRefresh(); + } + + @Override // com.ea.nimble.Component + public String getComponentId() { + return "com.ea.nimble.identity"; + } + + public NimbleIdentityConfig getConfiguration() { + return this.m_configuration; + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "Identity"; + } + + @Override // com.ea.nimble.identity.INimbleIdentity + public List getLoggedInAuthenticators() { + ArrayList arrayList = new ArrayList(); + if (this.m_authenticationConductor != null) { + synchronized (this) { + if (this.m_authenticators != null && this.m_authenticators.size() > 0) { + for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator : this.m_authenticators.values()) { + if (iNimbleIdentityAuthenticator.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + arrayList.add(iNimbleIdentityAuthenticator); + } + } + } + } + } + return arrayList; + } + + public INimbleIdentityAuthenticator getMainAuthenticator() { + return this.m_mainAuthenticator; + } + + @Override // com.ea.nimble.identity.INimbleIdentity + public Map getPidMap() { + if (this.m_authenticationConductor == null) { + return null; + } + return getPidMapInternal(); + } + + public HashMap getPidMapInternal() { + return this.m_pidMap; + } + + @Override // com.ea.nimble.identity.INimbleIdentity + public INimbleIdentity.NimbleIdentityState getState() { + return this.m_state; + } + + public void handlePendingMigration(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, String str, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2) { + makeMigrationNetworkCall(nimbleIdentityAuthenticatorCallback, str, iNimbleIdentityAuthenticator, getAndValidateTokenForMigration(iNimbleIdentityAuthenticator.getAuthenticatorId()), iNimbleIdentityAuthenticator2, getAndValidateTokenForMigration(iNimbleIdentityAuthenticator2.getAuthenticatorId())); + } + + public void highlight(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { + Log.Helper.LOGD(this, "Game wants to high light the just logged in authenticator", new Object[0]); + setMainAuthenticator(iNimbleIdentityAuthenticator); + } + + void makeMigrationNetworkCall(final INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, String str, final INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, String str2, final INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2, String str3) { + ByteArrayOutputStream byteArrayOutputStream; + Log.Helper.LOGD(this, "Starting migration network call", new Object[0]); + String format = String.format(DATA_TEMPLATE_MIGRATE, this.m_configuration.getClientId(), str); + URL url = null; + try { + String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_IDENTITY_CONNECT); + String str4 = serverUrlWithKey; + if (serverUrlWithKey.substring(serverUrlWithKey.length() - 1).equals("/")) { + str4 = serverUrlWithKey.substring(0, serverUrlWithKey.length() - 1); + } + url = new URL(String.format(URL_TEMPLATE_MIGRATE, str4) + format); + try { + byte[] bytes = format.getBytes("UTF-8"); + byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); + try { + byteArrayOutputStream.write(bytes); + } catch (IOException e) { + } + } catch (IOException e2) { + byteArrayOutputStream = null; + } + } catch (IOException e3) { + byteArrayOutputStream = null; + } + HashMap hashMap = new HashMap<>(); + hashMap.put(REQUEST_HEADER_CONTENT_TYPE_KEY, REQUEST_HEADER_CONTENT_TYPE_VALUE); + hashMap.put(REQUEST_HEADER_SOURCE_AT_KEY, str3); + hashMap.put(REQUEST_HEADER_TARGET_AT_KEY, str2); + HttpRequest httpRequest = new HttpRequest(url); + httpRequest.method = IHttpRequest.Method.POST; + httpRequest.headers = hashMap; + httpRequest.data = byteArrayOutputStream; + Network.getComponent().sendRequest(httpRequest, new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.5 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + Exception error = networkConnectionHandle.getResponse().getError(); + if (error != null) { + Log.Helper.LOGE(this, "Request for account migration failed for error " + error, new Object[0]); + NimbleIdentityImpl.this.getAuthenticatorBaseById(iNimbleIdentityAuthenticator.getAuthenticatorId()).logout(null); + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(NimbleIdentityImpl.this.getComponentId(), Persistence.Storage.DOCUMENT); + persistenceForNimbleComponent.setValue(INimbleIdentity.MIGRATION_PERSISTENCE_ID, null); + persistenceForNimbleComponent.synchronize(); + nimbleIdentityAuthenticatorCallback.onCallback(null, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_FAILED.intValue(), error.getMessage(), error)); + return; + } + NimbleIdentityImpl.this.completeMigration(iNimbleIdentityAuthenticator2, iNimbleIdentityAuthenticator, nimbleIdentityAuthenticatorCallback); + } + }); + } + + public void migrate(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2) { + if (nimbleIdentityAuthenticatorCallback == null) { + Log.Helper.LOGW(this, "Request account migration without callback, no way to notify caller", new Object[0]); + return; + } + Log.Helper.LOGI(this, "Request account migration", new Object[0]); + Component component = Base.getComponent(Tracking.COMPONENT_ID); + if (component != null) { + ITracking iTracking = (ITracking) component; + HashMap hashMap = new HashMap(); + HashMap hashMap2 = new HashMap(); + hashMap2.put(iNimbleIdentityAuthenticator2.getAuthenticatorId(), iNimbleIdentityAuthenticator2.getPidInfo().getPid()); + hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE, Utility.convertObjectToJSONString(hashMap2)); + HashMap hashMap3 = new HashMap(); + hashMap3.put(iNimbleIdentityAuthenticator.getAuthenticatorId(), iNimbleIdentityAuthenticator.getPidInfo().getPid()); + hashMap.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_TARGET, Utility.convertObjectToJSONString(hashMap3)); + hashMap.put(Tracking.NIMBLE_TRACKING_KEY_MIGRATION_GAME_TRIGGERED, Global.NOTIFICATION_DICTIONARY_RESULT_FAIL); + iTracking.logEvent(Tracking.NIMBLE_TRACKING_EVENT_IDENTITY_MIGRATION_STARTED, hashMap); + } + String authenticatorId = iNimbleIdentityAuthenticator2.getAuthenticatorId(); + String authenticatorId2 = iNimbleIdentityAuthenticator.getAuthenticatorId(); + Error validateMigrationIds = validateMigrationIds(authenticatorId, authenticatorId2); + if (validateMigrationIds != null) { + nimbleIdentityAuthenticatorCallback.onCallback(null, validateMigrationIds); + } + String andValidateTokenForMigration = getAndValidateTokenForMigration(authenticatorId); + String andValidateTokenForMigration2 = getAndValidateTokenForMigration(authenticatorId2); + if (andValidateTokenForMigration == null || andValidateTokenForMigration2 == null) { + NimbleIdentityError nimbleIdentityError = new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_NO_ACCESS_TOKENS, "Access token is empty or invalid"); + Log.Helper.LOGE(this, "Request for account migration failed for error " + nimbleIdentityError, new Object[0]); + nimbleIdentityAuthenticatorCallback.onCallback(null, nimbleIdentityError); + } + if (!Utility.validString(this.m_configuration.getClientId())) { + NimbleIdentityError nimbleIdentityError2 = new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_BAD_CLIENT_ID, "ClientId is empty or invalid"); + Log.Helper.LOGE(this, "Request for account migration failed for error " + nimbleIdentityError2, new Object[0]); + nimbleIdentityAuthenticatorCallback.onCallback(null, nimbleIdentityError2); + } + String uuid = UUID.randomUUID().toString(); + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.identity", Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent == null) { + Log.Helper.LOGW(this, "Attempted to save pending migration data but persistence was not available. Not saving.", new Object[0]); + } else { + persistenceForNimbleComponent.setValue(INimbleIdentity.MIGRATION_PERSISTENCE_ID, new NimbleIdentityMigrationObject(uuid, authenticatorId2, iNimbleIdentityAuthenticator.getPidInfo().getPid(), authenticatorId, iNimbleIdentityAuthenticator2.getPidInfo().getPid())); + persistenceForNimbleComponent.synchronize(); + Log.Helper.LOGV(this, "Migration object saved to persistence", new Object[0]); + } + makeMigrationNetworkCall(nimbleIdentityAuthenticatorCallback, uuid, iNimbleIdentityAuthenticator, andValidateTokenForMigration2, iNimbleIdentityAuthenticator2, andValidateTokenForMigration); + } + + void migrationFailed(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, Error error) { + Log.Helper.LOGD(this, "Migration failed for %s.", iNimbleIdentityAuthenticator); + iNimbleIdentityAuthenticator.logout(nimbleIdentityAuthenticatorCallback); + } + + @Override // com.ea.nimble.identity.INimbleIdentity + public void requestServerAuthCodeForLegacyOriginToken(String str, final String str2, final String str3, final INimbleIdentityAuthenticator.NimbleIdentityServerAuthCodeCallback nimbleIdentityServerAuthCodeCallback) { + if (nimbleIdentityServerAuthCodeCallback == null) { + Log.Helper.LOGW(this, "Request server authentication oAuth code without callback, no way to get result", new Object[0]); + return; + } + Log.Helper.LOGV(this, "Request server authentication oauth code for legacy origin ocs token", new Object[0]); + URL url = null; + try { + String format = String.format(URL_TEMPLATE_REQUEST_SERVER_AUTHENTICATION_OAUTH_CODE, this.m_configuration.getConnectServerUrl(), str2, str); + String str4 = format; + if (Utility.validString(str3)) { + str4 = format + String.format("&scope=%s", str3); + } + url = new URL(str4); + } catch (MalformedURLException e) { + } + Network.getComponent().sendGetRequest(url, new HashMap<>(), new NetworkConnectionCallback() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.4 + @Override // com.ea.nimble.NetworkConnectionCallback + public void callback(NetworkConnectionHandle networkConnectionHandle) { + try { + Map parseBodyJSONData = NimbleIdentityUtility.parseBodyJSONData(networkConnectionHandle); + String str5 = (String) parseBodyJSONData.get("code"); + if (!Utility.validString(str5)) { + Error error = new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Fail to parse oAuth code from server response data " + parseBodyJSONData); + Log.Helper.LOGD(NimbleIdentityImpl.this, "Request for legacy server auth code failed for error " + error, new Object[0]); + nimbleIdentityServerAuthCodeCallback.onCallback(null, null, str2, str3, error); + return; + } + Log.Helper.LOGD(this, "Request for server auth code succeed with auth code: " + str5, new Object[0]); + nimbleIdentityServerAuthCodeCallback.onCallback(null, str5, str2, str3, null); + } catch (Error e2) { + Log.Helper.LOGD(NimbleIdentityImpl.this, "Request for legacy server auth code failed for error " + e2, new Object[0]); + nimbleIdentityServerAuthCodeCallback.onCallback(null, null, str2, str3, e2); + } + } + }); + } + + public void resolveLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { + if (iNimbleIdentityAuthenticator != null) { + setMainAuthenticator(iNimbleIdentityAuthenticator); + } + } + + @Override // com.ea.nimble.Component + public void restore() { + this.m_configuration.initialize(); + this.m_authenticators.clear(); + 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 (Component component : componentList) { + if (!(component instanceof INimbleIdentityAuthenticator)) { + Log.Helper.LOGW(this, "Invalid authenticator %s", component.getComponentId()); + } else { + INimbleIdentityAuthenticator iNimbleIdentityAuthenticator = (INimbleIdentityAuthenticator) component; + this.m_authenticators.put(iNimbleIdentityAuthenticator.getAuthenticatorId(), iNimbleIdentityAuthenticator); + } + } + String loadMainAuthenticator = loadMainAuthenticator(); + String str = loadMainAuthenticator; + if (loadMainAuthenticator == null) { + Log.Helper.LOGD(this, "No existing main authenticator. Will log in anonymous authenticator", new Object[0]); + str = Global.NIMBLE_AUTHENTICATOR_ANONYMOUS; + } + Log.Helper.LOGD(this, "Main authenticator is " + str, new Object[0]); + AuthenticatorBase authenticatorBaseById = getAuthenticatorBaseById(str); + authenticatorBaseById.setState(INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_OFFLINE); + authenticatorBaseById.restoreAuthenticator(new INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback() { // from class: com.ea.nimble.identity.NimbleIdentityImpl.3 + @Override // com.ea.nimble.identity.INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback + public void onCallback(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2, Error error) { + for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator3 : NimbleIdentityImpl.this.m_authenticators.values()) { + AuthenticatorBase authenticatorBase = (AuthenticatorBase) iNimbleIdentityAuthenticator3; + if (authenticatorBase != iNimbleIdentityAuthenticator2) { + authenticatorBase.restoreAuthenticator(null); + } + } + } + }); + for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2 : this.m_authenticators.values()) { + if (iNimbleIdentityAuthenticator2.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_GOING) { + this.m_state = INimbleIdentity.NimbleIdentityState.NIMBLE_IDENTITY_AUTHENTICATING; + } + } + } + + @Override // com.ea.nimble.identity.INimbleIdentity + public void setAuthenticationConductor(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor) { + if (this.m_authenticationConductor != null) { + Log.Helper.LOGW(this, "Attempting setAuthenticationConductor when we already have one. Unsupported. Ignoring.", new Object[0]); + } else if (iNimbleIdentityAuthenticationConductor == null) { + Log.Helper.LOGW(this, "Attempting to setAuthenticationConductor with a null conductor.", new Object[0]); + } else if (this.m_authenticationConductor != iNimbleIdentityAuthenticationConductor) { + this.m_authenticationConductor = iNimbleIdentityAuthenticationConductor; + if (iNimbleIdentityAuthenticationConductor instanceof INimbleIdentityGenericAuthenticationConductor) { + Log.Helper.LOGD(this, "Setting the generic auth conductor as our conductor.", new Object[0]); + this.m_authenticationConductorHandler = new NimbleIdentityGenericAuthenticationConductorHandler(iNimbleIdentityAuthenticationConductor); + } else if (iNimbleIdentityAuthenticationConductor instanceof INimbleIdentityMigrationAuthenticationConductor) { + Log.Helper.LOGD(this, "Setting the migration auth conductor as our conductor.", new Object[0]); + this.m_authenticationConductorHandler = new NimbleIdentityMigrationAuthenticationConductorHandler(iNimbleIdentityAuthenticationConductor); + } + for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator : getAuthenticators()) { + if (iNimbleIdentityAuthenticator != null) { + ((AuthenticatorBase) iNimbleIdentityAuthenticator).resume(); + } + } + } + } + + @Override // com.ea.nimble.identity.INimbleIdentity + public void setAutoRefreshFlag(boolean z) { + this.m_configuration.setAutoRefresh(z); + Iterator it = this.m_authenticators.values().iterator(); + while (it.hasNext()) { + ((AuthenticatorBase) it.next()).enableAutoRefresh(z); + } + } + + public void setMainAuthenticator(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { + if (iNimbleIdentityAuthenticator == null) { + Log.Helper.LOGW(this, "Failed to set mainAuthenticator with new authenticator because given authenticator is null.", new Object[0]); + } else if (iNimbleIdentityAuthenticator == this.m_mainAuthenticator) { + Log.Helper.LOGV(this, "Skipping setMainAuthenticator because the given authenticator is the same as the previous one.", new Object[0]); + } else { + Log.Helper.LOGD(this, "Setting mainAuthenticator to: " + iNimbleIdentityAuthenticator.getAuthenticatorId(), new Object[0]); + this.m_mainAuthenticator = iNimbleIdentityAuthenticator; + HashMap hashMap = new HashMap(); + String authenticatorId = this.m_mainAuthenticator.getAuthenticatorId(); + saveMainAuthenticator(authenticatorId); + NimbleIdentityPidInfo pidInfo = this.m_mainAuthenticator.getPidInfo(); + if (pidInfo != null) { + hashMap.put(authenticatorId, pidInfo.getPid()); + } else { + hashMap.put(authenticatorId, ""); + } + HashMap hashMap2 = new HashMap(); + hashMap2.put(Tracking.NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE, hashMap); + Utility.sendBroadcastSerializable(Global.NIMBLE_NOTIFICATION_IDENTITY_MAIN_AUTHENTICATOR_CHANGE, hashMap2); + } + } + + public void setState(INimbleIdentity.NimbleIdentityState nimbleIdentityState) { + if (this.m_state != nimbleIdentityState) { + this.m_state = nimbleIdentityState; + Utility.sendBroadcast(INimbleIdentity.NIMBLE_NOTIFICATION_IDENTITY_UPDATE, null); + } + } + + public void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2) { + if (nimbleIdentityAuthenticatorCallback == null) { + Log.Helper.LOGW(this, "Requested account switching without callback. No way to notify caller. Aborting...", new Object[0]); + } else if (iNimbleIdentityAuthenticator2 == null) { + nimbleIdentityAuthenticatorCallback.onCallback(null, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_SOURCE_INVALID, "Attempted to switchAuthenticators but source authenticator was null")); + } else if (iNimbleIdentityAuthenticator == null) { + nimbleIdentityAuthenticatorCallback.onCallback(null, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_TARGET_INVALID, "Attempted to switchAuthenticators but target authenticator was null")); + } else if (iNimbleIdentityAuthenticator2.getAuthenticatorId().equals(iNimbleIdentityAuthenticator.getAuthenticatorId())) { + nimbleIdentityAuthenticatorCallback.onCallback(null, new NimbleIdentityError(NimbleIdentityError.NimbleIdentityErrorCode.NIMBLE_IDENTITY_ERROR_MIGRATION_FAILED, "Attempted to switch from one authenticator to itself. Your from and your to authenticators must be different.")); + } else { + setMainAuthenticator(iNimbleIdentityAuthenticator); + if (iNimbleIdentityAuthenticator2.getAuthenticatorId() == Global.NIMBLE_AUTHENTICATOR_ANONYMOUS) { + ((AuthenticatorAnonymous) iNimbleIdentityAuthenticator2).logoutInternal(nimbleIdentityAuthenticatorCallback); + } else { + nimbleIdentityAuthenticatorCallback.onCallback(iNimbleIdentityAuthenticator, 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 new file mode 100644 index 0000000..32b56ad --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityLoginParams.java @@ -0,0 +1,111 @@ +package com.ea.nimble.identity; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams.class */ +public abstract class NimbleIdentityLoginParams { + + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$AnonymousLoginParams.class */ + public static class AnonymousLoginParams extends NimbleIdentityLoginParams { + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$FacebookAccessTokenLoginParams.class */ + public static class FacebookAccessTokenLoginParams extends NimbleIdentityLoginParams { + private Date expiryDate; + private String facebookAccessToken; + + FacebookAccessTokenLoginParams() { + this.facebookAccessToken = ""; + } + + public FacebookAccessTokenLoginParams(String str, Date date) { + this.facebookAccessToken = ""; + this.facebookAccessToken = str; + this.expiryDate = date; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public Date getExpiryDate() { + return this.expiryDate; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public String getFacebookAccessToken() { + return this.facebookAccessToken; + } + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$FacebookClientLoginParams.class */ + public static class FacebookClientLoginParams extends NimbleIdentityLoginParams { + private List facebookPermissions; + + public FacebookClientLoginParams(List list) { + if (list == null || list.size() <= 0) { + this.facebookPermissions = new ArrayList(); + this.facebookPermissions.add("email"); + return; + } + this.facebookPermissions = list; + if (!list.contains("email")) { + this.facebookPermissions.add("email"); + } + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public List getFacebookPermissions() { + return this.facebookPermissions; + } + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$OriginCredentialsLoginParams.class */ + public static class OriginCredentialsLoginParams extends NimbleIdentityLoginParams { + private String password; + private String username; + + OriginCredentialsLoginParams() { + this.username = ""; + this.password = ""; + } + + public OriginCredentialsLoginParams(String str, String str2) { + this.username = ""; + this.password = ""; + this.username = str; + this.password = str2; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public String getPassword() { + return this.password; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public String getUsername() { + return this.username; + } + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityLoginParams$OriginOAuthCodeLoginParams.class */ + public static class OriginOAuthCodeLoginParams extends NimbleIdentityLoginParams { + private String oAuthCode; + + OriginOAuthCodeLoginParams() { + this.oAuthCode = ""; + } + + public OriginOAuthCodeLoginParams(String str) { + this.oAuthCode = ""; + this.oAuthCode = str; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public String getOauthCode() { + return this.oAuthCode; + } + } + + protected NimbleIdentityLoginParams() { + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationAuthenticationConductorHandler.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationAuthenticationConductorHandler.java new file mode 100644 index 0000000..f5ab885 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationAuthenticationConductorHandler.java @@ -0,0 +1,94 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Global; +import com.ea.nimble.Log; +import com.ea.nimble.Persistence; +import com.ea.nimble.PersistenceService; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import java.util.Iterator; +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityMigrationAuthenticationConductorHandler.class */ +class NimbleIdentityMigrationAuthenticationConductorHandler implements NimbleIdentityAuthenticationConductorHandler { + private INimbleIdentityMigrationAuthenticationConductor m_conductor; + + public NimbleIdentityMigrationAuthenticationConductorHandler(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor) { + this.m_conductor = (INimbleIdentityMigrationAuthenticationConductor) iNimbleIdentityAuthenticationConductor; + List loggedInAuthenticators = NimbleIdentity.getComponent().getLoggedInAuthenticators(); + if (loggedInAuthenticators.size() > 0) { + if (loggedInAuthenticators.size() != 1) { + Iterator it = loggedInAuthenticators.iterator(); + while (true) { + if (!it.hasNext()) { + break; + } + INimbleIdentityAuthenticator next = it.next(); + if (!next.getAuthenticatorId().equals(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)) { + NimbleIdentityImpl.getComponent().setMainAuthenticator(next); + break; + } + } + } else { + NimbleIdentityImpl.getComponent().setMainAuthenticator(loggedInAuthenticators.get(0)); + } + } + handlePendingMigration(); + } + + @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler + public void handleLogin(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, boolean z) { + NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); + INimbleIdentityAuthenticator mainAuthenticator = component.getMainAuthenticator(); + if (mainAuthenticator == null) { + component.setMainAuthenticator(iNimbleIdentityAuthenticator); + } else if (iNimbleIdentityAuthenticator == mainAuthenticator) { + Log.Helper.LOGW(this, "Error. Attempted to handle login on a authenticator: %s which is already mainAuthenticator", iNimbleIdentityAuthenticator.getAuthenticatorId()); + } else if (!handlePendingMigration()) { + this.m_conductor.handleLogin(new NimbleIdentityMigrationLoginResolver(iNimbleIdentityAuthenticator)); + } + } + + @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler + public void handleLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { + if (iNimbleIdentityAuthenticator == null) { + Log.Helper.LOGF(this, "Given a null authenticator as part of logout proess.", new Object[0]); + } else if (!iNimbleIdentityAuthenticator.getAuthenticatorId().equals(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)) { + NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); + AuthenticatorBase authenticatorBaseById = component.getAuthenticatorBaseById(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS); + if (authenticatorBaseById == null) { + Log.Helper.LOGF(this, "Unable to set Anonymous Authenticator as main authenticator as part of logout process.", new Object[0]); + return; + } + component.setMainAuthenticator(authenticatorBaseById); + if (authenticatorBaseById.getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + authenticatorBaseById.autoLogin(); + } + } + } + + public boolean handlePendingMigration() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.identity", Persistence.Storage.DOCUMENT); + if (persistenceForNimbleComponent == null) { + Log.Helper.LOGW(this, "Attempted to check pending migration status but persistence was not available. Failing.", new Object[0]); + return false; + } + NimbleIdentityMigrationObject nimbleIdentityMigrationObject = (NimbleIdentityMigrationObject) persistenceForNimbleComponent.getValue(INimbleIdentity.MIGRATION_PERSISTENCE_ID); + if (nimbleIdentityMigrationObject == null) { + Log.Helper.LOGI(this, "No pending migration object found in persistence!", new Object[0]); + return false; + } + NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); + AuthenticatorBase authenticatorBaseById = component.getAuthenticatorBaseById(nimbleIdentityMigrationObject.m_currentAuthenticatorId); + if (authenticatorBaseById.getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS || !authenticatorBaseById.getPidInfo().getPid().equals(nimbleIdentityMigrationObject.m_currentAuthenticatorPid)) { + return false; + } + AuthenticatorBase authenticatorBaseById2 = component.getAuthenticatorBaseById(nimbleIdentityMigrationObject.m_newAuthenticatorId); + if (authenticatorBaseById2.getState() != INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS || !authenticatorBaseById2.getPidInfo().getPid().equals(nimbleIdentityMigrationObject.m_newAuthenticatorPid)) { + return false; + } + NimbleIdentityPendingMigrationResolver nimbleIdentityPendingMigrationResolver = new NimbleIdentityPendingMigrationResolver(nimbleIdentityMigrationObject.m_migrationGUID, nimbleIdentityMigrationObject.m_newAuthenticatorId, nimbleIdentityMigrationObject.m_newAuthenticatorPid, nimbleIdentityMigrationObject.m_currentAuthenticatorId, nimbleIdentityMigrationObject.m_currentAuthenticatorPid); + Log.Helper.LOGI(this, "Sending request to game to handle pending migration", new Object[0]); + this.m_conductor.handlePendingMigration(nimbleIdentityPendingMigrationResolver); + return true; + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationLoginResolver.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationLoginResolver.java new file mode 100644 index 0000000..89ea237 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationLoginResolver.java @@ -0,0 +1,48 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Global; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import java.util.ArrayList; +import java.util.List; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityMigrationLoginResolver.class */ +class NimbleIdentityMigrationLoginResolver implements INimbleIdentityMigrationLoginResolver { + private INimbleIdentityAuthenticator m_authenticator; + private String m_authenticatorId; + private ArrayList m_loggedInAuthenticatorIds = new ArrayList<>(); + + /* JADX INFO: Access modifiers changed from: package-private */ + public NimbleIdentityMigrationLoginResolver(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { + this.m_authenticator = iNimbleIdentityAuthenticator; + this.m_authenticatorId = iNimbleIdentityAuthenticator.getAuthenticatorId(); + for (INimbleIdentityAuthenticator iNimbleIdentityAuthenticator2 : NimbleIdentity.getComponent().getLoggedInAuthenticators()) { + this.m_loggedInAuthenticatorIds.add(iNimbleIdentityAuthenticator2.getAuthenticatorId()); + } + } + + @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver + public List getLoggedInAuthenticatorIds() { + return this.m_loggedInAuthenticatorIds; + } + + @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver + public String getLoggingInAuthenticatorId() { + return this.m_authenticatorId; + } + + @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver + public void ignore() { + } + + @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver + public void migrate(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); + component.migrate(nimbleIdentityAuthenticatorCallback, this.m_authenticator, component.getMainAuthenticator()); + } + + @Override // com.ea.nimble.identity.INimbleIdentityMigrationLoginResolver + public void switchAuthenticators(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); + component.switchAuthenticators(nimbleIdentityAuthenticatorCallback, this.m_authenticator, component.getAuthenticatorById(Global.NIMBLE_AUTHENTICATOR_ANONYMOUS)); + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationObject.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationObject.java new file mode 100644 index 0000000..9ffb564 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityMigrationObject.java @@ -0,0 +1,25 @@ +package com.ea.nimble.identity; + +import java.io.Serializable; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityMigrationObject.class */ +class NimbleIdentityMigrationObject implements Serializable { + private static final long serialVersionUID = 1; + String m_currentAuthenticatorId; + String m_currentAuthenticatorPid; + String m_migrationGUID; + String m_newAuthenticatorId; + String m_newAuthenticatorPid; + + NimbleIdentityMigrationObject() { + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public NimbleIdentityMigrationObject(String str, String str2, String str3, String str4, String str5) { + this.m_migrationGUID = str; + this.m_newAuthenticatorId = str2; + this.m_newAuthenticatorPid = str3; + this.m_currentAuthenticatorId = str4; + this.m_currentAuthenticatorPid = str5; + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPendingMigrationResolver.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPendingMigrationResolver.java new file mode 100644 index 0000000..c68adeb --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPendingMigrationResolver.java @@ -0,0 +1,41 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.identity.INimbleIdentityAuthenticator; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPendingMigrationResolver.class */ +public class NimbleIdentityPendingMigrationResolver implements INimbleIdentityPendingMigrationResolver { + private String m_GUID; + private String m_currentAuthenticatorId; + private String m_currentAuthenticatorPid; + private String m_newAuthenticatorId; + + /* JADX INFO: Access modifiers changed from: package-private */ + public NimbleIdentityPendingMigrationResolver(String str, String str2, String str3, String str4, String str5) { + this.m_GUID = str; + this.m_newAuthenticatorId = str2; + this.m_currentAuthenticatorId = str4; + this.m_currentAuthenticatorPid = str5; + } + + @Override // com.ea.nimble.identity.INimbleIdentityPendingMigrationResolver + public String getMigrationSourceAuthenticatorId() { + return this.m_currentAuthenticatorId; + } + + @Override // com.ea.nimble.identity.INimbleIdentityPendingMigrationResolver + public String getMigrationTargetAuthenticatorId() { + return this.m_newAuthenticatorId; + } + + @Override // com.ea.nimble.identity.INimbleIdentityPendingMigrationResolver + public void resume(INimbleIdentityAuthenticator.NimbleIdentityAuthenticatorCallback nimbleIdentityAuthenticatorCallback) { + NimbleIdentityImpl component = NimbleIdentityImpl.getComponent(); + INimbleIdentityAuthenticator authenticatorById = component.getAuthenticatorById(this.m_currentAuthenticatorId); + INimbleIdentityAuthenticator authenticatorById2 = component.getAuthenticatorById(this.m_newAuthenticatorId); + if (!authenticatorById.getPidInfo().getPid().equals(this.m_currentAuthenticatorPid)) { + component.completeMigration(authenticatorById, authenticatorById2, nimbleIdentityAuthenticatorCallback); + } else { + component.handlePendingMigration(nimbleIdentityAuthenticatorCallback, this.m_GUID, authenticatorById2, authenticatorById); + } + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java new file mode 100644 index 0000000..adfc882 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPersona.java @@ -0,0 +1,518 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Log; + +import java.util.Date; +import java.util.Map; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona.class */ +public class NimbleIdentityPersona { + private String dateCreated; + private String displayName; + private Date expiryTime; + private String isVisible; + private String lastAuthenticated; + private String name; + private String namespaceName; + private long personaId; + private String pidId; + private PersonaPrivacyLevel showPersona; + private PersonaStatus status; + private PersonaStatusReasonCodes statusReasonCode; + + /* renamed from: com.ea.nimble.identity.NimbleIdentityPersona$1 reason: invalid class name */ + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona$1.class */ + static /* synthetic */ class AnonymousClass1 { + static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel = new int[PersonaPrivacyLevel.values().length]; + static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus; + static final /* synthetic */ int[] $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes; + + static { + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_NO_ONE.ordinal()] = 1; + } catch (NoSuchFieldError e) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_EVERYONE.ordinal()] = 2; + } catch (NoSuchFieldError e2) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS.ordinal()] = 3; + } catch (NoSuchFieldError e3) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS_OF_FRIENDS.ordinal()] = 4; + } catch (NoSuchFieldError e4) { + } + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes = new int[PersonaStatusReasonCodes.values().length]; + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_ONE.ordinal()] = 1; + } catch (NoSuchFieldError e5) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_REACTIVATED_CUSTOMER.ordinal()] = 2; + } catch (NoSuchFieldError e6) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_INVALID_EMAIL.ordinal()] = 3; + } catch (NoSuchFieldError e7) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_PRIVACY_POLICY.ordinal()] = 4; + } catch (NoSuchFieldError e8) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_PARENTS_REQUEST.ordinal()] = 5; + } catch (NoSuchFieldError e9) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_GENERAL.ordinal()] = 6; + } catch (NoSuchFieldError e10) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_HARASSMENT.ordinal()] = 7; + } catch (NoSuchFieldError e11) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_MACROING.ordinal()] = 8; + } catch (NoSuchFieldError e12) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_EXPLOITATION.ordinal()] = 9; + } catch (NoSuchFieldError e13) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_FRAUD.ordinal()] = 10; + } catch (NoSuchFieldError e14) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CUSTOMER_OPT_OUT.ordinal()] = 11; + } catch (NoSuchFieldError e15) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CUSTOMER_UNDER_AGE.ordinal()] = 12; + } catch (NoSuchFieldError e16) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_EMAIL_CONFIRMATION_REQUIRED.ordinal()] = 13; + } catch (NoSuchFieldError e17) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_MISTYPED_ID.ordinal()] = 14; + } catch (NoSuchFieldError e18) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_ABUSED_ID.ordinal()] = 15; + } catch (NoSuchFieldError e19) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_EMAIL_LINK.ordinal()] = 16; + } catch (NoSuchFieldError e20) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_CS.ordinal()] = 17; + } catch (NoSuchFieldError e21) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CLAIMED_BY_TRUE_OWNER.ordinal()] = 18; + } catch (NoSuchFieldError e22) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_BANNED.ordinal()] = 19; + } catch (NoSuchFieldError e23) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_AFFILIATE.ordinal()] = 20; + } catch (NoSuchFieldError e24) { + } + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus = new int[PersonaStatus.values().length]; + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_PENDING.ordinal()] = 1; + } catch (NoSuchFieldError e25) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_ACTIVE.ordinal()] = 2; + } catch (NoSuchFieldError e26) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_DEACTIVATED.ordinal()] = 3; + } catch (NoSuchFieldError e27) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_DISABLED.ordinal()] = 4; + } catch (NoSuchFieldError e28) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_DELETED.ordinal()] = 5; + } catch (NoSuchFieldError e29) { + } + try { + $SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[PersonaStatus.PERSONA_STATUS_BANNED.ordinal()] = 6; + } catch (NoSuchFieldError e30) { + } + } + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona$PersonaPrivacyLevel.class */ + public enum PersonaPrivacyLevel { + PERSONA_PRIVACY_LEVEL_NONE, + PERSONA_PRIVACY_LEVEL_NO_ONE, + PERSONA_PRIVACY_LEVEL_EVERYONE, + PERSONA_PRIVACY_LEVEL_FRIENDS, + PERSONA_PRIVACY_LEVEL_FRIENDS_OF_FRIENDS + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona$PersonaStatus.class */ + public enum PersonaStatus { + PERSONA_STATUS_NONE, + PERSONA_STATUS_PENDING, + PERSONA_STATUS_ACTIVE, + PERSONA_STATUS_DEACTIVATED, + PERSONA_STATUS_DISABLED, + PERSONA_STATUS_DELETED, + PERSONA_STATUS_BANNED + } + + /* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPersona$PersonaStatusReasonCodes.class */ + public enum PersonaStatusReasonCodes { + PERSONA_STATUS_REASON_CODES_NONE, + PERSONA_STATUS_REASON_CODES_ONE, + PERSONA_STATUS_REASON_CODES_REACTIVATED_CUSTOMER, + PERSONA_STATUS_REASON_CODES_INVALID_EMAIL, + PERSONA_STATUS_REASON_CODES_PRIVACY_POLICY, + PERSONA_STATUS_REASON_CODES_PARENTS_REQUEST, + PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_GENERAL, + PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_HARASSMENT, + PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_MACROING, + PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_EXPLOITATION, + PERSONA_STATUS_REASON_CODES_SUSPENDED_FRAUD, + PERSONA_STATUS_REASON_CODES_CUSTOMER_OPT_OUT, + PERSONA_STATUS_REASON_CODES_CUSTOMER_UNDER_AGE, + PERSONA_STATUS_REASON_CODES_EMAIL_CONFIRMATION_REQUIRED, + PERSONA_STATUS_REASON_CODES_MISTYPED_ID, + PERSONA_STATUS_REASON_CODES_ABUSED_ID, + PERSONA_STATUS_REASON_CODES_DEACTIVATED_EMAIL_LINK, + PERSONA_STATUS_REASON_CODES_DEACTIVATED_CS, + PERSONA_STATUS_REASON_CODES_CLAIMED_BY_TRUE_OWNER, + PERSONA_STATUS_REASON_CODES_BANNED, + PERSONA_STATUS_REASON_CODES_DEACTIVATED_AFFILIATE + } + + NimbleIdentityPersona() { + } + + public NimbleIdentityPersona(Map map, Date date) { + this.personaId = getLongFromObject(map.get("personaId")); + this.pidId = map.get("pidId").toString(); + this.displayName = (String) map.get("displayName"); + this.name = (String) map.get("name"); + this.namespaceName = (String) map.get("namespaceName"); + this.status = toEnumPersonaStatus((String) map.get("status")); + this.statusReasonCode = toEnumPersonaStatusReasonCodes((String) map.get("statusReasonCode")); + 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) == Boolean.TRUE) { + this.isVisible = "true"; + } else { + this.isVisible = "false"; + } + } else if (obj instanceof String) { + this.isVisible = (String) obj; + } + } + this.expiryTime = date; + } + + private long getLongFromObject(Object obj) { + if (obj instanceof Long) { + return ((Long) obj).longValue(); + } + if (obj instanceof Integer) { + return (long) ((Integer) obj).intValue(); + } + Log.Helper.LOGES("Identity", "Can't convert object of type " + obj.getClass().getName() + " to long", new Object[0]); + return 0; + } + + public static PersonaPrivacyLevel toEnumPersonaPrivacyLevel(String str) { + PersonaPrivacyLevel personaPrivacyLevel = PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_NONE; + if (str.equalsIgnoreCase("NO_ONE")) { + personaPrivacyLevel = PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_NO_ONE; + } else if (str.equalsIgnoreCase("EVERYONE")) { + return PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_EVERYONE; + } else { + if (str.equalsIgnoreCase("FRIENDS")) { + return PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS; + } + if (str.equalsIgnoreCase("FRIENDS_OF_FRIENDS")) { + return PersonaPrivacyLevel.PERSONA_PRIVACY_LEVEL_FRIENDS_OF_FRIENDS; + } + } + return personaPrivacyLevel; + } + + public static PersonaStatus toEnumPersonaStatus(String str) { + PersonaStatus personaStatus = PersonaStatus.PERSONA_STATUS_NONE; + if (str.equalsIgnoreCase("PENDING")) { + personaStatus = PersonaStatus.PERSONA_STATUS_PENDING; + } else if (str.equalsIgnoreCase("ACTIVE")) { + return PersonaStatus.PERSONA_STATUS_ACTIVE; + } else { + if (str.equalsIgnoreCase("DEACTIVATED")) { + return PersonaStatus.PERSONA_STATUS_DEACTIVATED; + } + if (str.equalsIgnoreCase("DISABLE")) { + return PersonaStatus.PERSONA_STATUS_DISABLED; + } + if (str.equalsIgnoreCase("DELETED")) { + return PersonaStatus.PERSONA_STATUS_DELETED; + } + if (str.equalsIgnoreCase("BANNED")) { + return PersonaStatus.PERSONA_STATUS_BANNED; + } + } + return personaStatus; + } + + public static PersonaStatusReasonCodes toEnumPersonaStatusReasonCodes(String str) { + PersonaStatusReasonCodes personaStatusReasonCodes = PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_NONE; + if (str.equalsIgnoreCase("CODES_ONE")) { + personaStatusReasonCodes = PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_ONE; + } else if (str.equalsIgnoreCase("REACTIVATED_CUSTOMER")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_REACTIVATED_CUSTOMER; + } else { + if (str.equalsIgnoreCase("INVALID_EMAIL")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_INVALID_EMAIL; + } + if (str.equalsIgnoreCase("PRIVACY_POLICY")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_PRIVACY_POLICY; + } + if (str.equalsIgnoreCase("PARENTS_REQUEST")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_PARENTS_REQUEST; + } + if (str.equalsIgnoreCase("SUSPENDED_MISCONDUCT_GENERAL")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_GENERAL; + } + if (str.equalsIgnoreCase("SUSPENDED_MISCONDUCT_HARASSMENT")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_HARASSMENT; + } + if (str.equalsIgnoreCase("SUSPENDED_MISCONDUCT_MACROING")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_MACROING; + } + if (str.equalsIgnoreCase("SUSPENDED_MISCONDUCT_EXPLOITATION")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_MISCONDUCT_EXPLOITATION; + } + if (str.equalsIgnoreCase("SUSPENDED_FRAUD")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_SUSPENDED_FRAUD; + } + if (str.equalsIgnoreCase("CUSTOMER_OPT_OUT")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CUSTOMER_OPT_OUT; + } + if (str.equalsIgnoreCase("CUSTOMER_UNDER_AGE")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CUSTOMER_UNDER_AGE; + } + if (str.equalsIgnoreCase("EMAIL_CONFIRMATION_REQUIRED")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_EMAIL_CONFIRMATION_REQUIRED; + } + if (str.equalsIgnoreCase("MISTYPED_ID")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_MISTYPED_ID; + } + if (str.equalsIgnoreCase("ABUSED_ID")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_ABUSED_ID; + } + if (str.equalsIgnoreCase("DEACTIVATED_EMAIL_LINK")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_EMAIL_LINK; + } + if (str.equalsIgnoreCase("DEACTIVATED_CS")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_CS; + } + if (str.equalsIgnoreCase("CLAIMED_BY_TRUE_OWNER")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_CLAIMED_BY_TRUE_OWNER; + } + if (str.equalsIgnoreCase("BANNED")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_BANNED; + } + if (str.equalsIgnoreCase("DEACTIVATED_AFFILIATE")) { + return PersonaStatusReasonCodes.PERSONA_STATUS_REASON_CODES_DEACTIVATED_AFFILIATE; + } + } + return personaStatusReasonCodes; + } + + public static String toStringPersonaPrivacyLevel(PersonaPrivacyLevel personaPrivacyLevel) { + switch (AnonymousClass1.$SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaPrivacyLevel[personaPrivacyLevel.ordinal()]) { + case 1: + return "NO_ONE"; + case 2: + return "EVERYONE"; + case 3: + return "FRIENDS"; + case 4: + return "FRIENDS_OF_FRIENDS"; + default: + return ""; + } + } + + public static String toStringPersonaStatus(PersonaStatus personaStatus) { + switch (AnonymousClass1.$SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatus[personaStatus.ordinal()]) { + case 1: + return "PENDING"; + case 2: + return "ACTIVE"; + case 3: + return "DEACTIVATED"; + case 4: + return "DISABLED"; + case 5: + return "DELETED"; + case 6: + return "BANNED"; + default: + return ""; + } + } + + public static String toStringPersonaStatusReasonCodes(PersonaStatusReasonCodes personaStatusReasonCodes) { + switch (AnonymousClass1.$SwitchMap$com$ea$nimble$identity$NimbleIdentityPersona$PersonaStatusReasonCodes[personaStatusReasonCodes.ordinal()]) { + case 1: + return "CODES_ONE"; + case 2: + return "REACTIVATED_CUSTOMER"; + case 3: + return "INVALID_EMAIL"; + case 4: + return "PRIVACY_POLICY"; + case 5: + return "PARENTS_REQUEST"; + case 6: + return "SUSPENDED_MISCONDUCT_GENERAL"; + case 7: + return "SUSPENDED_MISCONDUCT_HARASSMENT"; + case 8: + return "SUSPENDED_MISCONDUCT_MACROING"; + case 9: + return "SUSPENDED_MISCONDUCT_EXPLOITATION"; + case 10: + return "SUSPENDED_FRAUD"; + case 11: + return "CUSTOMER_OPT_OUT"; + case 12: + return "CUSTOMER_UNDER_AGE"; + case 13 /* 13 */: + return "EMAIL_CONFIRMATION_REQUIRED"; + case 14: + return "MISTYPED_ID"; + case 15 /* 15 */: + return "ABUSED_ID"; + case 16: + return "DEACTIVATED_EMAIL_LINK"; + case 17: + return "DEACTIVATED_CS"; + case 18: + return "CLAIMED_BY_TRUE_OWNER"; + case 19: + return "BANNED"; + case 20: + return "DEACTIVATED_AFFILIATE"; + default: + return ""; + } + } + + public String getDateCreated() { + return this.dateCreated; + } + + public String getDisplayName() { + return this.displayName; + } + + public Date getExpiryTime() { + return this.expiryTime; + } + + public String getLastAuthenticated() { + return this.lastAuthenticated; + } + + public String getName() { + return this.name; + } + + public String getNamespaceName() { + return this.namespaceName; + } + + public long getPersonaId() { + return this.personaId; + } + + public String getPidId() { + return this.pidId; + } + + public PersonaPrivacyLevel getShowPersona() { + return this.showPersona; + } + + public PersonaStatusReasonCodes getStatusReasonCode() { + return this.statusReasonCode; + } + + public PersonaStatus getStauts() { + return this.status; + } + + public String getVisible() { + return this.isVisible; + } + + public void setDateCreated(String str) { + this.dateCreated = str; + } + + public void setDisplayName(String str) { + this.displayName = str; + } + + public void setLastAuthenticated(String str) { + this.lastAuthenticated = str; + } + + public void setName(String str) { + this.name = str; + } + + public void setNamespaceName(String str) { + this.namespaceName = str; + } + + public void setPersonaId(long j) { + this.personaId = j; + } + + public void setPidId(String str) { + this.pidId = str; + } + + public void setShowPersona(PersonaPrivacyLevel personaPrivacyLevel) { + this.showPersona = personaPrivacyLevel; + } + + public void setStatusReasonCode(PersonaStatusReasonCodes personaStatusReasonCodes) { + this.statusReasonCode = personaStatusReasonCodes; + } + + public void setStauts(PersonaStatus personaStatus) { + this.status = personaStatus; + } + + public void setVisible(String str) { + this.isVisible = str; + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPidInfo.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPidInfo.java new file mode 100644 index 0000000..98b84aa --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPidInfo.java @@ -0,0 +1,201 @@ +package com.ea.nimble.identity; + +import java.io.Serializable; +import java.util.Date; +import java.util.Map; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPidInfo.class */ +public class NimbleIdentityPidInfo implements Serializable { + private static final long serialVersionUID = 2; + private String anonymousPid; + private String authenticationSource; + private String country; + private String dateCreated; + private String dateModified; + private String dob; + private Date expiryTime; + private String language; + private String lastAuthDate; + private String locale; + private String pid; + private String reasonCode; + private String registrationSource; + private String status; + private String strength; + private String tosVersion; + + NimbleIdentityPidInfo() { + } + + public NimbleIdentityPidInfo(Map map, Date date) { + Map map2; + if (map != null && (map2 = (Map) map.get("pid")) != null) { + this.pid = map2.get("pidId").toString(); + this.anonymousPid = (String) map2.get("anonymousPid"); + this.authenticationSource = (String) map2.get("authenticationSource"); + this.country = (String) map2.get("country"); + this.dateCreated = (String) map2.get("dateCreated"); + this.dateModified = (String) map2.get("dateModified"); + this.dob = (String) map2.get("dob"); + this.language = (String) map2.get("language"); + this.lastAuthDate = (String) map2.get("lastAuthDate"); + this.locale = (String) map2.get("locale"); + this.reasonCode = (String) map2.get("reasonCode"); + this.registrationSource = (String) map2.get("registrationSource"); + this.status = (String) map2.get("status"); + this.strength = (String) map2.get("strength"); + this.tosVersion = (String) map2.get("tosVersion"); + this.expiryTime = date; + } + } + + @Override // java.lang.Object + public boolean equals(Object obj) { + boolean z; + if (!(obj instanceof NimbleIdentityPidInfo)) { + z = false; + } else { + z = true; + if (this != obj) { + NimbleIdentityPidInfo nimbleIdentityPidInfo = (NimbleIdentityPidInfo) obj; + if (!this.pid.equals(nimbleIdentityPidInfo.pid) || !this.strength.equals(nimbleIdentityPidInfo.strength) || !this.dob.equals(nimbleIdentityPidInfo.dob) || !this.country.equals(nimbleIdentityPidInfo.country) || !this.language.equals(nimbleIdentityPidInfo.language) || !this.locale.equals(nimbleIdentityPidInfo.locale) || !this.status.equals(nimbleIdentityPidInfo.status) || !this.reasonCode.equals(nimbleIdentityPidInfo.reasonCode) || !this.tosVersion.equals(nimbleIdentityPidInfo.tosVersion) || !this.dateCreated.equals(nimbleIdentityPidInfo.dateCreated) || !this.dateModified.equals(nimbleIdentityPidInfo.dateModified) || !this.lastAuthDate.equals(nimbleIdentityPidInfo.lastAuthDate) || !this.registrationSource.equals(nimbleIdentityPidInfo.registrationSource) || !this.authenticationSource.equals(nimbleIdentityPidInfo.authenticationSource)) { + return false; + } + z = true; + if (!this.anonymousPid.equals(nimbleIdentityPidInfo.anonymousPid)) { + return false; + } + } + } + return z; + } + + public String getAnonymousPid() { + return this.anonymousPid; + } + + public String getAuthenticationSource() { + return this.authenticationSource; + } + + public String getCountry() { + return this.country; + } + + public String getDateCreated() { + return this.dateCreated; + } + + public String getDateModified() { + return this.dateModified; + } + + public String getDob() { + return this.dob; + } + + public Date getExpiryTime() { + return this.expiryTime; + } + + public String getLanguage() { + return this.language; + } + + public String getLastAuthDate() { + return this.lastAuthDate; + } + + public String getLocale() { + return this.locale; + } + + public String getPid() { + return this.pid; + } + + public String getReasonCode() { + return this.reasonCode; + } + + public String getRegistrationSource() { + return this.registrationSource; + } + + public String getStatus() { + return this.status; + } + + public String getStrength() { + return this.strength; + } + + public String getTosVersion() { + return this.tosVersion; + } + + public void setAnonymousPid(String str) { + this.anonymousPid = str; + } + + public void setAuthenticationSource(String str) { + this.authenticationSource = str; + } + + public void setCountry(String str) { + this.country = str; + } + + public void setDateCreated(String str) { + this.dateCreated = str; + } + + public void setDateModified(String str) { + this.dateModified = str; + } + + public void setDob(String str) { + this.dob = str; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public void setExpiryTime(Date date) { + this.expiryTime = date; + } + + public void setLanguage(String str) { + this.language = str; + } + + public void setLastAuthDate(String str) { + this.lastAuthDate = str; + } + + public void setLocale(String str) { + this.locale = str; + } + + public void setPidId(String str) { + this.pid = str; + } + + public void setReasonCode(String str) { + this.reasonCode = str; + } + + public void setRegistrationSource(String str) { + this.registrationSource = str; + } + + public void setStatus(String str) { + this.status = str; + } + + public void setStrength(String str) { + this.strength = str; + } + + public void setTosVersion(String str) { + this.tosVersion = str; + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPlainAuthenticationConductorHandler.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPlainAuthenticationConductorHandler.java new file mode 100644 index 0000000..5c29d21 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityPlainAuthenticationConductorHandler.java @@ -0,0 +1,26 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Global; +import com.ea.nimble.Log; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityPlainAuthenticationConductorHandler.class */ +public class NimbleIdentityPlainAuthenticationConductorHandler implements NimbleIdentityAuthenticationConductorHandler { + private INimbleIdentityPlainAuthenticationConductor m_conductor; + + public NimbleIdentityPlainAuthenticationConductorHandler(INimbleIdentityAuthenticationConductor iNimbleIdentityAuthenticationConductor) { + this.m_conductor = (INimbleIdentityPlainAuthenticationConductor) iNimbleIdentityAuthenticationConductor; + } + + @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler + public void handleLogin(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator, boolean z) { + if (iNimbleIdentityAuthenticator.getAuthenticatorId() == Global.NIMBLE_AUTHENTICATOR_ANONYMOUS && NimbleIdentityImpl.getComponent().getMainAuthenticator() == null) { + NimbleIdentityImpl.getComponent().setMainAuthenticator(iNimbleIdentityAuthenticator); + } + Log.Helper.LOGD(this, "New authenticator %s being LogIn handled by Plain authenticator.", iNimbleIdentityAuthenticator.getAuthenticatorId()); + } + + @Override // com.ea.nimble.identity.NimbleIdentityAuthenticationConductorHandler + public void handleLogout(INimbleIdentityAuthenticator iNimbleIdentityAuthenticator) { + Log.Helper.LOGD(this, "New authenticator %s being LogOut handled by Plain authenticator.", iNimbleIdentityAuthenticator.getAuthenticatorId()); + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityToken.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityToken.java new file mode 100644 index 0000000..e1c1e12 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityToken.java @@ -0,0 +1,76 @@ +package com.ea.nimble.identity; + +import com.ea.nimble.Log; +import java.io.Serializable; +import java.util.Date; +import java.util.Map; + +/* JADX INFO: Access modifiers changed from: package-private */ +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityToken.class */ +public class NimbleIdentityToken implements Serializable { + private static final String NIMBLE_IDENTITY_REFRESH_TOKEN_EXPIRES_IN = "refresh_token_expires_in"; + private static final String NIMBLE_IDENTITY_TOKEN_ACCESS_TOKEN = "access_token"; + private static final String NIMBLE_IDENTITY_TOKEN_EXPIRES_IN = "expires_in"; + private static final String NIMBLE_IDENTITY_TOKEN_ID_TOKEN = "id_token"; + private static final String NIMBLE_IDENTITY_TOKEN_REFRESH_TOKEN = "refresh_token"; + private static final String NIMBLE_IDENTITY_TOKEN_TYPE = "token_type"; + private static final long serialVersionUID = 2; + private String accessToken; + private Date accessTokenExpiryTime; + private String idToken; + private String refreshToken; + private Date refreshTokenExpiryTime; + private String type; + + public NimbleIdentityToken() { + } + + public NimbleIdentityToken(Map map) { + this.accessToken = (String) map.get("access_token"); + this.refreshToken = (String) map.get(NIMBLE_IDENTITY_TOKEN_REFRESH_TOKEN); + this.idToken = (String) map.get(NIMBLE_IDENTITY_TOKEN_ID_TOKEN); + this.type = (String) map.get(NIMBLE_IDENTITY_TOKEN_TYPE); + long currentTimeMillis = System.currentTimeMillis(); + this.accessTokenExpiryTime = new Date(getTimeFromObject(map.get("expires_in")) + currentTimeMillis); + this.refreshTokenExpiryTime = new Date(getTimeFromObject(map.get(NIMBLE_IDENTITY_REFRESH_TOKEN_EXPIRES_IN)) + currentTimeMillis); + } + + private long getTimeFromObject(Object obj) { + double d; + if (obj instanceof String) { + d = Double.parseDouble((String) obj); + } else if (obj instanceof Double) { + d = ((Double) obj).doubleValue(); + } else if (obj instanceof Integer) { + return (long) (((Integer) obj).intValue() * 1000); + } else { + Log.Helper.LOGES("Identity", "Couldn't get time from object of type " + obj.getClass().getName(), new Object[0]); + d = 0.0d; + } + return (long) (1000.0d * d); + } + + public String getAccessToken() { + return this.accessToken; + } + + public Date getAccessTokenExpiryTime() { + return this.accessTokenExpiryTime; + } + + public String getIdToken() { + return this.idToken; + } + + public String getRefreshToken() { + return this.refreshToken; + } + + public Date getRefreshTokenExpiryTime() { + return this.refreshTokenExpiryTime; + } + + public String getType() { + return this.type; + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUserInfo.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUserInfo.java new file mode 100644 index 0000000..14a0e2b --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUserInfo.java @@ -0,0 +1,92 @@ +package com.ea.nimble.identity; + +import java.io.Serializable; +import java.util.Date; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityUserInfo.class */ +public class NimbleIdentityUserInfo implements Serializable, Cloneable { + private static final long serialVersionUID = 1; + private String avatarUri; + private String dateOfBirth; + private String displayName; + private String email; + private Date expiryTime; + private String pid; + private String userId; + private String userName; + + @Override // java.lang.Object + public NimbleIdentityUserInfo clone() { + try { + return (NimbleIdentityUserInfo) super.clone(); + } catch (CloneNotSupportedException e) { + return null; + } + } + + public String getAvatarUri() { + return this.avatarUri; + } + + public String getDateOfBirth() { + return this.dateOfBirth; + } + + public String getDisplayName() { + return this.displayName; + } + + public String getEmail() { + return this.email; + } + + public Date getExpiryTime() { + return this.expiryTime; + } + + public String getPid() { + return this.pid; + } + + public String getUserId() { + return this.userId; + } + + public String getuserName() { + return this.userName; + } + + public void setAvatarUri(String str) { + this.avatarUri = str; + } + + public void setDateOfBirth(String str) { + this.dateOfBirth = str; + } + + public void setDisplayName(String str) { + this.displayName = str; + } + + public void setEmail(String str) { + this.email = str; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public void setExpiryTime(Date date) { + this.expiryTime = date; + } + + public void setPid(String str) { + this.pid = str; + } + + /* JADX INFO: Access modifiers changed from: package-private */ + public void setUserId(String str) { + this.userId = str; + } + + public void setUserName(String str) { + this.userName = str; + } +} diff --git a/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java new file mode 100644 index 0000000..363e654 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/identity/NimbleIdentityUtility.java @@ -0,0 +1,117 @@ +package com.ea.nimble.identity; + +import android.annotation.SuppressLint; + +import com.ea.nimble.Error; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.Utility; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.TimeZone; + +/* loaded from: stdlib.jar:com/ea/nimble/identity/NimbleIdentityUtility.class */ +class NimbleIdentityUtility { + public static final String NIMBLE_IDENTITY_DEVICE_UNIQUE_IDENTIFIER = "nimble.identity.device.unique.identifier"; + static int counter = 0; + + NimbleIdentityUtility() { + } + + @SuppressLint({"SimpleDateFormat"}) + public static String getCurrentTimeString() { + return new SimpleDateFormat("yyyy-MM-DD HH:mm:ss").format(new Date()); + } + + @SuppressLint({"SimpleDateFormat"}) + public static String getTimeString(Date date) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-DD HH:mm:ss"); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT")); + return simpleDateFormat.format(date); + } + + public static Map parseBodyJSONData(NetworkConnectionHandle networkConnectionHandle) throws Error { + return Utility.convertJSONObjectToMap(parseJsonResponse(networkConnectionHandle)); + } + + public static JSONObject parseJsonResponse(NetworkConnectionHandle networkConnectionHandle) throws Error { + Exception error = networkConnectionHandle.getResponse().getError(); + if (error == null) { + InputStream dataStream = networkConnectionHandle.getResponse().getDataStream(); + if (dataStream == null) { + throw new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Cannot understand server response, expecting JSON string but get invalid data"); + } + try { + try { + JSONObject jSONObject = new JSONObject(Utility.readStringFromStream(dataStream)); + if (!Utility.validString((String) jSONObject.opt("error"))) { + return jSONObject; + } + throw NimbleIdentityError.createWithData(Utility.convertJSONObjectToMap(jSONObject)); + } catch (JSONException e) { + throw new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Invalid JSON received from server", e); + } + } catch (IOException e2) { + throw new Error(Error.Code.NETWORK_INVALID_SERVER_RESPONSE, "Error reading server response", e2); + } + } else if (error instanceof Error) { + throw ((Error) error); + } else { + throw new Error(Error.Code.UNKNOWN, "Unknown error while parsing network response", error); + } + } + + public static HashMap parseRedirectURLParameters(NetworkConnectionHandle networkConnectionHandle) { + String url = networkConnectionHandle.getResponse().getUrl().toString(); + HashMap hashMap = new HashMap<>(); + String str = ""; + if (url.split("\\?").length == 2) { + str = url.split("\\?")[0]; + } + String[] split = str.split("&"); + for (String str2 : split) { + if (str2.split("=").length == 2) { + hashMap.put(str2.split("=")[0], str2.split("=")[1]); + } + } + return hashMap; + } + + public static ByteArrayOutputStream toJSONString(HashMap hashMap) { + IOException e; + UnsupportedEncodingException e2; + ByteArrayOutputStream byteArrayOutputStream = null; + if (hashMap != null) { + try { + byte[] bytes = new GsonBuilder().serializeNulls().create().toJson(hashMap, new TypeToken>() { // from class: com.ea.nimble.identity.NimbleIdentityUtility.1 + }.getType()).getBytes("UTF-8"); + byteArrayOutputStream = new ByteArrayOutputStream(bytes.length); + try { + byteArrayOutputStream.write(bytes); + } catch (UnsupportedEncodingException e3) { + e2 = e3; + e2.printStackTrace(); + return null; + } catch (IOException e4) { + e = e4; + e.printStackTrace(); + return null; + } + } catch (UnsupportedEncodingException e5) { + e2 = e5; + } + } + return byteArrayOutputStream; + } +} diff --git a/app/src/main/java/com/ea/nimble/inappmessage/IInAppMessage.java b/app/src/main/java/com/ea/nimble/inappmessage/IInAppMessage.java new file mode 100644 index 0000000..f61d174 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/inappmessage/IInAppMessage.java @@ -0,0 +1,10 @@ +package com.ea.nimble.inappmessage; + +import com.ea.nimble.inappmessage.Message; + +public interface IInAppMessage { + Message popMessageFromCache(); + + void showInAppMessage(); +} + diff --git a/app/src/main/java/com/ea/nimble/inappmessage/InAppMessage.java b/app/src/main/java/com/ea/nimble/inappmessage/InAppMessage.java new file mode 100644 index 0000000..1fe7b09 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/inappmessage/InAppMessage.java @@ -0,0 +1,26 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.inappmessage; + +import com.ea.nimble.Base; +import com.ea.nimble.Log; +import com.ea.nimble.inappmessage.IInAppMessage; +import com.ea.nimble.inappmessage.InAppMessageImpl; + +public class InAppMessage { + public static final String COMPONENT_ID = "com.ea.nimble.inappmessage"; + public static final String MESSAGE_EXCLUDE_ID = "messageExcludeID"; + static final String MESSAGE_PERSISTENCE_ID = "currentInAppMessage"; + public static final String NOTIFICATION_IN_APP_MESSAGE_REFRESH = "nimble.inappmessage.notification.message_refresh"; + + public static IInAppMessage getComponent() { + return (IInAppMessage)((Object)Base.getComponent(COMPONENT_ID)); + } + + private static void initialize() { + Log.Helper.LOGDS("IAM", "IAM initialize", new Object[0]); + Base.registerComponent(new InAppMessageImpl(), COMPONENT_ID); + } +} + diff --git a/app/src/main/java/com/ea/nimble/inappmessage/InAppMessageImpl.java b/app/src/main/java/com/ea/nimble/inappmessage/InAppMessageImpl.java new file mode 100644 index 0000000..3a9ad87 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/inappmessage/InAppMessageImpl.java @@ -0,0 +1,304 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.AlertDialog$Builder + * android.content.BroadcastReceiver + * android.content.ContentResolver + * android.content.Context + * android.content.DialogInterface + * android.content.DialogInterface$OnClickListener + * android.content.Intent + * android.net.Uri + * android.provider.Settings$Secure + * org.json.JSONException + * org.json.JSONObject + */ +package com.ea.nimble.inappmessage; + +import android.app.AlertDialog; +import android.content.BroadcastReceiver; +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.provider.Settings; + +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.Component; +import com.ea.nimble.IApplicationEnvironment; +import com.ea.nimble.ISynergyEnvironment; +import com.ea.nimble.ISynergyIdManager; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Persistence; +import com.ea.nimble.PersistenceService; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.SynergyIdManager; +import com.ea.nimble.SynergyNetwork; +import com.ea.nimble.SynergyNetworkConnectionCallback; +import com.ea.nimble.SynergyNetworkConnectionHandle; +import com.ea.nimble.Utility; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.Serializable; +import java.net.HttpURLConnection; +import java.net.URL; +import java.net.URLConnection; +import java.util.HashMap; +import java.util.Locale; + +public class InAppMessageImpl +extends Component +implements LogSource, +IInAppMessage { + private BroadcastReceiver m_receiver; + private SynergyNetworkConnectionHandle m_synergyNetworkConnectionHandle; + + static /* synthetic */ SynergyNetworkConnectionHandle access$102(InAppMessageImpl inAppMessageImpl, SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + inAppMessageImpl.m_synergyNetworkConnectionHandle = synergyNetworkConnectionHandle; + return synergyNetworkConnectionHandle; + } + + private static void addMessageToCache(Message message) { + int n2; + if (message == null) { + return; + } + Persistence persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.inappmessage", Persistence.Storage.CACHE); + Serializable serializable = persistence.getValue("messageExcludeID"); + int n3 = n2 = -1; + if (serializable != null) { + n3 = n2; + if (serializable.getClass() == Integer.class) { + try { + n3 = (Integer)serializable; + } + catch (ClassCastException classCastException) { + Log.Helper.LOGES("IAM", "Invalid persistence value for excludeID, expected Integer"); + n3 = n2; + } + } + } + if (message.m_messageID <= n3) return; + persistence.setValue("currentInAppMessage", message); + persistence.synchronize(); + Utility.sendBroadcast("nimble.inappmessage.notification.message_refresh", null); + } + + private Message getMessageFromCache() { + Message message = null; + Message message2 = (Message)PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.inappmessage", Persistence.Storage.CACHE).getValue("currentInAppMessage"); + if (message2 == null) return message; + return message2; + } + + private void refreshInAppMessage() { + Log.Helper.LOGD(this, "refresh in app message cache"); + IApplicationEnvironment iApplicationEnvironment = ApplicationEnvironment.getComponent(); + ISynergyEnvironment iSynergyEnvironment = SynergyEnvironment.getComponent(); + ISynergyIdManager iSynergyIdManager = SynergyIdManager.getComponent(); + HashMap hashMap = new HashMap(); + hashMap.put("language", iApplicationEnvironment.getShortApplicationLanguageCode()); + hashMap.put("localization", iApplicationEnvironment.getApplicationLanguageCode()); + hashMap.put("deviceLanguage", Locale.getDefault().getLanguage()); + hashMap.put("deviceLocale", Locale.getDefault().toString()); + hashMap.put("apiVer", "1.0.1"); + hashMap.put("appVer", iApplicationEnvironment.getApplicationVersion()); + hashMap.put("hwId", iSynergyEnvironment.getEAHardwareId()); + hashMap.put("sellId", SynergyEnvironment.getComponent().getSellId()); + hashMap.put("uid", iSynergyIdManager.getSynergyId()); + hashMap.put("type", "4"); + hashMap.put("excludeIds", ""); + this.m_synergyNetworkConnectionHandle = SynergyNetwork.getComponent().sendGetRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/core/getMessage", hashMap, new SynergyNetworkConnectionCallback(){ + + /* + * Enabled unnecessary exception pruning + */ + @Override + public void callback(SynergyNetworkConnectionHandle object) { + Log.Helper.LOGD(this, "IAM callback done is status code: " + object.getResponse().getHttpResponse().getStatusCode()); + InAppMessageImpl.access$102(InAppMessageImpl.this, null); + if (object.getResponse().getError() != null) return; + try { + JSONObject jsonObject = new JSONObject(object.getResponse().getJsonData()); + String string2 = jsonObject.getString("resultCode"); + Log.Helper.LOGD(this, "getMessage result code " + string2 + "~"); + if (string2.compareTo("-50005") == 0) { + return; + } + if (string2.compareTo("1") != 0) return; + Log.Helper.LOGD(this, "getMessage BODY: " + object); + String string3 = jsonObject.getString("message"); + String string4 = jsonObject.getString("title"); + Object object2 = jsonObject.getString("url"); + int n2 = jsonObject.getInt("messageId"); + string2 = ""; + String shortApplicationLanguageCode = ApplicationEnvironment.getComponent().getShortApplicationLanguageCode(); + + try { + object2 = (HttpURLConnection)new URL((String)object2).openConnection(); + ((URLConnection)object2).setConnectTimeout(15000); + ((URLConnection)object2).setReadTimeout(15000); + ((HttpURLConnection)object2).setInstanceFollowRedirects(false); + ((URLConnection)object2).connect(); + object2 = ((URLConnection)object2).getHeaderField("Location"); + String string5 = Settings.Secure.getString((ContentResolver)ApplicationEnvironment.getComponent().getApplicationContext().getContentResolver(), (String)"android_id"); + String string6 = ApplicationEnvironment.getComponent().getGoogleAdvertisingId(); + string5 = (String)object2 + "&android_id=" + string5; + object2 = string5; + if (string6 != null) { + object2 = string5; + if (string6.length() == 0) { + object2 = string5 + "&google_aid=" + string6; + } + } + InAppMessageImpl.addMessageToCache(new Message(n2, string4, string3, (String)object2, string2, null, null)); + return; + } + catch (Exception exception) { + System.out.println("error happened: " + exception.toString()); + } + return; + } + catch (JSONException jSONException) { + jSONException.printStackTrace(); + return; + } + } + }); + } + + private boolean refreshInAppMessageCache() { + if (SynergyEnvironment.getComponent().isDataAvailable()) { + this.refreshInAppMessage(); + return true; + } + if (this.m_receiver != null) return false; + this.m_receiver = new BroadcastReceiver(){ + + public void onReceive(Context context, Intent intent) { + Bundle extras = intent.getExtras(); + if (extras == null) return; + if (!extras.getString("result").equals("1")) return; + InAppMessageImpl.this.refreshInAppMessage(); + } + }; + Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_receiver); + Utility.registerReceiver("nimble.environment.notification.restored_from_persistent", this.m_receiver); + return false; + } + + private void removeMessageFromCache(Message message) { + if (message == null) { + Log.Helper.LOGD(this, "Removing msg from cache but no message to remove"); + return; + } + Persistence persistence = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.inappmessage", Persistence.Storage.CACHE); + Message message2 = (Message)persistence.getValue("currentInAppMessage"); + if (message2 == null) { + Log.Helper.LOGD(this, "Removing message from cache but nothing in the cache"); + return; + } + if (message2.m_messageID != message.m_messageID) return; + Log.Helper.LOGD(this, "Removing message from cache. Removed successfully"); + persistence.setValue("currentInAppMessage", null); + persistence.setValue("messageExcludeID", Integer.valueOf(message.m_messageID)); + persistence.synchronize(); + } + + @Override + public void cleanup() { + Log.Helper.LOGD(this, "cleanup"); + SynergyNetworkConnectionHandle synergyNetworkConnectionHandle = this.m_synergyNetworkConnectionHandle; + if (synergyNetworkConnectionHandle != null) { + Log.Helper.LOGD(this, "Canceling network connection."); + synergyNetworkConnectionHandle.cancel(); + this.m_synergyNetworkConnectionHandle = null; + } + if (this.m_receiver == null) return; + Utility.unregisterReceiver(this.m_receiver); + this.m_receiver = null; + } + + @Override + public String getComponentId() { + return "com.ea.nimble.inappmessage"; + } + + @Override + public String getLogSourceTitle() { + return "IAM"; + } + + @Override + public Message popMessageFromCache() { + Message message = this.getMessageFromCache(); + if (message != null) { + this.removeMessageFromCache(message); + Log.Helper.LOGV(this, "----- BEGIN POPPED IAM INFO -----"); + Log.Helper.LOGV(this, "messageId = " + message.getMessageId()); + Log.Helper.LOGV(this, "title = " + message.getTitle()); + Log.Helper.LOGV(this, "message = " + message.getMessage()); + Log.Helper.LOGV(this, "url = " + message.getUrl()); + Log.Helper.LOGV(this, "buttonLabel1 = " + message.buttonLabel1Title()); + Log.Helper.LOGV(this, "buttonLabel2 = " + message.buttonLabel2Title()); + Log.Helper.LOGV(this, "buttonLabel3 = " + message.buttonLabel3Title()); + Log.Helper.LOGV(this, "----- END POPPED IAM INFO -----"); + return message; + } + Log.Helper.LOGD(this, "No message in cache to display info for."); + return null; + } + + @Override + public void restore() { + Log.Helper.LOGD(this, "restore"); + this.refreshInAppMessageCache(); + } + + @Override + public void resume() { + Log.Helper.LOGD(this, "resume"); + this.refreshInAppMessageCache(); + } + + @Override + public void setup() { + Log.Helper.LOGD(this, "setup"); + } + + @Override + public void showInAppMessage() { + final Message message = (Message)PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.inappmessage", Persistence.Storage.CACHE).getValue("currentInAppMessage"); + if (message == null) { + return; + } + this.removeMessageFromCache(message); + final AlertDialog.Builder builder = new AlertDialog.Builder(ApplicationEnvironment.getCurrentActivity()); + builder.setTitle(message.m_title); + builder.setMessage(message.m_message); + if (message.m_buttonLabel1Title != null && message.m_url != null && !message.m_url.equals("")) { + builder.setPositiveButton(message.m_buttonLabel1Title, (dialogInterface, n2) -> { + Intent intent = new Intent("android.intent.action.VIEW", Uri.parse(message.m_url)); + ApplicationEnvironment.getCurrentActivity().startActivity(intent); + }); + } + if (message.m_buttonLabel2Title != null) { + builder.setNegativeButton((CharSequence)message.m_buttonLabel2Title, (dialogInterface, n2) -> dialogInterface.cancel()); + } + ApplicationEnvironment.getCurrentActivity().runOnUiThread(builder::show); + } + + @Override + public void suspend() { + if (this.m_synergyNetworkConnectionHandle == null) return; + Log.Helper.LOGD(this, "Canceling network connection."); + this.m_synergyNetworkConnectionHandle.cancel(); + this.m_synergyNetworkConnectionHandle = null; + } +} + diff --git a/app/src/main/java/com/ea/nimble/inappmessage/Message.java b/app/src/main/java/com/ea/nimble/inappmessage/Message.java new file mode 100644 index 0000000..ddfeb49 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/inappmessage/Message.java @@ -0,0 +1,60 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.inappmessage; + +import java.io.Serializable; + +public class Message +implements Serializable { + private static final long serialVersionUID = 1L; + String m_buttonLabel1Title; + String m_buttonLabel2Title; + String m_buttonLabel3Title; + String m_message; + int m_messageID; + String m_title; + String m_url; + + Message() { + } + + Message(int n2, String string2, String string3, String string4, String string5, String string6, String string7) { + this.m_messageID = n2; + this.m_title = string2; + this.m_message = string3; + this.m_url = string4; + this.m_buttonLabel1Title = string5; + this.m_buttonLabel2Title = string6; + this.m_buttonLabel3Title = string7; + } + + public String buttonLabel1Title() { + return this.m_buttonLabel1Title; + } + + public String buttonLabel2Title() { + return this.m_buttonLabel2Title; + } + + public String buttonLabel3Title() { + return this.m_buttonLabel3Title; + } + + public String getMessage() { + return this.m_message; + } + + public int getMessageId() { + return this.m_messageID; + } + + public String getTitle() { + return this.m_title; + } + + public String getUrl() { + return this.m_url; + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/INimbleMTX.java b/app/src/main/java/com/ea/nimble/mtx/INimbleMTX.java new file mode 100644 index 0000000..75b44ce --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/INimbleMTX.java @@ -0,0 +1,54 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx; + +import com.ea.nimble.Error; +import com.ea.nimble.mtx.NimbleCatalogItem; +import com.ea.nimble.mtx.NimbleMTXTransaction; +import java.util.List; +import java.util.Map; + +public interface INimbleMTX { + public static final String NIMBLE_NOTIFICATION_MTX_REFRESH_CATALOG_FINISHED = "nimble.notification.mtx.refreshcatalogfinished"; + public static final String NIMBLE_NOTIFICATION_MTX_RESTORE_PURCHASED_TRANSACTIONS_FINISHED = "nimble.notification.mtx.restorepurchasedtransactionsfinished"; + public static final String NIMBLE_NOTIFICATION_MTX_TRANSACTIONS_RECOVERED = "nimble.notification.mtx.transactionsrecovered"; + public static final String NOTIFICATION_DICTIONARY_KEY_TRANSACTIONID = "TRANSACTION_ID"; + + public Error finalizeTransaction(String var1, FinalizeTransactionCallback var2); + + public List getAvailableCatalogItems(); + + public List getPendingTransactions(); + + public List getPurchasedTransactions(); + + public List getRecoveredTransactions(); + + public Error itemGranted(String var1, NimbleCatalogItem.ItemType var2, ItemGrantedCallback var3); + + public Error purchaseItem(String var1, PurchaseTransactionCallback var2); + + public void refreshAvailableCatalogItems(); + + public void restorePurchasedTransactions(); + + public Error resumeTransaction(String var1, PurchaseTransactionCallback var2, ItemGrantedCallback var3, FinalizeTransactionCallback var4); + + public void setPlatformParameters(Map var1); + + public static interface FinalizeTransactionCallback { + public void finalizeComplete(NimbleMTXTransaction var1); + } + + public static interface ItemGrantedCallback { + public void itemGrantedComplete(NimbleMTXTransaction var1); + } + + public static interface PurchaseTransactionCallback { + public void purchaseComplete(NimbleMTXTransaction var1); + + public void unverifiedReceiptReceived(NimbleMTXTransaction var1); + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/NimbleCatalogItem.java b/app/src/main/java/com/ea/nimble/mtx/NimbleCatalogItem.java new file mode 100644 index 0000000..9703b9a --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/NimbleCatalogItem.java @@ -0,0 +1,32 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx; + +import java.util.Map; + +public abstract class NimbleCatalogItem { + public abstract Map getAdditionalInfo(); + + public abstract String getDescription(); + + public abstract ItemType getItemType(); + + public abstract String getMetaDataUrl(); + + public abstract float getPriceDecimal(); + + public abstract String getPriceWithCurrencyAndFormat(); + + public abstract String getSku(); + + public abstract String getTitle(); + + public static enum ItemType { + UNKNOWN, + NONCONSUMABLE, + CONSUMABLE; + + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/NimbleMTX.java b/app/src/main/java/com/ea/nimble/mtx/NimbleMTX.java new file mode 100644 index 0000000..21f485a --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/NimbleMTX.java @@ -0,0 +1,23 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx; + +import com.ea.nimble.Base; +import com.ea.nimble.Component; +import com.ea.nimble.Log; +import com.ea.nimble.mtx.INimbleMTX; + +public class NimbleMTX { + public static final String COMPONENT_ID = "com.ea.nimble.mtx"; + + public static INimbleMTX getComponent() { + Component[] componentArray = Base.getComponentList(COMPONENT_ID); + if (componentArray == null) return null; + if (componentArray.length <= 0) return null; + if (componentArray.length == 1) return (INimbleMTX)((Object)componentArray[0]); + Log.Helper.LOGFS("MTX", "More than one MTX component registered!", new Object[0]); + return (INimbleMTX)((Object)componentArray[0]); + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/NimbleMTXError.java b/app/src/main/java/com/ea/nimble/mtx/NimbleMTXError.java new file mode 100644 index 0000000..2ca05a3 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/NimbleMTXError.java @@ -0,0 +1,57 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx; + +import com.ea.nimble.Error; + +public class NimbleMTXError +extends Error { + public static final String ERROR_DOMAIN = "NimbleMTXError"; + private static final long serialVersionUID = 1L; + + public NimbleMTXError() { + } + + public NimbleMTXError(Code code, String string2) { + super(ERROR_DOMAIN, code.intValue(), string2, null); + } + + public NimbleMTXError(Code code, String string2, Throwable throwable) { + super(ERROR_DOMAIN, code.intValue(), string2, throwable); + } + + public static enum Code { + BILLING_NOT_AVAILABLE(20000), + ITEM_ALREADY_OWNED(20001), + ITEM_NOT_OWNED(20002), + USER_CANCELED(20003), + VERIFICATION_ERROR(20004), + GET_NONCE_ERROR(20005), + NON_CRITICAL_INTERRUPTION(20006), + INTERNAL_STATE(20007), + TRANSACTION_PENDING(20008), + TRANSACTION_NOT_RESUMABLE(20009), + UNRECOGNIZED_TRANSACTION_ID(20010), + INVALID_TRANSACTION_STATE(20011), + UNABLE_TO_CONSTRUCT_REQUEST(20012), + PLATFORM_ERROR(20013), + INVALID_SERVER_RESPONSE(20014), + ERROR_GETTING_PREPURCHASE_INFO(20015), + ITEM_UNAVAILABLE(20016), + INVALID_SKU(20017), + TRANSACTION_DEFERRED(20018), + TRANSACTION_SUPERSEDED(20019); + + private int m_value; + + private Code(int n3) { + this.m_value = n3; + } + + public int intValue() { + return this.m_value; + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/NimbleMTXTransaction.java b/app/src/main/java/com/ea/nimble/mtx/NimbleMTXTransaction.java new file mode 100644 index 0000000..7a5bd53 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/NimbleMTXTransaction.java @@ -0,0 +1,46 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx; + +import java.util.Date; +import java.util.Map; + +public interface NimbleMTXTransaction { + public Map getAdditionalInfo(); + + public Exception getError(); + + public String getItemSku(); + + public float getPriceDecimal(); + + public String getReceipt(); + + public Date getTimeStamp(); + + public String getTransactionId(); + + public TransactionState getTransactionState(); + + public TransactionType getTransactionType(); + + public static enum TransactionState { + UNDEFINED, + USER_INITIATED, + WAITING_FOR_PREPURCHASE_INFO, + WAITING_FOR_PLATFORM_RESPONSE, + WAITING_FOR_VERIFICATION, + WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT, + WAITING_FOR_PLATFORM_CONSUMPTION, + COMPLETE; + + } + + public static enum TransactionType { + PURCHASE, + RESTORE; + + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/ItemCategory.java b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/ItemCategory.java new file mode 100644 index 0000000..fccf5d4 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/ItemCategory.java @@ -0,0 +1,12 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.catalog.synergy; + +public class ItemCategory { + public int m_id; + public byte[] m_regularImageData; + public byte[] m_selectedImageData; + public String m_title; +} + 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 new file mode 100644 index 0000000..2cbaa20 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalog.java @@ -0,0 +1,219 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.util.Base64 + */ +package com.ea.nimble.mtx.catalog.synergy; + +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.IApplicationEnvironment; +import com.ea.nimble.IHttpRequest; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Network; +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.SynergyIdManager; +import com.ea.nimble.SynergyNetwork; +import com.ea.nimble.SynergyNetworkConnectionCallback; +import com.ea.nimble.SynergyRequest; +import com.ea.nimble.Utility; +import com.ea.nimble.mtx.NimbleCatalogItem; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class SynergyCatalog +implements LogSource { + public static final String MTX_INFO_KEY_CURRENCY = "localCurrency"; + private static final String SYNERGY_API_GET_AVAILABLE_ITEMS = "/product/api/core/getAvailableItems"; + private static final String SYNERGY_API_GET_CATEGORIES = "/product/api/core/getMTXGameCategories"; + private static final String SYNERGY_API_GET_DOWNLOAD_URL = "/product/api/core/getDownloadItemUrl"; + private static final String SYNERGY_API_GET_NONCE = "/drm/api/core/getNonce"; + private static final String SYNERGY_API_GET_PURCHASED_ITEMS = "/drm/api/core/getPurchasedItems"; + private String m_itemSkuPrefix; + private int m_itemsLoadingBinaryData = 0; + + public SynergyCatalog(StoreType storeType) { + if (storeType == StoreType.AMAZON) { + this.m_itemSkuPrefix = ApplicationEnvironment.getComponent().getApplicationBundleId() + "."; + return; + } + this.m_itemSkuPrefix = ""; + } + + static /* synthetic */ int access$106(SynergyCatalog synergyCatalog) { + int n2; + synergyCatalog.m_itemsLoadingBinaryData = n2 = synergyCatalog.m_itemsLoadingBinaryData - 1; + return n2; + } + + private SynergyCatalogItem createItemFromMap(Map object) { + SynergyCatalogItem synergyCatalogItem = new SynergyCatalogItem(); + synergyCatalogItem.m_sku = this.m_itemSkuPrefix + object.get("sellId"); + synergyCatalogItem.m_title = (String)object.get("title"); + NimbleCatalogItem.ItemType itemType = (Boolean)object.get("consumable") != false ? NimbleCatalogItem.ItemType.CONSUMABLE : NimbleCatalogItem.ItemType.NONCONSUMABLE; + synergyCatalogItem.m_type = itemType; + synergyCatalogItem.m_description = (String)object.get("desc"); + synergyCatalogItem.m_metaDataUrl = (String)object.get("packUrl"); + synergyCatalogItem.m_isFree = (Boolean)object.get("free"); + synergyCatalogItem.m_additionalInfo.putAll((Map)object); + return synergyCatalogItem; + } + + private void downloadContent(String string2, final DataCallback dataCallback) { + try { + URL uRL = new URL(string2); + Network.getComponent().sendGetRequest(uRL, null, networkConnectionHandle -> { + if (networkConnectionHandle.getResponse().getError() == null) { + dataCallback.callback(networkConnectionHandle.getResponse().getDataStream(), null); + return; + } + dataCallback.callback(null, networkConnectionHandle.getResponse().getError()); + }); + } + catch (MalformedURLException malformedURLException) { + Log.Helper.LOGE(this, "Invalid url: " + string2); + } + } + + private void getDownloadUrlForItem(SynergyCatalogItem object, StringCallback object2) { + + } + + public void downloadItem(SynergyCatalogItem synergyCatalogItem, final DataCallback dataCallback) { + this.getDownloadUrlForItem(synergyCatalogItem, new StringCallback(){ + + @Override + public void callback(String string2, Exception exception) { + if (exception == null) { + SynergyCatalog.this.downloadContent(string2, dataCallback); + return; + } + this.callback(null, exception); + } + }); + } + + public void getCategories(CategoryCallback object) {} + + public void getItemCatalog(ItemCallback object) { + Object object2 = (SynergyRequest.SynergyRequestPreparingCallback) synergyRequest -> { + IApplicationEnvironment iApplicationEnvironment = ApplicationEnvironment.getComponent(); + Object object1 = SynergyEnvironment.getComponent(); + HashMap hashMap = new HashMap(); + hashMap.put("masterSellId", null); + hashMap.put("typeSubstr", "1"); + hashMap.put("apiVer", "1.0.0"); + hashMap.put("ver", iApplicationEnvironment.getApplicationVersion()); + object1 = Utility.validString(SynergyIdManager.getComponent().getSynergyId()) ? SynergyIdManager.getComponent().getSynergyId() : "0"; + hashMap.put("uid", (String) object1); + hashMap.put("sdkVer", "1.23.14.1217"); + hashMap.put("langCode", iApplicationEnvironment.getShortApplicationLanguageCode()); + synergyRequest.urlParameters = hashMap; + synergyRequest.send(); + }; + object2 = new SynergyRequest(SYNERGY_API_GET_AVAILABLE_ITEMS, IHttpRequest.Method.GET, (SynergyRequest.SynergyRequestPreparingCallback)object2); + SynergyNetwork.getComponent().sendRequest((SynergyRequest)object2, (SynergyNetworkConnectionCallback)object); + } + + public String getItemSkuPrefix() { + return this.m_itemSkuPrefix; + } + + @Override + public String getLogSourceTitle() { + return "SynergyCatalog"; + } + + public void getNonce(StringCallback object){} + + public void getPurchasedItems(ItemSkuCallback object) {} + + public void loadBinaryDataForItems(Collection object, final CompletionCallback completionCallback) { + if (this.m_itemsLoadingBinaryData != 0) { + Log.Helper.LOGE(this, "Error: items already loading binary data"); + return; + } + for (SynergyCatalogItem catalogItem : object) { + String string2; + final SynergyCatalogItem synergyCatalogItem = catalogItem; + if (synergyCatalogItem.m_additionalInfo.get("binaryData") != null || (string2 = synergyCatalogItem.getMetaDataUrl()) == null) + continue; + try { + URL uRL = new URL(string2); + ++this.m_itemsLoadingBinaryData; + Network.getComponent().sendGetRequest(uRL, null, new NetworkConnectionCallback() { + + /* + * Enabled unnecessary exception pruning + */ + @Override + public void callback(NetworkConnectionHandle object) { + InputStream inputStream = object.getResponse().getDataStream(); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + try { + int n2; + byte[] byArray = new byte[4096]; + while ((n2 = inputStream.read(byArray, 0, byArray.length)) != -1) { + ((ByteArrayOutputStream) object).write(byArray, 0, n2); + } + ((OutputStream) object).flush(); + } catch (IOException iOException) { + Log.Helper.LOGE(this, "Error reading binary data"); + } + byte[] bytes = byteArrayOutputStream.toByteArray(); + synergyCatalogItem.getAdditionalInfo().put("binaryData", bytes); + SynergyCatalog.access$106(SynergyCatalog.this); + if (SynergyCatalog.this.m_itemsLoadingBinaryData != 0) return; + completionCallback.callback(null); + } + }); + } catch (MalformedURLException malformedURLException) { + Log.Helper.LOGE(this, "Error: Malformed item url: " + string2); + } + } + } + + public static interface CategoryCallback { + public void callback(Set var1, Exception var2); + } + + public static interface CompletionCallback { + public void callback(Exception var1); + } + + public static interface DataCallback { + public void callback(InputStream var1, Exception var2); + } + + public static interface ItemCallback { + public void callback(List var1, Exception var2); + } + + public static interface ItemSkuCallback { + public void callback(List var1, Exception var2); + } + + public static enum StoreType { + GOOGLE, + AMAZON; + + } + + public static interface StringCallback { + public void callback(String var1, Exception var2); + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalogItem.java b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalogItem.java new file mode 100644 index 0000000..3e825a1 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/catalog/synergy/SynergyCatalogItem.java @@ -0,0 +1,93 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.catalog.synergy; + +import com.ea.nimble.mtx.NimbleCatalogItem; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Map; + +public class SynergyCatalogItem +extends NimbleCatalogItem +implements Serializable { + private static final long serialVersionUID = 1L; + Map m_additionalInfo = new HashMap(); + String m_description; + String m_formattedPrice; + boolean m_isFree; + String m_metaDataUrl; + float m_price; + String m_sku; + String m_title; + NimbleCatalogItem.ItemType m_type; + + public SynergyCatalogItem() { + } + + public SynergyCatalogItem(String string2) { + this(); + this.m_sku = string2; + } + + @Override + public Map getAdditionalInfo() { + return this.m_additionalInfo; + } + + @Override + public String getDescription() { + return this.m_description; + } + + @Override + public NimbleCatalogItem.ItemType getItemType() { + return this.m_type; + } + + @Override + public String getMetaDataUrl() { + return this.m_metaDataUrl; + } + + @Override + public float getPriceDecimal() { + return this.m_price; + } + + @Override + public String getPriceWithCurrencyAndFormat() { + return this.m_formattedPrice; + } + + @Override + public String getSku() { + return this.m_sku; + } + + @Override + public String getTitle() { + return this.m_title; + } + + public boolean isFree() { + return this.m_isFree; + } + + public void setDescription(String string2) { + this.m_description = string2; + } + + public void setPriceDecimal(float f2) { + this.m_price = f2; + } + + public void setPriceWithCurrencyAndFormat(String string2) { + this.m_formattedPrice = string2; + } + + public void setTitle(String string2) { + this.m_title = string2; + } +} + 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 new file mode 100644 index 0000000..e44e5a8 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlay.java @@ -0,0 +1,1634 @@ +package com.ea.nimble.mtx.googleplay; + +import android.app.Activity; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.net.Uri; +import android.os.Bundle; +import android.provider.Settings; +import androidx.localbroadcastmanager.content.LocalBroadcastManager; +import android.telephony.TelephonyManager; +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.ApplicationLifecycle; +import com.ea.nimble.Base; +import com.ea.nimble.Component; +import com.ea.nimble.Error; +import com.ea.nimble.Global; +import com.ea.nimble.IApplicationEnvironment; +import com.ea.nimble.IApplicationLifecycle; +import com.ea.nimble.IHttpRequest; +import com.ea.nimble.ISynergyEnvironment; +import com.ea.nimble.ISynergyIdManager; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Network; +import com.ea.nimble.NimbleConfiguration; +import com.ea.nimble.Persistence; +import com.ea.nimble.PersistenceService; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.SynergyIdManager; +import com.ea.nimble.SynergyNetwork; +import com.ea.nimble.SynergyRequest; +import com.ea.nimble.SynergyServerError; +import com.ea.nimble.Timer; +import com.ea.nimble.Utility; +import com.ea.nimble.mtx.INimbleMTX; +import com.ea.nimble.mtx.NimbleCatalogItem; +import com.ea.nimble.mtx.NimbleMTXError; +import com.ea.nimble.mtx.NimbleMTXTransaction; +import com.ea.nimble.mtx.catalog.synergy.SynergyCatalog; +import com.ea.nimble.mtx.catalog.synergy.SynergyCatalogItem; +import com.ea.nimble.mtx.googleplay.util.IabHelper; +import com.ea.nimble.mtx.googleplay.util.IabResult; +import com.ea.nimble.mtx.googleplay.util.Inventory; +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.google.android.gms.maps.model.BitmapDescriptorFactory; +import java.io.Serializable; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Currency; +import java.util.Date; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.TimeZone; +import java.util.UUID; +import java.util.concurrent.atomic.AtomicInteger; + +public class GooglePlay extends Component implements IApplicationLifecycle.ActivityEventCallbacks, LogSource, INimbleMTX, IabHelper.OnIabPurchaseFinishedListener { + private static final double CACHE_EXPIRE_TIME = 3600.0d; + private static final String CACHE_TIMESTAMP_KEY = "cacheTimestamp"; + public static final String COMPONENT_ID = "com.ea.nimble.mtx.googleplay"; + private static final double DEFERRED_CALLBACK_DELAY = 0.1d; + private static final double MAX_REQUEST_RETRY_DELAY = 300.0d; + private static final String PERSISTENCE_CATALOG_ITEMS = "catalogItems"; + private static final String PERSISTENCE_PENDING_TRANSACTIONS = "pendingTransactions"; + private static final String PERSISTENCE_PURCHASED_TRANSACTIONS = "purchasedTransactions"; + private static final String PERSISTENCE_RECOVERED_TRANSACTIONS = "recoveredTransactions"; + private static final String PERSISTENCE_UNRECORDED_TRANSACTIONS = "unrecordedTransactions"; + private static final String SYNERGY_API_VERIFY_AND_RECORD_GOOGLEPLAY_PURCHASE = "/drm/api/android/verifyAndRecordPurchase"; + IabHelper mGooglePlayIabHelper; + String m_appPublicKey; + private Long m_cacheTimestamp; + private boolean m_restoreInProgress; + SynergyCatalog m_synergyCatalog; + private boolean m_verificationEnabled; + public static int GOOGLEPLAY_ACTIVITY_RESULT_REQUEST_CODE = 987654; + public static String GOOGLEPLAY_PLATFORM_PARAMETER_APPLICATION_PUBLIC_KEY = "GOOGLEPLAY_APPLICATION_PUBLIC_KEY"; + public static String GOOGLEPLAY_ADDITIONALINFO_KEY_ORDERID = "orderId"; + public static String GOOGLEPLAY_ADDITIONALINFO_KEY_PURCHASETIME = "purchaseTime"; + public static String GOOGLEPLAY_ADDITIONALINFO_KEY_PURCHASESTATE = "purchaseState"; + public static String GOOGLEPLAY_ADDITIONALINFO_KEY_TOKEN = "token"; + public static String GOOGLEPLAY_ADDITIONALINFO_KEY_PURCHASEDATA = "purchaseData"; + public static String GOOGLEPLAY_ADDITIONALINFO_KEY_RECEIPT = "receipt"; + private ItemRestorer m_itemRestorer = new ItemRestorer(); + private TransactionRecorder m_transactionRecorder = new TransactionRecorder(); + HashMap mPendingTransactions = new HashMap<>(); + HashMap mPurchasedTransactions = new HashMap<>(); + HashMap mRecoveredTransactions = new HashMap<>(); + HashMap mCatalogItems = new HashMap<>(); + ArrayList mUnrecordedTransactions = new ArrayList<>(); + + /* loaded from: stdlib.jar:com/ea/nimble/mtx/googleplay/GooglePlay$GetNonceCallback.class */ + public interface GetNonceCallback { + void onGetNonceComplete(GooglePlayTransaction googlePlayTransaction, String str, Error error); + } + + /* JADX INFO: Access modifiers changed from: private */ + /* loaded from: stdlib.jar:com/ea/nimble/mtx/googleplay/GooglePlay$ItemRestorer.class */ + public class ItemRestorer extends BroadcastReceiver implements Runnable { + private double m_requestRetryDelay; + private Timer m_timer; + + private ItemRestorer() { + this.m_timer = new Timer(this); + this.m_requestRetryDelay = 1.0d; + } + + public void cancel() { + GooglePlay.this.m_restoreInProgress = false; + this.m_timer.cancel(); + this.m_requestRetryDelay = 1.0d; + Utility.unregisterReceiver(this); + } + + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + if (intent.getExtras().getString(Global.NOTIFICATION_DICTIONARY_KEY_RESULT).equals(Global.NOTIFICATION_DICTIONARY_RESULT_FAIL)) { + Log.Helper.LOGD(GooglePlay.this, "Catalog refresh failed with restore pending. Retrying in " + this.m_requestRetryDelay + " seconds."); + if (!this.m_timer.isRunning()) { + this.m_timer.schedule(this.m_requestRetryDelay, false); + return; + } + return; + } + this.m_timer.cancel(); + Utility.unregisterReceiver(this); + GooglePlay.this.m_restoreInProgress = false; + GooglePlay.this.restorePurchasedTransactionsImpl(false); + } + + public void restoreItems() { + if (!GooglePlay.this.m_restoreInProgress) { + if (GooglePlay.this.mCatalogItems == null || GooglePlay.this.mCatalogItems.isEmpty()) { + GooglePlay.this.m_restoreInProgress = true; + Log.Helper.LOGD(GooglePlay.this, "Restore pending but catalog is unavailable. Initiating refresh now."); + Utility.registerReceiver(INimbleMTX.NIMBLE_NOTIFICATION_MTX_REFRESH_CATALOG_FINISHED, this); + GooglePlay.this.refreshAvailableCatalogItems(); + return; + } + GooglePlay.this.restorePurchasedTransactionsImpl(false); + } + } + + @Override // java.lang.Runnable + public void run() { + this.m_requestRetryDelay = Math.min(this.m_requestRetryDelay * 2.0d, 300.0d); + GooglePlay.this.refreshAvailableCatalogItems(); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + /* loaded from: stdlib.jar:com/ea/nimble/mtx/googleplay/GooglePlay$PurchaseTransactionVerifier.class */ + public class PurchaseTransactionVerifier { + private PurchaseTransactionVerifier() { + } + + public void verifyTransaction(GooglePlayTransaction googlePlayTransaction) { + GooglePlay.this.updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_NONCE); + GooglePlay.this.networkCallGetNonceFromSynergy(googlePlayTransaction, new GetNonceCallback() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.PurchaseTransactionVerifier.1 + @Override // com.ea.nimble.mtx.googleplay.GooglePlay.GetNonceCallback + public void onGetNonceComplete(final GooglePlayTransaction googlePlayTransaction2, String str, Error error) { + if (googlePlayTransaction2.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_NONCE) { + if (GooglePlay.this.updateTransactionRecordWithNonce(googlePlayTransaction2, str, error)) { + GooglePlay.this.networkCallRecordPurchase(googlePlayTransaction2, new VerifyCallback() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.PurchaseTransactionVerifier.1.1 + @Override // com.ea.nimble.mtx.googleplay.GooglePlay.VerifyCallback + public void onVerificationComplete(Exception exc) { + if (googlePlayTransaction2.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_SYNERGY_VERIFICATION) { + if (exc != null) { + Log.Helper.LOGE(this, "Error making recordPurchase call to Synergy: " + exc); + googlePlayTransaction2.mError = new NimbleMTXError(NimbleMTXError.Code.VERIFICATION_ERROR, "Synergy verification error", exc); + googlePlayTransaction2.mFailedState = googlePlayTransaction2.mGooglePlayTransactionState; + GooglePlay.this.updateGooglePlayTransactionRecordState(googlePlayTransaction2, GooglePlayTransaction.GooglePlayTransactionState.COMPLETE); + } else { + GooglePlay.this.updateGooglePlayTransactionRecordState(googlePlayTransaction2, GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT); + } + if (googlePlayTransaction2 != null && googlePlayTransaction2.mPurchaseCallback != null) { + googlePlayTransaction2.mPurchaseCallback.purchaseComplete(googlePlayTransaction2); + } + } + } + }); + } else if (googlePlayTransaction2 != null && googlePlayTransaction2.mPurchaseCallback != null) { + googlePlayTransaction2.mPurchaseCallback.purchaseComplete(googlePlayTransaction2); + } + } + } + }); + } + } + + /* JADX INFO: Access modifiers changed from: private */ + /* loaded from: stdlib.jar:com/ea/nimble/mtx/googleplay/GooglePlay$RestoreTransactionVerifier.class */ + public class RestoreTransactionVerifier { + private AtomicInteger m_transactionsVerifying; + private ArrayList m_verifiedTransactions; + + private RestoreTransactionVerifier() { + } + + public void verifyTransactions(List list) { + this.m_transactionsVerifying = new AtomicInteger(0); + this.m_verifiedTransactions = new ArrayList<>(); + if (list.size() == 0) { + GooglePlay.this.onRestoreComplete(this.m_verifiedTransactions); + return; + } + for (GooglePlayTransaction googlePlayTransaction : list) { + this.m_transactionsVerifying.incrementAndGet(); + GooglePlay.this.mPendingTransactions.put(googlePlayTransaction.getTransactionId(), googlePlayTransaction); + GooglePlay.this.updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_NONCE); + GooglePlay.this.networkCallGetNonceFromSynergy(googlePlayTransaction, new GetNonceCallback() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.RestoreTransactionVerifier.1 + @Override // com.ea.nimble.mtx.googleplay.GooglePlay.GetNonceCallback + public void onGetNonceComplete(final GooglePlayTransaction googlePlayTransaction2, String str, Error error) { + if (GooglePlay.this.updateTransactionRecordWithNonce(googlePlayTransaction2, str, error)) { + GooglePlay.this.networkCallRecordPurchase(googlePlayTransaction2, new VerifyCallback() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.RestoreTransactionVerifier.1.1 + @Override // com.ea.nimble.mtx.googleplay.GooglePlay.VerifyCallback + public void onVerificationComplete(Exception exc) { + if (exc != null) { + googlePlayTransaction2.mError = new NimbleMTXError(NimbleMTXError.Code.VERIFICATION_ERROR, "Synergy verification error", exc); + } + RestoreTransactionVerifier.this.m_verifiedTransactions.add(googlePlayTransaction2); + if (RestoreTransactionVerifier.this.m_transactionsVerifying.decrementAndGet() == 0) { + GooglePlay.this.onRestoreComplete(RestoreTransactionVerifier.this.m_verifiedTransactions); + } + } + }); + } else if (RestoreTransactionVerifier.this.m_transactionsVerifying.decrementAndGet() == 0) { + GooglePlay.this.onRestoreComplete(RestoreTransactionVerifier.this.m_verifiedTransactions); + } + } + }); + } + } + } + + /* loaded from: stdlib.jar:com/ea/nimble/mtx/googleplay/GooglePlay$TransactionRecorder.class */ + public class TransactionRecorder extends BroadcastReceiver implements GetNonceCallback, Runnable { + private double m_requestRetryDelay; + private Timer m_timer; + + private TransactionRecorder() { + this.m_requestRetryDelay = 1.0d; + this.m_timer = new Timer(this); + } + + public void cancel() { + this.m_timer.cancel(); + this.m_requestRetryDelay = 1.0d; + Utility.unregisterReceiver(this); + } + + @Override // com.ea.nimble.mtx.googleplay.GooglePlay.GetNonceCallback + public void onGetNonceComplete(final GooglePlayTransaction googlePlayTransaction, String str, Error error) { + if (!GooglePlay.this.isCancelledError(error)) { + if (GooglePlay.this.updateTransactionRecordWithNonce(googlePlayTransaction, str, error)) { + GooglePlay.this.networkCallRecordPurchase(googlePlayTransaction, new VerifyCallback() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.TransactionRecorder.1 + @Override // com.ea.nimble.mtx.googleplay.GooglePlay.VerifyCallback + public void onVerificationComplete(Exception exc) { + if (!GooglePlay.this.isCancelledError(exc)) { + if (googlePlayTransaction.mIsRecorded) { + GooglePlay.this.mUnrecordedTransactions.remove(googlePlayTransaction); + GooglePlay.this.saveUnrecordedTransactionsToPersistence(); + TransactionRecorder.this.m_requestRetryDelay = 1.0d; + } else if (!TransactionRecorder.this.m_timer.isRunning()) { + TransactionRecorder.this.m_timer.schedule(TransactionRecorder.this.m_requestRetryDelay, false); + } + } + } + }); + } else if (!this.m_timer.isRunning()) { + this.m_timer.schedule(this.m_requestRetryDelay, false); + } + } + } + + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + Log.Helper.LOGD(GooglePlay.this, "Received network notification"); + if (Network.getComponent().getStatus() == Network.Status.OK) { + Log.Helper.LOGD(GooglePlay.this, "Network status is OK, unregistering receiver and attempting to record transactions"); + Utility.unregisterReceiver(this); + recordTransactions(); + return; + } + Log.Helper.LOGD(GooglePlay.this, "Attempted to recordTransaction but network state was not OK. Aborting and eating my transaction."); + } + + public void recordTransactions() { + if (GooglePlay.this.mUnrecordedTransactions == null || GooglePlay.this.mUnrecordedTransactions.size() == 0) { + Log.Helper.LOGD(GooglePlay.this, "No transactions to record"); + return; + } + Log.Helper.LOGD(GooglePlay.this, "Attempting to record transactions"); + if (ApplicationEnvironment.getCurrentActivity() == null) { + Log.Helper.LOGD(GooglePlay.this, "Main application not running, ignoring record"); + } else if (Network.getComponent().getStatus() != Network.Status.OK) { + Log.Helper.LOGD(GooglePlay.this, "Waiting for Network connectivity"); + Utility.registerReceiver(Global.NOTIFICATION_NETWORK_STATUS_CHANGE, this); + } else { + Iterator it = GooglePlay.this.mUnrecordedTransactions.iterator(); + while (it.hasNext()) { + GooglePlay.this.networkCallGetNonceFromSynergy(it.next(), this); + } + } + } + + @Override // java.lang.Runnable + public void run() { + this.m_requestRetryDelay = Math.min(this.m_requestRetryDelay * 2.0d, 300.0d); + recordTransactions(); + } + } + + /* loaded from: stdlib.jar:com/ea/nimble/mtx/googleplay/GooglePlay$VerifyCallback.class */ + public interface VerifyCallback { + void onVerificationComplete(Exception exc); + } + + private GooglePlay() { + } + + public void broadcastLocalEvent(String str, String str2, String str3, Bundle bundle) { + LocalBroadcastManager instance = LocalBroadcastManager.getInstance(ApplicationEnvironment.getComponent().getApplicationContext()); + Intent intent = new Intent(); + intent.setAction(str); + Bundle bundle2 = bundle != null ? new Bundle(bundle) : new Bundle(); + if (str2 == null) { + bundle2.putString(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, Global.NOTIFICATION_DICTIONARY_RESULT_SUCCESS); + } else { + bundle2.putString("error", str2); + bundle2.putString(Global.NOTIFICATION_DICTIONARY_KEY_RESULT, Global.NOTIFICATION_DICTIONARY_RESULT_FAIL); + } + if (str3 != null) { + bundle2.putString(INimbleMTX.NOTIFICATION_DICTIONARY_KEY_TRANSACTIONID, str3); + } + intent.putExtras(bundle2); + instance.sendBroadcast(intent); + } + + public Map createAdditionalInfoBundleFromIabPurchase(Purchase purchase) { + HashMap hashMap = new HashMap(); + if (purchase != null) { + hashMap.put(GOOGLEPLAY_ADDITIONALINFO_KEY_ORDERID, purchase.getOrderId()); + hashMap.put(GOOGLEPLAY_ADDITIONALINFO_KEY_PURCHASETIME, Long.valueOf(purchase.getPurchaseTime())); + hashMap.put(GOOGLEPLAY_ADDITIONALINFO_KEY_PURCHASESTATE, Integer.valueOf(purchase.getPurchaseState())); + hashMap.put(GOOGLEPLAY_ADDITIONALINFO_KEY_TOKEN, purchase.getToken()); + hashMap.put(GOOGLEPLAY_ADDITIONALINFO_KEY_PURCHASEDATA, purchase.getOriginalJson()); + hashMap.put(GOOGLEPLAY_ADDITIONALINFO_KEY_RECEIPT, purchase.getSignature()); + } + return hashMap; + } + + public GooglePlayError createGooglePlayErrorFromIabResult(IabResult iabResult) { + GooglePlayError.Code code; + if (iabResult == null || iabResult.getResponse() == 0) { + return null; + } + switch (iabResult.getResponse()) { + case IabHelper.IABHELPER_UNKNOWN_ERROR /* -1009 */: + code = GooglePlayError.Code.IABHELPER_UNKNOWN_ERROR; + break; + case IabHelper.IABHELPER_BAD_STATE_ERROR /* -1008 */: + code = GooglePlayError.Code.IABHELPER_BAD_STATE_ERROR; + break; + case IabHelper.IABHELPER_MISSING_TOKEN /* -1007 */: + code = GooglePlayError.Code.IABHELPER_MISSING_TOKEN; + break; + case IabHelper.IABHELPER_UNKNOWN_PURCHASE_RESPONSE /* -1006 */: + code = GooglePlayError.Code.IABHELPER_UNKNOWN_PURCHASE_RESPONSE; + break; + case IabHelper.IABHELPER_USER_CANCELLED /* -1005 */: + code = GooglePlayError.Code.IABHELPER_USER_CANCELLED; + break; + case IabHelper.IABHELPER_SEND_INTENT_FAILED /* -1004 */: + code = GooglePlayError.Code.IABHELPER_SEND_INTENT_FAILED; + break; + case IabHelper.IABHELPER_VERIFICATION_FAILED /* -1003 */: + code = GooglePlayError.Code.IABHELPER_VERIFICATION_FAILED; + break; + case IabHelper.IABHELPER_BAD_RESPONSE /* -1002 */: + code = GooglePlayError.Code.IABHELPER_BAD_RESPONSE; + break; + case IabHelper.IABHELPER_REMOTE_EXCEPTION /* -1001 */: + code = GooglePlayError.Code.IABHELPER_REMOTE_EXCEPTION; + break; + case IabHelper.IABHELPER_ERROR_BASE /* -1000 */: + code = GooglePlayError.Code.IABHELPER_ERROR_BASE; + break; + case 1: + code = GooglePlayError.Code.BILLING_RESPONSE_RESULT_USER_CANCELED; + break; + case 3: + code = GooglePlayError.Code.BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE; + break; + case 4: + code = GooglePlayError.Code.BILLING_RESPONSE_RESULT_ITEM_UNAVAILABLE; + break; + case 5: + code = GooglePlayError.Code.BILLING_RESPONSE_RESULT_DEVELOPER_ERROR; + break; + case 6: + code = GooglePlayError.Code.BILLING_RESPONSE_RESULT_ERROR; + break; + case 7: + code = GooglePlayError.Code.BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED; + break; + case 8: + code = GooglePlayError.Code.BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED; + break; + default: + code = GooglePlayError.Code.UNKNOWN; + break; + } + return new GooglePlayError(code, iabResult.getMessage()); + } + + private void createIabHelper() { + this.mGooglePlayIabHelper = new IabHelper(ApplicationEnvironment.getComponent().getApplicationContext(), getAppPublicKey()); + 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."); + if (!iabResult.isSuccess()) { + Log.Helper.LOGD(this, "Error setting up InAppBilling helper: " + iabResult); + } else { + GooglePlay.this.m_itemRestorer.restoreItems(); + } + } + }, 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"); + GooglePlay.this.restorePurchasedTransactions(); + } + }); + } + + public NimbleMTXError createNimbleMTXErrorWithGooglePlayError(GooglePlayError googlePlayError, String str) { + NimbleMTXError.Code code = NimbleMTXError.Code.PLATFORM_ERROR; + NimbleMTXError.Code code2 = code; + if (googlePlayError != null) { + int code3 = googlePlayError.getCode(); + if (code3 == GooglePlayError.Code.BILLING_RESPONSE_RESULT_USER_CANCELED.intValue() || code3 == GooglePlayError.Code.IABHELPER_USER_CANCELLED.intValue()) { + code2 = NimbleMTXError.Code.USER_CANCELED; + } else if (code3 == GooglePlayError.Code.BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE.intValue()) { + code2 = NimbleMTXError.Code.BILLING_NOT_AVAILABLE; + } else if (code3 == GooglePlayError.Code.BILLING_RESPONSE_RESULT_ITEM_UNAVAILABLE.intValue()) { + code2 = NimbleMTXError.Code.ITEM_UNAVAILABLE; + } else if (code3 == GooglePlayError.Code.BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED.intValue()) { + code2 = NimbleMTXError.Code.ITEM_ALREADY_OWNED; + } else { + code2 = code; + if (code3 == GooglePlayError.Code.BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED.intValue()) { + code2 = NimbleMTXError.Code.ITEM_NOT_OWNED; + } + } + } + return new NimbleMTXError(code2, str, googlePlayError); + } + + private void deferredConsumeCallback(final INimbleMTX.ItemGrantedCallback itemGrantedCallback, final NimbleMTXTransaction nimbleMTXTransaction) { + new Timer(new Runnable() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.11 + @Override // java.lang.Runnable + public void run() { + itemGrantedCallback.itemGrantedComplete(nimbleMTXTransaction); + } + }).schedule(DEFERRED_CALLBACK_DELAY, false); + } + + private HashMap filterForResumablePurchaseTransactions(HashMap hashMap) { + HashMap hashMap2 = new HashMap<>(); + if (hashMap != null) { + for (GooglePlayTransaction googlePlayTransaction : hashMap.values()) { + if (googlePlayTransaction.mTransactionType == NimbleMTXTransaction.TransactionType.PURCHASE && (googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_NONCE || googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GOOGLEPLAY_ACTIVITY_RESPONSE || googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_SYNERGY_VERIFICATION || googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT || googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GOOGLEPLAY_CONSUMPTION || googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.COMPLETE)) { + hashMap2.put(googlePlayTransaction.getTransactionId(), googlePlayTransaction); + } + } + } + return hashMap2; + } + + private List findRecoveredTransactionsWithItemSku(String str) { + ArrayList arrayList = new ArrayList(); + if (str != null) { + for (GooglePlayTransaction googlePlayTransaction : this.mRecoveredTransactions.values()) { + if (googlePlayTransaction.getItemSku().equals(str)) { + arrayList.add(googlePlayTransaction); + } + } + } + return arrayList; + } + + private String generateDeveloperPayloadForTransaction(GooglePlayTransaction googlePlayTransaction) { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMddHHmmss", Locale.US); + simpleDateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); + return simpleDateFormat.format(new Date()); + } + + public String generateTransactionId() { + return UUID.randomUUID().toString(); + } + + private String getAppPublicKey() { + return this.m_appPublicKey; + } + + private GooglePlayCatalogItem getCatalogItemBySku(String str) { + return this.mCatalogItems.get(str); + } + + public static GooglePlay getComponent() { + return (GooglePlay) Base.getComponent(COMPONENT_ID); + } + + public void getGooglePlayPricingForPendingCatalogItems(List list) { + if (list == null || list.isEmpty()) { + broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_REFRESH_CATALOG_FINISHED, "Empty catalog item list for GooglePlay catalog query.", null, null); + return; + } + + ApplicationEnvironment.getCurrentActivity().runOnUiThread( + new Lambdas(list, this.mGooglePlayIabHelper, this) + ); + } + + class Lambdas implements Runnable, IabHelper.QueryInventoryFinishedListener{ + + List mCatalogItemList; + IabHelper mIabHelper; + GooglePlay mParentNimbleGooglePlayObject; + + public Lambdas(List mCatalogItemList, IabHelper mIabHelper, GooglePlay mParentNimbleGooglePlayObject) { + this.mCatalogItemList = mCatalogItemList; + this.mIabHelper = mIabHelper; + this.mParentNimbleGooglePlayObject = mParentNimbleGooglePlayObject; + } + + @Override + public void onQueryInventoryFinished(IabResult iabResult, Inventory inventory) { + NimbleMTXError nimbleMTXError; + Log.Helper.LOGD(this, "GooglePlayCatalogUpdateListener onQueryInventoryFinished"); + if (iabResult.isFailure()) { + Log.Helper.LOGD(this, "Query inventory error: " + iabResult.getMessage()); + nimbleMTXError = GooglePlay.this.createNimbleMTXErrorWithGooglePlayError(GooglePlay.this.createGooglePlayErrorFromIabResult(iabResult), "GooglePlay catalog query error"); + } else { + HashSet hashSet = new HashSet(); + for (GooglePlayCatalogItem googlePlayCatalogItem : this.mCatalogItemList) { + SkuDetails skuDetails = inventory.getSkuDetails(googlePlayCatalogItem.mSku); + if (skuDetails != null) { + googlePlayCatalogItem.mTitle = skuDetails.getTitle(); + googlePlayCatalogItem.mDescription = skuDetails.getDescription(); + googlePlayCatalogItem.mPriceWithCurrencyAndFormat = skuDetails.getPrice(); + googlePlayCatalogItem.mPriceDecimal = Utility.validString(skuDetails.getPriceMicros()) ? Float.parseFloat(skuDetails.getPriceMicros()) / 1000000.0f : BitmapDescriptorFactory.HUE_RED; + googlePlayCatalogItem.mAdditionalInfo.put(SynergyCatalog.MTX_INFO_KEY_CURRENCY, skuDetails.getCurrencyCode()); + } else { + Log.Helper.LOGE(this, "Could not get SKU details from GooglePlay for SKU: %s. Removing from results.", googlePlayCatalogItem.mSku); + hashSet.add(googlePlayCatalogItem); + } + } + nimbleMTXError = null; + if (hashSet.size() > 0) { + this.mCatalogItemList.removeAll(hashSet); + nimbleMTXError = null; + } + } + this.mParentNimbleGooglePlayObject.onGooglePlayCatalogItemsRefreshed(this.mCatalogItemList, true, nimbleMTXError); + } + + void queryGooglePlay() { + ArrayList arrayList = new ArrayList(); + for (GooglePlayCatalogItem googlePlayCatalogItem : this.mCatalogItemList) { + arrayList.add(googlePlayCatalogItem.mSku); + } + Log.Helper.LOGD(this, "Making GooglePlay inventory query for skus: " + arrayList); + this.mIabHelper.queryInventoryAsync(false, true, arrayList, this); + } + + @Override + public void run() { + try { + queryGooglePlay(); + } catch (IllegalStateException e) { + onQueryInventoryFinished(new IabResult(3, "Billing is unavailable"), null); + } + } + } + + private void googlePlayCallPurchaseItem(GooglePlayTransaction googlePlayTransaction) { + googlePlayTransaction.mDeveloperPayload = generateDeveloperPayloadForTransaction(googlePlayTransaction); + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GOOGLEPLAY_ACTIVITY_RESPONSE); + this.mGooglePlayIabHelper.launchPurchaseFlow(ApplicationEnvironment.getCurrentActivity(), googlePlayTransaction.getItemSku(), GOOGLEPLAY_ACTIVITY_RESULT_REQUEST_CODE, this, googlePlayTransaction.mDeveloperPayload); + } + + private void googlePlayConsumeItem(GooglePlayTransaction googlePlayTransaction) { + try { + this.mGooglePlayIabHelper.consumeAsync(new Purchase(googlePlayTransaction), new IabHelper.OnConsumeFinishedListener() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.10 + @Override // com.ea.nimble.mtx.googleplay.util.IabHelper.OnConsumeFinishedListener + public void onConsumeFinished(Purchase purchase, IabResult iabResult) { + if (iabResult.isFailure()) { + Log.Helper.LOGE(this, "GooglePlay consume item failed, item SKU: " + purchase.getSku()); + GooglePlayTransaction googlePlayTransaction2 = GooglePlay.this.mPendingTransactions.get(purchase.getNimbleMTXTransactionId()); + if (googlePlayTransaction2 != null) { + googlePlayTransaction2.mError = GooglePlay.this.createNimbleMTXErrorWithGooglePlayError(GooglePlay.this.createGooglePlayErrorFromIabResult(iabResult), "GooglePlay item consumption error."); + googlePlayTransaction2.mFailedState = googlePlayTransaction2.mGooglePlayTransactionState; + GooglePlay.this.updateGooglePlayTransactionRecordState(googlePlayTransaction2, GooglePlayTransaction.GooglePlayTransactionState.COMPLETE); + if (googlePlayTransaction2.mItemGrantedCallback != null) { + googlePlayTransaction2.mItemGrantedCallback.itemGrantedComplete(googlePlayTransaction2); + } else { + Log.Helper.LOGE(this, "Transaction does not have a consume callback to notify game of the finalize error."); + } + } + } else { + Log.Helper.LOGD(this, "GooglePlay consume item success, item SKU: " + purchase.getSku()); + GooglePlayTransaction googlePlayTransaction3 = GooglePlay.this.mPendingTransactions.get(purchase.getNimbleMTXTransactionId()); + if (googlePlayTransaction3 != null) { + GooglePlay.this.updateGooglePlayTransactionRecordState(googlePlayTransaction3, GooglePlayTransaction.GooglePlayTransactionState.COMPLETE); + if (googlePlayTransaction3.mItemGrantedCallback != null) { + googlePlayTransaction3.mItemGrantedCallback.itemGrantedComplete(googlePlayTransaction3); + } else { + Log.Helper.LOGE(this, "Transaction does not have a consume callback to notify game."); + } + } else { + Log.Helper.LOGE(this, "Unable to find consumed transaction to remove."); + } + } + } + }); + } catch (Exception e) { + Log.Helper.LOGE(this, "Unable to construct a Purchase object from GooglePlayTransaction. Unable to consume item with Google Play!"); + if (googlePlayTransaction.mItemGrantedCallback != null) { + googlePlayTransaction.mError = new NimbleMTXError(NimbleMTXError.Code.UNABLE_TO_CONSTRUCT_REQUEST, "Unable to construct Purchase object from GooglePlayTransaction."); + googlePlayTransaction.mFailedState = googlePlayTransaction.mGooglePlayTransactionState; + deferredConsumeCallback(googlePlayTransaction.mItemGrantedCallback, googlePlayTransaction); + return; + } + Log.Helper.LOGE(this, "ItemGrantedCallback not set, no way to notify game."); + } + } + + private static void initialize() { + Base.registerComponent(new GooglePlay(), COMPONENT_ID); + } + + private boolean isCacheExpired() { + return this.m_cacheTimestamp == null || ((double) (System.currentTimeMillis() - this.m_cacheTimestamp.longValue())) > 3600000.0d; + } + + public boolean isCancelledError(Throwable th) { + if (!(th instanceof Error)) { + return false; + } + Error error = (Error) th; + return (error.getDomain().equals(Error.ERROR_DOMAIN) && error.getCode() == Error.Code.NETWORK_OPERATION_CANCELLED.intValue()) || isCancelledError(error.getCause()); + } + + private boolean isTransactionPending() { + return isTransactionPending(true); + } + + private boolean isTransactionPending(boolean z) { + if (this.mPendingTransactions.size() == 0) { + return z && this.mRecoveredTransactions.size() != 0; + } + return true; + } + + private void loadFromPersistence() { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(COMPONENT_ID, Persistence.Storage.DOCUMENT); + Serializable value = persistenceForNimbleComponent.getValue(PERSISTENCE_CATALOG_ITEMS); + if (value != null && value.getClass() == HashMap.class) { + this.mCatalogItems = new HashMap<>((HashMap) value); + Log.Helper.LOGD(this, "Restored %d catalog items from persistence.", Integer.valueOf(this.mCatalogItems.size())); + } + Serializable value2 = persistenceForNimbleComponent.getValue(PERSISTENCE_PURCHASED_TRANSACTIONS); + if (value2 == null || value2.getClass() != HashMap.class) { + Log.Helper.LOGD(this, "No purchased transactions to restore."); + } else { + this.mPurchasedTransactions = new HashMap<>((HashMap) value2); + Log.Helper.LOGD(this, "%d purchased transactions restored from persistence.", Integer.valueOf(this.mPurchasedTransactions.size())); + } + Serializable value3 = persistenceForNimbleComponent.getValue(PERSISTENCE_RECOVERED_TRANSACTIONS); + if (value3 == null || value3.getClass() != HashMap.class) { + Log.Helper.LOGD(this, "No recovered transactions to restore."); + } else { + this.mRecoveredTransactions = new HashMap<>((HashMap) value3); + Log.Helper.LOGD(this, "%d recovered transactions restored from persistence.", Integer.valueOf(this.mRecoveredTransactions.size())); + } + Serializable value4 = persistenceForNimbleComponent.getValue(PERSISTENCE_PENDING_TRANSACTIONS); + if (value4 == null || value4.getClass() != HashMap.class) { + Log.Helper.LOGD(this, "No pending transactions to restore."); + } else { + HashMap hashMap = new HashMap<>((HashMap) value4); + Log.Helper.LOGD(this, "%d pending transactions restored from persistence.", Integer.valueOf(hashMap.size())); + if (this.mRecoveredTransactions == null) { + this.mRecoveredTransactions = new HashMap<>(); + } + this.mRecoveredTransactions.putAll(filterForResumablePurchaseTransactions(hashMap)); + for (GooglePlayTransaction googlePlayTransaction : this.mRecoveredTransactions.values()) { + this.mPendingTransactions.remove(googlePlayTransaction.getTransactionId()); + } + } + Serializable value5 = persistenceForNimbleComponent.getValue(PERSISTENCE_UNRECORDED_TRANSACTIONS); + if (value5 != null && (value5 instanceof ArrayList)) { + this.mUnrecordedTransactions = (ArrayList) value5; + this.m_transactionRecorder.recordTransactions(); + } + this.m_cacheTimestamp = (Long) persistenceForNimbleComponent.getValue(CACHE_TIMESTAMP_KEY); + if (this.mRecoveredTransactions != null && this.mRecoveredTransactions.size() > 0) { + Log.Helper.LOGD(this, "Recovered transactions: " + this.mRecoveredTransactions); + broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_TRANSACTIONS_RECOVERED, null, null, null); + } + } + + public void networkCallGetNonceFromSynergy(final GooglePlayTransaction googlePlayTransaction, final GetNonceCallback getNonceCallback) { + try { + this.m_synergyCatalog.getNonce(new SynergyCatalog.StringCallback() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.7 + @Override // com.ea.nimble.mtx.catalog.synergy.SynergyCatalog.StringCallback + public void callback(String str, Exception exc) { + if (exc == null) { + getNonceCallback.onGetNonceComplete(googlePlayTransaction, str, null); + return; + } + getNonceCallback.onGetNonceComplete(googlePlayTransaction, null, new NimbleMTXError(NimbleMTXError.Code.GET_NONCE_ERROR, "Synergy getNonce request error.", exc)); + } + }); + } catch (Exception e) { + e.printStackTrace(); + getNonceCallback.onGetNonceComplete(googlePlayTransaction, null, new NimbleMTXError(NimbleMTXError.Code.GET_NONCE_ERROR, "Error making Synergy getNonce request", e)); + } + } + + public void networkCallRecordPurchase(final GooglePlayTransaction googlePlayTransaction, final VerifyCallback verifyCallback) { + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_SYNERGY_VERIFICATION); + + SynergyNetwork + .getComponent() + .sendRequest( + new SynergyRequest(SYNERGY_API_VERIFY_AND_RECORD_GOOGLEPLAY_PURCHASE, IHttpRequest.Method.POST, (synergyRequest)->{ + String str; + String str2; + Map pidMap; + String gameSpecifiedPlayerId; + IApplicationEnvironment component = ApplicationEnvironment.getComponent(); + ISynergyEnvironment component2 = SynergyEnvironment.getComponent(); + ISynergyIdManager component3 = SynergyIdManager.getComponent(); + HashMap hashMap = new HashMap(); + boolean z = googlePlayTransaction.getCatalogItem() != null && googlePlayTransaction.getCatalogItem().isFree(); + hashMap.put("transactionId", googlePlayTransaction.getAdditionalInfo().get(GooglePlay.GOOGLEPLAY_ADDITIONALINFO_KEY_ORDERID)); + hashMap.put("price", (int) (googlePlayTransaction.getPriceDecimal() * 100.0f)); + hashMap.put("currency", googlePlayTransaction.getAdditionalInfo().get(SynergyCatalog.MTX_INFO_KEY_CURRENCY)); + hashMap.put("restore", googlePlayTransaction.getTransactionType() == NimbleMTXTransaction.TransactionType.RESTORE); + try { + hashMap.put("receipt", googlePlayTransaction.getAdditionalInfo().get(GooglePlay.GOOGLEPLAY_ADDITIONALINFO_KEY_PURCHASEDATA)); + } catch (Exception e) { + Log.Helper.LOGE(this, "Exception creating JSON body for /recordPurchase"); + hashMap.put("receipt", ""); + } + hashMap.put("itemSellId", googlePlayTransaction.getItemSku().substring(GooglePlay.this.m_synergyCatalog.getItemSkuPrefix().length())); + hashMap.put("masterSellId", component2.getSellId()); + hashMap.put("hwId", component2.getEAHardwareId()); + hashMap.put("signature", googlePlayTransaction.getReceipt()); + hashMap.put("nonce", googlePlayTransaction.getNonce()); + hashMap.put("isFree", z+""); + String synergyId = component3.getSynergyId(); + if (!(synergyId == null || synergyId == "")) { + hashMap.put("synergyUid", Utility.safeString(synergyId)); + } + HashMap hashMap2 = new HashMap(); + String string = Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id"); + if (!(component == null || (gameSpecifiedPlayerId = component.getGameSpecifiedPlayerId()) == null || gameSpecifiedPlayerId.length() <= 0)) { + hashMap.put("gamePlayerId", gameSpecifiedPlayerId); + } + String str3 = ""; + try { + String googleAdvertisingId = ApplicationEnvironment.getComponent().getGoogleAdvertisingId(); + str3 = googleAdvertisingId; + str = "true"; + str3 = googleAdvertisingId; + if (!ApplicationEnvironment.getComponent().isLimitAdTrackingEnabled()) { + str = "false"; + str3 = googleAdvertisingId; + } + } catch (Exception e2) { + Log.Helper.LOGW(this, "Exception when getting advertising ID for Android"); + str = "true"; + } + hashMap2.put("eaDeviceId", Utility.safeString(component2.getEADeviceId())); + hashMap2.put("androidId", Utility.safeString(string)); + hashMap2.put("advertiserId", Utility.safeString(str3)); + hashMap2.put("limitAdTracking", Utility.safeString(str)); + hashMap2.put("macHash", Utility.safeString(Utility.SHA256HashString(component.getMACAddress()))); + hashMap2.put("aut", Utility.safeString("")); + hashMap.put("didMap", Utility.convertObjectToJSONString(hashMap2)); + HashMap hashMap3 = new HashMap(); + hashMap3.put("timestamp", Utility.safeString(Utility.getUTCDateStringFormat(googlePlayTransaction.getTimeStamp()))); + hashMap3.put("bundleId", Utility.safeString(component.getApplicationBundleId())); + hashMap3.put("appName", Utility.safeString(component.getApplicationName())); + hashMap3.put("appVersion", Utility.safeString(component.getApplicationVersion())); + hashMap3.put("appLanguage", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); + hashMap3.put("countryCode", Utility.safeString(Locale.getDefault().getCountry())); + try { + Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); + ApplicationInfo applicationInfo = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), 128); + str2 = null; + if (applicationInfo.metaData != null) { + str2 = applicationInfo.metaData.getString("com.facebook.sdk.ApplicationId"); + } + } catch (PackageManager.NameNotFoundException e3) { + str2 = null; + } + if (Utility.validString(str2)) { + hashMap3.put("fbAppId", str2); + } + try { + Cursor query = ApplicationEnvironment.getComponent().getApplicationContext().getContentResolver().query(Uri.parse("content://com.facebook.katana.provider.AttributionIdProvider"), null, null, null, null); + if (query != null) { + query.moveToFirst(); + hashMap3.put("fbAttrId", query.getString(0)); + } + } catch (IllegalStateException e4) { + e4.printStackTrace(); + } catch (Exception e5) { + e5.printStackTrace(); + } + hashMap.put("appInfo", Utility.convertObjectToJSONString(hashMap3)); + HashMap hashMap4 = new HashMap(); + hashMap4.put("systemName", "Android"); + hashMap4.put("limitAdTracking", str); + PackageManager packageManager = component.getApplicationContext().getPackageManager(); + TelephonyManager telephonyManager = (TelephonyManager) component.getApplicationContext().getSystemService("phone"); + if (packageManager.checkPermission("android.permission.READ_PHONE_STATE", component.getApplicationContext().getPackageName()) == 0) { + hashMap4.put("imei", Utility.safeString(telephonyManager.getDeviceId())); + } + hashMap.put("deviceInfo", Utility.convertObjectToJSONString(hashMap4)); + hashMap.put("schemaVer", "2"); + hashMap.put("clientApiVersion", "2.0.0"); + synergyRequest.jsonData = hashMap; + synergyRequest.baseUrl = component2.getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_DRM); + synergyRequest.send(); + }), (synergyNetworkConnectionHandle)->{ + Exception error = synergyNetworkConnectionHandle.getResponse().getError(); + if (error == null) { + Log.Helper.LOGD(this, "recordPurchase response: " + synergyNetworkConnectionHandle.getResponse().getJsonData().toString()); + googlePlayTransaction.mIsRecorded = true; + } else if (error instanceof Error) { + Error error2 = (Error) error; + if (!(!error2.getDomain().equals(SynergyServerError.ERROR_DOMAIN) || error2.getCode() == SynergyServerError.Code.AMAZON_SERVER_CONNECTION_ERROR.intValue() || error2.getCode() == SynergyServerError.Code.APPLE_SERVER_CONNECTION_ERROR.intValue())) { + Log.Helper.LOGD(GooglePlay.this, "Transaction " + googlePlayTransaction.mTransactionId + " failed to record with error: " + error2); + googlePlayTransaction.mIsRecorded = true; + } + } + if (verifyCallback != null && ApplicationEnvironment.isMainApplicationRunning() && ApplicationEnvironment.getCurrentActivity() != null) { + verifyCallback.onVerificationComplete(error); + } + }); + } + + private class AnonClass1 implements SynergyRequest.SynergyRequestPreparingCallback{ + @Override + public void prepareRequest(SynergyRequest var1) { + + } + } + + public void onRestoreComplete(List list) { + boolean z = false; + HashMap hashMap = new HashMap<>(); + for (GooglePlayTransaction googlePlayTransaction : list) { + if (googlePlayTransaction.mError != null) { + Log.Helper.LOGE(this, "Error making recordPurchase call to Synergy: " + googlePlayTransaction.mError); + googlePlayTransaction.mFailedState = googlePlayTransaction.mGooglePlayTransactionState; + } + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.COMPLETE); + boolean z2 = false; + if (this.mCatalogItems != null) { + z2 = false; + if (this.mCatalogItems.size() > 0) { + GooglePlayCatalogItem googlePlayCatalogItem = this.mCatalogItems.get(googlePlayTransaction.getItemSku()); + z2 = false; + if (googlePlayCatalogItem != null) { + z2 = false; + if (googlePlayCatalogItem.getItemType() == NimbleCatalogItem.ItemType.CONSUMABLE) { + Log.Helper.LOGD(this, "Consumable transaction restored, sku: " + googlePlayCatalogItem.getSku()); + z2 = true; + for (GooglePlayTransaction googlePlayTransaction2 : findRecoveredTransactionsWithItemSku(googlePlayTransaction.getItemSku())) { + googlePlayTransaction2.mError = new NimbleMTXError(NimbleMTXError.Code.TRANSACTION_SUPERSEDED, "Transaction has been superseded by restored transaction"); + googlePlayTransaction2.mFailedState = googlePlayTransaction2.mGooglePlayTransactionState; + googlePlayTransaction2.mGooglePlayTransactionState = GooglePlayTransaction.GooglePlayTransactionState.COMPLETE; + } + } + } + } + } + if (z2) { + z = true; + this.mRecoveredTransactions.put(googlePlayTransaction.getTransactionId(), googlePlayTransaction); + googlePlayTransaction.mTransactionType = NimbleMTXTransaction.TransactionType.PURCHASE; + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT); + } else { + hashMap.put(googlePlayTransaction.getTransactionId(), googlePlayTransaction); + z = z; + if (!this.m_verificationEnabled) { + this.mUnrecordedTransactions.add(googlePlayTransaction); + this.m_transactionRecorder.recordTransactions(); + z = z; + } + } + this.mPendingTransactions.remove(googlePlayTransaction.getTransactionId()); + } + savePendingTransactionsToPersistence(); + this.mPurchasedTransactions = hashMap; + savePurchasedTransactionsToPersistence(); + saveUnrecordedTransactionsToPersistence(); + this.m_restoreInProgress = false; + Log.Helper.LOGD(this, "All RESTORE transactions processed. Raising REFRESH_PURCHASED_ITEMS_FINISHED notification."); + broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_RESTORE_PURCHASED_TRANSACTIONS_FINISHED, null, null, null); + if (z) { + broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_TRANSACTIONS_RECOVERED, null, null, null); + } + } + + public void restorePurchasedTransactionsImpl(boolean z) { + if (this.m_restoreInProgress) { + Log.Helper.LOGD(this, "restorePurchasedTransactions called while restore already in progress. Aborting."); + } else if (isTransactionPending(z)) { + Log.Helper.LOGD(this, "restorePurchasedTransactions called while transactions still pending."); + Log.Helper.LOGD(this, "pendingTransactions: " + this.mPendingTransactions); + Log.Helper.LOGD(this, "recoveredTransactions: " + this.mRecoveredTransactions); + broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_RESTORE_PURCHASED_TRANSACTIONS_FINISHED, "Can't restore purchases while transaction is pending", null, null); + } else { + Log.Helper.LOGD(this, "restorePurchasedTransactions called."); + this.m_restoreInProgress = true; + try { + this.mGooglePlayIabHelper.queryInventoryAsync(true, true, new IabHelper.QueryInventoryFinishedListener() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.4 + @Override // com.ea.nimble.mtx.googleplay.util.IabHelper.QueryInventoryFinishedListener + public void onQueryInventoryFinished(IabResult iabResult, Inventory inventory) { + Log.Helper.LOGD(this, "restorePurchasedTransactions onQueryInventoryFinished"); + GooglePlayError googlePlayError = null; + if (iabResult == null || iabResult.isFailure()) { + Log.Helper.LOGE(this, "Error with GooglePlay purchased item query. %s", iabResult.getMessage()); + googlePlayError = GooglePlay.this.createGooglePlayErrorFromIabResult(iabResult); + } + ArrayList arrayList = new ArrayList(); + if (!(inventory == null || inventory.getAllPurchases() == null)) { + for (Purchase purchase : inventory.getAllPurchases()) { + GooglePlayTransaction googlePlayTransaction = new GooglePlayTransaction(); + googlePlayTransaction.mTransactionType = NimbleMTXTransaction.TransactionType.RESTORE; + googlePlayTransaction.mTransactionId = GooglePlay.this.generateTransactionId(); + googlePlayTransaction.mItemSku = Utility.safeString(purchase.getSku()); + googlePlayTransaction.mNonce = Utility.safeString(purchase.getDeveloperPayload()); + googlePlayTransaction.mReceipt = Utility.safeString(purchase.getSignature()); + googlePlayTransaction.mAdditionalInfo = GooglePlay.this.createAdditionalInfoBundleFromIabPurchase(purchase); + googlePlayTransaction.mGooglePlayTransactionState = GooglePlayTransaction.GooglePlayTransactionState.UNDEFINED; + SkuDetails skuDetails = inventory.getSkuDetails(purchase.getSku()); + try { + googlePlayTransaction.mPriceDecimal = Float.parseFloat(skuDetails.getPriceMicros()) / 1000000.0f; + } catch (NullPointerException e) { + Log.Helper.LOGE(this, "Error: got passed a null pointer when trying to parse the catalog prices."); + googlePlayTransaction.mPriceDecimal = BitmapDescriptorFactory.HUE_RED; + } catch (NumberFormatException e2) { + Log.Helper.LOGE(this, "Error: got passed an invalid float string when trying to parse the catalog prices."); + googlePlayTransaction.mPriceDecimal = BitmapDescriptorFactory.HUE_RED; + } + googlePlayTransaction.mAdditionalInfo.put(SynergyCatalog.MTX_INFO_KEY_CURRENCY, skuDetails.getCurrencyCode()); + googlePlayTransaction.mTimeStamp = new Date(); + arrayList.add(googlePlayTransaction); + } + } + if (arrayList.size() == 0) { + Log.Helper.LOGD(this, "No restored transactions to verify. Raising REFRESH_PURCHASED_ITEMS_FINISHED notification."); + GooglePlay.this.m_restoreInProgress = false; + GooglePlay.this.broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_RESTORE_PURCHASED_TRANSACTIONS_FINISHED, googlePlayError != null ? googlePlayError.getMessage() : null, null, null); + } else if (GooglePlay.this.m_verificationEnabled) { + new RestoreTransactionVerifier().verifyTransactions(arrayList); + } else { + GooglePlay.this.onRestoreComplete(arrayList); + } + } + }); + } catch (IllegalStateException e) { + this.m_restoreInProgress = false; + Log.Helper.LOGD(this, "IAB Helper not setup. Check for Google Play account"); + broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_RESTORE_PURCHASED_TRANSACTIONS_FINISHED, "ERROR_IAB_NULL", null, null); + } + } + } + + private void saveCatalogToPersistence() { + HashMap hashMap = new HashMap(this.mCatalogItems); + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(COMPONENT_ID, Persistence.Storage.DOCUMENT); + Log.Helper.LOGD(this, "Saving %d catalog items to persistence.", Integer.valueOf(hashMap.size())); + persistenceForNimbleComponent.setValue(PERSISTENCE_CATALOG_ITEMS, hashMap); + this.m_cacheTimestamp = Long.valueOf(System.currentTimeMillis()); + persistenceForNimbleComponent.setValue(CACHE_TIMESTAMP_KEY, this.m_cacheTimestamp); + persistenceForNimbleComponent.synchronize(); + } + + private void savePendingTransactionsToPersistence() { + HashMap hashMap = new HashMap(this.mPendingTransactions); + HashMap hashMap2 = new HashMap(this.mRecoveredTransactions); + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(COMPONENT_ID, Persistence.Storage.DOCUMENT); + Log.Helper.LOGD(this, "Saving %d pending and %d previously recovered transactions to persistence.", Integer.valueOf(hashMap.size()), Integer.valueOf(hashMap2.size())); + persistenceForNimbleComponent.setValue(PERSISTENCE_PENDING_TRANSACTIONS, hashMap); + persistenceForNimbleComponent.setValue(PERSISTENCE_RECOVERED_TRANSACTIONS, hashMap2); + persistenceForNimbleComponent.synchronize(); + } + + private void savePurchasedTransactionsToPersistence() { + HashMap hashMap = new HashMap(this.mPurchasedTransactions); + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(COMPONENT_ID, Persistence.Storage.DOCUMENT); + Log.Helper.LOGD(this, "Saving %d purchased transactions to persistence.", Integer.valueOf(hashMap.size())); + persistenceForNimbleComponent.setValue(PERSISTENCE_PURCHASED_TRANSACTIONS, hashMap); + persistenceForNimbleComponent.synchronize(); + } + + public void saveUnrecordedTransactionsToPersistence() { + ArrayList arrayList = new ArrayList(this.mUnrecordedTransactions); + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(COMPONENT_ID, Persistence.Storage.DOCUMENT); + Log.Helper.LOGD(this, "Saving %d unrecorded transactions to persistence.", Integer.valueOf(arrayList.size())); + persistenceForNimbleComponent.setValue(PERSISTENCE_UNRECORDED_TRANSACTIONS, arrayList); + persistenceForNimbleComponent.synchronize(); + } + + public void updateGooglePlayTransactionRecordState(GooglePlayTransaction googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState googlePlayTransactionState) { + googlePlayTransaction.mGooglePlayTransactionState = googlePlayTransactionState; + googlePlayTransaction.mTimeStamp = new Date(); + savePendingTransactionsToPersistence(); + } + + public boolean updateTransactionRecordWithNonce(GooglePlayTransaction googlePlayTransaction, String str, Error error) { + NimbleMTXError nimbleMTXError; + if (error != null || str == null || str.length() == 0) { + if (error != null) { + Log.Helper.LOGE(this, "Error making getNonce call to Synergy: " + error); + nimbleMTXError = new NimbleMTXError(NimbleMTXError.Code.VERIFICATION_ERROR, "Synergy getNonce error", error); + } else { + Log.Helper.LOGE(this, "No nonce in Synergy response for getNonce."); + nimbleMTXError = new NimbleMTXError(NimbleMTXError.Code.VERIFICATION_ERROR, "No nonce in Synergy response"); + } + if (googlePlayTransaction != null) { + googlePlayTransaction.mError = nimbleMTXError; + googlePlayTransaction.mFailedState = googlePlayTransaction.mGooglePlayTransactionState; + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.COMPLETE); + return false; + } + Log.Helper.LOGE(this, "No transaction record in getNonce error handling. No callback to call."); + return false; + } + googlePlayTransaction.mNonce = str; + return true; + } + + @Override // com.ea.nimble.Component + public void cleanup() { + Log.Helper.LOGD(this, "Component cleanup"); + if (this.mGooglePlayIabHelper != null) { + this.mGooglePlayIabHelper.dispose(); + this.mGooglePlayIabHelper = null; + } + ApplicationLifecycle.getComponent().unregisterActivityEventCallbacks(this); + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public Error finalizeTransaction(String str, INimbleMTX.FinalizeTransactionCallback finalizeTransactionCallback) { + Component component; + boolean z = true; + GooglePlayTransaction googlePlayTransaction = this.mPendingTransactions.get(str); + if (googlePlayTransaction == null) { + String str2 = "Could not find transaction by Id to perform finalize, id: " + str; + Log.Helper.LOGE(this, str2); + return new NimbleMTXError(NimbleMTXError.Code.UNRECOGNIZED_TRANSACTION_ID, str2); + } + if (googlePlayTransaction.mGooglePlayTransactionState != GooglePlayTransaction.GooglePlayTransactionState.COMPLETE) { + Log.Helper.LOGW(this, "Finalize called on unfinished transaction, for sku, %s.", googlePlayTransaction.getItemSku()); + } + googlePlayTransaction.mFinalizeCallback = finalizeTransactionCallback; + if (googlePlayTransaction.getError() == null && (component = Base.getComponent(Tracking.COMPONENT_ID)) != null) { + ITracking iTracking = (ITracking) component; + HashMap hashMap = new HashMap(); + hashMap.put(Tracking.KEY_MTX_SELLID, googlePlayTransaction.getItemSku()); + hashMap.put(Tracking.KEY_MTX_PRICE, String.valueOf(googlePlayTransaction.getPriceDecimal())); + if (googlePlayTransaction.getAdditionalInfo().get(SynergyCatalog.MTX_INFO_KEY_CURRENCY) != null) { + hashMap.put(Tracking.KEY_MTX_CURRENCY, googlePlayTransaction.getAdditionalInfo().get(SynergyCatalog.MTX_INFO_KEY_CURRENCY).toString()); + } else { + Log.Helper.LOGD(this, "Currency information not currently available; using local currency instead."); + hashMap.put(Tracking.KEY_MTX_CURRENCY, Currency.getInstance(Locale.getDefault()).toString()); + } + iTracking.logEvent(Tracking.EVENT_MTX_ITEM_PURCHASED, hashMap); + } + this.mPendingTransactions.remove(str); + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.COMPLETE); + if (googlePlayTransaction.getError() == null) { + this.mPurchasedTransactions.put(str, googlePlayTransaction); + savePurchasedTransactionsToPersistence(); + } + if (googlePlayTransaction.mIsRecorded || googlePlayTransaction.mError != null) { + z = false; + } + if (z) { + this.mUnrecordedTransactions.add(googlePlayTransaction); + saveUnrecordedTransactionsToPersistence(); + } + if (googlePlayTransaction.mFinalizeCallback != null) { + googlePlayTransaction.mFinalizeCallback.finalizeComplete(googlePlayTransaction); + } + if (!z) { + return null; + } + this.m_transactionRecorder.recordTransactions(); + return null; + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public List getAvailableCatalogItems() { + if (this.mCatalogItems == null || isCacheExpired()) { + return null; + } + ArrayList arrayList = new ArrayList(this.mCatalogItems.values()); + Collections.sort(arrayList, new Comparator() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.1SkuComparator + public int compare(NimbleCatalogItem nimbleCatalogItem, NimbleCatalogItem nimbleCatalogItem2) { + return nimbleCatalogItem.getSku().compareTo(nimbleCatalogItem2.getSku()); + } + }); + return arrayList; + } + + @Override // com.ea.nimble.Component + public String getComponentId() { + return COMPONENT_ID; + } + + @Override // com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "MTX Google"; + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public List getPendingTransactions() { + if (this.mPendingTransactions == null) { + return null; + } + return new ArrayList(this.mPendingTransactions.values()); + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public List getPurchasedTransactions() { + return new ArrayList(this.mPurchasedTransactions.values()); + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public List getRecoveredTransactions() { + if (this.mRecoveredTransactions == null) { + return null; + } + return new ArrayList(this.mRecoveredTransactions.values()); + } + + public NimbleMTXTransaction getTransaction(String str) { + if (this.mPendingTransactions == null) { + return null; + } + return this.mPendingTransactions.get(str); + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public Error itemGranted(String str, NimbleCatalogItem.ItemType itemType, INimbleMTX.ItemGrantedCallback itemGrantedCallback) { + GooglePlayTransaction googlePlayTransaction = this.mPendingTransactions.get(str); + if (googlePlayTransaction == null) { + Log.Helper.LOGE(this, "Could not find transaction by Id to perform item grant, id: " + str); + return new NimbleMTXError(NimbleMTXError.Code.UNRECOGNIZED_TRANSACTION_ID, "Could not find transaction to perform item grant."); + } + if (googlePlayTransaction.mGooglePlayTransactionState != GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT) { + Log.Helper.LOGW(this, "Transaction in unexpected state for item grant. Transaction state: %s", googlePlayTransaction.mGooglePlayTransactionState); + } + if (itemGrantedCallback == null) { + Log.Helper.LOGE(this, "itemGranted called with empty callback parameter."); + return new Error(Error.Code.MISSING_CALLBACK, "Missing callback in itemGranted call."); + } + googlePlayTransaction.mItemGrantedCallback = itemGrantedCallback; + if (!(googlePlayTransaction.mCatalogItem == null || googlePlayTransaction.mCatalogItem.getItemType() != NimbleCatalogItem.ItemType.CONSUMABLE || itemType == NimbleCatalogItem.ItemType.CONSUMABLE)) { + Log.Helper.LOGW(this, "Game called item grant for SKU, %s, and indicated NOT consumable, though cached catalog data indicates the item is a consumable.", googlePlayTransaction.getItemSku()); + } + if (googlePlayTransaction.getError() != null) { + Log.Helper.LOGW(this, "Transaction for item SKU, %s, granted by game, despite an error. Clearing error from transaction.", googlePlayTransaction.getItemSku()); + googlePlayTransaction.mError = null; + } + if (itemType == NimbleCatalogItem.ItemType.CONSUMABLE) { + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GOOGLEPLAY_CONSUMPTION); + googlePlayConsumeItem(googlePlayTransaction); + return null; + } + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.COMPLETE); + deferredConsumeCallback(googlePlayTransaction.mItemGrantedCallback, googlePlayTransaction); + return null; + } + + public void networkCallGetAvailableItems() { + try { + this.m_synergyCatalog.getItemCatalog(new SynergyCatalog.ItemCallback() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.5 + @Override // com.ea.nimble.mtx.catalog.synergy.SynergyCatalog.ItemCallback + public void callback(List list, Exception exc) { + if (exc == null) { + LinkedList linkedList = new LinkedList(); + for (SynergyCatalogItem synergyCatalogItem : list) { + GooglePlayCatalogItem googlePlayCatalogItem = new GooglePlayCatalogItem(); + googlePlayCatalogItem.mItemType = synergyCatalogItem.getItemType(); + googlePlayCatalogItem.mAdditionalInfo = synergyCatalogItem.getAdditionalInfo(); + googlePlayCatalogItem.mDescription = synergyCatalogItem.getDescription(); + googlePlayCatalogItem.mSku = synergyCatalogItem.getSku(); + googlePlayCatalogItem.mTitle = synergyCatalogItem.getTitle(); + googlePlayCatalogItem.mUrl = synergyCatalogItem.getMetaDataUrl(); + googlePlayCatalogItem.mIsFree = synergyCatalogItem.isFree(); + linkedList.add(googlePlayCatalogItem); + } + if (Base.getConfiguration() != NimbleConfiguration.LIVE) { + GooglePlayCatalogItem googlePlayCatalogItem2 = new GooglePlayCatalogItem(); + googlePlayCatalogItem2.mSku = "android.test.purchased"; + googlePlayCatalogItem2.mTitle = "GP Purchased"; + googlePlayCatalogItem2.mDescription = "GP Purchased Desc"; + googlePlayCatalogItem2.mUrl = ""; + googlePlayCatalogItem2.mItemType = NimbleCatalogItem.ItemType.NONCONSUMABLE; + linkedList.add(googlePlayCatalogItem2); + GooglePlayCatalogItem googlePlayCatalogItem3 = new GooglePlayCatalogItem(); + googlePlayCatalogItem3.mSku = "android.test.canceled"; + googlePlayCatalogItem3.mTitle = "GP Canceled"; + googlePlayCatalogItem3.mDescription = "GP Canceled Desc"; + googlePlayCatalogItem3.mUrl = ""; + googlePlayCatalogItem3.mItemType = NimbleCatalogItem.ItemType.NONCONSUMABLE; + linkedList.add(googlePlayCatalogItem3); + GooglePlayCatalogItem googlePlayCatalogItem4 = new GooglePlayCatalogItem(); + googlePlayCatalogItem4.mSku = "android.test.refunded"; + googlePlayCatalogItem4.mTitle = "GP Refunded"; + googlePlayCatalogItem4.mDescription = "GP Refunded Desc"; + googlePlayCatalogItem4.mUrl = ""; + googlePlayCatalogItem4.mItemType = NimbleCatalogItem.ItemType.NONCONSUMABLE; + linkedList.add(googlePlayCatalogItem4); + GooglePlayCatalogItem googlePlayCatalogItem5 = new GooglePlayCatalogItem(); + googlePlayCatalogItem5.mSku = "android.test.item_unavailable"; + googlePlayCatalogItem5.mTitle = "GP Unavailable"; + googlePlayCatalogItem5.mDescription = "GP Unavailable Desc"; + googlePlayCatalogItem5.mUrl = ""; + googlePlayCatalogItem5.mItemType = NimbleCatalogItem.ItemType.NONCONSUMABLE; + linkedList.add(googlePlayCatalogItem5); + } + GooglePlay.this.getGooglePlayPricingForPendingCatalogItems(linkedList); + return; + } + Log.Helper.LOGE(this, "GetAvailableItems error: " + exc.toString()); + GooglePlay.this.broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_REFRESH_CATALOG_FINISHED, "Error making Synergy getAvailableItems call.", null, null); + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks + public void onActivityResult(Activity activity, int i, int i2, Intent intent) { + Log.Helper.LOGD(this, "onActivityResult"); + if (this.mGooglePlayIabHelper == null || !this.mGooglePlayIabHelper.isServiceAvailable()) { + Log.Helper.LOGE(this, "GooglePlayIabHelper is not created or service is not currently available!"); + } else { + this.mGooglePlayIabHelper.handleActivityResult(i, i2, intent); + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks + public boolean onBackPressed() { + return true; + } + + public void onGooglePlayCatalogItemsRefreshed(List list, boolean z, Exception exc) { + if (exc == null) { + Log.Helper.LOGD(this, "GooglePlayCatalog Updated."); + if (z) { + this.mCatalogItems.clear(); + } + for (GooglePlayCatalogItem googlePlayCatalogItem : list) { + this.mCatalogItems.put(googlePlayCatalogItem.getSku(), googlePlayCatalogItem); + } + saveCatalogToPersistence(); + } else { + Log.Helper.LOGE(this, "Error updating GooglePlay Catalog: " + exc); + } + broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_REFRESH_CATALOG_FINISHED, exc != null ? exc.toString() : null, null, null); + } + + @Override // com.ea.nimble.mtx.googleplay.util.IabHelper.OnIabPurchaseFinishedListener + public void onIabPurchaseFinished(IabResult iabResult, Purchase purchase) { + GooglePlayTransaction googlePlayTransaction; + Log.Helper.LOGD(this, "IAB Purchase finished: " + iabResult + ", purchase: " + purchase); + GooglePlayTransaction googlePlayTransaction2 = null; + GooglePlayTransaction googlePlayTransaction3 = null; + if (purchase == null) { + Iterator it = this.mPendingTransactions.values().iterator(); + while (true) { + googlePlayTransaction = googlePlayTransaction2; + if (!it.hasNext()) { + break; + } + GooglePlayTransaction next = it.next(); + if (next.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GOOGLEPLAY_ACTIVITY_RESPONSE) { + if (googlePlayTransaction2 == null) { + googlePlayTransaction2 = next; + } else { + Log.Helper.LOGE(this, "More than one transaction record in WAITING_FOR_GOOGLE_PLAY_RESPONSE state found! Using: " + googlePlayTransaction2.getItemSku() + ". Additional transaction for: " + next.getItemSku()); + } + } + } + } else { + String developerPayload = purchase.getDeveloperPayload(); + String orderId = purchase.getOrderId(); + Iterator it2 = this.mPendingTransactions.values().iterator(); + while (true) { + googlePlayTransaction = googlePlayTransaction3; + if (!it2.hasNext()) { + break; + } + GooglePlayTransaction next2 = it2.next(); + if (!Utility.validString(next2.mDeveloperPayload) || !next2.mDeveloperPayload.equals(developerPayload)) { + if (!Utility.validString(orderId) && !Utility.validString(developerPayload) && next2.mItemSku.equals(purchase.getSku())) { + Log.Helper.LOGD(this, "Found a matching SKU for pending transaction without orderId or developer payload, this must be a code redemption!"); + if (googlePlayTransaction3 == null) { + googlePlayTransaction3 = next2; + } else { + Log.Helper.LOGE(this, "Multiple transactions that look like code redemptions found! Using the first one. TransactionA: " + googlePlayTransaction3.toString() + " TransactionB: " + next2.toString()); + } + } + } else if (googlePlayTransaction3 == null) { + googlePlayTransaction3 = next2; + } else { + Log.Helper.LOGE(this, "Multiple transactions with the same developerPayload found! Using the first one. TransactionA: " + googlePlayTransaction3.toString() + " TransactionB: " + next2.toString()); + } + } + } + if (googlePlayTransaction == null) { + Log.Helper.LOGE(this, "Transaction record could not be found for purchase"); + GooglePlayTransaction googlePlayTransaction4 = new GooglePlayTransaction(); + googlePlayTransaction4.mTransactionId = generateTransactionId(); + googlePlayTransaction4.mTransactionType = NimbleMTXTransaction.TransactionType.PURCHASE; + if (purchase == null || purchase.getSku() == null) { + Log.Helper.LOGE(this, "No pre-existing transaction record, Google Play activity result has no SKU. No way to recover."); + new NimbleMTXError(NimbleMTXError.Code.INTERNAL_STATE, "Unrecoverable purchase notification from GooglePlay. No SKU."); + return; + } + Log.Helper.LOGD(this, "No transaction record for this purchase, creating one now. ItemSku(" + purchase.getSku() + ")"); + googlePlayTransaction4.mDeveloperPayload = purchase.getDeveloperPayload(); + googlePlayTransaction4.mItemSku = purchase.getSku(); + googlePlayTransaction4.mAdditionalInfo = createAdditionalInfoBundleFromIabPurchase(purchase); + this.mPendingTransactions.put(googlePlayTransaction4.mTransactionId, googlePlayTransaction4); + } else if (iabResult == null || iabResult.isFailure()) { + NimbleMTXError nimbleMTXError = null; + if (iabResult != null) { + nimbleMTXError = null; + if (0 == 0) { + Log.Helper.LOGD(this, "Error purchasing: " + iabResult); + nimbleMTXError = createNimbleMTXErrorWithGooglePlayError(createGooglePlayErrorFromIabResult(iabResult), "GooglePlay purchase error"); + } + } + googlePlayTransaction.mError = nimbleMTXError; + googlePlayTransaction.mFailedState = googlePlayTransaction.mGooglePlayTransactionState; + Log.Helper.LOGD(this, "MTX_GOOGLE: Purchase error. Purchase object is: " + purchase); + googlePlayTransaction.mAdditionalInfo = createAdditionalInfoBundleFromIabPurchase(purchase); + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.COMPLETE); + if (googlePlayTransaction.mPurchaseCallback != null) { + try { + googlePlayTransaction.mPurchaseCallback.purchaseComplete(googlePlayTransaction); + } catch (Exception e) { + Log.Helper.LOGE(this, "MTX_GOOGLE: Unhandled exception in mPurchaseCallback: " + e); + e.printStackTrace(); + } + } + } else { + Log.Helper.LOGD(this, "GooglePlay Purchase successful."); + googlePlayTransaction.mReceipt = purchase.getSignature(); + if (googlePlayTransaction.mReceipt == null || googlePlayTransaction.mReceipt.length() == 0) { + Log.Helper.LOGW(this, "Purchase has an empty signature string. Setting to \"xxxxx\" for test."); + googlePlayTransaction.mReceipt = "xxxxxxxxxxxxxxxxxxxxxxxxx"; + } + googlePlayTransaction.mAdditionalInfo = createAdditionalInfoBundleFromIabPurchase(purchase); + GooglePlayCatalogItem catalogItemBySku = getCatalogItemBySku(purchase.getSku()); + if (catalogItemBySku != null) { + googlePlayTransaction.mPriceDecimal = catalogItemBySku.getPriceDecimal(); + Object obj = catalogItemBySku.getAdditionalInfo().get(SynergyCatalog.MTX_INFO_KEY_CURRENCY); + if (obj != null) { + googlePlayTransaction.mAdditionalInfo.put(SynergyCatalog.MTX_INFO_KEY_CURRENCY, obj.toString()); + } else { + Log.Helper.LOGD(this, "Currency information not currently available; using local currency instead."); + googlePlayTransaction.mAdditionalInfo.put(SynergyCatalog.MTX_INFO_KEY_CURRENCY, Currency.getInstance(Locale.getDefault()).toString()); + } + } else { + Log.Helper.LOGW(this, "Purchased item not found in catalog, could not get price or currency of item."); + } + if (this.m_verificationEnabled) { + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_SYNERGY_VERIFICATION); + if (googlePlayTransaction.mPurchaseCallback != null) { + googlePlayTransaction.mPurchaseCallback.unverifiedReceiptReceived(googlePlayTransaction); + } else { + Log.Helper.LOGE(this, "Transaction missing callback, cannot notify game of unverified receipt"); + } + new PurchaseTransactionVerifier().verifyTransaction(googlePlayTransaction); + return; + } + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT); + if (googlePlayTransaction.mPurchaseCallback != null) { + googlePlayTransaction.mPurchaseCallback.purchaseComplete(googlePlayTransaction); + } else { + Log.Helper.LOGE(this, "Transaction missing callback, cannot notify game of completed purchase"); + } + } + } + + @Override // com.ea.nimble.IApplicationLifecycle.ActivityEventCallbacks + public void onWindowFocusChanged(boolean z) { + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public Error purchaseItem(String str, INimbleMTX.PurchaseTransactionCallback purchaseTransactionCallback) { + if (this.mGooglePlayIabHelper == null || !this.mGooglePlayIabHelper.isServiceAvailable()) { + return new NimbleMTXError(NimbleMTXError.Code.BILLING_NOT_AVAILABLE, "IabHelper is not set up"); + } + if (purchaseTransactionCallback == null) { + return new Error(Error.Code.MISSING_CALLBACK, "Missing purchase callback"); + } + if (isTransactionPending()) { + Log.Helper.LOGD(this, "purchaseItem called while transactions still pending."); + Log.Helper.LOGD(this, "pendingTransactions: " + this.mPendingTransactions); + Log.Helper.LOGD(this, "recoveredTransactions: " + this.mRecoveredTransactions); + return new NimbleMTXError(NimbleMTXError.Code.TRANSACTION_PENDING, "Another transaction is still outstanding."); + } else if (this.m_restoreInProgress) { + Log.Helper.LOGD(this, "purchaseItem called while restore is in progress."); + return new NimbleMTXError(NimbleMTXError.Code.TRANSACTION_PENDING, "Can't purchase item while restore is in progress."); + } else { + String generateTransactionId = generateTransactionId(); + GooglePlayTransaction googlePlayTransaction = new GooglePlayTransaction(); + googlePlayTransaction.mItemSku = str; + googlePlayTransaction.mTransactionId = generateTransactionId; + googlePlayTransaction.mTransactionType = NimbleMTXTransaction.TransactionType.PURCHASE; + googlePlayTransaction.mPurchaseCallback = purchaseTransactionCallback; + GooglePlayCatalogItem googlePlayCatalogItem = this.mCatalogItems.get(str); + if (googlePlayCatalogItem != null) { + googlePlayTransaction.mCatalogItem = new GooglePlayCatalogItem(googlePlayCatalogItem); + } + this.mPendingTransactions.put(generateTransactionId, googlePlayTransaction); + updateGooglePlayTransactionRecordState(googlePlayTransaction, GooglePlayTransaction.GooglePlayTransactionState.USER_INITIATED); + Component component = Base.getComponent(Tracking.COMPONENT_ID); + if (component != null) { + ITracking iTracking = (ITracking) component; + HashMap hashMap = new HashMap(); + hashMap.put(Tracking.KEY_MTX_SELLID, googlePlayTransaction.getItemSku()); + iTracking.logEvent(Tracking.EVENT_MTX_ITEM_BEGIN_PURCHASE, hashMap); + } + googlePlayCallPurchaseItem(googlePlayTransaction); + return null; + } + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public void refreshAvailableCatalogItems() { + if (this.mGooglePlayIabHelper == null || !this.mGooglePlayIabHelper.isServiceAvailable()) { + Log.Helper.LOGW(this, "refreshAvailable returning because billing is unavailable"); + broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_REFRESH_CATALOG_FINISHED, String.valueOf(NimbleMTXError.Code.BILLING_NOT_AVAILABLE), null, null); + } else if (Network.getComponent().getStatus() != Network.Status.OK) { + Log.Helper.LOGW(this, "refreshAvailable returning because there is no network connection"); + broadcastLocalEvent(INimbleMTX.NIMBLE_NOTIFICATION_MTX_REFRESH_CATALOG_FINISHED, String.valueOf(Error.Code.NETWORK_NO_CONNECTION), null, null); + } else { + networkCallGetAvailableItems(); + } + } + + @Override // com.ea.nimble.Component + public void restore() { + Log.Helper.LOGD(this, "Component restore"); + this.m_synergyCatalog = new SynergyCatalog(SynergyCatalog.StoreType.GOOGLE); + loadFromPersistence(); + Utility.registerReceiver(Global.NOTIFICATION_LANGUAGE_CHANGE, new BroadcastReceiver() { // from class: com.ea.nimble.mtx.googleplay.GooglePlay.3 + @Override // android.content.BroadcastReceiver + public void onReceive(Context context, Intent intent) { + Log.Helper.LOGD(this, "refreshing catalog items after language change"); + GooglePlay.this.refreshAvailableCatalogItems(); + } + }); + ApplicationLifecycle.getComponent().registerActivityEventCallbacks(this); + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public void restorePurchasedTransactions() { + restorePurchasedTransactionsImpl(true); + } + + @Override // com.ea.nimble.Component + public void resume() { + Log.Helper.LOGD(this, "Component resume"); + if (!this.mGooglePlayIabHelper.isServiceAvailable()) { + this.mGooglePlayIabHelper.dispose(); + createIabHelper(); + } + for (GooglePlayTransaction googlePlayTransaction : this.mPendingTransactions.values()) { + if (googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_SYNERGY_VERIFICATION || googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_NONCE) { + new PurchaseTransactionVerifier().verifyTransaction(googlePlayTransaction); + } + } + this.m_transactionRecorder.recordTransactions(); + this.m_itemRestorer.restoreItems(); + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public Error resumeTransaction(String str, INimbleMTX.PurchaseTransactionCallback purchaseTransactionCallback, INimbleMTX.ItemGrantedCallback itemGrantedCallback, INimbleMTX.FinalizeTransactionCallback finalizeTransactionCallback) { + GooglePlayTransaction googlePlayTransaction; + Log.Helper.LOGV(this, "Resuming transaction id, %s.", Utility.safeString(str)); + if (str == null) { + return new NimbleMTXError(NimbleMTXError.Code.UNRECOGNIZED_TRANSACTION_ID, "Null transaction ID"); + } + if (this.m_restoreInProgress) { + Log.Helper.LOGD(this, "resumeTransaction called while restore is in progress."); + return new NimbleMTXError(NimbleMTXError.Code.TRANSACTION_PENDING, "Can't resume transaction while restore is in progress."); + } + if (this.mPendingTransactions.size() > 0) { + GooglePlayTransaction googlePlayTransaction2 = this.mPendingTransactions.get(str); + if (googlePlayTransaction2 == null) { + Log.Helper.LOGD(this, "Resume called while transactions are pending: " + this.mPendingTransactions); + return new NimbleMTXError(NimbleMTXError.Code.TRANSACTION_PENDING, "Another transaction is pending. It needs to finish and finalize first."); + } else if (googlePlayTransaction2.mError == null) { + return new Error(Error.Code.INVALID_ARGUMENT, "Cannot resume a pending transaction with no error"); + } else { + googlePlayTransaction = googlePlayTransaction2; + if (googlePlayTransaction2.mTransactionType == NimbleMTXTransaction.TransactionType.RESTORE) { + return new NimbleMTXError(NimbleMTXError.Code.TRANSACTION_NOT_RESUMABLE, "Cannot resume a restore transaction. Only Purchase transactions can be resumed."); + } + } + } else { + googlePlayTransaction = this.mRecoveredTransactions.remove(str); + if (googlePlayTransaction == null) { + return new NimbleMTXError(NimbleMTXError.Code.UNRECOGNIZED_TRANSACTION_ID, "No transaction for given transaction ID."); + } + if (googlePlayTransaction.mTransactionType == NimbleMTXTransaction.TransactionType.RESTORE) { + return new NimbleMTXError(NimbleMTXError.Code.TRANSACTION_NOT_RESUMABLE, "Cannot resume a restore transaction. Only Purchase transactions can be resumed."); + } + this.mPendingTransactions.put(googlePlayTransaction.getTransactionId(), googlePlayTransaction); + } + if (googlePlayTransaction.mError != null && (!(googlePlayTransaction.mError instanceof Error) || ((Error) googlePlayTransaction.mError).getCode() != NimbleMTXError.Code.TRANSACTION_SUPERSEDED.intValue())) { + Log.Helper.LOGD(this, "Resuming transaction that failed in state " + googlePlayTransaction.mFailedState + " with error " + googlePlayTransaction.mError); + googlePlayTransaction.mGooglePlayTransactionState = googlePlayTransaction.mFailedState; + googlePlayTransaction.mFailedState = null; + googlePlayTransaction.mError = null; + } + if (googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.USER_INITIATED || googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GOOGLEPLAY_ACTIVITY_RESPONSE) { + googlePlayTransaction.mFailedState = googlePlayTransaction.mGooglePlayTransactionState; + googlePlayTransaction.mGooglePlayTransactionState = GooglePlayTransaction.GooglePlayTransactionState.COMPLETE; + googlePlayTransaction.mError = new NimbleMTXError(NimbleMTXError.Code.NON_CRITICAL_INTERRUPTION, "MTX transaction interrupted before account charged."); + } + googlePlayTransaction.mPurchaseCallback = purchaseTransactionCallback; + googlePlayTransaction.mFinalizeCallback = finalizeTransactionCallback; + googlePlayTransaction.mItemGrantedCallback = itemGrantedCallback; + savePendingTransactionsToPersistence(); + if (googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_NONCE || googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_SYNERGY_VERIFICATION) { + new PurchaseTransactionVerifier().verifyTransaction(googlePlayTransaction); + return null; + } else if (googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT) { + if (googlePlayTransaction.mPurchaseCallback == null) { + return new Error(Error.Code.MISSING_CALLBACK, "Resumed transaction not given purchase callback."); + } + googlePlayTransaction.mPurchaseCallback.purchaseComplete(googlePlayTransaction); + return null; + } else if (googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.WAITING_FOR_GOOGLEPLAY_CONSUMPTION) { + if (googlePlayTransaction.mItemGrantedCallback == null) { + return new Error(Error.Code.MISSING_CALLBACK, "Resumed transaction not given item granted callback."); + } + googlePlayConsumeItem(googlePlayTransaction); + return null; + } else if (googlePlayTransaction.mGooglePlayTransactionState == GooglePlayTransaction.GooglePlayTransactionState.COMPLETE) { + finalizeTransaction(str, googlePlayTransaction.mFinalizeCallback); + return null; + } else { + Log.Helper.LOGE(this, "ResumeTransaction called on a transaction that can't be resumed: " + googlePlayTransaction); + return new NimbleMTXError(NimbleMTXError.Code.TRANSACTION_NOT_RESUMABLE, "Transaction not in a resumable state."); + } + } + + @Override // com.ea.nimble.mtx.INimbleMTX + public void setPlatformParameters(Map map) { + String str; + if (map != null && (str = map.get(GOOGLEPLAY_PLATFORM_PARAMETER_APPLICATION_PUBLIC_KEY)) != null) { + this.m_appPublicKey = str; + if (this.mGooglePlayIabHelper != null) { + this.mGooglePlayIabHelper.setApplicationPublicKey(this.m_appPublicKey); + } + } + } + + @Override // com.ea.nimble.Component + public void setup() { + Log.Helper.LOGD(this, "Component setup"); + if (this.mGooglePlayIabHelper == null) { + createIabHelper(); + } + try { + if ("false".equalsIgnoreCase(ApplicationEnvironment.getCurrentActivity().getPackageManager().getApplicationInfo(ApplicationEnvironment.getCurrentActivity().getPackageName(), 128).metaData.getString("com.ea.nimble.mtx.enableVerification"))) { + this.m_verificationEnabled = false; + return; + } + } catch (PackageManager.NameNotFoundException e) { + } + this.m_verificationEnabled = true; + } + + @Override // com.ea.nimble.Component + public void suspend() { + Log.Helper.LOGD(this, "Component suspend"); + this.m_transactionRecorder.cancel(); + this.m_itemRestorer.cancel(); + } + + @Override // com.ea.nimble.Component + public void teardown() { + this.m_transactionRecorder.cancel(); + this.m_itemRestorer.cancel(); + } +} diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayCatalogItem.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayCatalogItem.java new file mode 100644 index 0000000..5b1a133 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayCatalogItem.java @@ -0,0 +1,123 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.googleplay; + +import com.ea.nimble.mtx.NimbleCatalogItem; +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.HashMap; +import java.util.Map; + +public class GooglePlayCatalogItem +extends NimbleCatalogItem +implements Externalizable { + Map mAdditionalInfo; + String mDescription; + boolean mIsFree; + NimbleCatalogItem.ItemType mItemType; + float mPriceDecimal; + String mPriceWithCurrencyAndFormat; + String mSku; + String mTitle; + String mUrl; + + public GooglePlayCatalogItem() { + this.mSku = ""; + this.mTitle = ""; + this.mDescription = ""; + this.mPriceDecimal = 0.0f; + this.mPriceWithCurrencyAndFormat = ""; + this.mItemType = NimbleCatalogItem.ItemType.UNKNOWN; + this.mUrl = ""; + this.mIsFree = false; + this.mAdditionalInfo = new HashMap(); + } + + public GooglePlayCatalogItem(GooglePlayCatalogItem googlePlayCatalogItem) { + this.mSku = new String(googlePlayCatalogItem.mSku); + this.mTitle = new String(googlePlayCatalogItem.mTitle); + this.mDescription = new String(googlePlayCatalogItem.mDescription); + this.mPriceDecimal = googlePlayCatalogItem.mPriceDecimal; + this.mPriceWithCurrencyAndFormat = new String(googlePlayCatalogItem.mPriceWithCurrencyAndFormat); + this.mItemType = googlePlayCatalogItem.mItemType; + this.mUrl = new String(googlePlayCatalogItem.mUrl); + this.mIsFree = googlePlayCatalogItem.mIsFree; + this.mAdditionalInfo = new HashMap(googlePlayCatalogItem.mAdditionalInfo); + } + + @Override + public Map getAdditionalInfo() { + return this.mAdditionalInfo; + } + + @Override + public String getDescription() { + return this.mDescription; + } + + @Override + public NimbleCatalogItem.ItemType getItemType() { + return this.mItemType; + } + + @Override + public String getMetaDataUrl() { + return this.mUrl; + } + + @Override + public float getPriceDecimal() { + return this.mPriceDecimal; + } + + @Override + public String getPriceWithCurrencyAndFormat() { + return this.mPriceWithCurrencyAndFormat; + } + + @Override + public String getSku() { + return this.mSku; + } + + @Override + public String getTitle() { + return this.mTitle; + } + + public boolean isFree() { + return this.mIsFree; + } + + @Override + public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException { + this.mSku = objectInput.readUTF(); + this.mTitle = objectInput.readUTF(); + this.mDescription = objectInput.readUTF(); + this.mPriceDecimal = objectInput.readFloat(); + this.mPriceWithCurrencyAndFormat = objectInput.readUTF(); + this.mItemType = (NimbleCatalogItem.ItemType)((Object)objectInput.readObject()); + this.mIsFree = objectInput.readBoolean(); + this.mAdditionalInfo = (Map)objectInput.readObject(); + } + + public String toString() { + return "SKU(" + this.mSku + ") Title(" + this.mTitle + ") Price(" + this.mPriceDecimal + ") Currency(" + this.mAdditionalInfo.get("localCurrency") + ") PriceStr(" + this.mPriceWithCurrencyAndFormat + ") ItemType(" + (Object)((Object)this.mItemType) + ")"; + } + + @Override + public void writeExternal(ObjectOutput objectOutput) throws IOException { + objectOutput.writeUTF(this.mSku); + objectOutput.writeUTF(this.mTitle); + objectOutput.writeUTF(this.mDescription); + objectOutput.writeFloat(this.mPriceDecimal); + objectOutput.writeUTF(this.mPriceWithCurrencyAndFormat); + objectOutput.writeObject((Object)this.mItemType); + objectOutput.writeBoolean(this.mIsFree); + objectOutput.writeObject(this.mAdditionalInfo); + } +} + 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 new file mode 100644 index 0000000..53f4e91 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayError.java @@ -0,0 +1,55 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.googleplay; + +import com.ea.nimble.Error; + +class GooglePlayError +extends Error { + public static final String ERROR_DOMAIN = "GooglePlayError"; + private static final long serialVersionUID = 1L; + + public GooglePlayError() { + } + + public GooglePlayError(Code code, String string2) { + super(ERROR_DOMAIN, code.intValue(), string2, null); + } + + public GooglePlayError(Code code, String string2, Throwable throwable) { + super(ERROR_DOMAIN, code.intValue(), string2, throwable); + } + + public static enum Code { + BILLING_RESPONSE_RESULT_USER_CANCELED(1), + BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE(3), + BILLING_RESPONSE_RESULT_ITEM_UNAVAILABLE(4), + BILLING_RESPONSE_RESULT_DEVELOPER_ERROR(5), + BILLING_RESPONSE_RESULT_ERROR(6), + BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED(7), + BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED(8), + IABHELPER_ERROR_BASE(-1000), + IABHELPER_REMOTE_EXCEPTION(-1001), + IABHELPER_BAD_RESPONSE(-1002), + IABHELPER_VERIFICATION_FAILED(-1003), + IABHELPER_SEND_INTENT_FAILED(-1004), + IABHELPER_USER_CANCELLED(-1005), + IABHELPER_UNKNOWN_PURCHASE_RESPONSE(-1006), + IABHELPER_MISSING_TOKEN(-1007), + IABHELPER_BAD_STATE_ERROR(-1008), + IABHELPER_UNKNOWN_ERROR(-1009), + UNKNOWN(10003); + + private int m_value; + + private Code(int n3) { + this.m_value = n3; + } + + public int intValue() { + return this.m_value; + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayNetworkConnectionCallback.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayNetworkConnectionCallback.java new file mode 100644 index 0000000..1309761 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayNetworkConnectionCallback.java @@ -0,0 +1,25 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.googleplay; + +import com.ea.nimble.NetworkConnectionCallback; +import com.ea.nimble.NetworkConnectionHandle; +import com.ea.nimble.mtx.googleplay.GooglePlay; + +public abstract class GooglePlayNetworkConnectionCallback +implements NetworkConnectionCallback { + String mParameter; + GooglePlay mParentGooglePlay; + String mTransactionId; + + public GooglePlayNetworkConnectionCallback(GooglePlay googlePlay, String string2, String string3) { + this.mParentGooglePlay = googlePlay; + this.mTransactionId = string2; + this.mParameter = string3; + } + + @Override + public abstract void callback(NetworkConnectionHandle var1); +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayTransaction.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayTransaction.java new file mode 100644 index 0000000..d1e6447 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/GooglePlayTransaction.java @@ -0,0 +1,192 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.googleplay; + +import com.ea.nimble.Error; +import com.ea.nimble.Utility; +import com.ea.nimble.mtx.INimbleMTX; +import com.ea.nimble.mtx.NimbleMTXTransaction; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class GooglePlayTransaction +implements NimbleMTXTransaction, +Externalizable { + Map mAdditionalInfo; + GooglePlayCatalogItem mCatalogItem = null; + String mDeveloperPayload = ""; + Exception mError = null; + GooglePlayTransactionState mFailedState = null; + INimbleMTX.FinalizeTransactionCallback mFinalizeCallback = null; + GooglePlayTransactionState mGooglePlayTransactionState = GooglePlayTransactionState.UNDEFINED; + boolean mIsRecorded = false; + INimbleMTX.ItemGrantedCallback mItemGrantedCallback = null; + String mItemSku = ""; + String mNonce = ""; + float mPriceDecimal = 0.0f; + INimbleMTX.PurchaseTransactionCallback mPurchaseCallback = null; + String mReceipt = ""; + Date mTimeStamp = null; + String mTransactionId = ""; + NimbleMTXTransaction.TransactionType mTransactionType = NimbleMTXTransaction.TransactionType.PURCHASE; + + public GooglePlayTransaction() { + this.mAdditionalInfo = new HashMap(); + } + + @Override + public Map getAdditionalInfo() { + return new HashMap(this.mAdditionalInfo); + } + + public GooglePlayCatalogItem getCatalogItem() { + return this.mCatalogItem; + } + + public String getDeveloperPayload() { + return this.mDeveloperPayload; + } + + @Override + public Exception getError() { + return this.mError; + } + + @Override + public String getItemSku() { + return this.mItemSku; + } + + public String getNonce() { + return this.mNonce; + } + + @Override + public float getPriceDecimal() { + return this.mPriceDecimal; + } + + @Override + public String getReceipt() { + return this.mReceipt; + } + + @Override + public Date getTimeStamp() { + return this.mTimeStamp; + } + + @Override + public String getTransactionId() { + return this.mTransactionId; + } + + @Override + public NimbleMTXTransaction.TransactionState getTransactionState() { + switch (this.mGooglePlayTransactionState.ordinal()) { + default: { + return NimbleMTXTransaction.TransactionState.UNDEFINED; + } + case 1: { + return NimbleMTXTransaction.TransactionState.USER_INITIATED; + } + case 2: { + return NimbleMTXTransaction.TransactionState.WAITING_FOR_PREPURCHASE_INFO; + } + case 3: { + return NimbleMTXTransaction.TransactionState.WAITING_FOR_PLATFORM_RESPONSE; + } + case 4: { + return NimbleMTXTransaction.TransactionState.WAITING_FOR_VERIFICATION; + } + case 5: { + return NimbleMTXTransaction.TransactionState.WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT; + } + case 6: { + return NimbleMTXTransaction.TransactionState.WAITING_FOR_PLATFORM_CONSUMPTION; + } + case 7: { + return NimbleMTXTransaction.TransactionState.COMPLETE; + } + case 8: + } + return NimbleMTXTransaction.TransactionState.UNDEFINED; + } + + @Override + public NimbleMTXTransaction.TransactionType getTransactionType() { + return this.mTransactionType; + } + + @Override + public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException { + this.mTransactionId = objectInput.readUTF(); + this.mItemSku = objectInput.readUTF(); + this.mGooglePlayTransactionState = (GooglePlayTransactionState)((Object)objectInput.readObject()); + this.mTransactionType = (NimbleMTXTransaction.TransactionType)((Object)objectInput.readObject()); + this.mPriceDecimal = objectInput.readFloat(); + this.mTimeStamp = (Date)objectInput.readObject(); + this.mReceipt = objectInput.readUTF(); + this.mNonce = objectInput.readUTF(); + this.mError = (Error)objectInput.readObject(); + this.mCatalogItem = (GooglePlayCatalogItem)objectInput.readObject(); + this.mAdditionalInfo = (Map)objectInput.readObject(); + this.mDeveloperPayload = objectInput.readUTF(); + try { + this.mFailedState = (GooglePlayTransactionState)((Object)objectInput.readObject()); + this.mIsRecorded = objectInput.readBoolean(); + return; + } + catch (IOException iOException) { + return; + } + } + + public String toString() { + return "GooglePlayTransaction: SKU(" + this.getItemSku() + ") " + "State(" + this.mGooglePlayTransactionState.toString() + ") " + "Receipt(" + this.getReceipt() + ") " + "TimeStamp(" + this.getTimeStamp() + ")"; + } + + @Override + public void writeExternal(ObjectOutput objectOutput) throws IOException { + objectOutput.writeUTF(Utility.safeString(this.mTransactionId)); + objectOutput.writeUTF(Utility.safeString(this.mItemSku)); + objectOutput.writeObject((Object)this.mGooglePlayTransactionState); + objectOutput.writeObject((Object)this.mTransactionType); + objectOutput.writeFloat(this.mPriceDecimal); + objectOutput.writeObject(this.mTimeStamp); + objectOutput.writeUTF(Utility.safeString(this.mReceipt)); + objectOutput.writeUTF(Utility.safeString(this.mNonce)); + objectOutput.writeObject(this.mError); + objectOutput.writeObject(this.mCatalogItem); + objectOutput.writeObject(this.mAdditionalInfo); + objectOutput.writeUTF(Utility.safeString(this.mDeveloperPayload)); + objectOutput.writeObject((Object)this.mFailedState); + objectOutput.writeBoolean(this.mIsRecorded); + } + + public enum GooglePlayTransactionState { + UNDEFINED("UNDEFINED"), + USER_INITIATED("USER_INITIATED"), + WAITING_FOR_NONCE("WAITING_FOR_NONCE"), + WAITING_FOR_GOOGLEPLAY_ACTIVITY_RESPONSE("WAITING_FOR_GOOGLEPLAY_ACTIVITY_RESPONSE"), + WAITING_FOR_SYNERGY_VERIFICATION("WAITING_FOR_SYNERGY_VERIFICATION"), + WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT("WAITING_FOR_GAME_TO_CONFIRM_ITEM_GRANT"), + WAITING_FOR_GOOGLEPLAY_CONSUMPTION("WAITING_FOR_GOOGLEPLAY_CONSUMPTION"), + COMPLETE("COMPLETE"); + + private String title; + + GooglePlayTransactionState(String title) { + this.title = title; + } + } +} + 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 new file mode 100644 index 0000000..f86c00e --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Base64.java @@ -0,0 +1,208 @@ +package com.ea.nimble.mtx.googleplay.util; + +/* loaded from: stdlib.jar:com/ea/nimble/mtx/googleplay/util/Base64.class */ +public class Base64 { + static final /* synthetic */ boolean $assertionsDisabled; + private static final byte[] ALPHABET; + private static final byte[] DECODABET; + public static final boolean DECODE = false; + public static final boolean ENCODE = true; + private static final byte EQUALS_SIGN = 61; + private static final byte EQUALS_SIGN_ENC = -1; + private static final byte NEW_LINE = 10; + private static final byte[] WEBSAFE_ALPHABET; + private static final byte[] WEBSAFE_DECODABET; + private static final byte WHITE_SPACE_ENC = -5; + + static { + $assertionsDisabled = !Base64.class.desiredAssertionStatus(); + ALPHABET = new byte[]{65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47}; + WEBSAFE_ALPHABET = new byte[]{65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 45, 95}; + DECODABET = new byte[]{-9, -9, -9, -9, -9, -9, -9, -9, -9, WHITE_SPACE_ENC, WHITE_SPACE_ENC, -9, -9, WHITE_SPACE_ENC, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, WHITE_SPACE_ENC, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, 62, -9, -9, -9, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, EQUALS_SIGN, -9, -9, -9, -1, -9, -9, -9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -9, -9, -9, -9, -9, -9, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -9, -9, -9, -9, -9}; + WEBSAFE_DECODABET = new byte[]{-9, -9, -9, -9, -9, -9, -9, -9, -9, WHITE_SPACE_ENC, WHITE_SPACE_ENC, -9, -9, WHITE_SPACE_ENC, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, WHITE_SPACE_ENC, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, -9, 62, -9, -9, 52, 53, 54, 55, 56, 57, 58, 59, 60, EQUALS_SIGN, -9, -9, -9, -1, -9, -9, -9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -9, -9, -9, -9, 63, -9, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -9, -9, -9, -9, -9}; + } + + private Base64() { + } + + public static byte[] decode(String str) throws Base64DecoderException { + byte[] bytes = str.getBytes(); + return decode(bytes, 0, bytes.length); + } + + public static byte[] decode(byte[] bArr) throws Base64DecoderException { + return decode(bArr, 0, bArr.length); + } + + public static byte[] decode(byte[] bArr, int i, int i2) throws Base64DecoderException { + return decode(bArr, i, i2, DECODABET); + } + + public static byte[] decode(byte[] bArr, int i, int i2, byte[] bArr2) throws Base64DecoderException { + byte[] bArr3 = new byte[((i2 * 3) / 4) + 2]; + int i3 = 0; + byte[] bArr4 = new byte[4]; + int i4 = 0; + int i5 = 0; + while (i4 < i2) { + byte b = (byte) (bArr[i4 + i] & Byte.MAX_VALUE); + byte b2 = bArr2[b]; + if (b2 >= WHITE_SPACE_ENC) { + if (b2 < -1) { + i3 = i3; + } else if (b == EQUALS_SIGN) { + int i6 = i2 - i4; + byte b3 = (byte) (bArr[(i2 - 1) + i] & Byte.MAX_VALUE); + if (i5 == 0 || i5 == 1) { + throw new Base64DecoderException("invalid padding byte '=' at byte offset " + i4); + } else if (i5 == 3 && i6 > 2) { + throw new Base64DecoderException("padding byte '=' falsely signals end of encoded value at offset " + i4); + } else if (b3 != EQUALS_SIGN && b3 != 10) { + throw new Base64DecoderException("encoded value has invalid trailing byte"); + } + } else { + int i7 = i5 + 1; + bArr4[i5] = b; + i5 = i7; + i3 = i3; + if (i7 == 4) { + i3 += decode4to3(bArr4, 0, bArr3, i3, bArr2); + i5 = 0; + } + } + i4++; + } else { + throw new Base64DecoderException("Bad Base64 input character at " + i4 + ": " + ((int) bArr[i4 + i]) + "(decimal)"); + } + } + if (i5 != 0) { + if (i5 == 1) { + throw new Base64DecoderException("single trailing character at offset " + (i2 - 1)); + } + bArr4[i5] = EQUALS_SIGN; + i3 += decode4to3(bArr4, 0, bArr3, i3, bArr2); + } + byte[] bArr5 = new byte[i3]; + System.arraycopy(bArr3, 0, bArr5, 0, i3); + return bArr5; + } + + private static int decode4to3(byte[] bArr, int i, byte[] bArr2, int i2, byte[] bArr3) { + if (bArr[i + 2] == EQUALS_SIGN) { + bArr2[i2] = (byte) ((((bArr3[bArr[i]] << 24) >>> 6) | ((bArr3[bArr[i + 1]] << 24) >>> 12)) >>> 16); + return 1; + } else if (bArr[i + 3] == EQUALS_SIGN) { + int i3 = ((bArr3[bArr[i]] << 24) >>> 6) | ((bArr3[bArr[i + 1]] << 24) >>> 12) | ((bArr3[bArr[i + 2]] << 24) >>> 18); + bArr2[i2] = (byte) (i3 >>> 16); + bArr2[i2 + 1] = (byte) (i3 >>> 8); + return 2; + } else { + int i4 = ((bArr3[bArr[i]] << 24) >>> 6) | ((bArr3[bArr[i + 1]] << 24) >>> 12) | ((bArr3[bArr[i + 2]] << 24) >>> 18) | ((bArr3[bArr[i + 3]] << 24) >>> 24); + bArr2[i2] = (byte) (i4 >> 16); + bArr2[i2 + 1] = (byte) (i4 >> 8); + bArr2[i2 + 2] = (byte) i4; + return 3; + } + } + + public static byte[] decodeWebSafe(String str) throws Base64DecoderException { + byte[] bytes = str.getBytes(); + return decodeWebSafe(bytes, 0, bytes.length); + } + + public static byte[] decodeWebSafe(byte[] bArr) throws Base64DecoderException { + return decodeWebSafe(bArr, 0, bArr.length); + } + + public static byte[] decodeWebSafe(byte[] bArr, int i, int i2) throws Base64DecoderException { + return decode(bArr, i, i2, WEBSAFE_DECODABET); + } + + public static String encode(byte[] bArr) { + return encode(bArr, 0, bArr.length, ALPHABET, true); + } + + public static String encode(byte[] bArr, int i, int i2, byte[] bArr2, boolean z) { + byte[] encode = encode(bArr, i, i2, bArr2, Integer.MAX_VALUE); + int length = encode.length; + while (!z && length > 0 && encode[length - 1] == EQUALS_SIGN) { + length--; + } + return new String(encode, 0, length); + } + + public static byte[] encode(byte[] bArr, int i, int i2, byte[] bArr2, int i3) { + int i4 = ((i2 + 2) / 3) * 4; + byte[] bArr3 = new byte[(i4 / i3) + i4]; + int i5 = 0; + int i6 = 0; + int i7 = 0; + while (i5 < i2 - 2) { + int i8 = ((bArr[i5 + i] << 24) >>> 8) | ((bArr[(i5 + 1) + i] << 24) >>> 16) | ((bArr[(i5 + 2) + i] << 24) >>> 24); + bArr3[i6] = bArr2[i8 >>> 18]; + bArr3[i6 + 1] = bArr2[(i8 >>> 12) & 63]; + bArr3[i6 + 2] = bArr2[(i8 >>> 6) & 63]; + bArr3[i6 + 3] = bArr2[i8 & 63]; + int i9 = i7 + 4; + int i10 = i6; + i7 = i9; + if (i9 == i3) { + bArr3[i6 + 4] = 10; + i10 = i6 + 1; + i7 = 0; + } + i5 += 3; + i6 = i10 + 4; + } + int i11 = i6; + if (i5 < i2) { + encode3to4(bArr, i5 + i, i2 - i5, bArr3, i6, bArr2); + int i12 = i6; + if (i7 + 4 == i3) { + bArr3[i6 + 4] = 10; + i12 = i6 + 1; + } + i11 = i12 + 4; + } + if ($assertionsDisabled || i11 == bArr3.length) { + return bArr3; + } + throw new AssertionError(); + } + + private static byte[] encode3to4(byte[] bArr, int i, int i2, byte[] bArr2, int i3, byte[] bArr3) { + int i4 = 0; + int i5 = i2 > 0 ? (bArr[i] << 24) >>> 8 : 0; + int i6 = i2 > 1 ? (bArr[i + 1] << 24) >>> 16 : 0; + if (i2 > 2) { + i4 = (bArr[i + 2] << 24) >>> 24; + } + int i7 = i6 | i5 | i4; + switch (i2) { + case 1: + bArr2[i3] = bArr3[i7 >>> 18]; + bArr2[i3 + 1] = bArr3[(i7 >>> 12) & 63]; + bArr2[i3 + 2] = EQUALS_SIGN; + bArr2[i3 + 3] = EQUALS_SIGN; + return bArr2; + case 2: + bArr2[i3] = bArr3[i7 >>> 18]; + bArr2[i3 + 1] = bArr3[(i7 >>> 12) & 63]; + bArr2[i3 + 2] = bArr3[(i7 >>> 6) & 63]; + bArr2[i3 + 3] = EQUALS_SIGN; + return bArr2; + case 3: + bArr2[i3] = bArr3[i7 >>> 18]; + bArr2[i3 + 1] = bArr3[(i7 >>> 12) & 63]; + bArr2[i3 + 2] = bArr3[(i7 >>> 6) & 63]; + bArr2[i3 + 3] = bArr3[i7 & 63]; + return bArr2; + default: + return bArr2; + } + } + + public static String encodeWebSafe(byte[] bArr, boolean z) { + return encode(bArr, 0, bArr.length, WEBSAFE_ALPHABET, z); + } +} diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Base64DecoderException.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Base64DecoderException.java new file mode 100644 index 0000000..d476507 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Base64DecoderException.java @@ -0,0 +1,17 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.googleplay.util; + +public class Base64DecoderException +extends Exception { + private static final long serialVersionUID = 1L; + + public Base64DecoderException() { + } + + public Base64DecoderException(String string2) { + super(string2); + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabException.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabException.java new file mode 100644 index 0000000..9738da1 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabException.java @@ -0,0 +1,34 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.googleplay.util; + +import com.ea.nimble.mtx.googleplay.util.IabResult; + +public class IabException +extends Exception { + private static final long serialVersionUID = 5626567164828265535L; + IabResult mResult; + + public IabException(int n2, String string2) { + this(new IabResult(n2, string2)); + } + + public IabException(int n2, String string2, Exception exception) { + this(new IabResult(n2, string2), exception); + } + + public IabException(IabResult iabResult) { + this(iabResult, null); + } + + public IabException(IabResult iabResult, Exception exception) { + super(iabResult.getMessage(), exception); + this.mResult = iabResult; + } + + public IabResult getResult() { + return this.mResult; + } +} + 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 new file mode 100644 index 0000000..487b9ad --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabHelper.java @@ -0,0 +1,574 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.Activity + * android.app.PendingIntent + * android.content.BroadcastReceiver + * android.content.ComponentName + * android.content.Context + * android.content.Intent + * android.content.IntentFilter + * android.content.IntentSender$SendIntentException + * android.content.ServiceConnection + * android.content.pm.ResolveInfo + * android.os.Bundle + * android.os.Handler + * android.os.IBinder + * android.os.Looper + * android.os.RemoteException + * android.text.TextUtils + * org.json.JSONException + */ +package com.ea.nimble.mtx.googleplay.util; + +import android.app.Activity; +import android.content.BroadcastReceiver; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.Bundle; +import android.os.Handler; +import android.os.IBinder; +import android.os.Looper; +import android.os.RemoteException; + +import com.ea.ironmonkey.devmenu.util.Observer; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; + +import org.json.JSONException; + +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; + +public class IabHelper +implements LogSource { + public static final int BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE = 3; + public static final int BILLING_RESPONSE_RESULT_DEVELOPER_ERROR = 5; + public static final int BILLING_RESPONSE_RESULT_ERROR = 6; + public static final int BILLING_RESPONSE_RESULT_ITEM_ALREADY_OWNED = 7; + public static final int BILLING_RESPONSE_RESULT_ITEM_NOT_OWNED = 8; + public static final int BILLING_RESPONSE_RESULT_ITEM_UNAVAILABLE = 4; + public static final int BILLING_RESPONSE_RESULT_OK = 0; + public static final int BILLING_RESPONSE_RESULT_USER_CANCELED = 1; + public static final String GET_SKU_DETAILS_ITEM_LIST = "ITEM_ID_LIST"; + public static final String GET_SKU_DETAILS_ITEM_TYPE_LIST = "ITEM_TYPE_LIST"; + public static final int IABHELPER_BAD_RESPONSE = -1002; + public static final int IABHELPER_BAD_STATE_ERROR = -1008; + public static final int IABHELPER_ERROR_BASE = -1000; + public static final int IABHELPER_MISSING_TOKEN = -1007; + public static final int IABHELPER_REMOTE_EXCEPTION = -1001; + public static final int IABHELPER_SEND_INTENT_FAILED = -1004; + public static final int IABHELPER_UNKNOWN_ERROR = -1009; + public static final int IABHELPER_UNKNOWN_PURCHASE_RESPONSE = -1006; + public static final int IABHELPER_USER_CANCELLED = -1005; + public static final int IABHELPER_VERIFICATION_FAILED = -1003; + public static final String INAPP_CONTINUATION_TOKEN = "INAPP_CONTINUATION_TOKEN"; + public static final String ITEM_TYPE_INAPP = "inapp"; + public static final String RESPONSE_BUY_INTENT = "BUY_INTENT"; + public static final String RESPONSE_CODE = "RESPONSE_CODE"; + public static final String RESPONSE_GET_SKU_DETAILS_LIST = "DETAILS_LIST"; + public static final String RESPONSE_INAPP_ITEM_LIST = "INAPP_PURCHASE_ITEM_LIST"; + public static final String RESPONSE_INAPP_PURCHASE_DATA = "INAPP_PURCHASE_DATA"; + public static final String RESPONSE_INAPP_PURCHASE_DATA_LIST = "INAPP_PURCHASE_DATA_LIST"; + public static final String RESPONSE_INAPP_SIGNATURE = "INAPP_DATA_SIGNATURE"; + public static final String RESPONSE_INAPP_SIGNATURE_LIST = "INAPP_DATA_SIGNATURE_LIST"; + boolean mAsyncInProgress = false; + AsyncOperation mAsyncOperation; + LinkedList mAsyncRequestQueue; + Context mContext; + boolean mDebugLog = false; + String mDebugTag = "IabHelper"; + OnIabPurchaseFinishedListener mPurchaseListener; + IabPurchaseUpdateReceiver mPurchaseUpdateReceiver = null; + int mRequestCode; + ServiceConnection mServiceConn; + boolean mSetupDone = false; + String mSignatureBase64 = null; + + public IabHelper(Context context, String string2) { + this.mContext = context.getApplicationContext(); + if (this.mContext == null) { + this.logError("IabHelper initializing with null application context!"); + } + this.mSignatureBase64 = string2; + this.logDebug("IAB helper created."); + this.mAsyncRequestQueue = new LinkedList(); + } + + private void checkAndPopAsyncQueue() { + if (this.mAsyncRequestQueue.size() <= 0) return; + AsyncOperation asyncOperation = this.mAsyncRequestQueue.removeFirst(); + this.flagStartAsync(asyncOperation); + asyncOperation.run(); + } + + private void enqueueOperation(AsyncOperation asyncOperation) { + this.logDebug("Enqueuing operation " + asyncOperation.getName() + " to execute after current async op, " + this.mAsyncOperation.getName() + ", is finished."); + this.mAsyncRequestQueue.add(asyncOperation); + } + + public static String getResponseDesc(int n2) { + String[] stringArray = "0:OK/1:User Canceled/2:Unknown/3:Billing Unavailable/4:Item unavailable/5:Developer Error/6:Error/7:Item Already Owned/8:Item not owned".split("/"); + String[] stringArray2 = "0:OK/-1001:Remote exception during initialization/-1002:Bad response received/-1003:Purchase signature verification failed/-1004:Send intent failed/-1005:User cancelled/-1006:Unknown purchase response/-1007:Missing token/-1008:Unknown error".split("/"); + if (n2 <= -1000) { + int n3 = -1000 - n2; + if (n3 < 0) return String.valueOf(n2) + ":Unknown IAB Helper Error"; + if (n3 >= stringArray2.length) return String.valueOf(n2) + ":Unknown IAB Helper Error"; + return stringArray2[n3]; + } + if (n2 < 0) return String.valueOf(n2) + ":Unknown"; + if (n2 < stringArray.length) return stringArray[n2]; + return String.valueOf(n2) + ":Unknown"; + } + + private void startOrQueueRunnable(AsyncOperation asyncOperation) { + synchronized (this) { + if (this.isAsyncInProgress()) { + this.enqueueOperation(asyncOperation); + } else { + this.flagStartAsync(asyncOperation); + asyncOperation.run(); + } + return; + } + } + + void checkSetupDone(String string2) { + if (this.mSetupDone) return; + this.logError("Illegal state for operation (" + string2 + "): IAB helper is not set up."); + throw new IllegalStateException("IAB helper is not set up. Can't perform operation: " + string2); + } + + void consume(Purchase purchase) throws IabException { + String string2; + String string3; + this.checkSetupDone("consume"); + string3 = purchase.getToken(); + string2 = purchase.getSku(); + if (string3 == null || string3.equals("")) { + this.logError("Can't consume " + string2 + ". No token."); + throw new IabException(-1007, "PurchaseInfo is missing token for sku: " + string2 + " " + purchase); + } + this.logDebug("Consuming sku: " + string2 + ", token: " + string3); + int n2 = 0; + this.logDebug("Successfully consumed sku: " + string2); + } + + public void consumeAsync(Purchase purchase, OnConsumeFinishedListener onConsumeFinishedListener) { + ArrayList arrayList = new ArrayList(); + arrayList.add(purchase); + this.consumeAsyncInternal(arrayList, onConsumeFinishedListener, null); + } + + public void consumeAsync(List list, OnConsumeMultiFinishedListener onConsumeMultiFinishedListener) { + this.consumeAsyncInternal(list, null, onConsumeMultiFinishedListener); + } + + void consumeAsyncInternal(final List list, final OnConsumeFinishedListener onConsumeFinishedListener, OnConsumeMultiFinishedListener onConsumeMultiFinishedListener) { + Looper looper; + Looper looper2 = looper = Looper.myLooper(); + if (looper == null) { + looper2 = Looper.getMainLooper(); + } + final Handler h = new Handler(looper2); + this.startOrQueueRunnable(new AsyncOperation("consume", true, new Runnable(){ + final /* synthetic */ Handler handler = h; + /* synthetic */ final OnConsumeMultiFinishedListener val$multiListener = onConsumeMultiFinishedListener; + + @Override + public void run() { + final ArrayList arrayList = new ArrayList(); + for (Purchase purchase : list) { + try { + IabHelper.this.consume(purchase); + arrayList.add(new IabResult(0, "Successful consume of sku " + purchase.getSku())); + } + catch (IabException iabException) { + arrayList.add(iabException.getResult()); + } + } + IabHelper.this.flagEndAsync(); + if (onConsumeFinishedListener != null) { + this.handler.post(() -> onConsumeFinishedListener.onConsumeFinished((Purchase)list.get(0), (IabResult)arrayList.get(0))); + } + if (this.val$multiListener == null) return; + this.handler.post(() -> val$multiListener.onConsumeMultiFinished(list, arrayList)); + } + })); + } + + public void dispose() { + this.logDebug("Disposing."); + this.mSetupDone = false; + if (this.mServiceConn == null) return; + this.logDebug("Unbinding from service."); + if (this.mContext != null) { + this.mContext.unbindService(this.mServiceConn); + } + this.mServiceConn = null; + this.mPurchaseListener = null; + } + + public void enableDebugLogging(boolean bl2) { + this.mDebugLog = bl2; + } + + public void enableDebugLogging(boolean bl2, String string2) { + this.mDebugLog = bl2; + this.mDebugTag = string2; + } + + void flagEndAsync() { + synchronized (this) { + this.logDebug("Ending async operation: " + this.mAsyncOperation.getName()); + this.mAsyncOperation = null; + this.mAsyncInProgress = false; + this.checkAndPopAsyncQueue(); + return; + } + } + + void flagStartAsync(AsyncOperation asyncOperation) { + if (this.mAsyncInProgress) { + throw new IllegalStateException("Can't start async operation (" + asyncOperation.getName() + ") because another async operation(" + this.mAsyncOperation.getName() + ") is in progress."); + } + this.mAsyncOperation = asyncOperation; + this.mAsyncInProgress = true; + this.logDebug("Starting async operation: " + asyncOperation.getName()); + } + + @Override + public String getLogSourceTitle() { + return "MTX Google IABHelper"; + } + + int getResponseCodeFromBundle(Bundle object) { + if (object.get(RESPONSE_CODE) == null) { + this.logDebug("Bundle with null response code, assuming OK (known issue)"); + return 0; + } + this.logError("Unexpected type for bundle response code."); + this.logError(object.getClass().getName()); + throw new RuntimeException("Unexpected type for bundle response code: " + object.getClass().getName()); + } + + int getResponseCodeFromIntent(Intent object) { + if (object.getExtras().get(RESPONSE_CODE) == null) { + this.logError("Intent with no response code, assuming OK (known issue)"); + return 0; + } + this.logError("Unexpected type for intent response code."); + this.logError(object.getClass().getName()); + throw new RuntimeException("Unexpected type for intent response code: " + object.getClass().getName()); + } + + public boolean handleActivityResult(int n2, int n3, Intent object) { + this.logDebug("handleActivityResult..."); + if (n2 != this.mRequestCode) { + return false; + } + this.checkSetupDone("handleActivityResult"); + this.flagEndAsync(); + if (object == null) { + this.logError("Null data in IAB activity result."); + IabResult result = new IabResult(-1002, "Null data in IAB result"); + if (this.mPurchaseListener == null) return true; + this.mPurchaseListener.onIabPurchaseFinished(result, null); + return true; + } + n2 = this.getResponseCodeFromIntent((Intent)object); + String string2 = object.getStringExtra(RESPONSE_INAPP_PURCHASE_DATA); + String string3 = object.getStringExtra(RESPONSE_INAPP_SIGNATURE); + if (n3 == -1 && n2 == 0) { + this.logDebug("Successful resultcode from purchase activity."); + this.logDebug("Purchase data: " + string2); + this.logDebug("Data signature: " + string3); + this.logDebug("Extras: " + object.getExtras()); + if (string2 == null || string3 == null) { + this.logError("BUG: either purchaseData or dataSignature is null."); + this.logDebug("Extras: " + object.getExtras().toString()); + IabResult iabResult = new IabResult(-1009, "IAB returned null purchaseData or dataSignature"); + if (this.mPurchaseListener == null) return true; + this.mPurchaseListener.onIabPurchaseFinished(iabResult, null); + return true; + } + try { + Purchase purchase = new Purchase(string2, string3); + if (this.mPurchaseListener == null) return true; + this.mPurchaseListener.onIabPurchaseFinished(new IabResult(0, "Success"), purchase); + return true; + } + catch (JSONException jSONException) { + this.logError("Failed to parse purchase data."); + jSONException.printStackTrace(); + IabResult iabResult = new IabResult(-1002, "Failed to parse purchase data."); + if (this.mPurchaseListener == null) return true; + this.mPurchaseListener.onIabPurchaseFinished(iabResult, null); + return true; + } + } + if (n3 == -1) { + this.logDebug("Result code was OK but in-app billing response was not OK: " + IabHelper.getResponseDesc(n2)); + if (this.mPurchaseListener == null) return true; + IabResult iabResult = new IabResult(n2, "Problem purchashing item."); + this.mPurchaseListener.onIabPurchaseFinished(iabResult, null); + return true; + } + if (n3 == 0) { + this.logDebug("Google Play Activity canceled - Response: " + IabHelper.getResponseDesc(n2)); + IabResult iabResult = new IabResult(n2, "Problem purchashing item."); + if (this.mPurchaseListener == null) return true; + this.mPurchaseListener.onIabPurchaseFinished(iabResult, null); + return true; + } + this.logError("Purchase failed. Result code: " + Integer.toString(n3) + ". Response: " + IabHelper.getResponseDesc(n2)); + IabResult iabResult = new IabResult(-1006, "Unknown purchase response."); + if (this.mPurchaseListener == null) return true; + this.mPurchaseListener.onIabPurchaseFinished(iabResult, null); + return true; + } + + boolean isAsyncInProgress() { + return this.mAsyncInProgress; + } + + public boolean isServiceAvailable() { + return this.mSetupDone; + } + + public void launchPurchaseFlow(Activity activity, String string2, int n2, OnIabPurchaseFinishedListener onIabPurchaseFinishedListener) { + this.launchPurchaseFlow(activity, string2, n2, onIabPurchaseFinishedListener, ""); + } + + public void launchPurchaseFlow(final Activity activity, final String string2, final int n2, final OnIabPurchaseFinishedListener onIabPurchaseFinishedListener, final String string3) { + synchronized (this) { + this.startOrQueueRunnable(new AsyncOperation("launchPurchaseFlow", false, new Runnable(){ + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled unnecessary exception pruning + */ + @Override + public void run() { + Object object = new Object(); + IabHelper.this.logDebug("Constructing buy intent for " + string2); + Bundle bundle = new Bundle(); + int n22 = IabHelper.this.getResponseCodeFromBundle(bundle); + if (n22 != 0) { + IabHelper.this.logDebug("BuyIntent Bundle: " + object); + IabHelper.this.logError("Unable to buy item, Error response: " + IabHelper.getResponseDesc(n22)); + IabHelper.this.flagEndAsync(); + object = new IabResult(n22, "Unable to buy item"); + OnIabPurchaseFinishedListener onIabPurchaseFinishedListener2 = onIabPurchaseFinishedListener; + if (onIabPurchaseFinishedListener2 == null) return; + try { + onIabPurchaseFinishedListener.onIabPurchaseFinished((IabResult) object, null); + } catch (Exception exception) { + IabHelper.this.logError("Uncaught exception in listener's onIabPurchaseFinished: " + exception); + } + } + } + })); + } + } + + void logDebug(String string2) { + Log.Helper.LOGD(this, string2); + } + + void logError(String string2) { + Log.Helper.LOGE(this, string2); + } + + void logWarn(String string2) { + Log.Helper.LOGW(this, string2); + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Enabled unnecessary exception pruning + */ + public Inventory queryInventory(boolean bl2, boolean bl3, List list) throws IabException { + int n2 = 0; + Inventory inventory; + try { + this.checkSetupDone("queryInventory"); + inventory = new Inventory(); + if (bl2 && (n2 = this.queryPurchases(inventory)) != 0) { + throw new IabException(n2, "Error refreshing inventory (querying owned items)."); + } + } + catch (RemoteException remoteException) { + throw new IabException(-1001, "Remote exception while refreshing inventory.", remoteException); + } + catch (JSONException jSONException) { + throw new IabException(-1002, "Error parsing JSON response while refreshing inventory.", jSONException); + } + catch (IllegalStateException illegalStateException) { + throw new IabException(-1008, "IabHelper in a bad state (billing service not connected, application context is null, etc.", illegalStateException); + } + if (!bl3) return inventory; + { + try { + n2 = this.querySkuDetails(inventory, list); + } catch (RemoteException e) { + e.printStackTrace(); + } catch (JSONException e) { + e.printStackTrace(); + } + if (n2 == 0) return inventory; + throw new IabException(n2, "Error refreshing inventory (querying prices of items)."); + } + } + + public void queryInventoryAsync(QueryInventoryFinishedListener queryInventoryFinishedListener) { + this.queryInventoryAsync(true, true, null, queryInventoryFinishedListener); + } + + public void queryInventoryAsync(boolean bl2, boolean bl3, QueryInventoryFinishedListener queryInventoryFinishedListener) { + this.queryInventoryAsync(bl2, bl3, null, queryInventoryFinishedListener); + } + + public void queryInventoryAsync(final boolean bl2, final boolean bl3, final List list, QueryInventoryFinishedListener queryInventoryFinishedListener) { + Looper looper; + Looper looper2 = looper = Looper.myLooper(); + if (looper == null) { + looper2 = Looper.getMainLooper(); + } + final Handler handler = new Handler(looper2); + final QueryInventoryFinishedListener queryInventoryFinishedListener1 = queryInventoryFinishedListener; + this.startOrQueueRunnable(new AsyncOperation("queryInventory", true, new Runnable(){ + final Handler handler2 = handler; + final QueryInventoryFinishedListener listener = queryInventoryFinishedListener1; + + @Override + public void run() { + IabResult iabResult = new IabResult(0, "Inventory refresh successful."); // var2_1 + Inventory inventory = null; + try { + inventory = IabHelper.this.queryInventory(bl2, bl3, list); + IabHelper.this.flagEndAsync(); + } + catch (IabException var2_2) { + iabResult = var2_2.getResult(); + } + IabResult finalIabResult = iabResult; + Inventory finalInventory = inventory; + this.handler2.post(() -> listener.onQueryInventoryFinished(finalIabResult, finalInventory)); + } + })); + } + + int queryPurchases(Inventory inventory) throws JSONException, RemoteException, IllegalStateException { + Observer.onCallingMethod(); + return 0; + } + + int querySkuDetails(Inventory inventory, List object) throws RemoteException, JSONException, IllegalStateException { + Observer.onCallingMethod(); + return 0; + } + + public void setApplicationPublicKey(String string2) { + this.mSignatureBase64 = string2; + } + + public void startSetup(final OnIabSetupFinishedListener onIabSetupFinishedListener, final OnIabBroadcastListener onIabBroadcastListener) { + if (this.mSetupDone) { + throw new IllegalStateException("IAB helper is already set up."); + } + this.logDebug("Starting in-app billing setup."); + this.mServiceConn = new ServiceConnection(){ + public void onServiceConnected(ComponentName var1_1, IBinder var2_3) { + Observer.onCallingMethod(); + } + + public void onServiceDisconnected(ComponentName componentName) { + Observer.onCallingMethod(); + } + }; + this.logDebug("...Starting in-app billing setup."); + this.logDebug("Binding service..."); + if (onIabBroadcastListener == null) { + this.logError("Unable to get ResolveInfo for InAppBillingService intent. Cannot bind to InAppBillinbService"); + this.mServiceConn = null; + return; + } + //this.logDebug("PackageName = " + ((ResolveInfo)onIabBroadcastListener).serviceInfo.packageName); + //this.logDebug("ClassName = " + ((ResolveInfo)onIabBroadcastListener).serviceInfo.name); + /*if (this.mContext.bindService((Intent)onIabSetupFinishedListener, this.mServiceConn, Context.BIND_AUTO_CREATE)) { + this.logDebug("Success - Bind to InAppBillingService"); + return; + }*/ + this.logError("Failed to Bind to InAppBillingService"); + this.mServiceConn = null; + } + + private class AsyncOperation { + private String m_name; + private Runnable m_operation; + private boolean m_runInNewThread; + + public AsyncOperation(String string2, boolean bl2, Runnable runnable) { + this.m_name = string2; + this.m_runInNewThread = bl2; + this.m_operation = runnable; + IabHelper.this.checkSetupDone(this.m_name); + } + + public String getName() { + return this.m_name; + } + + public void run() { + if (this.m_runInNewThread) { + new Thread(this.m_operation).start(); + return; + } + this.m_operation.run(); + } + } + + public static class IabPurchaseUpdateReceiver + extends BroadcastReceiver { + private final OnIabBroadcastListener mListener; + + public IabPurchaseUpdateReceiver(OnIabBroadcastListener onIabBroadcastListener) { + this.mListener = onIabBroadcastListener; + } + + public void onReceive(Context context, Intent intent) { + if (this.mListener == null) return; + this.mListener.receivedBroadcast(); + } + } + + public static interface OnConsumeFinishedListener { + public void onConsumeFinished(Purchase var1, IabResult var2); + } + + public static interface OnConsumeMultiFinishedListener { + public void onConsumeMultiFinished(List var1, List var2); + } + + public static interface OnIabBroadcastListener { + public void receivedBroadcast(); + } + + public static interface OnIabPurchaseFinishedListener { + public void onIabPurchaseFinished(IabResult var1, Purchase var2); + } + + public static interface OnIabSetupFinishedListener { + public void onIabSetupFinished(IabResult var1); + } + + public static interface QueryInventoryFinishedListener { + public void onQueryInventoryFinished(IabResult var1, Inventory var2); + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabResult.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabResult.java new file mode 100644 index 0000000..0d16551 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/IabResult.java @@ -0,0 +1,43 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.googleplay.util; + +import com.ea.nimble.mtx.googleplay.util.IabHelper; + +public class IabResult { + String mMessage; + int mResponse; + + public IabResult(int n2, String string2) { + this.mResponse = n2; + if (string2 != null && string2.trim().length() != 0) { + this.mMessage = string2 + " (response: " + IabHelper.getResponseDesc(n2) + ")"; + return; + } + this.mMessage = IabHelper.getResponseDesc(n2); + } + + public String getMessage() { + return this.mMessage; + } + + public int getResponse() { + return this.mResponse; + } + + public boolean isFailure() { + if (this.isSuccess()) return false; + return true; + } + + public boolean isSuccess() { + if (this.mResponse != 0) return false; + return true; + } + + public String toString() { + return "IabResult: " + this.getMessage(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Inventory.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Inventory.java new file mode 100644 index 0000000..5e2d200 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Inventory.java @@ -0,0 +1,62 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.mtx.googleplay.util; + +import com.ea.nimble.mtx.googleplay.util.Purchase; +import com.ea.nimble.mtx.googleplay.util.SkuDetails; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class Inventory { + Map mPurchaseMap; + Map mSkuMap = new HashMap(); + + Inventory() { + this.mPurchaseMap = new HashMap(); + } + + void addPurchase(Purchase purchase) { + this.mPurchaseMap.put(purchase.getSku(), purchase); + } + + void addSkuDetails(SkuDetails skuDetails) { + this.mSkuMap.put(skuDetails.getSku(), skuDetails); + } + + public void erasePurchase(String string2) { + if (!this.mPurchaseMap.containsKey(string2)) return; + this.mPurchaseMap.remove(string2); + } + + public List getAllOwnedSkus() { + return new ArrayList(this.mPurchaseMap.keySet()); + } + + public List getAllPurchases() { + return new ArrayList(this.mPurchaseMap.values()); + } + + public List getAllSkuDetails() { + return new ArrayList(this.mSkuMap.values()); + } + + public Purchase getPurchase(String string2) { + return this.mPurchaseMap.get(string2); + } + + public SkuDetails getSkuDetails(String string2) { + return this.mSkuMap.get(string2); + } + + public boolean hasDetails(String string2) { + return this.mSkuMap.containsKey(string2); + } + + public boolean hasPurchase(String string2) { + return this.mPurchaseMap.containsKey(string2); + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Purchase.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Purchase.java new file mode 100644 index 0000000..fd5ece3 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Purchase.java @@ -0,0 +1,119 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * org.json.JSONException + * org.json.JSONObject + */ +package com.ea.nimble.mtx.googleplay.util; + +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.mtx.googleplay.GooglePlay; +import com.ea.nimble.mtx.googleplay.GooglePlayTransaction; +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.Map; + +public class Purchase { + String mDeveloperPayload; + String mNimbleMTXTransactionId; + String mOrderId; + String mOriginalJson; + String mPackageName; + int mPurchaseState; + long mPurchaseTime; + String mSignature; + String mSku; + String mToken; + + public Purchase(GooglePlayTransaction googlePlayTransaction) throws IllegalArgumentException { + Map object = googlePlayTransaction.getAdditionalInfo(); + if (object == null) { + throw new IllegalArgumentException("Can't construct Purchase from GooglePlayTransaction without additional info bundle"); + } + String string2 = (String)object.get(GooglePlay.GOOGLEPLAY_ADDITIONALINFO_KEY_ORDERID); + String string3 = ApplicationEnvironment.getComponent().getApplicationBundleId(); + String string4 = googlePlayTransaction.getItemSku(); + long l2 = (Long)object.get(GooglePlay.GOOGLEPLAY_ADDITIONALINFO_KEY_PURCHASETIME); + int n2 = (Integer)object.get(GooglePlay.GOOGLEPLAY_ADDITIONALINFO_KEY_PURCHASESTATE); + String string5 = googlePlayTransaction.getNonce(); + Object o = object.get(GooglePlay.GOOGLEPLAY_ADDITIONALINFO_KEY_TOKEN); + String string6 = googlePlayTransaction.getReceipt(); + if (string2 == null) throw new IllegalArgumentException("Missing data to construct a Purchase object."); + if (string3 == null) throw new IllegalArgumentException("Missing data to construct a Purchase object."); + if (string4 == null) throw new IllegalArgumentException("Missing data to construct a Purchase object."); + if (string5 == null) throw new IllegalArgumentException("Missing data to construct a Purchase object."); + if (string6 == null) { + throw new IllegalArgumentException("Missing data to construct a Purchase object."); + } + this.mOrderId = string2; + this.mPackageName = string3; + this.mSku = string4; + this.mPurchaseTime = l2; + this.mPurchaseState = n2; + this.mDeveloperPayload = string5; + this.mToken = (String)o; + this.mSignature = string6; + this.mOriginalJson = "{\"constructedFromTransaction\":1}"; + this.mNimbleMTXTransactionId = googlePlayTransaction.getTransactionId(); + } + + public Purchase(String string2, String string3) throws JSONException { + this.mOriginalJson = string2; + JSONObject jsonObject = new JSONObject(this.mOriginalJson); + this.mOrderId = jsonObject.optString("orderId"); + this.mPackageName = jsonObject.optString("packageName"); + this.mSku = jsonObject.optString("productId"); + this.mPurchaseTime = jsonObject.optLong("purchaseTime"); + this.mPurchaseState = jsonObject.optInt("purchaseState"); + this.mDeveloperPayload = jsonObject.optString("developerPayload"); + this.mToken = jsonObject.optString("token", jsonObject.optString("purchaseToken")); + this.mSignature = string3; + } + + public String getDeveloperPayload() { + return this.mDeveloperPayload; + } + + public String getNimbleMTXTransactionId() { + return this.mNimbleMTXTransactionId; + } + + public String getOrderId() { + return this.mOrderId; + } + + public String getOriginalJson() { + return this.mOriginalJson; + } + + public String getPackageName() { + return this.mPackageName; + } + + public int getPurchaseState() { + return this.mPurchaseState; + } + + public long getPurchaseTime() { + return this.mPurchaseTime; + } + + public String getSignature() { + return this.mSignature; + } + + public String getSku() { + return this.mSku; + } + + public String getToken() { + return this.mToken; + } + + public String toString() { + return "PurchaseInfo:" + this.mOriginalJson; + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Security.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Security.java new file mode 100644 index 0000000..b07de10 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/Security.java @@ -0,0 +1,83 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.text.TextUtils + * android.util.Log + */ +package com.ea.nimble.mtx.googleplay.util; + +import android.text.TextUtils; +import android.util.Log; + +import java.security.InvalidKeyException; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.PublicKey; +import java.security.Signature; +import java.security.SignatureException; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.X509EncodedKeySpec; + +public class Security { + private static final String KEY_FACTORY_ALGORITHM = "RSA"; + private static final String SIGNATURE_ALGORITHM = "SHA1withRSA"; + private static final String TAG = "IABUtil/Security"; + + public static PublicKey generatePublicKey(String object) { + try { + byte[] decode = Base64.decode(object); + return KeyFactory.getInstance(KEY_FACTORY_ALGORITHM).generatePublic(new X509EncodedKeySpec(decode)); + } + catch (NoSuchAlgorithmException noSuchAlgorithmException) { + throw new RuntimeException(noSuchAlgorithmException); + } + catch (InvalidKeySpecException invalidKeySpecException) { + Log.e((String)TAG, (String)"Invalid key specification."); + throw new IllegalArgumentException(invalidKeySpecException); + } + catch (Base64DecoderException base64DecoderException) { + Log.e((String)TAG, (String)"Base64 decoding failed."); + throw new IllegalArgumentException(base64DecoderException); + } + } + + public static boolean verify(PublicKey publicKey, String string2, String string3) { + try { + Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); + signature.initVerify(publicKey); + signature.update(string2.getBytes()); + if (signature.verify(Base64.decode(string3))) return true; + Log.e((String)TAG, (String)"Signature verification failed."); + return false; + } + catch (NoSuchAlgorithmException noSuchAlgorithmException) { + Log.e((String)TAG, (String)"NoSuchAlgorithmException."); + return false; + } + catch (InvalidKeyException invalidKeyException) { + Log.e((String)TAG, (String)"Invalid key specification."); + return false; + } + catch (SignatureException signatureException) { + Log.e((String)TAG, (String)"Signature exception."); + return false; + } + catch (Base64DecoderException base64DecoderException) { + Log.e((String)TAG, (String)"Base64 decoding failed."); + return false; + } + } + + public static boolean verifyPurchase(String string2, String string3, String string4) { + if (string3 == null) { + Log.e((String)TAG, (String)"data is null"); + return false; + } + if (TextUtils.isEmpty((CharSequence)string4)) return true; + if (Security.verify(Security.generatePublicKey(string2), string3, string4)) return true; + Log.w((String)TAG, (String)"signature does not match data."); + return false; + } +} + diff --git a/app/src/main/java/com/ea/nimble/mtx/googleplay/util/SkuDetails.java b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/SkuDetails.java new file mode 100644 index 0000000..5f5025b --- /dev/null +++ b/app/src/main/java/com/ea/nimble/mtx/googleplay/util/SkuDetails.java @@ -0,0 +1,67 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * org.json.JSONException + * org.json.JSONObject + */ +package com.ea.nimble.mtx.googleplay.util; + +import org.json.JSONException; +import org.json.JSONObject; + +public class SkuDetails { + String mCurrencyCode; + String mDescription; + String mJson; + String mPrice; + String mPriceMicros; + String mSku; + String mTitle; + String mType; + + public SkuDetails(String string2) throws JSONException { + this.mJson = string2; + JSONObject jsonObject = new JSONObject(this.mJson); + this.mSku = jsonObject.optString("productId"); + this.mType = jsonObject.optString("type"); + this.mPrice = jsonObject.optString("price"); + this.mPriceMicros = jsonObject.optString("price_amount_micros"); + this.mCurrencyCode = jsonObject.optString("price_currency_code"); + this.mTitle = jsonObject.optString("title"); + this.mDescription = jsonObject.optString("description"); + } + + public String getCurrencyCode() { + return this.mCurrencyCode; + } + + public String getDescription() { + return this.mDescription; + } + + public String getPrice() { + return this.mPrice; + } + + public String getPriceMicros() { + return this.mPriceMicros; + } + + public String getSku() { + return this.mSku; + } + + public String getTitle() { + return this.mTitle; + } + + public String getType() { + return this.mType; + } + + public String toString() { + return "SkuDetails:" + this.mJson; + } +} + diff --git a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/GCMIntentService.java b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/GCMIntentService.java new file mode 100644 index 0000000..0b58080 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/GCMIntentService.java @@ -0,0 +1,200 @@ +package com.ea.nimble.pushnotificationgoogle; + +import android.app.AlertDialog; +import android.app.Notification; +import android.app.NotificationManager; +import android.app.PendingIntent; +import android.content.Context; +import android.content.DialogInterface; +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.util.Log; +import com.ea.nimble.Log.Helper; +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.Base; +import com.ea.nimble.Persistence; +import com.ea.nimble.PersistenceService; +import com.ea.nimble.tracking.ITracking; +import com.ea.nimble.tracking.Tracking; +import com.google.android.gcm.GCMBaseIntentService; +import com.google.android.gcm.GCMRegistrar; + +import java.net.URLDecoder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Locale; + +/* loaded from: stdlib.jar:com/ea/nimble/pushnotificationgoogle/GCMIntentService.class */ +public class GCMIntentService extends GCMBaseIntentService { + public static final String GCMPersistentMessageID = "GCMMessageId"; + public static final String TAG = "GCMIntentService"; + + public GCMIntentService() { + super("927779459434"); + } + + protected static void generateNotification(Context context, String str, String str2, String str3, Bundle bundle) { + long currentTimeMillis = System.currentTimeMillis(); + NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + String str4 = (String) context.getPackageManager().getApplicationLabel(context.getApplicationInfo()); + int identifier = context.getResources().getIdentifier("icon_pushnotification_custom", "drawable", context.getPackageName()); + int i = identifier; + if (identifier == 0) { + i = context.getApplicationContext().getApplicationInfo().icon; + } + Context applicationContext = context.getApplicationContext(); + Intent launchIntentForPackage = applicationContext.getPackageManager().getLaunchIntentForPackage(applicationContext.getPackageName()); + if (bundle != null) { + launchIntentForPackage.putExtras(bundle); + } + launchIntentForPackage.putExtra("PushNotification", "true"); + if (str2 != null && str2.length() > 0) { + launchIntentForPackage.putExtra("messageId", str2); + } + launchIntentForPackage.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); + PendingIntent activity = PendingIntent.getActivity(context, 0, launchIntentForPackage, PendingIntent.FLAG_ONE_SHOT); + Notification notification = new Notification(i, str, currentTimeMillis); + if (str3 != null && str3.length() > 0) { + if (applicationContext.getResources().getIdentifier(str3, "raw", applicationContext.getPackageName()) != 0) { + notification.sound = Uri.parse("android.resource://" + context.getPackageName() + "/raw/" + str3); + } else { + Log.e(TAG, "Attempt to play sound file " + str3 + " but the resource was not found"); + } + } + //notification.setLatestEventInfo(context, str4, str, activity); + notification.flags |= 16; + notificationManager.notify(0, notification); + } + + @Override // com.google.android.gcm.GCMBaseIntentService + protected void onDeletedMessages(Context context, int i) { + Log.i(TAG, "Received deleted messages notification"); + generateNotification(context, "Message deleted", null, null, null); + } + + @Override // com.google.android.gcm.GCMBaseIntentService + protected void onError(Context context, String str) { + Log.i(TAG, "Received error: " + str); + if (str.equals("ACCOUNT_MISSING") && Base.getComponent(PushNotification.COMPONENT_ID) != null) { + ((IPushNotification) Base.getComponent(PushNotification.COMPONENT_ID)).cleanup(); + } + } + + @Override // com.google.android.gcm.GCMBaseIntentService + protected void onMessage(Context context, Intent intent) { + Log.v(TAG, "Real - onMessage start"); + String str = ""; + String str2 = ""; + String str3 = ""; + Bundle extras = intent.getExtras(); + Log.v(TAG, "Real - message stuff: " + extras.toString()); + String str4 = "eamobile-message_" + (ApplicationEnvironment.isMainApplicationRunning() ? ApplicationEnvironment.getComponent().getShortApplicationLanguageCode() : Locale.getDefault().getLanguage()); + for (String str5 : extras.keySet()) { + String str6 = str; + if (str5.startsWith(str4)) { + try { + str6 = URLDecoder.decode(extras.getString(str5), "UTF-8"); + } catch (Exception e) { + str6 = str; + } + } + String str7 = str2; + if (str5.startsWith("messageId")) { + Log.v(TAG, "message id is " + extras.getString("messageId")); + str7 = extras.getString("messageId"); + } + str = str6; + str2 = str7; + if (str5.startsWith("eamobile-song")) { + str3 = extras.getString("eamobile-song"); + Log.v(TAG, "sound file to play is " + str3); + str = str6; + str2 = str7; + } + } + if (str.length() == 0) { + Log.v(TAG, "*****Recieved PN but message payload did not match app selected language. Suppressing PN*****"); + return; + } + try { + if (ApplicationEnvironment.isMainApplicationRunning()) { + Log.v(TAG, "Attempting to save PN details to persistent cache. Assumption is that the application is running"); + if (str2 != null && str2.length() > 0) { + Persistence persistenceForNimbleComponent = PersistenceService.getPersistenceForNimbleComponent(TAG, Persistence.Storage.CACHE); + ArrayList arrayList = (ArrayList) persistenceForNimbleComponent.getValue(GCMPersistentMessageID); + ArrayList arrayList2 = arrayList; + if (arrayList == null) { + arrayList2 = new ArrayList(); + } + arrayList2.add(str2); + persistenceForNimbleComponent.setValue(GCMPersistentMessageID, arrayList2); + persistenceForNimbleComponent.synchronize(); + } + } + } catch (Exception e2) { + Helper.LOGD(this, "GCM failed to save campaign ID to persistent. App was probably killed.", new Object[0]); + e2.printStackTrace(); + } + processIncomingMessage(context, str, str2, str3, extras); + } + + /* JADX INFO: Access modifiers changed from: protected */ + @Override // com.google.android.gcm.GCMBaseIntentService + public boolean onRecoverableError(Context context, String str) { + android.util.Log.i(TAG, "Received recoverable error: " + str); + return super.onRecoverableError(context, str); + } + + @Override // com.google.android.gcm.GCMBaseIntentService + protected void onRegistered(Context context, String str) { + android.util.Log.i(TAG, "Real - Device registered: regId = " + str); + PushNotification.register(context, str); + } + + @Override // com.google.android.gcm.GCMBaseIntentService + protected void onUnregistered(Context context, String str) { + android.util.Log.i(TAG, "Device unregistered"); + if (GCMRegistrar.isRegisteredOnServer(context)) { + PushNotification.unregister(context, str); + } else { + android.util.Log.i(TAG, "Ignoring unregister callback"); + } + } + + protected void processIncomingMessage(Context context, String str, String str2, String str3, Bundle bundle) { + if (!ApplicationEnvironment.isMainApplicationRunning() || ApplicationEnvironment.getCurrentActivity() == null) { + generateNotification(context, str, str2, str3, bundle); + } else { + showMessage(str, str2); + } + } + + protected void showMessage(String str, final String str2) { + if (str != null && ApplicationEnvironment.isMainApplicationRunning()) { + final AlertDialog.Builder builder = new AlertDialog.Builder(ApplicationEnvironment.getCurrentActivity()); + builder.setTitle(""); + builder.setMessage(str); + builder.setNegativeButton("OK", new DialogInterface.OnClickListener() { // from class: com.ea.nimble.pushnotificationgoogle.GCMIntentService.1 + @Override // android.content.DialogInterface.OnClickListener + public void onClick(DialogInterface dialogInterface, int i) { + ITracking iTracking; + if (!(Base.getComponent(Tracking.COMPONENT_ID) == null || (iTracking = (ITracking) Base.getComponent(Tracking.COMPONENT_ID)) == null)) { + HashMap hashMap = new HashMap(); + if (str2 != null) { + hashMap.put("NIMBLESTANDARD::KEY_PN_MESSAGE_ID", str2); + } + iTracking.logEvent(Tracking.EVENT_PN_USER_CLICKED_OK, hashMap); + } + dialogInterface.cancel(); + } + }); + ApplicationEnvironment.getCurrentActivity().runOnUiThread(new Runnable() { // from class: com.ea.nimble.pushnotificationgoogle.GCMIntentService.2 + @Override // java.lang.Runnable + public void run() { + builder.show(); + } + }); + } + } +} diff --git a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/IPushNotification.java b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/IPushNotification.java new file mode 100644 index 0000000..a63ed2c --- /dev/null +++ b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/IPushNotification.java @@ -0,0 +1,15 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.pushnotificationgoogle; + +import java.util.Map; + +public interface IPushNotification { + public void cleanup(); + + public void register(); + + public void sendPushNotificationTemplate(String var1, String var2, Map var3, Map var4); +} + diff --git a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/NimbleBroadcastReceiver.java b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/NimbleBroadcastReceiver.java new file mode 100644 index 0000000..07f4e0f --- /dev/null +++ b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/NimbleBroadcastReceiver.java @@ -0,0 +1,20 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.Context + */ +package com.ea.nimble.pushnotificationgoogle; + +import android.content.Context; +import com.ea.nimble.pushnotificationgoogle.GCMIntentService; +import com.google.android.gcm.GCMBroadcastReceiver; + +public class NimbleBroadcastReceiver +extends GCMBroadcastReceiver { + @Override + protected String getGCMIntentServiceClassName(Context context) { + return GCMIntentService.class.getName(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotification.java b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotification.java new file mode 100644 index 0000000..197f7f7 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotification.java @@ -0,0 +1,235 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + * android.util.Log + */ +package com.ea.nimble.pushnotificationgoogle; + +import static com.ea.easp.Debug.Log.d; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; + +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.Base; +import com.ea.nimble.Log.Helper; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.SynergyIdManager; +import com.ea.nimble.SynergyNetwork; +import com.ea.nimble.SynergyNetworkConnectionCallback; +import com.ea.nimble.SynergyNetworkConnectionHandle; +import com.ea.nimble.Utility; +import com.ea.nimble.identity.INimbleIdentity; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import com.google.android.gcm.GCMRegistrar; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; + +public class PushNotification { + public static final String COMPONENT_ID = "com.ea.nimble.pushnotificationgoogle"; + static final String DISPLAY_MESSAGE_ACTION = "com.ea.nimble.pushnotificationgoogle.DISPLAY_MESSAGE"; + static final String SENDER_ID = "927779459434"; + static String s_registerId = null; + + static void callSynergyRevokePushTokenByPid(String string2) { + Helper.LOGIS("PN", "GCM- SYNERGY ID2.0 registering device (regId = " + string2 + ")"); + HashMap hashMap = new HashMap(); + hashMap.put("pids", new String[]{string2}); + hashMap.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); + hashMap.put("clientApiVersion", "1.0.1"); + hashMap.put("hwId", SynergyEnvironment.getComponent().getEAHardwareId()); + SynergyNetwork.getComponent().sendPostRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/revokePids", null, hashMap, new SynergyNetworkConnectionCallback() { + + @Override + public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + if (synergyNetworkConnectionHandle.getResponse().getError() == null) { + Helper.LOGD(this, "Push Token revoke sent to synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + return; + } + Helper.LOGD(this, "Error: Push Token revoke unable to be sent. " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + } + }); + } + + static void callSynergyStorePushTokenByPid(String string2) { + if (!Utility.validString(string2)) { + return; + } + PushNotification.callSynergyStorePushTokenByPidArray(new String[]{string2}); + } + + private static void callSynergyStorePushTokenByPidArray(String[] stringArray) { + Helper.LOGIS("PN", "GCM- SYNERGY registering device with pids. PIDS WERE FOUND."); + if (!Utility.validString(s_registerId)) { + Helper.LOGW("PN", "No valid push token was found. GCM registration has failed. Please check the log above for a reason.\n Aborting storing token to synergy"); + return; + } + HashMap hashMap = new HashMap(); + hashMap.put("pids", stringArray); + hashMap.put("registrationId", s_registerId); + hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); + hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); + hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); + hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); + hashMap.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); + hashMap.put("network", "1"); + hashMap.put("clientApiVersion", "1.0.1"); + hashMap.put("hwId", SynergyEnvironment.getComponent().getEAHardwareId()); + SynergyNetwork.getComponent().sendPostRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/storePids", null, hashMap, new SynergyNetworkConnectionCallback() { + + @Override + public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + if (synergyNetworkConnectionHandle.getResponse().getError() == null) { + Helper.LOGD(this, "Push Token sent to synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + return; + } + Helper.LOGD(this, "Error: Push Token unable to be sent. " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + } + }); + } + + public static IPushNotification getComponent() { + return (IPushNotification) ((Object) Base.getComponent(COMPONENT_ID)); + } + + private static void initialize() { + Helper.LOGDS("PN", "initialize"); + Base.registerComponent(new PushNotificationImpl(), COMPONENT_ID); + } + + static boolean register(Context object, final String string2) { + boolean bl2; + boolean bl3 = bl2 = false; + if (!ApplicationEnvironment.isMainApplicationRunning()) return bl3; + bl3 = bl2; + if (ApplicationEnvironment.getCurrentActivity() == null) return bl3; + Helper.LOGDS("PN", "Push token returned from OS. Attempting to register token with snyergy backend."); + if (SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u") != null) { + PushNotification.registerTokenWithSynergy(object, string2); + return true; + } + Helper.LOGDS("PN", "Synergy backend URL is missing. /GetDirection is probably not finished or callback has not fired. Waiting... "); + BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { + + public void onReceive(Context context, Intent intent) { + Helper.LOGDS("PN", "Synergy PN URL found/startup is finished. Try PNs now."); + Bundle extras = intent.getExtras(); + if (extras == null) return; + if (!extras.getString("result").equals("1")) return; + PushNotification.registerTokenWithSynergy(context, string2); + } + }; + Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", broadcastReceiver); + Utility.registerReceiver("nimble.environment.notification.restored_from_persistent", broadcastReceiver); + return false; + } + + static void registerTokenWithSynergy(Context context, String string2) { + boolean bl2; + boolean bl3 = bl2 = false; + if (Base.getComponent("com.ea.nimble.identity") != null) { + List list = ((INimbleIdentity) ((Object) Base.getComponent("com.ea.nimble.identity"))).getAuthenticators(); + bl3 = bl2; + if (list != null) { + bl3 = bl2; + if (!list.isEmpty()) { + PushNotification.registerTokenWithSynergyID20Internal(context, string2); + bl3 = true; + } + } + } + if (bl3) return; + PushNotification.registerTokenWithSynergyInternal(context, string2); + } + + private static void registerTokenWithSynergyID20Internal(Context object, String list) { + s_registerId = list; + if (Base.getComponent("com.ea.nimble.identity") == null) return; + INimbleIdentity component = (INimbleIdentity) Base.getComponent("com.ea.nimble.identity"); + ArrayList arrayList = new ArrayList<>(); + arrayList.add(SynergyIdManager.getComponent().getSynergyId()); + if (arrayList.isEmpty()) return; + PushNotification.callSynergyStorePushTokenByPidArray(arrayList.toArray(new String[0])); + } + + private static void registerTokenWithSynergyInternal(final Context context, String string2) { + Helper.LOGIS("PN", "GCM- SYNERGY registering device (regId = " + string2 + ") using synergyId. PIDS WERE NOT FOUND."); + s_registerId = string2; + HashMap hashMap = new HashMap(); + hashMap.put("uid", Utility.safeString(SynergyIdManager.getComponent().getSynergyId())); + hashMap.put("registrationId", string2); + hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); + hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); + hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); + hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); + hashMap.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); + hashMap.put("network", "1"); + SynergyNetwork.getComponent().sendGetRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/storePushRegistrationId", hashMap, new SynergyNetworkConnectionCallback() { + + @Override + public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + if (synergyNetworkConnectionHandle.getResponse().getError() != null) return; + Helper.LOGD(this, "GCM Push Token registered with synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + GCMRegistrar.setRegisteredOnServer(context, true); + } + }); + } + + static void unregister(Context object, String object2) { + ArrayList object3 = new ArrayList(); + Log.d((String) "PN", (String) ("GCM - unregistering device (regId = " + (String) object2 + ")")); + ArrayList arrayList = new ArrayList(); + if (Base.getComponent("com.ea.nimble.identity") != null && ((INimbleIdentity) ((Object) Base.getComponent("com.ea.nimble.identity"))).getAuthenticators() != null) { + for (int i2 = 0; i2 < object3.size(); ++i2) { + if (((INimbleIdentityAuthenticator) object3.get(i2)).getPidInfo() == null || !Utility.validString(((INimbleIdentityAuthenticator) object3.get(i2)).getPidInfo().getPid())) + continue; + arrayList.add(((INimbleIdentityAuthenticator) object3.get(i2)).getPidInfo().getPid()); + } + } + + + HashMap hashMap = new HashMap<>(); + hashMap.put("pids", arrayList); + hashMap.put("registrationId", object2); + hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); + hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); + hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); + hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); + hashMap.put("network", "1"); + hashMap.put("clientApiVersion", "1.0.0"); + SynergyNetwork.getComponent().sendPostRequest((String) object2, "/m2u/api/android/revokePids", null, null, new SynergyNetworkConnectionCallback() { + + @Override + public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + if (synergyNetworkConnectionHandle.getResponse().getError() == null) { + Helper.LOGD(this, "Push Token removed to synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + return; + } + Helper.LOGD(this, "Error: Push Token removal unable to be sent. " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + } + }); + + + HashMap object5 = new HashMap<>(); + + object5.put("uid", Utility.safeString(SynergyIdManager.getComponent().getSynergyId())); + object5.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); + final Context finalContext = object; + SynergyNetwork.getComponent().sendGetRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/revokePushRegistrationId", object5, synergyNetworkConnectionHandle -> { + if (synergyNetworkConnectionHandle.getResponse().getError() != null) return; + d("GCM", "GCM Push Token unregistered with synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + GCMRegistrar.setRegisteredOnServer(finalContext, false); + }); + } +} + diff --git a/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotificationImpl.java b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotificationImpl.java new file mode 100644 index 0000000..8e41fc3 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/pushnotificationgoogle/PushNotificationImpl.java @@ -0,0 +1,280 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + * android.content.IntentFilter + */ +package com.ea.nimble.pushnotificationgoogle; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; + +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.Base; +import com.ea.nimble.Component; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.SynergyIdManager; +import com.ea.nimble.SynergyNetwork; +import com.ea.nimble.SynergyNetworkConnectionCallback; +import com.ea.nimble.SynergyNetworkConnectionHandle; +import com.ea.nimble.Utility; +import com.ea.nimble.identity.INimbleIdentity; +import com.ea.nimble.identity.INimbleIdentityAuthenticator; +import com.google.android.gcm.GCMRegistrar; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +public class PushNotificationImpl +extends Component +implements LogSource, +IPushNotification { + private BroadcastReceiver mAppLangChangedReceiver; + private BroadcastReceiver m_IdentityChangedReceiver; + private BroadcastReceiver m_handleMessageReceiver = new BroadcastReceiver(){ + + public void onReceive(Context context, Intent intent) { + Log.Helper.LOGV((Object)this, "got a message! someone loves me! wake up"); + } + }; + private BroadcastReceiver m_synergyIdChangedReceiver = new BroadcastReceiver(){ + + public void onReceive(Context context, Intent intent) { + PushNotificationImpl.this.onSynergyIdChanged(intent); + } + }; + + public PushNotificationImpl() { + this.mAppLangChangedReceiver = new BroadcastReceiver(){ + + public void onReceive(Context context, Intent intent) { + PushNotificationImpl.this.register(); + } + }; + this.m_IdentityChangedReceiver = new BroadcastReceiver(){ + + public void onReceive(Context object, Intent object2) { + Log.Helper.LOGD((Object)this, "identity changed - PN system attempting to register"); + if (object2 == null) return; + if (object2.getExtras() == null) return; + if (Base.getComponent("com.ea.nimble.identity") == null) { + Log.Helper.LOGD((Object)this, "identity changed - ID comp not found. Early out."); + return; + } + String authenticatorId = object2.getExtras().getString("authenticatorId"); + INimbleIdentityAuthenticator authenticatorById = ((INimbleIdentity) Base.getComponent("com.ea.nimble.identity")).getAuthenticatorById(authenticatorId); + if (object == null || authenticatorById.getPidInfo() == null) { + if (object == null) { + Log.Helper.LOGD(this, "identity changed - authObj was null"); + return; + } + Log.Helper.LOGD(this, "identity chagned - authObj.getPidInfo null"); + return; + } + String pid = authenticatorById.getPidInfo().getPid(); + if (authenticatorById.getState() == INimbleIdentityAuthenticator.NimbleIdentityAuthenticationState.NIMBLE_IDENTITY_AUTHENTICATION_SUCCESS) { + Log.Helper.LOGD((Object)this, "identity changed - PN system will store pid"); + PushNotification.callSynergyStorePushTokenByPid(pid); + return; + } + Log.Helper.LOGD((Object)this, "identity changed - PN system will revoke pid"); + PushNotification.callSynergyRevokePushTokenByPid(pid); + } + }; + } + + private void checkNotNull(Object object, String string2) { + if (object != null) return; + throw new NullPointerException("Error: null ptr"); + } + + private void onSynergyIdChanged(Intent object) { + String string2 = object.getStringExtra("previousSynergyId"); + if (!Utility.validString(object.getStringExtra("currentSynergyId"))) return; + if (PushNotification.s_registerId == null) return; + HashMap hashMap = new HashMap(); + hashMap.put("uid", ""); + hashMap.put("registrationId", PushNotification.s_registerId); + hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); + hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); + hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); + hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); + hashMap.put("sellId", SynergyEnvironment.getComponent().getSellId()); + hashMap.put("network", "1"); + if (Utility.validString(string2)) { + hashMap.put("revokeId", string2); + } + SynergyNetwork.getComponent().sendGetRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/storePushRegistrationId", hashMap, new SynergyNetworkConnectionCallback(){ + + @Override + public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + if (synergyNetworkConnectionHandle.getResponse().getError() != null) { + Log.Helper.LOGD(this, "ERROR: unable to register token with synergy: " + synergyNetworkConnectionHandle.getResponse().getError()); + return; + } + Log.Helper.LOGD(this, "PUSH NOTIFICATION TOKEN sent to synergy"); + } + }); + } + + @Override + public void cleanup() { + Context context = ApplicationEnvironment.getComponent().getApplicationContext(); + if (this.m_handleMessageReceiver != null) { + context.unregisterReceiver(this.m_handleMessageReceiver); + } + GCMRegistrar.onDestroy(context); + Utility.unregisterReceiver(this.m_synergyIdChangedReceiver); + Utility.unregisterReceiver(this.m_IdentityChangedReceiver); + } + + @Override + public String getComponentId() { + return "com.ea.nimble.pushnotificationgoogle"; + } + + @Override + public String getLogSourceTitle() { + return "PN"; + } + + @Override + public void register() { + this.trackStuff(); + this.checkNotNull("927779459434", "SENDER_ID"); + Log.Helper.LOGD(this, "Nimble PN Component is attempting to register this application for push notifications with the GCM service"); + Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); + try { + GCMRegistrar.checkDevice(applicationContext); + GCMRegistrar.checkManifest(applicationContext); + } + catch (Exception exception) { + Log.Helper.LOGD(this, "Nimble PN Component reports that GCMRegistrar checks have failed. PN service will not be available"); + this.m_handleMessageReceiver = null; + return; + } + Log.Helper.LOGD(this, "Nimble PN Component has passed GCMRegistrar checks and will now attempt to get a valid push token"); + new IntentFilter("com.ea.nimble.pushnotificationgoogle.intent.RETRY").addCategory("com.ea.nimble.pushnotificationgoogle"); + applicationContext.registerReceiver(this.m_handleMessageReceiver, new IntentFilter("com.ea.nimble.pushnotificationgoogle.DISPLAY_MESSAGE")); + + final String string2 = GCMRegistrar.getRegistrationId(applicationContext); + if (string2.equals("")) { + Log.Helper.LOGV(this, "GCM - attempting to register with google"); + GCMRegistrar.register(applicationContext, "927779459434"); + return; + } + Log.Helper.LOGV(this, "GCM - Already registered"); + if (SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u") != null) { + if (ApplicationEnvironment.getComponent() == null) return; + if (!SynergyEnvironment.getComponent().isDataAvailable()) return; + PushNotification.registerTokenWithSynergy(applicationContext, string2); + return; + } + Log.Helper.LOGD(this, "GCM - Already registered but nimble does not have synergy URL so we can not store token yet... waiting..."); + BroadcastReceiver br = new BroadcastReceiver(){ + + public void onReceive(Context context, Intent intent) { + if (intent.getExtras() == null) return; + if (!intent.getStringExtra("result").equals("1")) return; + Log.Helper.LOGD((Object)this, "GCM - received notification that environment is online. Sending token to synergy"); + PushNotification.registerTokenWithSynergy(context, string2); + } + }; + Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", br); + Utility.registerReceiver("nimble.environment.notification.restored_from_persistent", br); + } + + @Override + public void restore() { + Log.Helper.LOGD(this, "restore"); + this.register(); + Utility.registerReceiver("nimble.synergyidmanager.notification.synergy_id_changed", this.m_synergyIdChangedReceiver); + Utility.registerReceiver("nimble.notification.LanguageChanged", this.mAppLangChangedReceiver); + Utility.registerReceiver("nimble.notification.identity.authenticator.pid.info.update", this.m_IdentityChangedReceiver); + } + + @Override + public void resume() { + Log.Helper.LOGD(this, "resume"); + this.register(); + Utility.registerReceiver("nimble.synergyidmanager.notification.synergy_id_changed", this.m_synergyIdChangedReceiver); + } + + @Override + public void sendPushNotificationTemplate(String string2, String string3, Map arrayList, Map object) { + Object object2; + Log.Helper.LOGI(this, "GCM- SYNERGY "); + HashMap hashMap = new HashMap<>(); + String object3 = ""; + if (!arrayList.isEmpty()) { + for (Map.Entry object4 : arrayList.entrySet()) { + object2 = new HashMap(); + hashMap.put(object4.getKey(), object4.getValue()); + } + } + hashMap.put("overrideValues", object3); + if (!object.isEmpty()) { + for (Map.Entry entry : object.entrySet()) { + object3 = "custom_" + (String)entry.getKey(); + object2 = (String)entry.getValue(); + try { + String string4 = URLEncoder.encode((String)object3, "UTF-8").replaceAll("\\*", "%2A"); + object2 = URLEncoder.encode((String)object2, "UTF-8").replaceAll("\\*", "%2A"); + HashMap hashMap2 = new HashMap(); + hashMap2.put("name", string4); + hashMap2.put("value", object2); + } + catch (UnsupportedEncodingException unsupportedEncodingException) { + Log.Helper.LOGD(this, "Error: PushNotificationTemplate can not parse the custom parameter fields for key" + (String)object3); + unsupportedEncodingException.printStackTrace(); + } + } + } + hashMap.put("customMessages", arrayList); + hashMap.put("uid", Utility.safeString(SynergyIdManager.getComponent().getSynergyId())); + hashMap.put("targetUserId", string2); + hashMap.put("language", Utility.safeString(ApplicationEnvironment.getComponent().getShortApplicationLanguageCode())); + hashMap.put("localization", Utility.safeString(ApplicationEnvironment.getComponent().getApplicationLanguageCode())); + hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); + hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); + hashMap.put("sellId", Utility.safeString(SynergyEnvironment.getComponent().getSellId())); + hashMap.put("clientApiVersion", "1.2.1"); + hashMap.put("templateCode", string3); + hashMap.put("verificationCode", ""); + SynergyNetwork.getComponent().sendPostRequest(SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.m2u"), "/m2u/api/android/sendPushNotificationTemplateByUid", null, hashMap, new SynergyNetworkConnectionCallback(){ + + @Override + public void callback(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + if (synergyNetworkConnectionHandle.getResponse().getError() == null) { + Log.Helper.LOGD(this, "Push Notification sent to synergy. Status code: " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + return; + } + Log.Helper.LOGD(this, "Error: PN unable to be sent. " + synergyNetworkConnectionHandle.getResponse().getHttpResponse().getStatusCode()); + } + }); + } + + @Override + public void setup() { + Log.Helper.LOGD(this, "setup"); + } + + @Override + public void suspend() { + Log.Helper.LOGD(this, "suspend"); + Utility.unregisterReceiver(this.m_synergyIdChangedReceiver); + } + + public void trackStuff(){} +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/ITracking.java b/app/src/main/java/com/ea/nimble/tracking/ITracking.java new file mode 100644 index 0000000..88487b1 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/ITracking.java @@ -0,0 +1,21 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import java.util.Map; + +public interface ITracking { + public void addCustomSessionData(String var1, String var2); + + public void clearCustomSessionData(); + + public boolean getEnable(); + + public void logEvent(String var1, Map var2); + + public void setEnable(boolean var1); + + public void setTrackingAttribute(String var1, String var2); +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java new file mode 100644 index 0000000..a3fbbf7 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingImplBase.java @@ -0,0 +1,807 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.Activity + * android.app.ActivityManager + * android.app.ActivityManager$MemoryInfo + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + * android.util.Log + */ +package com.ea.nimble.tracking; + +import android.app.Activity; +import android.app.ActivityManager; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.Component; +import com.ea.nimble.EASPDataLoader; +import com.ea.nimble.IHttpResponse; +import com.ea.nimble.Log.Helper; +import com.ea.nimble.LogSource; +import com.ea.nimble.Network; +import com.ea.nimble.Persistence; +import com.ea.nimble.PersistenceService; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.SynergyNetwork; +import com.ea.nimble.SynergyNetworkConnectionCallback; +import com.ea.nimble.SynergyNetworkConnectionHandle; +import com.ea.nimble.SynergyRequest; +import com.ea.nimble.Utility; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.ScheduledFuture; + +abstract class NimbleTrackingImplBase +extends Component +implements LogSource, +ITracking { + private static final int DATA_VERSION_CURRENT = 3; + private static final int DEFAULT_MAX_QUEUE_LENGTH = 3; + protected static final double DEFAULT_POST_INTERVAL = 1.0; + protected static final double DEFAULT_REPOST_MULTIPLIER = 2.0; + protected static final double DEFAULT_RETRY_DELAY = 1.0; + protected static final double MAX_POST_RETRY_DELAY = 300.0; + private static final int MAX_QUEUED_EVENTS = 50; + private static final int MAX_QUEUED_SESSIONS = 50; + protected static final double NOW_POST_INTERVAL = 0.0; + private static final String ORIGIN_LOGIN_STATUS_STRING_AUTO_LOGGING_IN = "autoLogin"; + private static final String ORIGIN_LOGIN_STATUS_STRING_LIVE_USER = "live"; + private static final String ORIGIN_NOTIFICATION_LOGIN_STATUS_UPDATE_KEY_STATUS = "STATUS"; + private static final String PERSISTENCE_CURRENT_SESSION_ID = "currentSessionObject"; + private static final String PERSISTENCE_ENABLE_FLAG = "trackingEnabledFlag"; + private static final String PERSISTENCE_EVENT_QUEUE_ID = "eventQueue"; + private static final String PERSISTENCE_FIRST_SESSION_ID_NUMBER = "firstSessionIDNumber"; + private static final String PERSISTENCE_LAST_SESSION_ID_NUMBER = "lastSessionIDNumber"; + private static final String PERSISTENCE_LOGGED_IN_TO_ORIGIN_ID = "loggedInToOrigin"; + private static final String PERSISTENCE_QUEUED_SESSIONS_ID = "queuedSessionObjects"; + private static final String PERSISTENCE_SAVED_SESSION_ID_NUMBER = "savedSession"; + private static final String PERSISTENCE_SESSION_DATA_ID = "sessionData"; + private static final String PERSISTENCE_TOTAL_SESSION_COUNT = "totalSessionCount"; + private static final String PERSISTENCE_TRACKING_ATTRIBUTES = "trackingAttributes"; + private static final String PERSISTENCE_VERSION_ID = "dataVersion"; + private static final String SESSION_FILE_FORMAT = "%sSession%d"; + protected TrackingBaseSessionObject m_currentSessionObject; + protected ArrayList m_customSessionData; + private boolean m_enable = true; + private long m_firstSessionIDNumber = 0L; + private boolean m_isPostPending = false; + private boolean m_isRequestInProgress = false; + private long m_lastSessionIDNumber = -1L; + protected boolean m_loggedInToOrigin = false; + private int m_maxQueueLength = 3; + private BroadcastReceiver m_networkStatusChangedReceiver = null; + private OriginLoginStatusChangedReceiver m_originLoginStatusChangedReceiver = null; + private ArrayList> m_pendingEvents; + private double m_postInterval = 1.0; + protected double m_postRetryDelay; + private ScheduledFuture m_postTimer; + private StartupRequestsFinishedReceiver m_receiver = null; + private ArrayList m_sessionsToPost = new ArrayList(); + protected NimbleTrackingThreadManager m_threadManager; + private long m_totalSessions = 0L; + protected HashMap m_trackingAttributes; + + NimbleTrackingImplBase() { + this.m_pendingEvents = new ArrayList(); + this.m_customSessionData = new ArrayList(); + this.m_currentSessionObject = new TrackingBaseSessionObject(); + this.m_trackingAttributes = new HashMap(); + } + + private void addCurrentSessionObjectToBackOfQueue() { + ++this.m_lastSessionIDNumber; + ++this.m_totalSessions; + if (this.m_sessionsToPost.size() >= this.m_maxQueueLength) { + this.saveSessionToFile(this.m_currentSessionObject, this.m_lastSessionIDNumber); + } else { + this.m_sessionsToPost.add(this.m_currentSessionObject); + } + this.saveToPersistence(); + } + + private void configureTrackingOnFirstInstall() { + Helper.LOGD(this, "First Install. Look for App Settings to enable/disable tracking"); + try { + String string2 = ApplicationEnvironment.getCurrentActivity().getPackageManager().getApplicationInfo((String)ApplicationEnvironment.getCurrentActivity().getPackageName(), (int)128).metaData.getString("com.ea.nimble.tracking.defaultEnable"); + if (Utility.validString(string2)) { + if (string2.equalsIgnoreCase("enable")) { + Helper.LOGD(this, "Default App Setting : Enable Tracking"); + this.m_enable = true; + return; + } + if (!string2.equalsIgnoreCase("disable")) return; + Helper.LOGD(this, "Default App Setting : Disable Tracking"); + this.m_enable = false; + return; + } + } + catch (Exception exception) { + // empty catch block + } + Log.e((String)"Nimble", (String)"WARNING! Cannot find valid TrackingEnable from AndroidManifest.xml"); + } + + private void dropExtraSessions() { + if (this.dropExtraSessions(true)) return; + Helper.LOGD(this, "Failed to drop enough sessions. Dropping sessions without checking canDropSession."); + if (this.dropExtraSessions(false)) return; + Helper.LOGE(this, "Still unable to drop enough sessions. Remaining number: " + (this.m_lastSessionIDNumber - this.m_firstSessionIDNumber + 1L)); + } + + private boolean dropExtraSessions(boolean bl2) { + long l2; + if (this.m_totalSessions < 50L) { + return true; + } + Helper.LOGD(this, "Current number of sessions (%d) has reached maximum (%d). Removing old sessions.", this.m_totalSessions, 50); + ArrayList arrayList = new ArrayList(); + for (l2 = this.m_firstSessionIDNumber; l2 <= this.m_lastSessionIDNumber; ++l2) { + TrackingBaseSessionObject trackingBaseSessionObject; + long l3 = l2 - this.m_firstSessionIDNumber; + if (l3 < (long)this.m_sessionsToPost.size()) { + trackingBaseSessionObject = this.m_sessionsToPost.get((int)l3); + } else { + TrackingBaseSessionObject trackingBaseSessionObject2; + trackingBaseSessionObject = trackingBaseSessionObject2 = this.loadSessionFromFile(l2); + if (trackingBaseSessionObject2 == null) continue; + } + if (arrayList.size() == 0 || this.isSameSession(arrayList.get(arrayList.size() - 1), trackingBaseSessionObject)) { + arrayList.add(trackingBaseSessionObject); + continue; + } + if (!bl2 || this.canDropSession(arrayList)) { + this.dropSessions(arrayList, l2 - 1L); + } + arrayList.clear(); + if (this.m_totalSessions < 50L) { + this.fillSessionsToPost(); + return true; + } + arrayList.add(trackingBaseSessionObject); + } + if (arrayList.size() > 0 && (!bl2 || this.canDropSession(arrayList))) { + this.dropSessions(arrayList, l2 - 1L); + } + this.fillSessionsToPost(); + if (this.m_totalSessions >= 50L) return false; + return true; + } + + private void dropSessions(ArrayList arrayList, long l2) { + for (int i2 = 0; i2 < arrayList.size(); ++i2) { + this.m_sessionsToPost.remove(arrayList.get(i2)); + PersistenceService.removePersistenceForNimbleComponent(this.getFilenameForSessionID(l2 - (long)i2), Persistence.Storage.DOCUMENT); + } + if (l2 - (long)arrayList.size() + 1L == this.m_firstSessionIDNumber) { + this.m_firstSessionIDNumber += (long)arrayList.size(); + } + this.m_totalSessions -= (long)arrayList.size(); + this.saveToPersistence(); + } + + private void fillSessionsToPost() { + int n2 = this.m_sessionsToPost.size(); + while (n2 < this.m_maxQueueLength) { + long l2 = this.m_firstSessionIDNumber + (long)n2; + if (l2 > this.m_lastSessionIDNumber) { + return; + } + TrackingBaseSessionObject trackingBaseSessionObject = this.loadSessionFromFile(l2); + if (trackingBaseSessionObject != null) { + this.m_sessionsToPost.add(trackingBaseSessionObject); + PersistenceService.removePersistenceForNimbleComponent(this.getFilenameForSessionID(l2), Persistence.Storage.DOCUMENT); + } else { + ++this.m_firstSessionIDNumber; + } + ++n2; + } + } + + private String getFilenameForSessionID(long l2) { + if (l2 >= 0L) return String.format(Locale.US, SESSION_FILE_FORMAT, this.getComponentId(), l2); + Helper.LOGE(this, "Trying to find the filename for an invalid sessionID!"); + return null; + } + + private boolean isAbleToPostEvent(boolean bl2) { + if (!this.m_enable) { + return false; + } + if (!(bl2 || ApplicationEnvironment.isMainApplicationRunning() && ApplicationEnvironment.getCurrentActivity() != null)) { + Helper.LOGD(this, "isAbleToPostEvent - return because the app is in background"); + return false; + } + if (Network.getComponent().getStatus() != Network.Status.OK) { + if (this.m_networkStatusChangedReceiver != null) return false; + Helper.LOGD(this, "Network status not OK for event post. Adding receiver for network status change."); + this.killPostTimer(); + this.m_networkStatusChangedReceiver = new BroadcastReceiver(){ + + public void onReceive(Context context, Intent intent) { + if (!intent.getAction().equals("nimble.notification.networkStatusChanged")) return; + NimbleTrackingImplBase.this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingImplBase.this.onNetworkStatusChange(); + } + }); + } + }; + Utility.registerReceiver("nimble.notification.networkStatusChanged", this.m_networkStatusChangedReceiver); + return false; + } + if (SynergyEnvironment.getComponent().isDataAvailable()) return true; + this.m_isPostPending = true; + this.addObserverForSynergyEnvironmentUpdateFinished(); + return false; + } + + private void killPostTimer() { + if (this.m_postTimer == null) return; + this.m_postTimer.cancel(false); + this.m_postTimer = null; + } + + private TrackingBaseSessionObject loadSessionFromFile(long l2) { + Object object = PersistenceService.getPersistenceForNimbleComponent(this.getFilenameForSessionID(l2), Persistence.Storage.DOCUMENT); + if (object == null) return null; + if ((object = ((Persistence)object).getValue(PERSISTENCE_SAVED_SESSION_ID_NUMBER)) == null) return null; + if (object.getClass() != TrackingBaseSessionObject.class) return null; + return (TrackingBaseSessionObject)object; + } + + private void logEvent(Tracking.Event iterator, boolean bl2) { + List> maps = this.convertEvent((Tracking.Event) ((Object) iterator)); + if (maps != null && !maps.isEmpty()) { + for (Map map : maps) { + this.m_currentSessionObject.events.add(map); + Helper.LOGD(this, "Logged event, %s: \n", map); + } + this.saveToPersistence(); + if (!bl2 && (this.m_postTimer == null || this.m_postTimer.isDone() && !this.m_isRequestInProgress) && this.isAbleToPostEvent(false)) { + this.resetPostTimer(); + } + } + boolean bl3 = bl2; + if (this.m_currentSessionObject.events.size() >= 50) { + Helper.LOGD(this, "Current number of events (%d) has reached maximum (%d). Posting event queue now.", this.m_currentSessionObject.events.size(), 50); + bl3 = true; + } + if (!bl3) return; + this.killPostTimer(); + this.packageCurrentSession(); + this.postPendingEvents(bl2); + } + + private void onNetworkStatusChange() { + if (Network.getComponent().getStatus() != Network.Status.OK) return; + Helper.LOGD(this, "Network status restored, kicking off event post."); + Utility.unregisterReceiver(this.m_networkStatusChangedReceiver); + this.m_networkStatusChangedReceiver = null; + this.resetPostTimer(0.0); + } + + private void onOriginLoginStatusChanged(Intent object) { + if (object.getExtras() == null) { + Helper.LOGI(this, "Login status updated event received without extras bundle. Marking NOT logged in to Origin."); + this.m_loggedInToOrigin = false; + return; + } + if (!(object.getExtras().getString(ORIGIN_NOTIFICATION_LOGIN_STATUS_UPDATE_KEY_STATUS)).equals(ORIGIN_LOGIN_STATUS_STRING_LIVE_USER) && !object.equals(ORIGIN_LOGIN_STATUS_STRING_AUTO_LOGGING_IN)) { + Helper.LOGI(this, "Login status update, FALSE"); + this.m_loggedInToOrigin = false; + return; + } + Helper.LOGI(this, "Login status update, TRUE"); + this.m_loggedInToOrigin = true; + } + + private void onPostComplete(SynergyNetworkConnectionHandle synergyNetworkConnectionHandle, TrackingBaseSessionObject trackingBaseSessionObject) { + if (synergyNetworkConnectionHandle == null || synergyNetworkConnectionHandle.getResponse() == null) { + Helper.LOGE(this, "No response exists in this post!"); + return; + } + boolean bl2 = false; + double d2 = 1.0; + if (synergyNetworkConnectionHandle.getResponse().getError() == null) { + this.removeSessionAndFillQueue(trackingBaseSessionObject); + this.m_postRetryDelay = 1.0; + d2 = this.m_postInterval; + } else { + IHttpResponse iHttpResponse = synergyNetworkConnectionHandle.getResponse().getHttpResponse(); + if (iHttpResponse != null && (iHttpResponse.getStatusCode() == 400 || iHttpResponse.getStatusCode() == 415)) { + Helper.LOGE(this, "Received HTTP status %d. Discarding post.", iHttpResponse.getStatusCode()); + this.removeSessionAndFillQueue(trackingBaseSessionObject); + this.m_postRetryDelay = 1.0; + d2 = this.m_postInterval; + } else { + Helper.LOGE(this, "Failed to send tracking events. Error: %s", synergyNetworkConnectionHandle.getResponse().getError().getLocalizedMessage()); + bl2 = true; + } + } + Helper.LOGI(this, "Telemetry post request finished, resetting isRequestInProgress flag to false."); + this.m_isRequestInProgress = false; + if (bl2) { + d2 = this.m_postRetryDelay; + this.m_postRetryDelay *= 2.0; + if (this.m_postRetryDelay > 300.0) { + this.m_postRetryDelay = 300.0; + } + Helper.LOGI(this, "Posting a retry with delay of %s due to failed send. Queue size: %d", d2, this.m_sessionsToPost.size()); + this.resetPostTimer(d2, false); + return; + } + if (this.m_sessionsToPost != null && !this.m_sessionsToPost.isEmpty()) { + Helper.LOGI(this, "More items found in the queue. Post the next one now. Queue size: %d", this.m_sessionsToPost.size()); + this.resetPostTimer(0.0, false); + return; + } + Helper.LOGI(this, "No more items found in the queue. Wait on the timer. Queue size: %d", this.m_sessionsToPost.size()); + this.resetPostTimer(d2, true); + } + + private void onStartupRequestsFinished(Intent object) { + if (object.getExtras() == null) return; + if (!object.getExtras().getString("result").equals("1")) return; + int n2 = SynergyEnvironment.getComponent().getTrackingPostInterval(); + this.m_postInterval = n2 < 0 || n2 == -1 ? 1.0 : (double)n2; + if (this.m_sessionsToPost != null) { + for (TrackingBaseSessionObject trackingBaseSessionObject : this.m_sessionsToPost) { + if (trackingBaseSessionObject == null || trackingBaseSessionObject.sessionData == null) continue; + Object object2 = trackingBaseSessionObject.sessionData.get("sellId"); + if (object2 != null && object2 instanceof String && (((String)object2).equals("") || ((String)object2).equals("0"))) { + object2 = SynergyEnvironment.getComponent().getSellId(); + trackingBaseSessionObject.sessionData.put("sellId", Utility.safeString((String)object2)); + if (object2 == null || ((String)object2).equals("") || ((String)object2).equals("0")) { + Helper.LOGE(this, "Sell Id was still null after synergy update"); + } + } + if ((object2 = trackingBaseSessionObject.sessionData.get("hwId")) != null && object2 instanceof String && ((String)object2).equals("")) { + object2 = SynergyEnvironment.getComponent().getEAHardwareId(); + trackingBaseSessionObject.sessionData.put("hwId", Utility.safeString((String)object2)); + if (object2 == null || ((String)object2).equals("")) { + Helper.LOGE(this, "Hardware Id was still null after synergy update"); + } + } + if ((object2 = trackingBaseSessionObject.sessionData.get("deviceId")) == null || !(object2 instanceof String) || !((String)object2).equals("") && !((String)object2).equals("0")) continue; + object2 = SynergyEnvironment.getComponent().getEADeviceId(); + trackingBaseSessionObject.sessionData.put("deviceId", Utility.safeString((String)object2)); + if (object2 != null && !((String)object2).equals("") && !((String)object2).equals("0")) continue; + Helper.LOGE(this, "Device Id was still null after synergy update"); + } + } + Helper.LOGI(this, "Synergy environment update successful. Removing observer and re-attempting event post."); + if (this.m_receiver != null) { + Utility.unregisterReceiver(this.m_receiver); + this.m_receiver = null; + } + if (!this.m_isPostPending) return; + this.m_isPostPending = false; + this.resetPostTimer(0.0); + } + + private void postIntervalTimerExpired(boolean bl2) { + if (bl2) { + this.packageCurrentSession(); + } + this.postPendingEvents(false); + } + + private void postPendingEvents(boolean bl2) { + if (!this.isAbleToPostEvent(bl2)) { + return; + } + if (this.m_sessionsToPost == null || this.m_sessionsToPost.size() <= 0) { + Helper.LOGD(this, "No tracking sessions to post."); + return; + } + TrackingBaseSessionObject trackingBaseSessionObject = this.m_sessionsToPost.get(0); + while (trackingBaseSessionObject == null) { + this.removeSessionAndFillQueue(null); + if (this.m_sessionsToPost.size() <= 0) { + Helper.LOGD(this, "No valid tracking sessions to post."); + return; + } + trackingBaseSessionObject = this.m_sessionsToPost.get(0); + } + SynergyRequest synergyRequest = this.createPostRequest(trackingBaseSessionObject); + if (synergyRequest == null) return; + synergyRequest.httpRequest.runInBackground = bl2; + Helper.LOGD(this, "Event queue marshalled. Incrementing repost count from %d to %d", trackingBaseSessionObject.repostCount, trackingBaseSessionObject.repostCount + 1); + ++trackingBaseSessionObject.repostCount; + this.m_isRequestInProgress = true; + final NimbleTrackingThreadManager nimbleTrackingThreadManager = NimbleTrackingThreadManager.acquireInstance(); + try { + TrackingBaseSessionObject finalTrackingBaseSessionObject = trackingBaseSessionObject; + SynergyNetwork.getComponent().sendRequest(synergyRequest, new SynergyNetworkConnectionCallback(){ + + @Override + public void callback(final SynergyNetworkConnectionHandle synergyNetworkConnectionHandle) { + nimbleTrackingThreadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingImplBase.this.onPostComplete(synergyNetworkConnectionHandle, finalTrackingBaseSessionObject); + } + }); + NimbleTrackingThreadManager.releaseInstance(); + } + }); + return; + } + catch (OutOfMemoryError outOfMemoryError) { + Activity activity = ApplicationEnvironment.getCurrentActivity(); + if (activity != null) { + ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo(); + ((ActivityManager)activity.getSystemService(Activity.ACTIVITY_SERVICE)).getMemoryInfo(memoryInfo); + long l2 = memoryInfo.availMem / 0x100000L; + Helper.LOGI(this, "OutOfMemoryError with " + l2 + " MB left. Dropping current session"); + } else { + Helper.LOGI(this, "Out of memory. Dropping current session"); + } + NimbleTrackingThreadManager.releaseInstance(); + double d2 = this.m_postInterval; + this.removeSessionAndFillQueue(trackingBaseSessionObject); + this.m_postRetryDelay = 1.0; + this.m_isRequestInProgress = false; + if (this.m_sessionsToPost != null && !this.m_sessionsToPost.isEmpty()) { + Helper.LOGI(this, "More items found in the queue. Post the next one now. Queue size: %d", this.m_sessionsToPost.size()); + this.resetPostTimer(0.0, false); + return; + } + Helper.LOGI(this, "No more items found in the queue. Wait on the timer. Queue size: %d", this.m_sessionsToPost.size()); + this.resetPostTimer(d2, true); + return; + } + } + + private void removeSessionAndFillQueue(TrackingBaseSessionObject trackingBaseSessionObject) { + this.m_sessionsToPost.remove(trackingBaseSessionObject); + ++this.m_firstSessionIDNumber; + --this.m_totalSessions; + this.fillSessionsToPost(); + this.saveToPersistence(); + } + + private void resetPostTimer() { + this.resetPostTimer(this.m_postInterval); + } + + private void resetPostTimer(double d2, boolean bl2) { + double d3; + double d4 = d3 = d2; + if (d3 < 0.0) { + Helper.LOGE(this, "resetPostTimer called with an invalid period: period < 0.0. Timer reset with period 0.0 instead"); + d4 = 0.0; + } + Helper.LOGI(this, "Resetting event post timer for %s seconds.", d2); + this.killPostTimer(); + this.m_postTimer = this.m_threadManager.createTimer(d4, new PostTask(bl2)); + } + + private void saveSessionDataToPersistent() { + Persistence persistence = PersistenceService.getPersistenceForNimbleComponent(this.getComponentId(), Persistence.Storage.CACHE); + Helper.LOGI(this, "Saving event queue to persistence."); + persistence.setValue(PERSISTENCE_SESSION_DATA_ID, this.m_customSessionData); + persistence.synchronize(); + } + + /* + * Unable to fully structure code + */ + private void saveSessionToFile(TrackingBaseSessionObject var1_1, long var2_3) { + String var4_4 = this.getFilenameForSessionID(var2_3); + Persistence var5_5 = PersistenceService.getPersistenceForNimbleComponent(var4_4, Persistence.Storage.DOCUMENT); + if (var5_5.getBackUp()) { + var5_5.setBackUp(false); + } + try { + var5_5.setValue("savedSession", var1_1); + var5_5.synchronize(); + } + catch (OutOfMemoryError var1_2) { + Helper.LOGE(this, "OutOfMemoryError occurred while saving a session object to file. Exception: %s", var1_2.getLocalizedMessage()); + } + PersistenceService.cleanReferenceToPersistence(var4_4, Persistence.Storage.DOCUMENT); + } + + /* + * Exception decompiling + */ + private void saveToPersistence() { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Tried to end blocks [0[TRYBLOCK]], but top level block is 3[CATCHBLOCK] + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.processEndingBlocks(Op04StructuredStatement.java:435) + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:484) + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + * at the.bytecode.club.bytecodeviewer.decompilers.impl.CFRDecompiler.decompileToZip(CFRDecompiler.java:306) + * at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling.lambda$null$1(ResourceDecompiling.java:114) + * at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling$$Lambda$144/691390785.run(Unknown Source) + * at java.lang.Thread.run(Unknown Source) + */ + throw new IllegalStateException("Decompilation failed"); + } + + @Override + public void addCustomSessionData(String string2, String string3) { + if (!Utility.validString(string2)) return; + if (!Utility.validString(string3)) { + return; + } + SessionData sessionData = new SessionData(); + sessionData.key = string2; + sessionData.value = string3; + this.m_customSessionData.add(sessionData); + this.saveSessionDataToPersistent(); + } + + protected void addObserverForSynergyEnvironmentUpdateFinished() { + if (this.m_receiver != null) return; + this.m_receiver = new StartupRequestsFinishedReceiver(); + Utility.registerReceiver("nimble.environment.notification.startup_requests_finished", this.m_receiver); + } + + protected boolean canDropSession(List list) { + return true; + } + + @Override + protected void cleanup() { + this.killPostTimer(); + EASPDataLoader.deleteDatFile(EASPDataLoader.getTrackingDatFilePath()); + } + + @Override + public void clearCustomSessionData() { + this.m_customSessionData.clear(); + this.saveSessionDataToPersistent(); + } + + protected abstract List> convertEvent(Tracking.Event var1); + + protected abstract SynergyRequest createPostRequest(TrackingBaseSessionObject var1); + + @Override + public boolean getEnable() { + return this.m_enable; + } + + @Override + public String getLogSourceTitle() { + return "TrackingBase"; + } + + protected abstract String getPersistenceIdentifier(); + + protected boolean isSameSession(TrackingBaseSessionObject trackingBaseSessionObject, TrackingBaseSessionObject trackingBaseSessionObject2) { + return false; + } + + @Override + public void logEvent(String string2, Map map) { + if (!this.m_enable) { + return; + } + boolean bl2 = false; + if (string2.equals("NIMBLESTANDARD::SESSION_END")) { + Helper.LOGD(this, "Logging session end event, " + string2 + ". Posting event queue now."); + bl2 = true; + } + Tracking.Event event = new Tracking.Event(); + event.type = string2; + event.parameters = map; + event.timestamp = new Date(); + this.logEvent(event, bl2); + } + + protected abstract void packageCurrentSession(); + + protected void queueCurrentEventsForPost() { + Helper.LOGI(this, "queueCurrentEventsForPost called. Starting queue size: %d", this.m_sessionsToPost.size()); + if (this.m_sessionsToPost == null) { + this.m_sessionsToPost = new ArrayList(); + } + if (this.m_currentSessionObject == null) { + Helper.LOGE(this, "Unexpected state, currentSessionObject is null."); + } else if (this.m_currentSessionObject.countOfEvents() == 0) { + Helper.LOGE(this, "Unexpected state, currentSessionObject events list is null or empty."); + } else { + this.addCurrentSessionObjectToBackOfQueue(); + this.dropExtraSessions(); + } + this.m_currentSessionObject = new TrackingBaseSessionObject(new HashMap(this.m_currentSessionObject.sessionData)); + } + + protected void resetPostTimer(double d2) { + this.resetPostTimer(d2, true); + } + + /* + * Exception decompiling + */ + @Override + protected void restore() { + /* + * This method has failed to decompile. When submitting a bug report, please provide this stack trace, and (if you hold appropriate legal rights) the relevant class file. + * + * org.benf.cfr.reader.util.ConfusedCFRException: Started 2 blocks at once + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.getStartingBlocks(Op04StructuredStatement.java:412) + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op04StructuredStatement.buildNestedBlocks(Op04StructuredStatement.java:487) + * at org.benf.cfr.reader.bytecode.analysis.opgraph.Op03SimpleStatement.createInitialStructuredBlock(Op03SimpleStatement.java:736) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisInner(CodeAnalyser.java:850) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysisOrWrapFail(CodeAnalyser.java:278) + * at org.benf.cfr.reader.bytecode.CodeAnalyser.getAnalysis(CodeAnalyser.java:201) + * at org.benf.cfr.reader.entities.attributes.AttributeCode.analyse(AttributeCode.java:94) + * at org.benf.cfr.reader.entities.Method.analyse(Method.java:531) + * at org.benf.cfr.reader.entities.ClassFile.analyseMid(ClassFile.java:1055) + * at org.benf.cfr.reader.entities.ClassFile.analyseTop(ClassFile.java:942) + * at org.benf.cfr.reader.Driver.doJarVersionTypes(Driver.java:257) + * at org.benf.cfr.reader.Driver.doJar(Driver.java:139) + * at org.benf.cfr.reader.CfrDriverImpl.analyse(CfrDriverImpl.java:76) + * at org.benf.cfr.reader.Main.main(Main.java:54) + * at the.bytecode.club.bytecodeviewer.decompilers.impl.CFRDecompiler.decompileToZip(CFRDecompiler.java:306) + * at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling.lambda$null$1(ResourceDecompiling.java:114) + * at the.bytecode.club.bytecodeviewer.resources.ResourceDecompiling$$Lambda$144/691390785.run(Unknown Source) + * at java.lang.Thread.run(Unknown Source) + */ + throw new IllegalStateException("Decompilation failed"); + } + + @Override + protected void resume() { + if (this.getEnable()) { + this.resetPostTimer(); + } + if (this.m_originLoginStatusChangedReceiver == null) { + this.m_originLoginStatusChangedReceiver = new OriginLoginStatusChangedReceiver(); + Utility.registerReceiver("nimble.notification.LoginStatusChanged", this.m_originLoginStatusChangedReceiver); + } + this.m_postRetryDelay = 1.0; + } + + @Override + public void setEnable(boolean bl2) { + Object object = bl2 ? "ENABLED" : "DISABLED"; + Helper.LOGI(this, "setEnable called. enable = %s", object); + if (this.m_enable == bl2) { + return; + } + if (!bl2) { + object = new HashMap(); + ((HashMap)object).put("eventType", "NIMBLESTANDARD::USER_TRACKING_OPTOUT"); + this.logEvent("NIMBLESTANDARD::USER_TRACKING_OPTOUT", (Map)object); + this.packageCurrentSession(); + this.postPendingEvents(false); + if (this.m_currentSessionObject.countOfEvents() > 0) { + Helper.LOGI(this, "Removing %d remaining events that couldn't be sent from queue.", this.m_currentSessionObject.countOfEvents()); + } + this.m_currentSessionObject = new TrackingBaseSessionObject(); + if (this.m_sessionsToPost != null && this.m_sessionsToPost.size() > 0) { + Helper.LOGI(this, "Removing unposted sessions."); + this.m_sessionsToPost.clear(); + } + this.killPostTimer(); + } else { + this.resetPostTimer(); + } + this.m_enable = bl2; + this.saveToPersistence(); + } + + @Override + public void setTrackingAttribute(String string2, String string3) { + if (!Utility.validString(string2)) return; + if (!Utility.validString(string3)) return; + this.m_trackingAttributes.put(string2, string3); + } + + @Override + protected void setup() { + this.m_postRetryDelay = 1.0; + this.m_threadManager = NimbleTrackingThreadManager.acquireInstance(); + } + + @Override + protected void suspend() { + if (this.m_networkStatusChangedReceiver != null) { + Utility.unregisterReceiver(this.m_networkStatusChangedReceiver); + this.m_networkStatusChangedReceiver = null; + } + if (this.m_originLoginStatusChangedReceiver != null) { + Utility.unregisterReceiver(this.m_originLoginStatusChangedReceiver); + this.m_originLoginStatusChangedReceiver = null; + } + this.killPostTimer(); + this.saveToPersistence(); + EASPDataLoader.deleteDatFile(EASPDataLoader.getTrackingDatFilePath()); + } + + @Override + protected void teardown() { + NimbleTrackingThreadManager.releaseInstance(); + this.m_threadManager = null; + } + + private class OriginLoginStatusChangedReceiver + extends BroadcastReceiver { + private OriginLoginStatusChangedReceiver() { + } + + public void onReceive(Context context, final Intent intent) { + if (!intent.getAction().equals("nimble.notification.LoginStatusChanged")) return; + NimbleTrackingImplBase.this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingImplBase.this.onOriginLoginStatusChanged(intent); + } + }); + } + } + + private class PostTask + implements Runnable { + private boolean m_packageEventsOnExpiry = false; + + public PostTask(boolean bl2) { + this.m_packageEventsOnExpiry = bl2; + } + + @Override + public void run() { + NimbleTrackingImplBase.this.postIntervalTimerExpired(this.m_packageEventsOnExpiry); + } + } + + public static class SessionData + implements Serializable { + private static final long serialVersionUID = 465486L; + String key; + String value; + } + + private class StartupRequestsFinishedReceiver + extends BroadcastReceiver { + private StartupRequestsFinishedReceiver() { + } + + public void onReceive(Context context, final Intent intent) { + if (!intent.getAction().equals("nimble.environment.notification.startup_requests_finished")) return; + NimbleTrackingImplBase.this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingImplBase.this.onStartupRequestsFinished(intent); + } + }); + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SComponent.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SComponent.java new file mode 100644 index 0000000..25cd1e5 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SComponent.java @@ -0,0 +1,22 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import com.ea.nimble.Base; +import com.ea.nimble.tracking.NimbleTrackingS2SImpl; +import com.ea.nimble.tracking.NimbleTrackingThreadProxy; + +class NimbleTrackingS2SComponent +extends NimbleTrackingThreadProxy { + static final String COMPONENT_ID = "com.ea.nimble.trackingimpl.s2s"; + + private NimbleTrackingS2SComponent() { + super(new NimbleTrackingS2SImpl()); + } + + static void initialize() { + Base.registerComponent(new NimbleTrackingS2SComponent(), COMPONENT_ID); + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java new file mode 100644 index 0000000..f201c47 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingS2SImpl.java @@ -0,0 +1,416 @@ +package com.ea.nimble.tracking; + +import android.content.Context; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageManager; +import android.database.Cursor; +import android.net.Uri; +import android.os.Build; +import android.provider.Settings; +import android.telephony.TelephonyManager; + +import com.ea.ironmonkey.devmenu.util.Observer; +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.Global; +import com.ea.nimble.IApplicationEnvironment; +import com.ea.nimble.IHttpRequest; +import com.ea.nimble.ISynergyEnvironment; +import com.ea.nimble.ISynergyIdManager; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.SynergyIdManager; +import com.ea.nimble.SynergyRequest; +import com.ea.nimble.Utility; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.TimeZone; +import java.util.UUID; + +/* loaded from: stdlib.jar:com/ea/nimble/tracking/NimbleTrackingS2SImpl.class */ +public class NimbleTrackingS2SImpl extends NimbleTrackingImplBase implements LogSource { + public static final int EVENT_APPRESUMED = 103; + public static final int EVENT_APPSTARTED = 102; + public static final int EVENT_APPSTARTED_AFTERINSTALL = 101; + public static final int EVENT_LEVEL_UP = 108; + public static final int EVENT_MTXVIEW_ITEM_PURCHASED = 105; + private static final String EVENT_PREFIX = "SYNERGYS2S::"; + public static final int EVENT_REFERRERID_RECEIVED = 106; + public static final int EVENT_TUTORIAL_COMPLETE = 107; + public static final int EVENT_USER_REGISTERED = 104; + private static final double MARS_DEFAULT_POST_INTERVAL = 60.0d; + private static final double MARS_MAX_POST_RETRY_DELAY = 86400.0d; + private static final String SYNERGY_API_POST_EVENTS = "/s2s/api/core/postEvents"; + + private Map createEventRequestPostMap() { + String str; + String gameSpecifiedPlayerId; + IApplicationEnvironment component = ApplicationEnvironment.getComponent(); + ISynergyEnvironment component2 = SynergyEnvironment.getComponent(); + ISynergyIdManager component3 = SynergyIdManager.getComponent(); + Date date = new Date(); + HashMap hashMap = new HashMap<>(); + String str2 = ""; + boolean z = true; + try { + String googleAdvertisingId = ApplicationEnvironment.getComponent().getGoogleAdvertisingId(); + str2 = googleAdvertisingId; + z = ApplicationEnvironment.getComponent().isLimitAdTrackingEnabled(); + str2 = googleAdvertisingId; + } catch (Exception e) { + Log.Helper.LOGW(this, "Exception when getting advertising ID for Android"); + } + hashMap.put("advertiserID", str2); + hashMap.put("limitAdTracking", z+""); + hashMap.put("bundleId", Utility.safeString(component.getApplicationBundleId())); + hashMap.put("sellId", Utility.safeString(component2.getSellId())); + hashMap.put("appName", Utility.safeString(component.getApplicationName())); + hashMap.put("appVersion", Utility.safeString(component.getApplicationVersion())); + hashMap.put("deviceId", Utility.safeString(component2.getEADeviceId())); + hashMap.put("deviceNativeId", Utility.safeString(Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id"))); + hashMap.put("systemName", "Android"); + hashMap.put("systemVersion", Build.VERSION.RELEASE); + hashMap.put("deviceType", Build.MODEL); + hashMap.put("deviceBrand", Build.BRAND); + PackageManager packageManager = component.getApplicationContext().getPackageManager(); + TelephonyManager telephonyManager = (TelephonyManager) component.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); + hashMap.put("carrierName", Utility.safeString(telephonyManager.getNetworkOperatorName())); + if (packageManager.checkPermission("android.permission.READ_PHONE_STATE", component.getApplicationContext().getPackageName()) == PackageManager.PERMISSION_GRANTED) { + hashMap.put("imei", Utility.safeString(telephonyManager.getDeviceId())); + } + hashMap.put("androidId", Utility.safeString(Settings.Secure.getString(component.getApplicationContext().getContentResolver(), "android_id"))); + hashMap.put("countryCode", Utility.safeString(Locale.getDefault().getCountry())); + hashMap.put("appLanguage", Utility.safeString(component.getShortApplicationLanguageCode())); + hashMap.put("localization", Utility.safeString(component.getApplicationLanguageCode())); + hashMap.put("deviceLanguage", Utility.safeString(Locale.getDefault().getLanguage())); + hashMap.put("deviceLocale", Utility.safeString(Locale.getDefault().toString())); + hashMap.put("timezone", String.format(Locale.US, "%tZ", Calendar.getInstance())); + hashMap.put("gmtOffset", String.valueOf(TimeZone.getDefault().getOffset(date.getTime()) / 1000)); + hashMap.put("synergyId", Utility.safeString(component3.getSynergyId())); + hashMap.put("macAddress", Utility.safeString(component.getMACAddress())); + hashMap.put("jflag", component.isDeviceRooted() ? Global.NOTIFICATION_DICTIONARY_RESULT_SUCCESS : Global.NOTIFICATION_DICTIONARY_RESULT_FAIL); + if (!((gameSpecifiedPlayerId = component.getGameSpecifiedPlayerId()) == null || gameSpecifiedPlayerId.length() <= 0)) { + hashMap.put("gamePlayerId", gameSpecifiedPlayerId); + } + try { + Context applicationContext = ApplicationEnvironment.getComponent().getApplicationContext(); + ApplicationInfo applicationInfo = applicationContext.getPackageManager().getApplicationInfo(applicationContext.getPackageName(), PackageManager.GET_META_DATA); + str = null; + if (applicationInfo.metaData != null) { + str = applicationInfo.metaData.getString("com.facebook.sdk.ApplicationId"); + } + } catch (PackageManager.NameNotFoundException e2) { + str = null; + } + if (Utility.validString(str)) { + hashMap.put("fbAppId", str); + } + try { + Cursor query = ApplicationEnvironment.getComponent().getApplicationContext().getContentResolver().query(Uri.parse("content://com.facebook.katana.provider.AttributionIdProvider"), null, null, null, null); + if (query != null) { + query.moveToFirst(); + hashMap.put("fbAttrId", query.getString(0)); + } + } catch (IllegalStateException e3) { + e3.printStackTrace(); + } catch (Exception e4) { + e4.printStackTrace(); + } + hashMap.put("originUser", this.m_loggedInToOrigin ? "Y" : "N"); + int size = this.m_customSessionData.size(); + if (size > 0) { + for (int i = 0; i < size; i++) { + hashMap.put(((NimbleTrackingImplBase.SessionData) this.m_customSessionData.get(i)).key, ((NimbleTrackingImplBase.SessionData) this.m_customSessionData.get(i)).value); + } + } + if (!(this.m_currentSessionObject == null || this.m_currentSessionObject.events == null)) { + ArrayList arrayList = new ArrayList(this.m_currentSessionObject.events); + Iterator it = arrayList.iterator(); + while (it.hasNext()) { + Map map = (Map) it.next(); + if (map.containsKey("referrer")) { + map.remove("referrer"); + hashMap.put("referrer", (String) map.get("referrer")); + } + } + hashMap.put("adEvents", arrayList.toString()); + } + return hashMap; + } + + private static boolean isS2SEvent(String str) { + if (str == null) { + return false; + } + return str.startsWith(EVENT_PREFIX); + } + + @Override // com.ea.nimble.tracking.NimbleTrackingImplBase + protected boolean canDropSession(List list) { + TrackingBaseSessionObject trackingBaseSessionObject = list.get(0); + if (trackingBaseSessionObject.events.size() == 0) { + Log.Helper.LOGE(this, "Trying to drop session with no events"); + return true; + } + for (Map map : trackingBaseSessionObject.events) { + String str = map.get("eventType"); + if (str != null && str.equals(String.valueOf((int) EVENT_APPSTARTED_AFTERINSTALL))) { + return false; + } + } + return true; + } + + @Override // com.ea.nimble.tracking.NimbleTrackingImplBase + protected List> convertEvent(Tracking.Event event) { + int i; + String str; + String str2; + String str3; + String str4; + String str5 = null; + String str6 = null; + String str7 = null; + if (!Tracking.isNimbleStandardEvent(event.type) && !isS2SEvent(event.type)) { + return null; + } + HashMap hashMap = new HashMap(7); + if (event.type.equals(Tracking.EVENT_APPSTART_AFTERINSTALL)) { + i = EVENT_APPSTARTED_AFTERINSTALL; + str5 = "Launch"; + str4 = null; + str3 = null; + str2 = null; + str = null; + } else if (event.type.equals(Tracking.EVENT_APPSTART_NORMAL) || event.type.equals(Tracking.EVENT_APPSTART_AFTERUPGRADE) || event.type.equals(Tracking.EVENT_APPSTART_FROMURL)) { + i = 102; + str5 = "Launch"; + str = null; + str2 = null; + str3 = null; + str4 = null; + } else if (event.type.equals(Tracking.EVENT_APPSTART_FROMPUSH)) { + i = 102; + str5 = "NotificationLaunch"; + str = null; + str2 = null; + str3 = null; + str4 = null; + } else if (event.type.equals(Tracking.EVENT_APPRESUME_NORMAL) || event.type.equals(Tracking.EVENT_SESSION_START) || event.type.equals(Tracking.EVENT_APPRESUME_FROMURL) || event.type.equals(Tracking.EVENT_APPRESUME_FROMEBISU)) { + i = 103; + str5 = "Resume"; + str = null; + str2 = null; + str3 = null; + str4 = null; + } else if (event.type.equals(Tracking.EVENT_APPRESUME_FROMPUSH)) { + i = 103; + str5 = "NotificationResume"; + str = null; + str2 = null; + str3 = null; + str4 = null; + } else if (event.type.equals(Tracking.EVENT_USER_REGISTERED)) { + String str8 = event.parameters.get(Tracking.KEY_USERNAME); + str6 = "username"; + str = null; + str2 = null; + str7 = str8; + str3 = null; + str4 = null; + str5 = "Registration"; + i = 104; + if (str8 == null) { + Log.Helper.LOGE(this, "Error: missing event parameter \"%s\"", Tracking.KEY_USERNAME); + str6 = "username"; + str = null; + str2 = null; + str7 = str8; + str3 = null; + str4 = null; + str5 = "Registration"; + i = 104; + } + } else if (event.type.equals(Tracking.EVENT_MTX_ITEM_PURCHASED)) { + String str9 = event.parameters.get(Tracking.KEY_MTX_CURRENCY); + String str10 = event.parameters.get(Tracking.KEY_MTX_PRICE); + if (str9 == null) { + Log.Helper.LOGE(this, "Error: missing event parameter \"%s\"", Tracking.KEY_MTX_CURRENCY); + } + str6 = "tvalue"; + str = "fvalue"; + str2 = null; + str7 = str9; + str3 = str10; + str4 = null; + str5 = "Purchase"; + i = 105; + if (str10 == null) { + Log.Helper.LOGE(this, "Error: missing event parameter \"%s\"", Tracking.KEY_MTX_PRICE); + str6 = "tvalue"; + str = "fvalue"; + str2 = null; + str7 = str9; + str3 = str10; + str4 = null; + str5 = "Purchase"; + i = 105; + } + } else if (event.type.equals(Tracking.EVENT_REFERRERID_RECEIVED)) { + str7 = event.parameters.get(Tracking.KEY_REFERRER_ID); + if (str7 == null) { + Log.Helper.LOGE(this, "Error: invalid (null) referrer id."); + return null; + } + i = 106; + str5 = "Referrer"; + str6 = "referrerId"; + str = null; + str2 = null; + str3 = null; + str4 = null; + } else if (event.type.equals(Tracking.EVENT_TUTORIAL_COMPLETE)) { + i = 107; + str5 = "TutorialComplete"; + str = null; + str2 = null; + str3 = null; + str4 = null; + } else if (event.type.equals(Tracking.EVENT_LEVEL_UP)) { + i = 108; + str5 = "LevelUp"; + str6 = "duration"; + str7 = event.parameters.get(Tracking.KEY_DURATION); + str = "gameplayDuration"; + str3 = event.parameters.get(Tracking.KEY_GAMEPLAY_DURATION); + str2 = "userLevel"; + str4 = event.parameters.get(Tracking.KEY_USER_LEVEL); + } else if (!event.type.equals(TrackingS2S.EVENT_CUSTOM)) { + return null; + } else { + i = Integer.parseInt(event.parameters.get("eventType")); + str6 = event.parameters.get("keyType01"); + str7 = event.parameters.get("keyValue01"); + str = event.parameters.get("keyType02"); + str3 = event.parameters.get("keyValue02"); + str2 = event.parameters.get("keyType03"); + str4 = event.parameters.get("keyValue03"); + } + hashMap.put("eventType", String.valueOf(i)); + hashMap.put("eventName", str5); + hashMap.put("timestamp", Utility.getUTCDateStringFormat(event.timestamp)); + hashMap.put("eventKeyType01", str6 == null ? Global.NOTIFICATION_DICTIONARY_RESULT_FAIL : str6); + hashMap.put("eventValue01", str7 == null ? "" : str7); + hashMap.put("eventKeyType02", str == null ? Global.NOTIFICATION_DICTIONARY_RESULT_FAIL : str); + hashMap.put("eventValue02", str3 == null ? "" : str3); + hashMap.put("eventKeyType03", str2 == null ? Global.NOTIFICATION_DICTIONARY_RESULT_FAIL : str2); + hashMap.put("eventValue03", str4 == null ? "" : str4); + hashMap.put("transactionId", UUID.randomUUID().toString()); + if (i == 101 || i == 102 || i == 103) { + if (this.m_currentSessionObject.sessionData.size() > 0) { + queueCurrentEventsForPost(); + } + Log.Helper.LOGD(this, "Logging session start event. Posting event queue now."); + resetPostTimer(0.0d); + } + ArrayList arrayList = new ArrayList(); + arrayList.add(hashMap); + return arrayList; + } + + @Override // com.ea.nimble.tracking.NimbleTrackingImplBase + protected SynergyRequest createPostRequest(TrackingBaseSessionObject trackingBaseSessionObject) { + HashMap hashMap = new HashMap(); + hashMap.put("apiVer", "1.0.0"); + String serverUrlWithKey = SynergyEnvironment.getComponent().getServerUrlWithKey(SynergyEnvironment.SERVER_URL_KEY_SYNERGY_S2S); + if (serverUrlWithKey == null) { + Log.Helper.LOGI(this, "Tracking server URL from NimbleEnvironment is nil. Adding observer for environment update finish."); + super.addObserverForSynergyEnvironmentUpdateFinished(); + return null; + } + HashMap hashMap2 = new HashMap(trackingBaseSessionObject.sessionData); + hashMap2.put("now_timestamp", Utility.getUTCDateStringFormat(new Date())); + if (hashMap2.get("synergyId") == null || hashMap2.get("synergyId").toString().length() == 0) { + String synergyId = SynergyIdManager.getComponent().getSynergyId(); + if (Utility.validString(synergyId)) { + Log.Helper.LOGV(this, "Creating post request. No synergyId in session info dictionary, inserting synergyId value %s now.", synergyId); + hashMap2.put("synergyId", synergyId); + } else { + Log.Helper.LOGV(this, "Creating post request. No synergyId in session info dictionary, still no synergyId available now."); + } + } + SynergyRequest synergyRequest = new SynergyRequest(SYNERGY_API_POST_EVENTS, IHttpRequest.Method.POST, null); + synergyRequest.baseUrl = serverUrlWithKey; + synergyRequest.urlParameters = hashMap; + synergyRequest.jsonData = hashMap2; + return synergyRequest; + } + + @Override // com.ea.nimble.Component + public String getComponentId() { + return "com.ea.nimble.trackingimpl.s2s"; + } + + @Override // com.ea.nimble.tracking.NimbleTrackingImplBase, com.ea.nimble.LogSource + public String getLogSourceTitle() { + return "TrackingS2S"; + } + + @Override // com.ea.nimble.tracking.NimbleTrackingImplBase + protected String getPersistenceIdentifier() { + return "S2S"; + } + + /* JADX WARN: Multi-variable type inference failed */ + /* JADX WARN: Type inference failed for: r0v30, types: [double] */ + /* JADX WARN: Type inference failed for: r0v9, types: [double] */ + /* JADX WARN: Type inference failed for: r10v1 */ + /* JADX WARN: Type inference failed for: r10v2 */ + /* JADX WARN: Type inference failed for: r10v3, types: [double] */ + /* JADX WARN: Type inference failed for: r10v4 */ + /* JADX WARN: Type inference failed for: r10v5 */ + /* JADX WARN: Type inference failed for: r8v0, types: [double] */ + /* JADX WARN: Type inference failed for: r8v12 */ + /* JADX WARN: Type inference failed for: r8v5 */ + /* JADX WARN: Unknown variable types count: 4 */ + /* + Code decompiled incorrectly, please refer to instructions dump. + To view partially-correct code enable 'Show inconsistent code' option in preferences + */ + public double getRetryTime(com.ea.nimble.SynergyNetworkConnectionHandle r7) { + /* + Method dump skipped, instructions count: 349 + To view this dump change 'Code comments level' option to 'DEBUG' + */ + throw new UnsupportedOperationException("Method not decompiled: com.ea.nimble.tracking.NimbleTrackingS2SImpl.getRetryTime(com.ea.nimble.SynergyNetworkConnectionHandle):double"); + } + + @Override // com.ea.nimble.tracking.NimbleTrackingImplBase + protected void packageCurrentSession() { + if (this.m_currentSessionObject.countOfEvents() > 0) { + this.m_currentSessionObject.sessionData = new HashMap(createEventRequestPostMap()); + if (!((ArrayList) this.m_currentSessionObject.sessionData.get("adEvents")).isEmpty()) { + queueCurrentEventsForPost(); + } + } + } + + /* JADX WARN: Code restructure failed: missing block: B:18:0x007d, code lost: + if (r6 > -22000) goto L_0x0080; + */ + /* + Code decompiled incorrectly, please refer to instructions dump. + To view partially-correct code enable 'Show inconsistent code' option in preferences + */ + public boolean shouldAttemptReTrans(com.ea.nimble.SynergyNetworkConnectionHandle r5) { + Observer.onCallingMethod(Observer.Method.IMPOSSIBLE_TO_DECOMPILE); + return true; + } +} diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyComponent.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyComponent.java new file mode 100644 index 0000000..1f83663 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyComponent.java @@ -0,0 +1,22 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import com.ea.nimble.Base; +import com.ea.nimble.tracking.NimbleTrackingSynergyImpl; +import com.ea.nimble.tracking.NimbleTrackingThreadProxy; + +class NimbleTrackingSynergyComponent +extends NimbleTrackingThreadProxy { + static final String COMPONENT_ID = "com.ea.nimble.trackingimpl.synergy"; + + private NimbleTrackingSynergyComponent() { + super(new NimbleTrackingSynergyImpl()); + } + + static void initialize() { + Base.registerComponent(new NimbleTrackingSynergyComponent(), COMPONENT_ID); + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java new file mode 100644 index 0000000..571ea87 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingSynergyImpl.java @@ -0,0 +1,679 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.ContentResolver + * android.content.Context + * android.content.Intent + * android.os.Build$VERSION + * android.provider.Settings$Secure + */ +package com.ea.nimble.tracking; + +import android.content.BroadcastReceiver; +import android.content.ContentResolver; +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.provider.Settings; + +import com.ea.ironmonkey.devmenu.util.Observer; +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.IApplicationEnvironment; +import com.ea.nimble.IHttpRequest; +import com.ea.nimble.INetwork; +import com.ea.nimble.ISynergyEnvironment; +import com.ea.nimble.ISynergyIdManager; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.Network; +import com.ea.nimble.SynergyEnvironment; +import com.ea.nimble.SynergyIdManager; +import com.ea.nimble.SynergyRequest; +import com.ea.nimble.Utility; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Random; +import java.util.Set; + +class NimbleTrackingSynergyImpl + extends NimbleTrackingImplBase + implements LogSource { + private static final String EVENT_PREFIX = "SYNERGYTRACKING::"; + private static final int MAX_CUSTOM_EVENT_PARAMETERS = 20; + private int m_eventNumber; + private Map m_mainAuthenticator; + private final BroadcastReceiver m_mainAuthenticatorUpdateReceiver; + private List> m_pendingEvents; + private final BroadcastReceiver m_pidInfoUpdateReceiver = new BroadcastReceiver() { + + public void onReceive(Context context, final Intent intent) { + NimbleTrackingSynergyImpl.this.m_threadManager.runInWorkerThread(new Runnable() { + + @Override + public void run() { + NimbleTrackingSynergyImpl.this.onPidInfoUpdate(intent); + } + }); + } + }; + private Map m_pidMap; + private String m_sessionId; + private SynergyIdChangedReceiver m_synergyIdChangedReceiver; + + NimbleTrackingSynergyImpl() { + this.m_mainAuthenticatorUpdateReceiver = new BroadcastReceiver() { + + public void onReceive(Context context, final Intent intent) { + NimbleTrackingSynergyImpl.this.m_threadManager.runInWorkerThread(() -> NimbleTrackingSynergyImpl.this.onMainAuthenticatorUpdate(intent)); + } + }; + this.m_synergyIdChangedReceiver = new SynergyIdChangedReceiver(); + this.m_pendingEvents = new ArrayList>(); + } + + private void addPushTNGTrackingParams(Tracking.Event event, Map map) { + map.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); + map.put("eventValue01", event.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_ID")); + map.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + map.put("eventValue02", event.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_TYPE")); + map.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + map.put("eventValue03", event.parameters.get("NIMBLESTANDARD::KEY_PN_DEVICE_ID")); + } + + /* + * Unable to fully structure code + */ + private Map generateSessionInfoDictionary(String var1_1) { + ISynergyEnvironment var12_2 = SynergyEnvironment.getComponent(); + ISynergyIdManager var10_3 = SynergyIdManager.getComponent(); + IApplicationEnvironment var9_4 = ApplicationEnvironment.getComponent(); + HashMap var8_5 = new HashMap(); + String var6_6 = ""; + Boolean var4_7 = true; + try { + String var7_8 = ApplicationEnvironment.getComponent().getGoogleAdvertisingId(); + var4_7 = ApplicationEnvironment.getComponent().isLimitAdTrackingEnabled(); + var6_6 = var7_8; + var8_5.put("advertiserID", var6_6); + } catch (Exception var7_9) { + Log.Helper.LOGW(this, "Exception when getting advertising ID for Android"); + } + var8_5.put("limitAdTracking", var4_7); + String var7_8 = var12_2.getSellId(); + String var11_11 = var12_2.getEAHardwareId(); + String eaDeviceId = var12_2.getEADeviceId(); // var12_2 + String var13_12 = Build.VERSION.RELEASE; + var6_6 = ApplicationEnvironment.getComponent().getCarrier(); + String var14_13 = ApplicationEnvironment.getComponent().getApplicationVersion(); + String var15_14 = String.format(Locale.US, "%tZ", Calendar.getInstance()); + var8_5.put("carrier", var6_6); + var8_5.put("timezone", var15_14); + var6_6 = var9_4.isAppCracked() ? "1" : "0"; + var8_5.put("pflag", var6_6); + var6_6 = var9_4.isDeviceRooted() ? "1" : "0"; + var8_5.put("jflag", var6_6); + var8_5.put("firmwareVer", var13_12); + var8_5.put("sellId", Utility.safeString(var7_8)); + var8_5.put("buildId", Utility.safeString(var14_13)); + var8_5.put("sdkVer", "1.23.14.1217"); + var8_5.put("sdkCfg", "DL"); + var8_5.put("deviceId", Utility.safeString(eaDeviceId)); + var8_5.put("hwId", Utility.safeString(var11_11)); + var8_5.put("schemaVer", "2"); + var8_5.put("platform", "android"); + var6_6 = "N"; + INetwork component = Network.getComponent();//var7_8 + if (component.getStatus() == Network.Status.OK) { + var6_6 = component.isNetworkWifi() ? "W" : "G"; + } + var8_5.put("networkAccess", var6_6); + var6_6 = this.m_loggedInToOrigin ? "Y" : "N"; + var8_5.put("originUser", var6_6); + if (Utility.validString(var1_1)) { + var8_5.put("uid", Utility.safeString(var1_1)); + var8_5.put("androidId", Utility.safeString(Settings.Secure.getString((ContentResolver) var9_4.getApplicationContext().getContentResolver(), (String) "android_id"))); + var8_5.put("macHash", Utility.safeString(Utility.SHA256HashString(var9_4.getMACAddress()))); + var8_5.put("aut", Utility.safeString("")); + if (this.m_pidMap != null && this.m_pidMap.size() > 0) { + var8_5.put("pidMap", this.m_pidMap); + } + if ((var1_1 = var9_4.getGameSpecifiedPlayerId()) != null && var1_1.length() > 0) { + var8_5.put("gamePlayerId", var1_1); + } + if (this.m_customSessionData.size() <= 0) return var8_5; + + for (SessionData base : this.m_customSessionData) { + var8_5.put(base.key, base.value); + } + } + return var8_5; + } + + private String generateSynergySessionId() { + Object object = Utility.getUTCDateStringFormat(new Date()).replace("_", ""); + StringBuilder stringBuilder = new StringBuilder(24); + stringBuilder.append((String) object); + int n2 = stringBuilder.length(); + object = new Random(); + int n3 = 0; + while (n3 < 24 - n2) { + stringBuilder.append(((Random) object).nextInt(10)); + ++n3; + } + return stringBuilder.toString(); + } + + private static boolean isSynergyEvent(String string2) { + if (string2 != null) return string2.startsWith(EVENT_PREFIX); + return false; + } + + private void onMainAuthenticatorUpdate(Intent object) { + Observer.onCallingMethod(Observer.Method.SUSPICIOUS_METHOD); + } + + private void onPidInfoUpdate(Intent object) { + if ((object.getSerializableExtra("pidMapId")) == null) return; + this.m_currentSessionObject.sessionData.put("pidMap", this.m_pidMap); + } + + private void onSynergyIdChanged(Intent object) { + String string2 = object.getStringExtra("previousSynergyId"); + String currentSynergyId = object.getStringExtra("currentSynergyId"); + HashMap hashMap = new HashMap(); + hashMap.put("eventType", String.valueOf(SynergyConstants.EVT_SESSION_END_SYNERGYID_CHANGE.value)); + hashMap.put("keyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_SYNERGYID.value)); + hashMap.put("keyValue01", Utility.safeString(string2)); + hashMap.put("keyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_SYNERGYID.value)); + hashMap.put("keyValue02", Utility.safeString(currentSynergyId)); + this.logEvent("SYNERGYTRACKING::CUSTOM", hashMap); + this.m_currentSessionObject.sessionData = new HashMap<>(this.generateSessionInfoDictionary(string2)); + this.queueCurrentEventsForPost(); + hashMap.put("eventType", String.valueOf(SynergyConstants.EVT_NEW_SESSION_START_SYNERGYID_CHANGE.value)); + this.logEvent("SYNERGYTRACKING::CUSTOM", hashMap); + } + + /* + * Exception decompiling + */ + private void parseCustomParameters(Map var1_1, Map var2_2) { + Observer.onCallingMethod(Observer.Method.IMPOSSIBLE_TO_DECOMPILE, Observer.Method.SUSPICIOUS_METHOD); + } + + private void resetSession() { + this.m_sessionId = this.generateSynergySessionId(); + this.m_eventNumber = 1; + } + + private void sleep() { + Utility.unregisterReceiver(this.m_synergyIdChangedReceiver); + } + + private void wakeup() { + Utility.registerReceiver("nimble.synergyidmanager.notification.synergy_id_changed", this.m_synergyIdChangedReceiver); + } + + @Override + protected boolean canDropSession(List iterator) { + String string2; + TrackingBaseSessionObject trackingBaseSessionObject = iterator.get(0); + if (trackingBaseSessionObject.events.size() == 0) { + Log.Helper.LOGE(this, "Trying to drop session with no events"); + return true; + } + Iterator> iterator1 = trackingBaseSessionObject.events.iterator(); + do { + if (!iterator1.hasNext()) return true; + } while ((string2 = iterator1.next().get("eventType")) == null || !string2.equals(String.valueOf(SynergyConstants.EVT_APPSTART_AFTERINSTALL.value))); + return false; + } + + @Override + protected void cleanup() { + this.sleep(); + super.cleanup(); + } + + /* + * Loose catch block + * Enabled unnecessary exception pruning + */ + @Override + protected List> convertEvent(Tracking.Event arrayList) { + Object object; + Object object2222222; + HashMap hashMap; + Object object3; + Object object4; + + object4 = SynergyConstants.EVT_UNDEFINED; + object3 = -1; + hashMap = new HashMap(); + if (!Tracking.isNimbleStandardEvent(((Tracking.Event) ((Object) arrayList)).type) && !NimbleTrackingSynergyImpl.isSynergyEvent(((Tracking.Event) ((Object) arrayList)).type)) { + return null; + } + + switch (arrayList.type) { + case "NIMBLESTANDARD::APPSTART_NORMAL": { + object4 = SynergyConstants.EVT_APPSTART_NORMALLY; + } + case "NIMBLESTANDARD::APPSTART_AFTERINSTALL": { + object4 = SynergyConstants.EVT_APPSTART_AFTERINSTALL; + } + case "NIMBLESTANDARD::APPSTART_AFTERUPGRADE": { + object4 = SynergyConstants.EVT_APPSTART_AFTERUPGRADE; + } + case "NIMBLESTANDARD::APPSTART_FROMURL": { + object4 = SynergyConstants.EVT_APPSTART_FROM_URL; + } + case "NIMBLESTANDARD::APPSTART_FROMPUSH": { + object4 = SynergyConstants.EVT_APPSTART_FROMPUSH; + try { + object2222222 = ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).getString("messageId", null); + if (object2222222 == null) { + this.addPushTNGTrackingParams((Tracking.Event) ((Object) arrayList), (Map) hashMap); + object2222222 = object3; + } + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); + hashMap.put("eventValue01", (String) object2222222); + ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).edit().remove("messageId").commit(); + ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).edit().remove("PushNotification").commit(); + object2222222 = object3; + } catch (Exception exception) { + exception.printStackTrace(); + object2222222 = object3; + } + } + case "NIMBLESTANDARD::APPRESUME_FROMURL": { + object4 = SynergyConstants.EVT_APP_ENTER_FOREGROUND_FROM_URL; + } + case "NIMBLESTANDARD::APPRESUME_FROMEBISU": { + object4 = SynergyConstants.EVT_APP_ENTER_FOREGROUND_FROM_EBISU; + } + case "NIMBLESTANDARD::APPRESUME_FROMPUSH": { + object4 = SynergyConstants.EVT_APP_RESUME_FROM_PUSH; + try { + object2222222 = ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).getString("messageId", null); + if (object2222222 == null) { + this.addPushTNGTrackingParams((Tracking.Event) ((Object) arrayList), (Map) hashMap); + object2222222 = object3; + } + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); + hashMap.put("eventValue01", (String) object2222222); + ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).edit().remove("messageId").commit(); + ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).edit().remove("PushNotification").commit(); + object2222222 = object3; + } catch (Exception exception) { + exception.printStackTrace(); + object2222222 = object3; + } + } + case "NIMBLESTANDARD::SESSION_START": { + object4 = SynergyConstants.EVT_APP_SESSION_START; + } + case "NIMBLESTANDARD::SESSION_END": { + object4 = SynergyConstants.EVT_APP_SESSION_END; + } + case "NIMBLESTANDARD::SESSION_TIME": { + object4 = SynergyConstants.EVT_APP_SESSION_TIME; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_DURATION.value)); + hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_DURATION")); + } + case "NIMBLESTANDARD::MTX_ITEM_BEGIN_PURCHASE": { + object4 = SynergyConstants.EVT_MTXVIEW_ITEMPURCHASE; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MTX_SELLID.value)); + hashMap.put("eventValue01", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_MTX_SELLID")); + } + case "NIMBLESTANDARD::MTX_ITEM_PURCHASED": { + object4 = SynergyConstants.EVT_MTXVIEW_ITEM_PURCHASED; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MTX_SELLID.value)); + hashMap.put("eventValue01", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_MTX_SELLID")); + } + case "NIMBLESTANDARD::MTX_FREEITEM_DOWNLOADED": { + object4 = SynergyConstants.EVT_MTXVIEW_FREEITEM_DOWNLOADED; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MTX_SELLID.value)); + hashMap.put("eventValue01", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_MTX_SELLID")); + } + case "NIMBLESTANDARD::USER_TRACKING_OPTOUT": { + object4 = SynergyConstants.EVT_USER_TRACKING_OPTOUT; + } + case "NIMBLESTANDARD::PN_DISPLAY_OPT_IN": { + object4 = SynergyConstants.EVT_USER_SHOWN_PN_OPTIN_PROMPT; + } + case "NIMBLESTANDARD::PN_USER_OPT_IN": { + object4 = SynergyConstants.EVT_USER_SHOWN_PN_OPTIN_PROMPT; + hashMap.put("eventKeyType02", ((Tracking.Event) ((Object) arrayList)).parameters.get(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue02", "Yes"); + } + case "NIMBLESTANDARD::PN_SHOWN_TO_USER": { + object = SynergyConstants.EVT_PN_SHOWN_TO_USER; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); + hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_ID")); + if (arrayList.parameters.containsKey("NIMBLESTANDARD::KEY_PN_MESSAGE_ID")) { + hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_TYPE")); + } + object4 = object; + if (arrayList.parameters.containsKey("NIMBLESTANDARD::KEY_PN_DEVICE_ID")) { + hashMap.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue03", arrayList.parameters.get("NIMBLESTANDARD::KEY_PN_DEVICE_ID")); + } + } + case "NIMBLESTANDARD::PN_RECEIVED": { + object4 = SynergyConstants.EVT_PN_RECEIVED; + this.addPushTNGTrackingParams(arrayList, hashMap); + } + case "NIMBLESTANDARD::PN_DEVICE_REGISTERED": { + object4 = SynergyConstants.EVT_PN_DEVICE_REGISTERED; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue01", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_PN_DATE_OF_BIRTH")); + hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue02", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_PN_DISABLED_FLAG")); + hashMap.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue03", ((Tracking.Event) ((Object) arrayList)).parameters.get("NIMBLESTANDARD::KEY_PN_DEVICE_ID")); + } + case "NIMBLESTANDARD::PN_USER_CLICKED_OK": { + object4 = SynergyConstants.EVT_PN_SHOWN_TO_USER; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_MESSAGEID.value)); + hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_PN_MESSAGE_ID")); + hashMap.put("eventKeyType02", arrayList.parameters.get(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue02", "Ok"); + } + case "NIMBLESTANDARD::IDENTITY_MIGRATION": { + object4 = SynergyConstants.EVT_IDENTITY_MIGRATION; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_MIGRATION_GAME_TRIGGERED")); + hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_SOURCE")); + hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); + } + case "NIMBLESTANDARD::IDENTITY_LOGIN": { + object4 = SynergyConstants.EVT_IDENTITY_LOGIN; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); + hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGIN")); + hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); + hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_TARGET")); + + HashMap hashMap1 = new HashMap<>(); + + Set> entries = + Utility + .convertJSONObjectStringToMap( + arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGIN" + )).entrySet(); + + for (Map.Entry object5 : entries) + hashMap1.put(object5.getKey(), object5.getValue().toString()); + + Set> entries1 = Utility + .convertJSONObjectStringToMap( + arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_TARGET" + )).entrySet(); + + for (Map.Entry object5 : entries1) + hashMap1.put(object5.getKey(), object5.getValue().toString()); + this.m_pidMap = hashMap1; + this.m_currentSessionObject.sessionData.put("pidMap", this.m_pidMap); + } + case "NIMBLESTANDARD::IDENTITY_LOGOUT": { + object4 = SynergyConstants.EVT_IDENTITY_LOGOUT; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); + hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_SOURCE")); + hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); + hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGOUT")); + + HashMap hashMap1 = new HashMap<>(); + + Set> entries = + Utility + .convertJSONObjectStringToMap( + arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGOUT" + )).entrySet(); + + for (Map.Entry object5 : entries) + hashMap1.put(object5.getKey(), object5.getValue().toString()); + + this.m_currentSessionObject.sessionData.put("pidMap", this.m_pidMap); + this.m_pidMap = hashMap1; + } + case "NIMBLESTANDARD::IDENTITY_MIGRATION_STARTED": { + object4 = SynergyConstants.EVT_IDENTITY_MIGRATION_STARTED; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_MIGRATION_GAME_TRIGGERED")); + hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); + hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_SOURCE")); + hashMap.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_JSON_MAP.value)); + hashMap.put("eventValue03", arrayList.parameters.get("NIMBLESTANDARD::KEY_IDENTITY_TARGET")); + } + case "NIMBLESTANDARD::TUTORIAL_COMPLETE": { + object4 = SynergyConstants.EVT_GAMEPLAY_PROGRESSION_TUTORIAL_COMPLETE; + } + case "NIMBLESTANDARD::LEVEL_UP": { + object4 = SynergyConstants.EVT_GP_LEVEL_PROMOTION; + hashMap.put("eventKeyType01", String.valueOf(SynergyConstants.EVT_KEYTYPE_DURATION.value)); + hashMap.put("eventValue01", arrayList.parameters.get("NIMBLESTANDARD::KEY_DURATION")); + hashMap.put("eventKeyType02", String.valueOf(SynergyConstants.EVT_KEYTYPE_DURATION.value)); + hashMap.put("eventValue02", arrayList.parameters.get("NIMBLESTANDARD::KEY_GAMEPLAY_DURATION")); + hashMap.put("eventKeyType03", String.valueOf(SynergyConstants.EVT_KEYTYPE_ENUMERATION.value)); + hashMap.put("eventValue03", arrayList.parameters.get("NIMBLESTANDARD::KEY_USER_LEVEL")); + } + case "SYNERGYTRACKING::CUSTOM": + return null; + } + + object4 = arrayList.parameters.get("eventType"); + int n2 = Integer.parseInt((String) object4); + object4 = SynergyConstants.fromInt(n2); + this.parseCustomParameters(arrayList.parameters, hashMap); + + + Log.Helper.LOGE(this, "Error: Invalid format for eventType parameter. Expected integer value, got " + (String) object4); + Observer.onCallingMethod(Observer.Method.VERY_SUSPICIOUS_METHOD); + return null; +/* + while (object.hasNext()) { + String object5; + object5 = (String) object.next(); + object3 = hashMap.get(object5); + if (!Utility.validString((String) object3) || !((String) object3).startsWith("${") || !((String) object3).endsWith("}")) + continue; + if ((object3 = (String) this.m_trackingAttributes.get(((String) object3).substring(2, ((String) object3).length() - 1))) == null) { + object3 = ""; + } + hashMap.put((String) object5, (String) object3); + } + + object3 = Utility.getUTCDateStringFormat(arrayList.timestamp); + arrayList = new ArrayList>(); + if ((Integer) object2222222 != -1) { + hashMap.put("eventType", String.valueOf(object2222222)); + } else { + hashMap.put("eventType", String.valueOf(object4.value)); + } + hashMap.put("timestamp", (String) object3); + if (object4.isSessionStartEventType()) { + if (this.m_currentSessionObject.sessionData.size() > 0) { + this.queueCurrentEventsForPost(); + } + this.resetSession(); + for (Object object2222222 : this.m_pendingEvents) { + object2222222.put("session", this.m_sessionId); + object2222222.put("step", String.valueOf(this.m_eventNumber)); + ++this.m_eventNumber; + arrayList.add((Map) object2222222); + } + this.m_pendingEvents.clear(); + } else if (this.m_sessionId == null) { + this.m_pendingEvents.add(hashMap); + return null; + } + hashMap.put("session", this.m_sessionId); + hashMap.put("step", String.valueOf(this.m_eventNumber)); + ++this.m_eventNumber; + if (object4.isSessionStartEventType()) { + Log.Helper.LOGD(this, "Logging session start event, %s. Posting event queue now.", object4); + this.resetPostTimer(0.0); + } + if (object4 == SynergyConstants.EVT_APP_SESSION_END) { + this.m_sessionId = null; + } + arrayList.add(hashMap); + return arrayList; + */ + + } + + @Override + protected SynergyRequest createPostRequest(TrackingBaseSessionObject object) { + Observer.onCallingMethod(Observer.Method.HARD_TO_RECOVER_LOGIC); + return new SynergyRequest("lol", IHttpRequest.Method.POST, var1 -> Observer.onCallingMethod(Observer.Method.SUSPICIOUS_METHOD)); + /* + Object object2 = SynergyEnvironment.getComponent().getServerUrlWithKey("synergy.tracking"); + if (object2 == null) { + Log.Helper.LOGI(this, "Tracking server URL from NimbleEnvironment is nil. Adding observer for environment update finish."); + this.addObserverForSynergyEnvironmentUpdateFinished(); + return null; + } + Object object3 = object.sessionData; + HashMap hashMap = new HashMap<>(); + hashMap.putAll((Map) object3); + hashMap.put("now_timestamp", Utility.getUTCDateStringFormat(new Date())); + object3 = new ArrayList<>(object.events); + for (int i2 = 0; i2 < object3.size(); ++i2) { + ((Map) object3.get(i2)).put("repostCount", String.valueOf(object.repostCount)); + } + hashMap.put("events", object3); + if (hashMap.get("uid") == null) { + object = SynergyIdManager.getComponent().getSynergyId(); + if (Utility.validString((String) object)) { + Log.Helper.LOGV(this, "Creating post request. No uid in session info dictionary, inserting uid value %s now.", object); + hashMap.put("uid", object); + } else { + Log.Helper.LOGV(this, "Creating post request. No uid in session info dictionary, still no uid available now."); + } + } + object = SynergyEnvironment.getComponent(); + object3 = hashMap.get("sellId").toString(); + if (object3 == null || ((String) object3).equals("")) { + object3 = Utility.safeString(object.getSellId()); + if (object3 == null || ((String) object3).equals("")) { + Log.Helper.LOGE(this, "Creating POST request. Missing sell id."); + } else { + hashMap.put("sellId", object3); + } + } + if ((object3 = hashMap.get("hwId").toString()) == null || ((String) object3).equals("")) { + object3 = Utility.safeString(object.getEAHardwareId()); + if (object3 == null || ((String) object3).equals("")) { + Log.Helper.LOGE(this, "Creating POST request. Missing hw id."); + } else { + hashMap.put("hwId", object3); + } + } + if ((object3 = hashMap.get("deviceId").toString()) == null || ((String) object3).equals("")) { + if ((object = Utility.safeString(object.getEADeviceId())) == null || ((String) object).equals("")) { + Log.Helper.LOGE(this, "Creating POST request. Missing device id."); + } else { + hashMap.put("deviceId", object); + } + } + object = new SynergyRequest("/tracking/api/core/logEvent", IHttpRequest.Method.POST, null); + ((SynergyRequest) object).baseUrl = object2; + ((SynergyRequest) object).jsonData = hashMap; + object2 = OperationalTelemetryDispatch.getComponent(); + if (object2 != null) { + object3 = new HashMap(); + ((HashMap) object3).put("BASEURL", ((SynergyRequest) object).baseUrl); + ((HashMap) object3).put("API", ((SynergyRequest) object).api); + ((HashMap) object3).put("POSTDATA", Utility.convertObjectToJSONString(hashMap)); + object2.logEvent("com.ea.nimble.trackingimpl.synergy", (Map) object3); + } + Utility.sendBroadcast("nimble.notification.trackingimpl.synergy.postingToServer", null); + return object; + + */ + } + + @Override + public String getComponentId() { + return "com.ea.nimble.trackingimpl.synergy"; + } + + @Override + public String getLogSourceTitle() { + return "TrackingSynergy"; + } + + @Override + protected String getPersistenceIdentifier() { + return "Synergy"; + } + + @Override + protected boolean isSameSession(TrackingBaseSessionObject object, TrackingBaseSessionObject object2) { + if (((TrackingBaseSessionObject) object).events.size() == 0 || ((TrackingBaseSessionObject) object2).events.size() == 0) { + Log.Helper.LOGE(this, "Trying to compare session with no events"); + return true; + } + String session = object.events.get(0).get("session"); + String session2 = object2.events.get(0).get("session"); + if (session != null) { + if (session2 != null) return session.equals(session2); + } + Log.Helper.LOGE(this, "Trying to compare event with no session"); + return true; + } + + @Override + protected void packageCurrentSession() { + if (this.m_currentSessionObject.countOfEvents() <= 0) return; + Log.Helper.LOGV(this, "Preparing for post, generating session info dictionary."); + this.m_currentSessionObject.sessionData = new HashMap(this.generateSessionInfoDictionary(null)); + this.queueCurrentEventsForPost(); + } + + @Override + protected void restore() { + super.restore(); + Utility.registerReceiver("nimble.notification.identity.authenticator.pid.info.update", this.m_pidInfoUpdateReceiver); + Utility.registerReceiver("nimble.notification.identity.main.authenticator.change", this.m_mainAuthenticatorUpdateReceiver); + this.wakeup(); + } + + @Override + public void setEnable(boolean bl2) { + super.setEnable(bl2); + if (!bl2) { + this.m_sessionId = null; + } + if (this.m_sessionId != null) return; + if (!bl2) return; + this.resetSession(); + this.logEvent("NIMBLESTANDARD::SESSION_START", null); + } + + private class SynergyIdChangedReceiver + extends BroadcastReceiver { + private SynergyIdChangedReceiver() { + } + + public void onReceive(Context context, final Intent intent) { + NimbleTrackingSynergyImpl.this.m_threadManager.runInWorkerThread(new Runnable() { + + @Override + public void run() { + NimbleTrackingSynergyImpl.this.onSynergyIdChanged(intent); + } + }); + } + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadManager.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadManager.java new file mode 100644 index 0000000..fdbde32 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadManager.java @@ -0,0 +1,51 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +class NimbleTrackingThreadManager { + private static NimbleTrackingThreadManager s_instance; + private static int s_instanceRefs; + private ScheduledExecutorService m_executor = new ScheduledThreadPoolExecutor(1){ + + @Override + protected void afterExecute(Runnable object, Throwable throwable) {} + }; + + NimbleTrackingThreadManager() { + } + + static NimbleTrackingThreadManager acquireInstance() { + if (s_instance == null) { + s_instance = new NimbleTrackingThreadManager(); + } + ++s_instanceRefs; + return s_instance; + } + + static void releaseInstance() { + if (--s_instanceRefs != 0) return; + s_instance.shutdown(); + s_instance = null; + } + + private void shutdown() { + this.m_executor.shutdown(); + } + + ScheduledFuture createTimer(double d2, Runnable runnable) { + return this.m_executor.schedule(runnable, (long)(1000.0 * d2), TimeUnit.MILLISECONDS); + } + + void runInWorkerThread(Runnable runnable) { + this.runInWorkerThread(false, runnable); + } + + void runInWorkerThread(boolean bl2, Runnable object) {} +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadProxy.java b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadProxy.java new file mode 100644 index 0000000..37300dd --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/NimbleTrackingThreadProxy.java @@ -0,0 +1,156 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import com.ea.nimble.Component; +import com.ea.nimble.tracking.ITracking; +import com.ea.nimble.tracking.NimbleTrackingImplBase; +import com.ea.nimble.tracking.NimbleTrackingThreadManager; +import java.util.Map; + +public abstract class NimbleTrackingThreadProxy +extends Component +implements ITracking { + private NimbleTrackingImplBase m_impl; + private NimbleTrackingThreadManager m_threadManager; + + protected NimbleTrackingThreadProxy(NimbleTrackingImplBase nimbleTrackingImplBase) { + this.m_impl = nimbleTrackingImplBase; + } + + @Override + public void addCustomSessionData(final String string2, final String string3) { + this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.addCustomSessionData(string2, string3); + } + }); + } + + @Override + protected void cleanup() { + this.m_threadManager.runInWorkerThread(true, new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.cleanup(); + } + }); + } + + @Override + public void clearCustomSessionData() { + this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.clearCustomSessionData(); + } + }); + } + + @Override + public String getComponentId() { + return this.m_impl.getComponentId(); + } + + @Override + public boolean getEnable() { + return this.m_impl.getEnable(); + } + + @Override + public void logEvent(final String string2, final Map map) { + this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.logEvent(string2, map); + } + }); + } + + @Override + protected void restore() { + this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.restore(); + } + }); + } + + @Override + protected void resume() { + this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.resume(); + } + }); + } + + @Override + public void setEnable(final boolean bl2) { + this.m_threadManager.runInWorkerThread(true, new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.setEnable(bl2); + } + }); + } + + @Override + public void setTrackingAttribute(final String string2, final String string3) { + this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.setTrackingAttribute(string2, string3); + } + }); + } + + @Override + protected void setup() { + this.m_threadManager = NimbleTrackingThreadManager.acquireInstance(); + this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.setup(); + } + }); + } + + @Override + protected void suspend() { + this.m_threadManager.runInWorkerThread(new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.suspend(); + } + }); + } + + @Override + protected void teardown() { + this.m_threadManager.runInWorkerThread(true, new Runnable(){ + + @Override + public void run() { + NimbleTrackingThreadProxy.this.m_impl.teardown(); + } + }); + NimbleTrackingThreadManager.releaseInstance(); + this.m_threadManager = null; + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/ReferrerReceiver.java b/app/src/main/java/com/ea/nimble/tracking/ReferrerReceiver.java new file mode 100644 index 0000000..bfbc43e --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/ReferrerReceiver.java @@ -0,0 +1,79 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + * android.util.Log + */ +package com.ea.nimble.tracking; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; + +import com.ea.ironmonkey.devmenu.util.Observer; + +public class ReferrerReceiver +extends BroadcastReceiver { + public static final String TAG = "ReferrerReceiver"; + + public static void clearReferrerId(Context context) { + context.getSharedPreferences("referrer", 0).edit().putString("referrer", null).commit(); + } + + public static String getReferrerId(Context context) { + return context.getSharedPreferences("referrer", 0).getString("referrer", null); + } + + /* + * WARNING - Removed back jump from a try to a catch block - possible behaviour change. + * Unable to fully structure code + * Enabled unnecessary exception pruning + */ + public void onReceive(Context var1_1, Intent var2_3) { + Observer.onCallingMethod(Observer.Method.HARD_TO_RECOVER_LOGIC, Observer.Method.SUSPICIOUS_METHOD); + /* + if (var2_3 == null) return; + if (!Objects.equals(var2_3.getAction(), "com.android.vending.INSTALL_REFERRER")) return; + Log.i((String)"ReferrerReceiver", (String)"Received install referrer notification from the OS."); + var2_3 = var2_3 .getStringExtra("referrer"); + if (var2_3 == null) return; + var2_3 = URLDecoder.decode((String)var2_3 , "UTF-8"); + Log.i((String)"ReferrerReceiver", (String)("Referrer Id from the notification: " + (String)var2_3 )); + { + catch (Exception var1_2) { + Log.w((String)"ReferrerReceiver", (String)"Unable to log a Referrer - 106 event indicating that Nimble has received a referrer id from the OS."); + return; + } + try { + if (ApplicationEnvironment.isMainApplicationRunning() && ApplicationEnvironment.getCurrentActivity() != null && Base.getComponent("com.ea.nimble.tracking") != null) { + var3_4 = (ITracking)Base.getComponent("com.ea.nimble.tracking"); + var4_6 = new HashMap(); + var4_6.put("NIMBLESTANDARD::KEY_REFERRER_ID", (String)var2_3 ); + var3_4.logEvent("NIMBLESTANDARD::REFERRER_ID_RECEIVED", var4_6); + return; + } + Log.w((String)"ReferrerReceiver", (String)("Unable to log Referrer - 106 event because the Tracking component isn't ready. Persisting referrerId (" + (String)var2_3 + ") to try again later.")); + } + catch (Exception var3_5) {} +lbl-1000: + // 2 sources + + { + while (true) { + var1_1.getSharedPreferences("referrer", 0).edit().putString("referrer", (String)var2_3 ).commit(); + return; + } + } + { + Log.w((String)"ReferrerReceiver", (String)("Unable to log Referrer - 106 event because the Tracking component isn't ready. Persisting referrerId (" + (String)var2_3 + ") to try again later.")); + ** continue; + } + } + */ + } + +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java b/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java new file mode 100644 index 0000000..d6e17b1 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/SynergyConstants.java @@ -0,0 +1,254 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +public enum SynergyConstants { + EVT_UNDEFINED(-1), + EVT_APPSTART_NORMALLY(10000), + EVT_APPSTART_FROMPUSH(10001), + EVT_APPSTART_AFTERINSTALL(10002), + EVT_APPSTART_AFTERUPGRADE(10003), + EVT_APP_SESSION_START(10004), + EVT_APP_SESSION_TIME(10005), + EVT_APP_RESUME_FROM_PUSH(10007), + EVT_APPSTART_FROM_URL(10009), + EVT_APP_ENTER_FOREGROUND_FROM_URL(10010), + EVT_NEW_SESSION_START_SYNERGYID_CHANGE(10012), + EVT_IDENTITY_MIGRATION(12000), + EVT_IDENTITY_LOGIN(12001), + EVT_IDENTITY_LOGOUT(12002), + EVT_IDENTITY_MIGRATION_STARTED(12003), + EVT_APPEND_NORMALLY(20000), + EVT_APPEND_ABNORMALLY(20001), + EVT_APP_INTERRUPTED(20002), + EVT_APP_SESSION_END(20003), + EVT_APP_ENTER_FOREGROUND_FROM_EBISU(20004), + EVT_APP_SESSION_START_EMBED(20005), + EVT_EMBED_OTD_UPGRADE(20006), + EVT_SESSION_END_SYNERGYID_CHANGE(20007), + EVT_USER_SHOWN_PN_OPTIN_PROMPT(20008), + EVT_PN_SHOWN_TO_USER(20009), + EVT_PN_RECEIVED(20015), + EVT_PN_DEVICE_REGISTERED(20016), + EVT_OPT_FULL_PURCHASE(30000), + EVT_MOREGAMES_ENTER(30001), + EVT_MOREGAMES_CLICKTHROUGH(30002), + EVT_MOREGAMES_GAMESELECT(30004), + EVT_MOREGAMES_CATEGORYSELECT(30005), + EVT_MOREGAMES_OVERLAY_APPEARS(30006), + EVT_MOREGAMES_OVERLAY_BUYCLICK(30007), + EVT_ENTER_FULL_GAME_OVERVIEW_SCREEN(30008), + EVT_LITE_ED_GAME_DEMO_START(30009), + EVT_LITE_ED_GAME_DEMO_END(30010), + EVT_MAINMENU_BANNER_CLICK(30011), + EVT_MAINMENU_TICKER_CLICK(30012), + EVT_INSTORE_BANNER_CLICK(30013), + EVT_INSTORE_TICKER_CLICK(30014), + EVT_FEATURED_BANNER_CLICK(30015), + EVT_MOREGAMES_CLICKTHROUGH_FEATURED(30017), + EVT_MOREGAMES_CLICKTHROUGH_SIDEBANNER(30018), + EVT_IPAD_UPSELL_MESSAGE_DISPLAYED(30019), + EVT_IPAD_UPSELL_MESSAGE_NOTHANKS_CLICKED(30020), + EVT_IPAD_UPSELL_MESSAGE_OK_CLICKED(30021), + EVT_IPAD_UPSELL_MESSAGE_LATER_CLICKED(30022), + EVT_UPSELL_VIDEO_CLICKED(30023), + EVT_USER_TRACKING_OPTOUT(30024), + EVT_GAMEPLAY_PROGRESSION_SPGAME_START(30025), + EVT_GAMEPLAY_PROGRESSION_SPGAME_RESTART(30026), + EVT_GAMEPLAY_PROGRESSION_SPGAME_SAVE(30027), + EVT_GAMEPLAY_PROGRESSION_SPGAME_CONTINUE(30028), + EVT_GAMEPLAY_PROGRESSION_SPGAME_QUIT(30029), + EVT_GAMEPLAY_PROGRESSION_SPGAME_COMPLETE(30030), + EVT_GAMEPLAY_PROGRESSION_SPGAME_TIME_SPENT(30031), + EVT_GAMEPLAY_PROGRESSION_SPGAME_SCORE(30032), + EVT_GAMEPLAY_PROGRESSION_TUTORIAL_SKIP(30033), + EVT_GAMEPLAY_PROGRESSION_TUTORIAL_COMPLETE(30034), + EVT_GAMEPLAY_PROGRESSION_CUTSCENE_SKIP(30035), + EVT_GAMEPLAY_PROGRESSION_CONTROLSCHEME_USED(30036), + EVT_GAMEPLAY_PROGRESSION_CHARACTER(30037), + EVT_GAMEPLAY_PROGRESSION_MPGAME_START(30038), + EVT_GAMEPLAY_PROGRESSION_MPGAME_QUIT(30039), + EVT_GAMEPLAY_PROGRESSION_MPGAME_DISCONNECT(30040), + EVT_GAMEPLAY_PROGRESSION_MPGAME_COMPLETE(30041), + EVT_GAMEPLAY_PROGRESSION_MPGAME_TIME_SPENT(30042), + EVT_MULTITASKING_USER_APP_MINIMIZED(30043), + EVT_MULTITASKING_USER_APP_RESUMED(30044), + EVT_MULTITASKING_USER_START_TUTORIAL(30045), + EVT_MTXVIEW_ENTER(40000), + EVT_MTXVIEW_GAMECATEGORY(40001), + EVT_MTXVIEW_ITEMSELECT(40002), + EVT_MTXVIEW_ITEMPURCHASE(40003), + EVT_MTXVIEW_ENTER_FROMCTX(40004), + EVT_MTXVIEW_FREEITEM_DOWNLOADED(40005), + EVT_MTXVIEW_ITEM_PURCHASED(40006), + EVT_IAC_MTX_ITEM_USED(40007), + EVT_MTXVIEW_ITEM_PURCHASED_REFERRERDATA(40008), + EVT_MTXVIEW_ITEMPURCHASE_SLOTDATA(40009), + EVT_MTXVIEW_ITEDISPLAYED(40010), + EVT_IGE_FREE_CREDITS_EARNED(40011), + EVT_IGE_PAID_CREDITS_EARNED(40012), + EVT_IGE_GIFT_RECEIVED(40013), + EVT_IGE_GIFT_SENT(40014), + EVT_IGE_FREE_CREDITS_ITEMS_CLICK(40015), + EVT_IGE_PAID_CREDITS_ITEMS_CLICK(40016), + EVT_IGE_STORE_VISIT(40017), + EVT_IGE_PAID_CREDITS_PURCHASE_REVENUE(40018), + EVT_IGE_PAID_CREDITS_PURCHASE_LEVEL(40019), + EVT_IGE_FREE_CREDITS_PURCHASE_REVENUE(40020), + EVT_IGE_FREE_CREDITS_PURCHASE_LEVEL(40021), + EVT_IGE_GAME_START_CASH_DETAIL(40022), + EVT_OFFERWALL_ITEM_REDEEMED_STORE_EAL(40023), + EVT_OFFERWALL_ITEM_REDEEMED_USER_LEVEL_EAL(40024), + EVT_OFFERWALL_ITEM_CLICK_EAL(40025), + EVT_OFFERWALL_STORE_VISIT_EAL(40026), + EVT_INGAME_AD_CLICK(40027), + EVT_INGAME_LEVEL_FREE_CREDITS_COUNT(40028), + EVT_INGAME_LEVEL_PAID_CREDITS_COUNT(40029), + EVT_USER_LEVEL_MTX_ITEM_PURCHASED(40030), + EVT_IGE_GAME_START_FREE_CREDIT(40031), + EVT_IGE_GAME_START_PAID_CREDIT(40032), + EVT_INGAME_EMAIL_OPEN(50001), + EVT_INGAME_EMAIL_SEND(50002), + EVT_INGAME_EMAIL_RECEIEVE(50003), + EVT_MEDIAPICKER_OPEN(50004), + EVT_ACCESS_BT_MENU(50005), + EVT_BEGIN_BT_SESSION(50006), + EVT_COMPLETE_BT_SESSION(50007), + EVT_ACCESS_WIFI_MENU(50008), + EVT_BEGIN_WIFI_SESSION(50009), + EVT_COMPLETE_WIFI_SESSION(50010), + EVT_USR_ISSUE_PUSH_NOTIFICATION_CHALLENGE(50011), + EVT_LANGUAGE_SELECTED(50012), + EVT_MENU_PROGRESSION_MAINMENU_SELECTED(50013), + EVT_MENU_PROGRESSION_MAINMENU_SUBMENU_SELECTED(50014), + EVT_MENU_PROGRESSION_GAMEMENU_SELECTED(50015), + EVT_MENU_PROGRESSION_GAMEMENU_SUBMENU_SELECTED(50016), + EVT_DEVICE_ORIENTATION_CHANGED(50017), + EVT_ERROR_BLUETOOTH_WIFI_BOTH_ACTIVE(50018), + EVT_ACCESS_INGAME_SCREEN(60001), + EVT_LEAVE_INGAME_SCREEN(60002), + EVT_USER_GAMEPLAY_FUNNEL_EAL(60003), + EVT_USER_TUTORIAL_FUNNEL_EAL(60004), + EVT_USER_TRANSACTION_FUNNEL(60005), + EVT_USER_MESSAGING_FUNNEL(60006), + EVT_USER_SIGNUP_FUNNEL(60007), + EVT_USER_GAME_LOAD_FUNNEL(60008), + EVT_USER_GAME_DOWNLOAD_FUNNEL(60009), + EVT_EVENTS_PURGED(70000), + EVT_GP_LEVEL_PROMOTION(70005), + EVT_GP_LEVEL_PROMOTION_GAMEPLAY_TIME_TOTAL_EAL(70006), + EVT_GP_ACHIEVEMENTS_CHECKPOINTS_EAL(70007), + EVT_GP_XPGAIN_EVENT_EAL(70008), + EVT_GP_EVENT_USER_EAL(70009), + EVT_GP_APP_START_USER_LEVEL_EAL(70010), + EVT_EBISU_EMAIL_PROMPT(80032), + EVT_EBISU_PROMPT_INPUT(80033), + EVT_EBISU_REGISTRATION_FUNNEL(80034), + EVT_EBISU_OPTIONAL_REGISTRATION_FIELDS(80035), + EVT_EBISU_REGISTRATION_ERROR(80036), + EVT_EBISU_SIGNIN_FUNNEL(80037), + EVT_EBISU_SIGNIN_ERROR(80038), + EVT_EBISU_USER_SIGNIN(80039), + EVT_EBISU_USER_FRIENDS_COUNT(80040), + EVT_EBISU_ENTER_EBISUUI(80041), + EVT_EBISU_FRIENDS_VISIT(80042), + EVT_EBISU_FRIEND_SEARCH(80043), + EVT_EBISU_FRIEND_INVITE_SENT(80044), + EVT_EBISU_FRIEND_INVITE_ACCPTED(80045), + EVT_EBISU_NEWSFEED_VISIT(80046), + EVT_EBISU_NEWSFEED_TILE_BUTTON_CLICK(80047), + EVT_EBISU_NEWSFEED_BANNER_CLICK(80048), + EVT_EBISU_NEWSFEED_UPDATES(80049), + EVT_EBISU_PROFILE_VISIT(80050), + EVT_EBISU_LOGO_YES_CLICK(80051), + EVT_EBISU_LOGO_NO_CLICK(80052), + EVT_EBISU_RECOVER_PASSWORD_FUNNEL(80053), + EVT_EBISU_USER_SIGNOUT(80054), + EVT_EBISU_LOAD_FAIL(80055), + EVT_EBISU_FRIEND_PROFILE_BANNER_CLICK(80056), + EVT_EBISU_FRIEND_PROFILE_GAME_ICON_CLICK(80057), + EVT_EBISU_FRIEND_INVITE_REJECTED(80058), + EVT_EBISU_PROFILE_BANNER_CLICK(80059), + EVT_EBISU_PROFILE_GAME_ICON_CLICK(80060), + EVT_GAME_ERROR_CONNECTIVITY(90000), + EVT_GAME_ERROR_GAMEPLAY(90001), + EVT_KEYTYPE_NONE(0), + EVT_KEYTYPE_GAME_SELLID(1), + EVT_KEYTYPE_MTX_SELLID(2), + EVT_KEYTYPE_MTX_CATEGORY(3), + EVT_KEYTYPE_SCREEN_NAME(4), + EVT_KEYTYPE_EVENT_COUNT(5), + EVT_KEYTYPE_DURATION(7), + EVT_KEYTYPE_FREQUENCY(8), + EVT_KEYTYPE_FEATURED(10), + EVT_KEYTYPE_DMG_SECTION(11), + EVT_KEYTYPE_GAME_PRODUCTID(12), + EVT_KEYTYPE_DMG_CATEGORY(13), + EVT_KEYTYPE_SCORE(14), + EVT_KEYTYPE_ENUMERATION(15), + EVT_KEYTYPE_TICKERID(16), + EVT_KEYTYPE_BANNERID(17), + EVT_KEYTYPE_MESSAGEID(18), + EVT_KEYTYPE_BANNER_POSITION(19), + EVT_KEYTYPE_LANGUAGE(20), + EVT_KEYTYPE_USER_LEVEL_DATA(21), + EVT_KEYTYPE_FIELD_ID(22), + EVT_KEYTYPE_LOGO_MESSAGE_ID(23), + EVT_KEYTYPE_FIELD_TYPE(24), + EVT_KEYTYPE_SYNERGYID(25), + EVT_KEYTYPE_JSON_MAP(26), + EVT_KEYTYPE_LAST_ENUM(27); + + public static final int EVENT_SYNERGY_CUSTOM = 4; + public static final String NIMBLE_NOTIFICATION_TRACKING_SYNERGY_POSTING_TO_SERVER = "nimble.notification.trackingimpl.synergy.postingToServer"; + public final int value; + + private SynergyConstants(int n3) { + this.value = n3; + } + + public static SynergyConstants fromInt(int n2) { + SynergyConstants[] synergyConstantsArray = SynergyConstants.values(); + int n3 = synergyConstantsArray.length; + int n4 = 0; + while (n4 < n3) { + SynergyConstants synergyConstants = synergyConstantsArray[n4]; + if (synergyConstants.value == n2) { + return synergyConstants; + } + ++n4; + } + return EVT_UNDEFINED; + } + + public boolean isSessionEndEventType() { + switch (this.ordinal()) { + default: { + return false; + } + case 10: + case 11: + } + return true; + } + + public boolean isSessionStartEventType() { + switch (this) { + default: { + return false; + } + case EVT_APPSTART_NORMALLY: + case EVT_APPSTART_AFTERINSTALL: + case EVT_APPSTART_AFTERUPGRADE: + case EVT_APPSTART_FROM_URL: + case EVT_APPSTART_FROMPUSH: + case EVT_APP_SESSION_START: + case EVT_APP_ENTER_FOREGROUND_FROM_URL: + case EVT_NEW_SESSION_START_SYNERGYID_CHANGE: + case EVT_APP_RESUME_FROM_PUSH: + } + return true; + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/Tracking.java b/app/src/main/java/com/ea/nimble/tracking/Tracking.java new file mode 100644 index 0000000..ad83a48 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/Tracking.java @@ -0,0 +1,104 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import com.ea.nimble.Base; +import com.ea.nimble.tracking.ITracking; +import com.ea.nimble.tracking.TrackingWrangler; +import java.util.Date; +import java.util.Map; + +public class Tracking { + public static final String COMPONENT_ID = "com.ea.nimble.tracking"; + public static final String EVENT_APPRESUME_FROMEBISU = "NIMBLESTANDARD::APPRESUME_FROMEBISU"; + public static final String EVENT_APPRESUME_FROMPUSH = "NIMBLESTANDARD::APPRESUME_FROMPUSH"; + public static final String EVENT_APPRESUME_FROMURL = "NIMBLESTANDARD::APPRESUME_FROMURL"; + public static final String EVENT_APPRESUME_NORMAL = "NIMBLESTANDARD::APPRESUME_NORMAL"; + public static final String EVENT_APPSTART_AFTERINSTALL = "NIMBLESTANDARD::APPSTART_AFTERINSTALL"; + public static final String EVENT_APPSTART_AFTERUPGRADE = "NIMBLESTANDARD::APPSTART_AFTERUPGRADE"; + public static final String EVENT_APPSTART_FROMPUSH = "NIMBLESTANDARD::APPSTART_FROMPUSH"; + public static final String EVENT_APPSTART_FROMURL = "NIMBLESTANDARD::APPSTART_FROMURL"; + public static final String EVENT_APPSTART_NORMAL = "NIMBLESTANDARD::APPSTART_NORMAL"; + public static final String EVENT_LEVEL_UP = "NIMBLESTANDARD::LEVEL_UP"; + public static final String EVENT_MTX_FREEITEM_DOWNLOADED = "NIMBLESTANDARD::MTX_FREEITEM_DOWNLOADED"; + public static final String EVENT_MTX_ITEM_BEGIN_PURCHASE = "NIMBLESTANDARD::MTX_ITEM_BEGIN_PURCHASE"; + public static final String EVENT_MTX_ITEM_PURCHASED = "NIMBLESTANDARD::MTX_ITEM_PURCHASED"; + public static final String EVENT_PN_DEVICE_REGISTERED = "NIMBLESTANDARD::PN_DEVICE_REGISTERED"; + public static final String EVENT_PN_DISPLAY_OPT_IN = "NIMBLESTANDARD::PN_DISPLAY_OPT_IN"; + public static final String EVENT_PN_RECEIVED = "NIMBLESTANDARD::PN_RECEIVED"; + public static final String EVENT_PN_SHOWN_TO_USER = "NIMBLESTANDARD::PN_SHOWN_TO_USER"; + public static final String EVENT_PN_USER_CLICKED_OK = "NIMBLESTANDARD::PN_USER_CLICKED_OK"; + public static final String EVENT_PN_USER_OPT_IN = "NIMBLESTANDARD::PN_USER_OPT_IN"; + public static final String EVENT_REFERRERID_RECEIVED = "NIMBLESTANDARD::REFERRER_ID_RECEIVED"; + public static final String EVENT_SESSION_END = "NIMBLESTANDARD::SESSION_END"; + public static final String EVENT_SESSION_START = "NIMBLESTANDARD::SESSION_START"; + public static final String EVENT_SESSION_TIME = "NIMBLESTANDARD::SESSION_TIME"; + public static final String EVENT_TUTORIAL_COMPLETE = "NIMBLESTANDARD::TUTORIAL_COMPLETE"; + public static final String EVENT_USER_REGISTERED = "NIMBLESTANDARD::USER_REGISTERED"; + public static final String EVENT_USER_TRACKING_OPTOUT = "NIMBLESTANDARD::USER_TRACKING_OPTOUT"; + public static final String KEY_DURATION = "NIMBLESTANDARD::KEY_DURATION"; + public static final String KEY_GAMEPLAY_DURATION = "NIMBLESTANDARD::KEY_GAMEPLAY_DURATION"; + public static final String KEY_MTX_CURRENCY = "NIMBLESTANDARD::KEY_MTX_CURRENCY"; + public static final String KEY_MTX_PRICE = "NIMBLESTANDARD::KEY_MTX_PRICE"; + public static final String KEY_MTX_SELLID = "NIMBLESTANDARD::KEY_MTX_SELLID"; + public static final String KEY_PN_DATE_OF_BIRTH = "NIMBLESTANDARD::KEY_PN_DATE_OF_BIRTH"; + public static final String KEY_PN_DEVICE_ID = "NIMBLESTANDARD::KEY_PN_DEVICE_ID"; + public static final String KEY_PN_DISABLED_FLAG = "NIMBLESTANDARD::KEY_PN_DISABLED_FLAG"; + public static final String KEY_PN_MESSAGE_ID = "NIMBLESTANDARD::KEY_PN_MESSAGE_ID"; + public static final String KEY_PN_MESSAGE_TYPE = "NIMBLESTANDARD::KEY_PN_MESSAGE_TYPE"; + public static final String KEY_REFERRER_ID = "NIMBLESTANDARD::KEY_REFERRER_ID"; + public static final String KEY_USERNAME = "NIMBLESTANDARD::KEY_USERNAME"; + public static final String KEY_USER_LEVEL = "NIMBLESTANDARD::KEY_USER_LEVEL"; + public static final String NIMBLE_TRACKING_ATTRIBUTE_PROGRESSION_LEVEL = "NIMBLESTANDARD::ATTRIBUTE_PROGRESSION_LEVEL"; + public static final String NIMBLE_TRACKING_DEFAULTENABLE = "com.ea.nimble.tracking.defaultEnable"; + public static final String NIMBLE_TRACKING_EVENT_IDENTITY_LOGIN = "NIMBLESTANDARD::IDENTITY_LOGIN"; + public static final String NIMBLE_TRACKING_EVENT_IDENTITY_LOGOUT = "NIMBLESTANDARD::IDENTITY_LOGOUT"; + public static final String NIMBLE_TRACKING_EVENT_IDENTITY_MIGRATION = "NIMBLESTANDARD::IDENTITY_MIGRATION"; + public static final String NIMBLE_TRACKING_EVENT_IDENTITY_MIGRATION_STARTED = "NIMBLESTANDARD::IDENTITY_MIGRATION_STARTED"; + public static final String NIMBLE_TRACKING_KEY_IDENTITY_MAP_SOURCE = "NIMBLESTANDARD::KEY_IDENTITY_SOURCE"; + public static final String NIMBLE_TRACKING_KEY_IDENTITY_MAP_TARGET = "NIMBLESTANDARD::KEY_IDENTITY_TARGET"; + public static final String NIMBLE_TRACKING_KEY_IDENTITY_PIDMAP_LOGIN = "NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGIN"; + public static final String NIMBLE_TRACKING_KEY_IDENTITY_PIDMAP_LOGOUT = "NIMBLESTANDARD::KEY_IDENTITY_PIDMAP_LOGOUT"; + public static final String NIMBLE_TRACKING_KEY_MIGRATION_GAME_TRIGGERED = "NIMBLESTANDARD::KEY_MIGRATION_GAME_TRIGGERED"; + public static final String NIMBLE_TRACKING_KEY_PN_MESSAGEID = "NIMBLESTANDARD::KEY_PN_MESSAGE_ID"; + private static final String SESSION_END_EVENT_PREFIX = "SESSION_END"; + private static final String SESSION_RESUME_EVENT_PREFIX = "APPRESUME_"; + private static final String SESSION_START_EVENT_PREFIX = "APPSTART_"; + private static final String STANDARD_EVENT_PREFIX = "NIMBLESTANDARD::"; + + public static ITracking getComponent() { + return (ITracking)((Object)Base.getComponent(COMPONENT_ID)); + } + + private static void initialize() { + Base.registerComponent(new TrackingWrangler(), COMPONENT_ID); + } + + public static boolean isNimbleStandardEvent(String string2) { + if (string2 != null) return string2.startsWith(STANDARD_EVENT_PREFIX); + return false; + } + + public static boolean isSessionEndEvent(String string2) { + if (string2 != null) return string2.startsWith(SESSION_END_EVENT_PREFIX, STANDARD_EVENT_PREFIX.length()); + return false; + } + + public static boolean isSessionStartEvent(String string2) { + if (string2 == null) { + return false; + } + if (string2.startsWith(SESSION_START_EVENT_PREFIX, STANDARD_EVENT_PREFIX.length())) return true; + if (string2.equals(EVENT_SESSION_START)) return true; + if (!string2.startsWith(SESSION_RESUME_EVENT_PREFIX, STANDARD_EVENT_PREFIX.length())) return false; + return true; + } + + public static class Event { + Map parameters; + Date timestamp; + String type; + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingBaseSessionObject.java b/app/src/main/java/com/ea/nimble/tracking/TrackingBaseSessionObject.java new file mode 100644 index 0000000..83b149c --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/TrackingBaseSessionObject.java @@ -0,0 +1,51 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import java.io.Externalizable; +import java.io.IOException; +import java.io.ObjectInput; +import java.io.ObjectOutput; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TrackingBaseSessionObject +implements Externalizable { + private static final long serialVersionUID = 1L; + public List> events = new ArrayList>(); + public int repostCount; + public Map sessionData; + + public TrackingBaseSessionObject() { + this.sessionData = new HashMap(); + this.repostCount = 0; + } + + public TrackingBaseSessionObject(Map map) { + this.sessionData = map; + this.repostCount = 0; + } + + public int countOfEvents() { + if (this.events != null) return this.events.size(); + return 0; + } + + @Override + public void readExternal(ObjectInput objectInput) throws IOException, ClassNotFoundException { + this.events = (List)objectInput.readObject(); + this.sessionData = (Map)objectInput.readObject(); + this.repostCount = objectInput.readInt(); + } + + @Override + public void writeExternal(ObjectOutput objectOutput) throws IOException { + objectOutput.writeObject(this.events); + objectOutput.writeObject(this.sessionData); + objectOutput.writeInt(this.repostCount); + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java b/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java new file mode 100644 index 0000000..f34e291 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/TrackingEventWrangler.java @@ -0,0 +1,199 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.Intent + * android.os.Bundle + */ +package com.ea.nimble.tracking; + +import android.content.Intent; +import android.os.Bundle; + +import com.ea.ironmonkey.devmenu.util.Observer; +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.ApplicationLifecycle; +import com.ea.nimble.Base; +import com.ea.nimble.Component; +import com.ea.nimble.IApplicationLifecycle; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; +import com.ea.nimble.SynergyEnvironment; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +class TrackingEventWrangler +extends Component +implements IApplicationLifecycle.ApplicationLifecycleCallbacks, +LogSource { + private static final String APP_VERSION_PERSISTENCE_ID = "applicationBundleVersion"; + public static final String COMPONENT_ID = "com.ea.nimble.tracking.eventwrangler"; + private Long m_sessionStartTimestamp; + + private TrackingEventWrangler() { + } + + private void addPushTNGTrackingParams(Bundle bundle, Map map) { + if (bundle == null) return; + if (bundle.isEmpty()) return; + if (bundle.containsKey("pushId")) { + map.put("NIMBLESTANDARD::KEY_PN_MESSAGE_ID", bundle.getString("pushId")); + } + if (bundle.containsKey("pnType")) { + map.put("NIMBLESTANDARD::KEY_PN_MESSAGE_TYPE", bundle.getString("pnType")); + } + if (map == null) return; + if (map.isEmpty()) return; + map.put("NIMBLESTANDARD::KEY_PN_DEVICE_ID", SynergyEnvironment.getComponent().getEADeviceId()); + } + + private static void initialize() { + Base.registerComponent(new TrackingEventWrangler(), COMPONENT_ID); + } + + private void logAndCheckEvent(String string2) { + this.logAndCheckEvent(string2, null); + } + + private void logAndCheckEvent(String string2, Map map) { + Object object; + if (Tracking.isSessionStartEvent(string2)) { + if (this.m_sessionStartTimestamp != null) { + Log.Helper.LOGE(this, "Pre-existing session start timestamp found while logging new session start! Overwriting previous session start timestamp."); + } else { + Log.Helper.LOGD(this, "Marking session start time."); + } + this.m_sessionStartTimestamp = System.currentTimeMillis(); + } else if (Tracking.isSessionEndEvent(string2)) { + if (this.m_sessionStartTimestamp == null) { + Log.Helper.LOGE(this, "No session start timestamp found while logging new session end! Skip logging 'session time' event."); + } else { + double d2 = (double)(System.currentTimeMillis() - this.m_sessionStartTimestamp) / 1000.0; + object = String.format(Locale.US, "%.0f", d2); + Log.Helper.LOGD(this, "Logging session time, %s seconds.", object); + HashMap hashMap = new HashMap(); + hashMap.put("NIMBLESTANDARD::KEY_DURATION", (String)object); + this.logAndCheckEvent("NIMBLESTANDARD::SESSION_TIME", hashMap); + this.m_sessionStartTimestamp = null; + } + } + ITracking component = (ITracking) Base.getComponent("com.ea.nimble.tracking"); + if (component == null) return; + component.logEvent(string2, map); + } + + @Override + public void cleanup() { + ApplicationLifecycle.getComponent().unregisterApplicationLifecycleCallbacks(this); + } + + @Override + public String getComponentId() { + return COMPONENT_ID; + } + + @Override + public String getLogSourceTitle() { + return "Tracking"; + } + + /* + * Unable to fully structure code + */ + @Override + public void onApplicationLaunch(Intent var1_1) { + Observer.onCallingMethod(Observer.Method.HARD_TO_RECOVER_LOGIC, Observer.Method.VERY_SUSPICIOUS_METHOD); + /* + EASPDataLoader.EASPDataBuffer var2_3; + Object var3_6; + block10: { + block9: { + block8: { + if (var1_1.getData() != null) { + this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_FROMURL"); + return; + } + if (var1_1.getStringExtra("PushNotification") != null || ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).getString("PushNotification", null) != null) { + Log.Helper.LOGI(this, "Awesome. PN launched me"); + var2_2 = new HashMap(); + this.addPushTNGTrackingParams(var1_1.getExtras(), var2_2); + if (var2_2.isEmpty()) { + this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_FROMPUSH"); + return; + } + this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_FROMPUSH", var2_2); + return; + } + var1_1 = PersistenceService.getPersistenceForNimbleComponent("com.ea.nimble.tracking.eventwrangler", Persistence.Storage.CACHE); + var2_3 = var1_1.getStringValue("applicationBundleVersion"); + var3_6 = ApplicationEnvironment.getComponent().getApplicationVersion(); + Log.Helper.LOGD(this, "Current app version, %s. Cached app version, %s", var3_6, var2_3); + if (var2_3 != null) break block10; + var1_1.setValue("applicationBundleVersion", (Serializable)var3_6); + var1_1 = null; + try { + var1_1 = var2_3 = EASPDataLoader.loadDatFile(EASPDataLoader.getTrackingDatFilePath()); +lbl22: + // 3 sources + + while (var1_1 != null) { + break block8; + } + break block9; + } + catch (FileNotFoundException var2_4) { + Log.Helper.LOGD(this, "No EASP tracking file."); + } + catch (Exception var2_5) { + Log.Helper.LOGE(this, "Exception loading EASP tracking file."); + ** GOTO lbl22 + } + } + Log.Helper.LOGD(this, "EASP tracking file found. Counting as app update."); + this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_AFTERUPGRADE"); + return; + } + this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_AFTERINSTALL"); + return; + } + if (!var2_3.equals(var3_6)) { + var1_1.setValue("applicationBundleVersion", (Serializable)var3_6); + this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_AFTERUPGRADE"); + return; + } + this.logAndCheckEvent("NIMBLESTANDARD::APPSTART_NORMAL"); + + */ + } + + @Override + public void onApplicationQuit() { + this.logAndCheckEvent("NIMBLESTANDARD::SESSION_END"); + } + + @Override + public void onApplicationResume() { + if (ApplicationEnvironment.getCurrentActivity().getIntent().getData() != null) { + this.logAndCheckEvent("NIMBLESTANDARD::APPRESUME_FROMURL"); + return; + } + if (ApplicationEnvironment.getComponent().getApplicationContext().getSharedPreferences("PushNotification", 0).getString("PushNotification", null) != null) { + this.logAndCheckEvent("NIMBLESTANDARD::APPRESUME_FROMPUSH"); + return; + } + this.logAndCheckEvent("NIMBLESTANDARD::SESSION_START"); + } + + @Override + public void onApplicationSuspend() { + this.logAndCheckEvent("NIMBLESTANDARD::SESSION_END"); + } + + @Override + public void restore() { + ApplicationLifecycle.getComponent().registerApplicationLifecycleCallbacks(this); + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingS2S.java b/app/src/main/java/com/ea/nimble/tracking/TrackingS2S.java new file mode 100644 index 0000000..517f831 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/TrackingS2S.java @@ -0,0 +1,15 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import com.ea.nimble.tracking.NimbleTrackingS2SComponent; + +public class TrackingS2S { + public static final String EVENT_CUSTOM = "SYNERGYS2S::CUSTOM"; + + private static void initialize() { + NimbleTrackingS2SComponent.initialize(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingSynergy.java b/app/src/main/java/com/ea/nimble/tracking/TrackingSynergy.java new file mode 100644 index 0000000..1ebdd90 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/TrackingSynergy.java @@ -0,0 +1,15 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import com.ea.nimble.tracking.NimbleTrackingSynergyComponent; + +public class TrackingSynergy { + public static final String EVENT_CUSTOM = "SYNERGYTRACKING::CUSTOM"; + + private static void initialize() { + NimbleTrackingSynergyComponent.initialize(); + } +} + diff --git a/app/src/main/java/com/ea/nimble/tracking/TrackingWrangler.java b/app/src/main/java/com/ea/nimble/tracking/TrackingWrangler.java new file mode 100644 index 0000000..33c39b2 --- /dev/null +++ b/app/src/main/java/com/ea/nimble/tracking/TrackingWrangler.java @@ -0,0 +1,143 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.ea.nimble.tracking; + +import com.ea.ironmonkey.devmenu.util.Observer; +import com.ea.nimble.ApplicationEnvironment; +import com.ea.nimble.Base; +import com.ea.nimble.Component; +import com.ea.nimble.Log; +import com.ea.nimble.LogSource; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +public class TrackingWrangler extends Component implements LogSource, ITracking { + private ITracking[] m_trackingComponents; + + public TrackingWrangler() { + m_trackingComponents = new ITracking[10]; + Arrays.fill(m_trackingComponents, new ITracking() { + @Override + public void addCustomSessionData(String var1, String var2) { + + } + + @Override + public void clearCustomSessionData() { + + } + + @Override + public boolean getEnable() { + return false; + } + + @Override + public void logEvent(String var1, Map var2) { + + } + + @Override + public void setEnable(boolean var1) { + + } + + @Override + public void setTrackingAttribute(String var1, String var2) { + + } + }); + } + + static TrackingWrangler getComponent() { + return (TrackingWrangler)Tracking.getComponent(); + } + + @Override + public void addCustomSessionData(String string2, String string3) { + ITracking[] iTrackingArray = m_trackingComponents; + for(ITracking tracking : iTrackingArray){ + tracking.addCustomSessionData(string2, string3); + } + } + + @Override + public void clearCustomSessionData() { + ITracking[] iTrackingArray = this.m_trackingComponents; + for(ITracking tracking : iTrackingArray){ + tracking.clearCustomSessionData(); + } + } + + @Override + public String getComponentId() { + return "com.ea.nimble.tracking"; + } + + @Override + public boolean getEnable() { + return false; + } + + @Override + public String getLogSourceTitle() { + return "Tracking"; + } + + @Override + public void logEvent(String string2, Map map) { + Log.Helper.LOGD(this, "Logging event, " + string2); + if(m_trackingComponents != null) + for(ITracking tracking : m_trackingComponents) + tracking.logEvent(string2, map); + } + + @Override + public void restore() { + Object object = Base.getComponentList("com.ea.nimble.trackingimpl"); + this.m_trackingComponents = new ITracking[((Component[])object).length]; + int n2 = 0; + while (true) { + if (n2 >= ((Component[])object).length) { + object = ReferrerReceiver.getReferrerId(ApplicationEnvironment.getComponent().getApplicationContext()); + if (object == null) return; + if (((String)object).isEmpty()) return; + Log.Helper.LOGI(this, "Received a referrer id that was been sent while Nimble was not active; referrerId = " + (String)object); + HashMap hashMap = new HashMap(); + hashMap.put("NIMBLESTANDARD::KEY_REFERRER_ID", (String)object); + this.logEvent("NIMBLESTANDARD::REFERRER_ID_RECEIVED", hashMap); + ReferrerReceiver.clearReferrerId(ApplicationEnvironment.getComponent().getApplicationContext()); + return; + } + ++n2; + } + } + + @Override + public void setEnable(boolean bl2) { + StringBuilder stringBuilder = new StringBuilder(); + Object object = bl2 ? "ENABLE" : "DISABLE"; + Log.Helper.LOGD(this, stringBuilder.append((String)object).append(" tracking").toString()); + object = this.m_trackingComponents; + int n2 = ((ITracking[])object).length; + int n3 = 0; + while (n3 < n2) { + ++n3; + } + } + + @Override + public void setTrackingAttribute(String string2, String string3) { + ITracking[] iTrackingArray = this.m_trackingComponents; + int n2 = iTrackingArray.length; + int n3 = 0; + while (n3 < n2) { + iTrackingArray[n3].setTrackingAttribute(string2, string3); + ++n3; + } + } +} + diff --git a/app/src/main/java/com/eamobile/ADCTelemetry.java b/app/src/main/java/com/eamobile/ADCTelemetry.java new file mode 100644 index 0000000..2cf0c36 --- /dev/null +++ b/app/src/main/java/com/eamobile/ADCTelemetry.java @@ -0,0 +1,307 @@ +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.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.HttpConnectionParams; +import org.apache.http.params.HttpParams; +import org.apache.http.util.EntityUtils; +import org.json.JSONException; +import org.json.JSONObject; + +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 = null; + private DownloadActivityInternal downloadActivityInternal; + private boolean downloadStarted; + private Queue eventQueue; + private String pathToQueue; + private TelemetryQueueThread queueThread; + private String uniqueToken; + + /* access modifiers changed from: private */ + public class TelemetryQueueElement { + public String jsonEvent; + public int nrOfRetries; + + public TelemetryQueueElement(int i, String str) { + this.nrOfRetries = i; + this.jsonEvent = str; + } + } + + private class TelemetryQueueThread extends Thread { + private boolean running = true; + + private TelemetryQueueThread() { + } + + 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"); + new TelemetrySendThread(telemetryQueueElement.jsonEvent, telemetryQueueElement.nrOfRetries).start(); + } + try { + sleep(1000); + } catch (Exception e) { + } + } catch (Exception e2) { + Logging.DEBUG_OUT("ADCTelemetry - TelemetryQueueThread " + e2.toString()); + } + } + } + + public synchronized void stopThread() { + this.running = false; + } + } + + private class TelemetrySendThread extends Thread { + private String jsonEvent = null; + private String message; + private int retries; + private int state; + + public TelemetrySendThread(int i, String str) { + this.state = i; + this.message = new Date(System.currentTimeMillis()).toString() + " : " + str; + } + + public TelemetrySendThread(String str, int i) { + this.jsonEvent = str; + this.retries = i; + } + + 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 e) { + } + Logging.DEBUG_OUT("ADCTelemetry - The following JSON will be send: " + jSONObject.toString()); + return jSONObject.toString(); + } + + private String createURL() { + StringBuilder sb = new StringBuilder(); + DownloadActivityInternal unused = ADCTelemetry.this.downloadActivityInternal; + String sb2 = sb.append(DownloadActivityInternal.DOWNLOAD_URL).append("androidContentWS/cms/android/gameasset/application/telemetry?").append(UUID.randomUUID().toString()).toString(); + Logging.DEBUG_OUT("ADCTelemetry - Web service url: " + sb2); + return sb2; + } + + private void sendHttpPost(String str, int i) { + boolean z = false; + try { + DefaultHttpClient 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("Accept", "text/plain"); + httpPost.setHeader("Content-type", "application/json"); + Logging.DEBUG_OUT("ADCTelemetry - Calling web service."); + HttpResponse execute = defaultHttpClient.execute(httpPost); + int statusCode = execute.getStatusLine().getStatusCode(); + Logging.DEBUG_OUT("ADCTelemetry - Received status code " + Integer.toString(statusCode)); + if (statusCode != 200) { + z = true; + } else { + 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 = true; + i++; + } + } else { + Logging.DEBUG_OUT("ADCTelemetry - Received empty body string"); + z = true; + i++; + } + } + if (!z || i >= 5) { + Logging.DEBUG_OUT("ADCTelemetry - Telemetry was send with success"); + return; + } + Logging.DEBUG_OUT("ADCTelemetry - Send failed. Adding event to the queue."); + try { + ADCTelemetry.this.eventQueue.add(new TelemetryQueueElement(i, str)); + } catch (Exception e) { + Logging.DEBUG_OUT("ADCTelemetry - Received exception " + e.toString()); + } + } catch (Exception e2) { + Logging.DEBUG_OUT("ADCTelemetry - Received exception " + e2.toString()); + if (1 == 0 || i >= 5) { + Logging.DEBUG_OUT("ADCTelemetry - Telemetry was send with success"); + return; + } + Logging.DEBUG_OUT("ADCTelemetry - Send failed. Adding event to the queue."); + try { + ADCTelemetry.this.eventQueue.add(new TelemetryQueueElement(i, str)); + } catch (Exception e3) { + Logging.DEBUG_OUT("ADCTelemetry - Received exception " + e3.toString()); + } + } catch (Throwable th) { + if (0 == 0 || i >= 5) { + Logging.DEBUG_OUT("ADCTelemetry - Telemetry was send with success"); + } else { + Logging.DEBUG_OUT("ADCTelemetry - Send failed. Adding event to the queue."); + try { + ADCTelemetry.this.eventQueue.add(new TelemetryQueueElement(i, str)); + } catch (Exception e4) { + Logging.DEBUG_OUT("ADCTelemetry - Received exception " + e4.toString()); + } + } + throw th; + } + } + + 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 ADCTelemetry() { + this.eventQueue = null; + this.queueThread = null; + this.downloadActivityInternal = null; + this.downloadStarted = false; + this.downloadActivityInternal = DownloadActivityInternal.getMainActivity(); + this.uniqueToken = UUID.randomUUID().toString(); + } + + public static synchronized ADCTelemetry getInstance() { + ADCTelemetry aDCTelemetry; + synchronized (ADCTelemetry.class) { + if (instance == null) { + instance = new ADCTelemetry(); + } + aDCTelemetry = instance; + } + return aDCTelemetry; + } + + private String getQueueFileName(String str) { + return str + "/queue.file"; + } + + 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 e) { + } + } else { + Logging.DEBUG_OUT("ADCTelemetry - Queue file doesn't exists."); + } + } + + 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 e) { + } + } + + public void onCreate(String str) { + } + + public void onDestroy() { + } + + 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); + } + } +} diff --git a/app/src/main/java/com/eamobile/DownloadActivity.java b/app/src/main/java/com/eamobile/DownloadActivity.java new file mode 100644 index 0000000..78402e5 --- /dev/null +++ b/app/src/main/java/com/eamobile/DownloadActivity.java @@ -0,0 +1,48 @@ +package com.eamobile; + +import android.app.Activity; +import android.content.Context; + +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 destroyDownloadActvity() { + this.mDownloadActivityInternal.destroyDownloadActvity(); + } + + public void init(Activity activity, IDownloadActivity iDownloadActivity, Context context, Object obj) { + this.mDownloadActivityInternal.init(activity, iDownloadActivity, context, obj); + } + + public void onDestroy() { + this.mDownloadActivityInternal.onDestroy(); + } + + public void onPause() { + this.mDownloadActivityInternal.onPause(); + } + + public void onResume() { + this.mDownloadActivityInternal.onResume(); + } + + public void onWindowFocusChanged(boolean z) { + this.mDownloadActivityInternal.onWindowFocusChanged(z); + } + + 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 new file mode 100644 index 0000000..33e2f54 --- /dev/null +++ b/app/src/main/java/com/eamobile/DownloadActivityInternal.java @@ -0,0 +1,2307 @@ +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.ActivityInfo; +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.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.DeviceData; +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 org.apache.http.HttpEntity; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.DefaultHttpClient; +import org.apache.http.params.BasicHttpParams; +import org.apache.http.params.HttpConnectionParams; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +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 javax.xml.parsers.DocumentBuilderFactory; + +public class DownloadActivityInternal { + static boolean ALTERNATIVE_DATA_FOLDER = false; + static boolean CUSTOM_PROGRESS_BAR = true; + static boolean DELETE_ASSETS_ON_UPDATE = false; + static boolean DISABLE_3G = false; + static String DOWNLOAD_URL = null; + static final String DOWNLOAD_URL_CONFIG_FILE = "DownloadURL.indicate"; + static boolean DO_NOT_OPEN_STORAGE_SETTINGS = false; + 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 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 boolean FORCE_WAKE_DURING_DOWNLOAD = false; + static int MASTER_SELL_ID = 0; + static String MIN_ASSET_VERSION_REQUIRED = null; + private static final int NO_ZIP_ERRORS = 1; + static int NUMBER_OF_HOURS_TO_UPDATE_CHECKING = 0; + static int PRODUCT_ID = 0; + static boolean REDOWNLOAD_ON_SCREEN_SIZE_CHANGE = false; + private static final String RESOURCES_PATH = "downloadcontent/"; + static boolean RETRIEVE_FULL_SCREEN_RESOLUTION = false; + public static final int STATE_INVALID = -1; + public static final int STATE_SHOW_DOWNLOAD_MSG = 1; + public static final int STATE_DOWNLOADING_ASSETS = 2; + public static final int STATE_SUCCESS = 3; + public static final int STATE_SPACE_UNAVAILABLE = 4; + public static final int STATE_FAILURE = 5; + public static final int STATE_SHOW_WIFI_DIALOG = 6; + public static final int STATE_3G_UNAVAILABLE = 7; + public static final int STATE_CHECK_UPDATES = 8; + public static final int STATE_UPDATES_FOUND = 9; + public static final int STATE_SHOW_3G_DIALOG = 10; + public static final int STATE_BG_VIEW = 11; + public static final int STATE_UNSUPPORTED_DEVICE = 12; + public static final int STATE_SERVER_ERROR = 13; + public static final int STATE_CONTACTING_SERVER = 14; + public static final int STATE_CHECKING_HOST_IP = 15; + public static final int STATE_SHOW_DELETING_ASSETS = 16; + private static final 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 int TIMEOUT = 10000; + static int TOTAL_SPACE_MB = 0; + static int TOTAL_SPACE_MB_MIN = 0; + static boolean UNCOMPRESS_ZIP_ON_DEVICE = false; + static boolean UNSAFE_ASSET_DELETION_ON_UPDATE = false; + static boolean USE_INTERNAL_STORAGE = false; + static boolean USE_OLD_PROGRESS_BAR = false; + private static volatile boolean changingState = false; + protected static DownloadProgress downloadProgress; + private static int height; + private static Activity instance; + private static boolean isDownloadRange = false; + private static boolean isInitialized = false; + protected static Language language; + private static ArrayList mErrorList = new ArrayList<>(); + static DownloadActivityInternal mMainActivity = null; + private static int pState = -1; + private static int pStatePrev = -1; + private static String resolution = ""; + private static long spaceAvailableToDownload = -1; + private static long spaceNeededToDownload = -1; + private static int totalDownloadSizeMB = 0; + static boolean unknownHostExceptionTryAgain = true; + 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; + + 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); + } + + private void checkBackgroundImage() { + Logging.DEBUG_OUT("Calling: DownloadActivityInternal checkBackgroundImage()"); + if (this.mContext != null && getBackgroundBitmap() == null) { + 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 e) { + setBackgroundBitmap(null); + } + } + } + + private void checkLanguageChange() { + Logging.DEBUG_OUT("Calling: DownloadActivityInternal checkLanguageChange()"); + if (this.mContext != null && !this.mContext.getResources().getConfiguration().locale.toString().equalsIgnoreCase(this.mLocale)) { + 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)) { + this.mLocale = "en"; + language.loadStrings("en"); + } + } + } + + 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(), PackageManager.GET_PERMISSIONS).requestedPermissions); + boolean z = false; + for (int i = 0; i < EXPECTED_PERMISSIONS.length; i++) { + if (!asList.contains(EXPECTED_PERMISSIONS[i])) { + z = true; + Logging.DEBUG_OUT("\tPermission " + EXPECTED_PERMISSIONS[i] + " is missing."); + } + } + 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 boolean checkZipExtractorResult(int i) { + switch (i) { + case ERROR_ZIP_CHECKSUM_MATCH_FAILED /*{ENCODED_INT: -4}*/: + recordError(-11); + return false; + case ERROR_ZIP_CHECKSUM_NOT_FOUND /*{ENCODED_INT: -3}*/: + setStateChecksumError(); + return false; + case -2: + case -1: + recordError(-12); + return false; + default: + return true; + } + } + + /* access modifiers changed from: private */ + /* access modifiers changed from: public */ + private void cleanState(int i) { + switch (i) { + case 1: + this.pCurrentView = this.downloadMsgView; + break; + case 2: + this.pCurrentView = this.downloadProgressView; + break; + case 3: + if (!checkLocalAssetVersion()) { + this.pCurrentView = this.invalidAssetVersionView; + break; + } else { + Logging.DEBUG_OUT("onResult assetPath = " + this.assetManager.getAssetPath() + " result = " + -1); + this.mDownloadActivity.onResult(this.assetManager.getAssetPath(), -1); + Logging.DEBUG_CLOSE(); + return; + } + 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; + } + try { + 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; + } + + private String convertStreamToString(InputStream inputStream) { + BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream), 8192); + StringBuilder sb = new StringBuilder(); + try { + while (true) { + String readLine = bufferedReader.readLine(); + if (readLine != null) + sb.append(readLine + "\n"); + else + break; + } + } catch (IOException e) { + Logging.DEBUG_OUT("convertStreamToString Exception: " + e); + } + + try { + bufferedReader.close(); + } catch (IOException e) { + Logging.DEBUG_OUT("convertStreamToString Exception: " + e); + } + return sb.toString(); + } + + private boolean downloadAndValidateZipFile(DownloadFileData downloadFileData2, Hashtable hashtable) { + String fileURL = downloadFileData2.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, downloadFileData2))); + } catch (MalformedURLException e) { + e.printStackTrace(); + return false; + } catch (IOException e2) { + e2.printStackTrace(); + return false; + } + } + + /* JADX WARNING: Removed duplicated region for block: B:105:0x031f A[SYNTHETIC, Splitter:B:105:0x031f] */ + /* JADX WARNING: Removed duplicated region for block: B:108:0x0324 A[SYNTHETIC, Splitter:B:108:0x0324] */ + /* JADX WARNING: Removed duplicated region for block: B:32:0x0163 A[SYNTHETIC, Splitter:B:32:0x0163] */ + /* JADX WARNING: Removed duplicated region for block: B:35:0x0168 A[SYNTHETIC, Splitter:B:35:0x0168] */ + /* Code decompiled incorrectly, please refer to instructions dump. */ + private boolean downloadOtherFile(com.eamobile.download.DownloadFileData r29, java.util.Hashtable r30) { + /* + // Method dump skipped, instructions count: 825 + */ + 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) { + IOException e; + Logging.DEBUG_OUT("Extracting files from Zip: " + str); + try { + FileInputStream fileInputStream = new FileInputStream(this.assetManager.getFilePath(str)); + try { + Thread.sleep(1000); + return checkZipExtractorResult(new ZipExtractor().extractFiles(fileInputStream, hashtable, this.assetManager.getAssetPath(), TIMEOUT, new LocalZipExtractorEvent())); + } catch (InterruptedException e3) { + return false; + } + } catch (IOException e4) { + e = e4; + e.printStackTrace(); + 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 WARNING: Removed duplicated region for block: B:24:0x0085 A[SYNTHETIC, Splitter:B:24:0x0085] */ + /* JADX WARNING: Removed duplicated region for block: B:35:0x00a5 A[SYNTHETIC, Splitter:B:35:0x00a5] */ + /* Code decompiled incorrectly, please refer to instructions dump. */ + private java.util.Hashtable getChecksumsHashtable(java.lang.String r17, com.eamobile.download.DownloadFileData[] r18) { + /* + // Method dump skipped, instructions count: 204 + */ + throw new UnsupportedOperationException("Method not decompiled: com.eamobile.DownloadActivityInternal.getChecksumsHashtable(java.lang.String, com.eamobile.download.DownloadFileData[]):java.util.Hashtable"); + } + + private Device getDevice(String str) { + if (this.overrideDevices != 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 static boolean getFlagLastReportDownload() { + return downloadProgress.getFlagLastReportDownload(); + } + + public static boolean getForceWakeDuringDownload() { + return FORCE_WAKE_DURING_DOWNLOAD; + } + + protected static Activity getInstance() { + return instance; + } + + public static DownloadActivityInternal getMainActivity() { + return mMainActivity; + } + + 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; + } + + public static long getRealDownloaded() { + return downloadProgress.getRealDownloaded(); + } + + private String getResolution() { + Device device = getDevice(getModel()); + if (device != null) { + return device.getResolutionString(); + } + String str = null; + if (RETRIEVE_FULL_SCREEN_RESOLUTION) { + str = getResolutionUsingUndocumentedMethods(); + } + if (str == null) { + str = getResolutionUsingDisplayMetrics(); + } + if (instance.getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) { + Logging.DEBUG_OUT("SCREEN_ORIENTATION_LANDSCAPE"); + return str; + } + Logging.DEBUG_OUT("SCREEN_ORIENTATION_PORTRAIT"); + return str; + } + + 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()..."); + + Display defaultDisplay = instance.getWindowManager().getDefaultDisplay(); + width = defaultDisplay.getWidth(); + height = defaultDisplay.getHeight(); + + if (instance.getRequestedOrientation() == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) { + 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; + + } + + public static String getResourcesPath() { + return RESOURCES_PATH; + } + + public static long getSizeDownloaded() { + return downloadProgress.getSizeDownloaded(); + } + + public static int getTotalDownloadSizeMB() { + return totalDownloadSizeMB; + } + + public static String getTotalDownloadSizeMBString() { + return Integer.toString(totalDownloadSizeMB); + } + + public static boolean isInitialized() { + return isInitialized; + } + + private void loadConfigProperties() { + 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 = false; + } else { + isDownloadRange = true; + } + 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 !!!!!"); + } + 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; + Logging.DEBUG_OUT(" "); + } catch (Exception e4) { + Logging.DEBUG_OUT("\tException while loading properties: config.properties" + e4); + } finally { + Logging.DEBUG_OUT(" "); + } + } + + private void loadOverrides() { + InputStream inputStream = null; + try { + InputStream open = instance.getAssets().open(getResourcesPath() + "overrides.xml"); + Element documentElement = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(open).getDocumentElement(); + NodeList elementsByTagName = documentElement.getElementsByTagName("device"); + if (elementsByTagName != null && elementsByTagName.getLength() != 0) { + for (int i = 0; i < elementsByTagName.getLength(); i++) { + Element element = (Element) elementsByTagName.item(i); + NodeList elementsByTagName2 = element.getElementsByTagName("resolution"); + if (!(elementsByTagName2 == null || elementsByTagName2.getLength() == 0)) { + Element element2 = (Element) elementsByTagName2.item(0); + this.overrideDevices.add(new Device(element.getAttribute("name"), Integer.parseInt(element2.getAttribute("width")), Integer.parseInt(element2.getAttribute("height")))); + } + } + NodeList elementsByTagName3 = documentElement.getElementsByTagName("fallback"); + if (elementsByTagName3 != null && elementsByTagName3.getLength() != 0) { + String str = ""; + Element element3 = (Element) elementsByTagName3.item(0); + NodeList elementsByTagName4 = element3.getElementsByTagName("forceDevice"); + if (elementsByTagName4 != null && elementsByTagName4.getLength() > 0) { + str = ((Element) elementsByTagName4.item(0)).getAttribute("name"); + } + NodeList elementsByTagName5 = element3.getElementsByTagName("resolution"); + if (elementsByTagName5 != null && elementsByTagName5.getLength() != 0) { + Element element4 = (Element) elementsByTagName5.item(0); + this.deviceFallback = new Device(str, Integer.parseInt(element4.getAttribute("width")), Integer.parseInt(element4.getAttribute("height"))); + if (open != null) { + try { + open.close(); + } catch (Exception e) { + e.printStackTrace(); + } + } + } else if (open != null) { + try { + open.close(); + } catch (Exception e2) { + e2.printStackTrace(); + } + } + } else if (open != null) { + try { + open.close(); + } catch (Exception e3) { + e3.printStackTrace(); + } + } + } else if (open != null) { + try { + open.close(); + } catch (Exception e4) { + e4.printStackTrace(); + } + } + } catch (FileNotFoundException e5) { + if (0 != 0) { + try { + inputStream.close(); + } catch (Exception e6) { + e6.printStackTrace(); + } + } + } catch (Exception e7) { + e7.printStackTrace(); + if (0 != 0) { + try { + inputStream.close(); + } catch (Exception e8) { + e8.printStackTrace(); + } + } + } catch (Throwable th) { + if (0 != 0) { + try { + inputStream.close(); + } catch (Exception e9) { + e9.printStackTrace(); + } + } + throw th; + } + } + + private void printADCLibInfo() { + Logging.DEBUG_OUT(" "); + Logging.DEBUG_OUT("[ADC lib info]"); + if (Constants.ADC_BUILD_LOCAL.equalsIgnoreCase("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(" "); + } + + 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 ""; + } catch (Exception e) { + Logging.DEBUG_OUT("\t\tException while reading DownloadURL.indicate: " + e); + } + return ""; + } + + private JSONObject sendHttpPost(String str, JSONObject jSONObject) { + InputStream inputStream = null; + try { + DefaultHttpClient defaultHttpClient = new DefaultHttpClient(); + HttpConnectionParams.setConnectionTimeout(defaultHttpClient.getParams(), 10000); + HttpPost httpPost = new HttpPost(str); + httpPost.setEntity(new StringEntity(jSONObject.toString())); + httpPost.setHeader("Accept", "application/json"); + httpPost.setHeader("Content-type", "application/json"); + HttpEntity entity = defaultHttpClient.execute(httpPost).getEntity(); + if (entity != null) { + InputStream content = entity.getContent(); + JSONObject jSONObject2 = new JSONObject(convertStreamToString(content)); + unknownHostExceptionTryAgain = true; + if (content == null) { + return jSONObject2; + } + try { + content.close(); + return jSONObject2; + } catch (Exception e) { + return jSONObject2; + } + } else { + return null; + } + } catch (Exception e3) { + Logging.DEBUG_OUT("[ERROR] An exception occurred in sendHttpPost while trying to obtain the file list."); + Logging.DEBUG_OUT_STACK(e3); + 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); + return sendHttpPost; + } else { + Logging.DEBUG_OUT("Already tried sendHttpPost after failure."); + } + } catch (Throwable th) { + throw th; + } + return new JSONObject(); + } + + 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 = str2 + this.mContext.getFilesDir().getAbsolutePath(); + str3 = str3 + absolutePath2; + } else if (z) { + str2 = str2 + absolutePath; + str3 = 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) { + String str5 = str4 == null ? str3 + str : str4; + this.assetManager.setAlternativeAssetPath(str5); + Logging.DEBUG_OUT("\tsetAlternativeAssetPath(), mAlternativeAssetPath = " + str5); + } + Logging.DEBUG_OUT("\tsetAssetPath(), mAssetPath = " + str2); + } + + public static void setFlagLastReportDownload(boolean z) { + downloadProgress.setFlagLastReportDownload(z); + } + + public static void setForceWakeDuringDownload(boolean z) { + FORCE_WAKE_DURING_DOWNLOAD = z; + } + + 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; + } + } else { + Logging.DEBUG_OUT("Property updateCheckLastTime not found."); + return false; + } + } else { + Logging.DEBUG_OUT("AssetInfo file could not be read."); + return false; + } + } else { + Logging.DEBUG_OUT("NUMBER_OF_HOURS_TO_UPDATE_CHECKING not defined or invalid."); + return false; + } + } + + private boolean startDownloadingFiles(DownloadFileData[] downloadFileDataArr) { + if (!isConnected()) { + Logging.DEBUG_OUT("[ERROR] Connection unavailable"); + recordError(-16); + return false; + } + boolean z = false; + int i = 0; + while (true) { + try { + if (i >= downloadFileDataArr.length) { + break; + } + DownloadFileData downloadFileData2 = downloadFileDataArr[i]; + if (downloadFileData2.getType() == 1) { + if (!UNCOMPRESS_ZIP_ON_DEVICE) { + Logging.DEBUG_OUT("File to download (ZIP): " + downloadFileData2.getFileName()); + Logging.DEBUG_OUT("Files will be downloaded using a ZipInputStream: will NOT be ale to resume"); + Hashtable checksumsHashtable = getChecksumsHashtable(downloadFileData2.getFileName(), downloadFileDataArr); + if (checksumsHashtable == null) { + Logging.DEBUG_OUT("[ERROR] Unable to download required checksums file: " + getMatchingChecksumFile(downloadFileData2.getFileName(), this.downloadFileData).getFileName() + " (" + resolution + ")"); + recordError(-13); + return false; + } else if (!this.assetManager.isFileDownloaded(downloadFileData2.getFileName())) { + Logging.DEBUG_OUT("Downloading file: " + downloadFileData2.getFileName()); + z = downloadAndValidateZipFile(downloadFileData2, checksumsHashtable); + if (!z) { + break; + } + this.assetManager.saveState(downloadFileData2.getFileName() + "\t" + downloadFileData2.getVersion(), null); + downloadProgress.setCurrentFile("n_" + downloadFileData2.getFileName(), (long) downloadFileData2.getSize()); + downloadProgress.fillCurrentFileDownload(false); + } else { + Logging.DEBUG_OUT("File already downloaded:" + downloadFileData2.getFileName()); + downloadProgress.setCurrentFile("n_" + downloadFileData2.getFileName(), (long) downloadFileData2.getSize()); + downloadProgress.fillCurrentFileDownload(true); + setFlagLastReportDownload(false); + z = true; + } + } else { + Logging.DEBUG_OUT("File to download (ZIP): " + downloadFileData2.getFileName()); + Logging.DEBUG_OUT("Zip will be downloaded and uncompressed on device: resume is possible"); + Hashtable checksumsHashtable2 = getChecksumsHashtable(downloadFileData2.getFileName(), downloadFileDataArr); + if (checksumsHashtable2 == null) { + Logging.DEBUG_OUT("[ERROR] Unable to download required checksums file: " + getMatchingChecksumFile(downloadFileData2.getFileName(), this.downloadFileData).getFileName() + " (" + resolution + ")"); + recordError(-13); + return false; + } else if (!this.assetManager.isFileDownloaded(downloadFileData2.getFileName())) { + Logging.DEBUG_OUT("Downloading file: " + downloadFileData2.getFileName()); + z = false; + if (!downloadOtherFile(downloadFileData2, null)) { + break; + } + z = extractAndValidateFilesFromZip(downloadFileData2.getFileName(), checksumsHashtable2); + new File(this.assetManager.getFilePath(downloadFileData2.getFileName())).delete(); + if (!z) { + recordError(-12); + break; + } + this.assetManager.saveState(downloadFileData2.getFileName() + "\t" + downloadFileData2.getVersion(), null); + } else { + Logging.DEBUG_OUT("File already downloaded:" + downloadFileData2.getFileName()); + z = true; + downloadProgress.setCurrentFile("n_" + downloadFileData2.getFileName(), (long) downloadFileData2.getSize()); + downloadProgress.fillCurrentFileDownload(true); + setFlagLastReportDownload(false); + } + } + } else if (downloadFileData2.getType() == 3) { + Logging.DEBUG_OUT("File to download (NON-ZIP): " + downloadFileData2.getFileName()); + Hashtable checksumsHashtable3 = getChecksumsHashtable(downloadFileData2.getFileName(), downloadFileDataArr); + if (checksumsHashtable3 == null) { + Logging.DEBUG_OUT("[ERROR] Unable to download required checksums file: " + getMatchingChecksumFile(downloadFileData2.getFileName(), this.downloadFileData).getFileName() + " (" + resolution + ")"); + recordError(-13); + return false; + } else if (!this.assetManager.isFileDownloaded(downloadFileData2.getFileName())) { + Logging.DEBUG_OUT("Downloading file: " + downloadFileData2.getFileName()); + z = downloadOtherFile(downloadFileData2, checksumsHashtable3); + if (!z) { + break; + } + this.assetManager.saveState(downloadFileData2.getFileName() + "\t" + downloadFileData2.getVersion(), null); + } else { + Logging.DEBUG_OUT("File already downloaded:" + downloadFileData2.getFileName()); + z = true; + downloadProgress.setCurrentFile("n_" + downloadFileData2.getFileName(), (long) downloadFileData2.getSize()); + downloadProgress.fillCurrentFileDownload(true); + setFlagLastReportDownload(false); + } + } 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."); + return z; + } + Logging.DEBUG_OUT("[ERROR] Assets download failed."); + return z; + } + + private void unregisterWifiReceiver() { + 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; + } + } + + private int updateDownloadFilesData(boolean z) { + String brand = getBrand(); + resolution = getResolution(); + String deviceString = getDeviceString(); + if (z) { + if (this.deviceFallback == null) { + return ERROR_UNSUPPORTED_DEVICE; + } + resolution = this.deviceFallback.getResolutionString(); + String name = this.deviceFallback.getName(); + if (!name.equals("")) { + deviceString = name; + } + } + String str = DOWNLOAD_URL; + Logging.DEBUG_OUT(" "); + Logging.DEBUG_OUT("[OVERRIDE DEVICE DATA]"); + Logging.DEBUG_OUT("Checking if device data have been overridden in onRetrievedDeviceData()..."); + try { + DeviceData deviceData = new DeviceData(); + deviceData.setDeviceName(deviceString); + deviceData.setBrandName(brand); + deviceData.setResolution(width, height); + deviceData.setGlExtensions(this.glExtensions); + ((IDeviceData) instance).onRetrievedDeviceData(deviceData); + int i = 0; + if (!deviceString.equals(deviceData.getDeviceName())) { + i = 0 + 1; + Logging.DEBUG_OUT(i + ") Device name was overridden"); + Logging.DEBUG_OUT("\tFrom: " + deviceString); + Logging.DEBUG_OUT("\tTo: " + deviceData.getDeviceName()); + deviceString = deviceData.getDeviceName(); + } + if (!brand.equals(deviceData.getBrandName())) { + i++; + Logging.DEBUG_OUT(i + ") Brand name was overridden"); + Logging.DEBUG_OUT("\tFrom: " + brand); + Logging.DEBUG_OUT("\tTo: " + deviceData.getBrandName()); + brand = deviceData.getBrandName(); + } + width = deviceData.getWidth(); + height = deviceData.getHeight(); + String str2 = deviceData.getWidth() + "x" + deviceData.getHeight(); + if (!resolution.equals(str2)) { + i++; + Logging.DEBUG_OUT(i + ") Resolution was overridden"); + Logging.DEBUG_OUT("\tFrom: " + resolution); + Logging.DEBUG_OUT("\tTo: " + str2); + resolution = str2; + } + if (!this.glExtensions.equals(deviceData.getGlExtensions())) { + i++; + Logging.DEBUG_OUT(i + ") GL Extensions was overridden"); + Logging.DEBUG_OUT("\tFrom: " + this.glExtensions); + Logging.DEBUG_OUT("\tTo: " + deviceData.getGlExtensions()); + this.glExtensions = deviceData.getGlExtensions(); + } + if (i == 0) { + Logging.DEBUG_OUT("No device data overridden."); + } + } catch (ClassCastException e) { + Logging.DEBUG_OUT("onRetrievedDeviceData() not implemented."); + } finally { + Logging.DEBUG_OUT(" "); + } + String str3 = str + "androidContentWS/cms/android/gameasset/application/" + MASTER_SELL_ID + "/pId/" + PRODUCT_ID + "/version/" + getAPKVersion() + "/resolution/" + resolution + "/glext/device/" + deviceString + "/brand/" + brand + "?language=" + this.mLocale; + Logging.DEBUG_OUT("[SENDING REQUEST]"); + Logging.DEBUG_OUT("DOWNLOAD DATA URL\n" + str3); + Logging.DEBUG_OUT("TYPE: POST"); + JSONObject jSONObject = new JSONObject(); + this.downloadFileData = null; + totalDownloadSizeMB = 0; + try { + Logging.DEBUG_OUT("PARAMETERS: "); + jSONObject.put("glext", this.glExtensions); + Logging.DEBUG_OUT("\tglext: " + this.glExtensions); + Logging.DEBUG_OUT("ADDITIONAL INFORMATION:"); + Logging.DEBUG_OUT("\tProduct ID:" + PRODUCT_ID); + Logging.DEBUG_OUT("\tSell ID:" + MASTER_SELL_ID); + Logging.DEBUG_OUT("\tBrand:" + brand); + Logging.DEBUG_OUT("\tDevice:" + deviceString); + Logging.DEBUG_OUT("\tResolution:" + resolution); + Logging.DEBUG_OUT("\tLanguage:" + this.mLocale); + JSONObject sendHttpPost = sendHttpPost(str3, jSONObject); + if (sendHttpPost == null) { + return -15; + } + Logging.DEBUG_OUT("[JSON RESULT]\n" + sendHttpPost); + if (sendHttpPost.has("responseCode")) { + int i2 = sendHttpPost.getInt("responseCode"); + return i2 == 5001 ? ERROR_UNSUPPORTED_DEVICE : i2; + } + Logging.DEBUG_OUT("FILES: "); + JSONArray jSONArray = sendHttpPost.getJSONArray("files"); + for (int i3 = 0; i3 < jSONArray.length(); i3++) { + JSONObject jSONObject2 = jSONArray.getJSONObject(i3); + Logging.DEBUG_OUT("--------------------------------------"); + Logging.DEBUG_OUT("Filename:" + jSONObject2.getString("fileName")); + Logging.DEBUG_OUT("Size (bytes): " + jSONObject2.getInt("fileSize")); + Logging.DEBUG_OUT("Version: " + jSONObject2.getString("version")); + Logging.DEBUG_OUT("Language: " + jSONObject2.getString("language")); + Logging.DEBUG_OUT("URL: " + jSONObject2.getString("fileURL")); + Logging.DEBUG_OUT("--------------------------------------"); + } + this.downloadFileData = new DownloadFileData[jSONArray.length()]; + for (int i4 = 0; i4 < jSONArray.length(); i4++) { + JSONObject jSONObject3 = jSONArray.getJSONObject(i4); + String string = jSONObject3.getString("fileName"); + this.downloadFileData[i4] = new DownloadFileData(string, jSONObject3.getInt("fileSize"), jSONObject3.getString("version"), jSONObject3.getString("language"), jSONObject3.getString("fileURL"), 3); + if (MIN_ASSET_VERSION_REQUIRED != null) { + if (this.assetManager.isVersionLower(this.downloadFileData[i4].getVersion(), MIN_ASSET_VERSION_REQUIRED)) { + return -17; + } + } + if (string.endsWith(".zip")) { + this.downloadFileData[i4].setType(1); + } else if (string.endsWith(".checksums")) { + this.downloadFileData[i4].setType(2); + } + } + try { + spaceNeededToDownload = sendHttpPost.getLong("totalUncompressFilesSize"); + spaceNeededToDownload += getTotalDownloadSizeForNonZipFiles(this.downloadFileData); + } catch (JSONException e2) { + Logging.DEBUG_OUT(e2.toString()); + } + if (this.downloadFileData != null) { + totalDownloadSizeMB = getTotalDownloadSize(this.downloadFileData); + } + return 0; + } catch (Exception e3) { + Logging.DEBUG_OUT("[ERROR]An exception occurred in updateDownloadFilesData():"); + Logging.DEBUG_OUT_STACK(e3); + return -15; + } + } + + /* access modifiers changed from: protected */ + public long calculateDownloaded(File file) { + File[] listFiles = file.listFiles(); + if (listFiles == null) { + return 0; + } + long j = 0; + for (int i = 0; i < listFiles.length; i++) { + j += listFiles[i].isDirectory() ? calculateDownloaded(listFiles[i]) : listFiles[i].length(); + } + return j; + } + + 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(new HttpGet(DOWNLOAD_URL)).getStatusLine().getStatusCode() == 200; + } catch (Exception e) { + Logging.DEBUG_OUT_STACK(e); + return false; + } + } catch (MalformedURLException e2) { + Logging.DEBUG_OUT("Not found: URL is malformed"); + return false; + } + } + + public boolean canOpenStorageSettings() { + return !DO_NOT_OPEN_STORAGE_SETTINGS; + } + + public boolean checkForUpdates() { + if (!ALTERNATIVE_DATA_FOLDER) { + return this.assetManager.checkForUpdates(this.downloadFileData); + } + this.assetManager.useAlternativeAssetPath(false); + if (!this.assetManager.assetsFoundLocally() || this.assetManager.checkForUpdates(this.downloadFileData)) { + this.assetManager.useAlternativeAssetPath(true); + if (!this.assetManager.assetsFoundLocally()) { + Logging.DEBUG_OUT("[ERROR] Something very wrong happened: assets have been found previously, but cannot be found anymore."); + this.assetManager.useAlternativeAssetPath(false); + return true; + } else if (this.assetManager.checkForUpdates(this.downloadFileData)) { + Logging.DEBUG_OUT("Assets on alternative location and update found."); + return true; + } else { + Logging.DEBUG_OUT("Assets on alternative location and no update NOT found."); + return false; + } + } else { + Logging.DEBUG_OUT("Assets on main location and update NOT found."); + return false; + } + } + + public boolean checkLocalAssetVersion() { + if (MIN_ASSET_VERSION_REQUIRED != null) { + return this.assetManager.isAssetVersionCompatible(MIN_ASSET_VERSION_REQUIRED); + } + return true; + } + + 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) { + Logging.DEBUG_OUT("No information found."); + return false; + } + 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; + } + } else { + Logging.DEBUG_OUT("No information found."); + return false; + } + } + + public void checkServerContent(Boolean bool) { + 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)); + } + boolean z = false; + if (ALTERNATIVE_DATA_FOLDER) { + this.assetManager.useAlternativeAssetPath(false); + if (this.assetManager.assetsFoundLocally()) { + z = true; + } else { + this.assetManager.useAlternativeAssetPath(true); + if (this.assetManager.assetsFoundLocally()) { + z = true; + } else { + this.assetManager.useAlternativeAssetPath(false); + } + } + } 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); + } else if (!chooseAvailableMemory()) { + setState(4); + } else if (getState() != 2) { + setState(1); + } + } else { + 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 chooseAvailableMemory() { + if (!ALTERNATIVE_DATA_FOLDER) { + return isSpaceAvailableForDownload(); + } + if (isSpaceAvailableForDownload()) { + this.assetManager.useAlternativeAssetPath(false); + Logging.DEBUG_OUT("Memory space is available in main location."); + return true; + } else if (isSpaceAvailableForAlternativeDownload()) { + this.assetManager.useAlternativeAssetPath(true); + Logging.DEBUG_OUT("Memory space is available only in alternative location."); + return true; + } else { + Logging.DEBUG_OUT("Memory space is not available."); + return false; + } + } + + public void deleteAssets() { + if (UNSAFE_ASSET_DELETION_ON_UPDATE) { + this.assetManager.deleteEntireDownloadFolder(); + } else { + this.assetManager.deleteAssets(); + } + } + + 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; + } + + /* access modifiers changed from: protected */ + public String getAPKVersion() { + try { + return instance.getPackageManager().getPackageInfo(instance.getPackageName(), 0).versionName; + } catch (PackageManager.NameNotFoundException e) { + return ""; + } + } + + /* access modifiers changed from: protected */ + public String getAndroidUniqueId() { + String string = Settings.Secure.getString(instance.getContentResolver(), Settings.Secure.ANDROID_ID); + String deviceId = ((TelephonyManager) instance.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); + return string != null ? "androidId=" + string + "&imei=" + deviceId : "imei=" + deviceId; + } + + public String getApplicationName() { + try { + return instance.getString(instance.getPackageManager().getPackageInfo(instance.getPackageName(), 0).applicationInfo.labelRes); + } catch (PackageManager.NameNotFoundException e) { + return ""; + } + } + + public String getAvailableSpaceForDownload() { + return "" + ((spaceAvailableToDownload / 1024) / 1024); + } + + public Bitmap getBackgroundBitmap() { + return this.bmpBg; + } + + /* access modifiers changed from: protected */ + public String getBrand() { + String str = Build.BRAND; + try { + return URLEncoder.encode(str, "UTF-8"); + } catch (Exception e) { + return str; + } + } + + /* access modifiers changed from: protected */ + public String getDeviceString() { + String str = getManufacturer() + "-" + getModel(); + try { + return URLEncoder.encode(str, "UTF-8"); + } catch (Exception e) { + Logging.DEBUG_OUT("getDeviceString Encode Exception:" + e); + return str; + } + } + + public int getLastError() { + if (mErrorList.size() == 0) { + return 0; + } + return mErrorList.get(mErrorList.size() - 1).intValue(); + } + + /* access modifiers changed from: protected */ + public String getManufacturer() { + try { + return Build.MANUFACTURER; + } catch (Exception e) { + Logging.DEBUG_OUT("getManufacturer Exception:" + e); + return "Unknown"; + } + } + + /* access modifiers changed from: protected */ + public String getModel() { + try { + return Build.MODEL; + } catch (Exception e) { + Logging.DEBUG_OUT("getModel Exception:" + e); + return "Unknown"; + } + } + + public int getNumErrors() { + return mErrorList.size(); + } + + public int getPercentDownloaded() { + double sizeDownloaded = (double) (((float) ((getSizeDownloaded() / 1024) / 1024)) / ((float) totalDownloadSizeMB)); + if (this.percent_downloaded < 100) { + this.percent_downloaded = (int) (100.0d * sizeDownloaded); + } else { + this.percent_downloaded = 100; + } + return this.percent_downloaded; + } + + /* access modifiers changed from: protected */ + public int getPreviousState() { + return pStatePrev; + } + + public String getRequiredSpaceForDownload() { + return spaceNeededToDownload > 0 ? "" + ((spaceNeededToDownload / 1024) / 1024) : "" + TOTAL_SPACE_MB; + } + + public String getSpaceRangeForDownload() { + return spaceNeededToDownload > 0 ? "" + ((spaceNeededToDownload / 1024) / 1024) : !isDownloadRange ? "" + TOTAL_SPACE_MB : "" + TOTAL_SPACE_MB_MIN + "-" + TOTAL_SPACE_MB; + } + + public int getState() { + return pState; + } + + public String getStateName() { + return pState != -1 ? STATE_STRINGS[pState] : "STATE_INVALID"; + } + + public int getTotalDownloadSize(DownloadFileData[] downloadFileDataArr) { + totalDownloadSizeMB = 0; + int i = 0; + for (DownloadFileData downloadFileData2 : downloadFileDataArr) { + try { + i += downloadFileData2.getSize(); + } catch (Exception e) { + Logging.DEBUG_OUT("[ERROR] An exception occurred while calculating download size:" + e); + } + } + totalDownloadSizeMB = (i / 1024) / 1024; + return totalDownloadSizeMB; + } + + public long getTotalDownloadSizeForNonZipFiles(DownloadFileData[] downloadFileDataArr) { + long j = 0; + for (int i = 0; i < downloadFileDataArr.length; i++) { + try { + if (downloadFileDataArr[i].getType() != 1) { + j += (long) 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 WifiReceiver getWifiReceiver() { + return this.wifiReceiver; + } + + 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) { + isInitialized = true; + boolean z = false; + if (ALTERNATIVE_DATA_FOLDER) { + this.assetManager.useAlternativeAssetPath(false); + if (this.assetManager.assetsFoundLocally()) { + z = true; + } else { + this.assetManager.useAlternativeAssetPath(true); + if (this.assetManager.assetsFoundLocally()) { + z = true; + } else { + this.assetManager.useAlternativeAssetPath(false); + } + } + } else { + z = this.assetManager.assetsFoundLocally(); + } + ADCTelemetry.getInstance().onCreate(this.assetManager.getAssetPath()); + if (!z) { + setState(14); + } else if (shouldSkipUpdateCheck()) { + setState(11); + } else { + setState(14); + } + } else { + setState(pState); + } + } + + /* access modifiers changed from: protected */ + public 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); + } + } + + /* access modifiers changed from: protected */ + public int is3G() { + NetworkInfo activeNetworkInfo = ((ConnectivityManager) + instance + .getSystemService(Context.CONNECTIVITY_SERVICE)) + .getActiveNetworkInfo(); + return (activeNetworkInfo == + null || + !activeNetworkInfo.isConnected() || + !activeNetworkInfo.isAvailable() || + activeNetworkInfo.getType() != 0) + ? 0 : 1; + } + + public boolean is3GDisabled() { + return DISABLE_3G; + } + + public boolean isAmazonDevice() { + return getManufacturer().equalsIgnoreCase("amazon"); + } + + /* access modifiers changed from: protected */ + public boolean isConnected() { + NetworkInfo activeNetworkInfo = ((ConnectivityManager) + instance + .getSystemService(Context.CONNECTIVITY_SERVICE)) + .getActiveNetworkInfo(); + return activeNetworkInfo != + null && + activeNetworkInfo.isConnected() && + activeNetworkInfo.isAvailable(); + } + + /* access modifiers changed from: protected */ + public boolean isSpaceAvailableForAlternativeDownload() { + long availableInternalMemorySize; + long j = spaceNeededToDownload; + if (j <= 0) { + j = ((((long) TOTAL_SPACE_MB) * 1024) * 1024) - calculateDownloaded(new File(this.assetManager.getAssetPath())); + if (j <= 0) { + j = 1048576; + } + 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; + } + + /* access modifiers changed from: protected */ + public boolean isSpaceAvailableForDownload() { + long availableExternalMemorySize; + long j = spaceNeededToDownload; + if (j <= 0) { + j = ((((long) TOTAL_SPACE_MB) * 1024) * 1024) - calculateDownloaded(new File(this.assetManager.getAssetPath())); + if (j <= 0) { + j = 1048576; + } + 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; + } + + public boolean isWifiAvailable() { + WifiManager wifiManager = (WifiManager) + instance + .getApplicationContext() + .getSystemService(Context.WIFI_SERVICE); + + boolean isWifiEnabled = wifiManager.isWifiEnabled(); + return isWifiEnabled ? wifiManager.getConnectionInfo().getSupplicantState() == SupplicantState.COMPLETED : isWifiEnabled; + } + + 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 onPause() { + Logging.DEBUG_OUT("DownloadActivityInternal.onPause()"); + if (this.pCurrentView != null) { + this.pCurrentView.pause(); + } + } + + public void onResume() { + Logging.DEBUG_OUT("DownloadActivityInternal.onResume()"); + if (getState() == 6) { + startWifiDownload(true); + } else if (getState() != 4) { + resumeState(getState()); + } else if (chooseAvailableMemory()) { + cleanState(4); + if (!this.assetManager.assetsFoundLocally()) { + setState(1); + } else { + setState(8); + } + } else { + resumeState(4); + } + } + + public void onWindowFocusChanged(boolean z) { + Logging.DEBUG_OUT("DownloadActivityInternal.onWindowFocusChanged(focus == " + z + ")"); + /* + if (instance != null) { + instance.getWindow().getDecorView().setSystemUiVisibility(5894); + } + */ + } + + public void recordError(int i) { + mErrorList.add(Integer.valueOf(i)); + Logging.DEBUG_OUT("ERROR OCCURRED: " + i + " (total: " + mErrorList.size() + ")"); + } + + public void resumeState(int i) { + Logging.DEBUG_OUT("DownloadActivityInternal resumeState: " + (i == -1 ? "STATE_INVALID" : STATE_STRINGS[i])); + switch (i) { + case 1: + this.pCurrentView = this.downloadMsgView; + break; + case 2: + this.pCurrentView = this.downloadProgressView; + break; + case 3: + if (!checkLocalAssetVersion()) { + this.pCurrentView = this.invalidAssetVersionView; + break; + } else { + Logging.DEBUG_OUT("onResult assetPath = " + this.assetManager.getAssetPath() + " result = " + -1); + this.mDownloadActivity.onResult(this.assetManager.getAssetPath(), -1); + Logging.DEBUG_CLOSE(); + return; + } + 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; + } + try { + this.mHandler.postDelayed(new Runnable() { + /* class com.eamobile.DownloadActivityInternal.AnonymousClass3 */ + + public void run() { + Logging.DEBUG_OUT("DownloadActivityInternal resumeState - Making a new runnable to resume."); + if (DownloadActivityInternal.instance != null && DownloadActivityInternal.this.pCurrentView != null) { + 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()"); + } + } + }, 20); + pState = i; + } catch (Exception e) { + Logging.DEBUG_OUT("[ERROR] An exception occurred while resuming State:"); + Logging.DEBUG_OUT_STACK(e); + } + } + + public void setAssetPath(String str, boolean z) { + if (this.configLoaded) { + setAssetPathAux(str, z); + return; + } + this.callSetAssetPathAux = true; + this.activityAssetPath = str; + this.activityUseExternal = z; + } + + public void setBackgroundBitmap(Bitmap bitmap) { + this.bmpBg = bitmap; + } + + public void setState(int i) { + switch (i) { + case STATE_SHOW_DOWNLOAD_MSG: + this.pCurrentView = this.downloadMsgView; + break; + case STATE_DOWNLOADING_ASSETS: + this.pCurrentView = this.downloadProgressView; + break; + case STATE_SUCCESS: + if (!checkLocalAssetVersion()) { + this.pCurrentView = this.invalidAssetVersionView; + break; + } else { + Logging.DEBUG_OUT("onResult assetPath = " + this.assetManager.getAssetPath() + " result = " + -1); + this.mDownloadActivity.onResult(this.assetManager.getAssetPath(), -1); + ADCTelemetry.getInstance().sendTelemetry(1); + try { + Thread.sleep(1000); + } catch (Exception e) { + } + ADCTelemetry.getInstance().onDestroy(); + Logging.DEBUG_CLOSE(); + return; + } + case STATE_SPACE_UNAVAILABLE: + this.pCurrentView = this.spaceUnavailableView; + break; + case STATE_FAILURE: + this.downloadFailedView.setErrorCode(getLastError()); + ADCTelemetry.getInstance().sendTelemetry(3, "MINOR ERROR - error code=" + Integer.toString(getLastError())); + this.pCurrentView = this.downloadFailedView; + break; + case STATE_SHOW_WIFI_DIALOG: + this.pCurrentView = this.showWifiView; + break; + case STATE_3G_UNAVAILABLE: + this.pCurrentView = this.networkUnavailableView; + break; + case STATE_CHECK_UPDATES: + this.pCurrentView = this.checkUpdatesView; + break; + case STATE_UPDATES_FOUND: + this.pCurrentView = this.updatesFoundView; + break; + case STATE_SHOW_3G_DIALOG: + this.pCurrentView = this.show3GView; + break; + case STATE_BG_VIEW: + this.pCurrentView = this.showBGView; + break; + case STATE_UNSUPPORTED_DEVICE: + ADCTelemetry.getInstance().sendTelemetry(3, "CRITICAL ERROR - error code=" + getLastError()); + this.pCurrentView = this.unSupportedDeviceView; + break; + case STATE_SERVER_ERROR: + ADCTelemetry.getInstance().sendTelemetry(3, "CRITICAL ERROR - error code=" + getLastError()); + this.pCurrentView = this.serverErrorView; + break; + case STATE_CONTACTING_SERVER: + this.pCurrentView = this.contactingServerView; + break; + case STATE_CHECKING_HOST_IP: + this.pCurrentView = this.checkingHostIpView; + break; + case STATE_SHOW_DELETING_ASSETS: + this.pCurrentView = this.deletingAssetsView; + break; + } + try { + + Runnable r0 = new Runnable() { + @Override + 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() { + + 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"); + } + }); + } + DownloadActivityInternal.changingState = false; + } + }; + changingState = true; + this.mHandler.postDelayed(r0, 20); + pStatePrev = pState; + pState = i; + } catch (Exception e2) { + Logging.DEBUG_OUT("[ERROR] An exception occurred in setState:"); + Logging.DEBUG_OUT_STACK(e2); + } + } + + public void setStateChecksumError() { + recordError(-10); + this.serverErrorView.setErrorCode(getLastError()); + setState(13); + } + + /* access modifiers changed from: protected */ + public void start3GManager() { + instance.startActivity(new Intent("android.settings.NETWORK_OPERATOR_SETTINGS")); + } + + public void startDataManagement() { + instance.startActivity(new Intent("android.settings.MEMORY_CARD_SETTINGS")); + } + + public boolean startDownload() { + Logging.DEBUG_OUT("DownloadActivityInternal.startDownload()"); + this.assetManager.saveStateDownloadStarted(); + if (this.downloadFileData == null || this.downloadFileData.length <= 0) { + checkServerContent(false); + return false; + } + 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; + } + + public void startGameActivity(int i) { + ADCTelemetry.getInstance().sendTelemetry(4); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + } + ADCTelemetry.getInstance().onDestroy(); + Logging.DEBUG_OUT("onResult assetPath = " + this.assetManager.getAssetPath() + " result = " + i); + this.mDownloadActivity.onResult(this.assetManager.getAssetPath(), i); + Logging.DEBUG_CLOSE(); + } + + public void startWifiDownload(final boolean z) { + Thread r0 = new Thread() { + + @Override + public void run() { + do { + } 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); + } else { + DownloadActivityInternal.this.setState(2); + } + } else { + DownloadActivityInternal.this.setState(2); + } + } else { + Logging.DEBUG_OUT("checking wifi: FAILED"); + if (z) { + DownloadActivityInternal.this.resumeState(6); + } else { + DownloadActivityInternal.this.setState(6); + } + } + } + }; + Logging.DEBUG_OUT("startWifiDownload"); + setState(15); + r0.start(); + } + + public void startWifiManager() { + try { + instance.startActivity(new Intent("android.settings.WIFI_SETTINGS")); + } catch (ActivityNotFoundException e) { + Logging.DEBUG_OUT("[ERROR] Unable to find an Activity to open Wifi settings."); + instance.startActivity(new Intent("android.settings.SETTINGS")); + } + } + + public boolean test3GNetwork() { + NetworkInfo activeNetworkInfo = ((ConnectivityManager) + instance + .getSystemService(Context.CONNECTIVITY_SERVICE)) + .getActiveNetworkInfo(); + if (activeNetworkInfo == null || !activeNetworkInfo.isConnected() || !activeNetworkInfo.isAvailable()) { + return false; + } + return activeNetworkInfo.getType() != ConnectivityManager.TYPE_WIFI + && activeNetworkInfo.getType() == ConnectivityManager.TYPE_MOBILE; + } + + public boolean testNetwork(int[] iArr) { + iArr[0] = -1; + NetworkInfo activeNetworkInfo = ((ConnectivityManager) + instance + .getSystemService(Context.CONNECTIVITY_SERVICE)) + .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 boolean useCustomProgressBar() { + return CUSTOM_PROGRESS_BAR; + } + + public boolean useOldProgressBar() { + return USE_OLD_PROGRESS_BAR; + } +} diff --git a/app/src/main/java/com/eamobile/IDeviceData.java b/app/src/main/java/com/eamobile/IDeviceData.java new file mode 100644 index 0000000..1f28274 --- /dev/null +++ b/app/src/main/java/com/eamobile/IDeviceData.java @@ -0,0 +1,7 @@ +package com.eamobile; + +import com.eamobile.download.DeviceData; + +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 new file mode 100644 index 0000000..eedd440 --- /dev/null +++ b/app/src/main/java/com/eamobile/IDownloadActivity.java @@ -0,0 +1,7 @@ +package com.eamobile; + +public interface IDownloadActivity { + 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 new file mode 100644 index 0000000..d954feb --- /dev/null +++ b/app/src/main/java/com/eamobile/Language.java @@ -0,0 +1,211 @@ +package com.eamobile; + +import androidx.core.view.MotionEventCompat; + +import com.eamobile.download.Logging; + +import java.io.DataInput; +import java.io.DataInputStream; +import java.io.IOException; + +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[NB_STRINGS]; + public final int BUFFER_SIZE = 8096; + private String curLanguage; + + public static int determineFileType(String str) { + int i = 1; + DataInputStream dataInputStream = null; + try { + DataInputStream dataInputStream2 = new DataInputStream(DownloadActivityInternal.getInstance().getAssets().open(str)); + try { + if (dataInputStream2.readUnsignedShort() == 65534) { + i = 2; + } + try { + dataInputStream2.close(); + } catch (Exception ignored) { + } + } catch (IOException e2) { + dataInputStream = dataInputStream2; + try { + dataInputStream.close(); + } catch (Exception ignored) { + } + return i; + } catch (Throwable th2) { + dataInputStream = dataInputStream2; + try { + dataInputStream.close(); + } catch (Exception e4) { + } + } + } catch (IOException e5) { + try { + dataInputStream.close(); + } catch (IOException e) { + e.printStackTrace(); + } + return i; + } + return i; + } + + public static String getString(int i) { + return getString(i, null); + } + + public static String getString(int i, String[] strArr) { + int i2 = 0; + String str = strings[i]; + if (strArr != null) { + try { + if (strArr.length > 0) { + while (str.indexOf("%%") != -1 && i2 < strArr.length) { + int indexOf = str.indexOf("%%"); + str = str.substring(0, indexOf) + strArr[i2] + str.substring(indexOf + 2); + i2++; + } + } + } catch (Exception e) { + Logging.DEBUG_OUT("Exception e:" + e); + } + } + return str; + } + + public static char readChar(DataInput dataInput) throws IOException { + if (fileType != 2) { + return (char) dataInput.readUnsignedByte(); + } + int readUnsignedShort = dataInput.readUnsignedShort(); + return (char) ((readUnsignedShort >> 8) | ((readUnsignedShort & MotionEventCompat.ACTION_MASK) << 8)); + } + + 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 String getCurrentLanguage() { + return this.curLanguage; + } + + + public boolean loadStrings(String param) { + + return false; +/* + String path; + String pSVar2; + Activity ref; + AssetManager ref_00; + InputStream fileStream = null; + int iVar4; + DataInput ref_01; + Vector ref_02; + StringBuilder pSVar5; + + Logging.DEBUG_OUT("\tloadString(" + param + ")"); + + if (param != null) { + + path = DownloadActivityInternal.getResourcesPath() + param + ".txt"; + Logging.DEBUG_OUT("\tOpening file: " + path); + + ref = DownloadActivityInternal.getInstance(); + ref_00 = ref.getAssets(); + + try { + fileStream = ref_00.open(path); + } catch (IOException e) { + Log.e("Lang", e.toString()); + } + + if (fileStream != null) { + ref_02 = new Vector(); + + ref_01 = new DataInput(fileStream); + iVar4 = Language.determineFileType(path); + Language.fileType = iVar4; + if (Language.fileType == 2) { + ref_01.skipBytes(2); + } + do { + path = Language.readTo(ref_01,'\n',true); + ref_02.addElement(path); + } while( true ); + } + Logging.DEBUG_OUT("\tCouldn't find file: " + path); + } + return false; +*/ + } +} diff --git a/app/src/main/java/com/eamobile/WifiReceiver.java b/app/src/main/java/com/eamobile/WifiReceiver.java new file mode 100644 index 0000000..5342afb --- /dev/null +++ b/app/src/main/java/com/eamobile/WifiReceiver.java @@ -0,0 +1,60 @@ +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; + +public class WifiReceiver extends BroadcastReceiver { + private int wifiLevel = 0; + private WifiManager wifiManager; + private String wifiName = ""; + + public WifiReceiver() { + setWifiManager(); + } + + private void setWifiManager() { + Logging.DEBUG_OUT("Calling setWifiManager..."); + try { + if (DownloadActivityInternal.getInstance() != null) { + this.wifiManager = (WifiManager) DownloadActivityInternal.getInstance().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); + } + } + + public int getWifiLevel() { + return this.wifiLevel; + } + + public String getWifiName() { + return this.wifiName; + } + + public void onReceive(Context context, Intent intent) { + updateWifiInfo(); + } + + public void updateWifiInfo() { + if (this.wifiManager == null) { + setWifiManager(); + } + if (this.wifiManager != null && this.wifiManager.isWifiEnabled()) { + 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)"); + } + } + } +} diff --git a/app/src/main/java/com/eamobile/download/AssetManager.java b/app/src/main/java/com/eamobile/download/AssetManager.java new file mode 100644 index 0000000..5366a23 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/AssetManager.java @@ -0,0 +1,520 @@ +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; + +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; + + private boolean belongsToADC(File file, ArrayList arrayList) { + return arrayList.contains(file); + } + + 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; + } + + 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) { + Logging.DEBUG_OUT(absolutePath + " (NOT EMPTY)"); + } else if (belongsToADC(file, arrayList)) { + if (file.delete()) { + Logging.DEBUG_OUT(absolutePath + " (DELETED)"); + } else { + Logging.DEBUG_OUT(absolutePath + " (UNKNOWN ERROR WHILE DELETING)"); + } + try { + Thread.sleep(10); + } catch (InterruptedException e) { + Logging.DEBUG_OUT_STACK(e); + } + } else { + Logging.DEBUG_OUT(absolutePath + " (DOES NOT BELONG TO ADC)"); + } + } catch (SecurityException e2) { + Logging.DEBUG_OUT_STACK(e2); + } + } + + 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 e) { + } + return str3.contains(str); + } + + private ArrayList getDirList() { + try { + ArrayList arrayList = new ArrayList<>(); + File file = new File(getFilePath(DOWNLOAD_CONTROL_FILE2)); + if (!file.exists()) { + return arrayList; + } + BufferedReader bufferedReader = new BufferedReader(new FileReader(file), 8192); + TreeSet treeSet = new TreeSet(); + while (true) { + String readLine = bufferedReader.readLine(); + if (readLine == null) { + break; + } + String[] split = readLine.split("/"); + String str = ""; + for (int i = 0; i < split.length - 1; i++) { + str = str + split[i] + "/"; + treeSet.add(str); + } + } + 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: "); + for (int i2 = 0; i2 < arrayList.size(); i2++) { + Logging.DEBUG_OUT(arrayList.get(i2).getAbsolutePath()); + } + bufferedReader.close(); + return arrayList; + } catch (Exception e) { + return null; + } + } + + /* JADX WARNING: Removed duplicated region for block: B:28:0x008a A[SYNTHETIC, Splitter:B:28:0x008a] */ + /* JADX WARNING: Removed duplicated region for block: B:34:0x009d A[SYNTHETIC, Splitter:B:34:0x009d] */ + /* Code decompiled incorrectly, please refer to instructions dump. */ + private java.lang.String getFileList(com.eamobile.download.DownloadFileData r14) { + /* + // Method dump skipped, instructions count: 187 + */ + throw new UnsupportedOperationException("Method not decompiled: com.eamobile.download.AssetManager.getFileList(com.eamobile.download.DownloadFileData):java.lang.String"); + } + + 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(); + } + + 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 e) { + return false; + } + } + + public boolean checkForUpdates(DownloadFileData[] downloadFileDataArr) { + Logging.DEBUG_OUT("Calling: AssetManager checkForUpdates()"); + boolean z = false; + if (downloadFileDataArr != null && downloadFileDataArr.length > 0) { + try { + if (isVersionLower(getLocalAssetVersion(), downloadFileDataArr[0].getVersion())) { + z = true; + } + } catch (Exception e) { + Logging.DEBUG_OUT("[ERROR] An exception occurred while checking for updates: " + e); + Logging.DEBUG_OUT_STACK(e); + return false; + } + } + return z; + } + + public void clearDownloadDir() { + String[] list; + File file = new File(getAssetPath()); + if (file.isDirectory()) { + for (String str : file.list()) { + new File(file, str).delete(); + } + } + } + + public void deleteAssets() { + try { + File file = new File(getFilePath(DOWNLOAD_CONTROL_FILE2)); + if (file.exists()) { + 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()) { + Logging.DEBUG_OUT("\tDeleting file: " + filePath + " (NOT FOUND)"); + } else if (file2.delete()) { + Logging.DEBUG_OUT("\tDeleting file: " + filePath + " (OK)"); + } else { + Logging.DEBUG_OUT("\tDeleting file: " + filePath + " (FAILED)"); + } + } else { + bufferedReader.close(); + deleteEmptyDirs(getAssetPath(), getDirList()); + return; + } + } + } + } catch (Exception e) { + Logging.DEBUG_OUT("Exception while deleting assets:"); + 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 String getAssetPath() { + return !this.mUseAlternativeAssetPath ? this.mAssetPath : this.mAlternativeAssetPath; + } + + 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; + } + + public String getFilePath(String str) { + return !this.mUseAlternativeAssetPath ? this.mAssetPath + "/" + str : this.mAlternativeAssetPath + "/" + str; + } + + 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 0; + } + + 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; + } else 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 long getTotalSize(String str) { + String[] split; + long j = 0; + for (String str2 : str.split("\n")) { + j += getFileSize(str2); + } + return j; + } + + 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 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 e) { + Logging.DEBUG_OUT(str + " is not downloaded."); + return false; + } + } + + public boolean isVersionLower(String str, String str2) { + int compareTo = normalisedVersion(str2).compareTo(normalisedVersion(str)); + return compareTo >= 0 && compareTo > 0; + } + + 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 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 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); + } + } + + 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 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(); + String replaceAll = str2 != null ? str3.replaceAll(str, str2) : !exists(str, filePath) ? str3 + str : str; + if (!exists(replaceAll, filePath)) { + File file2 = new File(filePath); + if (file2.exists()) { + file2.delete(); + } + BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(filePath, true), 8192); + bufferedWriter.write(replaceAll + "\n"); + bufferedWriter.close(); + return; + } + 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 saveStateDownloadFinished() { + saveState(INDICATE_PROGRESS, INDICATE_FINISHED); + } + + public void saveStateDownloadStarted() { + saveState(INDICATE_PROGRESS, null); + } + + public void setAlternativeAssetPath(String str) { + this.mAlternativeAssetPath = str; + } + + public void setAssetPath(String str) { + this.mAssetPath = str; + } + + 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; + } +} diff --git a/app/src/main/java/com/eamobile/download/ChecksumValidator.java b/app/src/main/java/com/eamobile/download/ChecksumValidator.java new file mode 100644 index 0000000..194b14d --- /dev/null +++ b/app/src/main/java/com/eamobile/download/ChecksumValidator.java @@ -0,0 +1,38 @@ +package com.eamobile.download; + +import java.io.FileInputStream; +import java.io.IOException; +import java.util.zip.CRC32; +import java.util.zip.CheckedInputStream; + +public class ChecksumValidator { + public static boolean validate(String str, String str2, long j) { + String str3 = str; + if (str3.contains(str2)) { + str3 = str3.substring(str3.lastIndexOf(str2) + (str2.charAt(str2.length() + -1) == '/' ? str2.length() : str2.length() + 1)); + } + Logging.DEBUG_OUT("Validating checksum for " + str3); + try { + CheckedInputStream checkedInputStream = new CheckedInputStream(new FileInputStream(str), new CRC32()); + try { + do { + } while (checkedInputStream.read(new byte[8192]) != -1); + long value = checkedInputStream.getChecksum().getValue(); + checkedInputStream.close(); + boolean z = value == j; + if (z) { + Logging.DEBUG_OUT("Checksums match: " + j); + Logging.DEBUG_OUT("File " + str3 + " downloaded successfully"); + return z; + } + Logging.DEBUG_OUT("[ERROR] Checksums do not match FileChecksum:" + value + ", Server Checksums:" + j); + Logging.DEBUG_OUT("File " + str3 + " failed to download"); + return z; + } catch (IOException e) { + return false; + } + } catch (IOException e2) { + return false; + } + } +} diff --git a/app/src/main/java/com/eamobile/download/Constants.java b/app/src/main/java/com/eamobile/download/Constants.java new file mode 100644 index 0000000..efe5a1d --- /dev/null +++ b/app/src/main/java/com/eamobile/download/Constants.java @@ -0,0 +1,8 @@ +package com.eamobile.download; + +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 new file mode 100644 index 0000000..dc76b61 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/Device.java @@ -0,0 +1,29 @@ +package com.eamobile.download; + +public class Device { + private int height = 0; + private String name = ""; + private int width = 0; + + public Device(String str, int i, int i2) { + this.name = str; + this.width = i; + this.height = i2; + } + + public int getHeight() { + return this.height; + } + + public String getName() { + return this.name; + } + + public String getResolutionString() { + return this.width + "x" + this.height; + } + + public int getWidth() { + return this.width; + } +} diff --git a/app/src/main/java/com/eamobile/download/DeviceData.java b/app/src/main/java/com/eamobile/download/DeviceData.java new file mode 100644 index 0000000..8e88f0d --- /dev/null +++ b/app/src/main/java/com/eamobile/download/DeviceData.java @@ -0,0 +1,118 @@ +package com.eamobile.download; + +import java.util.EnumSet; +import java.util.Set; + +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 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 "; + } + } + + public String getBrandName() { + return this.brandName; + } + + public String getDeviceName() { + return this.deviceName; + } + + public String getGlExtensions() { + return this.glExtensions; + } + + public int getHeight() { + return this.height; + } + + 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 int getWidth() { + return this.width; + } + + public void setBrandName(String str) { + this.brandName = str; + } + + public void setDeviceName(String str) { + this.deviceName = str; + } + + public void setGlExtensions(String str) { + this.glExtensions = str; + } + + public void setResolution(int i, int i2) { + this.width = i; + this.height = i2; + } +} diff --git a/app/src/main/java/com/eamobile/download/DownloadFileData.java b/app/src/main/java/com/eamobile/download/DownloadFileData.java new file mode 100644 index 0000000..7889b66 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/DownloadFileData.java @@ -0,0 +1,74 @@ +package com.eamobile.download; + +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 String getFileURL() { + return this.fileURL; + } + + public String getLanguage() { + return this.language; + } + + public int getSize() { + return this.size; + } + + public int getType() { + return this.type; + } + + public String getVersion() { + return this.version; + } + + public void setFileName(String str) { + this.fileName = str; + } + + public void setFileURL(String str) { + this.fileURL = str; + } + + public void setLanguage(String str) { + this.language = str; + } + + public void setSize(int i) { + this.size = i; + } + + public void setType(int i) { + this.type = i; + } + + public void setVersion(String str) { + this.version = str; + } + + 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 new file mode 100644 index 0000000..997ae5c --- /dev/null +++ b/app/src/main/java/com/eamobile/download/DownloadProgress.java @@ -0,0 +1,86 @@ +package com.eamobile.download; + +import java.util.HashMap; + +public class DownloadProgress { + private FileProgress currentFileProgress = null; + private boolean isLastReportDownload = true; + private HashMap progressMap = new HashMap<>(); + private long realDownloaded = 0; + private long sizeDownloaded = 0; + + /* access modifiers changed from: package-private */ + public 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"); + } + + 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 boolean getFlagLastReportDownload() { + return this.isLastReportDownload; + } + + public long getRealDownloaded() { + return this.realDownloaded; + } + + public long getSizeDownloaded() { + return this.sizeDownloaded; + } + + 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 reportTotalDownloaded(long j) { + this.realDownloaded += j; + } + + 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(0, j); + this.progressMap.put(str, this.currentFileProgress); + return; + } + this.currentFileProgress = fileProgress; + } + + public void setFlagLastReportDownload(boolean z) { + this.isLastReportDownload = z; + } +} diff --git a/app/src/main/java/com/eamobile/download/IZipExtractorEvent.java b/app/src/main/java/com/eamobile/download/IZipExtractorEvent.java new file mode 100644 index 0000000..3d31c18 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/IZipExtractorEvent.java @@ -0,0 +1,11 @@ +package com.eamobile.download; + +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 new file mode 100644 index 0000000..441b85f --- /dev/null +++ b/app/src/main/java/com/eamobile/download/LocalZipExtractorEvent.java @@ -0,0 +1,21 @@ +package com.eamobile.download; + +public class LocalZipExtractorEvent implements IZipExtractorEvent { + @Override // com.eamobile.download.IZipExtractorEvent + public void onExtractEntryFinish() { + Logging.DEBUG_OUT("LocalZipExtractorEvent.onExtractEntryFinish"); + } + + @Override // com.eamobile.download.IZipExtractorEvent + public void onExtractEntryStart(String str, long j) { + Logging.DEBUG_OUT("LocalZipExtractorEvent.onExtractEntryStart"); + } + + @Override // com.eamobile.download.IZipExtractorEvent + public void onReportDownload(int i) { + } + + @Override // com.eamobile.download.IZipExtractorEvent + public void onReportProgress(int i) { + } +} diff --git a/app/src/main/java/com/eamobile/download/LockManager.java b/app/src/main/java/com/eamobile/download/LockManager.java new file mode 100644 index 0000000..e65f5a6 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/LockManager.java @@ -0,0 +1,87 @@ +package com.eamobile.download; + +import android.content.Context; +import android.net.wifi.WifiManager; +import android.os.PowerManager; + +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 PowerManager powerManager = null; + private PowerManager.WakeLock wakeLock = null; + private WifiManager.WifiLock wifiLock; + private WifiManager wifiManager = null; + + public LockManager(Context context2) { + this.context = context2; + } + + 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) { + Logging.DEBUG_OUT("[ERROR] While acquiring WakeLock (LockManager.acquireWakeLock())."); + return false; + } else if (!this.wakeLock.isHeld()) { + this.wakeLock.acquire(); + Logging.DEBUG_OUT("LockManager.acquireWakeLock() successfully called."); + return true; + } else { + Logging.DEBUG_OUT("LockManager.acquireWakeLock() - wakeLock already acquired."); + return false; + } + } catch (Exception e) { + Logging.DEBUG_OUT("[ERROR] An exception occurred in LockManager.acquireWakeLock()."); + Logging.DEBUG_OUT_STACK(e); + return false; + } + } + + 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) { + Logging.DEBUG_OUT("[ERROR] While acquiring WifiLock (LockManager.acquireWifiLock())."); + return false; + } else if (!this.wifiLock.isHeld()) { + this.wifiLock.acquire(); + Logging.DEBUG_OUT("LockManager.acquireWifiLock() successfully called."); + return true; + } else { + Logging.DEBUG_OUT("LockManager.acquireWifiLock() - wifiLock already acquired."); + return false; + } + } catch (Exception e) { + Logging.DEBUG_OUT("[ERROR] An exception occurred in LockManager.acquireWifiLock()."); + Logging.DEBUG_OUT_STACK(e); + return false; + } + } + + public void releaseWakeLock() { + if (this.wakeLock != null && this.wakeLock.isHeld()) { + this.wakeLock.release(); + this.wakeLock = null; + Logging.DEBUG_OUT("LockManager.releaseWakeLock() successfully called."); + } + } + + public void releaseWifiLock() { + if (this.wifiLock != null && this.wifiLock.isHeld()) { + this.wifiLock.release(); + this.wifiLock = null; + Logging.DEBUG_OUT("LockManager.releaseWifiLock() successfully called."); + } + } +} diff --git a/app/src/main/java/com/eamobile/download/Logging.java b/app/src/main/java/com/eamobile/download/Logging.java new file mode 100644 index 0000000..d782025 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/Logging.java @@ -0,0 +1,59 @@ +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; + +public class Logging { + public static boolean DEBUG_ON = false; + static OutputStream out = null; + + public static void DEBUG_CLOSE() { + if (DEBUG_ON) { + try { + out.flush(); + out.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + 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 e) { + } + } + } + + public static void DEBUG_OUT_STACK(Exception exc) { + StringWriter stringWriter = new StringWriter(); + exc.printStackTrace(new PrintWriter(stringWriter)); + DEBUG_OUT(stringWriter.toString()); + } +} diff --git a/app/src/main/java/com/eamobile/download/MemoryStatus.java b/app/src/main/java/com/eamobile/download/MemoryStatus.java new file mode 100644 index 0000000..229f885 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/MemoryStatus.java @@ -0,0 +1,58 @@ +package com.eamobile.download; + +import android.os.Environment; +import android.os.StatFs; + +public final class MemoryStatus { + static final int ERROR = -1; + + public static boolean externalMemoryAvailable() { + return Environment.getExternalStorageState().equals("mounted"); + } + + public static String formatSize(long j) { + String str = null; + if (j >= 1024) { + str = "KiB"; + j /= 1024; + if (j >= 1024) { + str = "MiB"; + j /= 1024; + } + } + 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(); + } + + public static long getAvailableExternalMemorySize() { + if (!externalMemoryAvailable()) { + return -1; + } + StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath()); + return ((long) statFs.getAvailableBlocks()) * ((long) statFs.getBlockSize()); + } + + public static long getAvailableInternalMemorySize() { + StatFs statFs = new StatFs(Environment.getDataDirectory().getPath()); + return ((long) statFs.getAvailableBlocks()) * ((long) statFs.getBlockSize()); + } + + public static long getTotalExternalMemorySize() { + if (!externalMemoryAvailable()) { + return -1; + } + StatFs statFs = new StatFs(Environment.getExternalStorageDirectory().getPath()); + return ((long) statFs.getBlockCount()) * ((long) statFs.getBlockSize()); + } + + public static long getTotalInternalMemorySize() { + StatFs statFs = new StatFs(Environment.getDataDirectory().getPath()); + return ((long) statFs.getBlockCount()) * ((long) statFs.getBlockSize()); + } +} diff --git a/app/src/main/java/com/eamobile/download/RandomAccessFileReadThread.java b/app/src/main/java/com/eamobile/download/RandomAccessFileReadThread.java new file mode 100644 index 0000000..92906f1 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/RandomAccessFileReadThread.java @@ -0,0 +1,59 @@ +package com.eamobile.download; + +import java.io.IOException; +import java.io.InputStream; +import java.io.RandomAccessFile; + +public class RandomAccessFileReadThread extends Thread { + private byte[] buffer = new byte[8192]; + public int currentFileSize = 0; + private DownloadProgress downloadProgress; + private RandomAccessFile file; + private InputStream in; + public boolean killMe = false; + public boolean reading = true; + public int sizeDownloaded = 0; + public long timestamp = System.currentTimeMillis(); + + public RandomAccessFileReadThread(InputStream inputStream, RandomAccessFile randomAccessFile, DownloadProgress downloadProgress2) { + this.in = inputStream; + this.file = randomAccessFile; + this.downloadProgress = downloadProgress2; + } + + public void run() { + int i = 0; + while (i != -1) { + if (i != 0) { + this.timestamp = System.currentTimeMillis(); + } + try { + i = this.in.read(this.buffer); + } catch (IOException e) { + e.printStackTrace(); + } + if (this.killMe) { + break; + } else if (i == 0) { + Logging.DEBUG_OUT("0 BYTES READ>>>"); + } else if (i > 0) { + try { + this.file.write(this.buffer, 0, i); + } catch (IOException e) { + e.printStackTrace(); + } + this.sizeDownloaded += i; + this.downloadProgress.reportTotalDownloaded((long) i); + try { + this.currentFileSize = ((int) this.file.getFilePointer()) - 1; + } catch (IOException e) { + e.printStackTrace(); + } + 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 new file mode 100644 index 0000000..3de4639 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/ReadThread.java @@ -0,0 +1,58 @@ +package com.eamobile.download; + +import com.google.android.gms.maps.model.BitmapDescriptorFactory; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +/* access modifiers changed from: package-private */ +/* compiled from: ZipExtractor */ +public class ReadThread extends Thread { + private byte[] buffer = new byte[8192]; + private float compRatio = BitmapDescriptorFactory.HUE_RED; + private InputStream in; + public boolean killMe = false; + private OutputStream out; + public volatile boolean pause = false; + public boolean reading = true; + public int sizeDownloaded = 0; + public long timestamp = System.currentTimeMillis(); + private IZipExtractorEvent zipExtractorEvent; + + public ReadThread(InputStream inputStream, OutputStream outputStream, float f, IZipExtractorEvent iZipExtractorEvent) { + this.in = inputStream; + this.out = outputStream; + this.compRatio = f; + this.zipExtractorEvent = iZipExtractorEvent; + } + + public void run() { + int i = 0; + while (i != -1) { + if (i != 0) { + this.timestamp = System.currentTimeMillis(); + } + if (this.killMe) { + break; + } else if (!this.pause) { + try { + i = this.in.read(this.buffer); + } catch (IOException e) { + e.printStackTrace(); + } + if (i == 0) { + Logging.DEBUG_OUT("0 BYTES READ>>>"); + } else if (i > 0) { + try { + this.out.write(this.buffer, 0, i); + } catch (IOException e) { + e.printStackTrace(); + } + this.sizeDownloaded += i; + this.zipExtractorEvent.onReportDownload(Math.round(((float) 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 new file mode 100644 index 0000000..1423abc --- /dev/null +++ b/app/src/main/java/com/eamobile/download/RemoteZipExtractorEvent.java @@ -0,0 +1,33 @@ +package com.eamobile.download; + +public class RemoteZipExtractorEvent implements IZipExtractorEvent { + private DownloadProgress downloadProgress; + private DownloadFileData zipFileData; + + public RemoteZipExtractorEvent(DownloadProgress downloadProgress2, DownloadFileData downloadFileData) { + this.downloadProgress = downloadProgress2; + this.zipFileData = downloadFileData; + } + + @Override // com.eamobile.download.IZipExtractorEvent + public void onExtractEntryFinish() { + Logging.DEBUG_OUT("RemoteZipExtractorEvent.onExtractEntryFinish"); + this.downloadProgress.fillCurrentFileDownload(true); + } + + @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 onReportDownload(int i) { + this.downloadProgress.reportTotalDownloaded((long) i); + } + + @Override // com.eamobile.download.IZipExtractorEvent + public void onReportProgress(int i) { + this.downloadProgress.reportProgress((long) i, true); + } +} diff --git a/app/src/main/java/com/eamobile/download/SpeedCalculator.java b/app/src/main/java/com/eamobile/download/SpeedCalculator.java new file mode 100644 index 0000000..227a369 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/SpeedCalculator.java @@ -0,0 +1,41 @@ +package com.eamobile.download; + +import com.google.android.gms.maps.model.BitmapDescriptorFactory; + +public class SpeedCalculator { + private float averageSpeed = BitmapDescriptorFactory.HUE_RED; + private float currentAmount = BitmapDescriptorFactory.HUE_RED; + private float currentSpeed = BitmapDescriptorFactory.HUE_RED; + private float currentTime = BitmapDescriptorFactory.HUE_RED; + private float previousAmount = BitmapDescriptorFactory.HUE_RED; + private float previousTime = BitmapDescriptorFactory.HUE_RED; + private float smoothingFactor = BitmapDescriptorFactory.HUE_RED; + + public SpeedCalculator(float f) { + this.smoothingFactor = f; + } + + public void forceAmount(float f) { + this.previousAmount = f; + } + + public float getCurrentSpeed() { + return this.averageSpeed; + } + + 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; + } + } +} diff --git a/app/src/main/java/com/eamobile/download/ZipExtractor.java b/app/src/main/java/com/eamobile/download/ZipExtractor.java new file mode 100644 index 0000000..e774c03 --- /dev/null +++ b/app/src/main/java/com/eamobile/download/ZipExtractor.java @@ -0,0 +1,52 @@ +package com.eamobile.download; + +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 = false; + private static boolean pauseDirty = false; + private IZipExtractorEvent zipExtractorEvent; + + public static void setPause(boolean z) { + pause = z; + pauseDirty = true; + } + + /* JADX WARNING: Code restructure failed: missing block: B:104:?, code lost: + return -1; + */ + /* JADX WARNING: Code restructure failed: missing block: B:11:0x0020, code lost: + if (r18 <= 0) goto L_0x0054; + */ + /* JADX WARNING: Code restructure failed: missing block: B:14:0x0026, code lost: + if (r36.isEmpty() == false) goto L_0x0054; + */ + /* JADX WARNING: Code restructure failed: missing block: B:15:0x0028, code lost: + com.eamobile.download.Logging.DEBUG_OUT("Read all the files from Zip Stream"); + */ + /* JADX WARNING: Code restructure failed: missing block: B:20:0x0054, code lost: + com.eamobile.download.Logging.DEBUG_OUT("[ERROR] Bad Zip, contained " + r18 + " Files"); + */ + /* JADX WARNING: Code restructure failed: missing block: B:78:0x0331, code lost: + r8 = move-exception; + */ + /* JADX WARNING: Code restructure failed: missing block: B:79:0x0332, code lost: + com.eamobile.download.Logging.DEBUG_OUT("Exception: downloadAndValidateZipFile():" + r8); + */ + /* JADX WARNING: Code restructure failed: missing block: B:93:?, code lost: + return 1; + */ + /* JADX WARNING: Code restructure failed: missing block: B:96:?, code lost: + return -2; + */ + /* Code decompiled incorrectly, please refer to instructions dump. */ + public int extractFiles(java.io.InputStream r35, java.util.Hashtable r36, java.lang.String r37, int r38, com.eamobile.download.IZipExtractorEvent r39) { + /* + // Method dump skipped, instructions count: 853 + */ + 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 new file mode 100644 index 0000000..a17c707 --- /dev/null +++ b/app/src/main/java/com/eamobile/licensing/ILicenseServerActivityCallback.java @@ -0,0 +1,10 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.eamobile.licensing; + +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 new file mode 100644 index 0000000..65700d4 --- /dev/null +++ b/app/src/main/java/com/eamobile/licensing/LicenseServerActivity.java @@ -0,0 +1,203 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.Activity + * android.content.Context + * android.os.Handler + * android.os.HandlerThread + */ +package com.eamobile.licensing; + +import android.app.Activity; +import android.content.Context; +import android.os.Handler; +import android.os.HandlerThread; +import java.util.ArrayList; + +public class LicenseServerActivity { + private static boolean G; + private static Activity H; + private static int M = 0; + private static int N = 0; + public static final String a = "com.android.vending.licensing.eapref"; + static final int k = -1; + static final int l = 13; + static final int m = 14; + static final int n = 15; + static final int o = 16; + static final int p = 17; + static final int q = 18; + static final int r = 19; + static final int s = 20; + static final int t = 21; + protected static final String u = "licenseserver/"; + protected static Object v; + private static LicenseServerActivity y; + private Object A; + private String B; + private Context C; + private String D; + private Handler E = null; + private boolean F = false; + private Object I; + private Object J; + private Object K; + private String L; + private String O = "en"; + public Object b; + public Object c; + byte[] d; + String e; + public Handler f = null; + Handler g = null; + public Handler h = null; + public Handler i = null; + public String j; + ILicenseServerActivityCallback w = null; + ArrayList x = new ArrayList(); + private Object z; + + static { + y = null; + G = false; + M = -1; + N = -1; + } + + private LicenseServerActivity() { + } + + static /* synthetic */ Handler a(LicenseServerActivity licenseServerActivity) { + return licenseServerActivity.E; + } + + static /* synthetic */ Object a(LicenseServerActivity licenseServerActivity, Object as2) { + licenseServerActivity.A = as2; + return as2; + } + + static /* synthetic */ String a(LicenseServerActivity licenseServerActivity, String string2) { + licenseServerActivity.D = string2; + return string2; + } + + protected static Activity b() { + return H; + } + + static /* synthetic */ String b(LicenseServerActivity licenseServerActivity) { + return licenseServerActivity.L; + } + + static /* synthetic */ Object c(LicenseServerActivity licenseServerActivity) { + return new Object(); + } + + static /* synthetic */ String d(LicenseServerActivity licenseServerActivity) { + return licenseServerActivity.D; + } + + static /* synthetic */ Context e(LicenseServerActivity licenseServerActivity) { + return licenseServerActivity.C; + } + + static /* synthetic */ String f(LicenseServerActivity licenseServerActivity) { + return licenseServerActivity.B; + } + + static /* synthetic */ Object g(LicenseServerActivity licenseServerActivity) { + return licenseServerActivity.A; + } + + private void g() { + if (this.A != null) { + this.A = null; + } + H = null; + y = null; + } + + public static LicenseServerActivity getInstance() { + if (y != null) return y; + y = new LicenseServerActivity(); + return y; + } + + private void h() { + if (this.J == null) return; + } + + public boolean LastCheckPointCheck() { + return true; + } + + public void a() { + + } + + /* + * Exception decompiling + */ + public void a(int var1_1) { + + } + + protected void a(Context context) { + } + + public void c() { + } + + public int d() { + return M; + } + + public void destroyLicenseServerActvity() { + this.h(); + G = false; + M = -1; + this.g(); + } + + protected int e() { + return N; + } + + protected void f() { + this.h(); + G = false; + M = -1; + this.g(); + } + + public void initLicenseServerActivity(Activity object, ILicenseServerActivityCallback iLicenseServerActivityCallback, Context context, byte[] object2, String string2, String string3, String string4) { + if (this.F) { + return; + } + this.F = true; + this.L = string4; + if (this.L == null) { + this.L = "001"; + } + this.B = string3; + this.C = context; + this.d = object2; + this.e = string2; + HandlerThread waitting_thread = new HandlerThread("waitting thread"); + waitting_thread.start(); + this.f = new Handler(waitting_thread.getLooper()); + if (H == null) { + H = object; + this.w = iLicenseServerActivityCallback; + } + if (v == null) { + this.O = context.getResources().getConfiguration().locale.toString(); + } + this.a(context); + if (G) return; + G = true; + this.a(20); + } +} + diff --git a/app/src/main/java/com/eamobile/views/CheckUpdatesView.java b/app/src/main/java/com/eamobile/views/CheckUpdatesView.java new file mode 100644 index 0000000..87c82b7 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/CheckUpdatesView.java @@ -0,0 +1,94 @@ +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; + +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 = new Handler() { + /* class com.eamobile.views.CheckUpdatesView.AnonymousClass3 */ + + 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); + } + } else if (message.what == 0) { + Logging.DEBUG_OUT("No updates found"); + CheckUpdatesView.this.dialog.dismiss(); + if (DownloadActivityInternal.getMainActivity() != null) { + DownloadActivityInternal.getMainActivity().setState(11); + } + } + } + }; + boolean updateFound = false; + + public CheckUpdatesView(Context context) { + super(context); + this.context = context; + } + + private void showContent(View view) { + } + + @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, 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() { + /* class com.eamobile.views.CheckUpdatesView.AnonymousClass1 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + new Thread() { + /* class com.eamobile.views.CheckUpdatesView.AnonymousClass2 */ + + 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(0); + } else { + CheckUpdatesView.this.handler.sendEmptyMessage(1); + } + } + }.start(); + showContent(this); + } + + @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 new file mode 100644 index 0000000..1016b53 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/CheckingHostIpView.java @@ -0,0 +1,20 @@ +package com.eamobile.views; + +import android.content.Context; + +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 clean() { + super.clean(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void init() { + super.init(); + } +} diff --git a/app/src/main/java/com/eamobile/views/ContactingServerView.java b/app/src/main/java/com/eamobile/views/ContactingServerView.java new file mode 100644 index 0000000..2a35fbe --- /dev/null +++ b/app/src/main/java/com/eamobile/views/ContactingServerView.java @@ -0,0 +1,74 @@ +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; + +public class ContactingServerView extends CustomView { + protected static final int MSG_DONE = 1; + Dialog dialog; + public Handler handler = new Handler() { + /* class com.eamobile.views.ContactingServerView.AnonymousClass3 */ + + public void handleMessage(Message message) { + ContactingServerView.this.dialog.dismiss(); + } + }; + + public ContactingServerView(Context context) { + super(context); + this.context = context; + } + + private void showContent(View view) { + } + + @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, 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() { + /* class com.eamobile.views.ContactingServerView.AnonymousClass1 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + new Thread() { + /* class com.eamobile.views.ContactingServerView.AnonymousClass2 */ + + public void run() { + DownloadActivityInternal.getMainActivity().checkServerContent(true); + ContactingServerView.this.handler.sendEmptyMessage(1); + } + }.start(); + showContent(this); + } + + @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 new file mode 100644 index 0000000..7fde258 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/CustomProgressBar.java @@ -0,0 +1,46 @@ +package com.eamobile.views; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Paint; +import android.graphics.RectF; +import android.view.View; +import com.google.android.gms.maps.model.BitmapDescriptorFactory; + +public class CustomProgressBar extends View { + private Paint paint = new Paint(); + private float progress = BitmapDescriptorFactory.HUE_RED; + + public CustomProgressBar(Context context) { + super(context); + } + + public void onDraw(Canvas canvas) { + this.paint.setColor(-1); + this.paint.setStrokeWidth(BitmapDescriptorFactory.HUE_RED); + this.paint.setAntiAlias(true); + this.paint.setStyle(Paint.Style.FILL); + this.paint.setARGB(180, 120, 120, 120); + int width = getWidth() - 10; + canvas.drawRect(new RectF(10.0f, 1.0f, (float) width, 33.0f), this.paint); + this.paint.setStyle(Paint.Style.FILL); + this.paint.setColor(-256); + canvas.drawRect(new RectF((float) 11, 2.0f, (float) (11 + ((int) Math.floor((double) (((float) ((width - 1) - 11)) * this.progress)))), 32.0f), this.paint); + } + + /* access modifiers changed from: protected */ + public void onMeasure(int i, int i2) { + super.onMeasure(i, i2); + setMeasuredDimension(View.MeasureSpec.getSize(i), 34); + } + + public void setProgress(float f) { + if (f < BitmapDescriptorFactory.HUE_RED) { + f = BitmapDescriptorFactory.HUE_RED; + } + if (f > 1.0f) { + f = 1.0f; + } + this.progress = f; + } +} diff --git a/app/src/main/java/com/eamobile/views/CustomProgressDialog.java b/app/src/main/java/com/eamobile/views/CustomProgressDialog.java new file mode 100644 index 0000000..abc320d --- /dev/null +++ b/app/src/main/java/com/eamobile/views/CustomProgressDialog.java @@ -0,0 +1,338 @@ +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; + +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 = null; + private int[] connectionType = new int[1]; + private CustomProgressBar customProgressBar; + private Dialog dialog; + private boolean exitConfirmation = false; + 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.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 e) { + 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); + } + } + + private void updateWifiInfo() { + if (((LinearLayout) this.dialog.findViewById(90)) != null && DownloadActivityInternal.getMainActivity() != null) { + 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(WIFI_LAYOUT_WIFI_VIEW_ID)).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(WIFI_LAYOUT_WIFI_VIEW_ID)).setImageBitmap(this.bmpWifi[0]); + } + this.wifiTextView.setText(Language.getString(16) + ": " + Language.getString(40)); + } + } + + @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 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(WIFI_LAYOUT_WIFI_VIEW_ID); + imageView.setPadding(10, 0, 10, 10); + imageView.setImageBitmap(null); + imageView.setClickable(false); + linearLayout2.addView(imageView); + } + this.wifiTextView = new TextView(this.context); + this.wifiTextView.setId(WIFI_LAYOUT_WIFI_TEXTVIEW_ID); + 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 boolean isDialogValid() { + return this.dialog != null; + } + + @Override // com.eamobile.views.IProgressDialog + public void setDownloadMax(int i) { + this.max = i; + } + + @Override // com.eamobile.views.IProgressDialog + public void setDownloadProgress(int i) { + this.progress = i; + } + + @Override // com.eamobile.views.IProgressDialog + public void setDownloadSpeed(float f) { + this.speed = f; + } + + @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() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass1 */ + + 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() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass2 */ + + 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() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass3 */ + + public void onClick(DialogInterface dialogInterface, int i) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.alertDialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass4 */ + + 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() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass5 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass6 */ + + public void onCancel(DialogInterface dialogInterface) { + String string = Language.getString(41); + String string2 = Language.getString(17); + String string3 = 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(string); + 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, string2, new DialogInterface.OnClickListener() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass6.AnonymousClass1 */ + + public void onClick(DialogInterface dialogInterface, int i) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + CustomProgressDialog.this.alertDialog.setButton(-2, string3, new DialogInterface.OnClickListener() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass6.AnonymousClass2 */ + + public void onClick(DialogInterface dialogInterface, int i) { + CustomProgressDialog.this.alertDialog.dismiss(); + CustomProgressDialog.this.alertDialog = null; + CustomProgressDialog.this.exitConfirmation = false; + CustomProgressDialog.this.showDialogContent(); + } + }); + CustomProgressDialog.this.alertDialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass6.AnonymousClass3 */ + + public void onCancel(DialogInterface dialogInterface) { + CustomProgressDialog.this.alertDialog.dismiss(); + CustomProgressDialog.this.alertDialog = null; + CustomProgressDialog.this.exitConfirmation = false; + CustomProgressDialog.this.showDialogContent(); + } + }); + CustomProgressDialog.this.alertDialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.CustomProgressDialog.AnonymousClass6.AnonymousClass4 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + CustomProgressDialog.this.alertDialog.show(); + CustomProgressDialog.this.exitConfirmation = true; + } + }); + } + if (this.alertDialog != null && this.exitConfirmation) { + this.alertDialog.show(); + this.dialog.hide(); + } + } + + @Override // com.eamobile.views.IProgressDialog + public void updateDialog() { + if (this.max > 0) { + float f = ((float) this.progress) / ((float) this.max); + this.customProgressBar.setProgress(f); + this.customProgressBar.invalidate(); + String replace = (((int) Math.floor((double) (100.0f * f))) + "% " + Language.getString(36)).replace("%1", "" + this.progress).replace("%2", "" + this.max).replace("%3", "" + String.format("%.0f", Float.valueOf(this.speed))); + updateWifiInfo(); + ((TextView) this.dialog.findViewById(1)).setText(replace); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/CustomView.java b/app/src/main/java/com/eamobile/views/CustomView.java new file mode 100644 index 0000000..3e77d97 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/CustomView.java @@ -0,0 +1,94 @@ +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; + +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; + + /* access modifiers changed from: package-private */ + public class BackGround extends Drawable { + BackGround() { + } + + public void draw(Canvas canvas) { + if (DownloadActivityInternal.getMainActivity() != null && DownloadActivityInternal.getMainActivity().getBackgroundBitmap() != null) { + canvas.drawBitmap(DownloadActivityInternal.getMainActivity().getBackgroundBitmap(), (float) ((canvas.getWidth() - DownloadActivityInternal.getMainActivity().getBackgroundBitmap().getWidth()) >> 1), (float) ((canvas.getHeight() - DownloadActivityInternal.getMainActivity().getBackgroundBitmap().getHeight()) >> 1), (Paint) null); + } + } + + public int getOpacity() { + return 0; + } + + public void setAlpha(int i) { + } + + public void setColorFilter(ColorFilter colorFilter) { + } + } + + public CustomView(Context context2) { + super(context2); + this.context = context2; + } + + public static Button addButton(Context context2, LinearLayout linearLayout, String str) { + Button button = new Button(context2); + 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 context2, LinearLayout linearLayout, String str) { + TextView textView = new TextView(context2); + 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; + } + + @Override // com.eamobile.views.IDownloadView + public void clean() { + } + + @Override // com.eamobile.views.IDownloadView + public void init() { + showBackground(); + ((Activity) this.context).getWindow().getDecorView().setSystemUiVisibility(5894); + } + + public void pause() { + } + + public void resume() { + } + + /* access modifiers changed from: protected */ + public void showBackground() { + setLayoutParams(new LinearLayout.LayoutParams(-1, -2)); + setOrientation(1); + setGravity(48); + setBackgroundDrawable(new BackGround()); + } +} diff --git a/app/src/main/java/com/eamobile/views/DefaultProgressDialog.java b/app/src/main/java/com/eamobile/views/DefaultProgressDialog.java new file mode 100644 index 0000000..6f2bc77 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/DefaultProgressDialog.java @@ -0,0 +1,104 @@ +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; + +public class DefaultProgressDialog extends CustomView implements IProgressDialog { + private static Method mSetProgressNumberFormat; + private ProgressDialog dialog = null; + private int max = 0; + private int progress = 0; + private float speed; + + public DefaultProgressDialog(Context context) { + super(context); + this.context = context; + mSetProgressNumberFormat = null; + } + + @Override // com.eamobile.views.IProgressDialog + public void dismissDialog() { + this.dialog.dismiss(); + } + + @Override // com.eamobile.views.IProgressDialog + public void initDialog() { + try { + mSetProgressNumberFormat = ProgressDialog.class.getMethod("setProgressNumberFormat", String.class); + } catch (NoSuchMethodException e) { + } + 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 boolean isDialogValid() { + return this.dialog != null; + } + + @Override // com.eamobile.views.IProgressDialog + public void setDownloadMax(int i) { + this.max = i; + } + + @Override // com.eamobile.views.IProgressDialog + public void setDownloadProgress(int i) { + this.progress = i; + } + + @Override // com.eamobile.views.IProgressDialog + public void setDownloadSpeed(float f) { + this.speed = f; + } + + @Override // com.eamobile.views.IProgressDialog + public void showDialogContent() { + if (this.dialog != null) { + this.dialog.show(); + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.DefaultProgressDialog.AnonymousClass1 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + /* class com.eamobile.views.DefaultProgressDialog.AnonymousClass2 */ + + 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 e) { + this.dialog.setProgress(DownloadActivityInternal.getMainActivity().getPercentDownloaded()); + } + } + } catch (Exception e2) { + Logging.DEBUG_OUT("Exception here:" + e2); + this.dialog.setProgress(DownloadActivityInternal.getMainActivity().getPercentDownloaded()); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/DeletingAssetsView.java b/app/src/main/java/com/eamobile/views/DeletingAssetsView.java new file mode 100644 index 0000000..1057423 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/DeletingAssetsView.java @@ -0,0 +1,82 @@ +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; + +public class DeletingAssetsView extends CustomView { + Dialog dialog; + public Handler handler = new Handler() { + /* class com.eamobile.views.DeletingAssetsView.AnonymousClass3 */ + + public void handleMessage(Message message) { + DeletingAssetsView.this.dialog.dismiss(); + if (DownloadActivityInternal.getMainActivity() != null) { + DownloadActivityInternal.getMainActivity().setState(1); + } + } + }; + boolean updateFound = false; + + public DeletingAssetsView(Context context) { + super(context); + this.context = context; + } + + private void showContent(View view) { + } + + @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, 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() { + /* class com.eamobile.views.DeletingAssetsView.AnonymousClass1 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + new Thread() { + /* class com.eamobile.views.DeletingAssetsView.AnonymousClass2 */ + + public void run() { + try { + Thread.sleep(300); + } catch (InterruptedException e) { + Logging.DEBUG_OUT_STACK(e); + } + DownloadActivityInternal.getMainActivity().deleteAssets(); + DeletingAssetsView.this.handler.sendEmptyMessage(0); + } + }.start(); + showContent(this); + } + + @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 new file mode 100644 index 0000000..5af7248 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/DownloadFailedView.java @@ -0,0 +1,115 @@ +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; + +public class DownloadFailedView extends CustomView { + Dialog dialog; + int errorCode = 0; + Button lskBtn; + LinearLayout mainLayout; + + public DownloadFailedView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.DownloadFailedView.AnonymousClass1 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.lskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.DownloadFailedView.AnonymousClass2 */ + + public void onClick(View view) { + DownloadFailedView.this.dialog.dismiss(); + ADCTelemetry.getInstance().sendTelemetry(2); + DownloadActivityInternal.getMainActivity().setState(2); + } + }); + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.DownloadFailedView.AnonymousClass3 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setContentView(this.mainLayout); + this.dialog.show(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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() { + showContent(this); + } + + 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 new file mode 100644 index 0000000..241e4b6 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/DownloadMsgView.java @@ -0,0 +1,118 @@ +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; + +public class DownloadMsgView extends CustomView { + Dialog dialog; + Button lskBtn; + LinearLayout mainLayout; + int spaceRequiredMB = 0; + + public DownloadMsgView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.DownloadMsgView.AnonymousClass1 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.lskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.DownloadMsgView.AnonymousClass2 */ + + public void onClick(View view) { + DownloadMsgView.this.dialog.dismiss(); + if (!DownloadActivityInternal.getMainActivity().chooseAvailableMemory()) { + DownloadActivityInternal.getMainActivity().setState(4); + } else { + DownloadActivityInternal.getMainActivity().startWifiDownload(false); + } + } + }); + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.DownloadMsgView.AnonymousClass3 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setContentView(this.mainLayout); + this.dialog.show(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/DownloadProgressView.java b/app/src/main/java/com/eamobile/views/DownloadProgressView.java new file mode 100644 index 0000000..2125e1a --- /dev/null +++ b/app/src/main/java/com/eamobile/views/DownloadProgressView.java @@ -0,0 +1,203 @@ +package com.eamobile.views; + +import android.content.Context; +import android.os.Handler; +import android.os.Message; +import android.os.SystemClock; +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.gms.maps.model.BitmapDescriptorFactory; +import java.util.Timer; +import java.util.TimerTask; + +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 = false; + private static Timer t; + private LockManager lockManager; + private IProgressDialog progressDialog; + public Handler progressHandler = new Handler() { + /* class com.eamobile.views.DownloadProgressView.AnonymousClass2 */ + + public void handleMessage(Message message) { + try { + if (DownloadActivityInternal.getMainActivity() != null && DownloadActivityInternal.isInitialized()) { + int totalDownloadSizeMB = DownloadActivityInternal.getTotalDownloadSizeMB(); + int sizeDownloaded = (int) ((DownloadActivityInternal.getSizeDownloaded() / 1024) / 1024); + 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 = ((float) SystemClock.uptimeMillis()) / 1000.0f; + } else { + DownloadProgressView.this.speedCalculator.reportAmount(((float) DownloadActivityInternal.getRealDownloaded()) / 1024.0f, (((float) 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 = new RetryTimerTask(); + DownloadProgressView.t.schedule(DownloadProgressView.this.timerTask, 0, 5000); + } else 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); + } + } + }; + private SpeedCalculator speedCalculator = null; + private float timeSeconds = BitmapDescriptorFactory.HUE_RED; + private RetryTimerTask timerTask; + + /* access modifiers changed from: package-private */ + public class RetryTimerTask extends TimerTask { + static final int QTY_RETRY = 10; + int numTries = 10; + + RetryTimerTask() { + } + + 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; + } + } + + public DownloadProgressView(Context context) { + super(context); + Logging.DEBUG_OUT("DownloadProgressView constructor"); + this.context = context; + this.lockManager = new LockManager(context); + } + + 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) { + this.lockManager.acquireWakeLock(); + } + } + + @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) { + this.lockManager.releaseWakeLock(); + } + } + + public boolean encounteredFatalDownloadError() { + int state = DownloadActivityInternal.getMainActivity().getState(); + return state == 12 || state == 13; + } + + @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 DefaultProgressDialog(this.context); + } else { + this.progressDialog = new CustomProgressDialog(this.context); + } + this.progressDialog.initDialog(); + new Thread(new Runnable() { + /* class com.eamobile.views.DownloadProgressView.AnonymousClass1 */ + + public void run() { + try { + DownloadProgressView.downloaded = false; + new Thread() { + /* class com.eamobile.views.DownloadProgressView.AnonymousClass1.AnonymousClass1 */ + + 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) { + Logging.DEBUG_OUT("Failed to download assets. Internal state: " + DownloadActivityInternal.getMainActivity().getStateName()); + if (!DownloadProgressView.this.encounteredFatalDownloadError()) { + DownloadProgressView.this.progressHandler.sendEmptyMessage(1); + } + } + } + }.start(); + Logging.DEBUG_OUT("DownloadProgressView before background loop downloaded=" + DownloadProgressView.downloaded); + while (!DownloadProgressView.downloaded && DownloadActivityInternal.isInitialized()) { + Thread.sleep(100); + 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 + public void pause() { + Logging.DEBUG_OUT("DownloadProgressView pause"); + if (DownloadActivityInternal.getForceWakeDuringDownload() && this.lockManager != null) { + this.lockManager.releaseWakeLock(); + } + } + + @Override // com.eamobile.views.CustomView + public void resume() { + Logging.DEBUG_OUT("DownloadProgressView resume"); + if (this.progressDialog != null && this.progressDialog.isDialogValid()) { + showContent(this); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/IDownloadView.java b/app/src/main/java/com/eamobile/views/IDownloadView.java new file mode 100644 index 0000000..7f788d3 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/IDownloadView.java @@ -0,0 +1,7 @@ +package com.eamobile.views; + +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 new file mode 100644 index 0000000..45c9455 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/IProgressDialog.java @@ -0,0 +1,19 @@ +package com.eamobile.views; + +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 new file mode 100644 index 0000000..9533472 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/InvalidAssetVersionView.java @@ -0,0 +1,113 @@ +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; + +public class InvalidAssetVersionView extends CustomView { + Dialog dialog; + Button exitBtn; + LinearLayout mainLayout; + + public InvalidAssetVersionView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.InvalidAssetVersionView.AnonymousClass1 */ + + public void onClick(View view) { + InvalidAssetVersionView.this.dialog.dismiss(); + try { + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } catch (Throwable th) { + } + } + }); + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.InvalidAssetVersionView.AnonymousClass2 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + /* class com.eamobile.views.InvalidAssetVersionView.AnonymousClass3 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.dialog.setContentView(this.mainLayout); + this.dialog.show(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/NetworkUnavailableView.java b/app/src/main/java/com/eamobile/views/NetworkUnavailableView.java new file mode 100644 index 0000000..6aa34ad --- /dev/null +++ b/app/src/main/java/com/eamobile/views/NetworkUnavailableView.java @@ -0,0 +1,125 @@ +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; + +public class NetworkUnavailableView extends CustomView { + Dialog dialog; + Button lskBtn; + LinearLayout mainLayout; + Button rskBtn; + + public NetworkUnavailableView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.NetworkUnavailableView.AnonymousClass1 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.lskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.NetworkUnavailableView.AnonymousClass2 */ + + public void onClick(View view) { + 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() { + /* class com.eamobile.views.NetworkUnavailableView.AnonymousClass3 */ + + public void onClick(View view) { + NetworkUnavailableView.this.dialog.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.NetworkUnavailableView.AnonymousClass4 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setContentView(this.mainLayout); + this.dialog.show(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/ServerErrorView.java b/app/src/main/java/com/eamobile/views/ServerErrorView.java new file mode 100644 index 0000000..e7b9b28 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/ServerErrorView.java @@ -0,0 +1,115 @@ +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; + +public class ServerErrorView extends CustomView { + Dialog dialog; + int errorCode = 0; + Button lskBtn; + LinearLayout mainLayout; + + public ServerErrorView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.ServerErrorView.AnonymousClass1 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.lskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.ServerErrorView.AnonymousClass2 */ + + public void onClick(View view) { + ServerErrorView.this.dialog.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.ServerErrorView.AnonymousClass3 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setContentView(this.mainLayout); + this.dialog.show(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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); + } + } + + 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 new file mode 100644 index 0000000..bbf6788 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/Show3GView.java @@ -0,0 +1,126 @@ +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; + +public class Show3GView extends CustomView { + Dialog dialog; + Button lskBtn; + LinearLayout mainLayout; + Button rskBtn; + + public Show3GView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.Show3GView.AnonymousClass1 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().setState(6); + } + }); + this.lskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.Show3GView.AnonymousClass2 */ + + public void onClick(View view) { + 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() { + /* class com.eamobile.views.Show3GView.AnonymousClass3 */ + + public void onClick(View view) { + Show3GView.this.dialog.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.Show3GView.AnonymousClass4 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setContentView(this.mainLayout); + this.dialog.show(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/ShowBGView.java b/app/src/main/java/com/eamobile/views/ShowBGView.java new file mode 100644 index 0000000..4cc126f --- /dev/null +++ b/app/src/main/java/com/eamobile/views/ShowBGView.java @@ -0,0 +1,47 @@ +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; + +public class ShowBGView extends CustomView { + public ShowBGView(Context context) { + super(context); + this.context = context; + } + + private void showContent(View view) { + new CountDownTimer(1000, 100) { + /* class com.eamobile.views.ShowBGView.AnonymousClass1 */ + + public void onFinish() { + if (DownloadActivityInternal.getMainActivity() != null) { + DownloadActivityInternal.getMainActivity().setState(3); + } + } + + public void onTick(long j) { + } + }.start(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + } + + @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 + public void resume() { + Logging.DEBUG_OUT("ShowBGView.resume"); + } +} diff --git a/app/src/main/java/com/eamobile/views/ShowWifiView.java b/app/src/main/java/com/eamobile/views/ShowWifiView.java new file mode 100644 index 0000000..c2af748 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/ShowWifiView.java @@ -0,0 +1,144 @@ +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; + +public class ShowWifiView extends CustomView { + Dialog dialog; + Button lskBtn; + LinearLayout mainLayout; + Button midBtn; + Button rskBtn; + + public ShowWifiView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.ShowWifiView.AnonymousClass1 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + /* class com.eamobile.views.ShowWifiView.AnonymousClass2 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().setState(1); + } + }); + if (!DownloadActivityInternal.getMainActivity().isAmazonDevice()) { + this.lskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.ShowWifiView.AnonymousClass3 */ + + public void onClick(View view) { + ShowWifiView.this.dialog.dismiss(); + DownloadActivityInternal.getMainActivity().startWifiManager(); + } + }); + if (!DownloadActivityInternal.getMainActivity().is3GDisabled()) { + this.midBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.ShowWifiView.AnonymousClass4 */ + + public void onClick(View view) { + ShowWifiView.this.dialog.dismiss(); + DownloadActivityInternal.getMainActivity().setState(10); + } + }); + } + } + this.rskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.ShowWifiView.AnonymousClass5 */ + + public void onClick(View view) { + ShowWifiView.this.dialog.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/SpaceUnavailableView.java b/app/src/main/java/com/eamobile/views/SpaceUnavailableView.java new file mode 100644 index 0000000..169aa6d --- /dev/null +++ b/app/src/main/java/com/eamobile/views/SpaceUnavailableView.java @@ -0,0 +1,130 @@ +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; + +public class SpaceUnavailableView extends CustomView { + Dialog dialog; + Button lskBtn; + LinearLayout mainLayout; + Button rskBtn; + + public SpaceUnavailableView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.SpaceUnavailableView.AnonymousClass1 */ + + public void onClick(View view) { + SpaceUnavailableView.this.dialog.dismiss(); + try { + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } catch (Throwable th) { + } + } + }); + if (DownloadActivityInternal.getMainActivity().canOpenStorageSettings()) { + this.lskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.SpaceUnavailableView.AnonymousClass2 */ + + public void onClick(View view) { + SpaceUnavailableView.this.dialog.dismiss(); + try { + DownloadActivityInternal.getMainActivity().startDataManagement(); + } catch (Throwable th) { + } + } + }); + } + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.SpaceUnavailableView.AnonymousClass3 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setOnCancelListener(new DialogInterface.OnCancelListener() { + /* class com.eamobile.views.SpaceUnavailableView.AnonymousClass4 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.dialog.setContentView(this.mainLayout); + this.dialog.show(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/UnSupportedDeviceView.java b/app/src/main/java/com/eamobile/views/UnSupportedDeviceView.java new file mode 100644 index 0000000..93a8adb --- /dev/null +++ b/app/src/main/java/com/eamobile/views/UnSupportedDeviceView.java @@ -0,0 +1,110 @@ +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; + +public class UnSupportedDeviceView extends CustomView { + Dialog dialog; + Button lskBtn; + LinearLayout mainLayout; + + public UnSupportedDeviceView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.UnSupportedDeviceView.AnonymousClass1 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.lskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.UnSupportedDeviceView.AnonymousClass2 */ + + public void onClick(View view) { + UnSupportedDeviceView.this.dialog.dismiss(); + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + }); + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.UnSupportedDeviceView.AnonymousClass3 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84; + } + }); + this.dialog.setContentView(this.mainLayout); + this.dialog.show(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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); + } + } +} diff --git a/app/src/main/java/com/eamobile/views/UpdatesFoundView.java b/app/src/main/java/com/eamobile/views/UpdatesFoundView.java new file mode 100644 index 0000000..2d869e6 --- /dev/null +++ b/app/src/main/java/com/eamobile/views/UpdatesFoundView.java @@ -0,0 +1,135 @@ +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; + +public class UpdatesFoundView extends CustomView { + Dialog dialog; + boolean localAssetsOK = true; + Button lskBtn; + LinearLayout mainLayout; + Button rskBtn; + + public UpdatesFoundView(Context context) { + super(context); + this.context = context; + } + + 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() { + /* class com.eamobile.views.UpdatesFoundView.AnonymousClass1 */ + + public void onCancel(DialogInterface dialogInterface) { + dialogInterface.dismiss(); + DownloadActivityInternal.getMainActivity().setState(3); + } + }); + this.lskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.UpdatesFoundView.AnonymousClass2 */ + + public void onClick(View view) { + UpdatesFoundView.this.dialog.dismiss(); + DownloadActivityInternal.getMainActivity().updateDownload(); + } + }); + this.rskBtn.setOnClickListener(new View.OnClickListener() { + /* class com.eamobile.views.UpdatesFoundView.AnonymousClass3 */ + + public void onClick(View view) { + UpdatesFoundView.this.dialog.dismiss(); + if (UpdatesFoundView.this.localAssetsOK) { + DownloadActivityInternal.getMainActivity().setState(11); + } else { + DownloadActivityInternal.getMainActivity().startGameActivity(0); + } + } + }); + this.dialog.setOnKeyListener(new DialogInterface.OnKeyListener() { + /* class com.eamobile.views.UpdatesFoundView.AnonymousClass4 */ + + public boolean onKey(DialogInterface dialogInterface, int i, KeyEvent keyEvent) { + return i == 82 || i == 84 || i == 4; + } + }); + this.dialog.setContentView(this.mainLayout); + this.dialog.show(); + } + + @Override // com.eamobile.views.CustomView, com.eamobile.views.IDownloadView + public void clean() { + super.clean(); + try { + this.dialog.dismiss(); + } catch (Exception e) { + } + } + + @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); + } + } +} diff --git a/app/src/main/java/com/facebook/android/BaseRequestListener.java b/app/src/main/java/com/facebook/android/BaseRequestListener.java new file mode 100644 index 0000000..5ae3333 --- /dev/null +++ b/app/src/main/java/com/facebook/android/BaseRequestListener.java @@ -0,0 +1,36 @@ +package com.facebook.android; + +import android.util.Log; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.net.MalformedURLException; + +/** + * Skeleton base class for RequestListeners, providing default error + * handling. Applications should handle these error conditions. + * + */ +public abstract class BaseRequestListener implements AsyncFacebookRunner.RequestListener { + + public void onFacebookError(FacebookError e) { + Log.e("Facebook", e.getMessage()); + e.printStackTrace(); + } + + public void onFileNotFoundException(FileNotFoundException e) { + Log.e("Facebook", e.getMessage()); + e.printStackTrace(); + } + + public void onIOException(IOException e) { + Log.e("Facebook", e.getMessage()); + e.printStackTrace(); + } + + public void onMalformedURLException(MalformedURLException e) { + Log.e("Facebook", e.getMessage()); + e.printStackTrace(); + } + +} diff --git a/app/src/main/java/com/facebook/android/SessionEvents.java b/app/src/main/java/com/facebook/android/SessionEvents.java new file mode 100644 index 0000000..1351f88 --- /dev/null +++ b/app/src/main/java/com/facebook/android/SessionEvents.java @@ -0,0 +1,146 @@ +/* + * Copyright 2010 Facebook, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.facebook.android; + +import java.util.LinkedList; + +public class SessionEvents { + + private static LinkedList mAuthListeners = + new LinkedList(); + private static LinkedList mLogoutListeners = + new LinkedList(); + + /** + * Associate the given listener with this Facebook object. The listener's + * callback interface will be invoked when authentication events occur. + * + * @param listener + * The callback object for notifying the application when auth + * events happen. + */ + public static void addAuthListener(AuthListener listener) { + mAuthListeners.add(listener); + } + + /** + * Remove the given listener from the list of those that will be notified + * when authentication events occur. + * + * @param listener + * The callback object for notifying the application when auth + * events happen. + */ + public static void removeAuthListener(AuthListener listener) { + mAuthListeners.remove(listener); + } + + /** + * Associate the given listener with this Facebook object. The listener's + * callback interface will be invoked when logout occurs. + * + * @param listener + * The callback object for notifying the application when log out + * starts and finishes. + */ + public static void addLogoutListener(LogoutListener listener) { + mLogoutListeners.add(listener); + } + + /** + * Remove the given listener from the list of those that will be notified + * when logout occurs. + * + * @param listener + * The callback object for notifying the application when log out + * starts and finishes. + */ + public static void removeLogoutListener(LogoutListener listener) { + mLogoutListeners.remove(listener); + } + + public static void onLoginSuccess() { + for (AuthListener listener : mAuthListeners) { + listener.onAuthSucceed(); + } + } + + public static void onLoginError(String error) { + for (AuthListener listener : mAuthListeners) { + listener.onAuthFail(error); + } + } + + public static void onLogoutBegin() { + for (LogoutListener l : mLogoutListeners) { + l.onLogoutBegin(); + } + } + + public static void onLogoutFinish() { + for (LogoutListener l : mLogoutListeners) { + l.onLogoutFinish(); + } + } + + /** + * Callback interface for authorization events. + * + */ + public static interface AuthListener { + + /** + * Called when a auth flow completes successfully and a valid OAuth + * Token was received. + * + * Executed by the thread that initiated the authentication. + * + * API requests can now be made. + */ + public void onAuthSucceed(); + + /** + * Called when a login completes unsuccessfully with an error. + * + * Executed by the thread that initiated the authentication. + */ + public void onAuthFail(String error); + } + + /** + * Callback interface for logout events. + * + */ + public static interface LogoutListener { + /** + * Called when logout begins, before session is invalidated. + * Last chance to make an API call. + * + * Executed by the thread that initiated the logout. + */ + public void onLogoutBegin(); + + /** + * Called when the session information has been cleared. + * UI should be updated to reflect logged-out state. + * + * Executed by the thread that initiated the logout. + */ + public void onLogoutFinish(); + } + +} diff --git a/app/src/main/java/com/google/android/c2dm/C2DMBaseReceiver.java b/app/src/main/java/com/google/android/c2dm/C2DMBaseReceiver.java new file mode 100644 index 0000000..5d848b0 --- /dev/null +++ b/app/src/main/java/com/google/android/c2dm/C2DMBaseReceiver.java @@ -0,0 +1,106 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.AlarmManager + * android.app.IntentService + * android.app.PendingIntent + * android.content.Context + * android.content.Intent + * android.os.PowerManager + * android.os.PowerManager$WakeLock + * android.util.Log + */ +package com.google.android.c2dm; + +import android.annotation.SuppressLint; +import android.app.AlarmManager; +import android.app.IntentService; +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.os.PowerManager; +import android.util.Log; +import com.google.android.c2dm.C2DMessaging; +import java.io.IOException; + +public abstract class C2DMBaseReceiver +extends IntentService { + private static final String C2DM_INTENT = "com.google.android.c2dm.intent.RECEIVE"; + private static final String C2DM_RETRY = "com.google.android.c2dm.intent.RETRY"; + public static final String ERR_ACCOUNT_MISSING = "ACCOUNT_MISSING"; + public static final String ERR_AUTHENTICATION_FAILED = "AUTHENTICATION_FAILED"; + public static final String ERR_INVALID_PARAMETERS = "INVALID_PARAMETERS"; + public static final String ERR_INVALID_SENDER = "INVALID_SENDER"; + public static final String ERR_PHONE_REGISTRATION_ERROR = "PHONE_REGISTRATION_ERROR"; + public static final String ERR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE"; + public static final String ERR_TOO_MANY_REGISTRATIONS = "TOO_MANY_REGISTRATIONS"; + public static final String EXTRA_ERROR = "error"; + public static final String EXTRA_REGISTRATION_ID = "registration_id"; + public static final String EXTRA_UNREGISTERED = "unregistered"; + public static final String REGISTRATION_CALLBACK_INTENT = "com.google.android.c2dm.intent.REGISTRATION"; + private static final String TAG = "C2DM"; + private static final String WAKELOCK_KEY = "C2DM_LIB"; + private static PowerManager.WakeLock mWakeLock; + private final String senderId; + + public C2DMBaseReceiver(String string) { + super(string); + this.senderId = string; + } + + private void handleRegistration(Context context, Intent object) { + String string = object.getStringExtra(EXTRA_REGISTRATION_ID); + String string2 = object.getStringExtra(EXTRA_ERROR); + String stringExtra = object.getStringExtra(EXTRA_UNREGISTERED); + if (Log.isLoggable((String)TAG, (int)3)) { + Log.d((String)TAG, (String)("dmControl: registrationId = " + string + ", error = " + string2 + ", removed = " + stringExtra)); + } + C2DMessaging.clearRegistrationId(context); + this.onUnregistered(context); + } + + @SuppressLint("InvalidWakeLockTag") + static void runIntentInService(Context context, Intent intent) { + if (mWakeLock == null) { + mWakeLock = ((PowerManager)context.getSystemService(Context.POWER_SERVICE)).newWakeLock(1, WAKELOCK_KEY); + } + mWakeLock.acquire(10*60*1000L /*10 minutes*/); + intent.setClassName(context, context.getPackageName() + ".C2DMReceiver"); + context.startService(intent); + } + + public abstract void onError(Context var1, String var2); + + /* + * Enabled unnecessary exception pruning + */ + public final void onHandleIntent(Intent intent) { + try { + Context context = this.getApplicationContext(); + if (intent.getAction().equals(REGISTRATION_CALLBACK_INTENT)) { + this.handleRegistration(context, intent); + return; + } + if (intent.getAction().equals(C2DM_INTENT)) { + this.onMessage(context, intent); + return; + } + if (!intent.getAction().equals(C2DM_RETRY)) return; + C2DMessaging.register(context, this.senderId); + return; + } + finally { + mWakeLock.release(); + } + } + + protected abstract void onMessage(Context var1, Intent var2); + + public void onRegistered(Context context, String string) throws IOException { + } + + public void onUnregistered(Context context) { + } +} + diff --git a/app/src/main/java/com/google/android/c2dm/C2DMBroadcastReceiver.java b/app/src/main/java/com/google/android/c2dm/C2DMBroadcastReceiver.java new file mode 100644 index 0000000..0b44332 --- /dev/null +++ b/app/src/main/java/com/google/android/c2dm/C2DMBroadcastReceiver.java @@ -0,0 +1,23 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + */ +package com.google.android.c2dm; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import com.google.android.c2dm.C2DMBaseReceiver; + +public class C2DMBroadcastReceiver +extends BroadcastReceiver { + public final void onReceive(Context context, Intent intent) { + C2DMBaseReceiver.runIntentInService(context, intent); + this.setResult(-1, null, null); + } +} + diff --git a/app/src/main/java/com/google/android/c2dm/C2DMessaging.java b/app/src/main/java/com/google/android/c2dm/C2DMessaging.java new file mode 100644 index 0000000..9cc6a7b --- /dev/null +++ b/app/src/main/java/com/google/android/c2dm/C2DMessaging.java @@ -0,0 +1,75 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.PendingIntent + * android.content.Context + * android.content.Intent + * android.os.Parcelable + */ +package com.google.android.c2dm; + +import android.app.PendingIntent; +import android.content.Context; +import android.content.Intent; +import android.content.SharedPreferences; +import android.os.Parcelable; + +public class C2DMessaging { + public static final String BACKOFF = "backoff"; + private static final long DEFAULT_BACKOFF = 30000L; + public static final String EXTRA_APPLICATION_PENDING_INTENT = "app"; + public static final String EXTRA_SENDER = "sender"; + public static final String GSF_PACKAGE = "com.google.android.gsf"; + public static final String LAST_REGISTRATION_CHANGE = "last_registration_change"; + static final String PREFERENCE = "com.google.android.c2dm"; + public static final String REQUEST_REGISTRATION_INTENT = "com.google.android.c2dm.intent.REGISTER"; + public static final String REQUEST_UNREGISTRATION_INTENT = "com.google.android.c2dm.intent.UNREGISTER"; + + static void clearRegistrationId(Context context) { + SharedPreferences.Editor edit = context.getSharedPreferences(PREFERENCE, 0).edit(); + edit.putString("dm_registration", ""); + edit.putLong(LAST_REGISTRATION_CHANGE, System.currentTimeMillis()); + edit.apply(); + } + + static long getBackoff(Context context) { + return context.getSharedPreferences(PREFERENCE, 0).getLong(BACKOFF, 30000L); + } + + public static long getLastRegistrationChange(Context context) { + return context.getSharedPreferences(PREFERENCE, 0).getLong(LAST_REGISTRATION_CHANGE, 0L); + } + + public static String getRegistrationId(Context context) { + return context.getSharedPreferences(PREFERENCE, 0).getString("dm_registration", ""); + } + + public static void register(Context context, String string) { + Intent intent = new Intent(REQUEST_REGISTRATION_INTENT); + intent.setPackage(GSF_PACKAGE); + intent.putExtra(EXTRA_APPLICATION_PENDING_INTENT, (Parcelable)PendingIntent.getBroadcast((Context)context, (int)0, (Intent)new Intent(), (int)0)); + intent.putExtra(EXTRA_SENDER, string); + context.startService(intent); + } + + static void setBackoff(Context context, long l2) { + SharedPreferences.Editor edit = context.getSharedPreferences(PREFERENCE, 0).edit(); + edit.putLong(BACKOFF, l2); + edit.apply(); + } + + static void setRegistrationId(Context context, String string) { + SharedPreferences.Editor edit = context.getSharedPreferences(PREFERENCE, 0).edit(); + edit.putString("dm_registration", string); + edit.apply(); + } + + public static void unregister(Context context) { + Intent intent = new Intent(REQUEST_UNREGISTRATION_INTENT); + intent.setPackage(GSF_PACKAGE); + intent.putExtra(EXTRA_APPLICATION_PENDING_INTENT, (Parcelable)PendingIntent.getBroadcast((Context)context, (int)0, (Intent)new Intent(), (int)0)); + context.startService(intent); + } +} + diff --git a/app/src/main/java/com/google/android/gcm/GCMBaseIntentService.java b/app/src/main/java/com/google/android/gcm/GCMBaseIntentService.java new file mode 100644 index 0000000..6467d01 --- /dev/null +++ b/app/src/main/java/com/google/android/gcm/GCMBaseIntentService.java @@ -0,0 +1,145 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.AlarmManager + * android.app.IntentService + * android.app.PendingIntent + * android.content.Context + * android.content.Intent + * android.os.PowerManager + * android.os.PowerManager$WakeLock + * android.os.SystemClock + * android.util.Log + */ +package com.google.android.gcm; + +import android.app.IntentService; +import android.content.Context; +import android.content.Intent; +import android.os.PowerManager; +import android.util.Log; + +import java.util.Random; +import java.util.concurrent.TimeUnit; + +public abstract class GCMBaseIntentService +extends IntentService { + private static final String EXTRA_TOKEN = "token"; + private static final Object LOCK = GCMBaseIntentService.class; + private static final int MAX_BACKOFF_MS; + public static final String TAG = "GCMBaseIntentService"; + private static final String TOKEN; + private static final String WAKELOCK_KEY = "GCM_LIB"; + private static int sCounter; + private static final Random sRandom; + private static PowerManager.WakeLock sWakeLock; + private final String[] mSenderIds; + + static { + sCounter = 0; + sRandom = new Random(); + MAX_BACKOFF_MS = (int)TimeUnit.SECONDS.toMillis(3600L); + TOKEN = Long.toBinaryString(sRandom.nextLong()); + } + + protected GCMBaseIntentService() { + this(GCMBaseIntentService.getName("DynamicSenderIds"), (String[])null); + } + + private GCMBaseIntentService(String string, String[] stringArray) { + super(string); + this.mSenderIds = stringArray; + } + + protected GCMBaseIntentService(String ... stringArray) { + this(GCMBaseIntentService.getName(stringArray), stringArray); + } + + private static String getName(String charSequence) { + int n2; + StringBuilder append = new StringBuilder().append("GCMIntentService-").append(charSequence).append("-"); + sCounter = n2 = sCounter + 1; + charSequence = append.append(n2).toString(); + Log.v(TAG, "Intent service name: " + charSequence); + return charSequence; + } + + private static String getName(String[] stringArray) { + return GCMBaseIntentService.getName(GCMRegistrar.getFlatSenderIds(stringArray)); + } + + private void handleRegistration(Context context, Intent object) {} + + /* + * Enabled unnecessary exception pruning + */ + static void runIntentInService(Context context, Intent intent, String string) { + + } + + protected String[] getSenderIds(Context context) { + if (this.mSenderIds != null) return this.mSenderIds; + throw new IllegalStateException("sender id not set on constructor"); + } + + protected void onDeletedMessages(Context context, int n2) { + } + + protected abstract void onError(Context var1, String var2); + + /* + * Enabled unnecessary exception pruning + * Converted monitor instructions to comments + */ + public final void onHandleIntent(Intent object) { + Context context = this.getApplicationContext(); + String string = object.getAction(); + if (string.equals("com.google.android.c2dm.intent.REGISTRATION")) { + GCMRegistrar.setRetryBroadcastReceiver(context); + this.handleRegistration(context, (Intent)object); + return; + } + if (string.equals("com.google.android.c2dm.intent.RECEIVE")) { + string = object.getStringExtra("message_type"); + if (string == null) { + this.onMessage(context, (Intent)object); + return; + } + if (!string.equals("deleted_messages")) { + Log.e((String)TAG, (String)("Received unknown special message: " + string)); + return; + } + if (object.getStringExtra("total_deleted") == null) return; + try { + int n2 = 0; + Log.v((String)TAG, (String)("Received deleted messages notification: " + n2)); + this.onDeletedMessages(context, n2); + return; + } + catch (NumberFormatException numberFormatException) { + Log.e((String)TAG, (String)("GCM returned invalid number of deleted messages: ")); + return; + } + } + if (!string.equals("com.google.android.gcm.intent.RETRY")) return; + + if (GCMRegistrar.isRegistered(context)) { + GCMRegistrar.internalUnregister(context); + return; + } + GCMRegistrar.internalRegister(context, this.getSenderIds(context)); + return; + } + + protected abstract void onMessage(Context var1, Intent var2); + + protected boolean onRecoverableError(Context context, String string) { + return true; + } + + protected abstract void onRegistered(Context var1, String var2); + + protected abstract void onUnregistered(Context var1, String var2); +} + diff --git a/app/src/main/java/com/google/android/gcm/GCMBroadcastReceiver.java b/app/src/main/java/com/google/android/gcm/GCMBroadcastReceiver.java new file mode 100644 index 0000000..366d7e8 --- /dev/null +++ b/app/src/main/java/com/google/android/gcm/GCMBroadcastReceiver.java @@ -0,0 +1,48 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + * android.util.Log + */ +package com.google.android.gcm; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.util.Log; +import com.google.android.gcm.GCMBaseIntentService; +import com.google.android.gcm.GCMRegistrar; + +public class GCMBroadcastReceiver +extends BroadcastReceiver { + private static final String TAG = "GCMBroadcastReceiver"; + private static boolean mReceiverSet = false; + + static final String getDefaultIntentServiceClassName(Context context) { + return context.getPackageName() + ".GCMIntentService"; + } + + protected String getGCMIntentServiceClassName(Context context) { + return GCMBroadcastReceiver.getDefaultIntentServiceClassName(context); + } + + public final void onReceive(Context context, Intent intent) { + String string; + Log.v((String)TAG, (String)("onReceive: " + intent.getAction())); + if (!mReceiverSet) { + mReceiverSet = true; + string = ((Object)((Object)this)).getClass().getName(); + if (!string.equals(GCMBroadcastReceiver.class.getName())) { + GCMRegistrar.setRetryReceiverClassName(string); + } + } + string = this.getGCMIntentServiceClassName(context); + Log.v((String)TAG, (String)("GCM IntentService class: " + string)); + GCMBaseIntentService.runIntentInService(context, intent, string); + this.setResult(-1, null, null); + } +} + diff --git a/app/src/main/java/com/google/android/gcm/GCMConstants.java b/app/src/main/java/com/google/android/gcm/GCMConstants.java new file mode 100644 index 0000000..b8c5159 --- /dev/null +++ b/app/src/main/java/com/google/android/gcm/GCMConstants.java @@ -0,0 +1,33 @@ +/* + * Decompiled with CFR 0.152. + */ +package com.google.android.gcm; + +public final class GCMConstants { + public static final String DEFAULT_INTENT_SERVICE_CLASS_NAME = ".GCMIntentService"; + public static final String ERROR_ACCOUNT_MISSING = "ACCOUNT_MISSING"; + public static final String ERROR_AUTHENTICATION_FAILED = "AUTHENTICATION_FAILED"; + public static final String ERROR_INVALID_PARAMETERS = "INVALID_PARAMETERS"; + public static final String ERROR_INVALID_SENDER = "INVALID_SENDER"; + public static final String ERROR_PHONE_REGISTRATION_ERROR = "PHONE_REGISTRATION_ERROR"; + public static final String ERROR_SERVICE_NOT_AVAILABLE = "SERVICE_NOT_AVAILABLE"; + public static final String EXTRA_APPLICATION_PENDING_INTENT = "app"; + public static final String EXTRA_ERROR = "error"; + public static final String EXTRA_REGISTRATION_ID = "registration_id"; + public static final String EXTRA_SENDER = "sender"; + public static final String EXTRA_SPECIAL_MESSAGE = "message_type"; + public static final String EXTRA_TOTAL_DELETED = "total_deleted"; + public static final String EXTRA_UNREGISTERED = "unregistered"; + public static final String INTENT_FROM_GCM_LIBRARY_RETRY = "com.google.android.gcm.intent.RETRY"; + public static final String INTENT_FROM_GCM_MESSAGE = "com.google.android.c2dm.intent.RECEIVE"; + public static final String INTENT_FROM_GCM_REGISTRATION_CALLBACK = "com.google.android.c2dm.intent.REGISTRATION"; + public static final String INTENT_TO_GCM_REGISTRATION = "com.google.android.c2dm.intent.REGISTER"; + public static final String INTENT_TO_GCM_UNREGISTRATION = "com.google.android.c2dm.intent.UNREGISTER"; + public static final String PERMISSION_GCM_INTENTS = "com.google.android.c2dm.permission.SEND"; + public static final String VALUE_DELETED_MESSAGES = "deleted_messages"; + + private GCMConstants() { + throw new UnsupportedOperationException(); + } +} + diff --git a/app/src/main/java/com/google/android/gcm/GCMRegistrar.java b/app/src/main/java/com/google/android/gcm/GCMRegistrar.java new file mode 100644 index 0000000..c382f59 --- /dev/null +++ b/app/src/main/java/com/google/android/gcm/GCMRegistrar.java @@ -0,0 +1,307 @@ +/* + * Decompiled with CFR 0.152. + * + * Could not load the following classes: + * android.app.PendingIntent + * android.content.BroadcastReceiver + * android.content.Context + * android.content.Intent + * android.content.IntentFilter + * android.content.SharedPreferences + * android.content.SharedPreferences$Editor + * android.content.pm.ActivityInfo + * android.content.pm.PackageManager + * android.content.pm.PackageManager$NameNotFoundException + * android.content.pm.ResolveInfo + * android.os.Build$VERSION + * android.os.Parcelable + * android.util.Log + */ +package com.google.android.gcm; + +import android.annotation.SuppressLint; +import android.app.PendingIntent; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.content.SharedPreferences; +import android.content.pm.ActivityInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; +import android.content.pm.ResolveInfo; +import android.os.Build; +import android.os.Parcelable; +import android.util.Log; + +import java.sql.Timestamp; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +public final class GCMRegistrar { + private static final String BACKOFF_MS = "backoff_ms"; + private static final int DEFAULT_BACKOFF_MS = 3000; + public static final long DEFAULT_ON_SERVER_LIFESPAN_MS = 604800000L; + private static final String GSF_PACKAGE = "com.google.android.gsf"; + private static final String PREFERENCES = "com.google.android.gcm"; + private static final String PROPERTY_APP_VERSION = "appVersion"; + private static final String PROPERTY_ON_SERVER = "onServer"; + private static final String PROPERTY_ON_SERVER_EXPIRATION_TIME = "onServerExpirationTime"; + private static final String PROPERTY_ON_SERVER_LIFESPAN = "onServerLifeSpan"; + private static final String PROPERTY_REG_ID = "regId"; + private static final String TAG = "GCMRegistrar"; + private static GCMBroadcastReceiver sRetryReceiver; + private static String sRetryReceiverClassName; + + private GCMRegistrar() { + throw new UnsupportedOperationException(); + } + + public static void checkDevice(Context context) { + int n2 = Build.VERSION.SDK_INT; + if (n2 < 8) { + throw new UnsupportedOperationException("Device must be at least API Level 8 (instead of " + n2 + ")"); + } + PackageManager packageManager = context.getPackageManager(); + try { + packageManager.getPackageInfo(GSF_PACKAGE, 0); + return; + } + catch (PackageManager.NameNotFoundException nameNotFoundException) { + throw new UnsupportedOperationException("Device does not have package com.google.android.gsf"); + } + } + + public static void checkManifest(Context context) { + PackageManager packageManager2 = context.getPackageManager(); + String packageName = context.getPackageName();//object + ActivityInfo[] activityInfoArray; + String permissions = packageName + ".permission.C2D_MESSAGE"; + + try { + packageManager2.getPermissionInfo(packageName, PackageManager.GET_META_DATA); + } + catch (PackageManager.NameNotFoundException nameNotFoundException) { + throw new IllegalStateException("Application does not define permission " + permissions); + } + PackageInfo packageInfo = new PackageInfo(); + try { + packageInfo = packageManager2.getPackageInfo(packageName, PackageManager.GET_RECEIVERS); + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + activityInfoArray = packageInfo.receivers; + if (activityInfoArray == null) throw new IllegalStateException("No receiver for package " + packageName); + if (activityInfoArray.length == 0) { + throw new IllegalStateException("No receiver for package " + packageName); + } + if (Log.isLoggable(TAG, Log.VERBOSE)) { + Log.v(TAG, "number of receivers for " + packageName + ": " + activityInfoArray.length); + } + HashSet hashSet = new HashSet<>(); + for (ActivityInfo activityInfo : activityInfoArray) { + if (!"com.google.android.c2dm.permission.SEND".equals(activityInfo.permission)) continue; + hashSet.add(activityInfo.name); + } + if (hashSet.isEmpty()) { + throw new IllegalStateException("No receiver allowed to receive com.google.android.c2dm.permission.SEND"); + } + GCMRegistrar.checkReceiver(context, hashSet, "com.google.android.c2dm.intent.REGISTRATION"); + GCMRegistrar.checkReceiver(context, hashSet, "com.google.android.c2dm.intent.RECEIVE"); + } + + private static void checkReceiver(Context object, Set set, String string) { + PackageManager packageManager = object.getPackageManager(); + String packageName = object.getPackageName(); + Intent intent = new Intent(string); + intent.setPackage(packageName); + @SuppressLint("WrongConstant") List resolveInfos = packageManager.queryBroadcastReceivers(intent, PackageManager.GET_INTENT_FILTERS); + if (resolveInfos.isEmpty()) { + throw new IllegalStateException("No receivers for action " + string); + } + if (Log.isLoggable(TAG, (int)2)) { + Log.v(TAG, "Found " + resolveInfos.size() + " receivers for action " + string); + } + Iterator iterator = resolveInfos.iterator(); + do { + if (!iterator.hasNext()) return; + } while (set.contains(string = iterator.next().activityInfo.name)); + throw new IllegalStateException("Receiver " + string + " is not set with permission " + "com.google.android.c2dm.permission.SEND"); + } + + static String clearRegistrationId(Context context) { + return GCMRegistrar.setRegistrationId(context, ""); + } + + private static int getAppVersion(Context context) { + try { + return context.getPackageManager().getPackageInfo((String)context.getPackageName(), (int)0).versionCode; + } + catch (PackageManager.NameNotFoundException nameNotFoundException) { + throw new RuntimeException("Coult not get package name: " + (Object)((Object)nameNotFoundException)); + } + } + + static int getBackoff(Context context) { + return GCMRegistrar.getGCMPreferences(context).getInt(BACKOFF_MS, 3000); + } + + static String getFlatSenderIds(String ... stringArray) { + if (stringArray == null) throw new IllegalArgumentException("No senderIds"); + if (stringArray.length == 0) { + throw new IllegalArgumentException("No senderIds"); + } + StringBuilder stringBuilder = new StringBuilder(stringArray[0]); + int n2 = 1; + while (n2 < stringArray.length) { + stringBuilder.append(',').append(stringArray[n2]); + ++n2; + } + return stringBuilder.toString(); + } + + private static SharedPreferences getGCMPreferences(Context context) { + return context.getSharedPreferences(PREFERENCES, 0); + } + + public static long getRegisterOnServerLifespan(Context context) { + return GCMRegistrar.getGCMPreferences(context).getLong(PROPERTY_ON_SERVER_LIFESPAN, 604800000L); + } + + public static String getRegistrationId(Context context) { + SharedPreferences gcmPreferences = GCMRegistrar.getGCMPreferences(context); + String string = gcmPreferences.getString(PROPERTY_REG_ID, ""); + int n2 = gcmPreferences.getInt(PROPERTY_APP_VERSION, Integer.MIN_VALUE); + int n3 = GCMRegistrar.getAppVersion(context); + if (n2 == Integer.MIN_VALUE) return string; + if (n2 == n3) return string; + Log.v(TAG, "App version changed from " + n2 + " to " + n3 + "; resetting registration id"); + GCMRegistrar.clearRegistrationId(context); + return ""; + } + + static void internalRegister(Context context, String ... object) { + String flatSenderIds = GCMRegistrar.getFlatSenderIds(object); + Log.v(TAG, "Registering app " + context.getPackageName() + " of senders " + flatSenderIds); + Intent intent = new Intent("com.google.android.c2dm.intent.REGISTER"); + intent.setPackage(GSF_PACKAGE); + intent.putExtra("app", PendingIntent.getBroadcast(context, 0, new Intent(), 0)); + intent.putExtra("sender", flatSenderIds); + context.startService(intent); + } + + static void internalUnregister(Context context) { + Log.v((String)TAG, (String)("Unregistering app " + context.getPackageName())); + Intent intent = new Intent("com.google.android.c2dm.intent.UNREGISTER"); + intent.setPackage(GSF_PACKAGE); + intent.putExtra("app", (Parcelable)PendingIntent.getBroadcast((Context)context, (int)0, (Intent)new Intent(), (int)0)); + context.startService(intent); + } + + public static boolean isRegistered(Context context) { + if (GCMRegistrar.getRegistrationId(context).length() <= 0) return false; + return true; + } + + public static boolean isRegisteredOnServer(Context context) { + SharedPreferences gcmPreferences = GCMRegistrar.getGCMPreferences(context); + boolean bl2 = gcmPreferences.getBoolean(PROPERTY_ON_SERVER, false); + Log.v(TAG, "Is registered on server: " + bl2); + if (!bl2) return false; + long l2 = gcmPreferences.getLong(PROPERTY_ON_SERVER_EXPIRATION_TIME, -1L); + if (System.currentTimeMillis() <= l2) return true; + Log.v(TAG, "flag expired on: " + new Timestamp(l2)); + return false; + } + + public static void onDestroy(Context context) { + synchronized (GCMRegistrar.class) { + if (sRetryReceiver == null) return; + Log.v(TAG, "Unregistering receiver"); + context.unregisterReceiver((BroadcastReceiver)sRetryReceiver); + sRetryReceiver = null; + } + } + + public static void register(Context context, String ... stringArray) { + GCMRegistrar.resetBackoff(context); + GCMRegistrar.internalRegister(context, stringArray); + } + + static void resetBackoff(Context context) { + Log.d((String)TAG, (String)("resetting backoff for " + context.getPackageName())); + GCMRegistrar.setBackoff(context, 3000); + } + + static void setBackoff(Context context, int n2) { + SharedPreferences.Editor edit = GCMRegistrar.getGCMPreferences(context).edit(); + edit.putInt(BACKOFF_MS, n2); + edit.apply(); + } + + public static void setRegisterOnServerLifespan(Context context, long l2) { + SharedPreferences.Editor edit = GCMRegistrar.getGCMPreferences(context).edit(); + edit.putLong(PROPERTY_ON_SERVER_LIFESPAN, l2); + edit.apply(); + } + + public static void setRegisteredOnServer(Context context, boolean bl2) { + SharedPreferences.Editor editor = GCMRegistrar.getGCMPreferences(context).edit(); + editor.putBoolean(PROPERTY_ON_SERVER, bl2); + long l2 = GCMRegistrar.getRegisterOnServerLifespan(context); + l2 = System.currentTimeMillis() + l2; + Log.v((String)TAG, (String)("Setting registeredOnServer status as " + bl2 + " until " + new Timestamp(l2))); + editor.putLong(PROPERTY_ON_SERVER_EXPIRATION_TIME, l2); + editor.apply(); + } + + static String setRegistrationId(Context context, String string) { + SharedPreferences sharedPreferences = GCMRegistrar.getGCMPreferences(context); + String string2 = sharedPreferences.getString(PROPERTY_REG_ID, ""); + int n2 = GCMRegistrar.getAppVersion(context); + Log.v(TAG, "Saving regId on app version " + n2); + SharedPreferences.Editor edit = sharedPreferences.edit(); + edit.putString(PROPERTY_REG_ID, string); + edit.putInt(PROPERTY_APP_VERSION, n2); + edit.commit(); + return string2; + } + + static void setRetryBroadcastReceiver(Context context) { + synchronized (GCMRegistrar.class) { + if (sRetryReceiver != null) return; + if (sRetryReceiverClassName == null) { + Log.e(TAG, "internal error: retry receiver class not set yet"); + sRetryReceiver = new GCMBroadcastReceiver(); + } else { + try { + sRetryReceiver = (GCMBroadcastReceiver) Class.forName(sRetryReceiverClassName).newInstance(); + } + catch (Exception exception) { + Log.e(TAG, "Could not create instance of " + sRetryReceiverClassName + ". Using " + GCMBroadcastReceiver.class.getName() + " directly."); + sRetryReceiver = new GCMBroadcastReceiver(); + } + } + String string = context.getPackageName(); + IntentFilter intentFilter = new IntentFilter("com.google.android.gcm.intent.RETRY"); + intentFilter.addCategory(string); + string = string + ".permission.C2D_MESSAGE"; + Log.v(TAG, "Registering receiver"); + context.registerReceiver((BroadcastReceiver)sRetryReceiver, intentFilter, string, null); + return; + } + } + + static void setRetryReceiverClassName(String string) { + Log.v(TAG, "Setting the name of retry receiver class to " + string); + sRetryReceiverClassName = string; + } + + public static void unregister(Context context) { + GCMRegistrar.resetBackoff(context); + GCMRegistrar.internalUnregister(context); + } +} + diff --git a/app/src/main/java/com/savegame/SavesRestoring.java b/app/src/main/java/com/savegame/SavesRestoring.java new file mode 100644 index 0000000..535c265 --- /dev/null +++ b/app/src/main/java/com/savegame/SavesRestoring.java @@ -0,0 +1,189 @@ +package com.savegame; + +import android.app.Activity; +import android.content.Context; +import android.content.res.AssetManager; +import android.os.Environment; +import android.util.Log; +import android.widget.Toast; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +public final class SavesRestoring extends Activity { + private static int PdsjdolaSd = 0; + private static int daDakdsIID = 0; + + public static void DoSmth(Context context) { + try { + SmartDataRestoreForYou(context, context.getAssets(), context.getPackageName()); + } catch (Exception e) { + Log.e(context.getPackageName() + ":savemessages", "Message: " + e.getMessage()); + e.printStackTrace(); + } + } + + public static boolean ExistsInArray(String[] strArr, String str) { + for (int i = 0; i < strArr.length; i++) { + if (strArr[i].contains(str)) { + return true; + } + } + return false; + } + + private static String IcvaeLIJAFL() { + daDakdsIID++; + return Character.toString('b'); + } + + private static String JaEBhFLsj() { + daDakdsIID++; + return Character.toString('s'); + } + + private static String MNTRGWO() { + daDakdsIID++; + return Character.toString('o'); + } + + private static String SWoFpOGUOR() { + daDakdsIID++; + return Character.toString('m'); + } + + private static void SmartDataRestoreForYou(Context context, AssetManager assetManager, String str) throws Exception { + if (!context.getSharedPreferences("savegame", 0).getBoolean("notfirst", false)) { + context.getSharedPreferences("savegame", 0).edit().putBoolean("notfirst", true).commit(); + String str2 = str + ":savemessages"; + Log.i(str2, "SmDR: Starting..."); + context.getSharedPreferences("savegame", 0).edit().putBoolean("notfirst", true).apply(); + String[] list = assetManager.list(""); + for (int i = 0; i < list.length; i++) { + Log.i(str2, "ListFiles[" + i + "] = " + list[i]); + } + if (ExistsInArray(list, "data.save")) { + Toast.makeText(context, "Restoring save...", Toast.LENGTH_SHORT); + try { + Log.i(str2, "data.save : Restoring..."); + unZipIt(assetManager.open("data.save"), "/data/data/" + context.getPackageName()); + Log.i(str2, "data.save: Successfully restored"); + } catch (Exception e) { + Log.e(str2, "data.save: Message: " + e.getMessage()); + Toast.makeText(context, "Can't restore save", Toast.LENGTH_SHORT); + } + } + if (ExistsInArray(list, "extobb.save")) { + Toast.makeText(context, "Restoring cache...", Toast.LENGTH_SHORT); + try { + Log.i(str2, "extobb.save: Restoring..."); + unZipIt(assetManager.open("extobb.save"), context.getObbDir().getAbsolutePath() + "/"); + Log.i(str2, "extobb.save: Successfully restored"); + } catch (Exception e2) { + Log.e(str2, "extobb.save: Message: " + e2.getMessage()); + Toast.makeText(context, "Can't restore external cache", Toast.LENGTH_SHORT); + } + } + if (ExistsInArray(list, "extdata.save")) { + Toast.makeText(context, "Restoring external data...", Toast.LENGTH_SHORT); + try { + Log.i(str2, "extdata.save: Restoring..."); + String str3 = Environment.getExternalStorageDirectory() + "/Android/data/" + context.getPackageName() + "/"; + new File(str3).mkdirs(); + unZipIt(assetManager.open("extdata.save"), str3); + Log.i(str2, "extdata.save: Successfully restored"); + } catch (Exception e3) { + Log.e(str2, "extdata.save: Message: " + e3.getMessage()); + Toast.makeText(context, "Can't restore external data", Toast.LENGTH_SHORT); + } + } + Log.i(str2, "Restoring completed"); + Toast.makeText(context, "Restoring completed", Toast.LENGTH_SHORT); + } + } + + private static String VNoYQilb() { + daDakdsIID++; + return Character.toString(' '); + } + + private static String cTDeCJR() { + daDakdsIID++; + return Character.toString('s'); + } + + private static String gwlVJD() { + daDakdsIID++; + return Character.toString('y'); + } + + private static String iiAqKeUvKgqUd() { + daDakdsIID++; + return Character.toString('M'); + } + + private static String ldpSDcTKVdWbP() { + daDakdsIID++; + return Character.toString('o'); + } + + private static String plKpPgCYGa() { + daDakdsIID++; + return Character.toString(' '); + } + + private static String tIdtgslWSDS() { + daDakdsIID++; + return Character.toString('d'); + } + + private static void unZipIt(InputStream inputStream, String str) throws Exception { + ZipInputStream zipInputStream = new ZipInputStream(inputStream); + if (daDakdsIID != PdsjdolaSd) { + throw new Exception("System error..."); + } + byte[] bArr = new byte[1024]; + new File(str).mkdirs(); + ZipEntry nextEntry = zipInputStream.getNextEntry(); + if (daDakdsIID != PdsjdolaSd) { + throw new Exception("System error! please don't cheat..."); + } + while (nextEntry != null) { + if (nextEntry.isDirectory()) { + nextEntry = zipInputStream.getNextEntry(); + } else { + int lastIndexOf = nextEntry.getName().lastIndexOf(47); + if (lastIndexOf < 0) { + lastIndexOf = 0; + } + new File(str + "/" + nextEntry.getName().substring(0, lastIndexOf)).mkdirs(); + FileOutputStream fileOutputStream = new FileOutputStream(new File(str + "/" + nextEntry.getName()), false); + if (daDakdsIID != PdsjdolaSd) { + fileOutputStream.close(); + throw new Exception("You are clever..."); + } + while (true) { + int read = zipInputStream.read(bArr); + if (read <= 0) { + break; + } + fileOutputStream.write(bArr, 0, read); + } + fileOutputStream.close(); + nextEntry = zipInputStream.getNextEntry(); + } + } + if (daDakdsIID != PdsjdolaSd) { + throw new Exception("And again..."); + } + zipInputStream.closeEntry(); + zipInputStream.close(); + } +/* + private static String wrEBJneYLx() { + daDakdsIID++; + return Character.toString('y'); + }*/ +} diff --git a/app/src/main/java/com/verizon/vcast/apps/APIUtils.java b/app/src/main/java/com/verizon/vcast/apps/APIUtils.java new file mode 100644 index 0000000..5856db0 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/APIUtils.java @@ -0,0 +1,137 @@ +package com.verizon.vcast.apps; + +public class APIUtils { + InAppPurchasor iap; + + APIUtils(InAppPurchasor inAppPurchasor) { + this.iap = inAppPurchasor; + } + + public DiscoveryParameters convertDiscoveryParameters(InAppPurchasor.DiscoveryParameters discoveryParameters) { + DiscoveryParameters discoveryParameters2 = new DiscoveryParameters(); + discoveryParameters2.ascendingOrder = discoveryParameters.isAscendingOrder(); + discoveryParameters2.maxResults = discoveryParameters.getMaxResults(); + discoveryParameters2.sortBy = discoveryParameters.getSortBy(); + discoveryParameters2.startIndex = discoveryParameters.getStartIndex(); + return discoveryParameters2; + } + + public InAppPurchasor.InAppContentOffers convertGetInAppContentOfferResult(InAppContentOffers inAppContentOffers) { + InAppPurchasor inAppPurchasor = this.iap; + inAppPurchasor.getClass(); + InAppPurchasor.InAppContentOffers inAppContentOffers2 = new InAppPurchasor.InAppContentOffers(); + inAppContentOffers2.setResult(inAppContentOffers.result); + inAppContentOffers2.setTotalSize(inAppContentOffers.totalSize); + InAppPurchasor.Offer[] offerArr = new InAppPurchasor.Offer[inAppContentOffers.offers.length]; + for (int i = 0; i < inAppContentOffers.offers.length; i++) { + offerArr[i] = convertOffer(inAppContentOffers.offers[i]); + } + inAppContentOffers2.setOffers(offerArr); + return inAppContentOffers2; + } + + public InAppPurchasor.InAppContents convertGetInAppContentsResult(InAppContents inAppContents) { + InAppPurchasor inAppPurchasor = this.iap; + inAppPurchasor.getClass(); + InAppPurchasor.InAppContents inAppContents2 = new InAppPurchasor.InAppContents(); + inAppContents2.setResult(inAppContents.result); + inAppContents2.setTotalSize(inAppContents.totalSize); + inAppContents2.setItems(convertItemArray(inAppContents.items)); + return inAppContents2; + } + + public InAppPurchasor.PurchasedInAppContents convertGetPurchasedInAppContentsResult(PurchasedInAppContents purchasedInAppContents) { + InAppPurchasor inAppPurchasor = this.iap; + inAppPurchasor.getClass(); + InAppPurchasor.PurchasedInAppContents purchasedInAppContents2 = new InAppPurchasor.PurchasedInAppContents(); + purchasedInAppContents2.setResult(purchasedInAppContents.result); + purchasedInAppContents2.setTotalSize(purchasedInAppContents.totalSize); + purchasedInAppContents2.setPurchases(convertPurchaseArray(purchasedInAppContents.purchases)); + return purchasedInAppContents2; + } + + public InAppPurchasor.Item convertItem(Item item) { + InAppPurchasor inAppPurchasor = this.iap; + inAppPurchasor.getClass(); + InAppPurchasor.Item item2 = new InAppPurchasor.Item(); + item2.setAgeRating(item.ageRating); + item2.setItemDescription(item.itemDescription); + item2.setItemID(item.itemID); + item2.setItemName(item.itemName); + return item2; + } + + public InAppPurchasor.Item[] convertItemArray(Item[] itemArr) { + InAppPurchasor.Item[] itemArr2 = new InAppPurchasor.Item[itemArr.length]; + for (int i = 0; i < itemArr.length; i++) { + itemArr2[i] = convertItem(itemArr[i]); + } + return itemArr2; + } + + public InAppPurchasor.Offer convertOffer(Offer offer) { + InAppPurchasor inAppPurchasor = this.iap; + inAppPurchasor.getClass(); + InAppPurchasor.Offer offer2 = new InAppPurchasor.Offer(); + offer2.setOfferID(offer.offerID); + offer2.setMaxPrice(offer.maxPrice); + offer2.setMinPrice(offer.minPrice); + offer2.setPriceLine(offer.priceLine); + offer2.setPriceType(offer.priceType); + offer2.setPricingTerms(offer.pricingTerms); + return offer2; + } + + public InAppPurchasor.Purchase convertPurchase(Purchase purchase) { + if (purchase == null) { + return null; + } + InAppPurchasor inAppPurchasor = this.iap; + inAppPurchasor.getClass(); + InAppPurchasor.Purchase purchase2 = new InAppPurchasor.Purchase(); + purchase2.setInAppName(purchase.inAppName); + purchase2.setItem(convertItem(purchase.item)); + purchase2.setPrice(purchase.price); + purchase2.setPriceLine(purchase.priceLine); + purchase2.setPriceType(purchase.priceType); + purchase2.setPricingTerms(purchase.pricingTerms); + purchase2.setPurchaseDate(purchase.purchaseDate); + purchase2.setSku(purchase.sku); + purchase2.setPurchaseID(purchase.purchaseID); + return purchase2; + } + + public InAppPurchasor.Purchase[] convertPurchaseArray(Purchase[] purchaseArr) { + if (purchaseArr == null) { + return null; + } + InAppPurchasor.Purchase[] purchaseArr2 = new InAppPurchasor.Purchase[purchaseArr.length]; + for (int i = 0; i < purchaseArr.length; i++) { + purchaseArr2[i] = convertPurchase(purchaseArr[i]); + } + return purchaseArr2; + } + + public InAppPurchasor.PurchaseInAppContentResult convertPurchaseInAppContentResult(PurchaseInAppContentResult purchaseInAppContentResult) { + InAppPurchasor inAppPurchasor = this.iap; + inAppPurchasor.getClass(); + InAppPurchasor.PurchaseInAppContentResult purchaseInAppContentResult2 = new InAppPurchasor.PurchaseInAppContentResult(); + purchaseInAppContentResult2.setLicense(purchaseInAppContentResult.license); + purchaseInAppContentResult2.setPurchaseID(purchaseInAppContentResult.purchaseID); + purchaseInAppContentResult2.setResult(purchaseInAppContentResult.result); + return purchaseInAppContentResult2; + } + + public PurchaseParameters convertPurchaseParameters(InAppPurchasor.PurchaseParameters purchaseParameters) { + PurchaseParameters purchaseParameters2 = new PurchaseParameters(); + purchaseParameters2.contentSize = Integer.valueOf(purchaseParameters.getContentSize() == null ? 0 : purchaseParameters.getContentSize().intValue()); + purchaseParameters2.inAppName = purchaseParameters.getInAppName(); + purchaseParameters2.offerID = purchaseParameters.getOfferID(); + purchaseParameters2.price = purchaseParameters.getPrice(); + purchaseParameters2.sku = purchaseParameters.getSku(); + purchaseParameters2.priceType = purchaseParameters.getPriceType(); + purchaseParameters2.priceLine = purchaseParameters.getPriceLine(); + purchaseParameters2.pricingTerms = purchaseParameters.getPricingTerms(); + return purchaseParameters2; + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/DatabaseHelper.java b/app/src/main/java/com/verizon/vcast/apps/DatabaseHelper.java new file mode 100644 index 0000000..5860eb3 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/DatabaseHelper.java @@ -0,0 +1,101 @@ +package com.verizon.vcast.apps; + +import android.content.Context; +import android.database.Cursor; +import android.database.sqlite.SQLiteDatabase; +import android.database.sqlite.SQLiteOpenHelper; +import android.database.sqlite.SQLiteStatement; +import android.util.Log; +import java.util.ArrayList; +import java.util.List; + +public class DatabaseHelper { + private static final String DATABASE_NAME = "timeStore.db"; + private static final int DATABASE_VERSION = 1; + private static final String INSERT = "insert into table1(name) values (?)"; + private static final String INSERT_RUNTIME = "insert into tableLastRunTime(name) values (?)"; + private static final String TABLE_NAME = "table1"; + private static final String TABLE_NAME_LAST_RUN_TIME = "tableLastRunTime"; + private Context context; + private SQLiteDatabase db = new OpenHelper(this.context).getWritableDatabase(); + private SQLiteStatement insertStmt = this.db.compileStatement(INSERT); + private SQLiteStatement insertStmt_runtime = this.db.compileStatement(INSERT_RUNTIME); + + private static class OpenHelper extends SQLiteOpenHelper { + OpenHelper(Context context) { + super(context, DatabaseHelper.DATABASE_NAME, (SQLiteDatabase.CursorFactory) null, 1); + } + + public void onCreate(SQLiteDatabase sQLiteDatabase) { + sQLiteDatabase.execSQL("CREATE TABLE tableLastRunTime (id INTEGER PRIMARY KEY, name TEXT)"); + sQLiteDatabase.execSQL("CREATE TABLE table1 (id INTEGER PRIMARY KEY, name TEXT)"); + } + + public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) { + Log.w("Example", "Upgrading database, this will drop tables and recreate."); + sQLiteDatabase.execSQL("DROP TABLE IF EXISTS table1"); + sQLiteDatabase.execSQL("DROP TABLE IF EXISTS tableLastRunTime"); + onCreate(sQLiteDatabase); + } + } + + public DatabaseHelper(Context context2) { + this.context = context2; + } + + public void cleanup() { + if (this.db != null) { + try { + this.db.close(); + } catch (Exception e) { + } + this.db = null; + } + } + + public void deleteAll() { + this.db.delete(TABLE_NAME, null, null); + } + + public void deleteRuntime() { + this.db.delete(TABLE_NAME_LAST_RUN_TIME, null, null); + } + + public long insert(String str) { + this.insertStmt.bindString(1, str); + return this.insertStmt.executeInsert(); + } + + public long insertRunTime(String str) { + this.insertStmt_runtime.bindString(1, str); + return this.insertStmt_runtime.executeInsert(); + } + + public List selectAll() { + ArrayList arrayList = new ArrayList(); + Cursor query = this.db.query(TABLE_NAME, new String[]{"name"}, null, null, null, null, "name desc"); + if (query.moveToFirst()) { + do { + arrayList.add(query.getString(0)); + } while (query.moveToNext()); + } + if (query != null && !query.isClosed()) { + query.close(); + } + return arrayList; + } + + public List selectRunTime() { + ArrayList arrayList = new ArrayList(); + Cursor query = this.db.query(TABLE_NAME_LAST_RUN_TIME, new String[]{"name"}, null, null, null, null, "name desc"); + if (query.moveToFirst()) { + do { + arrayList.add(query.getString(0)); + } while (query.moveToNext()); + } + if (query != null && !query.isClosed()) { + query.close(); + } + return arrayList; + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/DiscoveryParameters.java b/app/src/main/java/com/verizon/vcast/apps/DiscoveryParameters.java new file mode 100644 index 0000000..e5d77c9 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/DiscoveryParameters.java @@ -0,0 +1,54 @@ +package com.verizon.vcast.apps; + +import android.os.Parcel; +import android.os.Parcelable; + +public class DiscoveryParameters implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + /* class com.verizon.vcast.apps.DiscoveryParameters.AnonymousClass1 */ + + @Override // android.os.Parcelable.Creator + public DiscoveryParameters createFromParcel(Parcel parcel) { + return new DiscoveryParameters(parcel, null); + } + + @Override // android.os.Parcelable.Creator + public DiscoveryParameters[] newArray(int i) { + return new DiscoveryParameters[i]; + } + }; + public boolean ascendingOrder; + public int maxResults; + public String sortBy; + public int startIndex; + + public DiscoveryParameters() { + } + + private DiscoveryParameters(Parcel parcel) { + readFromParcel(parcel); + } + + /* synthetic */ DiscoveryParameters(Parcel parcel, DiscoveryParameters discoveryParameters) { + this(parcel); + } + + private void readFromParcel(Parcel parcel) { + parcel.readBooleanArray(new boolean[1]); + this.ascendingOrder = false; + this.maxResults = parcel.readInt(); + this.sortBy = parcel.readString(); + this.startIndex = parcel.readInt(); + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeBooleanArray(new boolean[]{this.ascendingOrder}); + parcel.writeInt(this.maxResults); + parcel.writeString(this.sortBy); + parcel.writeInt(this.startIndex); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/IVCastAppsLicenseService.java b/app/src/main/java/com/verizon/vcast/apps/IVCastAppsLicenseService.java new file mode 100644 index 0000000..00f9e78 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/IVCastAppsLicenseService.java @@ -0,0 +1,136 @@ +package com.verizon.vcast.apps; + +import android.os.Binder; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; + +public interface IVCastAppsLicenseService extends IInterface { + + public static abstract class Stub extends Binder implements IVCastAppsLicenseService { + private static final String DESCRIPTOR = "com.verizon.vcast.apps.IVCastAppsLicenseService"; + static final int TRANSACTION_getLicense = 1; + static final int TRANSACTION_getRemoteLicense = 3; + static final int TRANSACTION_getTime = 2; + + private static class Proxy implements IVCastAppsLicenseService { + private IBinder mRemote; + + Proxy(IBinder iBinder) { + this.mRemote = iBinder; + } + + public IBinder asBinder() { + return this.mRemote; + } + + public String getInterfaceDescriptor() { + return Stub.DESCRIPTOR; + } + + @Override // com.verizon.vcast.apps.IVCastAppsLicenseService + public byte[] getLicense(String str) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeString(str); + this.mRemote.transact(1, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.createByteArray(); + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + @Override // com.verizon.vcast.apps.IVCastAppsLicenseService + public byte[] getRemoteLicense(String str, boolean z) throws RemoteException { + int i = 0; + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeString(str); + if (z) { + i = 1; + } + obtain.writeInt(i); + this.mRemote.transact(3, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.createByteArray(); + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + @Override // com.verizon.vcast.apps.IVCastAppsLicenseService + public long getTime() throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + this.mRemote.transact(2, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readLong(); + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + } + + public Stub() { + attachInterface(this, DESCRIPTOR); + } + + public static IVCastAppsLicenseService asInterface(IBinder iBinder) { + if (iBinder == null) { + return null; + } + IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR); + return (queryLocalInterface == null || !(queryLocalInterface instanceof IVCastAppsLicenseService)) ? new Proxy(iBinder) : (IVCastAppsLicenseService) queryLocalInterface; + } + + public IBinder asBinder() { + return this; + } + + @Override // android.os.Binder + public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException { + switch (i) { + case 1: + parcel.enforceInterface(DESCRIPTOR); + byte[] license = getLicense(parcel.readString()); + parcel2.writeNoException(); + parcel2.writeByteArray(license); + return true; + case 2: + parcel.enforceInterface(DESCRIPTOR); + long time = getTime(); + parcel2.writeNoException(); + parcel2.writeLong(time); + return true; + case 3: + parcel.enforceInterface(DESCRIPTOR); + byte[] remoteLicense = getRemoteLicense(parcel.readString(), parcel.readInt() != 0); + parcel2.writeNoException(); + parcel2.writeByteArray(remoteLicense); + return true; + case 1598968902: + parcel2.writeString(DESCRIPTOR); + return true; + default: + return super.onTransact(i, parcel, parcel2, i2); + } + } + } + + byte[] getLicense(String str) throws RemoteException; + + byte[] getRemoteLicense(String str, boolean z) throws RemoteException; + + long getTime() throws RemoteException; +} diff --git a/app/src/main/java/com/verizon/vcast/apps/IVCastInAppService.java b/app/src/main/java/com/verizon/vcast/apps/IVCastInAppService.java new file mode 100644 index 0000000..6fcc80e --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/IVCastInAppService.java @@ -0,0 +1,225 @@ +package com.verizon.vcast.apps; + +import android.os.Binder; +import android.os.IBinder; +import android.os.IInterface; +import android.os.Parcel; +import android.os.RemoteException; + +public interface IVCastInAppService extends IInterface { + + public static abstract class Stub extends Binder implements IVCastInAppService { + private static final String DESCRIPTOR = "com.verizon.vcast.apps.IVCastInAppService"; + static final int TRANSACTION_cancelInAppContentSubscription = 1; + static final int TRANSACTION_getInAppContentOffer = 2; + static final int TRANSACTION_getInAppContents = 3; + static final int TRANSACTION_getPurchasedInAppContents = 4; + static final int TRANSACTION_purchaseInAppContent = 5; + + /* access modifiers changed from: private */ + public static class Proxy implements IVCastInAppService { + private IBinder mRemote; + + Proxy(IBinder iBinder) { + this.mRemote = iBinder; + } + + public IBinder asBinder() { + return this.mRemote; + } + + @Override // com.verizon.vcast.apps.IVCastInAppService + public int cancelInAppContentSubscription(String str, String str2, String str3) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeString(str); + obtain.writeString(str2); + obtain.writeString(str3); + this.mRemote.transact(1, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt(); + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + @Override // com.verizon.vcast.apps.IVCastInAppService + public InAppContentOffers getInAppContentOffer(String str, String str2) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeString(str); + obtain.writeString(str2); + this.mRemote.transact(2, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt() != 0 ? InAppContentOffers.CREATOR.createFromParcel(obtain2) : null; + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + @Override // com.verizon.vcast.apps.IVCastInAppService + public InAppContents getInAppContents(String str, DiscoveryParameters discoveryParameters) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeString(str); + if (discoveryParameters != null) { + obtain.writeInt(1); + discoveryParameters.writeToParcel(obtain, 0); + } else { + obtain.writeInt(0); + } + this.mRemote.transact(3, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt() != 0 ? InAppContents.CREATOR.createFromParcel(obtain2) : null; + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + public String getInterfaceDescriptor() { + return Stub.DESCRIPTOR; + } + + @Override // com.verizon.vcast.apps.IVCastInAppService + public PurchasedInAppContents getPurchasedInAppContents(String str, DiscoveryParameters discoveryParameters) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeString(str); + if (discoveryParameters != null) { + obtain.writeInt(1); + discoveryParameters.writeToParcel(obtain, 0); + } else { + obtain.writeInt(0); + } + this.mRemote.transact(4, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt() != 0 ? PurchasedInAppContents.CREATOR.createFromParcel(obtain2) : null; + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + + @Override // com.verizon.vcast.apps.IVCastInAppService + public PurchaseInAppContentResult purchaseInAppContent(String str, String str2, PurchaseParameters purchaseParameters) throws RemoteException { + Parcel obtain = Parcel.obtain(); + Parcel obtain2 = Parcel.obtain(); + try { + obtain.writeInterfaceToken(Stub.DESCRIPTOR); + obtain.writeString(str); + obtain.writeString(str2); + if (purchaseParameters != null) { + obtain.writeInt(1); + purchaseParameters.writeToParcel(obtain, 0); + } else { + obtain.writeInt(0); + } + this.mRemote.transact(5, obtain, obtain2, 0); + obtain2.readException(); + return obtain2.readInt() != 0 ? PurchaseInAppContentResult.CREATOR.createFromParcel(obtain2) : null; + } finally { + obtain2.recycle(); + obtain.recycle(); + } + } + } + + public Stub() { + attachInterface(this, DESCRIPTOR); + } + + public static IVCastInAppService asInterface(IBinder iBinder) { + if (iBinder == null) { + return null; + } + IInterface queryLocalInterface = iBinder.queryLocalInterface(DESCRIPTOR); + return (queryLocalInterface == null || !(queryLocalInterface instanceof IVCastInAppService)) ? new Proxy(iBinder) : (IVCastInAppService) queryLocalInterface; + } + + public IBinder asBinder() { + return this; + } + + @Override // android.os.Binder + public boolean onTransact(int i, Parcel parcel, Parcel parcel2, int i2) throws RemoteException { + switch (i) { + case 1: + parcel.enforceInterface(DESCRIPTOR); + int cancelInAppContentSubscription = cancelInAppContentSubscription(parcel.readString(), parcel.readString(), parcel.readString()); + parcel2.writeNoException(); + parcel2.writeInt(cancelInAppContentSubscription); + return true; + case 2: + parcel.enforceInterface(DESCRIPTOR); + InAppContentOffers inAppContentOffer = getInAppContentOffer(parcel.readString(), parcel.readString()); + parcel2.writeNoException(); + if (inAppContentOffer != null) { + parcel2.writeInt(1); + inAppContentOffer.writeToParcel(parcel2, 1); + return true; + } + parcel2.writeInt(0); + return true; + case 3: + parcel.enforceInterface(DESCRIPTOR); + InAppContents inAppContents = getInAppContents(parcel.readString(), parcel.readInt() != 0 ? DiscoveryParameters.CREATOR.createFromParcel(parcel) : null); + parcel2.writeNoException(); + if (inAppContents != null) { + parcel2.writeInt(1); + inAppContents.writeToParcel(parcel2, 1); + return true; + } + parcel2.writeInt(0); + return true; + case 4: + parcel.enforceInterface(DESCRIPTOR); + PurchasedInAppContents purchasedInAppContents = getPurchasedInAppContents(parcel.readString(), parcel.readInt() != 0 ? DiscoveryParameters.CREATOR.createFromParcel(parcel) : null); + parcel2.writeNoException(); + if (purchasedInAppContents != null) { + parcel2.writeInt(1); + purchasedInAppContents.writeToParcel(parcel2, 1); + return true; + } + parcel2.writeInt(0); + return true; + case 5: + parcel.enforceInterface(DESCRIPTOR); + PurchaseInAppContentResult purchaseInAppContent = purchaseInAppContent(parcel.readString(), parcel.readString(), parcel.readInt() != 0 ? PurchaseParameters.CREATOR.createFromParcel(parcel) : null); + parcel2.writeNoException(); + if (purchaseInAppContent != null) { + parcel2.writeInt(1); + purchaseInAppContent.writeToParcel(parcel2, 1); + return true; + } + parcel2.writeInt(0); + return true; + case 1598968902: + parcel2.writeString(DESCRIPTOR); + return true; + default: + return super.onTransact(i, parcel, parcel2, i2); + } + } + } + + int cancelInAppContentSubscription(String str, String str2, String str3) throws RemoteException; + + InAppContentOffers getInAppContentOffer(String str, String str2) throws RemoteException; + + InAppContents getInAppContents(String str, DiscoveryParameters discoveryParameters) throws RemoteException; + + PurchasedInAppContents getPurchasedInAppContents(String str, DiscoveryParameters discoveryParameters) throws RemoteException; + + PurchaseInAppContentResult purchaseInAppContent(String str, String str2, PurchaseParameters purchaseParameters) throws RemoteException; +} diff --git a/app/src/main/java/com/verizon/vcast/apps/InAppActivity.java b/app/src/main/java/com/verizon/vcast/apps/InAppActivity.java new file mode 100644 index 0000000..42cdaa5 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/InAppActivity.java @@ -0,0 +1,84 @@ +package com.verizon.vcast.apps; + +import android.app.Activity; +import android.content.Intent; +import android.os.Bundle; +import android.util.Log; +import com.verizon.vcast.apps.InAppPurchasor; +import java.util.Iterator; + +public abstract class InAppActivity extends Activity { + private static final String TAG = "InAppActivity"; + public static final int purchaseInAppContentRequestCode = 4684978; + protected InAppPurchasor inAppPurchasor; + + private void reportPurchaseError(int i) { + InAppPurchasor inAppPurchasor2 = this.inAppPurchasor; + inAppPurchasor2.getClass(); + InAppPurchasor.PurchaseInAppContentResult purchaseInAppContentResult = new InAppPurchasor.PurchaseInAppContentResult(); + purchaseInAppContentResult.setResult(Integer.valueOf(i)); + Log.e(TAG, "Purchase Response is invalid."); + onPurchaseResult(purchaseInAppContentResult); + } + + /* access modifiers changed from: protected */ + public void onActivityResult(int i, int i2, Intent intent) { + if (i != 4684978) { + return; + } + if (intent == null) { + reportPurchaseError(4); + return; + } + Bundle extras = intent.getExtras(); + if (extras == null) { + reportPurchaseError(4); + return; + } + Bundle bundle = extras.getBundle("bundle"); + if (bundle == null) { + reportPurchaseError(4); + return; + } + PurchaseInAppContentResult purchaseInAppContentResult = (PurchaseInAppContentResult) bundle.getParcelable("purchaseResult"); + if (purchaseInAppContentResult == null) { + reportPurchaseError(4); + return; + } + InAppPurchasor.PurchaseInAppContentResult convertPurchaseInAppContentResult = new APIUtils(this.inAppPurchasor).convertPurchaseInAppContentResult(purchaseInAppContentResult); + if (convertPurchaseInAppContentResult.getResult().intValue() == 3) { + try { + Iterator it = new LicenseAuthenticatorInternal().getInAppLicenses(convertPurchaseInAppContentResult.getLicense()).iterator(); + while (true) { + if (!it.hasNext()) { + break; + } + String next = it.next(); + int indexOf = next.indexOf(""); + int indexOf2 = next.indexOf(""); + if (indexOf != -1 && indexOf2 != -1 && next.substring(indexOf + 6, indexOf2).trim().equals(this.inAppPurchasor.itemIDBeingPurchased)) { + convertPurchaseInAppContentResult.setLicense(next); + if (convertPurchaseInAppContentResult.getPurchaseID() == null) { + int indexOf3 = next.indexOf(""); + int indexOf4 = next.indexOf(""); + if (indexOf != -1 && indexOf2 != -1) { + convertPurchaseInAppContentResult.setPurchaseID(next.substring(indexOf3 + 12, indexOf4)); + } + } + } + } + } catch (Exception e) { + Log.e("InAppPurchasor", "Cannot get specific in app license and populate purchase id.", e); + } + } + onPurchaseResult(convertPurchaseInAppContentResult); + } + + public void onCreate(Bundle bundle) { + super.onCreate(bundle); + this.inAppPurchasor = InAppPurchasor.getInstance(this); + } + + /* access modifiers changed from: protected */ + public abstract void onPurchaseResult(InAppPurchasor.PurchaseInAppContentResult purchaseInAppContentResult); +} diff --git a/app/src/main/java/com/verizon/vcast/apps/InAppContentOffers.java b/app/src/main/java/com/verizon/vcast/apps/InAppContentOffers.java new file mode 100644 index 0000000..3c3f210 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/InAppContentOffers.java @@ -0,0 +1,54 @@ +package com.verizon.vcast.apps; + +import android.os.Parcel; +import android.os.Parcelable; + +public class InAppContentOffers implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + /* class com.verizon.vcast.apps.InAppContentOffers.AnonymousClass1 */ + + @Override // android.os.Parcelable.Creator + public InAppContentOffers createFromParcel(Parcel parcel) { + return new InAppContentOffers(parcel, null); + } + + @Override // android.os.Parcelable.Creator + public InAppContentOffers[] newArray(int i) { + return new InAppContentOffers[i]; + } + }; + Offer[] offers; + int result; + int totalSize; + + public InAppContentOffers() { + } + + private InAppContentOffers(Parcel parcel) { + readFromParcel(parcel); + } + + /* synthetic */ InAppContentOffers(Parcel parcel, InAppContentOffers inAppContentOffers) { + this(parcel); + } + + private void readFromParcel(Parcel parcel) { + Object[] readArray = parcel.readArray(Offer.class.getClassLoader()); + this.offers = new Offer[readArray.length]; + for (int i = 0; i < readArray.length; i++) { + this.offers[i] = (Offer) readArray[i]; + } + this.result = parcel.readInt(); + this.totalSize = parcel.readInt(); + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeArray(this.offers); + parcel.writeInt(this.result); + parcel.writeInt(this.totalSize); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/InAppContents.java b/app/src/main/java/com/verizon/vcast/apps/InAppContents.java new file mode 100644 index 0000000..4675b9d --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/InAppContents.java @@ -0,0 +1,50 @@ +package com.verizon.vcast.apps; + +import android.os.Parcel; +import android.os.Parcelable; + +public class InAppContents implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + /* class com.verizon.vcast.apps.InAppContents.AnonymousClass1 */ + + @Override // android.os.Parcelable.Creator + public InAppContents createFromParcel(Parcel parcel) { + return new InAppContents(parcel); + } + + @Override // android.os.Parcelable.Creator + public InAppContents[] newArray(int i) { + return new InAppContents[i]; + } + }; + public Item[] items; + public Integer result; + public Integer totalSize; + + public InAppContents() { + } + + public InAppContents(Parcel parcel) { + readFromParcel(parcel); + } + + private void readFromParcel(Parcel parcel) { + Object[] readArray = parcel.readArray(Item.class.getClassLoader()); + this.items = new Item[readArray.length]; + for (int i = 0; i < readArray.length; i++) { + this.items[i] = (Item) readArray[i]; + } + this.result = Integer.valueOf(parcel.readInt()); + this.totalSize = Integer.valueOf(parcel.readInt()); + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeArray(this.items); + parcel.writeInt(this.result.intValue()); + parcel.writeInt(this.totalSize.intValue()); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/InAppPurchasor.java b/app/src/main/java/com/verizon/vcast/apps/InAppPurchasor.java new file mode 100644 index 0000000..164622d --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/InAppPurchasor.java @@ -0,0 +1,754 @@ +package com.verizon.vcast.apps; + +import android.app.Activity; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.os.RemoteException; +import android.util.Log; + +import java.util.Arrays; +import java.util.Date; + +public class InAppPurchasor extends InAppPurchasorInternal { + public static final int ERROR_CONTENT_HANDLER = 100; + public static final int ERROR_GENERAL = 106; + public static final int ERROR_ILLEGAL_ARGUMENT = 101; + public static final int ERROR_SECURITY = 102; + public static final int ERROR_UNABLE_TO_CONNECT_TO_CDS = 107; + public static final int INVALID_SUBSCIPTION_ID = 7; + public static final int LIST_REQ_FAILED = 9; + public static final int LIST_REQ_OK = 8; + public static final int PURCHASE_FAILED = 4; + public static final int PURCHASE_INITIATION_OK = 10; + public static final int PURCHASE_OK = 3; + public static final int SUBSCRIPTION_CANCELLATION_FAILED = 6; + public static final int SUBSCRIPTION_CANCELLED = 5; + private static InAppPurchasor instance = null; + + public class DiscoveryParameters { + private boolean ascendingOrder; + private int maxResults; + private String sortBy; + private int startIndex; + + public DiscoveryParameters() { + } + + public int getMaxResults() { + return this.maxResults; + } + + public String getSortBy() { + return this.sortBy; + } + + public int getStartIndex() { + return this.startIndex; + } + + public boolean isAscendingOrder() { + return this.ascendingOrder; + } + + public void setAscendingOrder(boolean z) { + this.ascendingOrder = z; + } + + public void setMaxResults(int i) { + this.maxResults = i; + } + + public void setSortBy(String str) { + this.sortBy = str; + } + + public void setStartIndex(int i) { + this.startIndex = i; + } + + public String toString() { + return "Start Index:" + this.startIndex + "\n" + "maxResults:" + this.maxResults + "\n" + "ascendingOrder:" + this.ascendingOrder + "\n" + "sortBy:" + this.sortBy; + } + } + + public static class InAppContentOffers { + private Offer[] offers; + private Integer result; + private Integer totalSize; + + public InAppContentOffers() { + } + + public Offer[] getOffers() { + return this.offers; + } + + public Integer getResult() { + return this.result; + } + + public Integer getTotalSize() { + return this.totalSize; + } + + public void setOffers(Offer[] offerArr) { + this.offers = offerArr; + } + + public void setResult(Integer num) { + this.result = num; + } + + public void setTotalSize(Integer num) { + this.totalSize = num; + } + + public String toString() { + return "Result:" + this.result + " \n" + "Total Size:" + this.totalSize + " \n" + "Offer:" + Arrays.deepToString(this.offers); + } + } + + public static class InAppContents { + private Item[] items; + private Integer result; + private Integer totalSize; + + public InAppContents() { + } + + public Item[] getItems() { + return this.items; + } + + public Integer getResult() { + return this.result; + } + + public Integer getTotalSize() { + return this.totalSize; + } + + public void setItems(Item[] itemArr) { + this.items = itemArr; + } + + public void setResult(Integer num) { + this.result = num; + } + + /* access modifiers changed from: package-private */ + public void setTotalSize(Integer num) { + this.totalSize = num; + } + + public String toString() { + return "Result:" + this.result + " \n" + "Total Size:" + this.totalSize + " \n" + "Offer:" + Arrays.deepToString(this.items); + } + } + + public static class Item { + private String ageRating; + private String itemDescription; + private String itemID; + private String itemName; + private float suggestedPrice; + private String suggestedPriceType; + + public Item() { + } + + public String getAgeRating() { + return this.ageRating; + } + + public String getItemDescription() { + return this.itemDescription; + } + + public String getItemID() { + return this.itemID; + } + + public String getItemName() { + return this.itemName; + } + + public float getSuggestedPrice() { + return this.suggestedPrice; + } + + public String getSuggestedPriceType() { + return this.suggestedPriceType; + } + + public void setAgeRating(String str) { + this.ageRating = str; + } + + public void setItemDescription(String str) { + this.itemDescription = str; + } + + public void setItemID(String str) { + this.itemID = str; + } + + public void setItemName(String str) { + this.itemName = str; + } + + public void setSuggestedPrice(float f) { + this.suggestedPrice = f; + } + + public void setSuggestedPriceType(String str) { + this.suggestedPriceType = str; + } + + public String toString() { + return "Item ID:" + this.itemID + "\n" + "Item Name:" + this.itemName + "\n" + "Item Description:" + this.itemDescription + "\n" + "Age Rating:" + this.ageRating; + } + } + + public static class Offer { + private float maxPrice; + private float minPrice; + private String offerID; + private String priceLine; + private String priceType; + private String pricingTerms; + + public Offer() { + } + + public float getMaxPrice() { + return this.maxPrice; + } + + public float getMinPrice() { + return this.minPrice; + } + + public String getOfferID() { + return this.offerID; + } + + public String getPriceLine() { + return this.priceLine; + } + + public String getPriceType() { + return this.priceType; + } + + public String getPricingTerms() { + return this.pricingTerms; + } + + public void setMaxPrice(float f) { + this.maxPrice = f; + } + + public void setMinPrice(float f) { + this.minPrice = f; + } + + public void setOfferID(String str) { + this.offerID = str; + } + + public void setPriceLine(String str) { + this.priceLine = str; + } + + public void setPriceType(String str) { + this.priceType = str; + } + + public void setPricingTerms(String str) { + this.pricingTerms = str; + } + + public String toString() { + return "Offer ID:" + this.offerID + "\n" + "Max Price:" + this.maxPrice + "\n" + "Min Price:" + this.minPrice + "\n" + "Price Line:" + this.priceLine + "\n" + "Price Type:" + this.priceType + "\n" + "Pricing Terms:" + this.pricingTerms; + } + } + + public static class Purchase { + private String inAppName; + private Item item; + private float price; + private String priceLine; + private String priceType; + private String pricingTerms; + private Date purchaseDate; + private String purchaseID; + private String sku; + + public Purchase() { + } + + public String getInAppName() { + return this.inAppName; + } + + public Item getItem() { + return this.item; + } + + public float getPrice() { + return this.price; + } + + public String getPriceLine() { + return this.priceLine; + } + + public String getPriceType() { + return this.priceType; + } + + public String getPricingTerms() { + return this.pricingTerms; + } + + public Date getPurchaseDate() { + return this.purchaseDate; + } + + public String getPurchaseID() { + return this.purchaseID; + } + + public String getSku() { + return this.sku; + } + + public void setInAppName(String str) { + this.inAppName = str; + } + + public void setItem(Item item2) { + this.item = item2; + } + + public void setPrice(float f) { + this.price = f; + } + + public void setPriceLine(String str) { + this.priceLine = str; + } + + public void setPriceType(String str) { + this.priceType = str; + } + + public void setPricingTerms(String str) { + this.pricingTerms = str; + } + + public void setPurchaseDate(Date date) { + this.purchaseDate = date; + } + + public void setPurchaseID(String str) { + this.purchaseID = str; + } + + public void setSku(String str) { + this.sku = str; + } + + public String toString() { + return "Offer ID:" + this.purchaseID + "\n" + "In App Name:" + this.inAppName + "\n" + "SKU:" + this.sku + "\n" + "Price Line:" + this.priceLine + "\n" + "Price Type:" + this.priceType + "\n" + "Pricing Terms:" + this.pricingTerms + "\n" + "Purchase Date:" + this.purchaseDate + "\n" + "Item: " + this.item + "\n"; + } + } + + public static class PurchaseInAppContentResult { + private String license; + private String purchaseID; + private Integer result; + + public PurchaseInAppContentResult() { + } + + public String getLicense() { + return this.license; + } + + public String getPurchaseID() { + return this.purchaseID; + } + + public Integer getResult() { + return this.result; + } + + public void setLicense(String str) { + this.license = str; + } + + public void setPurchaseID(String str) { + this.purchaseID = str; + } + + public void setResult(Integer num) { + this.result = num; + } + + public String toString() { + return "Result:" + this.result + " \n" + "License:" + this.license + " \n" + "purchaseID:" + this.purchaseID; + } + } + + public class PurchaseParameters { + private Integer contentSize; + private String inAppName; + private String offerID; + private float price; + private String priceLine; + private String priceType; + private String pricingTerms; + private String sku; + + public PurchaseParameters() { + } + + public Integer getContentSize() { + return this.contentSize; + } + + public String getInAppName() { + return this.inAppName; + } + + public String getOfferID() { + return this.offerID; + } + + public float getPrice() { + return this.price; + } + + public String getPriceLine() { + return this.priceLine; + } + + public String getPriceType() { + return this.priceType; + } + + public String getPricingTerms() { + return this.pricingTerms; + } + + public String getSku() { + return this.sku; + } + + public void setContentSize(Integer num) { + this.contentSize = num; + } + + public void setInAppName(String str) { + this.inAppName = str; + } + + public void setOfferID(String str) { + this.offerID = str; + } + + public void setPrice(float f) { + this.price = f; + } + + public void setPriceLine(String str) { + this.priceLine = str; + } + + public void setPriceType(String str) { + this.priceType = str; + } + + public void setPricingTerms(String str) { + this.pricingTerms = str; + } + + public void setSku(String str) { + this.sku = str; + } + + public String toString() { + return "In App Name:" + this.inAppName + "\n" + "SKU:" + this.sku + "\n" + "Price:" + this.price + "\n" + "Content Size:" + this.contentSize + "\n" + "Offer Id:" + this.offerID + "\n" + "Price Type:" + this.priceType + "\n" + "Price Line:" + this.priceLine + "\n" + "Pricing Terms:" + this.pricingTerms; + } + } + + public static class PurchasedInAppContents { + private Purchase[] purchases; + private Integer result; + private Integer totalSize; + + public PurchasedInAppContents() { + } + + public Purchase[] getPurchases() { + return this.purchases; + } + + public Integer getResult() { + return this.result; + } + + public Integer getTotalSize() { + return this.totalSize; + } + + public void setPurchases(Purchase[] purchaseArr) { + this.purchases = purchaseArr; + } + + public void setResult(Integer num) { + this.result = num; + } + + public void setTotalSize(Integer num) { + this.totalSize = num; + } + + public String toString() { + return "Result:" + this.result + " \n" + "Total Size:" + this.totalSize + " \n" + "Purchases:" + Arrays.deepToString(this.purchases); + } + } + + private InAppPurchasor(Context context) { + this.c = context; + this.apiUtils = new APIUtils(this); + this.isVcastUIEInstalled = isOdpInstalled("com.verizon.vcast.apps"); + this.isVcastGMInstalled = isOdpInstalled("com.gravitymobile.app.hornbill"); + if (!this.isVcastGMInstalled || this.isVcastUIEInstalled) { + this.serviceManager = new RemoteServiceManager(context, "com.verizon.vcast.apps", "com.verizon.vcast.apps.VCastInAppService"); + } else { + this.serviceManager = new RemoteServiceManager(context, "com.gravitymobile.app.hornbill", "com.verizon.vcast.apps.VCastInAppService"); + } + } + + public static InAppPurchasor getInstance(Context context) { + return instance == null ? new InAppPurchasor(context) : instance; + } + + public synchronized int cancelInAppContentSubscription(String str, String str2, String str3) { + int i; + Log.i("InAppPurchasor", "begin cancelInAppContentSubscription()"); + if (str != null) { + try { + if (!str.equals("") && str2 != null && !str2.equals("") && str3 != null && !str3.equals("")) { + i = this.serviceManager.validateService(); + if (i == 0) { + try { + int cancelInAppContentSubscription = IVCastInAppService.Stub.asInterface(this.serviceManager.getServiceBinder()).cancelInAppContentSubscription(str, str2, str3); + Log.i("LicenseAuthenticator", "cancelInAppContentSubscription() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + i = cancelInAppContentSubscription; + } catch (RemoteException e) { + Log.e("InAppPurchasor", "Error getting content offers from remote service", e); + i = 106; + Log.i("LicenseAuthenticator", "cancelInAppContentSubscription() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + } + } + } finally { + Log.i("LicenseAuthenticator", "cancelInAppContentSubscription() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + } + i = 101; + Log.i("LicenseAuthenticator", "cancelInAppContentSubscription() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + return i; + } + + public synchronized InAppContentOffers getInAppContentOffer(String str, String str2) { + Throwable th; + InAppContentOffers inAppContentOffers; + Log.i("InAppPurchasor", "begin getInAppContentOffer()"); + if (str != null) { + try { + if (!str.equals("") && str2 != null && !str2.equals("")) { + int validateService = this.serviceManager.validateService(); + if (validateService != 0) { + inAppContentOffers = new InAppContentOffers(); + inAppContentOffers.result = validateService; + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } else { + try { + InAppContentOffers convertGetInAppContentOfferResult = this.apiUtils.convertGetInAppContentOfferResult(IVCastInAppService.Stub.asInterface(this.serviceManager.getServiceBinder()).getInAppContentOffer(str, str2)); + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + inAppContentOffers = convertGetInAppContentOfferResult; + } catch (RemoteException e) { + Log.e("InAppPurchasor", "Error getting content offers from remote service", e); + inAppContentOffers = new InAppContentOffers(); + inAppContentOffers.result = 101; + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + } + } + } catch (Throwable th2) { + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + } + inAppContentOffers = new InAppContentOffers(); + try { + inAppContentOffers.result = 101; + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } catch (Throwable th3) { + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + return inAppContentOffers; + } + + public synchronized InAppContents getInAppContents(String str, DiscoveryParameters discoveryParameters) { + Throwable th; + InAppContents inAppContents; + Log.i("InAppPurchasor", "begin getInAppContents()"); + if (str != null) { + try { + if (!str.equals("") && discoveryParameters != null) { + int validateService = this.serviceManager.validateService(); + if (validateService != 0) { + inAppContents = new InAppContents(); + inAppContents.result = Integer.valueOf(validateService); + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } else { + IVCastInAppService asInterface = IVCastInAppService.Stub.asInterface(this.serviceManager.getServiceBinder()); + try { + InAppContents convertGetInAppContentsResult = this.apiUtils.convertGetInAppContentsResult(asInterface.getInAppContents(str, this.apiUtils.convertDiscoveryParameters(discoveryParameters))); + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + inAppContents = convertGetInAppContentsResult; + } catch (RemoteException e) { + Log.e("InAppPurchasor", "Error getting content offers from remote service", e); + inAppContents = new InAppContents(); + inAppContents.result = 101; + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + } + } + } catch (Throwable th2) { + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + } + inAppContents = new InAppContents(); + try { + inAppContents.result = 101; + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } catch (Throwable th3) { + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + return inAppContents; + } + + public synchronized PurchasedInAppContents getPurchasedInAppContents(String str, DiscoveryParameters discoveryParameters) { + Throwable th; + PurchasedInAppContents purchasedInAppContents; + Log.i("InAppPurchasor", "begin getPurchasedInAppContents()"); + if (str != null) { + try { + if (!str.equals("") && discoveryParameters != null) { + int validateService = this.serviceManager.validateService(); + if (validateService != 0) { + purchasedInAppContents = new PurchasedInAppContents(); + purchasedInAppContents.result = Integer.valueOf(validateService); + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } else { + IVCastInAppService asInterface = IVCastInAppService.Stub.asInterface(this.serviceManager.getServiceBinder()); + try { + PurchasedInAppContents convertGetPurchasedInAppContentsResult = this.apiUtils.convertGetPurchasedInAppContentsResult(asInterface.getPurchasedInAppContents(str, this.apiUtils.convertDiscoveryParameters(discoveryParameters))); + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + purchasedInAppContents = convertGetPurchasedInAppContentsResult; + } catch (RemoteException e) { + Log.e("InAppPurchasor", "Error getting content offers from remote service", e); + purchasedInAppContents = new PurchasedInAppContents(); + purchasedInAppContents.result = 101; + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + } + } + } catch (Throwable th2) { + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + } + purchasedInAppContents = new PurchasedInAppContents(); + try { + purchasedInAppContents.result = 101; + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } catch (Throwable th3) { + Log.i("LicenseAuthenticator", "getInAppContents() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + return purchasedInAppContents; + } + + /* JADX INFO: finally extract failed */ + public synchronized int purchaseInAppContent(String str, String str2, PurchaseParameters purchaseParameters) { + int i; + Log.i("InAppPurchasor", "begin PurchaseInAppContentResult()"); + if (str != null) { + try { + if (!str.equals("") && str2 != null && !str2.equals("")) { + try { + com.verizon.vcast.apps.PurchaseParameters convertPurchaseParameters = this.apiUtils.convertPurchaseParameters(purchaseParameters); + Intent intent = new Intent(); + if (this.isVcastUIEInstalled) { + intent.setComponent(new ComponentName("com.verizon.vcast.apps", "com.vzw.inapp.VZWInAppPurchase")); + } else { + intent.setComponent(new ComponentName("com.gravitymobile.app.hornbill", "com.vzw.inapp.VZWInAppPurchase")); + } + Bundle bundle = new Bundle(); + bundle.putString("keyword", str); + bundle.putString("itemID", str2); + bundle.putParcelable("purchaseParameters", convertPurchaseParameters); + intent.putExtra("purchaseInAppContentArguments", bundle); + ((Activity) this.c).startActivityForResult(intent, InAppActivity.purchaseInAppContentRequestCode); + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + this.itemIDBeingPurchased = str2; + i = 10; + } catch (Exception e) { + Log.e("InAppPurchasor", "Error intiating In App Purchase", e); + i = 106; + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + } + } + } catch (Throwable th) { + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + throw th; + } + } + i = 101; + Log.i("LicenseAuthenticator", "getInAppContentOffer() finished. Trying to shutDownRemoteService()"); + this.serviceManager.shutDownRemoteService(this.c); + return i; + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/InAppPurchasorInternal.java b/app/src/main/java/com/verizon/vcast/apps/InAppPurchasorInternal.java new file mode 100644 index 0000000..0d9977b --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/InAppPurchasorInternal.java @@ -0,0 +1,33 @@ +package com.verizon.vcast.apps; + +import android.content.Context; +import android.content.pm.PackageManager; +import android.util.Log; + +public class InAppPurchasorInternal { + protected static final String ODP_INTENT_CLASSNAME = "com.verizon.vcast.apps.VCastInAppService"; + protected static final String ODP_PURCHASE_CLASSNAME = "com.vzw.inapp.VZWInAppPurchase"; + protected static final String TAG = "InAppPurchasor"; + protected static final String VCAST_GM_ODP_IDENTIFIER = "com.gravitymobile.app.hornbill"; + protected static final String VCAST_UIE_ODP_IDENTIFIER = "com.verizon.vcast.apps"; + protected APIUtils apiUtils; + protected Context c; + protected boolean isVcastGMInstalled; + protected boolean isVcastUIEInstalled; + public String itemIDBeingPurchased; + protected RemoteServiceManager serviceManager; + + /* access modifiers changed from: protected */ + public boolean isOdpInstalled(String str) { + boolean z = false; + try { + this.c.getPackageManager().getApplicationInfo(str, 8192); + z = true; + Log.i(TAG, String.valueOf(str) + " is installed"); + return true; + } catch (PackageManager.NameNotFoundException e) { + Log.w(TAG, String.valueOf(str) + " is not installed"); + return z; + } + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/Item.java b/app/src/main/java/com/verizon/vcast/apps/Item.java new file mode 100644 index 0000000..c44262c --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/Item.java @@ -0,0 +1,53 @@ +package com.verizon.vcast.apps; + +import android.os.Parcel; +import android.os.Parcelable; + +public class Item implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + /* class com.verizon.vcast.apps.Item.AnonymousClass1 */ + + @Override // android.os.Parcelable.Creator + public Item createFromParcel(Parcel parcel) { + return new Item(parcel, null); + } + + @Override // android.os.Parcelable.Creator + public Item[] newArray(int i) { + return new Item[i]; + } + }; + public String ageRating; + public String itemDescription; + public String itemID; + public String itemName; + + public Item() { + } + + private Item(Parcel parcel) { + readFromParcel(parcel); + } + + /* synthetic */ Item(Parcel parcel, Item item) { + this(parcel); + } + + public int describeContents() { + return 0; + } + + public void readFromParcel(Parcel parcel) { + this.ageRating = parcel.readString(); + this.itemDescription = parcel.readString(); + this.itemID = parcel.readString(); + this.itemName = parcel.readString(); + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeString(this.ageRating); + parcel.writeString(this.itemDescription); + parcel.writeString(this.itemID); + parcel.writeString(this.itemName); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/LicenseAuthenticator.java b/app/src/main/java/com/verizon/vcast/apps/LicenseAuthenticator.java new file mode 100644 index 0000000..d0e1f4e --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/LicenseAuthenticator.java @@ -0,0 +1,147 @@ +package com.verizon.vcast.apps; + +import android.content.Context; +import android.util.Log; + +public final class LicenseAuthenticator extends LicenseAuthenticatorInternal { + public static final int ERROR_CONTENT_HANDLER = 100; + public static final int ERROR_GENERAL = 106; + public static final int ERROR_ILLEGAL_ARGUMENT = 101; + public static final int ERROR_SECURITY = 102; + public static final int ERROR_UNABLE_TO_CONNECT_TO_CDS = 107; + public static final int ITEM_NOT_FOUND = 51; + public static final int ITEM_USE_BLOCKED = 60; + public static final int LICENSE_NOT_FOUND = 52; + public static final int LICENSE_OK = 0; + public static final int LICENSE_TRIAL_OK = 1; + public static final int LICENSE_VALIDATION_FAILED = 50; + + public class CheckLicenseResult { + public String license; + public Integer result; + + public CheckLicenseResult() { + } + + public String getLicense() { + return this.license; + } + + public Integer getResult() { + return this.result; + } + + /* access modifiers changed from: package-private */ + public void setLicense(String str) { + this.license = str; + } + + /* access modifiers changed from: package-private */ + public void setResult(Integer num) { + this.result = num; + } + + public String toString() { + return "result code:" + this.result + ", license:" + this.license; + } + } + + public LicenseAuthenticator(Context context) { + callingContext = context; + } + + public synchronized CheckLicenseResult checkContentLicense(String str) { + return checkInAppContentLicense(str, null); + } + + public synchronized CheckLicenseResult checkContentLicense(String str, boolean z) { + return checkInAppContentLicense(str, null, z); + } + + public synchronized CheckLicenseResult checkInAppContentLicense(String str, String str2) { + return checkInAppContentLicense(str, str2, false); + } + + public synchronized CheckLicenseResult checkInAppContentLicense(String str, String str2, boolean z) { + CheckLicenseResult checkLicenseResult; + Log.i("LicenseAuthenticator", "begin checkLicense()"); + checkLicenseResult = new CheckLicenseResult(); + String str3 = null; + if (str != null) { + try { + if (!str.equals("")) { + boolean isOdpInstalled = isOdpInstalled("com.vzw.appstore.android"); + boolean z2 = false; + if (isOdpInstalled("com.gravitymobile.app.hornbill")) { + z2 = true; + str3 = "com.gravitymobile.app.hornbill"; + } + if (isOdpInstalled("com.verizon.vcast.apps")) { + z2 = true; + str3 = "com.verizon.vcast.apps"; + } + if (isEmaKeyword(str) && !isOdpInstalled) { + checkLicenseResult.setResult(100); + } else if (isEmaKeyword(str) && isOdpInstalled) { + checkLicenseResult = checkLicenseInternal("com.vzw.appstore.android", "com.verizon.vcast.apps.VCastAppsLicenseService", str, str2, z, checkLicenseResult); + Log.i("LicenseAuthenticator", "checkLicense() finished. Trying to shutDownLicenseService()"); + shutDownLicenseService(); + } else if (!isEmaKeyword(str)) { + if (isOdpInstalled) { + CheckLicenseResult checkLicenseInternal = checkLicenseInternal("com.vzw.appstore.android", "com.verizon.vcast.apps.VCastAppsLicenseService", str, str2, z, checkLicenseResult); + if (checkLicenseInternal.getResult().intValue() == 0 || checkLicenseInternal.getResult().intValue() == 1 || !z2) { + Log.i("LicenseAuthenticator", "checkLicense() finished. Trying to shutDownLicenseService()"); + shutDownLicenseService(); + checkLicenseResult = checkLicenseInternal; + } else { + shutDownLicenseService(); + } + } + if (z2) { + checkLicenseResult = checkLicenseInternal(str3, "com.verizon.vcast.apps.VCastAppsLicenseService", str, str2, z, checkLicenseResult); + Log.i("LicenseAuthenticator", "checkLicense() finished. Trying to shutDownLicenseService()"); + shutDownLicenseService(); + } else { + checkLicenseResult.setResult(100); + Log.i("LicenseAuthenticator", "checkLicense() finished. Trying to shutDownLicenseService()"); + shutDownLicenseService(); + } + } else { + checkLicenseResult.setResult(106); + Log.i("LicenseAuthenticator", "checkLicense() finished. Trying to shutDownLicenseService()"); + shutDownLicenseService(); + } + } + } finally { + Log.i("LicenseAuthenticator", "checkLicense() finished. Trying to shutDownLicenseService()"); + shutDownLicenseService(); + } + } + checkLicenseResult.setResult(101); + Log.i("LicenseAuthenticator", "checkLicense() finished. Trying to shutDownLicenseService()"); + shutDownLicenseService(); + return checkLicenseResult; + } + + public synchronized int checkLicense(String str) { + new CheckLicenseResult(); + return checkContentLicense(str).result.intValue(); + } + + public synchronized int checkLicense(String str, boolean z) { + new CheckLicenseResult(); + return checkContentLicense(str, z).result.intValue(); + } + + public CheckLicenseResult checkTestContentLicense(String str, CheckLicenseResult checkLicenseResult) { + return checkLicenseResult; + } + + public CheckLicenseResult checkTestInAppContentLicense(String str, String str2, CheckLicenseResult checkLicenseResult) { + return checkLicenseResult; + } + + public int checkTestLicense(String str, int i) { + return i; + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/LicenseAuthenticatorInternal.java b/app/src/main/java/com/verizon/vcast/apps/LicenseAuthenticatorInternal.java new file mode 100644 index 0000000..5a36add --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/LicenseAuthenticatorInternal.java @@ -0,0 +1,606 @@ +package com.verizon.vcast.apps; + +import android.content.ComponentName; +import android.content.Context; +import android.content.ServiceConnection; +import android.content.pm.PackageManager; +import android.os.IBinder; +import android.os.RemoteException; +import android.telephony.TelephonyManager; +import android.util.Log; + +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +import java.io.StringReader; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.Iterator; +import java.util.List; +import java.util.TimeZone; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +public class LicenseAuthenticatorInternal { + protected static final String EMA_KEYWORD_PREFIX = "ema_"; + private static final int EMA_LICENSE_SIGNATURE_LENGTH = 172; + protected static final String EMA_ODP_IDENTIFIER = "com.vzw.appstore.android"; + protected static final int LICENSE_SERVICE_STARTED = -1; + private static final byte ODP_ERROR_GENERAL = 3; + private static final byte ODP_ERROR_ITEM_NOT_FOUND = 1; + private static final byte ODP_ERROR_ITEM_USE_BLOCKED = 5; + private static final byte ODP_ERROR_LICENSE_VALIDATION_FAILED = 2; + protected static final String ODP_INTENT_CLASSNAME = "com.verizon.vcast.apps.VCastAppsLicenseService"; + private static final int ODP_TYPE_EMA = 1; + private static final int ODP_TYPE_VCAST = 0; + protected static final String TAG = LicenseAuthenticator.class.getSimpleName(); + protected static final String VCAST_GM_ODP_IDENTIFIER = "com.gravitymobile.app.hornbill"; + private static final int VCAST_LICENSE_SIGNATURE_LENGTH = 128; + protected static final String VCAST_UIE_ODP_IDENTIFIER = "com.verizon.vcast.apps"; + protected static Context callingContext = null; + private volatile DatabaseHelper db = null; + List inAppLicenses = null; + private int indexOfInApp; + private volatile Object initLock = new Object(); + protected volatile IVCastAppsLicenseService licenseService = null; + protected volatile LicenseServiceConnection licenseServiceConnection; + private volatile boolean serviceStarted = false; + + /* access modifiers changed from: private */ + public class LicenseServiceConnection implements ServiceConnection { + private LicenseServiceConnection() { + } + + /* synthetic */ LicenseServiceConnection(LicenseAuthenticatorInternal licenseAuthenticatorInternal, LicenseServiceConnection licenseServiceConnection) { + this(); + } + + public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + LicenseAuthenticatorInternal.this.licenseService = IVCastAppsLicenseService.Stub.asInterface(iBinder); + synchronized (LicenseAuthenticatorInternal.this.initLock) { + LicenseAuthenticatorInternal.this.initLock.notifyAll(); + } + } + + public void onServiceDisconnected(ComponentName componentName) { + LicenseAuthenticatorInternal.this.licenseService = null; + LicenseAuthenticatorInternal.this.licenseServiceConnection = null; + synchronized (LicenseAuthenticatorInternal.this.initLock) { + LicenseAuthenticatorInternal.this.initLock.notifyAll(); + } + } + } + + private long convertToLong(String str) { + int i; + int i2; + int i3; + int i4; + int i5; + int i6; + try { + int indexOf = str.indexOf("-"); + i = Integer.parseInt(str.substring(0, indexOf)); + int i7 = indexOf + 1; + int indexOf2 = str.indexOf("-", indexOf + 1); + i2 = Integer.parseInt(str.substring(i7, indexOf2)) - 1; + int i8 = indexOf2 + 1; + int indexOf3 = str.indexOf("T", indexOf2 + 1); + i3 = Integer.parseInt(str.substring(i8, indexOf3)); + int i9 = indexOf3 + 1; + int indexOf4 = str.indexOf(":", indexOf3 + 1); + i4 = Integer.parseInt(str.substring(i9, indexOf4)); + int i10 = indexOf4 + 1; + int indexOf5 = str.indexOf(":", indexOf4 + 1); + i5 = Integer.parseInt(str.substring(i10, indexOf5)); + i6 = Integer.parseInt(str.substring(indexOf5 + 1)); + } catch (Exception e) { + i = 1970; + i2 = 0; + i3 = 1; + i4 = 0; + i5 = 0; + i6 = 0; + } + Calendar instance = Calendar.getInstance(TimeZone.getTimeZone("GMT")); + instance.set(Calendar.YEAR, i); + instance.set(Calendar.MONTH, i2); + instance.set(Calendar.DAY_OF_MONTH, i3); + instance.set(Calendar.HOUR_OF_DAY, i4); + instance.set(Calendar.MINUTE, i5); + instance.set(Calendar.SECOND, i6); + return instance.getTime().getTime(); + } + + private long getBestCurrentTime() { + long currentTimeMillis = System.currentTimeMillis(); + long savedNetworkTime = getSavedNetworkTime(); + return savedNetworkTime > currentTimeMillis ? savedNetworkTime : currentTimeMillis; + } + + private List getChildByName(Node node, String str) { + ArrayList arrayList = new ArrayList(); + NodeList childNodes = node.getChildNodes(); + for (int i = 0; i < childNodes.getLength(); i++) { + Node item = childNodes.item(i); + if (item.getNodeName().equals(str)) { + arrayList.add(item); + } + } + return arrayList; + } + + private int getErrorCode(byte[] bArr) { + switch (bArr[0]) { + case 1: + return 51; + case 2: + return 52; + case 3: + return 107; + case 4: + default: + return 106; + case 5: + return 60; + } + } + + private String getMDN() { + TelephonyManager telephonyManager = (TelephonyManager) callingContext.getSystemService(Context.TELEPHONY_SERVICE); + int phoneType = telephonyManager.getPhoneType(); + switch (phoneType) { + case 1: + case 2: + return telephonyManager.getLine1Number(); + default: + Log.i("VZWLicense", "LicenseAuthenticator.getMDN(): Unsupported phoneType " + phoneType); + return null; + } + } + + private String getMEID() { + TelephonyManager telephonyManager = (TelephonyManager) callingContext.getSystemService(Context.TELEPHONY_SERVICE); + int phoneType = telephonyManager.getPhoneType(); + switch (phoneType) { + case 1: + case 2: + return telephonyManager.getDeviceId(); + default: + Log.i("VZWLicense", "LicenseAuthenticator.getMEID(): Unsupported phoneType " + phoneType); + return null; + } + } + + private String getMapValue(String str, String str2) { + try { + int indexOf = str2.indexOf("<" + str + ">") + 2 + str.length(); + int indexOf2 = str2.indexOf(""); + if (indexOf < 0 || indexOf2 < 0) { + return null; + } + return str2.substring(indexOf, indexOf2); + } catch (Exception e) { + return null; + } + } + + private long getSavedNetworkTime() { + Long l = 0L; + if (this.db == null) { + this.db = new DatabaseHelper(LicenseAuthenticator.callingContext); + } + try { + Iterator it = this.db.selectAll().iterator(); + if (it.hasNext()) { + l = Long.valueOf(Long.parseLong(it.next())); + } + } catch (Throwable th) { + System.err.print(th); + th.printStackTrace(); + } + Log.d("VZWLicense", "getSavedNetworkTime()=" + Long.toString(l)); + return l; + } + + private boolean isEmaSource(String str) { + return str.contains("") && getMapValue("Source", str).equalsIgnoreCase("EMA"); + } + + private boolean isSignatureValid(byte[] bArr, byte[] bArr2, int i) { + VzwRSAKyParam vzwRSAKyParam = null; + Log.i(TAG, "Validating Signature"); + if (i == 1) { + try { + vzwRSAKyParam = new VzwRSAKyParam(false, new VzwBigInt("107493806210625235577865383583966213583203769054180884203670357027270028071413938146414253505380813234565169065101353106586121476194778366775987951307055104758706320089544509318953312117460811040627008525057894596490834350638622651605940563447702952001450779562939078801196325903274126043191010876664350998971"), new VzwBigInt("65537")); + } catch (Exception e) { + return false; + } + } else { + vzwRSAKyParam = new VzwRSAKyParam(false, new VzwBigInt("113751985209425220389904911573418596054906626841732881629605928013581871729424978229159252758527107263930688983674762647850445576382155543169643622580638253014102297871653770954828091210266102863696922720690032125039249372686528361690969551775463749111601961827967139084754353180300766686096391389069084141699"), new VzwBigInt("65537")); + } + VzwPKCS1Encd vzwPKCS1Encd = new VzwPKCS1Encd(new VzwRSAEng()); + vzwPKCS1Encd.init(false, vzwRSAKyParam); + byte[] processBlock = new byte[0]; + try { + processBlock = vzwPKCS1Encd.processBlock(bArr, 0, bArr.length); + } catch (Exception e) { + e.printStackTrace(); + } + VzwSHA vzwSHA = new VzwSHA(); + byte[] bArr3 = new byte[20]; + vzwSHA.update(bArr2, 0, bArr2.length); + vzwSHA.doFinal(bArr3, 0); + if (processBlock.length == 20) { + for (int i2 = 0; i2 < bArr3.length; i2++) { + if (bArr3[i2] != processBlock[i2]) { + Log.e(TAG, "Signature Validation Failed"); + return false; + } + } + Log.i(TAG, "Signature Validation Passed"); + return true; + } + Log.e(TAG, "Signature Validation Failed"); + return false; + } + + private int validateLicense(Node node, String str, String str2) throws Exception { + String str3 = null; + String str4 = null; + String str5 = null; + String str6 = null; + String str7 = null; + String str8 = null; + String str9 = null; + String str10 = null; + boolean z = false; + boolean z2 = false; + long j = 0; + long j2 = 0; + long j3 = 0; + NodeList childNodes = node.getChildNodes(); + for (int i = 0; i < childNodes.getLength(); i++) { + try { + Node item = childNodes.item(i); + String nodeName = item.getNodeName(); + if (nodeName.equals("MDN")) { + str3 = item.getFirstChild().getNodeValue(); + } else if (nodeName.equals("MEID")) { + str4 = item.getFirstChild().getNodeValue(); + } else if (nodeName.equals("UniqueDeviceId")) { + str10 = item.getFirstChild().getNodeValue(); + } else if (nodeName.equals("IsLocked")) { + z = Boolean.parseBoolean(item.getFirstChild().getNodeValue()); + } else if (nodeName.equals("IsSubscriptionExpired")) { + str5 = item.getFirstChild().getNodeValue(); + } else if (nodeName.equals("IsLimitedTimeExpired")) { + str6 = item.getFirstChild().getNodeValue(); + } else if (nodeName.equals("IsPurchaseRequired")) { + str7 = item.getFirstChild().getNodeValue(); + } else if (nodeName.equals("Keyword")) { + str8 = item.getFirstChild().getNodeValue(); + } else if (nodeName.equals("PriceType")) { + str9 = item.getFirstChild().getNodeValue(); + } else if (nodeName.equals("IssueTime")) { + j = convertToLong(item.getFirstChild().getNodeValue()); + } else if (nodeName.equals("NextCheckTime")) { + j2 = convertToLong(item.getFirstChild().getNodeValue()); + } else if (nodeName.equals("PurchaseDate")) { + j3 = convertToLong(item.getFirstChild().getNodeValue()); + } + } catch (Exception e) { + Log.e(TAG, "Cannot fetch:" + ((String) null) + "from license."); + } + } + if (str9.equalsIgnoreCase("Subscription")) { + if (!str5.equalsIgnoreCase("FALSE")) { + Log.e(TAG, "License Validation Failed: Subscription Expired"); + return 50; + } else if (!str7.equalsIgnoreCase("FALSE")) { + Log.e(TAG, "License Validation Failed: Purchase is Required"); + return 50; + } + } else if (str9.equalsIgnoreCase("Per Period")) { + if (!str6.equalsIgnoreCase("FALSE")) { + Log.e(TAG, "License Validation Failed: Limited Time Expired"); + return 50; + } else if (!str7.equalsIgnoreCase("FALSE")) { + Log.e(TAG, "License Validation Failed: Purchase is Required"); + return 50; + } + } else if (str9.equalsIgnoreCase("First Download") || str9.equalsIgnoreCase("Free")) { + if (!str7.equalsIgnoreCase("FALSE")) { + Log.e(TAG, "License Validation Failed: Purchase is Required"); + return 50; + } + } else if (str9.equalsIgnoreCase("Trial Period")) { + z2 = true; + if (!str6.equalsIgnoreCase("FALSE")) { + Log.e(TAG, "License Validation Failed: Limited Time Expired"); + return 50; + } + } + String mdn = getMDN(); + String meid = getMEID(); + if (!str3.equalsIgnoreCase(mdn)) { + Log.e(TAG, "License Validation Failed: MDN from license (" + str3 + ") does not match MDN of device (" + mdn + ")"); + return 50; + } + if (str2.equals(EMA_ODP_IDENTIFIER)) { + if (str4 != null && !str4.equalsIgnoreCase(meid)) { + Log.e(TAG, "License Validation Failed: MEID from license (" + str4 + ") does not match MEID of device (" + meid + ")"); + return 50; + } else if (str10 != null && !str10.equalsIgnoreCase(meid)) { + Log.e(TAG, "License Validation Failed: UniqueDeviceId from license (" + str4 + ") does not match MEID of device (" + meid + ")"); + return 50; + } + } + if (str != null && !str8.equalsIgnoreCase(str)) { + Log.e(TAG, "License Validation Failed: Keyword from license (" + str8 + ") does not match keyword (" + str + ")"); + return 50; + } else if (z) { + Log.e(TAG, "License Validation Failed: The app is 'Remote Blocked'"); + return 50; + } else { + long bestCurrentTime = getBestCurrentTime(); + if (bestCurrentTime < j) { + Log.e(TAG, "License Validation Failed: CurrentTime < LastIssueTime. CurrentTime: " + bestCurrentTime + ", LastIssueTime: " + j); + return 50; + } else if (bestCurrentTime < j3) { + Log.e(TAG, "License Validation Failed: CurrentTime < PurchaseDate. CurrentTime: " + bestCurrentTime + ", PurchaseDate: " + j3); + return 50; + } else if (bestCurrentTime > j2) { + Log.e(TAG, "License Validation Failed: CurrentTime > NextCheckTime. CurrentTime: " + bestCurrentTime + ", NextCheckTime: " + j2); + return 50; + } else if (z2) { + Log.e(TAG, "License Validation OK: LICENSE_TRIAL_OK"); + return 1; + } else { + Log.i(TAG, "License Validation OK: LICENSE_OK"); + return 0; + } + } + } + + /* access modifiers changed from: protected */ + public LicenseAuthenticator.CheckLicenseResult checkLicenseInternal(String str, String str2, String str3, String str4, boolean z, LicenseAuthenticator.CheckLicenseResult checkLicenseResult) { + byte[] bArr = null; + int initLicenseService = initLicenseService(str, str2); + if (initLicenseService == -1) { + initLicenseService = 106; + try { + long time = new Date().getTime(); + if (!z || str != EMA_ODP_IDENTIFIER) { + Log.d(TAG, "Calling getLicense() with: keyword=" + str3); + bArr = this.licenseService.getLicense(str3); + } else { + Log.d(TAG, "Calling getRemoteLicense() with: keyword=" + str3 + ", isRemoteLockEnabled=" + z); + bArr = this.licenseService.getRemoteLicense(str3, z); + } + Log.d(TAG, "getRemoteLicense() took " + (new Date().getTime() - time) + " milliseconds and returned:" + new String(bArr)); + checkLicenseResult.setLicense(new String(bArr)); + } catch (RemoteException e) { + Log.e("LicenseAuthenticator", "Error fetching license from remote service", e); + initLicenseService = 100; + } + try { + saveNetworkTime(); + initLicenseService = validateLicense(bArr, str3, str4, str); + } catch (RemoteException e2) { + checkLicenseResult.setResult(107); + } catch (Exception e3) { + Log.e("LicenseAuthenticator", "General failure", e3); + } + } + checkLicenseResult.setResult(Integer.valueOf(initLicenseService)); + if (str4 != null) { + try { + this.inAppLicenses = getInAppLicenses(new String(bArr)); + checkLicenseResult.setLicense(this.inAppLicenses.get(this.indexOfInApp)); + } catch (Exception e4) { + Log.e(TAG, "Failed to extract in app specific license", e4); + } + } + return checkLicenseResult; + } + + /* access modifiers changed from: protected */ + public void cleanupDB() { + if (this.db != null) { + this.db.cleanup(); + this.db = null; + } + } + + public List getInAppLicenses(String str) { + int indexOf = str.indexOf(""); + if (indexOf == -1) { + return null; + } + ArrayList arrayList = new ArrayList(); + int i = indexOf; + while (str.indexOf("", i) != -1) { + int indexOf2 = str.indexOf("", i); + int indexOf3 = str.indexOf("", indexOf2); + arrayList.add(str.substring(indexOf2, indexOf3 + 8)); + i = indexOf3; + } + return arrayList; + } + + /* access modifiers changed from: protected */ + /* JADX WARNING: Code restructure failed: missing block: B:33:0x0094, code lost: + r3 = move-exception; + */ + /* JADX WARNING: Code restructure failed: missing block: B:34:0x0095, code lost: + android.util.Log.e("LicenseAuthenticator", "Security error connecting to remote service", r3); + android.util.Log.e("LicenseAuthenticator", "Likely cause: missing service permission. Required permissions:", r3); + android.util.Log.e("LicenseAuthenticator", " android.permission.READ_PHONE_STATE"); + android.util.Log.e("LicenseAuthenticator", " android.permission.START_BACKGROUND_SERVICE"); + android.util.Log.e("LicenseAuthenticator", " com.verizon.vcast.apps.VCAST_APPS_LICENSE_SERVICE"); + android.util.Log.e("LicenseAuthenticator", " com.verizon.vcast.apps.ACCESS_NETWORK_STATE"); + android.util.Log.e("LicenseAuthenticator", " android.permission.INTERNET"); + android.util.Log.e("LicenseAuthenticator", " com.vzw.appstore.android.permission"); + */ + /* JADX WARNING: Code restructure failed: missing block: B:35:0x00d1, code lost: + r0 = move-exception; + */ + /* JADX WARNING: Code restructure failed: missing block: B:36:0x00d2, code lost: + android.util.Log.e("LicenseAuthenticator", "initting license service failed", r0); + */ + /* JADX WARNING: Code restructure failed: missing block: B:46:?, code lost: + return 102; + */ + /* JADX WARNING: Code restructure failed: missing block: B:47:?, code lost: + return 106; + */ + /* JADX WARNING: Failed to process nested try/catch */ + /* JADX WARNING: Removed duplicated region for block: B:33:0x0094 A[ExcHandler: SecurityException (r3v0 'e' java.lang.SecurityException A[CUSTOM_DECLARE]), Splitter:B:8:0x0032] */ + /* Code decompiled incorrectly, please refer to instructions dump. */ + public int initLicenseService(java.lang.String r13, java.lang.String r14) throws java.lang.SecurityException { + /* + // Method dump skipped, instructions count: 234 + */ + throw new UnsupportedOperationException("Method not decompiled: com.verizon.vcast.apps.LicenseAuthenticatorInternal.initLicenseService(java.lang.String, java.lang.String):int"); + } + + /* access modifiers changed from: protected */ + public boolean isEmaKeyword(String str) { + boolean z = str.startsWith(EMA_KEYWORD_PREFIX) && str.split("[_]").length > 2; + Log.i(TAG, "isKeyWord: " + str); + return z; + } + + /* access modifiers changed from: protected */ + public boolean isOdpInstalled(String str) { + boolean z = false; + try { + callingContext.getPackageManager().getApplicationInfo(str, PackageManager.GET_UNINSTALLED_PACKAGES); + z = true; + Log.i(TAG, String.valueOf(str) + " is installed"); + return true; + } catch (PackageManager.NameNotFoundException e) { + Log.w(TAG, String.valueOf(str) + " is not installed"); + return z; + } + } + + /* access modifiers changed from: protected */ + public void saveNetworkTime() throws RemoteException { + long currentTimeMillis = System.currentTimeMillis(); + try { + currentTimeMillis = this.licenseService.getTime(); + } catch (RemoteException e) { + Log.e("LicenseAuthenticator", "Error fetching network time from remote service", e); + } + if (currentTimeMillis == -1) { + Log.e("LicenseAuthenticator", "Failure to fetch network time from CDS servers"); + throw new RemoteException(); + } + long j = 0; + if (this.db == null) { + this.db = new DatabaseHelper(LicenseAuthenticator.callingContext); + } + try { + long savedNetworkTime = getSavedNetworkTime(); + j = currentTimeMillis > savedNetworkTime ? currentTimeMillis : savedNetworkTime; + if (j != savedNetworkTime) { + this.db.deleteAll(); + this.db.insert(Long.toString(j)); + } + } catch (Throwable th) { + Log.e("LicenseAuthenticator", "Error saving network time to Database", th); + } + Log.d("VZWLicense", "saveNetworkTime()=" + Long.toString(j)); + } + + public void shutDownLicenseService() { + Log.i(TAG, "shutDownLicenseService()"); + cleanupDB(); + try { + if (this.licenseServiceConnection != null) { + callingContext.unbindService(this.licenseServiceConnection); + this.licenseServiceConnection = null; + this.serviceStarted = false; + } + } catch (Exception e) { + Log.e(TAG, "Failed to shutdown license service.", e); + } + } + + /* access modifiers changed from: protected */ + public int validateLicense(byte[] bArr, String str, String str2, String str3) throws SecurityException { + int i; + byte[] bArr2; + byte[] bArr3; + Log.d(TAG, "License XML: [" + new String(bArr) + "]"); + if (bArr.length == 1) { + return getErrorCode(bArr); + } + try { + if (isEmaSource(new String(bArr))) { + i = 1; + bArr2 = new byte[(bArr.length - 172)]; + bArr3 = new byte[EMA_LICENSE_SIGNATURE_LENGTH]; + } else { + i = 0; + bArr2 = new byte[(bArr.length - 128)]; + bArr3 = new byte[128]; + } + System.arraycopy(bArr, 0, bArr2, 0, bArr2.length); + System.arraycopy(bArr, bArr2.length, bArr3, 0, bArr3.length); + if (!isSignatureValid(bArr3, bArr2, i)) { + Log.e(TAG, "License Validation Failed: license signature is not valid"); + return 50; + } + DocumentBuilder newDocumentBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); + InputSource inputSource = new InputSource(); + inputSource.setCharacterStream(new StringReader(new String(bArr2))); + NodeList elementsByTagName = newDocumentBuilder.parse(inputSource).getElementsByTagName("License"); + if (elementsByTagName == null) { + Log.e(TAG, "License Validation Failed: License element not found in license xml."); + return 50; + } else if (str2 == null) { + return validateLicense(elementsByTagName.item(0), str, str3); + } else { + Node item = elementsByTagName.item(0); + if (item == null) { + Log.e(TAG, "License Validation Failed: License element not found in license xml."); + return 50; + } + List childByName = getChildByName(item, "InAppList"); + if (childByName == null || childByName.size() == 0) { + Log.e(TAG, "License Validation Failed: InAppList element not found in license xml."); + return 50; + } + List childByName2 = getChildByName(childByName.get(0), "InApp"); + for (int i2 = 0; i2 < childByName2.size(); i2++) { + List childByName3 = getChildByName(childByName2.get(i2), "InAppSKU"); + if (childByName3.size() != 0 && childByName3.get(0).getFirstChild().getNodeValue().equals(str2)) { + this.indexOfInApp = i2; + return validateLicense(childByName2.get(i2), null, str3); + } + } + Log.e(TAG, "License Validation Failed: General failure"); + return 50; + } + } catch (SecurityException e) { + Log.e("LicenseAuthenticator", "Security error connecting to remote service", e); + Log.e("LicenseAuthenticator", "Likely cause: missing service permission. Required permissions:", e); + Log.e("LicenseAuthenticator", " android.permission.READ_PHONE_STATE", e); + Log.e("LicenseAuthenticator", " android.permission.START_BACKGROUND_SERVICE", e); + Log.e("LicenseAuthenticator", " com.verizon.vcast.apps.VCAST_APPS_LICENSE_SERVICE", e); + Log.e("LicenseAuthenticator", " com.verizon.vcast.apps.ACCESS_NETWORK_STATE", e); + Log.e("LicenseAuthenticator", " android.permission.INTERNET", e); + Log.e("LicenseAuthenticator", " com.vzw.appstore.android.permission", e); + return 102; + } catch (Exception e2) { + Log.e("LicenseAuthenticator", "General failure", e2); + return 106; + } + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/Offer.java b/app/src/main/java/com/verizon/vcast/apps/Offer.java new file mode 100644 index 0000000..e5c5a44 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/Offer.java @@ -0,0 +1,59 @@ +package com.verizon.vcast.apps; + +import android.os.Parcel; +import android.os.Parcelable; + +public class Offer implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + /* class com.verizon.vcast.apps.Offer.AnonymousClass1 */ + + @Override // android.os.Parcelable.Creator + public Offer createFromParcel(Parcel parcel) { + return new Offer(parcel, null); + } + + @Override // android.os.Parcelable.Creator + public Offer[] newArray(int i) { + return new Offer[i]; + } + }; + public float maxPrice; + public float minPrice; + public String offerID; + public String priceLine; + public String priceType; + public String pricingTerms; + + public Offer() { + } + + private Offer(Parcel parcel) { + readFromParcel(parcel); + } + + /* synthetic */ Offer(Parcel parcel, Offer offer) { + this(parcel); + } + + private void readFromParcel(Parcel parcel) { + this.maxPrice = parcel.readFloat(); + this.minPrice = parcel.readFloat(); + this.offerID = parcel.readString(); + this.priceLine = parcel.readString(); + this.priceType = parcel.readString(); + this.pricingTerms = parcel.readString(); + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeFloat(this.maxPrice); + parcel.writeFloat(this.minPrice); + parcel.writeString(this.offerID); + parcel.writeString(this.priceLine); + parcel.writeString(this.priceType); + parcel.writeString(this.pricingTerms); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/Purchase.java b/app/src/main/java/com/verizon/vcast/apps/Purchase.java new file mode 100644 index 0000000..24a7e06 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/Purchase.java @@ -0,0 +1,70 @@ +package com.verizon.vcast.apps; + +import android.os.Parcel; +import android.os.Parcelable; +import java.util.Date; + +public class Purchase implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + /* class com.verizon.vcast.apps.Purchase.AnonymousClass1 */ + + @Override // android.os.Parcelable.Creator + public Purchase createFromParcel(Parcel parcel) { + return new Purchase(parcel, null); + } + + @Override // android.os.Parcelable.Creator + public Purchase[] newArray(int i) { + return new Purchase[i]; + } + }; + public String inAppName; + public Item item; + public float price; + public String priceLine; + public String priceType; + public String pricingTerms; + public Date purchaseDate; + public String purchaseID; + public String sku; + + public Purchase() { + } + + private Purchase(Parcel parcel) { + readFromParcel(parcel); + } + + /* synthetic */ Purchase(Parcel parcel, Purchase purchase) { + this(parcel); + } + + private void readFromParcel(Parcel parcel) { + this.inAppName = parcel.readString(); + this.item = (Item) parcel.readValue(Item.class.getClassLoader()); + this.priceLine = parcel.readString(); + this.priceType = parcel.readString(); + this.pricingTerms = parcel.readString(); + this.purchaseID = parcel.readString(); + this.sku = parcel.readString(); + this.price = parcel.readFloat(); + this.purchaseDate = new Date(); + this.purchaseDate.setTime(parcel.readLong()); + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeString(this.inAppName); + parcel.writeValue(this.item); + parcel.writeString(this.priceLine); + parcel.writeString(this.priceType); + parcel.writeString(this.pricingTerms); + parcel.writeString(this.purchaseID); + parcel.writeString(this.sku); + parcel.writeFloat(this.price); + parcel.writeLong(this.purchaseDate.getTime()); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/PurchaseInAppContentResult.java b/app/src/main/java/com/verizon/vcast/apps/PurchaseInAppContentResult.java new file mode 100644 index 0000000..39b6f7d --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/PurchaseInAppContentResult.java @@ -0,0 +1,46 @@ +package com.verizon.vcast.apps; + +import android.os.Parcel; +import android.os.Parcelable; + +public class PurchaseInAppContentResult implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + /* class com.verizon.vcast.apps.PurchaseInAppContentResult.AnonymousClass1 */ + + @Override // android.os.Parcelable.Creator + public PurchaseInAppContentResult createFromParcel(Parcel parcel) { + return new PurchaseInAppContentResult(parcel); + } + + @Override // android.os.Parcelable.Creator + public PurchaseInAppContentResult[] newArray(int i) { + return new PurchaseInAppContentResult[i]; + } + }; + public String license; + public String purchaseID; + public Integer result; + + public PurchaseInAppContentResult() { + } + + public PurchaseInAppContentResult(Parcel parcel) { + readFromParcel(parcel); + } + + private void readFromParcel(Parcel parcel) { + this.license = parcel.readString(); + this.purchaseID = parcel.readString(); + this.result = Integer.valueOf(parcel.readInt()); + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeString(this.license); + parcel.writeString(this.purchaseID); + parcel.writeInt(this.result.intValue()); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/PurchaseParameters.java b/app/src/main/java/com/verizon/vcast/apps/PurchaseParameters.java new file mode 100644 index 0000000..50c5441 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/PurchaseParameters.java @@ -0,0 +1,67 @@ +package com.verizon.vcast.apps; + +import android.os.Parcel; +import android.os.Parcelable; + +public class PurchaseParameters implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + /* class com.verizon.vcast.apps.PurchaseParameters.AnonymousClass1 */ + + @Override // android.os.Parcelable.Creator + public PurchaseParameters createFromParcel(Parcel parcel) { + return new PurchaseParameters(parcel, null); + } + + @Override // android.os.Parcelable.Creator + public PurchaseParameters[] newArray(int i) { + return new PurchaseParameters[i]; + } + }; + public Integer contentSize; + public String inAppName; + public String offerID; + public float price; + public String priceLine; + public String priceType; + public String pricingTerms; + public String sku; + + public PurchaseParameters() { + this.contentSize = 0; + } + + private PurchaseParameters(Parcel parcel) { + this.contentSize = 0; + readFromParcel(parcel); + } + + /* synthetic */ PurchaseParameters(Parcel parcel, PurchaseParameters purchaseParameters) { + this(parcel); + } + + private void readFromParcel(Parcel parcel) { + this.contentSize = Integer.valueOf(parcel.readInt()); + this.inAppName = parcel.readString(); + this.offerID = parcel.readString(); + this.price = parcel.readFloat(); + this.sku = parcel.readString(); + this.priceType = parcel.readString(); + this.priceLine = parcel.readString(); + this.pricingTerms = parcel.readString(); + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeInt(this.contentSize.intValue()); + parcel.writeString(this.inAppName); + parcel.writeString(this.offerID); + parcel.writeFloat(this.price); + parcel.writeString(this.sku); + parcel.writeString(this.priceType); + parcel.writeString(this.priceLine); + parcel.writeString(this.pricingTerms); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/PurchasedInAppContents.java b/app/src/main/java/com/verizon/vcast/apps/PurchasedInAppContents.java new file mode 100644 index 0000000..61218a0 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/PurchasedInAppContents.java @@ -0,0 +1,54 @@ +package com.verizon.vcast.apps; + +import android.os.Parcel; +import android.os.Parcelable; + +public class PurchasedInAppContents implements Parcelable { + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + /* class com.verizon.vcast.apps.PurchasedInAppContents.AnonymousClass1 */ + + @Override // android.os.Parcelable.Creator + public PurchasedInAppContents createFromParcel(Parcel parcel) { + return new PurchasedInAppContents(parcel, null); + } + + @Override // android.os.Parcelable.Creator + public PurchasedInAppContents[] newArray(int i) { + return new PurchasedInAppContents[i]; + } + }; + public Purchase[] purchases; + public Integer result; + public Integer totalSize; + + public PurchasedInAppContents() { + } + + private PurchasedInAppContents(Parcel parcel) { + readFromParcel(parcel); + } + + /* synthetic */ PurchasedInAppContents(Parcel parcel, PurchasedInAppContents purchasedInAppContents) { + this(parcel); + } + + private void readFromParcel(Parcel parcel) { + this.result = Integer.valueOf(parcel.readInt()); + this.totalSize = Integer.valueOf(parcel.readInt()); + Object[] readArray = parcel.readArray(Purchase.class.getClassLoader()); + this.purchases = new Purchase[readArray.length]; + for (int i = 0; i < readArray.length; i++) { + this.purchases[i] = (Purchase) readArray[i]; + } + } + + public int describeContents() { + return 0; + } + + public void writeToParcel(Parcel parcel, int i) { + parcel.writeInt(this.result.intValue()); + parcel.writeInt(this.totalSize.intValue()); + parcel.writeArray(this.purchases); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/RemoteServiceManager.java b/app/src/main/java/com/verizon/vcast/apps/RemoteServiceManager.java new file mode 100644 index 0000000..9366c26 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/RemoteServiceManager.java @@ -0,0 +1,111 @@ +package com.verizon.vcast.apps; + +import android.content.ComponentName; +import android.content.Context; +import android.content.ServiceConnection; +import android.os.IBinder; +import android.util.Log; + +public class RemoteServiceManager { + public static final int ERROR_CONTENT_HANDLER = 100; + public static final int ERROR_SECURITY = 102; + public static final String TAG = "RemoteServiceManager"; + protected Context callingContext; + private String className; + private volatile Object initLock = new Object(); + private String packageName; + protected volatile IBinder remoteServiceBinder = null; + protected volatile RemoteServiceConnection serviceConnection; + private volatile boolean serviceStarted = false; + + /* access modifiers changed from: package-private */ + public class RemoteServiceConnection implements ServiceConnection { + RemoteServiceConnection() { + } + + public void onServiceConnected(ComponentName componentName, IBinder iBinder) { + RemoteServiceManager.this.remoteServiceBinder = iBinder; + synchronized (RemoteServiceManager.this.initLock) { + RemoteServiceManager.this.initLock.notifyAll(); + } + } + + public void onServiceDisconnected(ComponentName componentName) { + RemoteServiceManager.this.remoteServiceBinder = null; + RemoteServiceManager.this.serviceConnection = null; + synchronized (RemoteServiceManager.this.initLock) { + RemoteServiceManager.this.initLock.notifyAll(); + } + } + } + + public RemoteServiceManager(Context context, String str, String str2) { + this.callingContext = context; + this.packageName = str; + this.className = str2; + } + + public IBinder getServiceBinder() { + return this.remoteServiceBinder; + } + + /* access modifiers changed from: protected */ + /* JADX WARNING: Code restructure failed: missing block: B:21:0x0077, code lost: + r3 = move-exception; + */ + /* JADX WARNING: Code restructure failed: missing block: B:22:0x0078, code lost: + throw r3; + */ + /* JADX WARNING: Code restructure failed: missing block: B:25:0x0082, code lost: + r0 = move-exception; + */ + /* JADX WARNING: Code restructure failed: missing block: B:26:0x0083, code lost: + android.util.Log.e(com.verizon.vcast.apps.RemoteServiceManager.TAG, "initializing remote service failed", r0); + */ + /* JADX WARNING: Code restructure failed: missing block: B:30:?, code lost: + return; + */ + /* JADX WARNING: Failed to process nested try/catch */ + /* JADX WARNING: Removed duplicated region for block: B:21:0x0077 A[ExcHandler: SecurityException (r3v0 'e' java.lang.SecurityException A[CUSTOM_DECLARE]), Splitter:B:2:0x0005] */ + /* Code decompiled incorrectly, please refer to instructions dump. */ + public void initRemoteService() throws java.lang.SecurityException { + /* + // Method dump skipped, instructions count: 142 + */ + throw new UnsupportedOperationException("Method not decompiled: com.verizon.vcast.apps.RemoteServiceManager.initRemoteService():void"); + } + + public void shutDownRemoteService(Context context) { + Log.i("LicenseAuthenticator", "shutDownRemoteService()"); + try { + if (this.serviceConnection != null) { + context.unbindService(this.serviceConnection); + this.serviceConnection = null; + } + } catch (Exception e) { + } + } + + public int validateService() { + if (this.remoteServiceBinder == null || this.serviceConnection == null) { + try { + initRemoteService(); + } catch (SecurityException e) { + Log.e(TAG, "Security error connecting to remote service", e); + Log.e(TAG, "Likely cause: missing service permission. Required permissions:"); + Log.e(TAG, " android.permission.READ_PHONE_STATE"); + Log.e(TAG, " android.permission.START_BACKGROUND_SERVICE"); + Log.e(TAG, " com.verizon.vcast.apps.VCAST_IN_APP_SERVICE"); + Log.e(TAG, " com.verizon.vcast.apps.ACCESS_NETWORK_STATE"); + Log.e(TAG, " android.permission.INTERNET"); + Log.e(TAG, " com.vzw.appstore.android.permission"); + return 102; + } + } + if (this.remoteServiceBinder != null && this.serviceConnection != null) { + return 0; + } + Log.e(TAG, "Failure connecting to remote service"); + return 100; + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwAsymBlkCipher.java b/app/src/main/java/com/verizon/vcast/apps/VzwAsymBlkCipher.java new file mode 100644 index 0000000..faa7cb9 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwAsymBlkCipher.java @@ -0,0 +1,12 @@ +package com.verizon.vcast.apps; + +/* access modifiers changed from: package-private */ +public interface VzwAsymBlkCipher { + int getInputBlockSize(); + + int getOutputBlockSize(); + + void init(boolean z, VzwRSAKyParam vzwRSAKyParam); + + byte[] processBlock(byte[] bArr, int i, int i2) throws Exception; +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwBigInt.java b/app/src/main/java/com/verizon/vcast/apps/VzwBigInt.java new file mode 100644 index 0000000..9f76592 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwBigInt.java @@ -0,0 +1,1905 @@ +package com.verizon.vcast.apps; + +import androidx.core.view.MotionEventCompat; +import androidx.customview.widget.ExploreByTouchHelper; +import com.ea.nimble.Global; +import com.google.android.gms.wallet.WalletConstants; +import java.util.Random; +import java.util.Stack; + +/* access modifiers changed from: package-private */ +public class VzwBigInt { + private static final int BITS_PER_BYTE = 8; + private static final int BYTES_PER_INT = 4; + private static final long IMASK = 4294967295L; + public static final VzwBigInt ONE = valueOf(1); + private static final VzwBigInt THREE = valueOf(3); + private static final VzwBigInt TWO = valueOf(2); + private static final int[] ZERO_MAGNITUDE = new int[0]; + public static final VzwBigInt ZERO = new VzwBigInt(0, ZERO_MAGNITUDE); + private static final byte[] bitCounts; + private static final int[][] primeLists = {new int[]{3, 5, 7, 11, 13, 17, 19, 23}, new int[]{29, 31, 37, 41, 43}, new int[]{47, 53, 59, 61, 67}, new int[]{71, 73, 79, 83}, new int[]{89, 97, 101, 103}, new int[]{107, 109, 113, 3}, new int[]{131, 137, 139, 149}, new int[]{151, 157, 163, 167}, new int[]{173, 179, 181, 191}, new int[]{193, 197, 199, 211}, new int[]{223, 227, 229}, new int[]{233, 239, 241}, new int[]{251, 257, 263}, new int[]{269, 271, 277}, new int[]{281, 283, 293}, new int[]{307, 311, 313}, new int[]{317, 331, 337}, new int[]{347, 349, 353}, new int[]{359, 367, 373}, new int[]{379, 383, 389}, new int[]{397, 401, WalletConstants.ERROR_CODE_BUYER_ACCOUNT_ERROR}, new int[]{419, 421, 431}, new int[]{433, 439, 443}, new int[]{449, 457, 461}, new int[]{463, 467, 479}, new int[]{487, 491, 499}, new int[]{503, 509, 521}, new int[]{523, 541, 547}, new int[]{557, 563, 569}, new int[]{571, 577, 587}, new int[]{593, 599, 601}, new int[]{607, 613, 617}, new int[]{619, 631, 641}, new int[]{643, 647, 653}, new int[]{659, 661, 673}, new int[]{677, 683, 691}, new int[]{701, 709, 719}, new int[]{727, 733, 739}, new int[]{743, 751, 757}, new int[]{761, 769, 773}, new int[]{787, 797, 809}, new int[]{811, 821, 823}, new int[]{827, 829, 839}, new int[]{853, 857, 859}, new int[]{863, 877, 881}, new int[]{883, 887, 907}, new int[]{911, 919, 929}, new int[]{937, 941, 947}, new int[]{953, 967, 971}, new int[]{977, 983, 991}, new int[]{997, 1009, 1013}, new int[]{1019, 1021, 1031}}; + private static int[] primeProducts = new int[primeLists.length]; + private static final byte[] rndMask = {-1, Byte.MAX_VALUE, 63, 31, 15, 7, 3, 1}; + private long mQuote; + private int[] magnitude; + private int nBitLength; + private int nBits; + private int sign; + + static { + int[] iArr; + ZERO.nBits = 0; + ZERO.nBitLength = 0; + ONE.nBits = 1; + ONE.nBitLength = 1; + TWO.nBits = 1; + TWO.nBitLength = 2; + for (int i = 0; i < primeLists.length; i++) { + int i2 = 1; + for (int i3 : primeLists[i]) { + i2 *= i3; + } + primeProducts[i] = i2; + } + byte[] bArr = new byte[256]; + bArr[1] = 1; + bArr[2] = 1; + bArr[3] = 2; + bArr[4] = 1; + bArr[5] = 2; + bArr[6] = 2; + bArr[7] = 3; + bArr[8] = 1; + bArr[9] = 2; + bArr[10] = 2; + bArr[11] = 3; + bArr[12] = 2; + bArr[13] = 3; + bArr[14] = 3; + bArr[15] = 4; + bArr[16] = 1; + bArr[17] = 2; + bArr[18] = 2; + bArr[19] = 3; + bArr[20] = 2; + bArr[21] = 3; + bArr[22] = 3; + bArr[23] = 4; + bArr[24] = 2; + bArr[25] = 3; + bArr[26] = 3; + bArr[27] = 4; + bArr[28] = 3; + bArr[29] = 4; + bArr[30] = 4; + bArr[31] = 5; + bArr[32] = 1; + bArr[33] = 2; + bArr[34] = 2; + bArr[35] = 3; + bArr[36] = 2; + bArr[37] = 3; + bArr[38] = 3; + bArr[39] = 4; + bArr[40] = 2; + bArr[41] = 3; + bArr[42] = 3; + bArr[43] = 4; + bArr[44] = 3; + bArr[45] = 4; + bArr[46] = 4; + bArr[47] = 5; + bArr[48] = 2; + bArr[49] = 3; + bArr[50] = 3; + bArr[51] = 4; + bArr[52] = 3; + bArr[53] = 4; + bArr[54] = 4; + bArr[55] = 5; + bArr[56] = 3; + bArr[57] = 4; + bArr[58] = 4; + bArr[59] = 5; + bArr[60] = 4; + bArr[61] = 5; + bArr[62] = 5; + bArr[63] = 6; + bArr[64] = 1; + bArr[65] = 2; + bArr[66] = 2; + bArr[67] = 3; + bArr[68] = 2; + bArr[69] = 3; + bArr[70] = 3; + bArr[71] = 4; + bArr[72] = 2; + bArr[73] = 3; + bArr[74] = 3; + bArr[75] = 4; + bArr[76] = 3; + bArr[77] = 4; + bArr[78] = 4; + bArr[79] = 5; + bArr[80] = 2; + bArr[81] = 3; + bArr[82] = 3; + bArr[83] = 4; + bArr[84] = 3; + bArr[85] = 4; + bArr[86] = 4; + bArr[87] = 5; + bArr[88] = 3; + bArr[89] = 4; + bArr[90] = 4; + bArr[91] = 5; + bArr[92] = 4; + bArr[93] = 5; + bArr[94] = 5; + bArr[95] = 6; + bArr[96] = 2; + bArr[97] = 3; + bArr[98] = 3; + bArr[99] = 4; + bArr[100] = 3; + bArr[101] = 4; + bArr[102] = 4; + bArr[103] = 5; + bArr[104] = 3; + bArr[105] = 4; + bArr[106] = 4; + bArr[107] = 5; + bArr[108] = 4; + bArr[109] = 5; + bArr[110] = 5; + bArr[111] = 6; + bArr[112] = 3; + bArr[113] = 4; + bArr[114] = 4; + bArr[115] = 5; + bArr[116] = 4; + bArr[117] = 5; + bArr[118] = 5; + bArr[119] = 6; + bArr[120] = 4; + bArr[121] = 5; + bArr[122] = 5; + bArr[123] = 6; + bArr[124] = 5; + bArr[125] = 6; + bArr[126] = 6; + bArr[127] = 7; + bArr[128] = 1; + bArr[129] = 2; + bArr[130] = 2; + bArr[131] = 3; + bArr[132] = 2; + bArr[133] = 3; + bArr[134] = 3; + bArr[135] = 4; + bArr[136] = 2; + bArr[137] = 3; + bArr[138] = 3; + bArr[139] = 4; + bArr[140] = 3; + bArr[141] = 4; + bArr[142] = 4; + bArr[143] = 5; + bArr[144] = 2; + bArr[145] = 3; + bArr[146] = 3; + bArr[147] = 4; + bArr[148] = 3; + bArr[149] = 4; + bArr[150] = 4; + bArr[151] = 5; + bArr[152] = 3; + bArr[153] = 4; + bArr[154] = 4; + bArr[155] = 5; + bArr[156] = 4; + bArr[157] = 5; + bArr[158] = 5; + bArr[159] = 6; + bArr[160] = 2; + bArr[161] = 3; + bArr[162] = 3; + bArr[163] = 4; + bArr[164] = 3; + bArr[165] = 4; + bArr[166] = 4; + bArr[167] = 5; + bArr[168] = 3; + bArr[169] = 4; + bArr[170] = 4; + bArr[171] = 5; + bArr[172] = 4; + bArr[173] = 5; + bArr[174] = 5; + bArr[175] = 6; + bArr[176] = 3; + bArr[177] = 4; + bArr[178] = 4; + bArr[179] = 5; + bArr[180] = 4; + bArr[181] = 5; + bArr[182] = 5; + bArr[183] = 6; + bArr[184] = 4; + bArr[185] = 5; + bArr[186] = 5; + bArr[187] = 6; + bArr[188] = 5; + bArr[189] = 6; + bArr[190] = 6; + bArr[191] = 7; + bArr[192] = 2; + bArr[193] = 3; + bArr[194] = 3; + bArr[195] = 4; + bArr[196] = 3; + bArr[197] = 4; + bArr[198] = 4; + bArr[199] = 5; + bArr[200] = 3; + bArr[201] = 4; + bArr[202] = 4; + bArr[203] = 5; + bArr[204] = 4; + bArr[205] = 5; + bArr[206] = 5; + bArr[207] = 6; + bArr[208] = 3; + bArr[209] = 4; + bArr[210] = 4; + bArr[211] = 5; + bArr[212] = 4; + bArr[213] = 5; + bArr[214] = 5; + bArr[215] = 6; + bArr[216] = 4; + bArr[217] = 5; + bArr[218] = 5; + bArr[219] = 6; + bArr[220] = 5; + bArr[221] = 6; + bArr[222] = 6; + bArr[223] = 7; + bArr[224] = 3; + bArr[225] = 4; + bArr[226] = 4; + bArr[227] = 5; + bArr[228] = 4; + bArr[229] = 5; + bArr[230] = 5; + bArr[231] = 6; + bArr[232] = 4; + bArr[233] = 5; + bArr[234] = 5; + bArr[235] = 6; + bArr[236] = 5; + bArr[237] = 6; + bArr[238] = 6; + bArr[239] = 7; + bArr[240] = 4; + bArr[241] = 5; + bArr[242] = 5; + bArr[243] = 6; + bArr[244] = 5; + bArr[245] = 6; + bArr[246] = 6; + bArr[247] = 7; + bArr[248] = 5; + bArr[249] = 6; + bArr[250] = 6; + bArr[251] = 7; + bArr[252] = 6; + bArr[253] = 7; + bArr[254] = 7; + bArr[255] = 8; + bitCounts = bArr; + } + + private VzwBigInt() { + this.nBits = -1; + this.nBitLength = -1; + this.mQuote = -1; + } + + public VzwBigInt(int i, int i2, Random random) throws ArithmeticException { + this.nBits = -1; + this.nBitLength = -1; + this.mQuote = -1; + if (i < 2) { + throw new ArithmeticException("bitLength < 2"); + } + this.sign = 1; + this.nBitLength = i; + if (i == 2) { + this.magnitude = random.nextInt() < 0 ? TWO.magnitude : THREE.magnitude; + return; + } + int i3 = (i + 7) / 8; + int i4 = (i3 * 8) - i; + byte b = rndMask[i4]; + byte[] bArr = new byte[i3]; + while (true) { + nextRndBytes(random, bArr); + bArr[0] = (byte) (bArr[0] & b); + bArr[0] = (byte) (bArr[0] | ((byte) (1 << (7 - i4)))); + int i5 = i3 - 1; + bArr[i5] = (byte) (bArr[i5] | 1); + this.magnitude = makeMagnitude(bArr, 1); + this.nBits = -1; + this.mQuote = -1; + if (i2 < 1 || isProbablePrime(i2)) { + return; + } + if (i > 32) { + for (int i6 = 0; i6 < 10000; i6++) { + int nextInt = ((random.nextInt() >>> 1) % (i - 2)) + 33; + int[] iArr = this.magnitude; + int length = this.magnitude.length - (nextInt >>> 5); + iArr[length] = iArr[length] ^ (1 << (nextInt & 31)); + int[] iArr2 = this.magnitude; + int length2 = this.magnitude.length - 1; + iArr2[length2] = iArr2[length2] ^ (random.nextInt() << 1); + this.mQuote = -1; + if (isProbablePrime(i2)) { + return; + } + } + continue; + } + } + } + + public VzwBigInt(int i, Random random) throws IllegalArgumentException { + int i2 = 0; + this.nBits = -1; + this.nBitLength = -1; + this.mQuote = -1; + if (i < 0) { + throw new IllegalArgumentException("numBits must be non-negative"); + } + this.nBits = -1; + this.nBitLength = -1; + if (i == 0) { + this.magnitude = ZERO_MAGNITUDE; + return; + } + int i3 = (i + 7) / 8; + byte[] bArr = new byte[i3]; + nextRndBytes(random, bArr); + bArr[0] = (byte) (bArr[0] & rndMask[(i3 * 8) - i]); + this.magnitude = makeMagnitude(bArr, 1); + this.sign = this.magnitude.length >= 1 ? 1 : i2; + } + + public VzwBigInt(int i, byte[] bArr) throws NumberFormatException { + this.nBits = -1; + this.nBitLength = -1; + this.mQuote = -1; + if (i < -1 || i > 1) { + throw new NumberFormatException("Invalid sign value"); + } else if (i == 0) { + this.sign = 0; + this.magnitude = new int[0]; + } else { + this.magnitude = makeMagnitude(bArr, 1); + this.sign = i; + } + } + + private VzwBigInt(int i, int[] iArr) { + this.nBits = -1; + this.nBitLength = -1; + this.mQuote = -1; + if (iArr.length > 0) { + this.sign = i; + int i2 = 0; + while (i2 < iArr.length && iArr[i2] == 0) { + i2++; + } + if (i2 == 0) { + this.magnitude = iArr; + return; + } + int[] iArr2 = new int[(iArr.length - i2)]; + System.arraycopy(iArr, i2, iArr2, 0, iArr2.length); + this.magnitude = iArr2; + if (iArr2.length == 0) { + this.sign = 0; + return; + } + return; + } + this.magnitude = iArr; + this.sign = 0; + } + + public VzwBigInt(String str) throws NumberFormatException { + this(str, 10); + } + + public VzwBigInt(String str, int i) throws NumberFormatException { + this.nBits = -1; + this.nBitLength = -1; + this.mQuote = -1; + if (str.length() == 0) { + throw new NumberFormatException("Zero length BigInteger"); + } else if (i < 2 || i > 36) { + throw new NumberFormatException("Radix out of range"); + } else { + int i2 = 0; + this.sign = 1; + if (str.charAt(0) == '-') { + if (str.length() == 1) { + throw new NumberFormatException("Zero length BigInteger"); + } + this.sign = -1; + i2 = 1; + } + while (i2 < str.length() && Character.digit(str.charAt(i2), i) == 0) { + i2++; + } + if (i2 >= str.length()) { + this.sign = 0; + this.magnitude = new int[0]; + return; + } + VzwBigInt vzwBigInt = ZERO; + VzwBigInt valueOf = valueOf((long) i); + while (i2 < str.length()) { + vzwBigInt = vzwBigInt.multiply(valueOf).add(valueOf((long) Character.digit(str.charAt(i2), i))); + i2++; + } + this.magnitude = vzwBigInt.magnitude; + } + } + + public VzwBigInt(byte[] bArr) throws NumberFormatException { + this.nBits = -1; + this.nBitLength = -1; + this.mQuote = -1; + if (bArr.length == 0) { + throw new NumberFormatException("Zero length BigInteger"); + } + this.sign = 1; + if (bArr[0] < 0) { + this.sign = -1; + } + this.magnitude = makeMagnitude(bArr, this.sign); + if (this.magnitude.length == 0) { + this.sign = 0; + } + } + + private long _extEuclid(long j, long j2, long[] jArr) { + long j3 = 1; + long j4 = j; + long j5 = 0; + long j6 = j2; + while (j6 > 0) { + long j7 = j4 / j6; + long j8 = j3 - (j5 * j7); + j3 = j5; + j5 = j8; + long j9 = j4 - (j6 * j7); + j4 = j6; + j6 = j9; + } + jArr[0] = j3; + jArr[1] = (j4 - (j3 * j)) / j2; + return j4; + } + + private long _modInverse(long j, long j2) throws ArithmeticException { + if (j2 < 0) { + throw new ArithmeticException("Modulus must be positive"); + } + long[] jArr = new long[2]; + if (_extEuclid(j, j2, jArr) != 1) { + throw new ArithmeticException("Numbers not relatively prime."); + } + if (jArr[0] < 0) { + jArr[0] = jArr[0] + j2; + } + return jArr[0]; + } + + private int[] add(int[] iArr, int[] iArr2) { + int length = iArr.length - 1; + long j = 0; + int length2 = iArr2.length - 1; + int i = length; + while (length2 >= 0) { + long j2 = j + (((long) iArr[i]) & IMASK) + (((long) iArr2[length2]) & IMASK); + iArr[i] = (int) j2; + j = j2 >>> 32; + length2--; + i--; + } + while (i >= 0 && j != 0) { + long j3 = j + (((long) iArr[i]) & IMASK); + iArr[i] = (int) j3; + j = j3 >>> 32; + i--; + } + return iArr; + } + + private VzwBigInt addToMagnitude(int[] iArr) { + int[] iArr2; + int[] iArr3; + int i = 1; + if (this.magnitude.length < iArr.length) { + iArr2 = iArr; + iArr3 = this.magnitude; + } else { + iArr2 = this.magnitude; + iArr3 = iArr; + } + int i2 = Integer.MAX_VALUE; + if (iArr2.length == iArr3.length) { + i2 = Integer.MAX_VALUE - iArr3[0]; + } + if (!((iArr2[0] ^ ExploreByTouchHelper.INVALID_ID) >= i2)) { + i = 0; + } + int[] iArr4 = new int[(iArr2.length + i)]; + System.arraycopy(iArr2, 0, iArr4, i, iArr2.length); + return new VzwBigInt(this.sign, add(iArr4, iArr3)); + } + + static int bitLen(int i) { + if (i >= 32768) { + return i < 8388608 ? i < 524288 ? i < 131072 ? i < 65536 ? 16 : 17 : i < 262144 ? 18 : 19 : i < 2097152 ? i < 1048576 ? 20 : 21 : i < 4194304 ? 22 : 23 : i < 134217728 ? i < 33554432 ? i < 16777216 ? 24 : 25 : i < 67108864 ? 26 : 27 : i < 536870912 ? i < 268435456 ? 28 : 29 : i < 1073741824 ? 30 : 31; + } + if (i >= 128) { + return i < 2048 ? i < 512 ? i < 256 ? 8 : 9 : i < 1024 ? 10 : 11 : i < 8192 ? i < 4096 ? 12 : 13 : i < 16384 ? 14 : 15; + } + if (i >= 8) { + return i < 32 ? i < 16 ? 4 : 5 : i < 64 ? 6 : 7; + } + if (i >= 2) { + return i < 4 ? 2 : 3; + } + if (i < 1) { + return i < 0 ? 32 : 0; + } + return 1; + } + + private int bitLength(int i, int[] iArr) { + int i2 = 1; + if (iArr.length == 0) { + return 0; + } + while (i != iArr.length && iArr[i] == 0) { + i++; + } + if (i == iArr.length) { + return 0; + } + int length = (((iArr.length - i) - 1) * 32) + bitLen(iArr[i]); + if (this.sign < 0) { + boolean z = ((bitCounts[iArr[i] & MotionEventCompat.ACTION_MASK] + bitCounts[(iArr[i] >> 8) & MotionEventCompat.ACTION_MASK]) + bitCounts[(iArr[i] >> 16) & MotionEventCompat.ACTION_MASK]) + bitCounts[(iArr[i] >> 24) & MotionEventCompat.ACTION_MASK] == 1; + for (int i3 = i + 1; i3 < iArr.length && z; i3++) { + z = iArr[i3] == 0; + } + if (!z) { + i2 = 0; + } + length -= i2; + } + return length; + } + + private int compareNoLeadingZeroes(int i, int[] iArr, int i2, int[] iArr2) { + int i3 = -1; + int length = (iArr.length - iArr2.length) - (i - i2); + if (length != 0) { + return length < 0 ? -1 : 1; + } + while (i < iArr.length) { + int i4 = i + 1; + int i5 = iArr[i]; + int i6 = i2 + 1; + int i7 = iArr2[i2]; + if (i5 != i7) { + if ((i5 ^ ExploreByTouchHelper.INVALID_ID) >= (i7 ^ ExploreByTouchHelper.INVALID_ID)) { + i3 = 1; + } + return i3; + } + i2 = i6; + i = i4; + } + return 0; + } + + private int compareTo(int i, int[] iArr, int i2, int[] iArr2) { + while (i != iArr.length && iArr[i] == 0) { + i++; + } + while (i2 != iArr2.length && iArr2[i2] == 0) { + i2++; + } + return compareNoLeadingZeroes(i, iArr, i2, iArr2); + } + + private int[] divide(int[] iArr, int[] iArr2) { + int[] iArr3; + int[] iArr4; + int compareTo; + int compareTo2 = compareTo(0, iArr, 0, iArr2); + if (compareTo2 > 0) { + int bitLength = bitLength(0, iArr) - bitLength(0, iArr2); + if (bitLength > 1) { + iArr3 = shiftLeft(iArr2, bitLength - 1); + iArr4 = shiftLeft(ONE.magnitude, bitLength - 1); + if (bitLength % 32 == 0) { + int[] iArr5 = new int[((bitLength / 32) + 1)]; + System.arraycopy(iArr4, 0, iArr5, 1, iArr5.length - 1); + iArr5[0] = 0; + iArr4 = iArr5; + } + } else { + iArr3 = new int[iArr.length]; + System.arraycopy(iArr2, 0, iArr3, iArr3.length - iArr2.length, iArr2.length); + iArr4 = new int[]{1}; + } + int[] iArr6 = new int[iArr4.length]; + subtract(0, iArr, 0, iArr3); + System.arraycopy(iArr4, 0, iArr6, 0, iArr4.length); + int i = 0; + int i2 = 0; + int i3 = 0; + while (true) { + int compareTo3 = compareTo(i, iArr, i2, iArr3); + while (compareTo3 >= 0) { + subtract(i, iArr, i2, iArr3); + add(iArr4, iArr6); + compareTo3 = compareTo(i, iArr, i2, iArr3); + } + compareTo = compareTo(i, iArr, 0, iArr2); + if (compareTo <= 0) { + break; + } + if (iArr[i] == 0) { + i++; + } + int bitLength2 = bitLength(i2, iArr3) - bitLength(i, iArr); + if (bitLength2 == 0) { + shiftRightOneInPlace(i2, iArr3); + shiftRightOneInPlace(i3, iArr6); + } else { + shiftRightInPlace(i2, iArr3, bitLength2); + shiftRightInPlace(i3, iArr6, bitLength2); + } + if (iArr3[i2] == 0) { + i2++; + } + if (iArr6[i3] == 0) { + i3++; + } + } + if (compareTo != 0) { + return iArr4; + } + add(iArr4, ONE.magnitude); + for (int i4 = i; i4 != iArr.length; i4++) { + iArr[i4] = 0; + } + return iArr4; + } else if (compareTo2 == 0) { + return new int[]{1}; + } else { + return new int[]{0}; + } + } + + private static VzwBigInt extEuclid(VzwBigInt vzwBigInt, VzwBigInt vzwBigInt2, VzwBigInt vzwBigInt3, VzwBigInt vzwBigInt4) { + VzwBigInt vzwBigInt5 = ONE; + VzwBigInt vzwBigInt6 = vzwBigInt; + VzwBigInt vzwBigInt7 = ZERO; + VzwBigInt vzwBigInt8 = vzwBigInt2; + while (vzwBigInt8.sign > 0) { + VzwBigInt[] divideAndRemainder = vzwBigInt6.divideAndRemainder(vzwBigInt8); + VzwBigInt subtract = vzwBigInt5.subtract(vzwBigInt7.multiply(divideAndRemainder[0])); + vzwBigInt5 = vzwBigInt7; + vzwBigInt7 = subtract; + vzwBigInt6 = vzwBigInt8; + vzwBigInt8 = divideAndRemainder[1]; + } + if (vzwBigInt3 != null) { + vzwBigInt3.sign = vzwBigInt5.sign; + vzwBigInt3.magnitude = vzwBigInt5.magnitude; + } + if (vzwBigInt4 != null) { + VzwBigInt divide = vzwBigInt6.subtract(vzwBigInt5.multiply(vzwBigInt)).divide(vzwBigInt2); + vzwBigInt4.sign = divide.sign; + vzwBigInt4.magnitude = divide.magnitude; + } + return vzwBigInt6; + } + + private VzwBigInt flipExistingBit(int i) { + int[] iArr = new int[this.magnitude.length]; + System.arraycopy(this.magnitude, 0, iArr, 0, iArr.length); + int length = (iArr.length - 1) - (i >>> 5); + iArr[length] = iArr[length] ^ (1 << (i & 31)); + return new VzwBigInt(this.sign, iArr); + } + + private long getMQuote() { + if (this.mQuote != -1) { + return this.mQuote; + } + if ((this.magnitude[this.magnitude.length - 1] & 1) == 0) { + return -1; + } + this.mQuote = _modInverse(((long) ((this.magnitude[this.magnitude.length - 1] ^ -1) | 1)) & IMASK, 4294967296L); + return this.mQuote; + } + + private int[] inc(int[] iArr) { + int length = iArr.length - 1; + long j = (((long) iArr[length]) & IMASK) + 1; + iArr[length] = (int) j; + long j2 = j >>> 32; + for (int i = length - 1; i >= 0 && j2 != 0; i--) { + long j3 = j2 + (((long) iArr[i]) & IMASK); + iArr[i] = (int) j3; + j2 = j3 >>> 32; + } + return iArr; + } + + private int[] lastNBits(int i) { + if (i < 1) { + return ZERO_MAGNITUDE; + } + int min = Math.min((i + 31) / 32, this.magnitude.length); + int[] iArr = new int[min]; + System.arraycopy(this.magnitude, this.magnitude.length - min, iArr, 0, min); + int i2 = i % 32; + if (i2 == 0) { + return iArr; + } + iArr[0] = iArr[0] & ((-1 << i2) ^ -1); + return iArr; + } + + private int[] makeMagnitude(byte[] bArr, int i) { + if (i >= 0) { + int i2 = 0; + while (i2 < bArr.length && bArr[i2] == 0) { + i2++; + } + if (i2 >= bArr.length) { + return new int[0]; + } + int length = ((bArr.length - i2) + 3) / 4; + int length2 = (bArr.length - i2) % 4; + if (length2 == 0) { + length2 = 4; + } + int[] iArr = new int[length]; + int i3 = 0; + int i4 = 0; + for (int i5 = i2; i5 < bArr.length; i5++) { + i3 = (i3 << 8) | (bArr[i5] & 255); + length2--; + if (length2 <= 0) { + iArr[i4] = i3; + i4++; + length2 = 4; + i3 = 0; + } + } + return iArr; + } + int i6 = 0; + while (i6 < bArr.length - 1 && bArr[i6] == 255) { + i6++; + } + int length3 = bArr.length; + boolean z = false; + if (bArr[i6] == 128) { + int i7 = i6 + 1; + while (i7 < bArr.length && bArr[i7] == 0) { + i7++; + } + if (i7 == bArr.length) { + length3++; + z = true; + } + } + int i8 = ((length3 - i6) + 3) / 4; + int i9 = (length3 - i6) % 4; + if (i9 == 0) { + i9 = 4; + } + int[] iArr2 = new int[i8]; + int i10 = 0; + int i11 = 0; + if (z && i9 - 1 <= 0) { + i11 = 0 + 1; + i9 = 4; + } + for (int i12 = i6; i12 < bArr.length; i12++) { + i10 = (i10 << 8) | ((bArr[i12] ^ -1) & MotionEventCompat.ACTION_MASK); + i9--; + if (i9 <= 0) { + iArr2[i11] = i10; + i11++; + i9 = 4; + i10 = 0; + } + } + int[] inc = inc(iArr2); + if (inc[0] != 0) { + return inc; + } + int[] iArr3 = new int[(inc.length - 1)]; + System.arraycopy(inc, 1, iArr3, 0, iArr3.length); + return iArr3; + } + + private int[] multiply(int[] iArr, int[] iArr2, int[] iArr3) { + long j; + int length = iArr3.length; + if (length >= 1) { + int length2 = iArr.length - iArr2.length; + while (true) { + length--; + long j2 = ((long) iArr3[length]) & IMASK; + j = 0; + for (int length3 = iArr2.length - 1; length3 >= 0; length3--) { + long j3 = j + ((((long) iArr2[length3]) & IMASK) * j2) + (((long) iArr[length2 + length3]) & IMASK); + iArr[length2 + length3] = (int) j3; + j = j3 >>> 32; + } + length2--; + if (length < 1) { + break; + } + iArr[length2] = (int) j; + } + if (length2 >= 0) { + iArr[length2] = (int) j; + } + } + return iArr; + } + + private void multiplyMonty(int[] iArr, int[] iArr2, int[] iArr3, int[] iArr4, long j) { + int length = iArr4.length; + int i = length - 1; + long j2 = ((long) iArr3[length - 1]) & IMASK; + for (int i2 = 0; i2 <= length; i2++) { + iArr[i2] = 0; + } + for (int i3 = length; i3 > 0; i3--) { + long j3 = ((long) iArr2[i3 - 1]) & IMASK; + long j4 = ((((((long) iArr[length]) & IMASK) + ((j3 * j2) & IMASK)) & IMASK) * j) & IMASK; + long j5 = j3 * j2; + long j6 = j4 * (((long) iArr4[length - 1]) & IMASK); + long j7 = (j5 >>> 32) + (j6 >>> 32) + ((((((long) iArr[length]) & IMASK) + (IMASK & j5)) + (IMASK & j6)) >>> 32); + for (int i4 = i; i4 > 0; i4--) { + long j8 = j3 * (((long) iArr3[i4 - 1]) & IMASK); + long j9 = j4 * (((long) iArr4[i4 - 1]) & IMASK); + long j10 = (((long) iArr[i4]) & IMASK) + (IMASK & j8) + (IMASK & j9) + (IMASK & j7); + j7 = (j7 >>> 32) + (j8 >>> 32) + (j9 >>> 32) + (j10 >>> 32); + iArr[i4 + 1] = (int) j10; + } + long j11 = j7 + (((long) iArr[0]) & IMASK); + iArr[1] = (int) j11; + iArr[0] = (int) (j11 >>> 32); + } + if (compareTo(0, iArr, 0, iArr4) >= 0) { + subtract(0, iArr, 0, iArr4); + } + System.arraycopy(iArr, 1, iArr2, 0, length); + } + + private void nextRndBytes(Random random, byte[] bArr) { + int length = bArr.length; + int i = 0; + int i2 = 0; + while (true) { + int i3 = 0; + while (i3 < 4) { + if (i != length) { + i2 = i3 == 0 ? random.nextInt() : i2 >> 8; + i++; + bArr[i] = (byte) i2; + i3++; + } else { + return; + } + } + i = i; + } + } + + public static VzwBigInt probablePrime(int i, Random random) { + return new VzwBigInt(i, 100, random); + } + + private boolean quickPow2Check() { + return this.sign > 0 && this.nBits == 1; + } + + private int remainder(int i) { + long j = 0; + for (int i2 = 0; i2 < this.magnitude.length; i2++) { + j = ((j << 32) | (((long) this.magnitude[i2]) & IMASK)) % ((long) i); + } + return (int) j; + } + + private int[] remainder(int[] iArr, int[] iArr2) { + int[] iArr3; + int i = 0; + while (i < iArr.length && iArr[i] == 0) { + i++; + } + int i2 = 0; + while (i2 < iArr2.length && iArr2[i2] == 0) { + i2++; + } + int compareNoLeadingZeroes = compareNoLeadingZeroes(i, iArr, i2, iArr2); + if (compareNoLeadingZeroes > 0) { + int bitLength = bitLength(i2, iArr2); + int bitLength2 = bitLength(i, iArr); + int i3 = bitLength2 - bitLength; + int i4 = 0; + int i5 = bitLength; + if (i3 > 0) { + iArr3 = shiftLeft(iArr2, i3); + i5 += i3; + } else { + int length = iArr2.length - i2; + iArr3 = new int[length]; + System.arraycopy(iArr2, i2, iArr3, 0, length); + } + loop2: + while (true) { + if (i5 < bitLength2 || compareNoLeadingZeroes(i, iArr, i4, iArr3) >= 0) { + subtract(i, iArr, i4, iArr3); + while (true) { + if (iArr[i] == 0) { + i++; + if (i == iArr.length) { + break loop2; + } + } else { + compareNoLeadingZeroes = compareNoLeadingZeroes(i, iArr, i2, iArr2); + if (compareNoLeadingZeroes <= 0) { + break; + } + bitLength2 = (((iArr.length - i) - 1) * 32) + bitLen(iArr[i]); + } + } + } + int i6 = i5 - bitLength2; + if (i6 < 2) { + shiftRightOneInPlace(i4, iArr3); + i5--; + } else { + shiftRightInPlace(i4, iArr3, i6); + i5 -= i6; + } + while (iArr3[i4] == 0) { + i4++; + } + } + } + if (compareNoLeadingZeroes == 0) { + for (int i7 = i; i7 < iArr.length; i7++) { + iArr[i7] = 0; + } + } + return iArr; + } + + private int[] shiftLeft(int[] iArr, int i) { + int[] iArr2; + int i2 = i >>> 5; + int i3 = i & 31; + int length = iArr.length; + if (i3 == 0) { + int[] iArr3 = new int[(length + i2)]; + System.arraycopy(iArr, 0, iArr3, 0, length); + return iArr3; + } + int i4 = 0; + int i5 = 32 - i3; + int i6 = iArr[0] >>> i5; + if (i6 != 0) { + iArr2 = new int[(length + i2 + 1)]; + iArr2[0] = i6; + i4 = 0 + 1; + } else { + iArr2 = new int[(length + i2)]; + } + int i7 = iArr[0]; + for (int i8 = 0; i8 < length - 1; i8++) { + int i9 = iArr[i8 + 1]; + i4++; + iArr2[i4] = (i7 << i3) | (i9 >>> i5); + i7 = i9; + } + iArr2[i4] = iArr[length - 1] << i3; + return iArr2; + } + + private static void shiftRightInPlace(int i, int[] iArr, int i2) { + int i3 = (i2 >>> 5) + i; + int i4 = i2 & 31; + int length = iArr.length - 1; + if (i3 != i) { + int i5 = i3 - i; + for (int i6 = length; i6 >= i3; i6--) { + iArr[i6] = iArr[i6 - i5]; + } + for (int i7 = i3 - 1; i7 >= i; i7--) { + iArr[i7] = 0; + } + } + if (i4 != 0) { + int i8 = 32 - i4; + int i9 = iArr[length]; + for (int i10 = length; i10 >= i3 + 1; i10--) { + int i11 = iArr[i10 - 1]; + iArr[i10] = (i9 >>> i4) | (i11 << i8); + i9 = i11; + } + iArr[i3] = iArr[i3] >>> i4; + } + } + + private static void shiftRightOneInPlace(int i, int[] iArr) { + int length = iArr.length - 1; + int i2 = iArr[length]; + for (int i3 = length; i3 > i; i3--) { + int i4 = iArr[i3 - 1]; + iArr[i3] = (i2 >>> 1) | (i4 << 31); + i2 = i4; + } + iArr[i] = iArr[i] >>> 1; + } + + private int[] square(int[] iArr, int[] iArr2) { + int length = iArr.length - 1; + for (int length2 = iArr2.length - 1; length2 != 0; length2--) { + long j = ((long) iArr2[length2]) & IMASK; + long j2 = j * j; + long j3 = j2 >>> 32; + long j4 = (j2 & IMASK) + (((long) iArr[length]) & IMASK); + iArr[length] = (int) j4; + long j5 = j3 + (j4 >> 32); + for (int i = length2 - 1; i >= 0; i--) { + length--; + long j6 = (((long) iArr2[i]) & IMASK) * j; + long j7 = j6 >>> 31; + long j8 = ((2147483647L & j6) << 1) + (((long) iArr[length]) & IMASK) + j5; + iArr[length] = (int) j8; + j5 = j7 + (j8 >>> 32); + } + int i2 = length - 1; + long j9 = j5 + (((long) iArr[i2]) & IMASK); + iArr[i2] = (int) j9; + int i3 = i2 - 1; + if (i3 >= 0) { + iArr[i3] = (int) (j9 >> 32); + } + length = i3 + length2; + } + long j10 = ((long) iArr2[0]) & IMASK; + long j11 = j10 * j10; + long j12 = j11 >>> 32; + long j13 = (j11 & IMASK) + (((long) iArr[length]) & IMASK); + iArr[length] = (int) j13; + int i4 = length - 1; + if (i4 >= 0) { + iArr[i4] = (int) ((j13 >> 32) + j12 + ((long) iArr[i4])); + } + return iArr; + } + + private int[] subtract(int i, int[] iArr, int i2, int[] iArr2) { + int i3; + int length = iArr.length; + int length2 = iArr2.length; + int i4 = 0; + do { + length--; + length2--; + long j = ((((long) iArr[length]) & IMASK) - (((long) iArr2[length2]) & IMASK)) + ((long) i4); + iArr[length] = (int) j; + i4 = (int) (j >> 63); + } while (length2 > i2); + if (i4 != 0) { + do { + length--; + i3 = iArr[length] - 1; + iArr[length] = i3; + } while (i3 == -1); + } + return iArr; + } + + public static VzwBigInt valueOf(long j) { + if (j == 0) { + return ZERO; + } + if (j < 0) { + return j == Long.MIN_VALUE ? valueOf(-1 ^ j).not() : valueOf(-j).negate(); + } + byte[] bArr = new byte[8]; + for (int i = 0; i < 8; i++) { + bArr[7 - i] = (byte) ((int) j); + j >>= 8; + } + return new VzwBigInt(bArr); + } + + private void zero(int[] iArr) { + for (int i = 0; i != iArr.length; i++) { + iArr[i] = 0; + } + } + + public VzwBigInt abs() { + return this.sign >= 0 ? this : negate(); + } + + public VzwBigInt add(VzwBigInt vzwBigInt) throws ArithmeticException { + if (vzwBigInt.sign == 0 || vzwBigInt.magnitude.length == 0) { + return this; + } + if (this.sign == 0 || this.magnitude.length == 0) { + return vzwBigInt; + } + if (vzwBigInt.sign < 0) { + if (this.sign > 0) { + return subtract(vzwBigInt.negate()); + } + } else if (this.sign < 0) { + return vzwBigInt.subtract(negate()); + } + return addToMagnitude(vzwBigInt.magnitude); + } + + public VzwBigInt and(VzwBigInt vzwBigInt) { + if (this.sign == 0 || vzwBigInt.sign == 0) { + return ZERO; + } + int[] iArr = this.sign > 0 ? this.magnitude : add(ONE).magnitude; + int[] iArr2 = vzwBigInt.sign > 0 ? vzwBigInt.magnitude : vzwBigInt.add(ONE).magnitude; + boolean z = this.sign < 0 && vzwBigInt.sign < 0; + int[] iArr3 = new int[Math.max(iArr.length, iArr2.length)]; + int length = iArr3.length - iArr.length; + int length2 = iArr3.length - iArr2.length; + int i = 0; + while (i < iArr3.length) { + int i2 = i >= length ? iArr[i - length] : 0; + int i3 = i >= length2 ? iArr2[i - length2] : 0; + if (this.sign < 0) { + i2 ^= -1; + } + if (vzwBigInt.sign < 0) { + i3 ^= -1; + } + iArr3[i] = i2 & i3; + if (z) { + iArr3[i] = iArr3[i] ^ -1; + } + i++; + } + VzwBigInt vzwBigInt2 = new VzwBigInt(1, iArr3); + return z ? vzwBigInt2.not() : vzwBigInt2; + } + + public VzwBigInt andNot(VzwBigInt vzwBigInt) { + return and(vzwBigInt.not()); + } + + public int bitCount() { + if (this.nBits == -1) { + if (this.sign < 0) { + this.nBits = not().bitCount(); + } else { + int i = 0; + for (int i2 = 0; i2 < this.magnitude.length; i2++) { + i = i + bitCounts[this.magnitude[i2] & MotionEventCompat.ACTION_MASK] + bitCounts[(this.magnitude[i2] >> 8) & MotionEventCompat.ACTION_MASK] + bitCounts[(this.magnitude[i2] >> 16) & MotionEventCompat.ACTION_MASK] + bitCounts[(this.magnitude[i2] >> 24) & MotionEventCompat.ACTION_MASK]; + } + this.nBits = i; + } + } + return this.nBits; + } + + public int bitLength() { + if (this.nBitLength == -1) { + if (this.sign == 0) { + this.nBitLength = 0; + } else { + this.nBitLength = bitLength(0, this.magnitude); + } + } + return this.nBitLength; + } + + public byte byteValue() { + return (byte) intValue(); + } + + public VzwBigInt clearBit(int i) throws ArithmeticException { + if (i >= 0) { + return !testBit(i) ? this : (this.sign <= 0 || i >= bitLength() + -1) ? andNot(ONE.shiftLeft(i)) : flipExistingBit(i); + } + throw new ArithmeticException("Bit address less than zero"); + } + + public int compareTo(VzwBigInt vzwBigInt) { + if (this.sign < vzwBigInt.sign) { + return -1; + } + if (this.sign > vzwBigInt.sign) { + return 1; + } + if (this.sign == 0) { + return 0; + } + return compareTo(0, this.magnitude, 0, vzwBigInt.magnitude) * this.sign; + } + + public int compareTo(Object obj) { + return compareTo((VzwBigInt) obj); + } + + public VzwBigInt divide(VzwBigInt vzwBigInt) throws ArithmeticException { + if (vzwBigInt.sign == 0) { + throw new ArithmeticException("Divide by zero"); + } else if (this.sign == 0) { + return ZERO; + } else { + if (vzwBigInt.compareTo(ONE) == 0) { + return this; + } + int[] iArr = new int[this.magnitude.length]; + System.arraycopy(this.magnitude, 0, iArr, 0, iArr.length); + return new VzwBigInt(this.sign * vzwBigInt.sign, divide(iArr, vzwBigInt.magnitude)); + } + } + + public VzwBigInt[] divideAndRemainder(VzwBigInt vzwBigInt) throws ArithmeticException { + if (vzwBigInt.sign == 0) { + throw new ArithmeticException("Divide by zero"); + } + VzwBigInt[] vzwBigIntArr = new VzwBigInt[2]; + if (this.sign == 0) { + VzwBigInt vzwBigInt2 = ZERO; + vzwBigIntArr[1] = vzwBigInt2; + vzwBigIntArr[0] = vzwBigInt2; + } else if (vzwBigInt.compareTo(ONE) == 0) { + vzwBigIntArr[0] = this; + vzwBigIntArr[1] = ZERO; + } else { + int[] iArr = new int[this.magnitude.length]; + System.arraycopy(this.magnitude, 0, iArr, 0, iArr.length); + vzwBigIntArr[0] = new VzwBigInt(this.sign * vzwBigInt.sign, divide(iArr, vzwBigInt.magnitude)); + vzwBigIntArr[1] = new VzwBigInt(this.sign, iArr); + } + return vzwBigIntArr; + } + + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof VzwBigInt)) { + return false; + } + VzwBigInt vzwBigInt = (VzwBigInt) obj; + if (!(vzwBigInt.sign == this.sign && vzwBigInt.magnitude.length == this.magnitude.length)) { + return false; + } + for (int i = 0; i < this.magnitude.length; i++) { + if (vzwBigInt.magnitude[i] != this.magnitude[i]) { + return false; + } + } + return true; + } + + public VzwBigInt flipBit(int i) throws ArithmeticException { + if (i >= 0) { + return (this.sign <= 0 || i >= bitLength() + -1) ? xor(ONE.shiftLeft(i)) : flipExistingBit(i); + } + throw new ArithmeticException("Bit address less than zero"); + } + + public VzwBigInt gcd(VzwBigInt vzwBigInt) { + if (vzwBigInt.sign == 0) { + return abs(); + } + if (this.sign == 0) { + return vzwBigInt.abs(); + } + VzwBigInt vzwBigInt2 = this; + VzwBigInt vzwBigInt3 = vzwBigInt; + while (vzwBigInt3.sign != 0) { + VzwBigInt mod = vzwBigInt2.mod(vzwBigInt3); + vzwBigInt2 = vzwBigInt3; + vzwBigInt3 = mod; + } + return vzwBigInt2; + } + + public int getLowestSetBit() { + if (this.sign == 0) { + return -1; + } + int length = this.magnitude.length; + do { + length--; + if (length <= 0) { + break; + } + } while (this.magnitude[length] == 0); + int i = this.magnitude[length]; + int i2 = (65535 & i) == 0 ? (16711680 & i) == 0 ? 7 : 15 : (i & MotionEventCompat.ACTION_MASK) == 0 ? 23 : 31; + while (i2 > 0 && (i << i2) != Integer.MIN_VALUE) { + i2--; + } + return ((this.magnitude.length - length) * 32) - (i2 + 1); + } + + public int hashCode() { + int length = this.magnitude.length; + if (this.magnitude.length > 0) { + length ^= this.magnitude[0]; + if (this.magnitude.length > 1) { + length ^= this.magnitude[this.magnitude.length - 1]; + } + } + return this.sign < 0 ? length ^ -1 : length; + } + + public int intValue() { + if (this.magnitude.length == 0) { + return 0; + } + return this.sign < 0 ? -this.magnitude[this.magnitude.length - 1] : this.magnitude[this.magnitude.length - 1]; + } + + public boolean isProbablePrime(int i) { + if (i <= 0) { + return true; + } + if (this.sign == 0) { + return false; + } + VzwBigInt abs = abs(); + if (!abs.testBit(0)) { + return abs.equals(TWO); + } + if (abs.equals(ONE)) { + return false; + } + int min = Math.min(abs.bitLength() - 1, primeLists.length); + for (int i2 = 0; i2 < min; i2++) { + int remainder = abs.remainder(primeProducts[i2]); + int[] iArr = primeLists[i2]; + for (int i3 = 0; i3 < iArr.length; i3++) { + int i4 = iArr[i3]; + if (remainder % i4 == 0) { + return abs.bitLength() < 16 && abs.intValue() == i4; + } + } + } + VzwBigInt subtract = abs.subtract(ONE); + int lowestSetBit = subtract.getLowestSetBit(); + VzwBigInt shiftRight = subtract.shiftRight(lowestSetBit); + Random random = new Random(); + while (true) { + VzwBigInt vzwBigInt = new VzwBigInt(abs.bitLength(), random); + if (vzwBigInt.compareTo(ONE) > 0 && vzwBigInt.compareTo(subtract) < 0) { + VzwBigInt modPow = vzwBigInt.modPow(shiftRight, abs); + if (!modPow.equals(ONE)) { + int i5 = 0; + while (!modPow.equals(subtract)) { + i5++; + if (i5 == lowestSetBit) { + return false; + } + modPow = modPow.modPow(TWO, abs); + if (modPow.equals(ONE)) { + return false; + } + } + } + i -= 2; + if (i <= 0) { + return true; + } + } + } + } + + public long longValue() { + if (this.magnitude.length == 0) { + return 0; + } + long j = this.magnitude.length > 1 ? (((long) this.magnitude[this.magnitude.length - 2]) << 32) | (((long) this.magnitude[this.magnitude.length - 1]) & IMASK) : ((long) this.magnitude[this.magnitude.length - 1]) & IMASK; + return this.sign < 0 ? -j : j; + } + + public VzwBigInt max(VzwBigInt vzwBigInt) { + return compareTo(vzwBigInt) > 0 ? this : vzwBigInt; + } + + public VzwBigInt min(VzwBigInt vzwBigInt) { + return compareTo(vzwBigInt) < 0 ? this : vzwBigInt; + } + + public VzwBigInt mod(VzwBigInt vzwBigInt) throws ArithmeticException { + if (vzwBigInt.sign <= 0) { + throw new ArithmeticException("BigInteger: modulus is not positive"); + } + VzwBigInt remainder = remainder(vzwBigInt); + return remainder.sign >= 0 ? remainder : remainder.add(vzwBigInt); + } + + public VzwBigInt modInverse(VzwBigInt vzwBigInt) throws ArithmeticException { + if (vzwBigInt.sign != 1) { + throw new ArithmeticException("Modulus must be positive"); + } + VzwBigInt vzwBigInt2 = new VzwBigInt(); + if (extEuclid(this, vzwBigInt, vzwBigInt2, null).equals(ONE)) { + return vzwBigInt2.compareTo(ZERO) < 0 ? vzwBigInt2.add(vzwBigInt) : vzwBigInt2; + } + throw new ArithmeticException("Numbers not relatively prime."); + } + + public VzwBigInt modPow(VzwBigInt vzwBigInt, VzwBigInt vzwBigInt2) throws ArithmeticException { + if (vzwBigInt2.sign < 1) { + throw new ArithmeticException("Modulus must be positive"); + } else if (vzwBigInt2.equals(ONE)) { + return ZERO; + } else { + if (vzwBigInt.sign == 0) { + return ONE; + } + if (this.sign == 0) { + return ZERO; + } + int[] iArr = null; + int[] iArr2 = null; + boolean z = (vzwBigInt2.magnitude[vzwBigInt2.magnitude.length + -1] & 1) == 1; + long j = 0; + if (z) { + j = vzwBigInt2.getMQuote(); + iArr = shiftLeft(vzwBigInt2.magnitude.length * 32).mod(vzwBigInt2).magnitude; + z = iArr.length <= vzwBigInt2.magnitude.length; + if (z) { + iArr2 = new int[(vzwBigInt2.magnitude.length + 1)]; + if (iArr.length < vzwBigInt2.magnitude.length) { + int[] iArr3 = new int[vzwBigInt2.magnitude.length]; + System.arraycopy(iArr, 0, iArr3, iArr3.length - iArr.length, iArr.length); + iArr = iArr3; + } + } + } + if (!z) { + if (this.magnitude.length <= vzwBigInt2.magnitude.length) { + iArr = new int[vzwBigInt2.magnitude.length]; + System.arraycopy(this.magnitude, 0, iArr, iArr.length - this.magnitude.length, this.magnitude.length); + } else { + VzwBigInt remainder = remainder(vzwBigInt2); + iArr = new int[vzwBigInt2.magnitude.length]; + System.arraycopy(remainder.magnitude, 0, iArr, iArr.length - remainder.magnitude.length, remainder.magnitude.length); + } + iArr2 = new int[(vzwBigInt2.magnitude.length * 2)]; + } + int[] iArr4 = new int[vzwBigInt2.magnitude.length]; + for (int i = 0; i < vzwBigInt.magnitude.length; i++) { + int i2 = vzwBigInt.magnitude[i]; + int i3 = 0; + if (i == 0) { + while (i2 > 0) { + i2 <<= 1; + i3++; + } + System.arraycopy(iArr, 0, iArr4, 0, iArr.length); + i2 <<= 1; + i3++; + } + while (i2 != 0) { + if (z) { + multiplyMonty(iArr2, iArr4, iArr4, vzwBigInt2.magnitude, j); + } else { + square(iArr2, iArr4); + remainder(iArr2, vzwBigInt2.magnitude); + System.arraycopy(iArr2, iArr2.length - iArr4.length, iArr4, 0, iArr4.length); + zero(iArr2); + } + i3++; + if (i2 < 0) { + if (z) { + multiplyMonty(iArr2, iArr4, iArr, vzwBigInt2.magnitude, j); + } else { + multiply(iArr2, iArr4, iArr); + remainder(iArr2, vzwBigInt2.magnitude); + System.arraycopy(iArr2, iArr2.length - iArr4.length, iArr4, 0, iArr4.length); + zero(iArr2); + } + } + i2 <<= 1; + } + while (i3 < 32) { + if (z) { + multiplyMonty(iArr2, iArr4, iArr4, vzwBigInt2.magnitude, j); + } else { + square(iArr2, iArr4); + remainder(iArr2, vzwBigInt2.magnitude); + System.arraycopy(iArr2, iArr2.length - iArr4.length, iArr4, 0, iArr4.length); + zero(iArr2); + } + i3++; + } + } + if (z) { + zero(iArr); + iArr[iArr.length - 1] = 1; + multiplyMonty(iArr2, iArr4, iArr, vzwBigInt2.magnitude, j); + } + VzwBigInt vzwBigInt3 = new VzwBigInt(1, iArr4); + return vzwBigInt.sign <= 0 ? vzwBigInt3.modInverse(vzwBigInt2) : vzwBigInt3; + } + } + + public VzwBigInt multiply(VzwBigInt vzwBigInt) { + if (this.sign == 0 || vzwBigInt.sign == 0) { + return ZERO; + } + int[] iArr = new int[(((bitLength() + vzwBigInt.bitLength()) / 32) + 1)]; + if (vzwBigInt == this) { + square(iArr, this.magnitude); + } else { + multiply(iArr, this.magnitude, vzwBigInt.magnitude); + } + return new VzwBigInt(this.sign * vzwBigInt.sign, iArr); + } + + public VzwBigInt negate() { + return this.sign == 0 ? this : new VzwBigInt(-this.sign, this.magnitude); + } + + public VzwBigInt not() { + return add(ONE).negate(); + } + + public VzwBigInt or(VzwBigInt vzwBigInt) { + if (this.sign == 0) { + return vzwBigInt; + } + if (vzwBigInt.sign == 0) { + return this; + } + int[] iArr = this.sign > 0 ? this.magnitude : add(ONE).magnitude; + int[] iArr2 = vzwBigInt.sign > 0 ? vzwBigInt.magnitude : vzwBigInt.add(ONE).magnitude; + boolean z = this.sign < 0 || vzwBigInt.sign < 0; + int[] iArr3 = new int[Math.max(iArr.length, iArr2.length)]; + int length = iArr3.length - iArr.length; + int length2 = iArr3.length - iArr2.length; + int i = 0; + while (i < iArr3.length) { + int i2 = i >= length ? iArr[i - length] : 0; + int i3 = i >= length2 ? iArr2[i - length2] : 0; + if (this.sign < 0) { + i2 ^= -1; + } + if (vzwBigInt.sign < 0) { + i3 ^= -1; + } + iArr3[i] = i2 | i3; + if (z) { + iArr3[i] = iArr3[i] ^ -1; + } + i++; + } + VzwBigInt vzwBigInt2 = new VzwBigInt(1, iArr3); + if (z) { + vzwBigInt2 = vzwBigInt2.not(); + } + return vzwBigInt2; + } + + public VzwBigInt pow(int i) throws ArithmeticException { + if (i < 0) { + throw new ArithmeticException("Negative exponent"); + } else if (this.sign == 0) { + return i == 0 ? ONE : this; + } else { + VzwBigInt vzwBigInt = ONE; + VzwBigInt vzwBigInt2 = this; + while (i != 0) { + if ((i & 1) == 1) { + vzwBigInt = vzwBigInt.multiply(vzwBigInt2); + } + i >>= 1; + if (i != 0) { + vzwBigInt2 = vzwBigInt2.multiply(vzwBigInt2); + } + } + return vzwBigInt; + } + } + + public VzwBigInt remainder(VzwBigInt vzwBigInt) throws ArithmeticException { + int[] remainder; + int i; + if (vzwBigInt.sign == 0) { + throw new ArithmeticException("BigInteger: Divide by zero"); + } else if (this.sign == 0) { + return ZERO; + } else { + if (vzwBigInt.magnitude.length != 1 || (i = vzwBigInt.magnitude[0]) <= 0) { + if (compareTo(0, this.magnitude, 0, vzwBigInt.magnitude) < 0) { + return this; + } + if (vzwBigInt.quickPow2Check()) { + remainder = lastNBits(vzwBigInt.abs().bitLength() - 1); + } else { + int[] iArr = new int[this.magnitude.length]; + System.arraycopy(this.magnitude, 0, iArr, 0, iArr.length); + remainder = remainder(iArr, vzwBigInt.magnitude); + } + return new VzwBigInt(this.sign, remainder); + } else if (i == 1) { + return ZERO; + } else { + int remainder2 = remainder(i); + return remainder2 == 0 ? ZERO : new VzwBigInt(this.sign, new int[]{remainder2}); + } + } + } + + public VzwBigInt setBit(int i) throws ArithmeticException { + if (i >= 0) { + return testBit(i) ? this : (this.sign <= 0 || i >= bitLength() + -1) ? or(ONE.shiftLeft(i)) : flipExistingBit(i); + } + throw new ArithmeticException("Bit address less than zero"); + } + + public VzwBigInt shiftLeft(int i) { + if (this.sign == 0 || this.magnitude.length == 0) { + return ZERO; + } + if (i == 0) { + return this; + } + if (i < 0) { + return shiftRight(-i); + } + VzwBigInt vzwBigInt = new VzwBigInt(this.sign, shiftLeft(this.magnitude, i)); + if (this.nBits != -1) { + vzwBigInt.nBits = this.sign > 0 ? this.nBits : this.nBits + i; + } + if (this.nBitLength != -1) { + vzwBigInt.nBitLength = this.nBitLength + i; + } + return vzwBigInt; + } + + public VzwBigInt shiftRight(int i) { + if (i == 0) { + return this; + } + if (i < 0) { + return shiftLeft(-i); + } + if (i >= bitLength()) { + return this.sign < 0 ? valueOf(-1) : ZERO; + } + int[] iArr = new int[this.magnitude.length]; + System.arraycopy(this.magnitude, 0, iArr, 0, iArr.length); + shiftRightInPlace(0, iArr, i); + return new VzwBigInt(this.sign, iArr); + } + + public int signum() { + return this.sign; + } + + public VzwBigInt subtract(VzwBigInt vzwBigInt) { + VzwBigInt vzwBigInt2; + VzwBigInt vzwBigInt3; + if (vzwBigInt.sign == 0 || vzwBigInt.magnitude.length == 0) { + return this; + } + if (this.sign == 0 || this.magnitude.length == 0) { + return vzwBigInt.negate(); + } + if (this.sign != vzwBigInt.sign) { + return add(vzwBigInt.negate()); + } + int compareTo = compareTo(0, this.magnitude, 0, vzwBigInt.magnitude); + if (compareTo == 0) { + return ZERO; + } + if (compareTo < 0) { + vzwBigInt2 = vzwBigInt; + vzwBigInt3 = this; + } else { + vzwBigInt2 = this; + vzwBigInt3 = vzwBigInt; + } + int[] iArr = new int[vzwBigInt2.magnitude.length]; + System.arraycopy(vzwBigInt2.magnitude, 0, iArr, 0, iArr.length); + return new VzwBigInt(this.sign * compareTo, subtract(0, iArr, 0, vzwBigInt3.magnitude)); + } + + public boolean testBit(int i) throws ArithmeticException { + if (i < 0) { + throw new ArithmeticException("Bit position must not be negative"); + } else if (this.sign < 0) { + return !not().testBit(i); + } else { + int i2 = i / 32; + return i2 < this.magnitude.length && ((this.magnitude[(this.magnitude.length + -1) - i2] >> (i % 32)) & 1) > 0; + } + } + + public byte[] toByteArray() { + if (this.sign == 0) { + return new byte[1]; + } + byte[] bArr = new byte[((bitLength() / 8) + 1)]; + int length = this.magnitude.length; + int length2 = bArr.length; + if (this.sign > 0) { + while (length > 1) { + length--; + int i = this.magnitude[length]; + int i2 = length2 - 1; + bArr[i2] = (byte) i; + int i3 = i2 - 1; + bArr[i3] = (byte) (i >>> 8); + int i4 = i3 - 1; + bArr[i4] = (byte) (i >>> 16); + length2 = i4 - 1; + bArr[length2] = (byte) (i >>> 24); + } + int i5 = this.magnitude[0]; + while ((i5 & -256) != 0) { + length2--; + bArr[length2] = (byte) i5; + i5 >>>= 8; + } + bArr[length2 - 1] = (byte) i5; + return bArr; + } + boolean z = true; + while (length > 1) { + length--; + int i6 = this.magnitude[length] ^ -1; + if (z) { + i6++; + z = i6 == 0; + } + int i7 = length2 - 1; + bArr[i7] = (byte) i6; + int i8 = i7 - 1; + bArr[i8] = (byte) (i6 >>> 8); + int i9 = i8 - 1; + bArr[i9] = (byte) (i6 >>> 16); + length2 = i9 - 1; + bArr[length2] = (byte) (i6 >>> 24); + } + int i10 = this.magnitude[0]; + if (z) { + i10--; + } + while ((i10 & -256) != 0) { + length2--; + bArr[length2] = (byte) (i10 ^ -1); + i10 >>>= 8; + } + int i11 = length2 - 1; + bArr[i11] = (byte) (i10 ^ -1); + if (i11 <= 0) { + return bArr; + } + bArr[i11 - 1] = -1; + return bArr; + } + + public String toString() { + return toString(10); + } + + public String toString(int i) { + if (this.magnitude == null) { + return "null"; + } + if (this.sign == 0) { + return Global.NOTIFICATION_DICTIONARY_RESULT_FAIL; + } + StringBuffer stringBuffer = new StringBuffer(); + if (i == 16) { + for (int i2 = 0; i2 < this.magnitude.length; i2++) { + String str = "0000000" + Integer.toHexString(this.magnitude[i2]); + stringBuffer.append(str.substring(str.length() - 8)); + } + } else if (i == 2) { + stringBuffer.append('1'); + for (int bitLength = bitLength() - 2; bitLength >= 0; bitLength--) { + stringBuffer.append(testBit(bitLength) ? '1' : '0'); + } + } else { + Stack stack = new Stack(); + VzwBigInt vzwBigInt = new VzwBigInt(Integer.toString(i, i), i); + for (VzwBigInt abs = abs(); !abs.equals(ZERO); abs = abs.divide(vzwBigInt)) { + VzwBigInt mod = abs.mod(vzwBigInt); + if (mod.equals(ZERO)) { + stack.push(Global.NOTIFICATION_DICTIONARY_RESULT_FAIL); + } else { + stack.push(Integer.toString(mod.magnitude[0], i)); + } + } + while (!stack.empty()) { + stringBuffer.append((String) stack.pop()); + } + } + String stringBuffer2 = stringBuffer.toString(); + while (stringBuffer2.length() > 1 && stringBuffer2.charAt(0) == '0') { + stringBuffer2 = stringBuffer2.substring(1); + } + return stringBuffer2.length() == 0 ? Global.NOTIFICATION_DICTIONARY_RESULT_FAIL : this.sign == -1 ? "-" + stringBuffer2 : stringBuffer2; + } + + public VzwBigInt xor(VzwBigInt vzwBigInt) { + if (this.sign == 0) { + return vzwBigInt; + } + if (vzwBigInt.sign == 0) { + return this; + } + int[] iArr = this.sign > 0 ? this.magnitude : add(ONE).magnitude; + int[] iArr2 = vzwBigInt.sign > 0 ? vzwBigInt.magnitude : vzwBigInt.add(ONE).magnitude; + boolean z = (this.sign < 0 && vzwBigInt.sign >= 0) || (this.sign >= 0 && vzwBigInt.sign < 0); + int[] iArr3 = new int[Math.max(iArr.length, iArr2.length)]; + int length = iArr3.length - iArr.length; + int length2 = iArr3.length - iArr2.length; + int i = 0; + while (i < iArr3.length) { + int i2 = i >= length ? iArr[i - length] : 0; + int i3 = i >= length2 ? iArr2[i - length2] : 0; + if (this.sign < 0) { + i2 ^= -1; + } + if (vzwBigInt.sign < 0) { + i3 ^= -1; + } + iArr3[i] = i2 ^ i3; + if (z) { + iArr3[i] = iArr3[i] ^ -1; + } + i++; + } + VzwBigInt vzwBigInt2 = new VzwBigInt(1, iArr3); + if (z) { + vzwBigInt2 = vzwBigInt2.not(); + } + return vzwBigInt2; + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwDigest.java b/app/src/main/java/com/verizon/vcast/apps/VzwDigest.java new file mode 100644 index 0000000..12d2d3f --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwDigest.java @@ -0,0 +1,18 @@ +package com.verizon.vcast.apps; + +/* access modifiers changed from: package-private */ +public interface VzwDigest { + int doFinal(byte[] bArr, int i); + + String getAlgorithmName(); + + int getByteLength(); + + int getDigestSize(); + + void reset(); + + void update(byte b); + + void update(byte[] bArr, int i, int i2); +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwGenDigest.java b/app/src/main/java/com/verizon/vcast/apps/VzwGenDigest.java new file mode 100644 index 0000000..0ccddb9 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwGenDigest.java @@ -0,0 +1,87 @@ +package com.verizon.vcast.apps; + +/* access modifiers changed from: package-private */ +public abstract class VzwGenDigest implements VzwDigest { + private static final int BYTE_LENGTH = 64; + private long byteCount; + private byte[] xBuf; + private int xBufOff; + + protected VzwGenDigest() { + this.xBuf = new byte[4]; + this.xBufOff = 0; + } + + protected VzwGenDigest(VzwGenDigest vzwGenDigest) { + this.xBuf = new byte[vzwGenDigest.xBuf.length]; + System.arraycopy(vzwGenDigest.xBuf, 0, this.xBuf, 0, vzwGenDigest.xBuf.length); + this.xBufOff = vzwGenDigest.xBufOff; + this.byteCount = vzwGenDigest.byteCount; + } + + public void finish() { + long j = this.byteCount << 3; + update(Byte.MIN_VALUE); + while (this.xBufOff != 0) { + update((byte) 0); + } + processLength(j); + processBlock(); + } + + @Override // com.verizon.vcast.apps.VzwDigest + public int getByteLength() { + return 64; + } + + /* access modifiers changed from: protected */ + public abstract void processBlock(); + + /* access modifiers changed from: protected */ + public abstract void processLength(long j); + + /* access modifiers changed from: protected */ + public abstract void processWord(byte[] bArr, int i); + + @Override // com.verizon.vcast.apps.VzwDigest + public void reset() { + this.byteCount = 0; + this.xBufOff = 0; + for (int i = 0; i < this.xBuf.length; i++) { + this.xBuf[i] = 0; + } + } + + @Override // com.verizon.vcast.apps.VzwDigest + public void update(byte b) { + byte[] bArr = this.xBuf; + int i = this.xBufOff; + this.xBufOff = i + 1; + bArr[i] = b; + if (this.xBufOff == this.xBuf.length) { + processWord(this.xBuf, 0); + this.xBufOff = 0; + } + this.byteCount++; + } + + @Override // com.verizon.vcast.apps.VzwDigest + public void update(byte[] bArr, int i, int i2) { + while (this.xBufOff != 0 && i2 > 0) { + update(bArr[i]); + i++; + i2--; + } + while (i2 > this.xBuf.length) { + processWord(bArr, i); + i += this.xBuf.length; + i2 -= this.xBuf.length; + this.byteCount += (long) this.xBuf.length; + } + while (i2 > 0) { + update(bArr[i]); + i++; + i2--; + } + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwPKCS1Encd.java b/app/src/main/java/com/verizon/vcast/apps/VzwPKCS1Encd.java new file mode 100644 index 0000000..c32a010 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwPKCS1Encd.java @@ -0,0 +1,72 @@ +package com.verizon.vcast.apps; + +/* access modifiers changed from: package-private */ +public class VzwPKCS1Encd implements VzwAsymBlkCipher { + private static final int HEADER_LENGTH = 10; + public static final String STRICT_LENGTH_ENABLED_PROPERTY = "org.bouncycastle.pkcs1.strict"; + private VzwAsymBlkCipher engine; + private boolean useStrictLength = useStrict(); + + public VzwPKCS1Encd(VzwAsymBlkCipher vzwAsymBlkCipher) { + this.engine = vzwAsymBlkCipher; + } + + private byte[] decodeBlock(byte[] bArr, int i, int i2) throws Exception { + byte b; + byte[] processBlock = this.engine.processBlock(bArr, i, i2); + if (processBlock.length < getOutputBlockSize()) { + throw new Exception("block truncated"); + } + byte b2 = processBlock[0]; + if (b2 != 1 && b2 != 2) { + throw new Exception("unknown block type"); + } else if (!this.useStrictLength || processBlock.length == this.engine.getOutputBlockSize()) { + int i3 = 1; + while (i3 != processBlock.length && (b = processBlock[i3]) != 0) { + if (b2 != 1 || b == -1) { + i3++; + } else { + throw new Exception("block padding incorrect"); + } + } + int i4 = i3 + 1; + if (i4 > processBlock.length || i4 < 10) { + throw new Exception("no data in block"); + } + byte[] bArr2 = new byte[(processBlock.length - i4)]; + System.arraycopy(processBlock, i4, bArr2, 0, bArr2.length); + return bArr2; + } else { + throw new Exception("block incorrect size"); + } + } + + private boolean useStrict() { + String property = System.getProperty(STRICT_LENGTH_ENABLED_PROPERTY); + return property == null || property.equals("true"); + } + + @Override // com.verizon.vcast.apps.VzwAsymBlkCipher + public int getInputBlockSize() { + return this.engine.getInputBlockSize(); + } + + @Override // com.verizon.vcast.apps.VzwAsymBlkCipher + public int getOutputBlockSize() { + return this.engine.getOutputBlockSize() - 10; + } + + public VzwAsymBlkCipher getUnderlyingCipher() { + return this.engine; + } + + @Override // com.verizon.vcast.apps.VzwAsymBlkCipher + public void init(boolean z, VzwRSAKyParam vzwRSAKyParam) { + this.engine.init(z, vzwRSAKyParam); + } + + @Override // com.verizon.vcast.apps.VzwAsymBlkCipher + public byte[] processBlock(byte[] bArr, int i, int i2) throws Exception { + return decodeBlock(bArr, i, i2); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwPack.java b/app/src/main/java/com/verizon/vcast/apps/VzwPack.java new file mode 100644 index 0000000..cef3ecb --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwPack.java @@ -0,0 +1,30 @@ +package com.verizon.vcast.apps; + +abstract class VzwPack { + VzwPack() { + } + + public static int bigEndianToInt(byte[] bArr, int i) { + int i2 = i + 1; + int i3 = i2 + 1; + return (bArr[i] << 24) | ((bArr[i2] & 255) << 16) | ((bArr[i3] & 255) << 8) | (bArr[i3 + 1] & 255); + } + + public static long bigEndianToLong(byte[] bArr, int i) { + return ((((long) bigEndianToInt(bArr, i)) & 4294967295L) << 32) | (((long) bigEndianToInt(bArr, i + 4)) & 4294967295L); + } + + public static void intToBigEndian(int i, byte[] bArr, int i2) { + bArr[i2] = (byte) (i >>> 24); + int i3 = i2 + 1; + bArr[i3] = (byte) (i >>> 16); + int i4 = i3 + 1; + bArr[i4] = (byte) (i >>> 8); + bArr[i4 + 1] = (byte) i; + } + + public static void longToBigEndian(long j, byte[] bArr, int i) { + intToBigEndian((int) (j >>> 32), bArr, i); + intToBigEndian((int) (4294967295L & j), bArr, i + 4); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwRSACreEng.java b/app/src/main/java/com/verizon/vcast/apps/VzwRSACreEng.java new file mode 100644 index 0000000..ed7f414 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwRSACreEng.java @@ -0,0 +1,69 @@ +package com.verizon.vcast.apps; + +class VzwRSACreEng { + private boolean forEncryption; + private VzwRSAKyParam key; + + VzwRSACreEng() { + } + + public VzwBigInt convertInput(byte[] bArr, int i, int i2) { + byte[] bArr2; + if (i2 > getInputBlockSize() + 1) { + throw new IllegalStateException("input too large for RSA cipher."); + } else if (i2 != getInputBlockSize() + 1 || this.forEncryption) { + if (i == 0 && i2 == bArr.length) { + bArr2 = bArr; + } else { + bArr2 = new byte[i2]; + System.arraycopy(bArr, i, bArr2, 0, i2); + } + VzwBigInt vzwBigInt = new VzwBigInt(1, bArr2); + if (vzwBigInt.compareTo(this.key.getModulus()) < 0) { + return vzwBigInt; + } + throw new IllegalStateException("input too large for RSA cipher."); + } else { + throw new IllegalStateException("input too large for RSA cipher."); + } + } + + public byte[] convertOutput(VzwBigInt vzwBigInt) { + byte[] byteArray = vzwBigInt.toByteArray(); + if (this.forEncryption) { + if (byteArray[0] == 0 && byteArray.length > getOutputBlockSize()) { + byte[] bArr = new byte[(byteArray.length - 1)]; + System.arraycopy(byteArray, 1, bArr, 0, bArr.length); + return bArr; + } else if (byteArray.length < getOutputBlockSize()) { + byte[] bArr2 = new byte[getOutputBlockSize()]; + System.arraycopy(byteArray, 0, bArr2, bArr2.length - byteArray.length, byteArray.length); + return bArr2; + } + } else if (byteArray[0] == 0) { + byte[] bArr3 = new byte[(byteArray.length - 1)]; + System.arraycopy(byteArray, 1, bArr3, 0, bArr3.length); + return bArr3; + } + return byteArray; + } + + public int getInputBlockSize() { + int bitLength = this.key.getModulus().bitLength(); + return this.forEncryption ? ((bitLength + 7) / 8) - 1 : (bitLength + 7) / 8; + } + + public int getOutputBlockSize() { + int bitLength = this.key.getModulus().bitLength(); + return this.forEncryption ? (bitLength + 7) / 8 : ((bitLength + 7) / 8) - 1; + } + + public void init(boolean z, VzwRSAKyParam vzwRSAKyParam) { + this.key = vzwRSAKyParam; + this.forEncryption = z; + } + + public VzwBigInt processBlock(VzwBigInt vzwBigInt) { + return vzwBigInt.modPow(this.key.getExponent(), this.key.getModulus()); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwRSAEng.java b/app/src/main/java/com/verizon/vcast/apps/VzwRSAEng.java new file mode 100644 index 0000000..75e7728 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwRSAEng.java @@ -0,0 +1,35 @@ +package com.verizon.vcast.apps; + +/* access modifiers changed from: package-private */ +public class VzwRSAEng implements VzwAsymBlkCipher { + private VzwRSACreEng core; + + VzwRSAEng() { + } + + @Override // com.verizon.vcast.apps.VzwAsymBlkCipher + public int getInputBlockSize() { + return this.core.getInputBlockSize(); + } + + @Override // com.verizon.vcast.apps.VzwAsymBlkCipher + public int getOutputBlockSize() { + return this.core.getOutputBlockSize(); + } + + @Override // com.verizon.vcast.apps.VzwAsymBlkCipher + public void init(boolean z, VzwRSAKyParam vzwRSAKyParam) { + if (this.core == null) { + this.core = new VzwRSACreEng(); + } + this.core.init(z, vzwRSAKyParam); + } + + @Override // com.verizon.vcast.apps.VzwAsymBlkCipher + public byte[] processBlock(byte[] bArr, int i, int i2) { + if (this.core != null) { + return this.core.convertOutput(this.core.processBlock(this.core.convertInput(bArr, i, i2))); + } + throw new IllegalStateException("RSA engine not initialised"); + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwRSAKyParam.java b/app/src/main/java/com/verizon/vcast/apps/VzwRSAKyParam.java new file mode 100644 index 0000000..4bc1730 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwRSAKyParam.java @@ -0,0 +1,26 @@ +package com.verizon.vcast.apps; + +/* access modifiers changed from: package-private */ +public class VzwRSAKyParam { + private VzwBigInt exponent; + private VzwBigInt modulus; + boolean privateKey; + + public VzwRSAKyParam(boolean z, VzwBigInt vzwBigInt, VzwBigInt vzwBigInt2) { + this.privateKey = z; + this.modulus = vzwBigInt; + this.exponent = vzwBigInt2; + } + + public VzwBigInt getExponent() { + return this.exponent; + } + + public VzwBigInt getModulus() { + return this.modulus; + } + + public boolean isPrivate() { + return this.privateKey; + } +} diff --git a/app/src/main/java/com/verizon/vcast/apps/VzwSHA.java b/app/src/main/java/com/verizon/vcast/apps/VzwSHA.java new file mode 100644 index 0000000..32897f6 --- /dev/null +++ b/app/src/main/java/com/verizon/vcast/apps/VzwSHA.java @@ -0,0 +1,210 @@ +package com.verizon.vcast.apps; + +/* access modifiers changed from: package-private */ +public class VzwSHA extends VzwGenDigest { + private static final int DIGEST_LENGTH = 20; + private static final int Y1 = 1518500249; + private static final int Y2 = 1859775393; + private static final int Y3 = -1894007588; + private static final int Y4 = -899497514; + private int H1; + private int H2; + private int H3; + private int H4; + private int H5; + private int[] X; + private int xOff; + + public VzwSHA() { + this.X = new int[80]; + reset(); + } + + public VzwSHA(VzwSHA vzwSHA) { + super(vzwSHA); + this.X = new int[80]; + this.H1 = vzwSHA.H1; + this.H2 = vzwSHA.H2; + this.H3 = vzwSHA.H3; + this.H4 = vzwSHA.H4; + this.H5 = vzwSHA.H5; + System.arraycopy(vzwSHA.X, 0, this.X, 0, vzwSHA.X.length); + this.xOff = vzwSHA.xOff; + } + + private int f(int i, int i2, int i3) { + return (i & i2) | ((i ^ -1) & i3); + } + + private int g(int i, int i2, int i3) { + return (i & i2) | (i & i3) | (i2 & i3); + } + + private int h(int i, int i2, int i3) { + return (i ^ i2) ^ i3; + } + + @Override // com.verizon.vcast.apps.VzwDigest + public int doFinal(byte[] bArr, int i) { + finish(); + VzwPack.intToBigEndian(this.H1, bArr, i); + VzwPack.intToBigEndian(this.H2, bArr, i + 4); + VzwPack.intToBigEndian(this.H3, bArr, i + 8); + VzwPack.intToBigEndian(this.H4, bArr, i + 12); + VzwPack.intToBigEndian(this.H5, bArr, i + 16); + reset(); + return 20; + } + + @Override // com.verizon.vcast.apps.VzwDigest + public String getAlgorithmName() { + return "SHA-1"; + } + + @Override // com.verizon.vcast.apps.VzwDigest + public int getDigestSize() { + return 20; + } + + /* access modifiers changed from: protected */ + @Override // com.verizon.vcast.apps.VzwGenDigest + public void processBlock() { + int i; + for (int i2 = 16; i2 < 80; i2++) { + int i3 = ((this.X[i2 - 3] ^ this.X[i2 - 8]) ^ this.X[i2 - 14]) ^ this.X[i2 - 16]; + this.X[i2] = (i3 << 1) | (i3 >>> 31); + } + int i4 = this.H1; + int i5 = this.H2; + int i6 = this.H3; + int i7 = this.H4; + int i8 = this.H5; + int i9 = 0; + int i10 = 0; + while (true) { + i = i9; + if (i10 >= 4) { + break; + } + int i11 = i + 1; + int f = i8 + ((i4 << 5) | (i4 >>> 27)) + f(i5, i6, i7) + this.X[i] + Y1; + int i12 = (i5 << 30) | (i5 >>> 2); + int i13 = i11 + 1; + int f2 = i7 + ((f << 5) | (f >>> 27)) + f(i4, i12, i6) + this.X[i11] + Y1; + int i14 = (i4 << 30) | (i4 >>> 2); + int i15 = i13 + 1; + int f3 = i6 + ((f2 << 5) | (f2 >>> 27)) + f(f, i14, i12) + this.X[i13] + Y1; + i8 = (f << 30) | (f >>> 2); + int i16 = i15 + 1; + i5 = i12 + ((f3 << 5) | (f3 >>> 27)) + f(f2, i8, i14) + this.X[i15] + Y1; + i7 = (f2 << 30) | (f2 >>> 2); + i9 = i16 + 1; + i4 = i14 + ((i5 << 5) | (i5 >>> 27)) + f(f3, i7, i8) + this.X[i16] + Y1; + i6 = (f3 << 30) | (f3 >>> 2); + i10++; + } + int i17 = 0; + while (i17 < 4) { + int i18 = i + 1; + int h = i8 + ((i4 << 5) | (i4 >>> 27)) + h(i5, i6, i7) + this.X[i] + Y2; + int i19 = (i5 << 30) | (i5 >>> 2); + int i20 = i18 + 1; + int h2 = i7 + ((h << 5) | (h >>> 27)) + h(i4, i19, i6) + this.X[i18] + Y2; + int i21 = (i4 << 30) | (i4 >>> 2); + int i22 = i20 + 1; + int h3 = i6 + ((h2 << 5) | (h2 >>> 27)) + h(h, i21, i19) + this.X[i20] + Y2; + i8 = (h << 30) | (h >>> 2); + int i23 = i22 + 1; + i5 = i19 + ((h3 << 5) | (h3 >>> 27)) + h(h2, i8, i21) + this.X[i22] + Y2; + i7 = (h2 << 30) | (h2 >>> 2); + i4 = i21 + ((i5 << 5) | (i5 >>> 27)) + h(h3, i7, i8) + this.X[i23] + Y2; + i6 = (h3 << 30) | (h3 >>> 2); + i17++; + i = i23 + 1; + } + int i24 = 0; + while (i24 < 4) { + int i25 = i + 1; + int g = i8 + ((i4 << 5) | (i4 >>> 27)) + g(i5, i6, i7) + this.X[i] + Y3; + int i26 = (i5 << 30) | (i5 >>> 2); + int i27 = i25 + 1; + int g2 = i7 + ((g << 5) | (g >>> 27)) + g(i4, i26, i6) + this.X[i25] + Y3; + int i28 = (i4 << 30) | (i4 >>> 2); + int i29 = i27 + 1; + int g3 = i6 + ((g2 << 5) | (g2 >>> 27)) + g(g, i28, i26) + this.X[i27] + Y3; + i8 = (g << 30) | (g >>> 2); + int i30 = i29 + 1; + i5 = i26 + ((g3 << 5) | (g3 >>> 27)) + g(g2, i8, i28) + this.X[i29] + Y3; + i7 = (g2 << 30) | (g2 >>> 2); + i4 = i28 + ((i5 << 5) | (i5 >>> 27)) + g(g3, i7, i8) + this.X[i30] + Y3; + i6 = (g3 << 30) | (g3 >>> 2); + i24++; + i = i30 + 1; + } + int i31 = 0; + while (i31 <= 3) { + int i32 = i + 1; + int h4 = i8 + ((i4 << 5) | (i4 >>> 27)) + h(i5, i6, i7) + this.X[i] + Y4; + int i33 = (i5 << 30) | (i5 >>> 2); + int i34 = i32 + 1; + int h5 = i7 + ((h4 << 5) | (h4 >>> 27)) + h(i4, i33, i6) + this.X[i32] + Y4; + int i35 = (i4 << 30) | (i4 >>> 2); + int i36 = i34 + 1; + int h6 = i6 + ((h5 << 5) | (h5 >>> 27)) + h(h4, i35, i33) + this.X[i34] + Y4; + i8 = (h4 << 30) | (h4 >>> 2); + int i37 = i36 + 1; + i5 = i33 + ((h6 << 5) | (h6 >>> 27)) + h(h5, i8, i35) + this.X[i36] + Y4; + i7 = (h5 << 30) | (h5 >>> 2); + i4 = i35 + ((i5 << 5) | (i5 >>> 27)) + h(h6, i7, i8) + this.X[i37] + Y4; + i6 = (h6 << 30) | (h6 >>> 2); + i31++; + i = i37 + 1; + } + this.H1 += i4; + this.H2 += i5; + this.H3 += i6; + this.H4 += i7; + this.H5 += i8; + this.xOff = 0; + for (int i38 = 0; i38 < 16; i38++) { + this.X[i38] = 0; + } + } + + /* access modifiers changed from: protected */ + @Override // com.verizon.vcast.apps.VzwGenDigest + public void processLength(long j) { + if (this.xOff > 14) { + processBlock(); + } + this.X[14] = (int) (j >>> 32); + this.X[15] = (int) (-1 & j); + } + + /* access modifiers changed from: protected */ + @Override // com.verizon.vcast.apps.VzwGenDigest + public void processWord(byte[] bArr, int i) { + int i2 = i + 1; + int i3 = i2 + 1; + this.X[this.xOff] = (bArr[i] << 24) | ((bArr[i2] & 255) << 16) | ((bArr[i3] & 255) << 8) | (bArr[i3 + 1] & 255); + int i4 = this.xOff + 1; + this.xOff = i4; + if (i4 == 16) { + processBlock(); + } + } + + @Override // com.verizon.vcast.apps.VzwGenDigest, com.verizon.vcast.apps.VzwDigest + public void reset() { + super.reset(); + this.H1 = 1732584193; + this.H2 = -271733879; + this.H3 = -1732584194; + this.H4 = 271733878; + this.H5 = -1009589776; + this.xOff = 0; + for (int i = 0; i != this.X.length; i++) { + this.X[i] = 0; + } + } +} diff --git a/app/src/main/jniLibs/armeabi-v7a/libapp.so b/app/src/main/jniLibs/armeabi-v7a/libapp.so new file mode 100644 index 0000000..a9fe392 Binary files /dev/null and b/app/src/main/jniLibs/armeabi-v7a/libapp.so differ diff --git a/app/src/main/jniLibs/armeabi-v7a/libfmodevent.so b/app/src/main/jniLibs/armeabi-v7a/libfmodevent.so new file mode 100644 index 0000000..8ec329d Binary files /dev/null and b/app/src/main/jniLibs/armeabi-v7a/libfmodevent.so differ diff --git a/app/src/main/jniLibs/armeabi-v7a/libfmodex.so b/app/src/main/jniLibs/armeabi-v7a/libfmodex.so new file mode 100644 index 0000000..441be3a Binary files /dev/null and b/app/src/main/jniLibs/armeabi-v7a/libfmodex.so differ diff --git a/app/src/main/jniLibs/armeabi-v7a/libgnustl_shared.so b/app/src/main/jniLibs/armeabi-v7a/libgnustl_shared.so new file mode 100644 index 0000000..6ce0bf0 Binary files /dev/null and b/app/src/main/jniLibs/armeabi-v7a/libgnustl_shared.so differ diff --git a/app/src/main/jniLibs/armeabi-v7a/libnimble.so b/app/src/main/jniLibs/armeabi-v7a/libnimble.so new file mode 100644 index 0000000..b928bb7 Binary files /dev/null and b/app/src/main/jniLibs/armeabi-v7a/libnimble.so differ diff --git a/app/src/main/res/drawable-hdpi-v4/facebook_close.png b/app/src/main/res/drawable-hdpi-v4/facebook_close.png new file mode 100644 index 0000000..79106a9 Binary files /dev/null and b/app/src/main/res/drawable-hdpi-v4/facebook_close.png differ diff --git a/app/src/main/res/drawable-hdpi-v4/icon.png b/app/src/main/res/drawable-hdpi-v4/icon.png new file mode 100644 index 0000000..fa5e34a Binary files /dev/null and b/app/src/main/res/drawable-hdpi-v4/icon.png differ diff --git a/app/src/main/res/drawable-hdpi-v4/iconb.png b/app/src/main/res/drawable-hdpi-v4/iconb.png new file mode 100644 index 0000000..7f14e51 Binary files /dev/null and b/app/src/main/res/drawable-hdpi-v4/iconb.png differ diff --git a/app/src/main/res/drawable-hdpi-v4/iconw.png b/app/src/main/res/drawable-hdpi-v4/iconw.png new file mode 100644 index 0000000..a228c6d Binary files /dev/null and b/app/src/main/res/drawable-hdpi-v4/iconw.png differ diff --git a/app/src/main/res/drawable-ldpi-v4/facebook_close.png b/app/src/main/res/drawable-ldpi-v4/facebook_close.png new file mode 100644 index 0000000..f4d2e2f Binary files /dev/null and b/app/src/main/res/drawable-ldpi-v4/facebook_close.png differ diff --git a/app/src/main/res/drawable-ldpi-v4/icon.png b/app/src/main/res/drawable-ldpi-v4/icon.png new file mode 100644 index 0000000..eaeec98 Binary files /dev/null and b/app/src/main/res/drawable-ldpi-v4/icon.png differ diff --git a/app/src/main/res/drawable-ldpi-v4/iconb.png b/app/src/main/res/drawable-ldpi-v4/iconb.png new file mode 100644 index 0000000..696f1e1 Binary files /dev/null and b/app/src/main/res/drawable-ldpi-v4/iconb.png differ diff --git a/app/src/main/res/drawable-ldpi-v4/iconw.png b/app/src/main/res/drawable-ldpi-v4/iconw.png new file mode 100644 index 0000000..6ae8029 Binary files /dev/null and b/app/src/main/res/drawable-ldpi-v4/iconw.png differ diff --git a/app/src/main/res/drawable-mdpi-v4/facebook_close.png b/app/src/main/res/drawable-mdpi-v4/facebook_close.png new file mode 100644 index 0000000..6b6fe97 Binary files /dev/null and b/app/src/main/res/drawable-mdpi-v4/facebook_close.png differ diff --git a/app/src/main/res/drawable-mdpi-v4/icon.png b/app/src/main/res/drawable-mdpi-v4/icon.png new file mode 100644 index 0000000..26a4bc7 Binary files /dev/null and b/app/src/main/res/drawable-mdpi-v4/icon.png differ diff --git a/app/src/main/res/drawable-mdpi-v4/iconb.png b/app/src/main/res/drawable-mdpi-v4/iconb.png new file mode 100644 index 0000000..6f3d805 Binary files /dev/null and b/app/src/main/res/drawable-mdpi-v4/iconb.png differ diff --git a/app/src/main/res/drawable-mdpi-v4/iconw.png b/app/src/main/res/drawable-mdpi-v4/iconw.png new file mode 100644 index 0000000..23087a3 Binary files /dev/null and b/app/src/main/res/drawable-mdpi-v4/iconw.png differ diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi-v4/facebook_close.png b/app/src/main/res/drawable-xhdpi-v4/facebook_close.png new file mode 100644 index 0000000..f456e83 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi-v4/facebook_close.png differ diff --git a/app/src/main/res/drawable-xhdpi-v4/icon.png b/app/src/main/res/drawable-xhdpi-v4/icon.png new file mode 100644 index 0000000..11ee95e Binary files /dev/null and b/app/src/main/res/drawable-xhdpi-v4/icon.png differ diff --git a/app/src/main/res/drawable-xhdpi-v4/iconb.png b/app/src/main/res/drawable-xhdpi-v4/iconb.png new file mode 100644 index 0000000..7f14e51 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi-v4/iconb.png differ diff --git a/app/src/main/res/drawable-xhdpi-v4/iconw.png b/app/src/main/res/drawable-xhdpi-v4/iconw.png new file mode 100644 index 0000000..a228c6d Binary files /dev/null and b/app/src/main/res/drawable-xhdpi-v4/iconw.png differ diff --git a/app/src/main/res/drawable-xxhdpi-v4/facebook_close.png b/app/src/main/res/drawable-xxhdpi-v4/facebook_close.png new file mode 100644 index 0000000..f456e83 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi-v4/facebook_close.png differ diff --git a/app/src/main/res/drawable-xxhdpi-v4/icon.png b/app/src/main/res/drawable-xxhdpi-v4/icon.png new file mode 100644 index 0000000..47209dd Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi-v4/icon.png differ diff --git a/app/src/main/res/drawable-xxhdpi-v4/iconb.png b/app/src/main/res/drawable-xxhdpi-v4/iconb.png new file mode 100644 index 0000000..7f14e51 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi-v4/iconb.png differ diff --git a/app/src/main/res/drawable-xxhdpi-v4/iconw.png b/app/src/main/res/drawable-xxhdpi-v4/iconw.png new file mode 100644 index 0000000..a228c6d Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi-v4/iconw.png differ diff --git a/app/src/main/res/drawable-xxxhdpi-v4/facebook_close.png b/app/src/main/res/drawable-xxxhdpi-v4/facebook_close.png new file mode 100644 index 0000000..f456e83 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi-v4/facebook_close.png differ diff --git a/app/src/main/res/drawable-xxxhdpi-v4/icon.png b/app/src/main/res/drawable-xxxhdpi-v4/icon.png new file mode 100644 index 0000000..c1089d7 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi-v4/icon.png differ diff --git a/app/src/main/res/drawable-xxxhdpi-v4/iconb.png b/app/src/main/res/drawable-xxxhdpi-v4/iconb.png new file mode 100644 index 0000000..7f14e51 Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi-v4/iconb.png differ diff --git a/app/src/main/res/drawable-xxxhdpi-v4/iconw.png b/app/src/main/res/drawable-xxxhdpi-v4/iconw.png new file mode 100644 index 0000000..a228c6d Binary files /dev/null and b/app/src/main/res/drawable-xxxhdpi-v4/iconw.png differ diff --git a/app/src/main/res/drawable/btn_back.png b/app/src/main/res/drawable/btn_back.png new file mode 100644 index 0000000..022b74c Binary files /dev/null and b/app/src/main/res/drawable/btn_back.png differ diff --git a/app/src/main/res/drawable/btn_back_pressed.png b/app/src/main/res/drawable/btn_back_pressed.png new file mode 100644 index 0000000..fb37448 Binary files /dev/null and b/app/src/main/res/drawable/btn_back_pressed.png differ diff --git a/app/src/main/res/drawable/facebook_close.png b/app/src/main/res/drawable/facebook_close.png new file mode 100644 index 0000000..f26783d Binary files /dev/null and b/app/src/main/res/drawable/facebook_close.png differ diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/icon.png b/app/src/main/res/drawable/icon.png new file mode 100644 index 0000000..f1da26f Binary files /dev/null and b/app/src/main/res/drawable/icon.png differ diff --git a/app/src/main/res/drawable/iconb.png b/app/src/main/res/drawable/iconb.png new file mode 100644 index 0000000..7f14e51 Binary files /dev/null and b/app/src/main/res/drawable/iconb.png differ diff --git a/app/src/main/res/drawable/iconw.png b/app/src/main/res/drawable/iconw.png new file mode 100644 index 0000000..a228c6d Binary files /dev/null and b/app/src/main/res/drawable/iconw.png differ diff --git a/app/src/main/res/drawable/origin.png b/app/src/main/res/drawable/origin.png new file mode 100644 index 0000000..92c3824 Binary files /dev/null and b/app/src/main/res/drawable/origin.png differ diff --git a/app/src/main/res/drawable/weblogo.png b/app/src/main/res/drawable/weblogo.png new file mode 100644 index 0000000..eaeec98 Binary files /dev/null and b/app/src/main/res/drawable/weblogo.png differ diff --git a/app/src/main/res/layout/custom.xml b/app/src/main/res/layout/custom.xml new file mode 100644 index 0000000..d7ff3ad --- /dev/null +++ b/app/src/main/res/layout/custom.xml @@ -0,0 +1,43 @@ + + + + + + + + + +