Advertisement
Guest User

CheckPackage.class

a guest
Sep 3rd, 2011
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 6.42 KB | None | 0 0
  1. package com.android.settings.deviceinfo;
  2.  
  3. import android.app.Activity;
  4. import android.app.AlertDialog;
  5. import android.app.AlertDialog.Builder;
  6. import android.content.ComponentName;
  7. import android.content.DialogInterface;
  8. import android.content.DialogInterface.OnClickListener;
  9. import android.content.Intent;
  10. import android.os.Bundle;
  11. import android.os.Environment;
  12. import android.util.Log;
  13. import android.view.Display;
  14. import android.view.View;
  15. import android.view.View.OnClickListener;
  16. import android.view.WindowManager;
  17. import android.widget.Button;
  18. import android.widget.TextView;
  19. import java.io.File;
  20.  
  21. public class CheckPackage extends Activity
  22. {
  23.   Button m_OK;
  24.   TextView m_promt;
  25.  
  26.   // ERROR //
  27.   private boolean getVersionInfor(String paramString)
  28.   {
  29.     // Byte code:
  30.     //   0: new 27  java/io/FileReader
  31.     //   3: dup
  32.     //   4: aload_1
  33.     //   5: invokespecial 30    java/io/FileReader:<init>   (Ljava/lang/String;)V
  34.     //   8: astore_2
  35.     //   9: new 32  java/io/BufferedReader
  36.     //   12: dup
  37.     //   13: aload_2
  38.     //   14: sipush 256
  39.     //   17: invokespecial 35   java/io/BufferedReader:<init>   (Ljava/io/Reader;I)V
  40.     //   20: astore_3
  41.     //   21: aload_3
  42.     //   22: invokevirtual 39   java/io/BufferedReader:readLine ()Ljava/lang/String;
  43.     //   25: astore 4
  44.     //   27: new 41 java/lang/StringBuilder
  45.     //   30: dup
  46.     //   31: invokespecial 42   java/lang/StringBuilder:<init>  ()V
  47.     //   34: ldc 44
  48.     //   36: invokevirtual 48   java/lang/StringBuilder:append  (Ljava/lang/String;)Ljava/lang/StringBuilder;
  49.     //   39: aload 4
  50.     //   41: invokevirtual 48   java/lang/StringBuilder:append  (Ljava/lang/String;)Ljava/lang/StringBuilder;
  51.     //   44: invokevirtual 51   java/lang/StringBuilder:toString    ()Ljava/lang/String;
  52.     //   47: astore 5
  53.     //   49: ldc 53
  54.     //   51: aload 5
  55.     //   53: invokestatic 59    android/util/Log:e  (Ljava/lang/String;Ljava/lang/String;)I
  56.     //   56: istore 6
  57.     //   58: aload_3
  58.     //   59: invokevirtual 62   java/io/BufferedReader:close    ()V
  59.     //   62: aload 4
  60.     //   64: ifnull +26 -> 90
  61.     //   67: aload 4
  62.     //   69: ldc 64
  63.     //   71: invokevirtual 70   java/lang/String:indexOf    (Ljava/lang/String;)I
  64.     //   74: istore 7
  65.     //   76: iload 7
  66.     //   78: iflt +12 -> 90
  67.     //   81: iconst_1
  68.     //   82: istore 8
  69.     //   84: aload_3
  70.     //   85: astore 9
  71.     //   87: iload 8
  72.     //   89: ireturn
  73.     //   90: aload_3
  74.     //   91: astore 10
  75.     //   93: iconst_0
  76.     //   94: istore 8
  77.     //   96: goto -9 -> 87
  78.     //   99: astore 11
  79.     //   101: aload 11
  80.     //   103: invokevirtual 73  java/io/FileNotFoundException:printStackTrace   ()V
  81.     //   106: iconst_0
  82.     //   107: istore 8
  83.     //   109: goto -22 -> 87
  84.     //   112: astore 11
  85.     //   114: aload 11
  86.     //   116: invokevirtual 74  java/io/IOException:printStackTrace ()V
  87.     //   119: iconst_0
  88.     //   120: istore 8
  89.     //   122: goto -35 -> 87
  90.     //   125: astore 11
  91.     //   127: aload_3
  92.     //   128: astore 12
  93.     //   130: goto -16 -> 114
  94.     //   133: astore 11
  95.     //   135: aload_3
  96.     //   136: astore 13
  97.     //   138: goto -37 -> 101
  98.     //
  99.     // Exception table:
  100.     //   from   to  target  type
  101.     //   0  21  99  java/io/FileNotFoundException
  102.     //   0  21  112 java/io/IOException
  103.     //   21 76  125 java/io/IOException
  104.     //   21 76  133 java/io/FileNotFoundException
  105.   }
  106.  
  107.   public void onCreate(Bundle paramBundle)
  108.   {
  109.     super.onCreate(paramBundle);
  110.     setContentView(2130968584);
  111.     Display localDisplay = getWindowManager().getDefaultDisplay();
  112.     TextView localTextView1 = (TextView)findViewById(2131427582);
  113.     this.m_promt = localTextView1;
  114.     TextView localTextView2 = this.m_promt;
  115.     int i = (int)(localDisplay.getHeight() * 0.7D);
  116.     localTextView2.setHeight(i);
  117.     this.m_promt.setTextSize(18.0F);
  118.     this.m_promt.setText(2131297396);
  119.     Button localButton1 = (Button)findViewById(2131427583);
  120.     this.m_OK = localButton1;
  121.     Button localButton2 = this.m_OK;
  122.     int j = (int)(localDisplay.getWidth() * 0.3D);
  123.     localButton2.setWidth(j);
  124.     this.m_OK.setTextSize(18.0F);
  125.     this.m_OK.setText("OK");
  126.     Button localButton3 = this.m_OK;
  127.     1 local1 = new View.OnClickListener()
  128.     {
  129.       public void onClick(View paramView)
  130.       {
  131.         File localFile = Environment.getExternalStorageDirectory();
  132.         StringBuilder localStringBuilder1 = new StringBuilder().append(" SDpath=");
  133.         String str1 = localFile.getPath();
  134.         String str2 = str1;
  135.         int i = Log.e("HWY", str2);
  136.         StringBuilder localStringBuilder2 = new StringBuilder();
  137.         String str3 = localFile.getPath();
  138.         String str4 = str3 + "/image/image.bin";
  139.         if (new File(str4).exists())
  140.         {
  141.           if (!CheckPackage.this.getVersionInfor(str4))
  142.           {
  143.             CheckPackage localCheckPackage1 = CheckPackage.this;
  144.             AlertDialog.Builder localBuilder1 = new AlertDialog.Builder(localCheckPackage1).setTitle(2131297397).setMessage(2131297399);
  145.             1 local1 = new DialogInterface.OnClickListener()
  146.             {
  147.               public void onClick(DialogInterface paramDialogInterface, int paramInt)
  148.               {
  149.                 CheckPackage.this.finish();
  150.               }
  151.             };
  152.             AlertDialog localAlertDialog1 = localBuilder1.setPositiveButton("OK", local1).show();
  153.             return;
  154.           }
  155.           int j = Log.e("HWY", " Begin to update");
  156.           Intent localIntent1 = new Intent();
  157.           ComponentName localComponentName = new ComponentName("com.android.settings", "com.android.settings.deviceinfo.SDRise");
  158.           Intent localIntent2 = localIntent1.setComponent(localComponentName);
  159.           CheckPackage.this.startActivity(localIntent1);
  160.           CheckPackage.this.finish();
  161.           return;
  162.         }
  163.         int k = Log.e("HWY", " Update package doesn't exist!");
  164.         CheckPackage localCheckPackage2 = CheckPackage.this;
  165.         AlertDialog.Builder localBuilder2 = new AlertDialog.Builder(localCheckPackage2).setTitle(2131297397).setMessage(2131297398);
  166.         2 local2 = new DialogInterface.OnClickListener()
  167.         {
  168.           public void onClick(DialogInterface paramDialogInterface, int paramInt)
  169.           {
  170.             CheckPackage.this.finish();
  171.           }
  172.         };
  173.         AlertDialog localAlertDialog2 = localBuilder2.setPositiveButton("OK", local2).show();
  174.       }
  175.     };
  176.     localButton3.setOnClickListener(local1);
  177.   }
  178. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement