Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
start vdd
- Loading branch information
Showing
12 changed files
with
227 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<LinearLayout | |||
xmlns:android="http://schemas.android.com/apk/res/android" | |||
android:orientation="vertical" | |||
android:layout_width="match_parent" | |||
android:layout_height="match_parent"> | |||
<CheckBox android:text="@string/gemini" | |||
android:id="@+id/checkBox1" android:layout_width="wrap_content" | |||
android:layout_height="wrap_content"></CheckBox> | |||
<Button android:layout_gravity="center_horizontal" android:id="@+id/button1" android:text="@android:string/ok" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button> | |||
|
|||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,82 @@ | |||
package com.ideos.x5settings; | |||
|
|||
import java.io.BufferedReader; | |||
import java.io.FileReader; | |||
|
|||
import android.app.Activity; | |||
import android.os.Bundle; | |||
import android.util.Log; | |||
import android.view.View; | |||
import android.widget.Button; | |||
import android.widget.CheckBox; | |||
import android.widget.Toast; | |||
|
|||
public class Misc extends Activity{ | |||
private Button applyButton; | |||
private CheckBox geminiBox; | |||
|
|||
public void onCreate(Bundle savedInstanceState) { | |||
super.onCreate(savedInstanceState); | |||
setContentView(R.layout.misc); | |||
|
|||
applyButton = (Button) findViewById(R.id.button1); | |||
geminiBox = (CheckBox) findViewById(R.id.checkBox1); | |||
|
|||
applyButton.setOnClickListener(new View.OnClickListener() { | |||
public void onClick(View view) { | |||
setMisc(); | |||
} | |||
}); | |||
|
|||
getMiscSettings(); | |||
|
|||
} | |||
|
|||
public void setMisc(){ | |||
boolean WRITE = false; | |||
String gemini = "chmod "; | |||
gemini += geminiBox.isChecked() ? "0666" : "0000"; | |||
gemini += " /dev/gemini0"; | |||
|
|||
WRITE = Rootcommands.runRootCommand("mount -o rw,remount -t ext4 /dev/block/mmcblk0p12 /system"); | |||
|
|||
if(WRITE) { | |||
Rootcommands.runRootCommand(gemini); | |||
Rootcommands.runRootCommand("echo "+ | |||
gemini + | |||
" > /etc/init.d/16misc"); | |||
Rootcommands.runRootCommand("chmod +x /system/etc/init.d/16misc"); | |||
This comment has been minimized.
Sorry, something went wrong. |
|||
Rootcommands.runRootCommand("mount -o ro,remount -t ext4 /dev/block/mmcblk0p12 /system"); | |||
WRITE = false; | |||
Toast complete = Toast.makeText(this, R.string.complete, 2000); | |||
complete.show(); | |||
} | |||
else { | |||
Log.d("X5 Settings", "Error writing file"); | |||
} | |||
} | |||
|
|||
public void getMiscSettings() { | |||
String settings = null; | |||
FileReader input; | |||
BufferedReader reader; | |||
|
|||
try { | |||
input = new FileReader("/etc/init.d/16misc"); | |||
reader = new BufferedReader(input); | |||
|
|||
settings = reader.readLine(); | |||
|
|||
reader.close(); | |||
input.close(); | |||
|
|||
if(settings.split(" ")[1].matches("0666")){ | |||
geminiBox.setChecked(true); | |||
} | |||
|
|||
}catch (Exception e) { | |||
Log.d("X5 Settings", "Unexpected error: "+e.getMessage()); | |||
} | |||
|
|||
} | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When i enable this option and close X5Setting , next time I open misc page , The check box was not checked .
I debug on my u8800 and found at Line 65 FileReader throws an 'no permission' exception.
I don't know why it happen . How about add an 'r' here ?