Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple minor fixes #3

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@
# generated GUI files
*R.java

lint.xml

BuildConfig.java

proguard/
bin/
.settings/
10 changes: 5 additions & 5 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.projectvoodoo.otarootkeeper"
android:installLocation="auto"
android:versionCode="10"
android:versionName="2.0.3" >
android:versionCode="11"
android:versionName="2.0.4" >

<uses-sdk
android:minSdkVersion="3"
android:targetSdkVersion="15" />

android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<uses-permission android:name="android.permission.ACCESS_SUPERUSER" />
<uses-permission android:name="android.permission.ACCESS_- SUPERUSER"

<supports-screens
android:anyDensity="true"
android:largeScreens="true"
Expand All @@ -34,4 +34,4 @@
</activity>
</application>

</manifest>
</manifest>
2 changes: 1 addition & 1 deletion project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
# project structure.

# Project target.
target=android-15
target=android-17
4 changes: 3 additions & 1 deletion res/layout/status_available.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/checkbox_on_background" >
android:src="@android:drawable/checkbox_on_background"
tools:ignore="ContentDescription" >
</ImageView>
</LinearLayout>
4 changes: 3 additions & 1 deletion res/layout/status_unavailable.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@android:drawable/checkbox_off_background" >
android:src="@android:drawable/checkbox_off_background"
tools:ignore="ContentDescription" >
</ImageView>
</LinearLayout>
2 changes: 1 addition & 1 deletion res/menu/main_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<item
android:id="@+id/refresh"
android:icon="@android:drawable/ic_menu_info_details"
android:title="Refresh status"/>
android:title="@string/refresh"/>

</menu>
4 changes: 2 additions & 2 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<resources>

<string name="app_name">Voodoo OTA RootKeeper</string>
<string name="introduction_title">Introduction:</string>
<string name="introduction">This app saves a protected copy of \"su\"
for devices already rooted.\nIf you loose root permissions after an
OTA update, RootKeeper might be able to restore it.</string>
Expand All @@ -11,7 +10,7 @@
style incremental OTA update.zip</string>
<string name="useless_with_title">Useless with:</string>
<string name="useless_with">Samsung phones updated via KIES or Odin and older
devices using YAFFS filesystems only, any device flashing entiere
devices using YAFFS filesystems only, any device flashing entire
system partition.</string>
<string name="status_title">Status:</string>
<string name="superuser_apk_installed">Superuser app installed</string>
Expand Down Expand Up @@ -40,5 +39,6 @@
\nFollow on Twitter:\nhttps://twitter.com/supercurio
\n\nMore apps:\nhttps://play.google.com/store/apps/developer?id=supercurio+-+Project+Voodoo
\n\nXDA discussion thread for community help and support\nhttp://forum.xda-developers.com/showthread.php?t=1241517</string>
<string name="refresh">Refresh status</string>

</resources>
33 changes: 31 additions & 2 deletions src/org/projectvoodoo/otarootkeeper/backend/Device.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,16 @@ private void ensureAttributeUtilsAvailability() {

public void analyzeSu() {
isRooted = detectValidSuBinaryInPath();
isSuperuserAppInstalled = isSuperUserApkinstalled();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I

isSuperuserAppInstalled = isChainsDD_SuperUserApkinstalled();

if (isSuperuserAppInstalled == false) {
isSuperuserAppInstalled = isChainfire_SuperSUApkinstalled();
}

if (isSuperuserAppInstalled == false) {
isSuperuserAppInstalled = isKoush_SuperUserApkinstalled();
}

isSuProtected = isSuProtected();
}

Expand Down Expand Up @@ -180,7 +189,7 @@ private Boolean detectValidSuBinaryInPath() {
return false;
}

private Boolean isSuperUserApkinstalled() {
private Boolean isChainsDD_SuperUserApkinstalled() {
try {
mContext.getPackageManager().getPackageInfo("com.noshufou.android.su", 0);
Log.d(TAG, "Superuser.apk installed");
Expand All @@ -190,4 +199,24 @@ private Boolean isSuperUserApkinstalled() {
}
}

private Boolean isChainfire_SuperSUApkinstalled() {
try {
mContext.getPackageManager().getPackageInfo("eu.chainfire.supersu", 0);
Log.d(TAG, "Superuser.apk installed");
return true;
} catch (NameNotFoundException e) {
return false;
}
}

private Boolean isKoush_SuperUserApkinstalled() {
try {
mContext.getPackageManager().getPackageInfo("com.koushikdutta.superuser", 0);
Log.d(TAG, "Superuser.apk installed");
return true;
} catch (NameNotFoundException e) {
return false;
}
}

}