Inital Progress

This commit is contained in:
ApfelTeeSaft
2026-07-03 07:44:47 +02:00
parent 5f3ba656a2
commit 390f5fc2ec
185 changed files with 15518 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
original_reference/original.apk
original_reference/raw_apk_extract/
original_reference/apktool_output/*
!original_reference/apktool_output/AndroidManifest.xml
!original_reference/apktool_output/apktool.yml
original_reference/jadx_output/*
!original_reference/jadx_output/sources/
original_reference/jadx_output/sources/*
!original_reference/jadx_output/sources/com/
original_reference/jadx_output/sources/com/*
!original_reference/jadx_output/sources/com/supercell/
!original_reference/jadx_output/sources/com/oldcrcell/
!original_reference/jadx_output/sources/org/
original_reference/jadx_output/sources/org/*
!original_reference/jadx_output/sources/org/fmod/
original_reference/native_libs_original/*.so
original_reference/dex_raw/*.dex
app/src/main/jniLibs/**/*.so
out/
app/build/
native/build/
.gradle/
build/
*.log
local.properties
+10
View File
@@ -0,0 +1,10 @@
# OpenRoyale
Modernization/preservation rebuild of `ClassicRoyale-1.7_1.apk` - a ~10-year-old **Clash Royale**
client built on **Supercell's "Titan" engine** (repackaged as `com.oldcrcell.clashroyale`). The
original ships **only 32-bit (`armeabi-v7a`) native code**, so it will not run on modern 64-bit-only
Android devices. Goal: a rebuildable Gradle project that can produce **armeabi-v7a, arm64-v8a, and
universal** APKs.
## Legal / safety
Analysis/modification/rebuild is for **preservation, compatibility, and interoperability**.
+57
View File
@@ -0,0 +1,57 @@
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
S="$HERE/tools/scripts"
REQUIRED_LIBS=(libfmod.so libg.so libcr.so)
ABI=""
while [ $# -gt 0 ]; do
case "$1" in
--abi) ABI="${2:-}"; shift 2;;
-h|--help) sed -n '2,12p' "$0"; exit 0;;
*) echo "unknown arg: $1"; exit 1;;
esac
done
[ -n "$ABI" ] || { echo "usage: ./build.sh --abi <armeabi-v7a|arm64-v8a|universal|32|64|both>"; exit 1; }
case "$ABI" in
32) ABI=armeabi-v7a;;
64) ABI=arm64-v8a;;
both|all) ABI=universal;;
armeabi-v7a|arm64-v8a|universal) ;;
*) echo "invalid --abi '$ABI'"; exit 1;;
esac
case "$ABI" in universal) ABIS=(armeabi-v7a arm64-v8a);; *) ABIS=("$ABI");; esac
echo "==> Target ABI: $ABI (build set: ${ABIS[*]})"
echo "==> Checking tools"
miss=0
for t in java cmake ninja; do command -v "$t" >/dev/null || { echo " MISSING: $t"; miss=1; }; done
command -v gradle >/dev/null || [ -x "$HERE/gradlew" ] || { echo " MISSING: gradle/gradlew"; miss=1; }
[ -n "${ANDROID_NDK_HOME:-${NDK:-}}" ] || echo " WARN: ANDROID_NDK_HOME unset (needed for native build; see tools/scripts/fetch_ndk.sh)"
[ -n "${ANDROID_HOME:-${ANDROID_SDK_ROOT:-}}" ] || echo " WARN: ANDROID_HOME unset (needed for Gradle/AAPT2/apksigner; see tools/scripts/fetch_sdk.sh)"
[ "$miss" -eq 0 ] || { echo "==> Install missing tools first (analysis/TOOLCHAIN.md)"; exit 2; }
for abi in "${ABIS[@]}"; do
echo "==> Native build: $abi"
"$S/build_native.sh" "$abi" Debug
done
echo "==> Verifying required native libs are present per ABI"
for abi in "${ABIS[@]}"; do
d="$HERE/app/src/main/jniLibs/$abi"
for req in "${REQUIRED_LIBS[@]}"; do
[ -f "$d/$req" ] || { echo " ERROR: $abi missing required $req"; \
echo " -> reconstruct/replace it before building this ABI (see SHARED_LIBRARY_PORTING_PLAN.md)"; exit 3; }
if [ "$abi" = arm64-v8a ] && ! file -b "$d/$req" | grep -qi '64-bit'; then
echo " ERROR: $abi/$req is not ELF64 (arm64 INCOMPLETE)"; exit 3; fi
done
done
echo "==> Gradle app build ($ABI)"
"$S/build_project.sh" "$ABI"
"$S/package_apk.sh" "$ABI"
OUT_APK="$HERE/out/app-${ABI}-debug.apk"
"$S/sign_apk.sh" "$OUT_APK"
"$S/verify_apk.sh" "$OUT_APK" "$ABI"
echo "==> DONE: $OUT_APK"
+5
View File
@@ -0,0 +1,5 @@
set -euo pipefail
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "[*] Cleaning build outputs"
rm -rf "$HERE/out"/* "$HERE/native/build" "$HERE/app/build" "$HERE/.gradle" 2>/dev/null || true
echo "[+] Clean done (original_reference/ and analysis/ preserved)"
+52
View File
@@ -0,0 +1,52 @@
cmake_minimum_required(VERSION 3.22)
project(cr_native LANGUAGES C CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
file(GLOB_RECURSE LIBG_SRC CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/src/libg/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/src/libg/*.cpp")
if(LIBG_SRC)
add_library(g SHARED ${LIBG_SRC})
target_include_directories(g PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/include"
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmod/include")
if(ANDROID)
target_link_libraries(g PRIVATE log android GLESv2 EGL m dl)
# FMOD linked as prebuilt import when present:
set(FMOD_SO "${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmod/${ANDROID_ABI}/libfmod.so")
if(EXISTS "${FMOD_SO}")
add_library(fmod SHARED IMPORTED)
set_target_properties(fmod PROPERTIES IMPORTED_LOCATION "${FMOD_SO}")
target_link_libraries(g PRIVATE fmod)
endif()
endif()
else()
message(STATUS "native: src/libg not populated yet (Phase 7/8). Skipping target 'g'.")
endif()
# libcr is part of a custom shared library from classic royale
file(GLOB_RECURSE LIBCR_SRC CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/libcr/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/libcr/*.cpp")
if(LIBCR_SRC)
add_library(cr SHARED ${LIBCR_SRC})
target_include_directories(cr PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libcr/include")
if(ANDROID)
target_link_libraries(cr PRIVATE log z android m dl)
endif()
else()
message(STATUS "native: third_party/libcr not present yet. Drop the OWNED libcr source here (Phase 12).")
endif()
file(GLOB_RECURSE FMOD_SHIM_SRC CONFIGURE_DEPENDS
"${CMAKE_CURRENT_SOURCE_DIR}/compatibility/fmod_shim/*.cpp")
if(FMOD_SHIM_SRC AND NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmod/${ANDROID_ABI}/libfmod.so")
add_library(fmod SHARED ${FMOD_SHIM_SRC})
target_include_directories(fmod PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/third_party/fmod/include")
if(ANDROID)
target_link_libraries(fmod PRIVATE log OpenSLES m dl)
endif()
endif()
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="23" android:compileSdkVersionCodename="6.0-2438415" android:installLocation="auto" package="com.oldcrcell.clashroyale" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415">
<uses-feature android:glEsVersion="0x20000" android:required="true"/>
<uses-feature android:name="android.hardware.screen.portrait" android:required="true"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="com.android.vending.BILLING"/>
<permission android:name="com.supercell.clashroyale.permission.C2D_MESSAGExdjygqkqbpbwlp" android:protectionLevel="signature"/>
<uses-permission android:name="com.supercell.clashroyale.permission.C2D_MESSAGExdjygqkqbpbwlp"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true"/>
<application android:allowBackup="true" android:backupAgent="com.supercell.titan.PreferencesBackupAgent" android:icon="@drawable/ic_launcher" android:label="@string/app_name">
<meta-data android:name="com.google.android.gms.games.APP_ID" android:value="@string/app_id"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id"/>
<meta-data android:name="com.google.android.backup.api_key" android:value="@string/backup_api_key"/>
<activity android:configChanges="keyboard|keyboardHidden|navigation|orientation|screenSize" android:label="@string/app_name" android:launchMode="singleTask" android:name="com.supercell.clashroyale.GameApp" android:resizeableActivity="false" android:screenOrientation="sensorPortrait" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:windowSoftInputMode="stateUnchanged">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="clashroyale"/>
</intent-filter>
</activity>
<receiver android:name="com.supercell.clashroyale.TimeAlarm"/>
<receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
<action android:name="com.google.android.c2dm.intent.REGISTRATION"/>
<category android:name="com.oldcrcell.clashroyale"/>
</intent-filter>
</receiver>
<receiver android:exported="true" android:name="com.mobileapptracker.Tracker">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<service android:name="com.supercell.clashroyale.GCMIntentService"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:label="@string/app_name" android:name="com.facebook.FacebookActivity" android:screenOrientation="fullSensor" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity android:name="com.helpshift.support.activities.ParentActivity" android:theme="@style/Helpshift.Theme.Activity"/>
<activity android:configChanges="orientation|screenSize" android:name="com.helpshift.support.HSReview" android:theme="@style/Helpshift.Theme.Dialog"/>
<service android:label="Helpshift Service" android:name="com.helpshift.support.HSService"/>
<service android:label="Helpshift Service" android:name="com.helpshift.support.HSRetryService"/>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
</manifest>
@@ -0,0 +1,16 @@
version: 3.0.2
apkFileName: ClassicRoyale-1.7_1.apk
usesFramework:
ids:
- 1
sdkInfo:
minSdkVersion: 15
targetSdkVersion: 25
versionInfo:
versionCode: 155
versionName: 1.9.2
resourcesInfo:
packageId: 127
keepRawValues: true
doNotCompress:
- png
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,8 @@
package com.supercell.clashroyale;
/* JADX INFO: loaded from: classes.dex */
public class GCMIntentService extends com.supercell.titan.GCMIntentService {
public GCMIntentService() {
super(GameApp.class, "598800548981");
}
}
@@ -0,0 +1,8 @@
package com.supercell.clashroyale;
/* JADX INFO: loaded from: classes.dex */
public class GameApp extends com.supercell.titan.GameApp {
public GameApp() {
super(TimeAlarm.class, null);
}
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,14 @@
package com.supercell.clashroyale;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.supercell.titan.dk;
/* JADX INFO: loaded from: classes.dex */
public class TimeAlarm extends BroadcastReceiver {
@Override // android.content.BroadcastReceiver
public void onReceive(Context context, Intent intent) {
dk.a(context, intent);
}
}
@@ -0,0 +1,295 @@
package com.supercell.titan;
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.net.Uri;
import android.os.Build;
import android.provider.Settings;
import android.support.v4.view.InputDeviceCompat;
import android.util.DisplayMetrics;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Locale;
import java.util.concurrent.FutureTask;
import java.util.concurrent.atomic.AtomicBoolean;
import org.OpenUDID.OpenUDID_manager;
/* JADX INFO: loaded from: classes.dex */
public class ApplicationUtil {
private static boolean c;
private static com.google.android.gms.ads.a.b d;
private static String b = "";
public static final AtomicBoolean a = new AtomicBoolean(false);
private static int e = -267522035;
public static boolean canOpenURL(String str) {
PackageManager packageManager = GameApp.getInstance().getPackageManager();
if (!str.startsWith("fb://")) {
return packageManager.queryIntentActivities(new Intent("android.intent.action.VIEW", Uri.parse(str)), 0).size() > 0;
}
try {
return packageManager.getPackageInfo("com.facebook.katana", 0).versionCode >= 3002850;
} catch (PackageManager.NameNotFoundException e2) {
return false;
}
}
public static void changeKunlunAccount() {
}
public static void copyString(String str) {
GameApp gameApp = GameApp.getInstance();
gameApp.runOnUiThread(new a(gameApp, str));
}
public static boolean existsKeyValue(String str) {
return !getKeyValue(str).isEmpty();
}
public static String getAdvertiserID() {
String str = b;
str.isEmpty();
return str;
}
public static boolean getAdvertiserTrackingEnabled() {
return c;
}
public static String getAndroidID() {
return Settings.Secure.getString(GameApp.getInstance().getContentResolver(), "android_id");
}
public static String getAppVersion() {
GameApp gameApp = GameApp.getInstance();
try {
return gameApp.getPackageManager().getPackageInfo(gameApp.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundException e2) {
GameApp.debuggerException(e2);
return "";
}
}
public static String getBundleID() {
return GameApp.getInstance().getPackageName();
}
public static String getKeyValue(String str) {
GameApp gameApp = GameApp.getInstance();
String strB = gameApp.k.b(str);
if (strB.isEmpty()) {
strB = gameApp.j.b(str);
if (!strB.isEmpty()) {
gameApp.k.a(str, strB);
gameApp.b();
}
}
return strB;
}
public static String getKunlunSSO() {
return "";
}
public static String getKunlunUID() {
return "";
}
public static String getOpenUDID() {
String strA;
return (!OpenUDID_manager.b() || (strA = OpenUDID_manager.a()) == null) ? "" : strA;
}
public static String getPlatformDetail(int i) {
String strValueOf = null;
GameApp gameApp = GameApp.getInstance();
switch (i) {
case 256:
strValueOf = Build.BOARD;
break;
case InputDeviceCompat.SOURCE_KEYBOARD /* 257 */:
strValueOf = Build.BOOTLOADER;
break;
case 258:
strValueOf = Build.BRAND;
break;
case 259:
strValueOf = Build.CPU_ABI;
break;
case 260:
strValueOf = Build.CPU_ABI2;
break;
case 261:
strValueOf = Build.DEVICE;
break;
case 262:
strValueOf = Build.DISPLAY;
break;
case 263:
strValueOf = Build.FINGERPRINT;
break;
case 264:
strValueOf = Build.HARDWARE;
break;
case 265:
strValueOf = Build.MANUFACTURER;
break;
case 266:
strValueOf = Build.MODEL;
break;
case 267:
strValueOf = Build.PRODUCT;
break;
case 268:
strValueOf = Build.TAGS;
break;
case 269:
strValueOf = Build.TYPE;
break;
case 270:
strValueOf = Build.VERSION.RELEASE;
break;
case 271:
DisplayMetrics displayMetrics = new DisplayMetrics();
gameApp.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
strValueOf = String.valueOf(displayMetrics.xdpi);
break;
case 272:
DisplayMetrics displayMetrics2 = new DisplayMetrics();
gameApp.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics2);
strValueOf = String.valueOf(displayMetrics2.ydpi);
break;
case 273:
DisplayMetrics displayMetrics3 = new DisplayMetrics();
gameApp.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics3);
strValueOf = String.valueOf(displayMetrics3.density);
break;
case 274:
strValueOf = String.valueOf(getTotalMemory() * 1024 * 1024);
break;
}
return strValueOf == null ? "" : strValueOf;
}
public static String getPreferredLanguage() {
Locale locale = Locale.getDefault();
String language = locale.getLanguage();
String country = locale.getCountry();
return (country == null || country.isEmpty()) ? language : language + "-" + country;
}
public static int getTotalMemory() {
if (e == -267522035) {
try {
BufferedReader bufferedReader = new BufferedReader(new FileReader("/proc/meminfo"), 8192);
e = Integer.parseInt(bufferedReader.readLine().split("\\s+")[1]) >> 10;
bufferedReader.close();
} catch (Exception e2) {
e = 0;
GameApp.debuggerException(e2);
}
}
return e;
}
public static boolean isAmazonDeviceMessagingSupported() {
return false;
}
public static void openMarketURL() {
try {
GameApp.getInstance().startActivity(new Intent("android.intent.action.VIEW", Uri.parse("market://details?id=" + GameApp.getInstance().getPackageName())));
} catch (ActivityNotFoundException e2) {
GameApp.debuggerException(e2);
}
}
public static void openURL(String str) {
GameApp gameApp = GameApp.getInstance();
if (str.startsWith("https://") || str.startsWith("http://") || str.startsWith("hockeyapp://") || str.startsWith("market://")) {
try {
gameApp.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str.replace("market://play.google.com/store/apps/details?id=", "market://details?id="))));
return;
} catch (ActivityNotFoundException e2) {
GameApp.debuggerException(e2);
return;
}
}
if (str.startsWith("mailto:")) {
try {
gameApp.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
return;
} catch (ActivityNotFoundException e3) {
Uri uri = Uri.parse(str);
Intent intent = new Intent("android.intent.action.SENDTO");
intent.setData(uri);
gameApp.startActivity(Intent.createChooser(intent, "Send email"));
return;
}
}
if (str.startsWith("settings://")) {
try {
gameApp.startActivity(new Intent(str.substring(str.indexOf("settings://") + "settings://".length())));
return;
} catch (ActivityNotFoundException e4) {
GameApp.debuggerException(e4);
return;
}
}
if (str.startsWith("fb://")) {
gameApp.startActivity(new Intent("android.intent.action.VIEW", Uri.parse(str)));
return;
}
try {
gameApp.startActivity(new Intent("android.intent.action.VIEW", Uri.parse("http://" + str)));
} catch (ActivityNotFoundException e5) {
GameApp.debuggerException(e5);
}
}
public static String pasteString() {
GameApp gameApp = GameApp.getInstance();
FutureTask futureTask = new FutureTask(new b(gameApp));
gameApp.runOnUiThread(futureTask);
try {
return (String) futureTask.get();
} catch (Exception e2) {
return "";
}
}
public static void removeKeyValue(String str) {
storeKeyValue(str, "");
}
public static void requestAdvertiserInfoOnNewThread() {
new d().start();
}
public static void setKeepScreenOn(boolean z) {
GameApp gameApp = GameApp.getInstance();
f fVar = gameApp.d;
if (fVar == null) {
return;
}
gameApp.runOnUiThread(new c(fVar, z));
}
public static void setKunlunPlayerInfo(String str, int i, int i2, String str2, boolean z) {
}
public static void showKunlunExitScreen() {
}
public static void storeKeyValue(String str, String str2) {
if (str2 == null) {
str2 = "";
}
GameApp gameApp = GameApp.getInstance();
if (str == null || gameApp == null || gameApp.j == null || (!(GameApp.a(str, str2, gameApp.k) | false) && !GameApp.a(str, str2, gameApp.j))) {
return;
}
gameApp.b();
}
}
@@ -0,0 +1,33 @@
package com.supercell.titan;
import android.text.Editable;
import android.text.TextWatcher;
/* JADX INFO: renamed from: com.supercell.titan.do, reason: invalid class name */
/* JADX INFO: loaded from: classes.dex */
class Cdo implements TextWatcher {
final /* synthetic */ dl a;
private String b = "";
Cdo(dl dlVar) {
this.a = dlVar;
}
@Override // android.text.TextWatcher
public void afterTextChanged(Editable editable) {
String string = editable.toString();
if (string.equals(this.b) || this.a.a) {
return;
}
GameApp.getInstance().a(new dp(this, string));
}
@Override // android.text.TextWatcher
public void beforeTextChanged(CharSequence charSequence, int i, int i2, int i3) {
this.b = charSequence.toString();
}
@Override // android.text.TextWatcher
public void onTextChanged(CharSequence charSequence, int i, int i2, int i3) {
}
}
@@ -0,0 +1,137 @@
package com.supercell.titan;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import com.facebook.share.internal.ShareConstants;
import com.google.android.gcm.GCMBaseIntentService;
/* JADX INFO: loaded from: classes.dex */
public class GCMIntentService extends GCMBaseIntentService {
public static boolean a;
private static String b = "";
private static String c = "";
private static int d = -1;
private final Class<?> e;
public GCMIntentService(Class<?> cls, String str) {
super(str);
this.e = cls;
}
private static void d(String str) {
b = "";
if (str == null) {
str = "";
}
c = str;
d = 0;
a = true;
}
public static int getErrorCode() {
return d;
}
public static String getErrorMessage() {
return b;
}
public static String getID() {
return c;
}
public static void onDestroy(Context context) {
try {
if (c.isEmpty()) {
return;
}
com.google.android.gcm.a.a(context);
} catch (Exception e) {
GameApp.debuggerException(e);
}
}
public static void register() {
GameApp gameApp = GameApp.getInstance();
String str = gameApp.g;
if (str.isEmpty()) {
return;
}
try {
String strC = com.google.android.gcm.a.c(gameApp);
if (strC != null && !strC.isEmpty()) {
d(strC);
} else {
com.google.android.gcm.a.d(gameApp);
com.google.android.gcm.a.a(gameApp, str);
}
} catch (Exception e) {
GameApp.debuggerException(e);
}
}
@Override // com.google.android.gcm.GCMBaseIntentService
public final void a() {
b = "";
c = "";
d = -1;
a = true;
}
@Override // com.google.android.gcm.GCMBaseIntentService
public final void a(Context context, Intent intent) {
String string;
Bundle extras = intent.getExtras();
if (extras != null && (string = extras.getString("origin")) != null && string.equals("helpshift")) {
try {
HelpshiftTitan.callInit();
com.helpshift.a.a(context, intent);
HelpshiftTitan.requestNotificationCount();
return;
} catch (Exception e) {
return;
}
}
String stringExtra = intent.getStringExtra(ShareConstants.WEB_DIALOG_PARAM_DATA);
if (stringExtra == null || stringExtra.isEmpty()) {
return;
}
GameApp gameApp = GameApp.getInstance();
if (gameApp == null || gameApp.e) {
String stringExtra2 = intent.getStringExtra(ShareConstants.WEB_DIALOG_PARAM_ID);
if (stringExtra2 == null) {
stringExtra2 = "";
}
dk.a(context, stringExtra, "", stringExtra2, this.e);
}
}
@Override // com.google.android.gcm.GCMBaseIntentService
public final boolean a(String str) {
if (str == null) {
str = "";
}
b = str;
c = "";
d = 1;
a = true;
return true;
}
@Override // com.google.android.gcm.GCMBaseIntentService
public final void b(String str) {
if (str == null) {
str = "";
}
b = str;
c = "";
d = 1;
a = true;
}
@Override // com.google.android.gcm.GCMBaseIntentService
public final void c(String str) {
d(str);
}
}
@@ -0,0 +1,983 @@
package com.supercell.titan;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.backup.BackupManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.Signature;
import android.content.res.AssetManager;
import android.content.res.Configuration;
import android.graphics.Point;
import android.media.AudioManager;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Process;
import android.os.StatFs;
import android.os.Vibrator;
import android.provider.Settings;
import android.support.v4.content.ContextCompat;
import android.util.Base64;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.KeyEvent;
import android.view.Window;
import android.view.inputmethod.InputMethodManager;
import android.widget.TextView;
import android.widget.Toast;
import com.facebook.internal.NativeProtocol;
import com.facebook.share.internal.ShareConstants;
import com.mobileapptracker.MobileAppTracker;
import java.io.File;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.security.MessageDigest;
import java.util.Iterator;
import java.util.Locale;
import java.util.Vector;
import org.OpenUDID.OpenUDID_manager;
import org.fmod.FMOD;
import org.json.JSONArray;
import org.json.JSONObject;
/* JADX INFO: loaded from: classes.dex */
public class GameApp extends Activity {
private static GameApp n;
private Bundle A;
private final Class<?> B;
private di C;
private boolean D;
private GoogleServiceClient E;
private MobileAppTracker F;
private boolean G;
private int H;
private boolean I;
boolean a;
ax b;
Vector<q> c;
f d;
boolean e;
String g;
String h;
PurchaseManager i;
di j;
di k;
public int l;
final Vector<String> m;
private WifiManager.WifiLock o;
private boolean p;
private boolean q;
private Thread r;
private boolean s;
private boolean t;
private AlarmManager w;
private final int x;
private String y;
private final int z;
private static int u = (int) (System.currentTimeMillis() / 1000);
static final Vector<s> f = new Vector<>();
private static final Vector<Long> v = new Vector<>();
public GameApp() {
this(dk.class, null);
}
public GameApp(int i, int i2, Class<?> cls) {
this(i, i2, cls, (Class<?>) null);
}
public GameApp(int i, int i2, Class<?> cls, Class<?> cls2) {
this.g = "";
this.h = "";
this.y = "this game";
this.D = true;
this.m = new Vector<>();
this.H = -1;
this.z = i;
this.x = i2;
this.B = cls;
}
public GameApp(Class<?> cls, Class<?> cls2) {
this(-1, -1, cls, cls2);
}
@Deprecated
public GameApp(String str, String str2, Class<?> cls) {
this(str, str2, cls, (Class<?>) null);
}
@Deprecated
public GameApp(String str, String str2, Class<?> cls, Class<?> cls2) {
this(-1, -1, cls, cls2);
this.y = str;
this.g = str2;
}
private static s a(String str, String str2, String str3, int i) {
Intent intent = new Intent(n, n.B);
intent.putExtra("msg", str2);
intent.putExtra(ShareConstants.WEB_DIALOG_PARAM_ID, i);
intent.putExtra("snd", "");
intent.putExtra("userId", str);
s sVar = new s((byte) 0);
sVar.c = i;
sVar.d = str2;
sVar.b = str;
sVar.e = str3;
sVar.a = PendingIntent.getBroadcast(n, i, intent, 1073741824);
return sVar;
}
private static String a(Intent intent) {
if (intent == null || intent.getData() == null) {
return null;
}
return intent.getData().toString();
}
private String a(String str) {
int identifier = getResources().getIdentifier(str, "string", getPackageName());
return identifier == 0 ? "" : getString(identifier);
}
private void a(Context context) {
this.d = new f(context, 8, 8, 8, 8, 0, 0);
setContentView(this.d);
this.d.post(new m(this));
}
private void a(boolean z) {
this.e = false;
WifiManager wifiManager = (WifiManager) getSystemService("wifi");
if (wifiManager != null) {
try {
wifiManager.reconnect();
} catch (Exception e) {
}
if (this.o != null && !this.o.isHeld()) {
this.o.acquire();
}
}
if (this.D) {
this.D = false;
} else if (this.d != null) {
this.d.e = true;
}
if (this.s) {
if (!VirtualKeyboardHandler.a) {
VirtualKeyboardHandler.hideKeyboardFromResume();
}
if (!z) {
this.E.onStart();
soundSystemStart();
NotificationManager notificationManager = (NotificationManager) getSystemService("notification");
if (notificationManager != null) {
try {
notificationManager.cancelAll();
} catch (Exception e2) {
}
}
AlarmManager alarmManager = n.w;
synchronized (f) {
for (int i = 0; i < f.size(); i++) {
alarmManager.cancel(f.get(i).a);
}
}
if (NativeFacebookManager.getInstance() != null) {
NativeFacebookManager.getInstance();
NativeFacebookManager.onStart();
}
db dbVar = (db) this.i;
if (!dbVar.q) {
dbVar.g();
} else if (!dbVar.p && dbVar.e() > 0) {
PurchaseManager.updateDetails();
}
}
HelpshiftTitan.onResume();
if (this.d != null) {
this.d.onResume();
}
}
}
static boolean a(String str, String str2, di diVar) {
boolean z = false;
if (!diVar.b(str).equals(str2)) {
z = true;
if (str2.isEmpty()) {
diVar.a(str);
} else {
diVar.a(str, str2);
}
}
return z;
}
@TargetApi(18)
private static long b(String str) {
long blockSize;
try {
StatFs statFs = new StatFs(str);
if (Build.VERSION.SDK_INT >= 18) {
blockSize = statFs.getAvailableBytes();
} else {
blockSize = ((long) statFs.getBlockSize()) * ((long) statFs.getAvailableBlocks());
}
return blockSize;
} catch (Exception e) {
return 0L;
}
}
/* JADX WARN: Removed duplicated region for block: B:28:0x0059 */
/* JADX WARN: Removed duplicated region for block: B:29:0x005c */
/*
Code decompiled incorrectly, please refer to instructions dump.
*/
private static String b(Context context) {
long jB;
long jB2;
File file;
File cacheDir = context.getCacheDir();
if (cacheDir == null || !cacheDir.canWrite()) {
jB = 0;
cacheDir = null;
} else {
jB = b(cacheDir.toString());
if (jB <= 0) {
}
}
if (cacheDir != null && jB >= 1073741824) {
return cacheDir.toString();
}
try {
File[] externalCacheDirs = ContextCompat.getExternalCacheDirs(context);
int length = externalCacheDirs.length;
int i = 0;
while (i < length) {
File file2 = externalCacheDirs[i];
if (file2 == null || !file2.canWrite()) {
jB2 = jB;
file = cacheDir;
} else {
jB2 = b(file2.toString());
if (jB2 > jB) {
file = file2;
}
}
i++;
cacheDir = file;
jB = jB2;
}
} catch (Exception e) {
}
if (cacheDir != null) {
return cacheDir.toString();
}
return null;
}
private static String b(Intent intent) {
Bundle extras;
String string;
return (intent == null || (extras = intent.getExtras()) == null || (string = extras.getString("userId")) == null) ? "" : string;
}
public static native boolean backButtonPressed();
public static void cancelAllNotifications() {
AlarmManager alarmManager = n.w;
f.clear();
v.clear();
String strB = n.C.b("localNotifications");
if (strB.isEmpty()) {
return;
}
n.C.a("localNotifications");
try {
JSONArray jSONArray = new JSONArray(strB);
for (int i = 0; i < jSONArray.length(); i++) {
JSONObject jSONObject = jSONArray.getJSONObject(i);
alarmManager.cancel(a(jSONObject.getString("userId"), jSONObject.getString("msg"), jSONObject.getString("snd"), jSONObject.getInt(ShareConstants.WEB_DIALOG_PARAM_ID)).a);
}
} catch (Exception e) {
debuggerException(e);
}
}
public static void cancelNotification(int i) {
int size = f.size();
while (true) {
int i2 = size - 1;
if (i2 < 0) {
break;
}
if (f.get(i2).c == i) {
f.remove(i2);
v.remove(i2);
}
size = i2;
}
if (n == null || n.C == null) {
return;
}
String strB = n.C.b("localNotifications");
if (strB.isEmpty()) {
return;
}
AlarmManager alarmManager = n.w;
try {
JSONArray jSONArray = new JSONArray(strB);
JSONArray jSONArray2 = new JSONArray();
for (int i3 = 0; i3 < jSONArray.length(); i3++) {
JSONObject jSONObject = jSONArray.getJSONObject(i3);
if (i == jSONObject.getInt(ShareConstants.WEB_DIALOG_PARAM_ID)) {
String string = jSONObject.getString("userId");
String string2 = jSONObject.getString("snd");
String string3 = jSONObject.getString("msg");
if (alarmManager != null) {
alarmManager.cancel(a(string, string3, string2, i).a);
}
} else {
jSONArray2.put(jSONObject);
}
}
int length = jSONArray2.length();
if (length != jSONArray.length()) {
if (length == 0) {
n.C.a("localNotifications");
} else {
n.C.a("localNotifications", jSONArray2.toString());
}
}
} catch (Exception e) {
debuggerException(e);
}
}
public static native void clearTouches();
public static native String createGameMain(AssetManager assetManager, String str, String str2, String str3, long j, int i, int i2, int i3, int i4);
public static int createNotification(String str, String str2, int i, String str3) {
int i2 = u + 1;
u = i2;
cancelNotification(i2);
s sVarA = a(str, str2, str3, i2);
long jCurrentTimeMillis = System.currentTimeMillis();
if (i == -9999) {
n.w.set(0, jCurrentTimeMillis + 1000, sVarA.a);
return 0;
}
f.add(sVarA);
v.add(Long.valueOf((((long) i) * 1000) + jCurrentTimeMillis));
return i2;
}
public static int createNotificationAbsolute(String str, String str2, long j, String str3) {
int i = u + 1;
u = i;
cancelNotification(i);
s sVarA = a(str, str2, str3, i);
long jCurrentTimeMillis = System.currentTimeMillis();
if (j * 1000 < jCurrentTimeMillis) {
n.w.set(0, jCurrentTimeMillis + 1000, sVarA.a);
return 0;
}
f.add(sVarA);
v.add(Long.valueOf(j * 1000));
return i;
}
public static void debuggerException(Exception exc) {
if (exc == null || n == null) {
return;
}
StringWriter stringWriter = new StringWriter();
exc.printStackTrace(new PrintWriter(stringWriter));
n.m.add(stringWriter.toString());
}
public static void debuggerWarning(String str) {
if (str != null) {
n.m.add(str);
}
}
public static native void deinit();
public static native void dialogDismissed(int i, int i2);
private int e() {
try {
for (Signature signature : getPackageManager().getPackageInfo(getPackageName(), 64).signatures) {
MessageDigest messageDigest = MessageDigest.getInstance("SHA");
messageDigest.update(signature.toByteArray());
String strEncodeToString = Base64.encodeToString(messageDigest.digest(), 0);
String str = "Include this string as a value for SIGNATURE:" + strEncodeToString;
if ("RWEg0wzahyAlW2DQMkx9FUMH9SU=".equals(strEncodeToString) || "LhjT+HJrHeYxMicWUY+yrsLr654=".equals(strEncodeToString) || "xWj3NbEpQjAUk4KDgJo23qjr06Q=".equals(strEncodeToString) || "HnxASw7gdJz5NmBsPsNM+dMoO+M=".equals(strEncodeToString)) {
return 0;
}
}
} catch (Exception e) {
}
return 1;
}
private void f() {
int[] iArr = {102, 76, 120, 89, 66, 57, 77, 56, 52, 65, 98, 101, 117, 115, 69, 82, 77, 89, 57, 89, 70, 122, 86, 71};
String packageName = getPackageName();
String str = "";
int length = packageName.length();
while (true) {
length--;
if (length < 0) {
this.k = new di(this, "storage_new", str, true);
return;
} else {
str = str + ((char) (((packageName.charAt(length) ^ iArr[length % 24]) & 31) + 48));
}
}
}
public static native int getAllowedScreenRotations();
public static native int getDepthBits();
public static native String getFontPath(String str);
public static GameApp getInstance() {
return n;
}
public static native int getStencilBits();
public static native int getSurfaceFormat();
public static native void handleDeeplinkURL(String str);
public static native boolean init(int i, int i2, String str);
public static native void inputKeyboardDismissed();
public static native void inputOkPressed();
public static native void inputSelectionChanged(int i, int i2);
public static native void inputTextChanged(String str);
public static boolean isEmulator() {
try {
getInstance().r.join();
} catch (Exception e) {
}
return getInstance().q;
}
public static boolean isNativeLibraryLoaded() {
return n.s;
}
public static boolean isPlayingUserMusic() {
AudioManager audioManager;
if (getInstance() == null || (audioManager = (AudioManager) getInstance().getSystemService("audio")) == null) {
return false;
}
return audioManager.isMusicActive();
}
public static boolean isSignatureValid() {
return getInstance() != null && getInstance().e() == 0;
}
public static native void keyboardSizeChanged(float f2, float f3);
public static native void logDebuggerException(String str);
public static void mobileAppTrackerStart(String str, String str2, boolean z, String str3) {
try {
if (n.F == null) {
MobileAppTracker.init(n.getApplicationContext(), str, str2);
MobileAppTracker mobileAppTracker = MobileAppTracker.getInstance();
n.F = mobileAppTracker;
mobileAppTracker.setReferralSources(n);
if (!str3.isEmpty()) {
mobileAppTracker.setUserId(str3);
}
new Thread(new p(mobileAppTracker)).start();
}
if (n.F != null) {
n.F.setExistingUser(z);
n.F.measureSession();
}
} catch (Exception e) {
debuggerException(e);
}
}
public static void removeOutOfDateNotifications(long j) {
int size = f.size();
while (true) {
int i = size - 1;
if (i < 0) {
return;
}
if (j >= v.get(i).longValue()) {
f.remove(i);
v.remove(i);
}
size = i;
}
}
public static native void setPushNotificationValues(int i, String str, String str2);
public static native void setTencentDiffLogin();
public static native void setTencentLaunchParameter(String str, int i, String str2);
public static native void setTencentLoggedOut(int i);
public static native void setTencentLogin(String str, String str2, int i);
public static native void setTencentShareResult(int i);
public static native void setTencentUserInfo(String str);
public static native void setTencentWaiting(boolean z);
public static native void setTouch(int i, int i2, int i3, int i4);
public static native void soundSystemStart();
public static native void soundSystemStop();
public static native void start(String str);
public static native void stop();
public static native boolean update();
public static void vibrateDevice() {
try {
Vibrator vibrator = (Vibrator) n.getSystemService("vibrator");
if (vibrator == null || !vibrator.hasVibrator()) {
return;
}
vibrator.vibrate(400L);
} catch (Exception e) {
}
}
public final void a() {
Bundle bundle;
boolean zIsEmpty = false;
if (this.d == null) {
return;
}
if (this.H == -1) {
int i = Build.VERSION.SDK_INT;
if (i >= 19) {
if (i >= 22) {
zIsEmpty = true;
} else {
try {
Object systemService = getApplicationContext().getSystemService("user");
zIsEmpty = (systemService == null || (bundle = (Bundle) systemService.getClass().getMethod("getUserRestrictions", new Class[0]).invoke(systemService, new Object[0])) == null) ? false : bundle.isEmpty();
} catch (Exception e) {
}
}
}
if (zIsEmpty) {
this.H = 5894;
} else {
this.H = 1024;
}
}
this.d.setSystemUiVisibility(this.H);
}
public final void a(long j) {
new Handler().postDelayed(new o(this), j);
}
public final void a(q qVar) {
if (this.c == null || qVar == null) {
return;
}
this.c.remove(qVar);
}
public final void a(Runnable runnable) {
if (runnable == null) {
return;
}
if (this.d != null) {
this.d.queueEvent(runnable);
} else if (this.s) {
logDebuggerException("runOnView when view = null, " + runnable.toString());
}
}
public final void b() {
try {
new BackupManager(this).dataChanged();
} catch (Exception e) {
}
}
public final void c() {
if (this.G && this.I) {
this.I = false;
a(false);
}
}
@Override // android.app.Activity
public void onActivityResult(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
if (this.E != null) {
this.E.onActivityResult(i, i2, intent);
}
if (this.i != null && i == 10000004) {
((db) this.i).a(i2, intent);
}
if (NativeFacebookManager.getInstance() != null) {
NativeFacebookManager.getInstance().a.onActivityResult(i, i2, intent);
}
}
@Override // android.app.Activity
public void onBackPressed() {
if (TitanWebView.isInCustomView()) {
TitanWebView.hideCustomView();
} else if (this.d != null) {
this.d.b = true;
}
}
@Override // android.app.Activity, android.content.ComponentCallbacks
public void onConfigurationChanged(Configuration configuration) {
super.onConfigurationChanged(configuration);
}
@Override // android.app.Activity
protected void onCreate(Bundle bundle) {
int i;
int i2;
int i3;
int i4;
super.onCreate(bundle);
n = this;
if (this.x != -1) {
this.g = getResources().getString(this.x);
} else if (this.g == null || this.g.isEmpty()) {
this.g = a("app_id");
}
this.h = a("googleplay_clientid");
if (this.z != -1) {
this.y = getResources().getString(this.z);
} else if (this.y == null || this.y.isEmpty() || this.y.equals("this game")) {
this.y = a(NativeProtocol.BRIDGE_ARG_APP_NAME_STRING);
if (this.y.isEmpty()) {
this.y = "this game";
}
}
FragmentManager fragmentManager = getFragmentManager();
if (fragmentManager != null) {
Fragment fragmentFindFragmentByTag = fragmentManager.findFragmentByTag("NativeDialog");
if (fragmentFindFragmentByTag instanceof NativeDialogManager) {
((NativeDialogManager) fragmentFindFragmentByTag).a();
NativeDialogManager.a = false;
}
}
this.A = bundle;
WifiManager wifiManager = (WifiManager) getSystemService("wifi");
if (wifiManager != null) {
this.o = wifiManager.createWifiLock(1, getPackageName());
try {
wifiManager.reconnect();
} catch (Exception e) {
}
}
this.w = (AlarmManager) getSystemService("alarm");
Window window = getWindow();
window.setFlags(1024, 1024);
if (Build.VERSION.SDK_INT >= 19) {
window.setFlags(134217728, 134217728);
}
this.l = getRequestedOrientation();
if (Build.VERSION.SDK_INT == 23 && this.l == 7) {
setRequestedOrientation(6);
setRequestedOrientation(this.l);
}
com.a.a.a.a aVarA = com.a.a.a.a.a(this);
aVarA.b = false;
aVarA.a = false;
Thread thread = new Thread(new com.a.a.a.b(aVarA, new l(this)));
thread.start();
this.r = thread;
if (!this.t) {
this.t = true;
Context applicationContext = getApplicationContext();
String str = applicationContext.getApplicationInfo().dataDir;
String absolutePath = applicationContext.getCacheDir().getAbsolutePath();
String strB = b(this);
long jB = 0;
if (strB != null) {
jB = b(strB);
if (jB <= 0) {
strB = "";
}
} else {
strB = "";
}
String string = Settings.Secure.getString(getContentResolver(), "android_id");
if (string == null || string.isEmpty()) {
string = getPackageName().toUpperCase(Locale.ENGLISH);
}
this.j = new di(this, "storage", string, true);
String string2 = Settings.Secure.getString(applicationContext.getContentResolver(), "android_id");
this.C = new di(this, "localPrefs", (string2 == null || string2.isEmpty()) ? string + "titan" : string2, true);
f();
try {
System.loadLibrary("fmod");
try {
System.loadLibrary("g");
System.loadLibrary("cr");
this.s = true;
FMOD.init(this);
NativeHTTPClientManager.getInstance();
NativeFacebookManager.createInstance(this);
HelpshiftTitan.getNotificationCount();
try {
OpenUDID_manager.a(this);
} catch (Exception e2) {
debuggerException(e2);
}
Display defaultDisplay = getWindowManager().getDefaultDisplay();
DisplayMetrics displayMetrics = new DisplayMetrics();
defaultDisplay.getMetrics(displayMetrics);
int i5 = displayMetrics.densityDpi;
Point point = new Point();
defaultDisplay.getSize(point);
this.i = new db(this, createGameMain(applicationContext.getAssets(), str, absolutePath, strB, jB, point.x, point.y, i5, 2));
if (getSurfaceFormat() == 565) {
i = 5;
i2 = 6;
i3 = 5;
i4 = 0;
} else {
i = 8;
i2 = 8;
i3 = 8;
i4 = 8;
}
this.d = new f(applicationContext, i, i2, i3, i4, getDepthBits(), getStencilBits());
this.d.c = b(getIntent());
this.d.setFocusable(true);
this.d.setFocusableInTouchMode(true);
setContentView(this.d);
a();
this.E = new GoogleServiceClient(this);
this.b = new ax(this);
this.d.d = a(getIntent());
} catch (UnsatisfiedLinkError e3) {
a(applicationContext);
}
} catch (UnsatisfiedLinkError e4) {
a(applicationContext);
}
}
TextView textView = new TextView(this);
textView.setText("- Created by Gamemaster2022 -");
textView.setTextColor(-1);
textView.setBackgroundColor(-13487566);
textView.setPadding(24, 16, 24, 16);
textView.setTextSize(2, 18.0f);
Toast toast = new Toast(this);
toast.setView(textView);
toast.setDuration(1);
toast.show();
}
@Override // android.app.Activity
protected void onDestroy() {
super.onDestroy();
if (this.s) {
deinit();
NativeFacebookManager.destructInstance();
FMOD.close();
}
if (this.i != null) {
this.i.a();
}
GCMIntentService.onDestroy(this);
Process.killProcess(Process.myPid());
}
@Override // android.app.Activity, android.view.KeyEvent.Callback
public boolean onKeyUp(int i, KeyEvent keyEvent) {
if (i == 25 || i == 24 || i == 164 || i == 4) {
a();
a(5000L);
}
return super.onKeyUp(i, keyEvent);
}
@Override // android.app.Activity
protected void onNewIntent(Intent intent) {
if (this.d == null || intent == null) {
return;
}
this.d.c = b(intent);
String strA = a(intent);
if (strA != null) {
if (this.d.a) {
handleDeeplinkURL(strA);
} else {
this.d.d = strA;
}
}
}
@Override // android.app.Activity
protected void onPause() {
super.onPause();
isFinishing();
if (NativeFacebookManager.getInstance() != null) {
NativeFacebookManager.getInstance();
NativeFacebookManager.onPause();
}
if (!this.p && this.d != null) {
this.d.onPause();
}
this.p = true;
}
@Override // android.app.Activity
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
if (this.c != null) {
Iterator<q> it = this.c.iterator();
while (it.hasNext()) {
it.next().onRequestPermissionsResult(i, strArr, iArr);
}
}
}
@Override // android.app.Activity
protected void onRestart() {
super.onRestart();
}
@Override // android.app.Activity
protected void onResume() {
super.onResume();
if (this.p) {
this.p = false;
if (!this.I) {
a(true);
}
}
if (NativeFacebookManager.getInstance() != null) {
NativeFacebookManager.getInstance();
NativeFacebookManager.onResume();
}
((InputMethodManager) getSystemService("input_method")).hideSoftInputFromWindow(findViewById(android.R.id.content).getWindowToken(), 0);
}
@Override // android.app.Activity
protected void onSaveInstanceState(Bundle bundle) {
super.onSaveInstanceState(bundle);
if (NativeFacebookManager.getInstance() != null) {
NativeFacebookManager.getInstance();
NativeFacebookManager.onSaveInstanceState$79e5e33f();
}
}
@Override // android.app.Activity
protected void onStart() {
if (this.G) {
this.I = true;
} else {
this.I = false;
this.G = false;
a(false);
}
super.onStart();
}
@Override // android.app.Activity
protected void onStop() {
if (this.e) {
super.onStop();
return;
}
this.e = true;
if (this.s) {
soundSystemStop();
}
if (this.E != null) {
this.E.onStop();
}
if (NativeFacebookManager.getInstance() != null) {
NativeFacebookManager.getInstance();
NativeFacebookManager.onStop();
}
if (this.o != null && this.o.isHeld()) {
this.o.release();
}
if (this.C != null) {
long jCurrentTimeMillis = System.currentTimeMillis();
removeOutOfDateNotifications(jCurrentTimeMillis);
AlarmManager alarmManager = n.w;
JSONArray jSONArray = new JSONArray();
boolean z = false;
for (int i = 0; i < f.size(); i++) {
long jLongValue = v.get(i).longValue();
if (jCurrentTimeMillis < jLongValue) {
s sVar = f.get(i);
alarmManager.set(0, jLongValue, sVar.a);
JSONObject jSONObject = new JSONObject();
try {
jSONObject.put("msg", sVar.d);
jSONObject.put("snd", sVar.e);
jSONObject.put("userId", sVar.b);
jSONObject.put(ShareConstants.WEB_DIALOG_PARAM_ID, sVar.c);
jSONArray.put(jSONObject);
z = true;
} catch (Exception e) {
debuggerException(e);
}
}
}
if (z) {
this.C.a("localNotifications", jSONArray.toString());
} else {
this.C.a("localNotifications");
}
}
this.p = false;
super.onStop();
}
@Override // android.app.Activity, android.view.Window.Callback
public void onWindowFocusChanged(boolean z) {
super.onWindowFocusChanged(z);
if (z) {
c();
a();
}
this.G = !z;
}
}
@@ -0,0 +1,121 @@
package com.supercell.titan;
import android.content.Intent;
import android.os.Bundle;
import com.google.android.gms.common.ConnectionResult;
/* JADX INFO: loaded from: classes.dex */
public class GoogleServiceClient implements com.google.android.gms.common.api.l, com.google.android.gms.common.api.m {
private static boolean i;
private GameApp a;
private com.google.android.gms.common.api.i b;
private volatile boolean c;
private volatile boolean d;
private Object j;
private boolean k;
private volatile String e = "";
private volatile String f = "";
private volatile boolean h = false;
private volatile String g = "";
public GoogleServiceClient(GameApp gameApp) {
this.a = gameApp;
}
private void a() {
}
static /* synthetic */ void a(GoogleServiceClient googleServiceClient) {
}
static /* synthetic */ boolean a(GoogleServiceClient googleServiceClient, boolean z) {
googleServiceClient.h = false;
return false;
}
private void b() {
}
public static native void onSignIn();
public static native void onSignInCanceled();
public static native void onSignInFailed();
public static native void onSignOut();
public static native void updateNativeInstance(GoogleServiceClient googleServiceClient);
public void connect() {
}
public void forNative_signIn(boolean z) {
}
public void forNative_signOut() {
}
public String getAuthCode() {
return this.g;
}
public String getPlayerDisplayName() {
return this.f;
}
public String getPlayerId() {
return this.e;
}
public boolean isAvailable() {
return false;
}
public boolean isRecordingControlsVisible() {
return false;
}
public boolean isScreenRecordingAvailable() {
return false;
}
public boolean isSignedIn() {
return false;
}
public void onActivityResult(int i2, int i3, Intent intent) {
}
@Override // com.google.android.gms.common.api.l
public void onConnected(Bundle bundle) {
}
@Override // com.google.android.gms.common.api.m
public void onConnectionFailed(ConnectionResult connectionResult) {
}
@Override // com.google.android.gms.common.api.l
public void onConnectionSuspended(int i2) {
}
public void onStart() {
}
public void onStop() {
}
public void showAchievements() {
}
public void showVideoRecordingControls() {
}
public void signIn(boolean z) {
}
public void signOut() {
}
public void unlockAchievement(String str) {
}
}
@@ -0,0 +1,154 @@
package com.supercell.titan;
import android.os.Handler;
import java.util.HashMap;
/* JADX INFO: loaded from: classes.dex */
public class HelpshiftTitan {
private static int a;
private static boolean b;
private static boolean g;
private static Handler j;
private static boolean k;
private static boolean l;
private static final HashMap<String, String> c = new HashMap<>();
private static String[] d = new String[0];
private static String[] e = new String[0];
private static String[] f = new String[0];
private static int h = com.helpshift.support.dq.c.intValue();
private static boolean i = false;
static /* synthetic */ boolean b(boolean z) {
g = true;
return true;
}
public static void callInit() {
if (l) {
return;
}
com.helpshift.a.a(com.helpshift.support.de.a());
l = true;
}
public static void clearMetadata() {
c.clear();
d = new String[0];
f = new String[0];
}
public static void enableChat() {
i = true;
}
private static HashMap<String, Object> f() {
HashMap map = new HashMap(c);
if (d.length > 0) {
map.put("hs-tags", d);
}
HashMap<String, Object> map2 = new HashMap<>(1);
map2.put("hs-custom-metadata", map);
map2.put("gotoConversationAfterContactUs", false);
map2.put("showSearchOnNewConversation", true);
map2.put("showConversationResolutionQuestion", true);
map2.put("enableContactUs", Integer.valueOf(h));
map2.put("enableChat", Boolean.valueOf(i));
if (f.length > 0) {
HashMap map3 = new HashMap(2);
map3.put("operator", "or");
map3.put("tags", f);
map2.put("withTagsMatching", map3);
}
return map2;
}
public static int getNotificationCount() {
return a;
}
public static void handlePushNotification(String str) {
}
public static boolean isVisible() {
return k;
}
public static void leaveBreadcrumb(String str) {
GameApp.getInstance().runOnUiThread(new am(str));
}
public static void onResume() {
if (g) {
g = false;
requestNotificationCount();
}
}
public static void requestNotificationCount() {
if (b) {
GameApp.getInstance().runOnUiThread(new ao());
}
}
public static void setContactUsMode(int i2) {
h = i2;
}
public static void setMetadata(String str, String str2) {
c.put(str, str2);
}
public static void setMetadataCallback() {
GameApp.getInstance().runOnUiThread(new aq());
}
public static void setMetadataTags(String str) {
d = str.split(",");
e = d;
}
public static void setNameAndEmail(String str, String str2) {
GameApp.getInstance().runOnUiThread(new as(str, str2));
}
public static void setPushNotificationToken(String str) {
GameApp gameApp = GameApp.getInstance();
gameApp.runOnUiThread(new at(gameApp, str));
}
public static void setSDKLanguage(String str) {
GameApp.getInstance().runOnUiThread(new an(str));
}
public static void setUserIdentifier(String str) {
GameApp.getInstance().runOnUiThread(new ar(str));
}
public static void setWithTagsMatching(String str) {
f = str.split(",");
}
public static void showConversation() {
GameApp.getInstance().a(new au(f()));
}
public static void showFAQ() {
GameApp.getInstance().a(new av(f()));
}
public static void showFAQSection(String str) {
GameApp.getInstance().a(new al(str, f()));
}
public static void showSingleFAQ(String str) {
GameApp.getInstance().a(new aw(str, f()));
}
public static void start(String str, String str2, String str3) {
if (b) {
return;
}
b = true;
GameApp.getInstance().runOnUiThread(new ai(str, str2, str3));
}
}
@@ -0,0 +1,163 @@
package com.supercell.titan;
import android.annotation.SuppressLint;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.text.TextUtils;
import java.util.concurrent.FutureTask;
/* JADX INFO: loaded from: classes.dex */
public class LocationService implements LocationListener, q {
private static Location a;
private long e;
private String f;
private final String[] b = {"android.permission.ACCESS_FINE_LOCATION"};
private final GameApp d = GameApp.getInstance();
private final LocationManager c = (LocationManager) this.d.getSystemService("location");
/* JADX INFO: Access modifiers changed from: private */
@SuppressLint({"MissingPermission"})
public void a() {
GameApp.getInstance().runOnUiThread(new bh(this, this));
}
private boolean a(Location location, Location location2) {
if (location2 == null && location != null) {
return true;
}
if (location == null) {
return false;
}
long time = location.getTime() - location2.getTime();
boolean z = time > 120000;
boolean z2 = time < -120000;
boolean z3 = time > 0;
if (z) {
return true;
}
if (z2) {
return false;
}
int accuracy = (int) (location.getAccuracy() - location2.getAccuracy());
boolean z4 = accuracy > 0;
boolean z5 = accuracy < 0;
boolean z6 = accuracy > 200;
String provider = location.getProvider();
String provider2 = location2.getProvider();
boolean zEquals = provider == null ? provider2 == null : provider.equals(provider2);
if (z5) {
return true;
}
if (!z3 || z4) {
return z3 && !z6 && zEquals;
}
return true;
}
static /* synthetic */ Location d(LocationService locationService) {
Location lastKnownLocation = locationService.c.getLastKnownLocation("network");
Location lastKnownLocation2 = locationService.c.getLastKnownLocation("gps");
if (locationService.a(lastKnownLocation2, a)) {
a = lastKnownLocation2;
}
if (locationService.a(lastKnownLocation, a)) {
a = lastKnownLocation;
}
return a;
}
public static native void locationChanged(long j, double d, double d2);
public void init(long j) {
this.e = j;
}
public boolean isEnabled() {
int i;
if (Build.VERSION.SDK_INT < 19) {
return !TextUtils.isEmpty(Settings.Secure.getString(this.d.getContentResolver(), "location_providers_allowed"));
}
try {
i = Settings.Secure.getInt(this.d.getContentResolver(), "location_mode");
} catch (Settings.SettingNotFoundException e) {
i = 0;
}
return i != 0;
}
@Override // android.location.LocationListener
public void onLocationChanged(Location location) {
a = location;
this.d.a(new bk(this, location));
}
@Override // android.location.LocationListener
public void onProviderDisabled(String str) {
String str2 = "onProviderDisabled = " + str;
}
@Override // android.location.LocationListener
public void onProviderEnabled(String str) {
String str2 = "onProviderEnabled = " + str;
}
@Override // com.supercell.titan.q
public void onRequestPermissionsResult(int i, String[] strArr, int[] iArr) {
boolean z;
String str = "Permission results are in from settings " + i;
if (i == 1) {
this.d.a(this);
for (String str2 : this.b) {
int i2 = 0;
while (true) {
if (i2 >= strArr.length) {
z = false;
break;
} else {
if (strArr[i2].equals(str2) && iArr[i2] == 0) {
z = true;
break;
}
i2++;
}
}
if (z) {
a();
}
}
}
}
@Override // android.location.LocationListener
public void onStatusChanged(String str, int i, Bundle bundle) {
String str2 = "onStatusChanged provider = " + str + "status = " + i;
}
public boolean showSystemSettings() {
try {
FutureTask futureTask = new FutureTask(new bj(this));
this.d.runOnUiThread(futureTask);
try {
return ((Boolean) futureTask.get()).booleanValue();
} catch (Exception e) {
e.getCause();
return false;
}
} catch (Exception e2) {
return false;
}
}
public void startUpdatingLocation() {
GameApp.getInstance().runOnUiThread(new bg(this, this));
}
@SuppressLint({"MissingPermission"})
public void stopUpdatingLocation() {
GameApp.getInstance().runOnUiThread(new bi(this, this));
}
}
@@ -0,0 +1,163 @@
package com.supercell.titan;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.ActivityNotFoundException;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import com.facebook.share.internal.ShareConstants;
import java.util.Vector;
/* JADX INFO: loaded from: classes.dex */
public class NativeDialogManager extends DialogFragment {
public static boolean a;
public static int b;
public static int c;
private static NativeDialogManager g;
private int e = -1;
private boolean f;
private static int d = 1000;
private static final Vector<bn> h = new Vector<>();
public static int ShowDialog(String str, String str2, String str3, String str4, String str5) {
int i = d + 1;
d = i;
if (str2.startsWith("Welcome to Classic Royale")) {
a = true;
c = i;
b = 0;
return i;
}
if (g == null) {
a(str, str2, str3, str4, str5, i);
} else {
bn bnVar = new bn((byte) 0);
bnVar.a = str;
bnVar.b = str2;
bnVar.c = str3;
bnVar.d = str4;
bnVar.e = str5;
bnVar.f = i;
h.add(bnVar);
}
return i;
}
public static void ShowPostDialog(String str, String str2) {
GameApp gameApp = GameApp.getInstance();
try {
Intent intent = new Intent("android.intent.action.SEND");
intent.setType("text/plain");
intent.addFlags(524288);
intent.putExtra("android.intent.extra.TEXT", str);
gameApp.startActivity(Intent.createChooser(intent, str2));
} catch (ActivityNotFoundException e) {
GameApp.debuggerException(e);
}
}
public static void ShowPostURLDialog(String str, String str2, String str3) {
GameApp gameApp = GameApp.getInstance();
try {
Intent intent = new Intent("android.intent.action.SEND");
intent.setType("text/plain");
intent.addFlags(524288);
intent.putExtra("android.intent.extra.SUBJECT", str);
intent.putExtra("android.intent.extra.TEXT", str3);
gameApp.startActivity(Intent.createChooser(intent, str2));
} catch (ActivityNotFoundException e) {
GameApp.debuggerException(e);
}
}
/* JADX INFO: Access modifiers changed from: private */
public void a(int i, int i2) {
if (this.f) {
return;
}
this.f = true;
g = null;
GameApp gameApp = GameApp.getInstance();
if (h.isEmpty()) {
gameApp.d.setRenderMode(1);
WifiManager wifiManager = (WifiManager) gameApp.getSystemService("wifi");
if (wifiManager != null) {
try {
wifiManager.reconnect();
} catch (Exception e) {
}
}
} else {
bn bnVarRemove = h.remove(0);
a(bnVarRemove.a, bnVarRemove.b, bnVarRemove.c, bnVarRemove.d, bnVarRemove.e, bnVarRemove.f);
}
a = true;
c = i;
b = i2;
}
private static void a(String str, String str2, String str3, String str4, String str5, int i) {
GameApp gameApp = GameApp.getInstance();
gameApp.runOnUiThread(new bl(str, str2, str3, str4, str5, i, gameApp));
}
public static boolean isDialogVisible() {
return g != null;
}
public static void nativeDialogDismissAll() {
h.clear();
NativeDialogManager nativeDialogManager = g;
g = null;
if (nativeDialogManager != null) {
nativeDialogManager.a();
}
a = false;
f fVar = GameApp.getInstance().d;
if (fVar != null) {
fVar.setRenderMode(1);
}
}
void a() {
this.f = true;
try {
dismiss();
} catch (Exception e) {
GameApp.debuggerException(e);
}
}
@Override // android.app.DialogFragment
public Dialog onCreateDialog(Bundle bundle) {
GameApp gameApp = GameApp.getInstance();
if (gameApp == null) {
return null;
}
bm bmVar = new bm(this);
String string = getArguments().getString(ShareConstants.WEB_DIALOG_PARAM_TITLE);
String string2 = getArguments().getString("button");
String string3 = getArguments().getString("button2");
String string4 = getArguments().getString("button3");
String string5 = getArguments().getString(ShareConstants.WEB_DIALOG_PARAM_MESSAGE);
this.e = getArguments().getInt(ShareConstants.WEB_DIALOG_PARAM_ID);
AlertDialog.Builder neutralButton = new AlertDialog.Builder(gameApp, 4).setTitle(string).setMessage(string5).setNeutralButton(string2, bmVar);
if (!string3.isEmpty()) {
neutralButton.setPositiveButton(string3, bmVar);
}
if (!string4.isEmpty()) {
neutralButton.setNegativeButton(string4, bmVar);
}
return neutralButton.create();
}
@Override // android.app.DialogFragment, android.content.DialogInterface.OnDismissListener
public void onDismiss(DialogInterface dialogInterface) {
super.onDismiss(dialogInterface);
GameApp.getInstance().a();
a(this.e, 0);
}
}
@@ -0,0 +1,279 @@
package com.supercell.titan;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import com.facebook.AccessToken;
import com.facebook.CallbackManager;
import com.facebook.FacebookException;
import com.facebook.FacebookSdk;
import com.facebook.GraphRequest;
import com.facebook.HttpMethod;
import com.facebook.ProfileTracker;
import com.facebook.login.LoginManager;
import com.facebook.share.internal.ShareConstants;
import com.facebook.share.widget.GameRequestDialog;
import com.facebook.share.widget.ShareDialog;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Set;
/* JADX INFO: loaded from: classes.dex */
public class NativeFacebookManager {
private static NativeFacebookManager c;
private static final Uri i = Uri.parse("content://com.facebook.katana.provider.AttributionIdProvider");
CallbackManager a;
private final GameApp b;
private final ArrayList<String> d = new ArrayList<>(1);
private int e = 0;
private String f = "";
private boolean g;
private ProfileTracker h;
private NativeFacebookManager(GameApp gameApp) {
this.b = gameApp;
this.d.add("user_friends");
FacebookSdk.sdkInitialize(gameApp);
this.a = CallbackManager.Factory.create();
LoginManager.getInstance().registerCallback(this.a, new bo(this, gameApp));
this.h = new cb(this, gameApp);
}
/* JADX INFO: Access modifiers changed from: private */
public void a(int i2) {
String str = "NativeFacebookManager.handleRequest, type " + i2;
this.e = 0;
GraphRequest graphRequest = null;
if (this.g) {
if (this.g) {
this.g = false;
} else {
e();
}
this.e = i2;
return;
}
if (i2 == 3) {
cl clVar = new cl(this.b);
Bundle bundle = new Bundle();
bundle.putString(GraphRequest.FIELDS_PARAM, "id,name,picture,first_name,installed");
if (!d()) {
return;
}
graphRequest = new GraphRequest(AccessToken.getCurrentAccessToken(), this.f, bundle, HttpMethod.GET, clVar);
this.f = "";
} else if (i2 == 2) {
if (!d()) {
return;
}
GraphRequest graphRequestNewMyFriendsRequest = GraphRequest.newMyFriendsRequest(AccessToken.getCurrentAccessToken(), new cn(this.b));
Bundle bundle2 = new Bundle();
bundle2.putString(GraphRequest.FIELDS_PARAM, "id, name, picture, first_name");
bundle2.putString("limit", "5000");
graphRequestNewMyFriendsRequest.setParameters(bundle2);
this.b.runOnUiThread(new ce(this, graphRequestNewMyFriendsRequest));
} else if (i2 == 1) {
this.b.runOnUiThread(new cs(this.b));
}
if (graphRequest != null) {
this.b.runOnUiThread(new cf(this, graphRequest));
}
}
static /* synthetic */ void a(NativeFacebookManager nativeFacebookManager, String str, String str2, String str3, String str4) {
GameRequestDialog gameRequestDialog = new GameRequestDialog(nativeFacebookManager.b);
gameRequestDialog.registerCallback(nativeFacebookManager.a, new ci(nativeFacebookManager));
nativeFacebookManager.b.runOnUiThread(new cj(nativeFacebookManager, str, str2, str3, str4, gameRequestDialog));
}
static /* synthetic */ void a(NativeFacebookManager nativeFacebookManager, String str, String str2, String str3, String str4, String str5) {
ShareDialog shareDialog = new ShareDialog(nativeFacebookManager.b);
shareDialog.registerCallback(nativeFacebookManager.a, new cg(nativeFacebookManager));
nativeFacebookManager.b.runOnUiThread(new ch(nativeFacebookManager, str2, str3, str4, str5, shareDialog));
}
static /* synthetic */ void b(NativeFacebookManager nativeFacebookManager, String str) {
}
private static boolean b() {
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
return (currentAccessToken == null || currentAccessToken.isExpired()) ? false : true;
}
static /* synthetic */ void c(NativeFacebookManager nativeFacebookManager, String str) {
if (d()) {
try {
Bundle bundle = new Bundle();
bundle.putString(ShareConstants.WEB_DIALOG_PARAM_ID, str);
GraphRequest graphRequest = new GraphRequest(AccessToken.getCurrentAccessToken(), "/", bundle, HttpMethod.GET, new cp(str));
graphRequest.setParameters(bundle);
GraphRequest.executeBatchAsync(graphRequest);
} catch (FacebookException e) {
GameApp.debuggerException(e);
} catch (IllegalStateException e2) {
GameApp.debuggerException(e2);
}
}
}
private static boolean c() {
Set<String> permissions = AccessToken.getCurrentAccessToken().getPermissions();
if (permissions == null) {
return false;
}
return permissions.contains("publish_actions");
}
public static void createInstance(GameApp gameApp) {
c = new NativeFacebookManager(gameApp);
}
static /* synthetic */ void d(NativeFacebookManager nativeFacebookManager) {
if (b()) {
nativeFacebookManager.a(1);
} else {
LoginManager.getInstance().logInWithReadPermissions(nativeFacebookManager.b, nativeFacebookManager.d);
}
}
static /* synthetic */ void d(NativeFacebookManager nativeFacebookManager, String str) {
if (d()) {
Bundle bundle = new Bundle();
bundle.putString("object", str);
try {
GraphRequest.executeBatchAsync(new GraphRequest(AccessToken.getCurrentAccessToken(), "me/og.likes", bundle, HttpMethod.POST, new ck(nativeFacebookManager)));
} catch (FacebookException e) {
GameApp.debuggerException(e);
} catch (IllegalStateException e2) {
GameApp.debuggerException(e2);
}
}
}
private static boolean d() {
AccessToken currentAccessToken = AccessToken.getCurrentAccessToken();
return (currentAccessToken == null || currentAccessToken.isExpired()) ? false : true;
}
public static void destructInstance() {
if (c != null) {
c.h.stopTracking();
c = null;
}
}
/* JADX INFO: Access modifiers changed from: private */
public void e() {
if (c()) {
return;
}
this.g = true;
LoginManager.getInstance().logInWithPublishPermissions(this.b, Arrays.asList("publish_actions"));
}
static /* synthetic */ void f(NativeFacebookManager nativeFacebookManager) {
}
public static native void facebookFriends(String str);
public static native void facebookLinkStatistics(boolean z, int i2, String str);
public static native void facebookLogged(String str, String str2);
public static native void facebookLoginFailedWithError(String str, String str2);
public static native void facebookLogout();
public static native void facebookReceivedAppRequest(String str);
public static native void facebookSentAppRequest(String str, String str2);
public static native void facebookUserInfo(String str);
public static NativeFacebookManager getInstance() {
return c;
}
public static void jniActivateApp() {
}
public static void jniAppRequestDialog(String str, String str2, String str3, String str4) {
GameApp.getInstance().runOnUiThread(new bx(str, str2, str3, str4));
}
public static void jniAuthorize() {
GameApp.getInstance().runOnUiThread(new br());
}
public static boolean jniCanPublish() {
return c();
}
public static void jniCheckAppRequests() {
GameApp.getInstance().runOnUiThread(new bv());
}
public static void jniDeleteAppRequest(String str) {
GameApp.getInstance().runOnUiThread(new by(str));
}
public static void jniFeedDialog(String str, String str2, String str3, String str4, String str5) {
GameApp.getInstance().runOnUiThread(new bw(str, str2, str3, str4, str5));
}
public static String jniGetAttributionID() {
Cursor cursorQuery = GameApp.getInstance().getContentResolver().query(i, new String[]{"aid"}, null, null, null);
if (cursorQuery == null || !cursorQuery.moveToFirst()) {
return "";
}
String string = cursorQuery.getString(cursorQuery.getColumnIndex("aid"));
cursorQuery.close();
return string == null ? "" : string;
}
public static boolean jniIsLogged() {
return b();
}
public static void jniLike(String str) {
GameApp.getInstance().runOnUiThread(new ca(str));
}
public static void jniLinkStatistics(String str) {
GameApp.getInstance().runOnUiThread(new bz(str));
}
public static void jniLogout() {
GameApp.getInstance().runOnUiThread(new bs());
}
public static void jniRequestFriends() {
GameApp.getInstance().runOnUiThread(new bt());
}
public static void jniRequestNewPublishPermissions() {
GameApp.getInstance().runOnUiThread(new cd());
}
public static void jniRequestUserInfo(String str) {
if (str == null) {
return;
}
GameApp.getInstance().runOnUiThread(new bu(str));
}
public static void onPause() {
}
public static void onResume() {
}
public static void onSaveInstanceState$79e5e33f() {
}
public static void onStart() {
}
public static void onStop() {
}
}
@@ -0,0 +1,72 @@
package com.supercell.titan;
import java.util.Vector;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/* JADX INFO: loaded from: classes.dex */
public class NativeHTTPClientManager {
private static final Vector<cw> a = new Vector<>();
private static int b = 1234;
private static final NativeHTTPClientManager e = new NativeHTTPClientManager();
private final cv c = new cv(0);
private final ExecutorService d = Executors.newCachedThreadPool();
private NativeHTTPClientManager() {
}
private void a(Runnable runnable) {
this.d.execute(runnable);
}
public static native void getFinished(boolean z, int i, byte[] bArr, int i2);
public static NativeHTTPClientManager getInstance() {
return e;
}
public static native void postFinished(boolean z, int i, byte[] bArr, int i2);
public static int startGetRequest(String str, String str2, String str3, String str4) {
NativeHTTPClientManager nativeHTTPClientManager = getInstance();
cw cwVar = new cw(nativeHTTPClientManager.c, str3, str4);
cwVar.d = cx.GET;
cwVar.b = str;
cwVar.e = null;
cwVar.c = str2;
int i = b;
b = i + 1;
cwVar.a = i;
nativeHTTPClientManager.a(cwVar);
return cwVar.a;
}
public static int startPostRequest(String str, String str2, byte[] bArr) {
NativeHTTPClientManager nativeHTTPClientManager = getInstance();
cw cwVar = new cw(nativeHTTPClientManager.c, "", "");
cwVar.d = cx.POST;
cwVar.b = str;
cwVar.e = bArr;
cwVar.c = str2;
int i = b;
b = i + 1;
cwVar.a = i;
nativeHTTPClientManager.a(cwVar);
return cwVar.a;
}
public static void updateBeforeFrame() {
int size = a.size();
for (int i = 0; i < size; i++) {
cw cwVarRemove = a.remove(0);
boolean z = cwVarRemove.f == cy.OK;
int i2 = cwVarRemove.a;
byte[] bArr = cwVarRemove.g;
if (cwVarRemove.d == cx.GET) {
getFinished(z, i2, bArr, cwVarRemove.h);
} else {
postFinished(z, i2, bArr, cwVarRemove.h);
}
}
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
import android.app.backup.BackupAgentHelper;
import android.app.backup.SharedPreferencesBackupHelper;
/* JADX INFO: loaded from: classes.dex */
public class PreferencesBackupAgent extends BackupAgentHelper {
@Override // android.app.backup.BackupAgent
public void onCreate() {
try {
addHelper("app_prefs", new SharedPreferencesBackupHelper(this, "storage", "storage_new"));
} catch (Exception e) {
}
}
}
@@ -0,0 +1,211 @@
package com.supercell.titan;
import android.content.Intent;
import java.util.HashMap;
import java.util.Map;
import java.util.Vector;
/* JADX INFO: loaded from: classes.dex */
public abstract class PurchaseManager {
private static PurchaseManager p;
protected final GameApp j;
protected int k;
protected boolean m;
protected boolean o;
protected final Vector<String> a = new Vector<>();
protected final Vector<da> b = new Vector<>();
protected final Vector<cz> c = new Vector<>();
protected final Vector<String> d = new Vector<>();
protected String e = "";
protected String f = "";
protected int g = -1;
protected final Vector<String> h = new Vector<>();
protected final Map<String, String> i = new HashMap();
protected final Vector<da> l = new Vector<>();
private boolean q = true;
protected String n = "";
protected PurchaseManager(GameApp gameApp) {
this.j = gameApp;
p = this;
}
public static void addProduct(String str, String str2, int i, int i2, String str3) {
}
public static void addSku(String str, boolean z) {
if (p.h.contains(str)) {
return;
}
p.h.add(str);
if (z) {
p.i.put(str, "subs");
}
}
public static boolean arePaymentsAvailable() {
return p.d();
}
public static native void billingKunlunPurchaseWindowClosed(String str, String str2, int i);
public static native void billingProductBought(String str, String str2, String str3, String str4, String str5, boolean z);
public static native void billingProductCanceled(String str);
public static native void billingProductFailed(String str, String str2, int i);
public static native void billingSetMarketplace(String str);
public static void buyProduct(String str) {
p.d(str);
}
public static void cppBillingCreated() {
p.m = true;
}
public static void cppBillingDestroyed() {
p.m = false;
}
public static void finishTransaction(String str) {
p.e(str);
}
public static String getProductDetails(String str) {
return p.c(str);
}
public static boolean isWaitingForTransaction() {
boolean z;
synchronized (p) {
z = p.k > 0;
}
return (p.l.isEmpty() ? false : true) | z;
}
public static void onResume() {
}
public static native void sendPurchasingEvent(String str);
public static void setAccountId(String str) {
p.f(str);
}
public static void startBillingTransactions() {
if (p.q) {
return;
}
p.q = true;
p.b.addAll(p.l);
p.l.clear();
}
public static void stopBillingTransactions() {
p.q = false;
}
public static native void updateBillingProductDetails(String str, String str2, int i);
public static void updateDetails() {
p.b();
}
public void a() {
p = null;
}
protected final void a(int i) {
this.l.remove(i);
}
public void a(int i, Intent intent) {
}
protected final boolean a(String str) {
if (str == null || str.isEmpty()) {
return false;
}
return this.h.isEmpty() || this.h.contains(str);
}
public final String b(String str) {
String str2 = this.i.get(str);
return str2 == null ? "inapp" : str2;
}
protected abstract void b();
protected abstract String c(String str);
public final void c() {
int size = this.a.size();
for (int i = 0; i < size; i++) {
sendPurchasingEvent(this.a.remove(0));
}
if (this.m) {
if (this.o) {
this.o = false;
billingSetMarketplace(this.n);
}
if (this.e == null) {
this.e = "";
}
if (this.f == null) {
this.f = "";
}
if (!this.e.isEmpty() || !this.f.isEmpty()) {
if (this.f.isEmpty()) {
updateBillingProductDetails(this.e, "", this.g);
} else {
updateBillingProductDetails("", "", this.g);
}
this.e = "";
this.f = "";
this.g = -1;
}
if (this.q) {
int size2 = this.b.size();
for (int i2 = 0; i2 < size2; i2++) {
da daVarRemove = this.b.remove(0);
if (daVarRemove != null) {
billingProductBought(daVarRemove.c, daVarRemove.b, daVarRemove.a, daVarRemove.d, daVarRemove.e, daVarRemove.f);
if (this.l.size() >= 100) {
this.l.remove(0);
}
this.l.add(daVarRemove);
}
}
int size3 = this.c.size();
for (int i3 = 0; i3 < size3; i3++) {
cz czVarRemove = this.c.remove(0);
if (czVarRemove != null) {
billingProductFailed(czVarRemove.a, czVarRemove.b, czVarRemove.c);
}
}
int size4 = this.d.size();
for (int i4 = 0; i4 < size4; i4++) {
billingProductCanceled(this.d.remove(0));
}
}
}
}
protected abstract void d(String str);
protected abstract boolean d();
public final int e() {
return this.h.size();
}
protected abstract void e(String str);
public void f() {
}
protected void f(String str) {
}
}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,86 @@
package com.supercell.titan;
import android.view.View;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.widget.FrameLayout;
/* JADX INFO: loaded from: classes.dex */
public class TitanWebView {
private static boolean a;
private static WebView b;
private static FrameLayout c;
private static View d;
private static WebChromeClient.CustomViewCallback e;
private static ee f;
public static void addSwipeRightRecognizer() {
GameApp.getInstance().runOnUiThread(new ds());
}
public static boolean canGoBack() {
return a;
}
public static void close() {
GameApp.getInstance().runOnUiThread(new du());
}
public static void eval(String str) {
GameApp.getInstance().runOnUiThread(new dx(str));
}
public static void goBack() {
GameApp.getInstance().runOnUiThread(new eb());
}
public static void hide() {
GameApp.getInstance().runOnUiThread(new ea());
}
public static void hideCustomView() {
if (f == null) {
return;
}
f.onHideCustomView();
}
public static void init() {
GameApp gameApp = GameApp.getInstance();
gameApp.runOnUiThread(new dr(gameApp));
}
public static boolean isInCustomView() {
return d != null;
}
public static boolean isVisible() {
return b.getVisibility() == 0;
}
public static void loadHTML(String str) {
GameApp.getInstance().runOnUiThread(new dw(str));
}
public static void loadURL(String str) {
GameApp.getInstance().runOnUiThread(new dv(str));
}
public static native void onPageFinished(String str);
public static native void onPageStarted(String str);
public static native void onReceivedError(String str);
public static native void onSwipeRight();
public static void setAlpha(float f2) {
GameApp.getInstance().runOnUiThread(new dz(f2));
}
public static native boolean shouldOverrideUrlLoading(String str);
public static void show(int i, int i2, int i3, int i4) {
GameApp.getInstance().runOnUiThread(new dy(i, i2, i3, i4));
}
}
@@ -0,0 +1,83 @@
package com.supercell.titan;
import android.text.InputFilter;
import java.io.UnsupportedEncodingException;
/* JADX INFO: loaded from: classes.dex */
public class VirtualKeyboardHandler {
public static boolean a;
private static boolean c;
private static String e;
private static int b = -1;
private static int d = 1;
private static final InputFilter f = new eo();
private static void a(boolean z, boolean z2) {
GameApp gameApp = GameApp.getInstance();
ax axVar = gameApp.b;
if (axVar != null) {
gameApp.runOnUiThread(new em(axVar, z, z2));
}
a = false;
}
public static void dismissKeyboard() {
a(true, true);
}
public static void hideKeyboard() {
a(false, true);
}
public static void hideKeyboardFromResume() {
a(false, false);
}
public static void setMaxTextLength(int i, int i2) {
char c2 = 1;
if (i == b && i2 == d) {
return;
}
int i3 = i2 == 0 ? 1 : 0;
if (i >= 0) {
i3++;
}
b = i;
d = i2;
ax axVar = GameApp.getInstance().b;
InputFilter[] inputFilterArr = new InputFilter[i3];
if (i >= 0) {
inputFilterArr[0] = new InputFilter.LengthFilter(i);
} else {
c2 = 0;
}
int i4 = 301989894;
if (i2 == 0) {
inputFilterArr[c2] = f;
i4 = -1845493754;
}
axVar.c.setFilters(inputFilterArr);
axVar.c.setImeOptions(i4);
}
public static void setText(byte[] bArr) {
try {
String str = new String(bArr, "UTF-8");
GameApp gameApp = GameApp.getInstance();
gameApp.runOnUiThread(new en(gameApp, str));
} catch (UnsupportedEncodingException e2) {
GameApp.debuggerException(e2);
}
}
public static void showKeyboard() {
showKeyboard(c, e);
}
public static void showKeyboard(boolean z, String str) {
GameApp gameApp = GameApp.getInstance();
c = z;
e = str;
gameApp.runOnUiThread(new el(gameApp, z, str));
}
}
@@ -0,0 +1,24 @@
package com.supercell.titan;
import android.content.ClipData;
import android.content.ClipboardManager;
/* JADX INFO: loaded from: classes.dex */
final class a implements Runnable {
final /* synthetic */ GameApp a;
final /* synthetic */ String b;
a(GameApp gameApp, String str) {
this.a = gameApp;
this.b = str;
}
@Override // java.lang.Runnable
public final void run() {
try {
((ClipboardManager) this.a.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("text", this.b));
} catch (Exception e) {
GameApp.debuggerException(e);
}
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class aa implements Runnable {
final /* synthetic */ GoogleServiceClient a;
aa(GoogleServiceClient googleServiceClient) {
this.a = googleServiceClient;
}
@Override // java.lang.Runnable
public void run() {
GoogleServiceClient.onSignInFailed();
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class ab implements Runnable {
final /* synthetic */ GoogleServiceClient a;
ab(GoogleServiceClient googleServiceClient) {
this.a = googleServiceClient;
}
@Override // java.lang.Runnable
public void run() {
GoogleServiceClient.onSignInFailed();
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class ac implements Runnable {
final /* synthetic */ GoogleServiceClient a;
ac(GoogleServiceClient googleServiceClient) {
this.a = googleServiceClient;
}
@Override // java.lang.Runnable
public void run() {
GoogleServiceClient.onSignInFailed();
}
}
@@ -0,0 +1,27 @@
package com.supercell.titan;
import android.os.AsyncTask;
/* JADX INFO: loaded from: classes.dex */
class ad extends AsyncTask<Void, Void, Void> {
final /* synthetic */ GoogleServiceClient a;
ad(GoogleServiceClient googleServiceClient) {
this.a = googleServiceClient;
}
private Void a() {
try {
boolean unused = GoogleServiceClient.i = ((com.google.android.gms.games.video.e) com.google.android.gms.games.c.u.b(this.a.b).a()).b();
return null;
} catch (Exception e) {
boolean unused2 = GoogleServiceClient.i = false;
return null;
}
}
@Override // android.os.AsyncTask
protected /* synthetic */ Void doInBackground(Void[] voidArr) {
return a();
}
}
@@ -0,0 +1,43 @@
package com.supercell.titan;
import android.os.AsyncTask;
/* JADX INFO: loaded from: classes.dex */
class ae extends AsyncTask<Void, Void, String> {
final /* synthetic */ GoogleServiceClient a;
ae(GoogleServiceClient googleServiceClient) {
this.a = googleServiceClient;
}
private String a() {
try {
com.google.android.gms.games.m mVar = (com.google.android.gms.games.m) com.google.android.gms.games.c.a(this.a.b, this.a.a.h).a();
if (mVar.a().b()) {
return mVar.b();
}
} catch (Exception e) {
GameApp.debuggerException(e);
}
return "";
}
@Override // android.os.AsyncTask
protected /* synthetic */ String doInBackground(Void[] voidArr) {
return a();
}
@Override // android.os.AsyncTask
protected /* synthetic */ void onPostExecute(String str) {
String str2 = str;
GoogleServiceClient.a(this.a, false);
if (str2 == null || str2.length() <= 0) {
this.a.b.g();
this.a.a.a(new ag(this));
} else {
this.a.g = str2;
this.a.a.a(new af(this));
this.a.a.i.f();
}
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class af implements Runnable {
final /* synthetic */ ae a;
af(ae aeVar) {
this.a = aeVar;
}
@Override // java.lang.Runnable
public void run() {
GoogleServiceClient.onSignIn();
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class ag implements Runnable {
final /* synthetic */ ae a;
ag(ae aeVar) {
this.a = aeVar;
}
@Override // java.lang.Runnable
public void run() {
GoogleServiceClient.onSignInFailed();
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class ah implements Runnable {
final /* synthetic */ GoogleServiceClient a;
ah(GoogleServiceClient googleServiceClient) {
this.a = googleServiceClient;
}
@Override // java.lang.Runnable
public void run() {
GoogleServiceClient.onSignOut();
}
}
@@ -0,0 +1,40 @@
package com.supercell.titan;
import android.content.res.Resources;
import android.os.Handler;
import java.util.HashMap;
/* JADX INFO: loaded from: classes.dex */
final class ai implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ String b;
final /* synthetic */ String c;
ai(String str, String str2, String str3) {
this.a = str;
this.b = str2;
this.c = str3;
}
@Override // java.lang.Runnable
public final void run() {
Handler unused = HelpshiftTitan.j = new aj(this);
try {
HashMap map = new HashMap();
map.put("enableInAppNotification", true);
try {
int identifier = GameApp.getInstance().getResources().getIdentifier("ic_notification", "drawable", GameApp.getInstance().getPackageName());
if (identifier != 0) {
map.put("notificationIcon", Integer.valueOf(identifier));
}
} catch (Resources.NotFoundException e) {
}
HelpshiftTitan.callInit();
com.helpshift.a.a(GameApp.getInstance().getApplication(), this.a, this.b, this.c, map);
com.helpshift.support.de.a(new ak(this));
com.helpshift.support.de.a(new ap());
} catch (Exception e2) {
GameApp.debuggerException(e2);
}
}
}
@@ -0,0 +1,23 @@
package com.supercell.titan;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
/* JADX INFO: loaded from: classes.dex */
class aj extends Handler {
final /* synthetic */ ai a;
aj(ai aiVar) {
this.a = aiVar;
}
@Override // android.os.Handler
public void handleMessage(Message message) {
super.handleMessage(message);
try {
int unused = HelpshiftTitan.a = ((Bundle) message.obj).getInt("value");
} catch (Exception e) {
}
}
}
@@ -0,0 +1,20 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class ak implements com.helpshift.support.dp {
final /* synthetic */ ai a;
ak(ai aiVar) {
this.a = aiVar;
}
@Override // com.helpshift.support.dv
public final void a() {
boolean unused = HelpshiftTitan.k = true;
}
@Override // com.helpshift.support.dv
public final void b() {
boolean unused = HelpshiftTitan.k = false;
}
}
@@ -0,0 +1,23 @@
package com.supercell.titan;
import java.util.HashMap;
/* JADX INFO: loaded from: classes.dex */
final class al implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ HashMap b;
al(String str, HashMap map) {
this.a = str;
this.b = map;
}
@Override // java.lang.Runnable
public final void run() {
try {
HelpshiftTitan.b(true);
com.helpshift.support.de.a(GameApp.getInstance(), this.a, this.b);
} catch (Exception e) {
}
}
}
@@ -0,0 +1,18 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class am implements Runnable {
final /* synthetic */ String a;
am(String str) {
this.a = str;
}
@Override // java.lang.Runnable
public final void run() {
try {
com.helpshift.support.de.b(this.a);
} catch (Exception e) {
}
}
}
@@ -0,0 +1,18 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class an implements Runnable {
final /* synthetic */ String a;
an(String str) {
this.a = str;
}
@Override // java.lang.Runnable
public final void run() {
try {
com.helpshift.support.de.c(this.a);
} catch (Exception e) {
}
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
import android.os.Handler;
/* JADX INFO: loaded from: classes.dex */
final class ao implements Runnable {
ao() {
}
@Override // java.lang.Runnable
public final void run() {
try {
com.helpshift.support.de.a(HelpshiftTitan.j, new Handler());
} catch (Exception e) {
}
}
}
@@ -0,0 +1,18 @@
package com.supercell.titan;
import java.util.HashMap;
/* JADX INFO: loaded from: classes.dex */
final class ap implements com.helpshift.support.b {
ap() {
}
@Override // com.helpshift.support.b
public final HashMap<String, Object> a() {
HashMap<String, Object> map = new HashMap<>(HelpshiftTitan.c);
if (HelpshiftTitan.d.length > 0) {
map.put("hs-tags", HelpshiftTitan.e);
}
return map;
}
}
@@ -0,0 +1,16 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class aq implements Runnable {
aq() {
}
@Override // java.lang.Runnable
public final void run() {
try {
com.helpshift.support.de.a(new ap());
} catch (Exception e) {
GameApp.debuggerException(e);
}
}
}
@@ -0,0 +1,18 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class ar implements Runnable {
final /* synthetic */ String a;
ar(String str) {
this.a = str;
}
@Override // java.lang.Runnable
public final void run() {
try {
com.helpshift.support.de.a(this.a);
} catch (Exception e) {
}
}
}
@@ -0,0 +1,20 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class as implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ String b;
as(String str, String str2) {
this.a = str;
this.b = str2;
}
@Override // java.lang.Runnable
public final void run() {
try {
com.helpshift.a.a(this.a, this.b);
} catch (Exception e) {
}
}
}
@@ -0,0 +1,20 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class at implements Runnable {
final /* synthetic */ GameApp a;
final /* synthetic */ String b;
at(GameApp gameApp, String str) {
this.a = gameApp;
this.b = str;
}
@Override // java.lang.Runnable
public final void run() {
try {
com.helpshift.a.a(this.a, this.b);
} catch (Exception e) {
}
}
}
@@ -0,0 +1,21 @@
package com.supercell.titan;
import java.util.HashMap;
/* JADX INFO: loaded from: classes.dex */
final class au implements Runnable {
final /* synthetic */ HashMap a;
au(HashMap map) {
this.a = map;
}
@Override // java.lang.Runnable
public final void run() {
try {
HelpshiftTitan.b(true);
com.helpshift.support.de.a(GameApp.getInstance(), this.a);
} catch (Exception e) {
}
}
}
@@ -0,0 +1,21 @@
package com.supercell.titan;
import java.util.HashMap;
/* JADX INFO: loaded from: classes.dex */
final class av implements Runnable {
final /* synthetic */ HashMap a;
av(HashMap map) {
this.a = map;
}
@Override // java.lang.Runnable
public final void run() {
try {
HelpshiftTitan.b(true);
com.helpshift.support.de.b(GameApp.getInstance(), this.a);
} catch (Exception e) {
}
}
}
@@ -0,0 +1,23 @@
package com.supercell.titan;
import java.util.HashMap;
/* JADX INFO: loaded from: classes.dex */
final class aw implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ HashMap b;
aw(String str, HashMap map) {
this.a = str;
this.b = map;
}
@Override // java.lang.Runnable
public final void run() {
try {
HelpshiftTitan.b(true);
com.helpshift.support.de.b(GameApp.getInstance(), this.a, this.b);
} catch (Exception e) {
}
}
}
@@ -0,0 +1,100 @@
package com.supercell.titan;
import android.app.Dialog;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.ColorDrawable;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.RelativeLayout;
import com.facebook.internal.NativeProtocol;
import java.util.concurrent.atomic.AtomicInteger;
/* JADX INFO: loaded from: classes.dex */
public class ax extends Dialog {
private static final AtomicInteger h = new AtomicInteger(1);
final GameApp a;
final Button b;
final dl c;
Typeface d;
final int e;
final Rect f;
private final be g;
public ax(GameApp gameApp) {
super(gameApp);
this.f = new Rect();
this.a = gameApp;
requestWindowFeature(1);
this.c = new dl(gameApp);
this.b = new Button(gameApp);
this.g = new be(gameApp);
Point point = new Point();
gameApp.getWindowManager().getDefaultDisplay().getSize(point);
this.e = point.x;
}
public final void a() {
Window window = getWindow();
window.clearFlags(2);
window.setBackgroundDrawable(new ColorDrawable(0));
window.setLayout(-1, -1);
if (Build.VERSION.SDK_INT >= 19) {
window.setFlags(134217728, 134217728);
window.setFlags(67108864, 67108864);
}
window.setFlags(1024, 1024);
}
public final void a(boolean z, boolean z2) {
hide();
InputMethodManager inputMethodManager = (InputMethodManager) this.a.getSystemService("input_method");
if (inputMethodManager == null || this.c == null) {
return;
}
inputMethodManager.hideSoftInputFromWindow(this.c.getWindowToken(), 0);
this.c.clearFocus();
if (z && !z2) {
this.a.a(new bd(this));
}
this.a.a();
this.a.a(2000L);
}
@Override // android.app.Dialog
protected void onCreate(Bundle bundle) {
int i;
int i2;
super.onCreate(bundle);
this.d = this.c.getTypeface();
this.c.setFocusable(true);
this.c.setInputType(NativeProtocol.MESSAGE_GET_ACCESS_TOKEN_REPLY);
this.c.setSingleLine();
this.g.setOnTouchListener(new ay(this));
if (Build.VERSION.SDK_INT < 17) {
Button button = this.b;
do {
i = h.get();
i2 = i + 1;
if (i2 > 16777215) {
i2 = 1;
}
} while (!h.compareAndSet(i, i2));
button.setId(i);
} else {
this.b.setId(View.generateViewId());
}
this.b.setOnClickListener(new az(this));
RelativeLayout.LayoutParams layoutParams = new RelativeLayout.LayoutParams(-1, -1);
this.g.addView(this.b);
this.g.addView(this.c);
this.g.setFitsSystemWindows(true);
setContentView(this.g, layoutParams);
a();
}
}
@@ -0,0 +1,19 @@
package com.supercell.titan;
import android.view.MotionEvent;
import android.view.View;
/* JADX INFO: loaded from: classes.dex */
class ay implements View.OnTouchListener {
final /* synthetic */ ax a;
ay(ax axVar) {
this.a = axVar;
}
@Override // android.view.View.OnTouchListener
public boolean onTouch(View view, MotionEvent motionEvent) {
motionEvent.setLocation(motionEvent.getRawX(), motionEvent.getRawY());
return this.a.a.d.dispatchTouchEvent(motionEvent);
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
import android.view.View;
/* JADX INFO: loaded from: classes.dex */
class az implements View.OnClickListener {
final /* synthetic */ ax a;
az(ax axVar) {
this.a = axVar;
}
@Override // android.view.View.OnClickListener
public void onClick(View view) {
this.a.a.a(new ba(this));
}
}
@@ -0,0 +1,38 @@
package com.supercell.titan;
import android.content.ClipboardManager;
import java.io.UnsupportedEncodingException;
import java.util.concurrent.Callable;
/* JADX INFO: loaded from: classes.dex */
final class b implements Callable<String> {
final /* synthetic */ GameApp a;
b(GameApp gameApp) {
this.a = gameApp;
}
/* JADX INFO: Access modifiers changed from: private */
@Override // java.util.concurrent.Callable
/* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
public String call() {
String string;
ClipboardManager clipboardManager;
try {
clipboardManager = (ClipboardManager) this.a.getSystemService("clipboard");
} catch (Exception e) {
GameApp.debuggerException(e);
}
if (!clipboardManager.hasPrimaryClip() || clipboardManager.getPrimaryClip().getItemCount() <= 0) {
string = "";
} else {
string = clipboardManager.getPrimaryClip().getItemAt(0).getText().toString();
try {
string.getBytes("UTF-8");
} catch (UnsupportedEncodingException e2) {
return "";
}
}
return string;
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class ba implements Runnable {
final /* synthetic */ az a;
ba(az azVar) {
this.a = azVar;
}
@Override // java.lang.Runnable
public void run() {
GameApp.inputOkPressed();
}
}
@@ -0,0 +1,24 @@
package com.supercell.titan;
import android.graphics.Typeface;
/* JADX INFO: loaded from: classes.dex */
class bb implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ ax b;
bb(ax axVar, String str) {
this.b = axVar;
this.a = str;
}
@Override // java.lang.Runnable
public void run() {
Typeface typefaceA;
String fontPath = GameApp.getFontPath(this.a);
if (fontPath == null || fontPath.trim().length() <= 0 || (typefaceA = e.a(this.b.a, fontPath)) == null) {
return;
}
this.b.a.runOnUiThread(new bc(this, typefaceA));
}
}
@@ -0,0 +1,19 @@
package com.supercell.titan;
import android.graphics.Typeface;
/* JADX INFO: loaded from: classes.dex */
class bc implements Runnable {
final /* synthetic */ Typeface a;
final /* synthetic */ bb b;
bc(bb bbVar, Typeface typeface) {
this.b = bbVar;
this.a = typeface;
}
@Override // java.lang.Runnable
public void run() {
this.b.b.c.setTypeface(this.a);
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class bd implements Runnable {
final /* synthetic */ ax a;
bd(ax axVar) {
this.a = axVar;
}
@Override // java.lang.Runnable
public void run() {
GameApp.inputKeyboardDismissed();
}
}
@@ -0,0 +1,22 @@
package com.supercell.titan;
import android.view.KeyEvent;
import android.widget.RelativeLayout;
/* JADX INFO: loaded from: classes.dex */
class be extends RelativeLayout {
private final GameApp a;
public be(GameApp gameApp) {
super(gameApp);
this.a = gameApp;
}
@Override // android.view.ViewGroup, android.view.View
public boolean dispatchKeyEventPreIme(KeyEvent keyEvent) {
if (keyEvent.getKeyCode() == 4 && keyEvent.getAction() == 1) {
this.a.runOnUiThread(new bf(this));
}
return super.dispatchKeyEventPreIme(keyEvent);
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class bf implements Runnable {
final /* synthetic */ be a;
bf(be beVar) {
this.a = beVar;
}
@Override // java.lang.Runnable
public void run() {
this.a.a.b.a(true, false);
}
}
@@ -0,0 +1,30 @@
package com.supercell.titan;
import android.support.v4.app.ActivityCompat;
import java.util.Vector;
/* JADX INFO: loaded from: classes.dex */
class bg implements Runnable {
final /* synthetic */ LocationService a;
final /* synthetic */ LocationService b;
bg(LocationService locationService, LocationService locationService2) {
this.b = locationService;
this.a = locationService2;
}
@Override // java.lang.Runnable
public void run() {
if (ActivityCompat.checkSelfPermission(this.b.d, "android.permission.ACCESS_FINE_LOCATION") == 0) {
this.b.a();
return;
}
GameApp gameApp = this.b.d;
LocationService locationService = this.a;
if (gameApp.c == null) {
gameApp.c = new Vector<>();
}
gameApp.c.add(locationService);
ActivityCompat.requestPermissions(this.b.d, this.b.b, 1);
}
}
@@ -0,0 +1,34 @@
package com.supercell.titan;
import android.location.Criteria;
import android.location.Location;
/* JADX INFO: loaded from: classes.dex */
class bh implements Runnable {
final /* synthetic */ LocationService a;
final /* synthetic */ LocationService b;
bh(LocationService locationService, LocationService locationService2) {
this.b = locationService;
this.a = locationService2;
}
@Override // java.lang.Runnable
public void run() {
try {
Location locationD = LocationService.d(this.b);
if (locationD != null) {
String str = "Sending last known location: " + locationD;
this.b.onLocationChanged(locationD);
}
Criteria criteria = new Criteria();
criteria.setAccuracy(1);
this.b.f = this.b.c.getBestProvider(criteria, true);
if (this.b.f == null) {
return;
}
this.b.c.requestLocationUpdates(this.b.f, 1000L, 10.0f, this.a);
} catch (SecurityException e) {
}
}
}
@@ -0,0 +1,21 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class bi implements Runnable {
final /* synthetic */ LocationService a;
final /* synthetic */ LocationService b;
bi(LocationService locationService, LocationService locationService2) {
this.b = locationService;
this.a = locationService2;
}
@Override // java.lang.Runnable
public void run() {
try {
this.b.c.removeUpdates(this.a);
this.b.d.a(this.a);
} catch (SecurityException e) {
}
}
}
@@ -0,0 +1,19 @@
package com.supercell.titan;
import android.content.Intent;
import java.util.concurrent.Callable;
/* JADX INFO: loaded from: classes.dex */
class bj implements Callable<Boolean> {
final /* synthetic */ LocationService a;
bj(LocationService locationService) {
this.a = locationService;
}
@Override // java.util.concurrent.Callable
public /* synthetic */ Boolean call() {
this.a.d.startActivity(new Intent("android.settings.LOCATION_SOURCE_SETTINGS"));
return true;
}
}
@@ -0,0 +1,19 @@
package com.supercell.titan;
import android.location.Location;
/* JADX INFO: loaded from: classes.dex */
class bk implements Runnable {
final /* synthetic */ Location a;
final /* synthetic */ LocationService b;
bk(LocationService locationService, Location location) {
this.b = locationService;
this.a = location;
}
@Override // java.lang.Runnable
public void run() {
LocationService.locationChanged(this.b.e, this.a.getLatitude(), this.a.getLongitude());
}
}
@@ -0,0 +1,46 @@
package com.supercell.titan;
import android.os.Bundle;
import com.facebook.share.internal.ShareConstants;
/* JADX INFO: loaded from: classes.dex */
final class bl implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ String b;
final /* synthetic */ String c;
final /* synthetic */ String d;
final /* synthetic */ String e;
final /* synthetic */ int f;
final /* synthetic */ GameApp g;
bl(String str, String str2, String str3, String str4, String str5, int i, GameApp gameApp) {
this.a = str;
this.b = str2;
this.c = str3;
this.d = str4;
this.e = str5;
this.f = i;
this.g = gameApp;
}
@Override // java.lang.Runnable
public final void run() {
NativeDialogManager nativeDialogManager = new NativeDialogManager();
nativeDialogManager.setStyle(0, android.R.style.Theme.DeviceDefault.Dialog);
Bundle bundle = new Bundle();
bundle.putString(ShareConstants.WEB_DIALOG_PARAM_TITLE, this.a);
bundle.putString(ShareConstants.WEB_DIALOG_PARAM_MESSAGE, this.b);
bundle.putString("button", this.c);
bundle.putString("button2", this.d);
bundle.putString("button3", this.e);
bundle.putInt(ShareConstants.WEB_DIALOG_PARAM_ID, this.f);
nativeDialogManager.setArguments(bundle);
try {
nativeDialogManager.show(this.g.getFragmentManager(), "NativeDialog");
NativeDialogManager unused = NativeDialogManager.g = nativeDialogManager;
this.g.d.setRenderMode(0);
} catch (Exception e) {
GameApp.debuggerException(e);
}
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
import android.content.DialogInterface;
/* JADX INFO: loaded from: classes.dex */
class bm implements DialogInterface.OnClickListener {
final /* synthetic */ NativeDialogManager a;
bm(NativeDialogManager nativeDialogManager) {
this.a = nativeDialogManager;
}
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
this.a.a(this.a.e, i == -1 ? 1 : i == -2 ? 2 : 0);
}
}
@@ -0,0 +1,23 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class bn {
String a;
String b;
String c;
String d;
String e;
int f;
private bn() {
this.a = "";
this.b = "";
this.c = "";
this.d = "";
this.e = "";
}
/* synthetic */ bn(byte b) {
this();
}
}
@@ -0,0 +1,46 @@
package com.supercell.titan;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.login.LoginManager;
import com.facebook.login.LoginResult;
import java.util.Iterator;
import java.util.Set;
/* JADX INFO: loaded from: classes.dex */
class bo implements FacebookCallback<LoginResult> {
final /* synthetic */ GameApp a;
final /* synthetic */ NativeFacebookManager b;
bo(NativeFacebookManager nativeFacebookManager, GameApp gameApp) {
this.b = nativeFacebookManager;
this.a = gameApp;
}
@Override // com.facebook.FacebookCallback
public void onCancel() {
this.a.a(new bp(this));
}
@Override // com.facebook.FacebookCallback
public void onError(FacebookException facebookException) {
this.a.a(new bq(this));
}
@Override // com.facebook.FacebookCallback
public /* synthetic */ void onSuccess(LoginResult loginResult) {
LoginResult loginResult2 = loginResult;
if (loginResult2.getAccessToken() != null) {
Set<String> recentlyDeniedPermissions = loginResult2.getRecentlyDeniedPermissions();
Iterator it = this.b.d.iterator();
while (it.hasNext()) {
if (recentlyDeniedPermissions.contains((String) it.next())) {
LoginManager.getInstance().logInWithReadPermissions(this.a, this.b.d);
}
}
}
if (this.b.e != 0) {
this.b.a(this.b.e);
}
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class bp implements Runnable {
final /* synthetic */ bo a;
bp(bo boVar) {
this.a = boVar;
}
@Override // java.lang.Runnable
public void run() {
NativeFacebookManager.facebookLogout();
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class bq implements Runnable {
final /* synthetic */ bo a;
bq(bo boVar) {
this.a = boVar;
}
@Override // java.lang.Runnable
public void run() {
NativeFacebookManager.facebookLogout();
}
}
@@ -0,0 +1,14 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class br implements Runnable {
br() {
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.d(NativeFacebookManager.c);
}
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
import com.facebook.login.LoginManager;
/* JADX INFO: loaded from: classes.dex */
final class bs implements Runnable {
bs() {
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager nativeFacebookManager = NativeFacebookManager.c;
LoginManager.getInstance().logOut();
}
}
}
@@ -0,0 +1,14 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class bt implements Runnable {
bt() {
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.c.a(2);
}
}
}
@@ -0,0 +1,18 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class bu implements Runnable {
final /* synthetic */ String a;
bu(String str) {
this.a = str;
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.c.f = this.a;
NativeFacebookManager.c.a(3);
}
}
}
@@ -0,0 +1,14 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class bv implements Runnable {
bv() {
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.f(NativeFacebookManager.c);
}
}
}
@@ -0,0 +1,25 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class bw implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ String b;
final /* synthetic */ String c;
final /* synthetic */ String d;
final /* synthetic */ String e;
bw(String str, String str2, String str3, String str4, String str5) {
this.a = str;
this.b = str2;
this.c = str3;
this.d = str4;
this.e = str5;
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.a(NativeFacebookManager.c, this.a, this.b, this.c, this.d, this.e);
}
}
}
@@ -0,0 +1,23 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class bx implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ String b;
final /* synthetic */ String c;
final /* synthetic */ String d;
bx(String str, String str2, String str3, String str4) {
this.a = str;
this.b = str2;
this.c = str3;
this.d = str4;
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.a(NativeFacebookManager.c, this.a, this.b, this.c, this.d);
}
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class by implements Runnable {
final /* synthetic */ String a;
by(String str) {
this.a = str;
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.b(NativeFacebookManager.c, this.a);
}
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class bz implements Runnable {
final /* synthetic */ String a;
bz(String str) {
this.a = str;
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.c(NativeFacebookManager.c, this.a);
}
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class c implements Runnable {
final /* synthetic */ f a;
final /* synthetic */ boolean b;
c(f fVar, boolean z) {
this.a = fVar;
this.b = z;
}
@Override // java.lang.Runnable
public final void run() {
this.a.setKeepScreenOn(this.b);
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class ca implements Runnable {
final /* synthetic */ String a;
ca(String str) {
this.a = str;
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.d(NativeFacebookManager.c, this.a);
}
}
}
@@ -0,0 +1,25 @@
package com.supercell.titan;
import com.facebook.Profile;
import com.facebook.ProfileTracker;
/* JADX INFO: loaded from: classes.dex */
class cb extends ProfileTracker {
final /* synthetic */ GameApp a;
final /* synthetic */ NativeFacebookManager b;
cb(NativeFacebookManager nativeFacebookManager, GameApp gameApp) {
this.b = nativeFacebookManager;
this.a = gameApp;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // com.facebook.ProfileTracker
public void onCurrentProfileChanged(Profile profile, Profile profile2) {
if (profile2 != null) {
this.b.a(1);
} else {
this.a.a(new cc(this));
}
}
}
@@ -0,0 +1,15 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class cc implements Runnable {
final /* synthetic */ cb a;
cc(cb cbVar) {
this.a = cbVar;
}
@Override // java.lang.Runnable
public void run() {
NativeFacebookManager.facebookLogout();
}
}
@@ -0,0 +1,14 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
final class cd implements Runnable {
cd() {
}
@Override // java.lang.Runnable
public final void run() {
if (NativeFacebookManager.c != null) {
NativeFacebookManager.c.e();
}
}
}
@@ -0,0 +1,26 @@
package com.supercell.titan;
import com.facebook.FacebookException;
import com.facebook.GraphRequest;
/* JADX INFO: loaded from: classes.dex */
class ce implements Runnable {
final /* synthetic */ GraphRequest a;
final /* synthetic */ NativeFacebookManager b;
ce(NativeFacebookManager nativeFacebookManager, GraphRequest graphRequest) {
this.b = nativeFacebookManager;
this.a = graphRequest;
}
@Override // java.lang.Runnable
public void run() {
try {
GraphRequest.executeBatchAsync(this.a);
} catch (FacebookException e) {
GameApp.debuggerException(e);
} catch (IllegalStateException e2) {
GameApp.debuggerException(e2);
}
}
}
@@ -0,0 +1,28 @@
package com.supercell.titan;
import com.facebook.FacebookException;
import com.facebook.GraphRequest;
/* JADX INFO: loaded from: classes.dex */
class cf implements Runnable {
final /* synthetic */ GraphRequest a;
final /* synthetic */ NativeFacebookManager b;
cf(NativeFacebookManager nativeFacebookManager, GraphRequest graphRequest) {
this.b = nativeFacebookManager;
this.a = graphRequest;
}
@Override // java.lang.Runnable
public void run() {
try {
this.a.executeAsync();
} catch (FacebookException e) {
GameApp.debuggerException(e);
} catch (IllegalStateException e2) {
GameApp.debuggerException(e2);
} catch (Exception e3) {
GameApp.debuggerException(e3);
}
}
}
@@ -0,0 +1,37 @@
package com.supercell.titan;
import android.widget.Toast;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.FacebookOperationCanceledException;
import com.facebook.share.Sharer;
/* JADX INFO: loaded from: classes.dex */
class cg implements FacebookCallback<Sharer.Result> {
final /* synthetic */ NativeFacebookManager a;
cg(NativeFacebookManager nativeFacebookManager) {
this.a = nativeFacebookManager;
}
@Override // com.facebook.FacebookCallback
public void onCancel() {
Toast.makeText(this.a.b.getApplicationContext(), "Publish cancelled", 0).show();
}
@Override // com.facebook.FacebookCallback
public void onError(FacebookException facebookException) {
if (facebookException instanceof FacebookOperationCanceledException) {
Toast.makeText(this.a.b.getApplicationContext(), "Publish cancelled", 0).show();
} else {
Toast.makeText(this.a.b.getApplicationContext(), "Error posting story", 0).show();
}
}
@Override // com.facebook.FacebookCallback
public /* synthetic */ void onSuccess(Sharer.Result result) {
if (result.getPostId() != null) {
Toast.makeText(this.a.b, "Posted story", 0).show();
}
}
}
@@ -0,0 +1,45 @@
package com.supercell.titan;
import android.net.Uri;
import com.facebook.share.model.ShareContent;
import com.facebook.share.model.ShareLinkContent;
import com.facebook.share.widget.ShareDialog;
/* JADX INFO: loaded from: classes.dex */
class ch implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ String b;
final /* synthetic */ String c;
final /* synthetic */ String d;
final /* synthetic */ ShareDialog e;
final /* synthetic */ NativeFacebookManager f;
ch(NativeFacebookManager nativeFacebookManager, String str, String str2, String str3, String str4, ShareDialog shareDialog) {
this.f = nativeFacebookManager;
this.a = str;
this.b = str2;
this.c = str3;
this.d = str4;
this.e = shareDialog;
}
@Override // java.lang.Runnable
public void run() {
if (ShareDialog.canShow((Class<? extends ShareContent>) ShareLinkContent.class)) {
ShareLinkContent.Builder builder = new ShareLinkContent.Builder();
if (!this.a.isEmpty()) {
builder.setContentTitle(this.a);
}
if (!this.b.isEmpty()) {
builder.setContentDescription(this.b);
}
if (!this.c.isEmpty()) {
builder.setContentUrl(Uri.parse(this.c));
}
if (!this.d.isEmpty()) {
builder.setImageUrl(Uri.parse(this.d));
}
this.e.show(builder.build());
}
}
}
@@ -0,0 +1,37 @@
package com.supercell.titan;
import android.widget.Toast;
import com.facebook.FacebookCallback;
import com.facebook.FacebookException;
import com.facebook.FacebookOperationCanceledException;
import com.facebook.share.widget.GameRequestDialog;
/* JADX INFO: loaded from: classes.dex */
class ci implements FacebookCallback<GameRequestDialog.Result> {
final /* synthetic */ NativeFacebookManager a;
ci(NativeFacebookManager nativeFacebookManager) {
this.a = nativeFacebookManager;
}
@Override // com.facebook.FacebookCallback
public void onCancel() {
Toast.makeText(this.a.b.getApplicationContext(), "Request cancelled", 0).show();
}
@Override // com.facebook.FacebookCallback
public void onError(FacebookException facebookException) {
if (facebookException instanceof FacebookOperationCanceledException) {
Toast.makeText(this.a.b.getApplicationContext(), "Request cancelled", 0).show();
} else {
Toast.makeText(this.a.b.getApplicationContext(), "Network Error", 0).show();
}
}
@Override // com.facebook.FacebookCallback
public /* synthetic */ void onSuccess(GameRequestDialog.Result result) {
if (result.getRequestId() != null) {
Toast.makeText(this.a.b.getApplicationContext(), "Request sent", 0).show();
}
}
}
@@ -0,0 +1,41 @@
package com.supercell.titan;
import com.facebook.share.model.GameRequestContent;
import com.facebook.share.widget.GameRequestDialog;
/* JADX INFO: loaded from: classes.dex */
class cj implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ String b;
final /* synthetic */ String c;
final /* synthetic */ String d;
final /* synthetic */ GameRequestDialog e;
final /* synthetic */ NativeFacebookManager f;
cj(NativeFacebookManager nativeFacebookManager, String str, String str2, String str3, String str4, GameRequestDialog gameRequestDialog) {
this.f = nativeFacebookManager;
this.a = str;
this.b = str2;
this.c = str3;
this.d = str4;
this.e = gameRequestDialog;
}
@Override // java.lang.Runnable
public void run() {
GameRequestContent.Builder builder = new GameRequestContent.Builder();
if (!this.a.isEmpty()) {
builder.setMessage(this.a);
}
if (!this.b.isEmpty()) {
builder.setTitle(this.b);
}
if (!this.c.isEmpty()) {
builder.setData(this.c);
}
if (!this.d.isEmpty()) {
builder.setTo(this.d);
}
this.e.show(builder.build());
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
/* JADX INFO: loaded from: classes.dex */
class ck implements GraphRequest.Callback {
final /* synthetic */ NativeFacebookManager a;
ck(NativeFacebookManager nativeFacebookManager) {
this.a = nativeFacebookManager;
}
@Override // com.facebook.GraphRequest.Callback
public void onCompleted(GraphResponse graphResponse) {
}
}
@@ -0,0 +1,21 @@
package com.supercell.titan;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
/* JADX INFO: loaded from: classes.dex */
public class cl implements GraphRequest.Callback {
private final GameApp a;
public cl(GameApp gameApp) {
this.a = gameApp;
}
@Override // com.facebook.GraphRequest.Callback
public void onCompleted(GraphResponse graphResponse) {
String string = graphResponse.getJSONObject() != null ? graphResponse.getJSONObject().toString() : "";
if (graphResponse.getError() == null) {
this.a.a(new cm(this, string));
}
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class cm implements Runnable {
final /* synthetic */ String a;
final /* synthetic */ cl b;
cm(cl clVar, String str) {
this.b = clVar;
this.a = str;
}
@Override // java.lang.Runnable
public void run() {
NativeFacebookManager.facebookUserInfo(this.a);
}
}
@@ -0,0 +1,25 @@
package com.supercell.titan;
import com.facebook.FacebookRequestError;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import org.json.JSONArray;
/* JADX INFO: loaded from: classes.dex */
public class cn implements GraphRequest.GraphJSONArrayCallback {
private final GameApp a;
public cn(GameApp gameApp) {
this.a = gameApp;
}
@Override // com.facebook.GraphRequest.GraphJSONArrayCallback
public void onCompleted(JSONArray jSONArray, GraphResponse graphResponse) {
FacebookRequestError error = graphResponse.getError();
if (error != null) {
GameApp.debuggerWarning("NativeFacebookRequestFriendsCallback: " + error.getErrorMessage());
} else {
this.a.a(new co(this, graphResponse));
}
}
}
@@ -0,0 +1,21 @@
package com.supercell.titan;
import com.facebook.GraphResponse;
import org.json.JSONObject;
/* JADX INFO: loaded from: classes.dex */
class co implements Runnable {
final /* synthetic */ GraphResponse a;
final /* synthetic */ cn b;
co(cn cnVar, GraphResponse graphResponse) {
this.b = cnVar;
this.a = graphResponse;
}
@Override // java.lang.Runnable
public void run() {
JSONObject jSONObject = this.a.getJSONObject();
NativeFacebookManager.facebookFriends(jSONObject != null ? jSONObject.toString() : "");
}
}
@@ -0,0 +1,37 @@
package com.supercell.titan;
import android.os.Bundle;
import com.facebook.AccessToken;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.HttpMethod;
import com.facebook.share.internal.ShareConstants;
import com.mobileapptracker.MATEvent;
import org.json.JSONException;
/* JADX INFO: loaded from: classes.dex */
public class cp implements GraphRequest.Callback {
private final String a;
public cp(String str) {
this.a = str;
}
@Override // com.facebook.GraphRequest.Callback
public void onCompleted(GraphResponse graphResponse) {
if (AccessToken.getCurrentAccessToken() == null || AccessToken.getCurrentAccessToken().isExpired()) {
return;
}
try {
int i = graphResponse.getJSONObject().getJSONObject(MATEvent.SHARE).getInt("share_count");
Bundle bundle = new Bundle();
bundle.putString(GraphRequest.FIELDS_PARAM, ShareConstants.WEB_DIALOG_PARAM_ID);
bundle.putString("object", this.a);
GraphRequest.executeBatchAsync(new GraphRequest(AccessToken.getCurrentAccessToken(), "me/og.likes", bundle, HttpMethod.GET, new cq(this, i)));
} catch (JSONException e) {
GameApp.debuggerException(e);
} catch (Exception e2) {
GameApp.debuggerException(e2);
}
}
}
@@ -0,0 +1,28 @@
package com.supercell.titan;
import com.facebook.GraphRequest;
import com.facebook.GraphResponse;
import com.facebook.share.internal.ShareConstants;
import org.json.JSONException;
/* JADX INFO: loaded from: classes.dex */
class cq implements GraphRequest.Callback {
final /* synthetic */ int a;
final /* synthetic */ cp b;
cq(cp cpVar, int i) {
this.b = cpVar;
this.a = i;
}
@Override // com.facebook.GraphRequest.Callback
public void onCompleted(GraphResponse graphResponse) {
try {
GameApp.getInstance().a(new cr(this, graphResponse.getJSONObject().getJSONArray(ShareConstants.WEB_DIALOG_PARAM_DATA).length() > 0));
} catch (JSONException e) {
GameApp.debuggerException(e);
} catch (Exception e2) {
GameApp.debuggerException(e2);
}
}
}
@@ -0,0 +1,17 @@
package com.supercell.titan;
/* JADX INFO: loaded from: classes.dex */
class cr implements Runnable {
final /* synthetic */ boolean a;
final /* synthetic */ cq b;
cr(cq cqVar, boolean z) {
this.b = cqVar;
this.a = z;
}
@Override // java.lang.Runnable
public void run() {
NativeFacebookManager.facebookLinkStatistics(this.a, this.b.a, this.b.b.a);
}
}

Some files were not shown because too many files have changed in this diff Show More