Advertisement
bigrushdog

Untitled

Oct 22nd, 2012
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 14.08 KB | None | 0 0
  1. /*jadclipse*/// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
  2. // Jad home page: http://www.geocities.com/kpdus/jad.html
  3. // Decompiler options: packimports(3) radix(10) lradix(10)
  4.  
  5. package com.android.hiddenmenu;
  6.  
  7. import android.app.Activity;
  8. import android.app.Dialog;
  9. import android.content.DialogInterface;
  10. import android.content.res.Resources;
  11. import android.net.ConnectivityManager;
  12. import android.os.*;
  13. import android.util.Log;
  14. import android.view.View;
  15. import android.widget.RadioButton;
  16. import com.android.internal.telephony.Phone;
  17. import com.android.internal.telephony.PhoneFactory;
  18. import java.io.*;
  19.  
  20. public class DUN extends Activity
  21.     implements android.view.View.OnClickListener
  22. {
  23.  
  24.     public DUN()
  25.     {
  26.         byte abyte0[] = new byte[2];
  27.         abyte0[0] = 49;
  28.         abyte0[1] = 0;
  29.         DUN_ON = abyte0;
  30.         byte abyte1[] = new byte[2];
  31.         abyte1[0] = 50;
  32.         abyte1[1] = 0;
  33.         DUN_OFF = abyte1;
  34.         byte abyte2[] = new byte[3];
  35.         abyte2[0] = 48;
  36.         abyte2[1] = 49;
  37.         abyte2[2] = 0;
  38.         MSM_AP = abyte2;
  39.         byte abyte3[] = new byte[4];
  40.         abyte3[0] = 80;
  41.         abyte3[1] = 68;
  42.         abyte3[2] = 65;
  43.         abyte3[3] = 0;
  44.         MSM_CP = abyte3;
  45.         byte abyte4[] = new byte[6];
  46.         abyte4[0] = 77;
  47.         abyte4[1] = 79;
  48.         abyte4[2] = 68;
  49.         abyte4[3] = 69;
  50.         abyte4[4] = 77;
  51.         abyte4[5] = 0;
  52.         MDM = abyte4;
  53.         cm = null;
  54.         mPhone = null;
  55.         IPC_USB_DUN = 2;
  56.         IPC_BROWSER_CALL = 1;
  57.         phone = null;
  58.         mHandler = new Handler() {
  59.  
  60.             public void handleMessage(Message message)
  61.             {
  62.                 message.what;
  63.                 JVM INSTR tableswitch 1999 1999: default 24
  64.             //                           1999 25;
  65.                    goto _L1 _L2
  66. _L1:
  67.                 return;
  68. _L2:
  69.                 Log.i("DUN", "Verify response incoming!!");
  70.                 AsyncResult asyncresult = (AsyncResult)message.obj;
  71.                 if(asyncresult.exception != null)
  72.                     Log.i("DUN", "AsyncResult Exception Occur!!!");
  73.                 else
  74.                 if(asyncresult.result == null)
  75.                     Log.i("DUN", "ar.result == NULL! - No answer");
  76.                 else
  77.                     finish();
  78.                 if(true) goto _L1; else goto _L3
  79. _L3:
  80.             }
  81.  
  82.             final DUN this$0;
  83.  
  84.            
  85.             {
  86.                 this$0 = DUN.this;
  87.                 super();
  88.             }
  89.         };
  90.         radio_listener = new android.view.View.OnClickListener() {
  91.  
  92.             public void onClick(View view)
  93.             {
  94.                 (RadioButton)view;
  95.                 view.getId();
  96.                 JVM INSTR tableswitch 2131165193 2131165194: default 32
  97.             //                           2131165193 33
  98.             //                           2131165194 61;
  99.                    goto _L1 _L2 _L3
  100. _L1:
  101.                 return;
  102. _L2:
  103.                 Log.i("OnClickListener", "DUN ON");
  104.                 saveDUNStatus(true);
  105.                 showDialog(101);
  106.                 continue; /* Loop/switch isn't completed */
  107. _L3:
  108.                 setDataDunEnabled(false);
  109.                 saveDUNStatus(false);
  110.                 sendOemData(IPC_BROWSER_CALL);
  111.                 finish();
  112.                 if(true) goto _L1; else goto _L4
  113. _L4:
  114.             }
  115.  
  116.             final DUN this$0;
  117.  
  118.            
  119.             {
  120.                 this$0 = DUN.this;
  121.                 super();
  122.             }
  123.         };
  124.     }
  125.  
  126.     private void changeUsb(String s)
  127.         throws IOException
  128.     {
  129.         if(s.equals("MSM"))
  130.             setUSBSwitching((byte)32);
  131.         else
  132.         if(s.equals("MDM"))
  133.             setUSBSwitching((byte)16);
  134.         break MISSING_BLOCK_LABEL_47;
  135.         Exception exception1;
  136.         exception1;
  137.         exception1.printStackTrace();
  138.         break MISSING_BLOCK_LABEL_47;
  139.         Exception exception;
  140.         exception;
  141.         throw exception;
  142.     }
  143.  
  144.     private boolean isDUNEnable()
  145.     {
  146.         byte abyte0[];
  147.         String s;
  148.         abyte0 = new byte[100];
  149.         s = new String("MODEM");
  150.         s.trim();
  151.         if(cm.getMobileDataEnabled()) goto _L2; else goto _L1
  152. _L1:
  153.         FileInputStream fileinputstream = new FileInputStream(new File("/sys/devices/tuna_otg/usb_sel"));
  154.         String s1;
  155.         fileinputstream.read(abyte0);
  156.         s1 = new String(abyte0);
  157.         int i;
  158.         s1.trim();
  159.         i = s1.indexOf(s);
  160.         if(i == -1) goto _L2; else goto _L3
  161. _L3:
  162.         boolean flag = true;
  163. _L4:
  164.         return flag;
  165.         Exception exception;
  166.         exception;
  167. _L5:
  168.         Log.i("DUN", (new StringBuilder()).append("isDUNEnable Exception : ").append(exception).toString());
  169. _L2:
  170.         flag = false;
  171.           goto _L4
  172.         exception;
  173.           goto _L5
  174.         exception;
  175.           goto _L5
  176.     }
  177.  
  178.     private void saveDUNStatus(boolean flag)
  179.     {
  180.         FileOutputStream fileoutputstream = null;
  181.         FileOutputStream fileoutputstream1 = new FileOutputStream("/sdcard/cfg_dun_status");
  182.         if(!flag) goto _L2; else goto _L1
  183. _L1:
  184.         fileoutputstream1.write(DUN_ON);
  185. _L4:
  186.         if(fileoutputstream1 == null)
  187.             break MISSING_BLOCK_LABEL_33;
  188.         fileoutputstream1.close();
  189. _L5:
  190.         return;
  191. _L2:
  192.         if(flag) goto _L4; else goto _L3
  193. _L3:
  194.         fileoutputstream1.write(DUN_OFF);
  195.           goto _L4
  196.         Exception exception2;
  197.         exception2;
  198.         fileoutputstream = fileoutputstream1;
  199. _L8:
  200.         Log.i("DUN", (new StringBuilder()).append("Not Save DUNStatus Exeption : ").append(exception2).toString());
  201.         if(fileoutputstream != null)
  202.             try
  203.             {
  204.                 fileoutputstream.close();
  205.             }
  206.             catch(Exception exception3)
  207.             {
  208.                 Log.e("DUN", (new StringBuilder()).append("DUN Param Close Fail : ").append(exception3).toString());
  209.             }
  210.           goto _L5
  211.         Exception exception4;
  212.         exception4;
  213.         Log.e("DUN", (new StringBuilder()).append("DUN Param Close Fail : ").append(exception4).toString());
  214.           goto _L5
  215.         Exception exception;
  216.         exception;
  217. _L7:
  218.         if(fileoutputstream != null)
  219.             try
  220.             {
  221.                 fileoutputstream.close();
  222.             }
  223.             catch(Exception exception1)
  224.             {
  225.                 Log.e("DUN", (new StringBuilder()).append("DUN Param Close Fail : ").append(exception1).toString());
  226.             }
  227.         throw exception;
  228.         exception;
  229.         fileoutputstream = fileoutputstream1;
  230.         if(true) goto _L7; else goto _L6
  231. _L6:
  232.         exception2;
  233.           goto _L8
  234.     }
  235.  
  236.     private void sendOemData(byte byte0)
  237.     {
  238.         ByteArrayOutputStream bytearrayoutputstream;
  239.         DataOutputStream dataoutputstream;
  240.         bytearrayoutputstream = new ByteArrayOutputStream();
  241.         dataoutputstream = new DataOutputStream(bytearrayoutputstream);
  242.         mPhone = PhoneFactory.getDefaultPhone();
  243.         dataoutputstream.writeByte(81);
  244.         dataoutputstream.writeByte(21);
  245.         dataoutputstream.writeShort(5);
  246.         dataoutputstream.writeByte(byte0);
  247.         mPhone.invokeOemRilRequestRaw(bytearrayoutputstream.toByteArray(), null);
  248. _L2:
  249.         return;
  250.         IOException ioexception;
  251.         ioexception;
  252.         if(true) goto _L2; else goto _L1
  253. _L1:
  254.     }
  255.  
  256.     private void setChecked(boolean flag)
  257.     {
  258.         if(flag) goto _L2; else goto _L1
  259. _L1:
  260.         DUN_Off.setChecked(true);
  261.         DUN_On.setChecked(false);
  262. _L4:
  263.         return;
  264. _L2:
  265.         if(flag)
  266.         {
  267.             DUN_Off.setChecked(false);
  268.             DUN_On.setChecked(true);
  269.         }
  270.         if(true) goto _L4; else goto _L3
  271. _L3:
  272.     }
  273.  
  274.     private void setDataDunEnabled(boolean flag)
  275.     {
  276.         if(!flag)
  277.             break MISSING_BLOCK_LABEL_45;
  278.         cm.setMobileDataEnabled(false);
  279.         changeUsb("MDM");
  280.         setChecked(false);
  281.         Log.i("OnClickListener", "DUN OFF");
  282. _L1:
  283.         return;
  284.         IOException ioexception1;
  285.         ioexception1;
  286.         ioexception1.printStackTrace();
  287.           goto _L1
  288.         try
  289.         {
  290.             cm.setMobileDataEnabled(true);
  291.             changeUsb("MSM");
  292.             setChecked(false);
  293.             Log.i("OnClickListener", "DUN OFF");
  294.         }
  295.         catch(IOException ioexception)
  296.         {
  297.             ioexception.printStackTrace();
  298.         }
  299.           goto _L1
  300.     }
  301.  
  302.     private void setUSBSwitching(byte byte0)
  303.     {
  304.         ByteArrayOutputStream bytearrayoutputstream;
  305.         DataOutputStream dataoutputstream;
  306.         Log.d("DUN", (new StringBuilder()).append("setUSBSwitching ").append(byte0).toString());
  307.         phone = PhoneFactory.getDefaultPhone();
  308.         bytearrayoutputstream = new ByteArrayOutputStream();
  309.         dataoutputstream = new DataOutputStream(bytearrayoutputstream);
  310.         dataoutputstream.writeByte(117);
  311.         dataoutputstream.writeByte(19);
  312.         dataoutputstream.writeShort(5);
  313.         dataoutputstream.writeByte(byte0);
  314.         phone.invokeOemRilRequestRaw(bytearrayoutputstream.toByteArray(), null);
  315. _L2:
  316.         return;
  317.         IOException ioexception;
  318.         ioexception;
  319.         Log.i("DUN", " failed to write");
  320.         if(true) goto _L2; else goto _L1
  321. _L1:
  322.     }
  323.  
  324.     public void onClick(View view)
  325.     {
  326.         view.getId();
  327.         JVM INSTR tableswitch 2131165190 2131165190: default 24
  328.     //                   2131165190 25;
  329.            goto _L1 _L2
  330. _L1:
  331.         return;
  332. _L2:
  333.         Log.i("DUN", "cancel Button");
  334.         finish();
  335.         if(true) goto _L1; else goto _L3
  336. _L3:
  337.     }
  338.  
  339.     public void onCreate(Bundle bundle)
  340.     {
  341.         super.onCreate(bundle);
  342.         setContentView(2130903044);
  343.         cm = (ConnectivityManager)getSystemService("connectivity");
  344.         DUN_On = (RadioButton)findViewById(2131165193);
  345.         DUN_Off = (RadioButton)findViewById(2131165194);
  346.         View view = findViewById(2131165190);
  347.         DUN_On.setOnClickListener(radio_listener);
  348.         DUN_Off.setOnClickListener(radio_listener);
  349.         view.setOnClickListener(this);
  350.         setChecked(isDUNEnable());
  351.     }
  352.  
  353.     protected Dialog onCreateDialog(int i)
  354.     {
  355.         i;
  356.         JVM INSTR tableswitch 101 101: default 20
  357.     //                   101 24;
  358.            goto _L1 _L2
  359. _L1:
  360.         Object obj = null;
  361. _L4:
  362.         return ((Dialog) (obj));
  363. _L2:
  364.         obj = (new android.app.AlertDialog.Builder(this)).setMessage(getResources().getString(2131034245)).setTitle(17039380).setIcon(17301543).setPositiveButton(17039379, new android.content.DialogInterface.OnClickListener() {
  365.  
  366.             public void onClick(DialogInterface dialoginterface, int j)
  367.             {
  368.                 setDataDunEnabled(true);
  369.                 sendOemData(IPC_USB_DUN);
  370.                 finish();
  371.             }
  372.  
  373.             final DUN this$0;
  374.  
  375.            
  376.             {
  377.                 this$0 = DUN.this;
  378.                 super();
  379.             }
  380.         }).setNegativeButton(17039369, new android.content.DialogInterface.OnClickListener() {
  381.  
  382.             public void onClick(DialogInterface dialoginterface, int j)
  383.             {
  384.                 setDataDunEnabled(false);
  385.             }
  386.  
  387.             final DUN this$0;
  388.  
  389.            
  390.             {
  391.                 this$0 = DUN.this;
  392.                 super();
  393.             }
  394.         }).create();
  395.         if(true) goto _L4; else goto _L3
  396. _L3:
  397.     }
  398.  
  399.     protected void onResume()
  400.     {
  401.         super.onResume();
  402.         setChecked(isDUNEnable());
  403.     }
  404.  
  405.     private static final int DIALOG = 101;
  406.     private static final int GET_DATA_DONE = 1998;
  407.     private static final String LOG_TAG = "DUN";
  408.     static final int OEM_FUNCTION_ID_MISC = 117;
  409.     static final int OEM_HIDDEN_DUN_MODE = 21;
  410.     static final int OEM_MAIN_CMD_HIDDEN = 81;
  411.     private static final byte USB_PARAM_MODEM = 16;
  412.     private static final byte USB_PARAM_PDA = 32;
  413.     private static final int VERIFY_DATA_DONE = 1999;
  414.     private final byte DUN_OFF[];
  415.     private final byte DUN_ON[];
  416.     private RadioButton DUN_Off;
  417.     private RadioButton DUN_On;
  418.     private byte IPC_BROWSER_CALL;
  419.     private byte IPC_USB_DUN;
  420.     private final byte MDM[];
  421.     private final byte MSM_AP[];
  422.     private final byte MSM_CP[];
  423.     private final String PARAM_DUN_STATUS = "/sdcard/cfg_dun_status";
  424.     private final String USB_PATH = "/sys/devices/tuna_otg/usb_sel";
  425.     ConnectivityManager cm;
  426.     private Handler mHandler;
  427.     private Phone mPhone;
  428.     private Phone phone;
  429.     android.view.View.OnClickListener radio_listener;
  430.  
  431.  
  432.  
  433.  
  434.  
  435. }
  436.  
  437.  
  438. /*
  439.     DECOMPILATION REPORT
  440.  
  441.     Decompiled from: /home/bigrushdog/dex2jar_apks/toroplus_cdma/HiddenMenu-dex2jar.jar
  442.     Total time: 18 ms
  443.     Jad reported messages/errors:
  444. The class file version is 50.0 (only 45.3, 46.0 and 47.0 are supported)
  445. The class file version is 50.0 (only 45.3, 46.0 and 47.0 are supported)
  446. The class file version is 50.0 (only 45.3, 46.0 and 47.0 are supported)
  447. The class file version is 50.0 (only 45.3, 46.0 and 47.0 are supported)
  448. The class file version is 50.0 (only 45.3, 46.0 and 47.0 are supported)
  449. Couldn't fully decompile method handleMessage
  450. Couldn't fully decompile method onClick
  451. Couldn't fully decompile method changeUsb
  452. Couldn't resolve all exception handlers in method changeUsb
  453. Couldn't fully decompile method isDUNEnable
  454. Couldn't resolve all exception handlers in method isDUNEnable
  455. Couldn't fully decompile method saveDUNStatus
  456. Couldn't resolve all exception handlers in method saveDUNStatus
  457. Couldn't fully decompile method sendOemData
  458. Couldn't resolve all exception handlers in method sendOemData
  459. Couldn't fully decompile method setChecked
  460. Couldn't fully decompile method setDataDunEnabled
  461. Couldn't resolve all exception handlers in method setDataDunEnabled
  462. Couldn't fully decompile method setUSBSwitching
  463. Couldn't resolve all exception handlers in method setUSBSwitching
  464. Couldn't fully decompile method onClick
  465. Couldn't fully decompile method onCreateDialog
  466.     Exit status: 0
  467.     Caught exceptions:
  468. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement