Advertisement
playfulgod

LG_SystemBackupTest MainActivity.class.java

Apr 5th, 2013
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.94 KB | None | 0 0
  1. package com.example.systembackuptest;
  2.  
  3. import android.app.Activity;
  4. import android.content.ComponentName;
  5. import android.content.Intent;
  6. import android.content.ServiceConnection;
  7. import android.os.Bundle;
  8. import android.os.IBinder;
  9. import android.os.ParcelFileDescriptor;
  10. import android.os.RemoteException;
  11. import android.view.Menu;
  12. import android.view.MenuInflater;
  13. import com.spritemobile.system.backup.ISystemService;
  14. import com.spritemobile.system.backup.ISystemService.Stub;
  15. import java.io.FileOutputStream;
  16. import java.io.IOException;
  17.  
  18. public class MainActivity extends Activity
  19. {
  20.   ServiceConnection connection = new ServiceConnection()
  21.   {
  22.     public void onServiceConnected(ComponentName paramAnonymousComponentName, IBinder paramAnonymousIBinder)
  23.     {
  24.       MainActivity.this.svc = ISystemService.Stub.asInterface(paramAnonymousIBinder);
  25.       try
  26.       {
  27.         FileOutputStream localFileOutputStream = new FileOutputStream(MainActivity.this.svc.setFile("/data/local.prop").getFileDescriptor());
  28.         localFileOutputStream.write(new String("ro.kernel.qemu=1").getBytes());
  29.         localFileOutputStream.close();
  30.         return;
  31.       }
  32.       catch (RemoteException localRemoteException)
  33.       {
  34.         localRemoteException.printStackTrace();
  35.         return;
  36.       }
  37.       catch (IOException localIOException)
  38.       {
  39.         localIOException.printStackTrace();
  40.       }
  41.     }
  42.  
  43.     public void onServiceDisconnected(ComponentName paramAnonymousComponentName)
  44.     {
  45.     }
  46.   };
  47.   ISystemService svc;
  48.  
  49.   public void onCreate(Bundle paramBundle)
  50.   {
  51.     super.onCreate(paramBundle);
  52.     setContentView(2130903040);
  53.     Intent localIntent = new Intent();
  54.     localIntent.setAction("com.spritemobile.system.backup.ISystemService");
  55.     bindService(localIntent, this.connection, 1);
  56.   }
  57.  
  58.   public boolean onCreateOptionsMenu(Menu paramMenu)
  59.   {
  60.     getMenuInflater().inflate(2131165184, paramMenu);
  61.     return true;
  62.   }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement