Advertisement
bigrushdog

Untitled

Sep 10th, 2012
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 9.04 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.content.Context;
  9. import android.os.*;
  10. import android.util.Log;
  11. import android.view.View;
  12. import android.widget.Button;
  13. import android.widget.Toast;
  14. import com.android.internal.telephony.Phone;
  15. import com.android.internal.telephony.PhoneFactory;
  16. import java.io.*;
  17. import java.nio.ByteBuffer;
  18.  
  19. public class Prl_Write extends Activity
  20. {
  21.  
  22.     public Prl_Write()
  23.     {
  24.         PRL_File = null;
  25.         phone = null;
  26.         prl_length = 0;
  27.         fileSize = 0;
  28.         prlbytedata = null;
  29.         dstbyteArray = null;
  30.         mHandler = new Handler() {
  31.  
  32.             public void handleMessage(Message message)
  33.             {
  34.                 super.handleMessage(message);
  35.                 message.what;
  36.                 JVM INSTR tableswitch 9999980 9999980: default 28
  37.             //                           9999980 29;
  38.                    goto _L1 _L2
  39. _L1:
  40.                 return;
  41. _L2:
  42.                 AsyncResult asyncresult;
  43.                 Log.i("Prl_Write", (new StringBuilder()).append("OMADM PRL IPC response received : ").append(message).toString());
  44.                 asyncresult = (AsyncResult)message.obj;
  45.                 if(asyncresult != null) goto _L4; else goto _L3
  46. _L3:
  47.                 Log.i("Prl_Write", "No AsyncResult for PRL IPC");
  48. _L5:
  49.                 Log.i("Prl_Write", (new StringBuilder()).append("bytesWritten : ").append(bytesWritten).toString());
  50.                 if(bytesWritten < prl_length)
  51.                 {
  52.                     int i = prl_length - bytesWritten;
  53.                     int j;
  54.                     byte abyte0[];
  55.                     ByteArrayOutputStream bytearrayoutputstream;
  56.                     DataOutputStream dataoutputstream;
  57.                     if(i > 200)
  58.                     {
  59.                         i = 200;
  60.                         j = 1;
  61.                     } else
  62.                     {
  63.                         j = 0;
  64.                     }
  65.                     abyte0 = new byte[i];
  66.                     prlbytedata.get(abyte0, 0, abyte0.length);
  67.                     bytearrayoutputstream = new ByteArrayOutputStream();
  68.                     dataoutputstream = new DataOutputStream(bytearrayoutputstream);
  69.                     try
  70.                     {
  71.                         fileSize = 8 + abyte0.length;
  72.                         Log.i("Prl_Write", (new StringBuilder()).append("bytesWritten : ").append(bytesWritten).append(" / dstArray.length : ").append(abyte0.length).append(" / more : ").append(j).append(" /filesize : ").append(fileSize).toString());
  73.                         dataoutputstream.writeByte(10);
  74.                         dataoutputstream.writeByte(28);
  75.                         dataoutputstream.writeShort(fileSize);
  76.                         dataoutputstream.writeShort(prl_length);
  77.                         dataoutputstream.writeByte(abyte0.length);
  78.                         dataoutputstream.writeByte(j);
  79.                         dataoutputstream.write(abyte0);
  80.                         phone.invokeOemRilRequestRaw(bytearrayoutputstream.toByteArray(), mHandler.obtainMessage(9999980));
  81.                         Prl_Write prl_write = Prl_Write.this;
  82.                         prl_write.bytesWritten = prl_write.bytesWritten + abyte0.length;
  83.                     }
  84.                     catch(FileNotFoundException filenotfoundexception)
  85.                     {
  86.                         filenotfoundexception.printStackTrace();
  87.                         Toast.makeText(getBaseContext(), "Fail to send TEST PRL file", 0).show();
  88.                     }
  89.                     catch(IOException ioexception)
  90.                     {
  91.                         ioexception.printStackTrace();
  92.                     }
  93.                 } else
  94.                 {
  95.                     rebootDevice();
  96.                 }
  97.                 if(true) goto _L1; else goto _L4
  98. _L4:
  99.                 if(asyncresult.exception != null)
  100.                     Log.i("Prl_Write", (new StringBuilder()).append("AsyncResult Exception for PRL IPC : ").append(asyncresult.exception).toString());
  101.                 if(asyncresult.result == null)
  102.                     Log.i("Prl_Write", (new StringBuilder()).append("No answer for PRL IPC").append(asyncresult).toString());
  103.                   goto _L5
  104.             }
  105.  
  106.             final Prl_Write this$0;
  107.  
  108.            
  109.             {
  110.                 this$0 = Prl_Write.this;
  111.                 super();
  112.             }
  113.         };
  114.     }
  115.  
  116.     private void rebootDevice()
  117.     {
  118.         Log.i("Prl_Write", " - reboot Device");
  119.         ((PowerManager)getSystemService("power")).reboot(null);
  120.     }
  121.  
  122.     public void check_prlfile_insdcard()
  123.     {
  124.         PRL_File = new File("/sdcard/TEST.prl");
  125.         prl_length = (int)PRL_File.length();
  126.         if(PRL_File.exists())
  127.             copyPRLFile();
  128.         else
  129.             Toast.makeText(getBaseContext(), "There is no TEST PRL file in SDcard", 0).show();
  130.         finish();
  131.     }
  132.  
  133.     public void copyPRLFile()
  134.     {
  135.         in = new FileInputStream("/sdcard/TEST.prl");
  136.         prlbytedata = ByteBuffer.allocate(16384);
  137.         dstbyteArray = prlbytedata.array();
  138.         prl_length = in.read(dstbyteArray);
  139.         if(prllength < 0)
  140.             throw new IOException();
  141.           goto _L1
  142.         FileNotFoundException filenotfoundexception;
  143.         filenotfoundexception;
  144.         filenotfoundexception.printStackTrace();
  145.         Toast.makeText(getBaseContext(), "Fail to send TEST PRL file", 0).show();
  146. _L2:
  147.         return;
  148. _L1:
  149.         int i;
  150.         byte abyte0[];
  151.         Log.i("Prl_Write", (new StringBuilder()).append("prl_length:").append(prl_length).toString());
  152.         bytesWritten = 0;
  153.         i = 1;
  154.         if(prl_length > 200)
  155.             break MISSING_BLOCK_LABEL_352;
  156.         abyte0 = new byte[prl_length];
  157.         i = 0;
  158. _L3:
  159.         prlbytedata.get(abyte0, 0, abyte0.length);
  160.         ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
  161.         DataOutputStream dataoutputstream = new DataOutputStream(bytearrayoutputstream);
  162.         fileSize = 8 + abyte0.length;
  163.         Log.i("Prl_Write", (new StringBuilder()).append("bytesWritten : ").append(bytesWritten).append(" / dstArray.length : ").append(abyte0.length).append(" / more : ").append(i).append(" /filesize : ").append(fileSize).toString());
  164.         dataoutputstream.writeByte(10);
  165.         dataoutputstream.writeByte(28);
  166.         dataoutputstream.writeShort(fileSize);
  167.         dataoutputstream.writeShort(prl_length);
  168.         dataoutputstream.writeByte(abyte0.length);
  169.         dataoutputstream.writeByte(i);
  170.         dataoutputstream.write(abyte0);
  171.         phone.invokeOemRilRequestRaw(bytearrayoutputstream.toByteArray(), mHandler.obtainMessage(9999980));
  172.         bytesWritten = bytesWritten + abyte0.length;
  173.         in.close();
  174.           goto _L2
  175.         IOException ioexception;
  176.         ioexception;
  177.         ioexception.printStackTrace();
  178.           goto _L2
  179.         abyte0 = new byte[200];
  180.           goto _L3
  181.     }
  182.  
  183.     public void onCreate(Bundle bundle)
  184.     {
  185.         super.onCreate(bundle);
  186.         setContentView(2130903059);
  187.         Button button = (Button)findViewById(2131165240);
  188.         phone = PhoneFactory.getDefaultPhone();
  189.         if(button == null)
  190.             finish();
  191.         else
  192.             button.setOnClickListener(new android.view.View.OnClickListener() {
  193.  
  194.                 public void onClick(View view)
  195.                 {
  196.                     check_prlfile_insdcard();
  197.                 }
  198.  
  199.                 final Prl_Write this$0;
  200.  
  201.            
  202.             {
  203.                 this$0 = Prl_Write.this;
  204.                 super();
  205.             }
  206.             });
  207.     }
  208.  
  209.     private static final int MAX_PRL_SIZE = 16384;
  210.     static final int OEM_FUNCTION_ID_OMADM = 10;
  211.     static final int OEM_OMADM_WRITE_PRL = 28;
  212.     private static final int OMADM_PRL_RESP = 9999980;
  213.     private static final String PRL_FILE_PATH = "/sdcard/TEST.prl";
  214.     private static final String TAG = "Prl_Write";
  215.     private static Context mContext = null;
  216.     private File PRL_File;
  217.     int bytesWritten;
  218.     byte dstbyteArray[];
  219.     int fileSize;
  220.     private FileInputStream in;
  221.     private Handler mHandler;
  222.     private Phone phone;
  223.     private int prl_length;
  224.     ByteBuffer prlbytedata;
  225.     int prllength;
  226.  
  227.  
  228.  
  229.  
  230.  
  231. }
  232.  
  233.  
  234. /*
  235.     DECOMPILATION REPORT
  236.  
  237.     Decompiled from: /home/bigrushdog/dex2jar_apks/HiddenMenu-dex2jar.jar
  238.     Total time: 6 ms
  239.     Jad reported messages/errors:
  240. The class file version is 50.0 (only 45.3, 46.0 and 47.0 are supported)
  241. The class file version is 50.0 (only 45.3, 46.0 and 47.0 are supported)
  242. The class file version is 50.0 (only 45.3, 46.0 and 47.0 are supported)
  243. Couldn't fully decompile method handleMessage
  244. Couldn't fully decompile method copyPRLFile
  245. Couldn't resolve all exception handlers in method copyPRLFile
  246.     Exit status: 0
  247.     Caught exceptions:
  248. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement