Skip to content
Snippets Groups Projects
Commit ceff2e74 authored by Augusto Bott's avatar Augusto Bott
Browse files

Merge branch 'work' into HEAD

parents a54fdd1c 924eaa9a
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="br.com.bott.droidsshd"
<<<<<<< HEAD
android:versionCode="5"
android:versionName="0.5" android:installLocation="internalOnly">
=======
android:installLocation="auto" android:versionName="0.6" android:versionCode="6">
>>>>>>> refs/heads/work
 
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Loading
Loading
Loading
Loading
@@ -44,9 +44,9 @@ public class Preferences extends PreferenceActivity
mAuthorizedKeys = findPreference("authorized_keys_key");
mAuthorizedKeys.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
public boolean onPreferenceClick(Preference preference) {
Intent p = new Intent(getBaseContext(), com.h3r3t1c.filechooser.FileChooser.class);
startActivityForResult(p, R.string.activity_file_chooser);
return true;
Intent p = new Intent(getBaseContext(), com.h3r3t1c.filechooser.FileChooser.class);
startActivityForResult(p, R.string.activity_file_chooser);
return true;
}
});
}
Loading
Loading
Loading
Loading
@@ -24,8 +24,8 @@ public class Base {
public static final String THIS_PACKAGE_NAME = "br.com.bott.droidsshd";
public static final String SU_BIN = "/system/xbin/su";
public static final String SH_BIN = "/system/bin/sh";
// public static final String SU_BIN = "/system/xbin/su";
// public static final String SH_BIN = "/system/bin/sh";
 
public static final String DROPBEAR_DIR_KEY = "etc";
public static final String DROPBEAR_DIR_TMP = "run";
Loading
Loading
@@ -77,6 +77,9 @@ public class Base {
protected static String dropbearBinDir;
protected static String dropbearPidFile;
protected static String pathToSuBinary;
protected static String pathToShBinary;
protected static int dropbearDaemonStatus = DAEMON_STATUS_UNKNOWN;
 
 
Loading
Loading
@@ -112,6 +115,14 @@ public class Base {
// }
}
public static String getPathToSuBinary() {
return pathToSuBinary;
}
public static String getPathToShBinary() {
return pathToShBinary;
}
public static boolean shouldAcquireWakeLock(){
return wakeLock;
}
Loading
Loading
@@ -255,6 +266,8 @@ public class Base {
password = sp.getString(context.getString(R.string.pref_dropbear_auth_password_key), "password");
runDaemonAsRoot = sp.getBoolean(context.getString(R.string.pref_dropbear_as_root_key),false);
// username = sp.getString(context.getString(R.string.pref_dropbear_auth_username_key), "android");
pathToSuBinary = sp.getString(context.getString(R.string.pref_path_to_su_key), "/system/xbin/su");
pathToShBinary = sp.getString(context.getString(R.string.pref_path_to_sh_key), "/system/bin/sh");
if(runDaemonAsRoot) {
username="root";
} else {
Loading
Loading
Loading
Loading
@@ -88,14 +88,12 @@ public class ShellSession extends Thread {
if (debug) {
Log.d(tag, "Starting new ROOT shell");
}
process = Runtime.getRuntime().exec(Base.SU_BIN);
// process = Runtime.getRuntime().exec(Base.SU_BIN, null, new File("/sdcard"));
process = Runtime.getRuntime().exec(Base.getPathToSuBinary());
} else {
if (debug) {
Log.d(tag, "Starting new shell");
}
process = Runtime.getRuntime().exec(Base.SH_BIN);
// process = Runtime.getRuntime().exec(Base.SH_BIN, null, new File("/sdcard"));
process = Runtime.getRuntime().exec(Base.getPathToShBinary());
}
stdin = new PrintStream(process.getOutputStream());
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment