mirror of
https://github.com/RfidResearchGroup/RFIDtools.git
synced 2026-05-12 11:19:59 -07:00
add pm3 cwd save and get function.
This commit is contained in:
@@ -283,4 +283,25 @@ public class Commons {
|
||||
return getPrivatePreferences()
|
||||
.getInt(Properties.k_terminal_type, -1);
|
||||
}
|
||||
|
||||
public static void setPM3ExternalWorkDirectoryEnable(boolean enable) {
|
||||
getPrivatePreferences().edit()
|
||||
.putBoolean(Properties.k_pm3_externl_cwd_enable, enable)
|
||||
.apply();
|
||||
}
|
||||
|
||||
public static boolean isPM3ExternalWorkDirectoryEnable() {
|
||||
return getPrivatePreferences()
|
||||
.getBoolean(Properties.k_pm3_externl_cwd_enable, false);
|
||||
}
|
||||
|
||||
public static void updatePM3Cwd() {
|
||||
// init pm3 cwd
|
||||
if (Commons.isPM3ExternalWorkDirectoryEnable()) {
|
||||
TermuxService.PM3_CWD = Paths.PM3_CWD;
|
||||
new File(TermuxService.PM3_CWD).mkdirs();
|
||||
} else {
|
||||
Paths.PM3_CWD = TermuxService.HOME_PATH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user