Java Code Examples for com.grarak.kerneladiutor.utils.Utils#getInternalDataStorage()

The following examples show how to use com.grarak.kerneladiutor.utils.Utils#getInternalDataStorage() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Backup.java    From KernelAdiutor with GNU General Public License v3.0 6 votes vote down vote up
public static String getPath(PARTITION PARTITION_type) {
    String folder = null;
    switch (PARTITION_type) {
        case BOOT:
            folder = "boot";
            break;
        case RECOVERY:
            folder = "recovery";
            break;
        case FOTA:
            folder = "fota";
            break;
    }
    File file = new File(Utils.getInternalDataStorage() + "/backup/" + folder);
    if (file.exists() && file.isFile()) {
        file.delete();
    }
    file.mkdirs();
    if (Utils.existFile(file.toString())) return file.toString();
    return Utils.getInternalDataStorage().replace(
            Environment.getExternalStorageDirectory().toString(), "/sdcard") + "/backup/" + folder;
}
 
Example 2
Source File: Buildprop.java    From KernelAdiutor with GNU General Public License v3.0 5 votes vote down vote up
public static void backup() {
    File data = new File(Utils.getInternalDataStorage());
    if (!data.exists()) {
        data.mkdirs();
    }
    new RootFile(BUILD_PROP).cp(data.toString().replace(
            Environment.getExternalStorageDirectory().toString(), "/sdcard") + "/build.prop");
}
 
Example 3
Source File: ExportProfile.java    From KernelAdiutor with GNU General Public License v3.0 5 votes vote down vote up
public boolean export(String name) {
    if (!name.endsWith(".json")) name += ".json";
    File exportFiles = new File(Utils.getInternalDataStorage() + "/profiles");
    File file = new File(exportFiles.toString() + "/" + name);
    if (file.exists()) return false;
    exportFiles.mkdirs();
    Utils.writeFile(file.toString(), mMain.toString(), false, false);
    return true;
}
 
Example 4
Source File: ExportControl.java    From KernelAdiutor with GNU General Public License v3.0 5 votes vote down vote up
public boolean export(String name) {
    if (!name.endsWith(".json")) name += ".json";
    File exportFiles = new File(Utils.getInternalDataStorage() + "/controls");
    File file = new File(exportFiles.toString() + "/" + name);
    if (file.exists()) return false;
    exportFiles.mkdirs();
    Utils.writeFile(file.toString(), mMain.toString(), false, false);
    return true;
}