1
0
mirror of http://galexander.org/git/simplesshd.git synced 2025-01-01 02:40:52 +00:00
simplesshd/src/org/galexander/sshd/Prefs.java
2014-12-17 22:46:04 -05:00

45 lines
1020 B
Java

package org.galexander.sshd;
import android.content.SharedPreferences;
import android.content.Context;
import android.preference.PreferenceManager;
public class Prefs {
private static SharedPreferences pref = null;
public static void init(Context c) {
if (pref == null) {
pref = PreferenceManager.getDefaultSharedPreferences(c);
}
}
public static boolean get_onboot() {
return pref.getBoolean("onboot", false);
}
public static int get_port() {
int ret;
try {
ret = Integer.valueOf(pref.getString("port", "2222"));
} catch (Exception e) {
ret = 2222;
}
return ret;
}
public static String get_path() {
return pref.getString("path", "/sdcard/ssh");
}
public static String get_shell() {
return pref.getString("shell", "/system/bin/sh");
}
public static String get_home() {
return pref.getString("home", "/sdcard/ssh");
}
public static String get_extra() {
return pref.getString("extra", "");
}
public static SharedPreferences.Editor edit() {
return pref.edit();
}
};