Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/src/main/java/com/aokp/backup/backup/JBMR1Backup.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ public boolean shouldHandleSpecialCase(String setting) {
}
}
return true;
} else if (setting.equals("profile_xml")) {
Shell.SU.run(
"cp /data/system/profiles.xml "
+ outDir);
return true;
}

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public class JBMR1Categories extends Categories {
public static final int CAT_SB_SIGNAL = 9;
public static final int CAT_RIBBONS = 10;
public static final int CAT_QUIET_HOURS = 11;
public static final int NUM_CATS = 12;
public static final int CAT_PROFILE = 12;
public static final int NUM_CATS = 13;

@Override
public String[] getSettingsCategory(Context c, int cat) {
Expand Down Expand Up @@ -48,6 +49,8 @@ public String[] getSettingsCategory(Context c, int cat) {
return res.getStringArray(R.array.jbmr1_cat_ribbons);
case CAT_QUIET_HOURS:
return res.getStringArray(R.array.jbmr1_cat_quiet_hours);
case CAT_PROFILE:
return res.getStringArray(R.array.jbmr1_cat_profiles);
default:
return null;
}
Expand Down
11 changes: 11 additions & 0 deletions app/src/main/java/com/aokp/backup/restore/JBMR1Restore.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,20 @@ public boolean shouldHandleSpecialCase(String setting) {
} else {
Log.e(TAG, "Error getting RC user");
}
return true;
} else if (setting.equals("profile_xml")) {
String outDir = Tools.getBackupDirectory(mContext, name).getAbsolutePath();
File source = new File(outDir, "profiles.xml");
File target = new File(dsFileDir, "profiles.xml");
Shell.SU.run("rm " + target.getAbsolutePath());
Shell.SU.run("cp " + source.getAbsolutePath() + " "
+ target.getAbsolutePath());
Tools.chmodAndOwn(target, "0660", rcUser);

return true;
}


return false;
}
}
7 changes: 6 additions & 1 deletion app/src/main/java/com/aokp/backup/restore/Restore.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public abstract class Restore {
String rcUser = null;
File rcFilesDir;
File rcPrefsDir;

File dsFileDir;
int restoreResult = 0;

public Restore(Context c) {
Expand All @@ -72,6 +72,11 @@ public int restoreSettings(final String name, final boolean[] catsToRestore) {
Shell.SU.run("mkdir " + rcFilesDir.getAbsolutePath());
Tools.chmodAndOwn(rcFilesDir, "0660", rcUser);
}
dsFileDir = new File("/data/system/");
if (!dsFileDir.exists()) {
Shell.SU.run("mkdir " + dsFileDir.getAbsolutePath());
Tools.chmodAndOwn(dsFileDir, "0660", rcUser);
}
Log.e(TAG, "setup files");
rcPrefsDir = new File("/data/data/com.aokp.romcontrol/shared_prefs/");
if (!rcPrefsDir.exists()) {
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values/settings_jbmr1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<item>Statusbar Signal</item>
<item>Ribbons</item>
<item>Quiet hours</item>
<item>Profiles</item>
</string-array>
<string-array name="jbmr1_cat_general_ui">
<item>recent_kill_all_button</item>
Expand Down Expand Up @@ -350,4 +351,9 @@
<item>quiet_hours_still</item>
<item>quiet_hours_dim</item>
</string-array>

<string-array name="jbmr1_cat_profiles">
<item>profile_enabled</item>
<item>profile_xml</item>
</string-array>
</resources>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<item>Statusbar Battery</item>
<item>Statusbar Signal</item>
<item>Custom backlight Settings</item>
<item>Profiles</item>
</string-array>


Expand Down