PageRenderTime 64ms CodeModel.GetById 24ms RepoModel.GetById 0ms app.codeStats 1ms

/ANE3Source/src/com/adobe/air/AndroidActivityWrapper.java

https://github.com/SixMinute/ANEResourcesBugExample
Java | 2382 lines | 2168 code | 201 blank | 13 comment | 312 complexity | 6584bbda9430600e1e1f081d9cbf23e7 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. // Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.geocities.com/kpdus/jad.html
  3. // Decompiler options: braces fieldsfirst space lnc
  4. package com.adobe.air;
  5. import android.app.Activity;
  6. import android.app.Application;
  7. import android.app.Dialog;
  8. import android.app.KeyguardManager;
  9. import android.content.ActivityNotFoundException;
  10. import android.content.Context;
  11. import android.content.Intent;
  12. import android.content.pm.ActivityInfo;
  13. import android.content.pm.ApplicationInfo;
  14. import android.content.pm.PackageManager;
  15. import android.content.res.Configuration;
  16. import android.content.res.Resources;
  17. import android.graphics.Bitmap;
  18. import android.graphics.Canvas;
  19. import android.media.AudioManager;
  20. import android.os.Build;
  21. import android.os.Bundle;
  22. import android.util.AttributeSet;
  23. import android.view.ContextMenu;
  24. import android.view.KeyEvent;
  25. import android.view.Menu;
  26. import android.view.MenuItem;
  27. import android.view.MotionEvent;
  28. import android.view.Surface;
  29. import android.view.SurfaceHolder;
  30. import android.view.SurfaceView;
  31. import android.view.View;
  32. import android.widget.FrameLayout;
  33. import android.widget.RelativeLayout;
  34. import com.adobe.air.telephony.AndroidTelephonyManager;
  35. import com.adobe.air.utils.Utils;
  36. import com.adobe.flashplayer.HDMIUtils;
  37. import java.io.File;
  38. import java.io.IOException;
  39. import java.net.InetAddress;
  40. import java.net.ServerSocket;
  41. import java.net.Socket;
  42. import java.net.URISyntaxException;
  43. import java.util.ArrayList;
  44. import java.util.HashMap;
  45. import java.util.List;
  46. import java.util.concurrent.locks.Condition;
  47. import java.util.concurrent.locks.Lock;
  48. import java.util.concurrent.locks.ReentrantLock;
  49. // Referenced classes of package com.adobe.air:
  50. // DebuggerSettings, Entrypoints, AndroidIdleState, AIRWindowSurfaceView,
  51. // AndroidCameraView, OrientationManager, ResourceFileManager, ApplicationFileManager,
  52. // ListenErrorDialog, RemoteDebuggerListenerDialog, RemoteDebuggerDialog, AIRUpdateDialog,
  53. // FlashEGL, DeviceProfiling, ConfigDownloadListener
  54. public class AndroidActivityWrapper
  55. {
  56. static interface ActivityResultCallback
  57. {
  58. public abstract void onActivityResult(int i, int j, Intent intent);
  59. }
  60. public static final class ActivityState extends Enum
  61. {
  62. private static final ActivityState $VALUES[];
  63. public static final ActivityState DESTROYED;
  64. public static final ActivityState PAUSED;
  65. public static final ActivityState RESTARTED;
  66. public static final ActivityState RESUMED;
  67. public static final ActivityState STARTED;
  68. public static final ActivityState STOPPED;
  69. public static ActivityState valueOf(String s)
  70. {
  71. return (ActivityState)Enum.valueOf(com/adobe/air/AndroidActivityWrapper$ActivityState, s);
  72. }
  73. public static ActivityState[] values()
  74. {
  75. return (ActivityState[])$VALUES.clone();
  76. }
  77. static
  78. {
  79. STARTED = new ActivityState("STARTED", 0);
  80. RESTARTED = new ActivityState("RESTARTED", 1);
  81. RESUMED = new ActivityState("RESUMED", 2);
  82. PAUSED = new ActivityState("PAUSED", 3);
  83. STOPPED = new ActivityState("STOPPED", 4);
  84. DESTROYED = new ActivityState("DESTROYED", 5);
  85. ActivityState aactivitystate[] = new ActivityState[6];
  86. aactivitystate[0] = STARTED;
  87. aactivitystate[1] = RESTARTED;
  88. aactivitystate[2] = RESUMED;
  89. aactivitystate[3] = PAUSED;
  90. aactivitystate[4] = STOPPED;
  91. aactivitystate[5] = DESTROYED;
  92. $VALUES = aactivitystate;
  93. }
  94. private ActivityState(String s, int i)
  95. {
  96. super(s, i);
  97. }
  98. }
  99. private static final class DebugMode extends Enum
  100. {
  101. private static final DebugMode $VALUES[];
  102. public static final DebugMode ConflictMode;
  103. public static final DebugMode ConnectMode;
  104. public static final DebugMode ListenMode;
  105. public static final DebugMode None;
  106. public static DebugMode valueOf(String s)
  107. {
  108. return (DebugMode)Enum.valueOf(com/adobe/air/AndroidActivityWrapper$DebugMode, s);
  109. }
  110. public static DebugMode[] values()
  111. {
  112. return (DebugMode[])$VALUES.clone();
  113. }
  114. static
  115. {
  116. None = new DebugMode("None", 0);
  117. ConnectMode = new DebugMode("ConnectMode", 1);
  118. ListenMode = new DebugMode("ListenMode", 2);
  119. ConflictMode = new DebugMode("ConflictMode", 3);
  120. DebugMode adebugmode[] = new DebugMode[4];
  121. adebugmode[0] = None;
  122. adebugmode[1] = ConnectMode;
  123. adebugmode[2] = ListenMode;
  124. adebugmode[3] = ConflictMode;
  125. $VALUES = adebugmode;
  126. }
  127. private DebugMode(String s, int i)
  128. {
  129. super(s, i);
  130. }
  131. }
  132. static interface InputEventCallback
  133. {
  134. public abstract boolean onGenericMotionEvent(MotionEvent motionevent);
  135. public abstract boolean onKeyEvent(KeyEvent keyevent);
  136. }
  137. public static class PlaneID
  138. {
  139. public static final int PLANE_CAMERA = 5;
  140. public static final int PLANE_COUNT = 8;
  141. public static final int PLANE_FLASH = 3;
  142. public static final int PLANE_OVERLAY = 2;
  143. public static final int PLANE_STAGE3D = 6;
  144. public static final int PLANE_STAGETEXT = 1;
  145. public static final int PLANE_STAGEVIDEO = 7;
  146. public static final int PLANE_STAGEVIDEOAUTOMATIC = 4;
  147. public static final int PLANE_STAGEWEBVIEW;
  148. public PlaneID()
  149. {
  150. }
  151. }
  152. static interface StateChangeCallback
  153. {
  154. public abstract void onActivityStateChanged(ActivityState activitystate);
  155. public abstract void onConfigurationChanged(Configuration configuration);
  156. }
  157. private static final String ADOBE_COM = "adobe.com";
  158. private static final int ASPECT_RATIO_ANY = 3;
  159. private static final int ASPECT_RATIO_LANDSCAPE = 2;
  160. private static final int ASPECT_RATIO_PORTRAIT = 1;
  161. public static final int IMAGE_PICKER_REQUEST_CODE = 2;
  162. private static final int INVOKE_EVENT_OPEN_URL = 1;
  163. private static final int INVOKE_EVENT_STANDARD = 0;
  164. private static final String LOG_TAG = "AndroidActivityWrapper";
  165. public static final int STILL_PICTURE_REQUEST_CODE = 3;
  166. public static final int VIDEO_CAPTURE_REQUEST_CODE = 4;
  167. public static final int WEBVIEW_UPLOAD_FILE_CHOOSER_CODE = 5;
  168. private static final String WWW_ADOBE_COM = "www.adobe.com";
  169. private static AndroidActivityWrapper sActivityWrapper = null;
  170. private static AndroidTelephonyManager sAndroidTelephonyManager = null;
  171. private static boolean sApplicationLaunched = false;
  172. private static boolean sDepthAndStencil = false;
  173. private static Entrypoints sEntryPoint = null;
  174. private static String sGamePreviewHost = "";
  175. private static boolean sHasCaptiveRuntime = false;
  176. private static AndroidIdleState sIdleStateManager = null;
  177. private static boolean sIsSwfPreviewMode = false;
  178. private static boolean sRuntimeLibrariesLoaded = false;
  179. private int debuggerPort;
  180. private KeyguardManager keyGuardManager;
  181. private boolean mActivateEventPending;
  182. private List mActivityResultListeners;
  183. private ActivityState mActivityState;
  184. private List mActivityStateListeners;
  185. private ConfigDownloadListener mConfigDownloadListener;
  186. private boolean mContainsVideo;
  187. private DebuggerSettings mDebuggerSettings;
  188. private boolean mDisplayWaitingDialog;
  189. private String mExtraArgs;
  190. private boolean mFullScreenSetFromMetaData;
  191. private int mHardKeyboardHidden;
  192. private int mHardKeyboardType;
  193. private List mInputEventListeners;
  194. private boolean mInvokeEventPendingFromOnCreate;
  195. private boolean mIsADL;
  196. private boolean mIsDebuggerMode;
  197. private boolean mIsFullScreen;
  198. private String mLibCorePath;
  199. private OrientationManager mOrientationManager;
  200. private boolean mRGB565Override;
  201. private String mRootDir;
  202. private boolean mScreenOn;
  203. private boolean mShowDebuggerDialog;
  204. private String mXmlPath;
  205. private Activity m_activity;
  206. private Application m_application;
  207. private AndroidCameraView m_cameraView;
  208. private FlashEGL m_flashEGL;
  209. private FrameLayout m_layout;
  210. private AIRWindowSurfaceView m_mainView;
  211. private Condition m_newActivityCondition;
  212. private Lock m_newActivityLock;
  213. private RelativeLayout m_overlaysLayout;
  214. private boolean m_planeBreakCascade;
  215. private boolean m_planeCascadeInit;
  216. private int m_planeCascadeStep;
  217. private List m_planes;
  218. private Context m_runtimeContext;
  219. private boolean m_skipKickCascade;
  220. private SurfaceView m_videoView;
  221. private AndroidActivityWrapper(Activity activity)
  222. {
  223. m_activity = null;
  224. mConfigDownloadListener = null;
  225. m_application = null;
  226. mActivityResultListeners = null;
  227. m_mainView = null;
  228. m_videoView = null;
  229. m_cameraView = null;
  230. m_layout = null;
  231. m_flashEGL = null;
  232. mXmlPath = null;
  233. mRootDir = null;
  234. mExtraArgs = null;
  235. mIsADL = false;
  236. mRGB565Override = false;
  237. mIsDebuggerMode = false;
  238. mHardKeyboardHidden = 2;
  239. mHardKeyboardType = 0;
  240. mShowDebuggerDialog = false;
  241. mDisplayWaitingDialog = false;
  242. debuggerPort = -1;
  243. mInvokeEventPendingFromOnCreate = false;
  244. mActivateEventPending = false;
  245. mActivityStateListeners = null;
  246. mInputEventListeners = null;
  247. mFullScreenSetFromMetaData = false;
  248. mIsFullScreen = false;
  249. mContainsVideo = false;
  250. mLibCorePath = null;
  251. m_runtimeContext = null;
  252. m_overlaysLayout = null;
  253. m_newActivityLock = null;
  254. m_newActivityCondition = null;
  255. mOrientationManager = null;
  256. keyGuardManager = null;
  257. mScreenOn = true;
  258. mDebuggerSettings = new DebuggerSettings();
  259. mActivityState = ActivityState.STARTED;
  260. m_planes = null;
  261. m_planeCascadeStep = 0;
  262. m_planeBreakCascade = false;
  263. m_planeCascadeInit = false;
  264. m_skipKickCascade = true;
  265. m_activity = activity;
  266. m_newActivityLock = new ReentrantLock();
  267. m_newActivityCondition = m_newActivityLock.newCondition();
  268. m_application = activity.getApplication();
  269. LoadRuntimeLibraries();
  270. keyGuardManager = (KeyguardManager)(KeyguardManager)activity.getSystemService("keyguard");
  271. }
  272. public static AndroidActivityWrapper CreateAndroidActivityWrapper(Activity activity)
  273. {
  274. return CreateAndroidActivityWrapper(activity, Boolean.valueOf(false));
  275. }
  276. public static AndroidActivityWrapper CreateAndroidActivityWrapper(Activity activity, Boolean boolean1)
  277. {
  278. sHasCaptiveRuntime = boolean1.booleanValue();
  279. if (boolean1.booleanValue())
  280. {
  281. Utils.setRuntimePackageName(activity.getApplicationContext().getPackageName());
  282. } else
  283. {
  284. Utils.setRuntimePackageName("com.adobe.air");
  285. }
  286. if (sActivityWrapper == null)
  287. {
  288. sActivityWrapper = new AndroidActivityWrapper(activity);
  289. }
  290. return sActivityWrapper;
  291. }
  292. public static AndroidActivityWrapper GetAndroidActivityWrapper()
  293. {
  294. return sActivityWrapper;
  295. }
  296. public static boolean GetDepthAndStencilForGamePreview()
  297. {
  298. return sDepthAndStencil;
  299. }
  300. public static boolean GetHasCaptiveRuntime()
  301. {
  302. return sHasCaptiveRuntime;
  303. }
  304. public static boolean IsGamePreviewMode()
  305. {
  306. return sIsSwfPreviewMode;
  307. }
  308. private void LaunchApplication(Activity activity, AIRWindowSurfaceView airwindowsurfaceview, String s, String s1, String s2, boolean flag, boolean flag1)
  309. {
  310. if (sApplicationLaunched)
  311. {
  312. return;
  313. }
  314. if (!flag) goto _L2; else goto _L1
  315. _L1:
  316. String s13 = activity.getIntent().getStringExtra("args");
  317. if (s13 == null) goto _L4; else goto _L3
  318. _L3:
  319. String as1[];
  320. String s14;
  321. as1 = s13.split(" ");
  322. s14 = as1[0];
  323. String s15 = as1[1];
  324. if (as1.length < 2) goto _L6; else goto _L5
  325. _L5:
  326. String s23 = (new StringBuilder()).append(as1[2]).append(" ").toString();
  327. String s16 = s23;
  328. _L33:
  329. String s17;
  330. int k;
  331. s17 = s16;
  332. k = 3;
  333. _L8:
  334. String s22;
  335. if (k >= as1.length)
  336. {
  337. break; /* Loop/switch isn't completed */
  338. }
  339. s22 = (new StringBuilder()).append(s17).append(as1[k]).append(" ").toString();
  340. s17 = s22;
  341. k++;
  342. if (true) goto _L8; else goto _L7
  343. _L7:
  344. String s18;
  345. String s19;
  346. String s20;
  347. s18 = s17;
  348. s19 = s14;
  349. s20 = s15;
  350. _L34:
  351. String s3;
  352. String s4;
  353. String s5;
  354. s3 = s18;
  355. String s21 = s20;
  356. s5 = s19;
  357. s4 = s21;
  358. _L31:
  359. boolean flag2;
  360. String s6;
  361. String as[];
  362. int i;
  363. byte byte0;
  364. int j;
  365. String s7;
  366. String s8;
  367. String s9;
  368. String s10;
  369. String s11;
  370. Exception exception3;
  371. Exception exception4;
  372. Exception exception5;
  373. try
  374. {
  375. Context context = getApplicationContext();
  376. sEntryPoint = new Entrypoints();
  377. sEntryPoint.EntryMain(s5, s4, s3, Utils.getRuntimePackageName(), airwindowsurfaceview, activity.getApplication(), activity.getApplicationInfo(), context, this, flag, flag1);
  378. sIdleStateManager = AndroidIdleState.GetIdleStateManager(context);
  379. sApplicationLaunched = true;
  380. return;
  381. }
  382. catch (Exception exception)
  383. {
  384. return;
  385. }
  386. _L2:
  387. flag2 = sIsSwfPreviewMode;
  388. if (!flag2) goto _L10; else goto _L9
  389. _L9:
  390. s6 = activity.getIntent().getDataString();
  391. if (s6 == null) goto _L12; else goto _L11
  392. _L11:
  393. if (s6.indexOf("?") <= 0) goto _L12; else goto _L13
  394. _L13:
  395. as = s6.substring(1 + s6.indexOf("?")).split("&");
  396. i = as.length;
  397. byte0 = -1;
  398. j = 0;
  399. _L35:
  400. if (j >= i) goto _L15; else goto _L14
  401. _L14:
  402. s7 = as[j];
  403. if (!s7.substring(0, s7.indexOf("=")).equalsIgnoreCase("depthAndStencil")) goto _L17; else goto _L16
  404. _L16:
  405. if (!s7.substring(1 + s7.indexOf("=")).equalsIgnoreCase("true")) goto _L19; else goto _L18
  406. _L18:
  407. sDepthAndStencil = true;
  408. goto _L20
  409. _L19:
  410. sDepthAndStencil = false;
  411. goto _L20
  412. _L17:
  413. if (!s7.substring(0, s7.indexOf("=")).equalsIgnoreCase("autoorients")) goto _L22; else goto _L21
  414. _L21:
  415. if (!s7.substring(1 + s7.indexOf("=")).equalsIgnoreCase("true")) goto _L24; else goto _L23
  416. _L23:
  417. setAutoOrients(true);
  418. goto _L20
  419. _L24:
  420. setAutoOrients(false);
  421. goto _L20
  422. _L22:
  423. if (!s7.substring(0, s7.indexOf("=")).equalsIgnoreCase("aspectratio")) goto _L20; else goto _L25
  424. _L25:
  425. s8 = s7.substring(1 + s7.indexOf("="));
  426. if (!s8.equalsIgnoreCase("portrait")) goto _L27; else goto _L26
  427. _L26:
  428. byte0 = 1;
  429. goto _L20
  430. _L27:
  431. if (!s8.equalsIgnoreCase("landscape")) goto _L29; else goto _L28
  432. _L28:
  433. byte0 = 2;
  434. goto _L20
  435. _L29:
  436. if (s8.equalsIgnoreCase("any"))
  437. {
  438. byte0 = 3;
  439. }
  440. goto _L20
  441. _L15:
  442. if (byte0 == -1) goto _L12; else goto _L30
  443. _L30:
  444. setAspectRatio(byte0);
  445. _L12:
  446. s3 = s2;
  447. s4 = s1;
  448. s5 = s;
  449. goto _L31
  450. exception3;
  451. s9 = s2;
  452. s11 = s14;
  453. s10 = s1;
  454. goto _L32
  455. exception4;
  456. s9 = s2;
  457. s11 = s14;
  458. s10 = s15;
  459. goto _L32
  460. exception5;
  461. s9 = s17;
  462. s11 = s14;
  463. s10 = s15;
  464. goto _L32
  465. _L10:
  466. s3 = s2;
  467. s4 = s1;
  468. s5 = s;
  469. goto _L31
  470. _L6:
  471. s16 = s2;
  472. goto _L33
  473. _L4:
  474. s18 = s2;
  475. s20 = s1;
  476. s19 = s;
  477. goto _L34
  478. Exception exception2;
  479. exception2;
  480. s9 = s2;
  481. s10 = s1;
  482. s11 = s;
  483. _L32:
  484. s3 = s9;
  485. String s12 = s10;
  486. s5 = s11;
  487. s4 = s12;
  488. goto _L31
  489. _L20:
  490. j++;
  491. goto _L35
  492. Exception exception1;
  493. exception1;
  494. s3 = s2;
  495. s4 = s1;
  496. s5 = s;
  497. goto _L31
  498. }
  499. private void LoadRuntimeLibraries()
  500. {
  501. if (sRuntimeLibrariesLoaded)
  502. {
  503. break MISSING_BLOCK_LABEL_27;
  504. }
  505. System.load(Utils.GetLibSTLPath(m_application));
  506. System.load(GetLibCorePath());
  507. sRuntimeLibrariesLoaded = true;
  508. return;
  509. UnsatisfiedLinkError unsatisfiedlinkerror;
  510. unsatisfiedlinkerror;
  511. }
  512. private void SetVisible(boolean flag)
  513. {
  514. if (flag)
  515. {
  516. if (isSurfaceValid() && mScreenOn && mActivityState != ActivityState.STOPPED && mActivityState != ActivityState.DESTROYED)
  517. {
  518. nativeSetVisible(true);
  519. }
  520. } else
  521. if (isApplicationLaunched())
  522. {
  523. nativeSetVisible(false);
  524. return;
  525. }
  526. }
  527. public static boolean ShouldShowGamePreviewWatermark()
  528. {
  529. Boolean boolean1 = Boolean.valueOf(sIsSwfPreviewMode);
  530. if (boolean1.booleanValue() && (sGamePreviewHost.equalsIgnoreCase("www.adobe.com") || sGamePreviewHost.equalsIgnoreCase("adobe.com")))
  531. {
  532. boolean1 = Boolean.valueOf(false);
  533. }
  534. return boolean1.booleanValue();
  535. }
  536. private void SignalNewActivityCreated()
  537. {
  538. m_newActivityLock.lock();
  539. m_newActivityCondition.signalAll();
  540. m_newActivityLock.unlock();
  541. }
  542. private void afterOnCreate()
  543. {
  544. if (m_planes != null)
  545. {
  546. break MISSING_BLOCK_LABEL_48;
  547. }
  548. m_planes = new ArrayList(8);
  549. int i = 0;
  550. while (i < 8)
  551. {
  552. Context context;
  553. Bundle bundle;
  554. Boolean boolean1;
  555. try
  556. {
  557. m_planes.add(i, null);
  558. }
  559. catch (Exception exception)
  560. {
  561. return;
  562. }
  563. i++;
  564. }
  565. context = getApplicationContext();
  566. m_layout = new FrameLayout(context);
  567. m_mainView = new AIRWindowSurfaceView(context, this);
  568. if (m_cameraView == null && m_runtimeContext.checkCallingOrSelfPermission("android.permission.CAMERA") == 0)
  569. {
  570. m_cameraView = new AndroidCameraView(context, this);
  571. }
  572. if (m_cameraView != null)
  573. {
  574. m_layout.addView(m_cameraView, 8, 16);
  575. }
  576. bundle = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), 128).metaData;
  577. if (bundle == null)
  578. {
  579. break MISSING_BLOCK_LABEL_218;
  580. }
  581. boolean1 = (Boolean)bundle.get("containsVideo");
  582. if (boolean1 == null)
  583. {
  584. break MISSING_BLOCK_LABEL_218;
  585. }
  586. if (boolean1.booleanValue())
  587. {
  588. mContainsVideo = boolean1.booleanValue();
  589. m_videoView = m_mainView.getVideoView();
  590. m_layout.addView(m_videoView, 0);
  591. }
  592. m_layout.addView(m_mainView);
  593. if (m_overlaysLayout != null)
  594. {
  595. m_layout.addView(m_overlaysLayout);
  596. }
  597. m_activity.setContentView(m_layout);
  598. if ((mIsADL || mShowDebuggerDialog) && m_activity != null && m_activity.getCurrentFocus() != m_mainView)
  599. {
  600. m_mainView.requestFocus();
  601. m_mainView.onWindowFocusChanged(true);
  602. }
  603. if (!mFullScreenSetFromMetaData)
  604. {
  605. setFullScreenFromMetaData();
  606. }
  607. mFullScreenSetFromMetaData = true;
  608. if (getIsFullScreen())
  609. {
  610. m_mainView.setFullScreen();
  611. }
  612. mHardKeyboardHidden = m_activity.getResources().getConfiguration().hardKeyboardHidden;
  613. mHardKeyboardType = m_activity.getResources().getConfiguration().keyboard;
  614. mOrientationManager = OrientationManager.getOrientationManager();
  615. mOrientationManager.onActivityCreated(m_activity, m_mainView);
  616. callActivityStateListeners();
  617. HDMIUtils.initHelper(context);
  618. return;
  619. }
  620. private void callActivityResultListeners(int i, int j, Intent intent)
  621. {
  622. if (mActivityResultListeners != null) goto _L2; else goto _L1
  623. _L1:
  624. return;
  625. _L2:
  626. int k;
  627. int l;
  628. try
  629. {
  630. k = mActivityResultListeners.size();
  631. }
  632. catch (Exception exception)
  633. {
  634. return;
  635. }
  636. l = 0;
  637. if (l >= k)
  638. {
  639. continue; /* Loop/switch isn't completed */
  640. }
  641. ((ActivityResultCallback)mActivityResultListeners.get(l)).onActivityResult(i, j, intent);
  642. l++;
  643. if (true) goto _L4; else goto _L3
  644. _L3:
  645. break MISSING_BLOCK_LABEL_53;
  646. _L4:
  647. break MISSING_BLOCK_LABEL_22;
  648. if (true) goto _L1; else goto _L5
  649. _L5:
  650. }
  651. private void callActivityStateListeners()
  652. {
  653. if (mActivityStateListeners != null) goto _L2; else goto _L1
  654. _L1:
  655. return;
  656. _L2:
  657. int i;
  658. int j;
  659. try
  660. {
  661. i = mActivityStateListeners.size();
  662. }
  663. catch (Exception exception)
  664. {
  665. return;
  666. }
  667. j = 0;
  668. if (j >= i)
  669. {
  670. continue; /* Loop/switch isn't completed */
  671. }
  672. ((StateChangeCallback)mActivityStateListeners.get(j)).onActivityStateChanged(mActivityState);
  673. j++;
  674. if (true) goto _L4; else goto _L3
  675. _L3:
  676. break MISSING_BLOCK_LABEL_49;
  677. _L4:
  678. break MISSING_BLOCK_LABEL_20;
  679. if (true) goto _L1; else goto _L5
  680. _L5:
  681. }
  682. private void callActivityStateListeners(Configuration configuration)
  683. {
  684. if (mActivityStateListeners != null) goto _L2; else goto _L1
  685. _L1:
  686. return;
  687. _L2:
  688. int i;
  689. int j;
  690. try
  691. {
  692. i = mActivityStateListeners.size();
  693. }
  694. catch (Exception exception)
  695. {
  696. return;
  697. }
  698. j = 0;
  699. if (j >= i)
  700. {
  701. continue; /* Loop/switch isn't completed */
  702. }
  703. ((StateChangeCallback)mActivityStateListeners.get(j)).onConfigurationChanged(configuration);
  704. j++;
  705. if (true) goto _L4; else goto _L3
  706. _L3:
  707. break MISSING_BLOCK_LABEL_49;
  708. _L4:
  709. break MISSING_BLOCK_LABEL_21;
  710. if (true) goto _L1; else goto _L5
  711. _L5:
  712. }
  713. private boolean callInputEventListeners(KeyEvent keyevent)
  714. {
  715. boolean flag;
  716. if (mInputEventListeners == null)
  717. {
  718. return false;
  719. }
  720. int i;
  721. int j;
  722. boolean flag1;
  723. boolean flag2;
  724. try
  725. {
  726. i = mInputEventListeners.size();
  727. }
  728. catch (Exception exception)
  729. {
  730. return false;
  731. }
  732. j = 0;
  733. flag = false;
  734. if (j >= i) goto _L2; else goto _L1
  735. _L1:
  736. if (flag) goto _L4; else goto _L3
  737. _L3:
  738. try
  739. {
  740. flag2 = ((InputEventCallback)mInputEventListeners.get(j)).onKeyEvent(keyevent);
  741. }
  742. catch (Exception exception1)
  743. {
  744. return flag;
  745. }
  746. if (!flag2) goto _L5; else goto _L4
  747. _L4:
  748. flag1 = true;
  749. _L6:
  750. j++;
  751. flag = flag1;
  752. continue; /* Loop/switch isn't completed */
  753. _L5:
  754. flag1 = false;
  755. if (true) goto _L6; else goto _L2
  756. _L2:
  757. return flag;
  758. if (true) goto _L8; else goto _L7
  759. _L8:
  760. break MISSING_BLOCK_LABEL_25;
  761. _L7:
  762. }
  763. private boolean callInputEventListeners(MotionEvent motionevent)
  764. {
  765. boolean flag;
  766. if (mInputEventListeners == null)
  767. {
  768. return false;
  769. }
  770. int i;
  771. int j;
  772. boolean flag1;
  773. boolean flag2;
  774. try
  775. {
  776. i = mInputEventListeners.size();
  777. }
  778. catch (Exception exception)
  779. {
  780. return false;
  781. }
  782. j = 0;
  783. flag = false;
  784. if (j >= i) goto _L2; else goto _L1
  785. _L1:
  786. if (flag) goto _L4; else goto _L3
  787. _L3:
  788. try
  789. {
  790. flag2 = ((InputEventCallback)mInputEventListeners.get(j)).onGenericMotionEvent(motionevent);
  791. }
  792. catch (Exception exception1)
  793. {
  794. return flag;
  795. }
  796. if (!flag2) goto _L5; else goto _L4
  797. _L4:
  798. flag1 = true;
  799. _L6:
  800. j++;
  801. flag = flag1;
  802. continue; /* Loop/switch isn't completed */
  803. _L5:
  804. flag1 = false;
  805. if (true) goto _L6; else goto _L2
  806. _L2:
  807. return flag;
  808. if (true) goto _L8; else goto _L7
  809. _L8:
  810. break MISSING_BLOCK_LABEL_25;
  811. _L7:
  812. }
  813. private void checkForDebuggerAndLaunchDialog()
  814. {
  815. ResourceFileManager resourcefilemanager;
  816. DebugMode debugmode;
  817. if (mIsADL)
  818. {
  819. break MISSING_BLOCK_LABEL_510;
  820. }
  821. resourcefilemanager = new ResourceFileManager(m_activity);
  822. debugmode = DebugMode.None;
  823. if (!resourcefilemanager.resExists(resourcefilemanager.lookupResId("raw.debuginfo"))) goto _L2; else goto _L1
  824. _L1:
  825. HashMap hashmap;
  826. String s1;
  827. hashmap = Utils.parseKeyValuePairFile(resourcefilemanager.getFileStreamFromRawRes(resourcefilemanager.lookupResId("raw.debuginfo")), "=");
  828. s1 = (String)hashmap.get("incomingDebugPort");
  829. if (s1 == null)
  830. {
  831. break MISSING_BLOCK_LABEL_91;
  832. }
  833. DebugMode debugmode3;
  834. debuggerPort = Integer.parseInt(s1);
  835. debugmode3 = DebugMode.ListenMode;
  836. debugmode = debugmode3;
  837. _L24:
  838. String s2 = (String)hashmap.get("outgoingDebugHost");
  839. if (s2 == null) goto _L2; else goto _L3
  840. _L3:
  841. DebugMode debugmode2;
  842. if (debugmode == DebugMode.ListenMode)
  843. {
  844. DebugMode.ConflictMode;
  845. throw new Exception("listen and connect are mutually exclusive.");
  846. }
  847. debugmode2 = DebugMode.ConnectMode;
  848. DebugMode debugmode1;
  849. String s;
  850. s = s2;
  851. debugmode1 = debugmode2;
  852. _L22:
  853. static class _cls2
  854. {
  855. static final int $SwitchMap$com$adobe$air$AndroidActivityWrapper$DebugMode[];
  856. static
  857. {
  858. $SwitchMap$com$adobe$air$AndroidActivityWrapper$DebugMode = new int[DebugMode.values().length];
  859. try
  860. {
  861. $SwitchMap$com$adobe$air$AndroidActivityWrapper$DebugMode[DebugMode.ListenMode.ordinal()] = 1;
  862. }
  863. catch (NoSuchFieldError nosuchfielderror) { }
  864. try
  865. {
  866. $SwitchMap$com$adobe$air$AndroidActivityWrapper$DebugMode[DebugMode.ConnectMode.ordinal()] = 2;
  867. }
  868. catch (NoSuchFieldError nosuchfielderror1) { }
  869. try
  870. {
  871. $SwitchMap$com$adobe$air$AndroidActivityWrapper$DebugMode[DebugMode.None.ordinal()] = 3;
  872. }
  873. catch (NoSuchFieldError nosuchfielderror2) { }
  874. try
  875. {
  876. $SwitchMap$com$adobe$air$AndroidActivityWrapper$DebugMode[DebugMode.ConflictMode.ordinal()] = 4;
  877. }
  878. catch (NoSuchFieldError nosuchfielderror3)
  879. {
  880. return;
  881. }
  882. }
  883. }
  884. _cls2..SwitchMap.com.adobe.air.AndroidActivityWrapper.DebugMode[debugmode1.ordinal()];
  885. JVM INSTR tableswitch 1 4: default 180
  886. // 1 181
  887. // 2 419
  888. // 3 448
  889. // 4 510;
  890. goto _L4 _L5 _L6 _L7 _L8
  891. _L8:
  892. break MISSING_BLOCK_LABEL_510;
  893. _L4:
  894. return;
  895. _L5:
  896. ServerSocket serversocket = new ServerSocket(debuggerPort, 1, InetAddress.getLocalHost());
  897. serversocket.close();
  898. if (serversocket == null) goto _L10; else goto _L9
  899. _L9:
  900. serversocket.close();
  901. _L10:
  902. boolean flag = true;
  903. _L11:
  904. ServerSocket serversocket1;
  905. Exception exception1;
  906. Exception exception2;
  907. DebuggerSettings debuggersettings;
  908. boolean flag1;
  909. IOException ioexception1;
  910. IOException ioexception2;
  911. boolean flag2;
  912. IOException ioexception4;
  913. IOException ioexception5;
  914. SecurityException securityexception1;
  915. IOException ioexception6;
  916. if (flag)
  917. {
  918. mDisplayWaitingDialog = true;
  919. afterOnCreate();
  920. } else
  921. {
  922. showDialogUnableToListenOnPort(debuggerPort);
  923. }
  924. debuggersettings = mDebuggerSettings;
  925. if (debugmode1 == DebugMode.ListenMode)
  926. {
  927. flag1 = true;
  928. } else
  929. {
  930. flag1 = false;
  931. }
  932. debuggersettings.setListen(flag1);
  933. mDebuggerSettings.setDebugerPort(debuggerPort);
  934. return;
  935. ioexception5;
  936. flag = true;
  937. goto _L11
  938. ioexception6;
  939. serversocket = null;
  940. _L20:
  941. if (serversocket == null) goto _L13; else goto _L12
  942. _L12:
  943. serversocket.close();
  944. _L13:
  945. flag = false;
  946. goto _L11
  947. ioexception1;
  948. flag = false;
  949. goto _L11
  950. securityexception1;
  951. serversocket = null;
  952. _L19:
  953. if (serversocket == null) goto _L15; else goto _L14
  954. _L14:
  955. serversocket.close();
  956. _L15:
  957. flag = false;
  958. goto _L11
  959. ioexception2;
  960. flag = false;
  961. goto _L11
  962. exception1;
  963. serversocket1 = null;
  964. _L18:
  965. flag2 = exception1.getClass().getName().equals("android.os.NetworkOnMainThreadException");
  966. if (flag2)
  967. {
  968. flag = true;
  969. } else
  970. {
  971. flag = false;
  972. }
  973. if (serversocket1 != null)
  974. {
  975. try
  976. {
  977. serversocket1.close();
  978. }
  979. // Misplaced declaration of an exception variable
  980. catch (IOException ioexception4) { }
  981. }
  982. goto _L11
  983. exception2;
  984. serversocket = null;
  985. _L17:
  986. if (serversocket != null)
  987. {
  988. try
  989. {
  990. serversocket.close();
  991. }
  992. catch (IOException ioexception3) { }
  993. }
  994. throw exception2;
  995. _L6:
  996. if (!Utils.nativeConnectDebuggerSocket(s))
  997. {
  998. showDialogforIpAddress(s);
  999. return;
  1000. } else
  1001. {
  1002. mDebuggerSettings.setHost(s);
  1003. afterOnCreate();
  1004. return;
  1005. }
  1006. _L7:
  1007. afterOnCreate();
  1008. return;
  1009. exception2;
  1010. continue; /* Loop/switch isn't completed */
  1011. exception2;
  1012. serversocket = serversocket1;
  1013. if (true) goto _L17; else goto _L16
  1014. _L16:
  1015. Exception exception;
  1016. exception;
  1017. serversocket1 = serversocket;
  1018. exception1 = exception;
  1019. goto _L18
  1020. SecurityException securityexception;
  1021. securityexception;
  1022. goto _L19
  1023. IOException ioexception;
  1024. ioexception;
  1025. goto _L20
  1026. NumberFormatException numberformatexception;
  1027. numberformatexception;
  1028. continue; /* Loop/switch isn't completed */
  1029. _L2:
  1030. debugmode1 = debugmode;
  1031. s = null;
  1032. if (true) goto _L22; else goto _L21
  1033. _L21:
  1034. Exception exception3;
  1035. exception3;
  1036. return;
  1037. if (true) goto _L24; else goto _L23
  1038. _L23:
  1039. }
  1040. private void closeDialogWaitingForConnection()
  1041. {
  1042. Context context = getApplicationContext();
  1043. try
  1044. {
  1045. Intent intent = new Intent();
  1046. intent.setAction("android.intent.action.MAIN");
  1047. intent.addCategory("RemoteDebuggerListenerDialogClose");
  1048. intent.putExtra("debuggerPort", debuggerPort);
  1049. context.sendBroadcast(intent);
  1050. return;
  1051. }
  1052. catch (Exception exception)
  1053. {
  1054. return;
  1055. }
  1056. }
  1057. private void initializeAndroidAppVars(ApplicationInfo applicationinfo)
  1058. {
  1059. ApplicationFileManager.setAndroidPackageName(applicationinfo.packageName);
  1060. ApplicationFileManager.setAndroidAPKPath(applicationinfo.sourceDir);
  1061. ApplicationFileManager.processAndroidDataPath(m_application.getCacheDir().getAbsolutePath());
  1062. }
  1063. public static boolean isGingerbread()
  1064. {
  1065. return android.os.Build.VERSION.SDK_INT >= 9;
  1066. }
  1067. public static boolean isHoneycomb()
  1068. {
  1069. return android.os.Build.VERSION.SDK_INT >= 11;
  1070. }
  1071. public static boolean isIceCreamSandwich()
  1072. {
  1073. return android.os.Build.VERSION.SDK_INT >= 14;
  1074. }
  1075. public static boolean isJellybean()
  1076. {
  1077. return android.os.Build.VERSION.SDK_INT >= 16;
  1078. }
  1079. private native void nativeActivateEvent();
  1080. private native void nativeDeactivateEvent();
  1081. private native void nativeLowMemoryEvent();
  1082. private native void nativeOnFocusListener(boolean flag);
  1083. private native void nativeSendInvokeEventWithData(String s, String s1, int i);
  1084. private native void nativeSetVisible(boolean flag);
  1085. private void parseArgs(Activity activity, String as[])
  1086. {
  1087. String s = "false";
  1088. String s14 = as[0];
  1089. String s15 = as[1];
  1090. String s16 = as[2];
  1091. String s10 = as[3];
  1092. String s18 = as[4];
  1093. if (as.length < 6) goto _L2; else goto _L1
  1094. _L1:
  1095. String s22 = as[5];
  1096. String s24 = as[6];
  1097. String s20;
  1098. s = s22;
  1099. s20 = s24;
  1100. _L6:
  1101. String s7;
  1102. String s8;
  1103. String s9;
  1104. String s11;
  1105. String s12;
  1106. String s13;
  1107. String s21 = s20;
  1108. s8 = s15;
  1109. s12 = s;
  1110. s7 = s14;
  1111. s13 = s21;
  1112. s11 = s18;
  1113. s9 = s16;
  1114. _L3:
  1115. String s1;
  1116. String s2;
  1117. String s3;
  1118. String s4;
  1119. String s5;
  1120. String s6;
  1121. mExtraArgs = s9;
  1122. mIsADL = Boolean.valueOf(s10).booleanValue();
  1123. mIsDebuggerMode = Boolean.valueOf(s11).booleanValue();
  1124. sIsSwfPreviewMode = Boolean.valueOf(s12).booleanValue();
  1125. sGamePreviewHost = s13;
  1126. initializeAndroidAppVars(m_activity.getApplicationInfo());
  1127. ArrayIndexOutOfBoundsException arrayindexoutofboundsexception;
  1128. if (mIsADL)
  1129. {
  1130. mXmlPath = s7;
  1131. mRootDir = s8;
  1132. return;
  1133. } else
  1134. {
  1135. mXmlPath = ApplicationFileManager.getAppXMLRoot();
  1136. mRootDir = ApplicationFileManager.getAppRoot();
  1137. return;
  1138. }
  1139. arrayindexoutofboundsexception;
  1140. s1 = s;
  1141. s2 = s;
  1142. s3 = s;
  1143. s4 = "";
  1144. s5 = "";
  1145. s6 = "";
  1146. _L4:
  1147. s7 = s6;
  1148. s8 = s5;
  1149. s9 = s4;
  1150. s10 = s3;
  1151. s11 = s2;
  1152. s12 = s1;
  1153. s13 = "";
  1154. goto _L3
  1155. ArrayIndexOutOfBoundsException arrayindexoutofboundsexception1;
  1156. arrayindexoutofboundsexception1;
  1157. s2 = s;
  1158. s3 = s;
  1159. s4 = "";
  1160. s5 = "";
  1161. s6 = s14;
  1162. s1 = s;
  1163. goto _L4
  1164. ArrayIndexOutOfBoundsException arrayindexoutofboundsexception2;
  1165. arrayindexoutofboundsexception2;
  1166. s3 = s;
  1167. s4 = "";
  1168. s5 = s15;
  1169. s6 = s14;
  1170. s1 = s;
  1171. s2 = s;
  1172. goto _L4
  1173. ArrayIndexOutOfBoundsException arrayindexoutofboundsexception3;
  1174. arrayindexoutofboundsexception3;
  1175. s4 = s16;
  1176. s5 = s15;
  1177. s6 = s14;
  1178. s1 = s;
  1179. s2 = s;
  1180. s3 = s;
  1181. goto _L4
  1182. ArrayIndexOutOfBoundsException arrayindexoutofboundsexception4;
  1183. arrayindexoutofboundsexception4;
  1184. s5 = s15;
  1185. s6 = s14;
  1186. s1 = s;
  1187. s2 = s;
  1188. String s17 = s10;
  1189. s4 = s16;
  1190. s3 = s17;
  1191. goto _L4
  1192. ArrayIndexOutOfBoundsException arrayindexoutofboundsexception5;
  1193. arrayindexoutofboundsexception5;
  1194. s6 = s14;
  1195. s1 = s;
  1196. String s19 = s10;
  1197. s4 = s16;
  1198. s3 = s19;
  1199. s2 = s18;
  1200. s5 = s15;
  1201. goto _L4
  1202. ArrayIndexOutOfBoundsException arrayindexoutofboundsexception6;
  1203. arrayindexoutofboundsexception6;
  1204. s6 = s14;
  1205. s1 = s22;
  1206. String s23 = s10;
  1207. s4 = s16;
  1208. s3 = s23;
  1209. s2 = s18;
  1210. s5 = s15;
  1211. goto _L4
  1212. _L2:
  1213. s20 = "";
  1214. if (true) goto _L6; else goto _L5
  1215. _L5:
  1216. }
  1217. private boolean planeRemovedSuccessfully(SurfaceView surfaceview)
  1218. {
  1219. if (!surfaceview.getHolder().getSurface().isValid())
  1220. {
  1221. return true;
  1222. }
  1223. return (Build.MODEL.equals("LT18i") || Build.MODEL.equals("LT15i") || Build.MODEL.equals("Arc")) && isIceCreamSandwich() && m_layout.indexOfChild(surfaceview) < 0;
  1224. }
  1225. private void setFullScreenFromMetaData()
  1226. {
  1227. Bundle bundle = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), 128).metaData;
  1228. if (bundle == null)
  1229. {
  1230. return;
  1231. }
  1232. Boolean boolean1 = (Boolean)bundle.get("fullScreen");
  1233. if (boolean1 != null)
  1234. {
  1235. try
  1236. {
  1237. if (boolean1.booleanValue())
  1238. {
  1239. m_mainView.setFullScreen();
  1240. return;
  1241. }
  1242. }
  1243. catch (android.content.pm.PackageManager.NameNotFoundException namenotfoundexception) { }
  1244. }
  1245. return;
  1246. }
  1247. private void setMainView(View view)
  1248. {
  1249. while (!sApplicationLaunched || sEntryPoint == null || !isResumed())
  1250. {
  1251. return;
  1252. }
  1253. try
  1254. {
  1255. sEntryPoint.setMainView(view);
  1256. return;
  1257. }
  1258. catch (Exception exception)
  1259. {
  1260. return;
  1261. }
  1262. }
  1263. private void showDialogUnableToListenOnPort(int i)
  1264. {
  1265. (new ListenErrorDialog(m_activity, i)).createAndShowDialog();
  1266. }
  1267. private void showDialogWaitingForConnection(final int aDebuggerPort)
  1268. {
  1269. getApplicationContext();
  1270. if (sHasCaptiveRuntime)
  1271. {
  1272. (new Thread(new Runnable() {
  1273. final AndroidActivityWrapper this$0;
  1274. final int val$aDebuggerPort;
  1275. public void run()
  1276. {
  1277. try
  1278. {
  1279. Thread.sleep(30000L);
  1280. (new Socket(InetAddress.getLocalHost(), aDebuggerPort)).close();
  1281. return;
  1282. }
  1283. catch (Exception exception1)
  1284. {
  1285. return;
  1286. }
  1287. }
  1288. {
  1289. this$0 = AndroidActivityWrapper.this;
  1290. aDebuggerPort = i;
  1291. super();
  1292. }
  1293. })).start();
  1294. return;
  1295. }
  1296. try
  1297. {
  1298. Intent intent = new Intent(m_runtimeContext, com/adobe/air/RemoteDebuggerListenerDialog);
  1299. intent.setAction("android.intent.action.MAIN");
  1300. intent.addCategory("RemoteDebuggerListenerDialog");
  1301. intent.putExtra("debuggerPort", aDebuggerPort);
  1302. m_activity.startActivity(intent);
  1303. return;
  1304. }
  1305. catch (Exception exception)
  1306. {
  1307. return;
  1308. }
  1309. }
  1310. private void showDialogforIpAddress(String s)
  1311. {
  1312. getApplicationContext();
  1313. (new RemoteDebuggerDialog(m_activity)).createAndShowDialog(s);
  1314. }
  1315. public void BroadcastIntent(String s, String s1)
  1316. {
  1317. try
  1318. {
  1319. getDefaultContext().startActivity(Intent.parseUri(s1, 0).setAction(s).addFlags(getDefaultIntentFlags()));
  1320. return;
  1321. }
  1322. catch (URISyntaxException urisyntaxexception)
  1323. {
  1324. return;
  1325. }
  1326. catch (ActivityNotFoundException activitynotfoundexception)
  1327. {
  1328. return;
  1329. }
  1330. }
  1331. public String GetAppCacheDirectory()
  1332. {
  1333. return m_application.getCacheDir().getAbsolutePath();
  1334. }
  1335. public String GetAppDataDirectory()
  1336. {
  1337. return m_application.getApplicationInfo().dataDir;
  1338. }
  1339. public DebuggerSettings GetDebuggerSettings()
  1340. {
  1341. return mDebuggerSettings;
  1342. }
  1343. public String GetLibCorePath()
  1344. {
  1345. if (mLibCorePath == null)
  1346. {
  1347. mLibCorePath = Utils.GetLibCorePath(m_application);
  1348. }
  1349. return mLibCorePath;
  1350. }
  1351. public String GetRuntimeDataDirectory()
  1352. {
  1353. return (new StringBuilder()).append(m_runtimeContext.getApplicationInfo().dataDir).append("/").toString();
  1354. }
  1355. public void LaunchMarketPlaceForAIR(String s)
  1356. {
  1357. String s1;
  1358. if (s == null)
  1359. {
  1360. s1 = (new StringBuilder()).append("market://details?id=").append(Utils.getRuntimePackageName()).toString();
  1361. } else
  1362. {
  1363. s1 = s;
  1364. }
  1365. try
  1366. {
  1367. BroadcastIntent("android.intent.action.VIEW", s1);
  1368. return;
  1369. }
  1370. catch (Exception exception)
  1371. {
  1372. return;
  1373. }
  1374. }
  1375. public void SendIntentToRuntime(Class class1, String s, String s1)
  1376. {
  1377. try
  1378. {
  1379. Intent intent = new Intent(m_runtimeContext, class1);
  1380. intent.setAction(s);
  1381. intent.addCategory(s1);
  1382. m_activity.startActivity(intent);
  1383. return;
  1384. }
  1385. catch (Exception exception)
  1386. {
  1387. return;
  1388. }
  1389. }
  1390. public void SendIntentToRuntime(Class class1, String s, String s1, String s2, String s3)
  1391. {
  1392. try
  1393. {
  1394. Intent intent = new Intent(m_runtimeContext, class1);
  1395. intent.setAction(s);
  1396. intent.addCategory(s1);
  1397. intent.putExtra(s2, s3);
  1398. m_activity.startActivity(intent);
  1399. return;
  1400. }
  1401. catch (Exception exception)
  1402. {
  1403. return;
  1404. }
  1405. }
  1406. public void SendInvokeEvent()
  1407. {
  1408. Intent intent = m_activity.getIntent();
  1409. String s = intent.getDataString();
  1410. int i = 0;
  1411. if (s != null)
  1412. {
  1413. i = 1;
  1414. }
  1415. nativeSendInvokeEventWithData(s, intent.getAction(), i);
  1416. }
  1417. public void ShowImmediateUpdateDialog()
  1418. {
  1419. Bundle bundle = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), 128).metaData;
  1420. if (bundle == null) goto _L2; else goto _L1
  1421. _L1:
  1422. String s1 = (String)bundle.get("airDownloadURL");
  1423. _L5:
  1424. String s = s1;
  1425. _L3:
  1426. if (s != null)
  1427. {
  1428. SendIntentToRuntime(com/adobe/air/AIRUpdateDialog, "android.intent.action.MAIN", "AIRUpdateDialog", "airDownloadURL", s);
  1429. return;
  1430. } else
  1431. {
  1432. SendIntentToRuntime(com/adobe/air/AIRUpdateDialog, "android.intent.action.MAIN", "AIRUpdateDialog");
  1433. return;
  1434. }
  1435. android.content.pm.PackageManager.NameNotFoundException namenotfoundexception;
  1436. namenotfoundexception;
  1437. s = null;
  1438. if (true) goto _L3; else goto _L2
  1439. _L2:
  1440. s1 = null;
  1441. if (true) goto _L5; else goto _L4
  1442. _L4:
  1443. }
  1444. public void StartDownloadConfigService()
  1445. {
  1446. Intent intent = new Intent();
  1447. intent.setPackage(Utils.getRuntimePackageName());
  1448. intent.setAction("com.adobe.air.DownloadConfig");
  1449. try
  1450. {
  1451. getApplicationContext().startService(intent);
  1452. return;
  1453. }
  1454. catch (SecurityException securityexception)
  1455. {
  1456. return;
  1457. }
  1458. }
  1459. public Activity WaitForNewActivity()
  1460. {
  1461. m_newActivityLock.lock();
  1462. if (m_activity == null)
  1463. {
  1464. m_newActivityCondition.await();
  1465. }
  1466. m_newActivityLock.unlock();
  1467. _L2:
  1468. return m_activity;
  1469. InterruptedException interruptedexception;
  1470. interruptedexception;
  1471. m_newActivityLock.unlock();
  1472. if (true) goto _L2; else goto _L1
  1473. _L1:
  1474. Exception exception;
  1475. exception;
  1476. m_newActivityLock.unlock();
  1477. throw exception;
  1478. }
  1479. public void addActivityResultListener(ActivityResultCallback activityresultcallback)
  1480. {
  1481. if (mActivityResultListeners == null)
  1482. {
  1483. mActivityResultListeners = new ArrayList();
  1484. }
  1485. if (!mActivityResultListeners.contains(activityresultcallback))
  1486. {
  1487. mActivityResultListeners.add(activityresultcallback);
  1488. }
  1489. }
  1490. public void addActivityStateChangeListner(StateChangeCallback statechangecallback)
  1491. {
  1492. if (mActivityStateListeners == null)
  1493. {
  1494. mActivityStateListeners = new ArrayList();
  1495. }
  1496. if (!mActivityStateListeners.contains(statechangecallback))
  1497. {
  1498. mActivityStateListeners.add(statechangecallback);
  1499. }
  1500. }
  1501. public void addInputEventListner(InputEventCallback inputeventcallback)
  1502. {
  1503. if (mInputEventListeners == null)
  1504. {
  1505. mInputEventListeners = new ArrayList();
  1506. }
  1507. if (!mInputEventListeners.contains(inputeventcallback))
  1508. {
  1509. mInputEventListeners.add(inputeventcallback);
  1510. }
  1511. }
  1512. public void applyDownloadedConfig()
  1513. {
  1514. if (sEntryPoint != null)
  1515. {
  1516. sEntryPoint.EntryApplyDownloadedConfig();
  1517. }
  1518. }
  1519. public void didRemoveOverlay()
  1520. {
  1521. if (m_overlaysLayout != null && m_overlaysLayout.getChildCount() == 0)
  1522. {
  1523. m_layout.removeView(m_overlaysLayout);
  1524. m_overlaysLayout = null;
  1525. }
  1526. }
  1527. public boolean dispatchGenericMotionEvent(MotionEvent motionevent, boolean flag)
  1528. {
  1529. return callInputEventListeners(motionevent);
  1530. }
  1531. public boolean dispatchKeyEvent(KeyEvent keyevent, boolean flag)
  1532. {
  1533. return callInputEventListeners(keyevent);
  1534. }
  1535. public void ensureZOrder()
  1536. {
  1537. for (int i = 7; i >= 0; i--)
  1538. {
  1539. if (m_planes.get(i) != null && m_layout.indexOfChild((View)m_planes.get(i)) >= 0)
  1540. {
  1541. m_layout.bringChildToFront((View)m_planes.get(i));
  1542. }
  1543. }
  1544. }
  1545. public void finish()
  1546. {
  1547. if (m_activity != null)
  1548. {
  1549. m_activity.finish();
  1550. }
  1551. }
  1552. public void finishActivityFromChild(Activity activity, int i)
  1553. {
  1554. }
  1555. public void finishFromChild(Activity activity)
  1556. {
  1557. }
  1558. public Activity getActivity()
  1559. {
  1560. return m_activity;
  1561. }
  1562. public Application getApplication()
  1563. {
  1564. return m_application;
  1565. }
  1566. public Context getApplicationContext()
  1567. {
  1568. return m_application;
  1569. }
  1570. public boolean getAutoOrients()
  1571. {
  1572. return mOrientationManager.getAutoOrients();
  1573. }
  1574. public AndroidCameraView getCameraView()
  1575. {
  1576. return m_cameraView;
  1577. }
  1578. public Context getDefaultContext()
  1579. {
  1580. if (m_activity != null)
  1581. {
  1582. return m_activity;
  1583. } else
  1584. {
  1585. return m_application;
  1586. }
  1587. }
  1588. public int getDefaultIntentFlags()
  1589. {
  1590. return m_activity == null ? 0x10000000 : 0;
  1591. }
  1592. public int getDeviceOrientation()
  1593. {
  1594. return mOrientationManager.getDeviceOrientation();
  1595. }
  1596. public FlashEGL getEgl()
  1597. {
  1598. if (m_flashEGL == null)
  1599. {
  1600. m_flashEGL = new FlashEGL();
  1601. }
  1602. return m_flashEGL;
  1603. }
  1604. public int getHardKeyboardType()
  1605. {
  1606. return mHardKeyboardType;
  1607. }
  1608. protected boolean getIsFullScreen()
  1609. {
  1610. return mIsFullScreen;
  1611. }
  1612. public int getOrientation()
  1613. {
  1614. return mOrientationManager.getOrientation();
  1615. }
  1616. public RelativeLayout getOverlaysLayout(boolean flag)
  1617. {
  1618. if (flag && m_overlaysLayout == null)
  1619. {
  1620. m_overlaysLayout = new RelativeLayout(m_activity);
  1621. m_layout.addView(m_overlaysLayout);
  1622. }
  1623. return m_overlaysLayout;
  1624. }
  1625. public Context getRuntimeContext()
  1626. {
  1627. return m_runtimeContext;
  1628. }
  1629. public boolean getSpeakerphoneOn()
  1630. {
  1631. return ((AudioManager)getActivity().getSystemService("audio")).isSpeakerphoneOn();
  1632. }
  1633. public int[] getSupportedOrientations()
  1634. {
  1635. return mOrientationManager.getSupportedOrientations();
  1636. }
  1637. public View getView()
  1638. {
  1639. return m_mainView;
  1640. }
  1641. public void gotResultFromDialog(boolean flag, String s)
  1642. {
  1643. boolean flag1;
  1644. if (flag)
  1645. {
  1646. if (s.length() != 0)
  1647. {
  1648. flag1 = Utils.nativeConnectDebuggerSocket(s);
  1649. } else
  1650. {
  1651. flag1 = false;
  1652. }
  1653. if (!flag1)
  1654. {
  1655. showDialogforIpAddress(s);
  1656. } else
  1657. {
  1658. mDebuggerSettings.setHost(s);
  1659. mDebuggerSettings.setListen(false);
  1660. mShowDebuggerDialog = true;
  1661. }
  1662. } else
  1663. {
  1664. flag1 = false;
  1665. }
  1666. if (flag1 || !flag)
  1667. {
  1668. afterOnCreate();
  1669. }
  1670. }
  1671. public void initCallStateListener()
  1672. {
  1673. if (sAndroidTelephonyManager == null)
  1674. {
  1675. sAndroidTelephonyManager = AndroidTelephonyManager.CreateAndroidTelephonyManager(getApplicationContext());
  1676. sAndroidTelephonyManager.listen(true);
  1677. }
  1678. }
  1679. public boolean isApplicationLaunched()
  1680. {
  1681. return sApplicationLaunched;
  1682. }
  1683. public boolean is

Large files files are truncated, but you can click here to view the full file