Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.android.settings.deviceinfo;
- import android.app.Activity;
- import android.app.AlertDialog;
- import android.app.AlertDialog.Builder;
- import android.content.ComponentName;
- import android.content.DialogInterface;
- import android.content.DialogInterface.OnClickListener;
- import android.content.Intent;
- import android.os.Bundle;
- import android.os.Environment;
- import android.util.Log;
- import android.view.Display;
- import android.view.View;
- import android.view.View.OnClickListener;
- import android.view.WindowManager;
- import android.widget.Button;
- import android.widget.TextView;
- import java.io.File;
- public class CheckPackage extends Activity
- {
- Button m_OK;
- TextView m_promt;
- // ERROR //
- private boolean getVersionInfor(String paramString)
- {
- // Byte code:
- // 0: new 27 java/io/FileReader
- // 3: dup
- // 4: aload_1
- // 5: invokespecial 30 java/io/FileReader:<init> (Ljava/lang/String;)V
- // 8: astore_2
- // 9: new 32 java/io/BufferedReader
- // 12: dup
- // 13: aload_2
- // 14: sipush 256
- // 17: invokespecial 35 java/io/BufferedReader:<init> (Ljava/io/Reader;I)V
- // 20: astore_3
- // 21: aload_3
- // 22: invokevirtual 39 java/io/BufferedReader:readLine ()Ljava/lang/String;
- // 25: astore 4
- // 27: new 41 java/lang/StringBuilder
- // 30: dup
- // 31: invokespecial 42 java/lang/StringBuilder:<init> ()V
- // 34: ldc 44
- // 36: invokevirtual 48 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
- // 39: aload 4
- // 41: invokevirtual 48 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder;
- // 44: invokevirtual 51 java/lang/StringBuilder:toString ()Ljava/lang/String;
- // 47: astore 5
- // 49: ldc 53
- // 51: aload 5
- // 53: invokestatic 59 android/util/Log:e (Ljava/lang/String;Ljava/lang/String;)I
- // 56: istore 6
- // 58: aload_3
- // 59: invokevirtual 62 java/io/BufferedReader:close ()V
- // 62: aload 4
- // 64: ifnull +26 -> 90
- // 67: aload 4
- // 69: ldc 64
- // 71: invokevirtual 70 java/lang/String:indexOf (Ljava/lang/String;)I
- // 74: istore 7
- // 76: iload 7
- // 78: iflt +12 -> 90
- // 81: iconst_1
- // 82: istore 8
- // 84: aload_3
- // 85: astore 9
- // 87: iload 8
- // 89: ireturn
- // 90: aload_3
- // 91: astore 10
- // 93: iconst_0
- // 94: istore 8
- // 96: goto -9 -> 87
- // 99: astore 11
- // 101: aload 11
- // 103: invokevirtual 73 java/io/FileNotFoundException:printStackTrace ()V
- // 106: iconst_0
- // 107: istore 8
- // 109: goto -22 -> 87
- // 112: astore 11
- // 114: aload 11
- // 116: invokevirtual 74 java/io/IOException:printStackTrace ()V
- // 119: iconst_0
- // 120: istore 8
- // 122: goto -35 -> 87
- // 125: astore 11
- // 127: aload_3
- // 128: astore 12
- // 130: goto -16 -> 114
- // 133: astore 11
- // 135: aload_3
- // 136: astore 13
- // 138: goto -37 -> 101
- //
- // Exception table:
- // from to target type
- // 0 21 99 java/io/FileNotFoundException
- // 0 21 112 java/io/IOException
- // 21 76 125 java/io/IOException
- // 21 76 133 java/io/FileNotFoundException
- }
- public void onCreate(Bundle paramBundle)
- {
- super.onCreate(paramBundle);
- setContentView(2130968584);
- Display localDisplay = getWindowManager().getDefaultDisplay();
- TextView localTextView1 = (TextView)findViewById(2131427582);
- this.m_promt = localTextView1;
- TextView localTextView2 = this.m_promt;
- int i = (int)(localDisplay.getHeight() * 0.7D);
- localTextView2.setHeight(i);
- this.m_promt.setTextSize(18.0F);
- this.m_promt.setText(2131297396);
- Button localButton1 = (Button)findViewById(2131427583);
- this.m_OK = localButton1;
- Button localButton2 = this.m_OK;
- int j = (int)(localDisplay.getWidth() * 0.3D);
- localButton2.setWidth(j);
- this.m_OK.setTextSize(18.0F);
- this.m_OK.setText("OK");
- Button localButton3 = this.m_OK;
- 1 local1 = new View.OnClickListener()
- {
- public void onClick(View paramView)
- {
- File localFile = Environment.getExternalStorageDirectory();
- StringBuilder localStringBuilder1 = new StringBuilder().append(" SDpath=");
- String str1 = localFile.getPath();
- String str2 = str1;
- int i = Log.e("HWY", str2);
- StringBuilder localStringBuilder2 = new StringBuilder();
- String str3 = localFile.getPath();
- String str4 = str3 + "/image/image.bin";
- if (new File(str4).exists())
- {
- if (!CheckPackage.this.getVersionInfor(str4))
- {
- CheckPackage localCheckPackage1 = CheckPackage.this;
- AlertDialog.Builder localBuilder1 = new AlertDialog.Builder(localCheckPackage1).setTitle(2131297397).setMessage(2131297399);
- 1 local1 = new DialogInterface.OnClickListener()
- {
- public void onClick(DialogInterface paramDialogInterface, int paramInt)
- {
- CheckPackage.this.finish();
- }
- };
- AlertDialog localAlertDialog1 = localBuilder1.setPositiveButton("OK", local1).show();
- return;
- }
- int j = Log.e("HWY", " Begin to update");
- Intent localIntent1 = new Intent();
- ComponentName localComponentName = new ComponentName("com.android.settings", "com.android.settings.deviceinfo.SDRise");
- Intent localIntent2 = localIntent1.setComponent(localComponentName);
- CheckPackage.this.startActivity(localIntent1);
- CheckPackage.this.finish();
- return;
- }
- int k = Log.e("HWY", " Update package doesn't exist!");
- CheckPackage localCheckPackage2 = CheckPackage.this;
- AlertDialog.Builder localBuilder2 = new AlertDialog.Builder(localCheckPackage2).setTitle(2131297397).setMessage(2131297398);
- 2 local2 = new DialogInterface.OnClickListener()
- {
- public void onClick(DialogInterface paramDialogInterface, int paramInt)
- {
- CheckPackage.this.finish();
- }
- };
- AlertDialog localAlertDialog2 = localBuilder2.setPositiveButton("OK", local2).show();
- }
- };
- localButton3.setOnClickListener(local1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement