Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.oudhitsquad.oudinfograbber;
- import java.io.IOException;
- import android.os.Bundle;
- import android.app.Activity;
- import android.graphics.drawable.Drawable;
- import android.view.Menu;
- import android.view.View;
- import android.widget.Button;
- public class Main extends Activity {
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setContentView(R.layout.main);
- final Button button1 = (Button) findViewById(R.id.button1);
- button1.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- try {
- Runtime.getRuntime().exec("mkdir /sdcard/phone-info");
- Runtime.getRuntime().exec("cp proc/cmdline sdcard/phone-info/cmdline.txt");
- Runtime.getRuntime().exec("cp proc/cpuinfo sdcard/phone-info/cpuinfo.txt");
- Runtime.getRuntime().exec("cp proc/partitions sdcard/phone-info/partitions.txt");
- Runtime.getRuntime().exec("cp proc/mounts sdcard/phone-info/mounts.txt");
- Runtime.getRuntime().exec("cp system/build.prop sdcard/phone-info/build.prop");
- Runtime.getRuntime().exec("chmod 0777 /sdcard/phone-info/*");
- Runtime.getRuntime().exec("tar -cf sdcard/info.tar /sdcard/phone-info");
- //Runtime.getRuntime().exec("rm -rf sdcard/phone-info");
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
- final Button button2 = (Button) findViewById(R.id.button2);
- button2.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- try {
- Runtime.getRuntime().exec("exit");
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- });
- }
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- // Inflate the menu; this adds items to the action bar if it is present.
- getMenuInflater().inflate(R.menu.main, menu);
- return true;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement