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.DialogInterface;
- import android.content.DialogInterface.OnClickListener;
- import android.content.Intent;
- import android.os.Bundle;
- import android.os.Handler;
- import android.util.Log;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStream;
- import java.io.InputStreamReader;
- import java.io.PrintStream;
- import java.util.Timer;
- import java.util.TimerTask;
- public class SDRise extends Activity
- {
- int code = -1;
- final Handler cwjHandler;
- final Runnable mUpdateResults;
- Thread m_update;
- public SDRise()
- {
- Handler localHandler = new Handler();
- this.cwjHandler = localHandler;
- 1 local1 = new Runnable()
- {
- public void run()
- {
- SDRise.this.updateUI();
- }
- };
- this.mUpdateResults = local1;
- 3 local3 = new Thread()
- {
- public void run()
- {
- try
- {
- localProcess = Runtime.getRuntime().exec("/system/bin/Tgetmem 0x00201018 0x2E6F73C9 6");
- InputStream localInputStream = localProcess.getInputStream();
- InputStreamReader localInputStreamReader = new InputStreamReader(localInputStream);
- BufferedReader localBufferedReader = new BufferedReader(localInputStreamReader);
- while (true)
- {
- String str1 = localBufferedReader.readLine();
- if (str1 == null)
- break;
- System.out.println(str1);
- }
- }
- catch (IOException localInterruptedException)
- {
- localIOException.printStackTrace();
- int i = Log.e("HWY", "Exception in process");
- StringBuilder localStringBuilder1 = new StringBuilder().append("code=");
- int j = SDRise.this.code;
- String str2 = j;
- int k = Log.e("HWY", str2);
- if (localProcess != null)
- localProcess.destroy();
- while (true)
- {
- Intent localIntent1 = new Intent();
- Intent localIntent2 = localIntent1.setAction("android.intent.action.REBOOT");
- Intent localIntent3 = localIntent1.putExtra("nowait", 1);
- Intent localIntent4 = localIntent1.putExtra("interval", 1);
- Intent localIntent5 = localIntent1.putExtra("window", 0);
- SDRise.this.sendBroadcast(localIntent1);
- return;
- try
- {
- SDRise localSDRise = SDRise.this;
- int m = localProcess.waitFor();
- localSDRise.code = m;
- StringBuilder localStringBuilder2 = new StringBuilder().append("code=");
- int n = SDRise.this.code;
- String str3 = n;
- int i1 = Log.e("HWY", str3);
- if (localProcess != null)
- localProcess.destroy();
- }
- catch (InterruptedException localInterruptedException)
- {
- while (true)
- {
- localInterruptedException.printStackTrace();
- int i2 = Log.e("HWY", "InterruptedException in process");
- }
- }
- }
- }
- finally
- {
- Process localProcess;
- StringBuilder localStringBuilder3 = new StringBuilder().append("code=");
- int i3 = SDRise.this.code;
- String str4 = i3;
- int i4 = Log.e("HWY", str4);
- if (localProcess != null)
- localProcess.destroy();
- }
- throw localObject;
- }
- };
- this.m_update = local3;
- }
- private void updateUI()
- {
- AlertDialog.Builder localBuilder = new AlertDialog.Builder(this).setTitle(2131297397).setMessage(2131297400);
- 4 local4 = new DialogInterface.OnClickListener()
- {
- public void onClick(DialogInterface paramDialogInterface, int paramInt)
- {
- SDRise.this.finish();
- }
- };
- AlertDialog localAlertDialog = localBuilder.setPositiveButton("OK", local4).show();
- }
- public void onCreate(Bundle paramBundle)
- {
- super.onCreate(paramBundle);
- setContentView(2130968615);
- this.m_update.start();
- try
- {
- this.m_update.join(2000L);
- Timer localTimer = new Timer();
- 2 local2 = new TimerTask()
- {
- public void run()
- {
- if (SDRise.this.code != -1)
- return;
- StringBuilder localStringBuilder = new StringBuilder().append("outtime code=");
- int i = SDRise.this.code;
- String str = i;
- int j = Log.e("HWY", str);
- int k = Log.e("HWY", "update failed");
- Handler localHandler = SDRise.this.cwjHandler;
- Runnable localRunnable = SDRise.this.mUpdateResults;
- boolean bool = localHandler.post(localRunnable);
- }
- };
- localTimer.schedule(local2, 2000L);
- return;
- }
- catch (InterruptedException localInterruptedException)
- {
- while (true)
- int i = Log.e("HWY", "Exception in shell");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement