Skip to content

Commit

Permalink
Fixed icons and most CM6 issues. 0.9.3.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
openback committed Oct 5, 2010
1 parent 993de36 commit b81d2e5
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Type Fresh</name>
<name>Type-Fresh</name>
<comment></comment>
<projects>
</projects>
Expand Down
6 changes: 4 additions & 2 deletions AndroidManifest.xml
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.pixelpod.typefresh" android:versionName="0.9.3.5" android:versionCode="20">
package="net.pixelpod.typefresh" android:versionName="0.9.3.6" android:versionCode="21">
<supports-screens
android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true" />
android:anyDensity="true" android:resizeable="true"/>
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="false">
<activity android:name=".TypeFresh"
android:label="@string/app_name"
Expand All @@ -21,4 +21,6 @@
<uses-permission android:name="android.permission.REBOOT"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"></uses-permission>


</manifest>
Binary file modified res/drawable-hdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-ldpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified res/drawable-mdpi/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 18 additions & 5 deletions src/net/pixelpod/typefresh/FileCopier.java
Expand Up @@ -26,6 +26,7 @@
package net.pixelpod.typefresh;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
Expand Down Expand Up @@ -76,7 +77,6 @@ protected Void doInBackground(Object... params) {
boolean remountRequired = destinationPaths[0].indexOf("/system/") == 0;

Process su = null;
Runtime runtime = Runtime.getRuntime();
success = false;

if (remountRequired) {
Expand All @@ -102,7 +102,7 @@ protected Void doInBackground(Object... params) {
continue;
}
publishProgress(sourcePaths[i]);
su = runtime.exec("/system/bin/su");
su = getSu();
cmd = "cp -f \"" + sourcePaths[i] + "\" \"" + destinationPaths[i] + "\"";
Log.i(TypeFresh.TAG,"Executing \"" + cmd + "\"");
cmd += "\nexit\n";
Expand Down Expand Up @@ -190,12 +190,12 @@ public void setActivity(TypeFresh owner) {
*/
public static boolean remount(int readwrite) throws IOException,InterruptedException {
String type = (readwrite == READ_WRITE) ? "rw" : "ro";
Process su = Runtime.getRuntime().exec("/system/bin/su");
Process su = getSu();
String systemBlock = systemLocation();

Log.i(TypeFresh.TAG,"Remounting /system " + type);
String cmd = "mount -o remount," + type + " " + systemBlock + " /system\nexit\n";
Log.i(TypeFresh.TAG, "Executing :" + cmd);
Log.i(TypeFresh.TAG, "Executing : '" + cmd + "'");
su.getOutputStream().write(cmd.getBytes());

if (su.waitFor() != 0) {
Expand Down Expand Up @@ -228,7 +228,7 @@ protected static String systemLocation() throws InterruptedException, IOExceptio
return systemBlock;
}

Process su = Runtime.getRuntime().exec("/system/bin/su");
Process su = getSu();
String cmd = "mount\nexit\n";
Log.d(TypeFresh.TAG, "running \"" + cmd + "\"");

Expand Down Expand Up @@ -267,4 +267,17 @@ protected static String systemLocation() throws InterruptedException, IOExceptio
throw new FileNotFoundException("Could not find /system");
}

/**
* Finds the proper <code>su</code> binary and returns its <code>Process</code>.
*
* @throws IOException If we have a problem reading <code>stdout</code>.
* @return Superuser <code>Process</code>.
*/
private static Process getSu() throws IOException {
String suLocation = "/system/bin/su";
if (!(new File(suLocation)).exists()) {
suLocation = "/system/xbin/su";
}
return Runtime.getRuntime().exec(suLocation);
}
}

0 comments on commit b81d2e5

Please sign in to comment.