mirror of
https://github.com/RfidResearchGroup/RFIDtools.git
synced 2026-05-12 11:19:59 -07:00
cwd invalid bug fixed.
This commit is contained in:
@@ -21,6 +21,8 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.termux.app.TermuxService;
|
||||
|
||||
import cn.dxl.common.util.AppUtil;
|
||||
import cn.dxl.common.util.FileUtils;
|
||||
import cn.dxl.common.util.LogUtils;
|
||||
@@ -164,7 +166,9 @@ public class MainSettingsFragment
|
||||
@Override
|
||||
public void onChange(View view, int pos, boolean checked) {
|
||||
Commons.setPM3ExternalWorkDirectoryEnable(checked);
|
||||
Commons.updatePM3Cwd();
|
||||
setSubTitle(Commons.updatePM3Cwd());
|
||||
setChecked(checked);
|
||||
multiTypeAdapter.notifyDataSetChanged();
|
||||
}
|
||||
};
|
||||
pm3HomePathItem.setSubTitle(Paths.PM3_CWD);
|
||||
|
||||
@@ -295,13 +295,16 @@ public class Commons {
|
||||
.getBoolean(Properties.k_pm3_externl_cwd_enable, false);
|
||||
}
|
||||
|
||||
public static void updatePM3Cwd() {
|
||||
public static String updatePM3Cwd() {
|
||||
// init pm3 cwd
|
||||
if (Commons.isPM3ExternalWorkDirectoryEnable()) {
|
||||
TermuxService.PM3_CWD = Paths.PM3_CWD;
|
||||
new File(TermuxService.PM3_CWD).mkdirs();
|
||||
TermuxService.PM3_CWD = Paths.PM3_CWD_FINAL;
|
||||
Paths.PM3_CWD = TermuxService.PM3_CWD;
|
||||
new File(Paths.PM3_CWD).mkdirs();
|
||||
} else {
|
||||
Paths.PM3_CWD = TermuxService.HOME_PATH;
|
||||
TermuxService.PM3_CWD = null;
|
||||
}
|
||||
return Paths.PM3_CWD;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,6 +63,7 @@ public class Paths {
|
||||
public static String PM3_IMAGE_OS_FILE = TermuxService.HOME_PATH + File.separator + PM3_PATH + File.separator + PM3_OS_FILE_NAME;
|
||||
// pm3 cwd -> sdcard
|
||||
public static String PM3_CWD = PM3_DIRECTORY + File.separator + "home";
|
||||
public static final String PM3_CWD_FINAL = PM3_DIRECTORY + File.separator + "home";
|
||||
|
||||
public static String PN53X_FORWARD_O = PN53X_DIRRECTORY + "/" + "pn53x_forward_o.txt";
|
||||
public static String PN53X_FORWARD_E = PN53X_DIRRECTORY + "/" + "pn53x_forward_e.txt";
|
||||
|
||||
Reference in New Issue
Block a user