This is excellent. Now we can truly learn from each other!So as this is a open project here is my source to build the app version "Phronesis Rom Control".
I build this to support the Note5 port for the note3 on the Phronesis rom.
Github Source
This is excellent. Now we can truly learn from each other!So as this is a open project here is my source to build the app version "Phronesis Rom Control".
I build this to support the Note5 port for the note3 on the Phronesis rom.
Github Source
Merry Christmas everyone! !! Best wishes and most productive year! May all your families, loved ones and friends bring only joy into your lives. And may marshmallow be a blessed, easy to root, easy to mode, fun to develop for platform ?
Merry Christmas and Happy new year to all!!!
Sent from my SM-N920C using Tapatalk
So as this is a open project here is my source to build the app version "Phronesis Rom Control".
I build this to support the Note5 port for the note3 on the Phronesis rom.
Github Source
It is not feasible for Rom Control only as it utilizes the main sql database to store its entries. The entire sql database would have to be backed/restored as kmokhtar79 said.
I have done this for some time now.
The backup script:
Restore script with auto reboot after restore:Code:#!/system/bin/sh mount -o rw,remount /data mkdir /sdcard/backups cp -rf /data/data/com.android.providers.settings/databases /sdcard/backups
Code:#!/system/bin/sh mount -o rw,remount /data cp -rf /sdcard/backups/databases /data/data/com.android.providers.settings pkill zygote
I'm not really sure why I put the mkdir command there, the folder always gets created for us on 5.0 & also 5.1.1 for other use so it probably was not necessary.sir i dont know why but this method isnt working on my phone , it never creates the backups folder
can u please guide me what can be the issue ??
I'm not really sure why I put the mkdir command there, the folder always gets created for us on 5.0 & also 5.1.1 for other use so it probably was not necessary.
- First make sure you can run script from terminal or root browser to see if it works.
- Possibly scripts are not compiling with rom control. Decompile with apktool and see if the scripts are really there in assets/scripts of decompiled apk.
- Last (probably simplest), it is possible sdcard mkdir command is not working for you. Try removing mkdir command and experiment using an existing folder that always get created for every version of TW android like Media (I think android requires case sensitive syntax for folders so make sure you use upper case M for media in script name if you use that folder as example).
Edit: Rom Toolbox root explorer is excellent tool for testing/running scripts. I copy the script to SD and run from there with Rom Toolbox. Exit code of 0 means it is successful. Exit code of 1 means a syntax or command error.
the main problem is itsworking for my friend and not for me
the script creates folder and we have same device , same android version
Possible something going on with your internal storage too.the main problem is itsworking for my friend and not for me
the script creates folder and we have same device , same android version
Also, you did not say if your friend is using the same rom and rom control or different rom with different rom control.the main problem is itsworking for my friend and not for me
the script creates folder and we have same device , same android version
Have you tried his rom control?
---------- Post added at 01:18 PM ---------- Previous post was at 12:46 PM ----------
Possible something going on with your internal storage too.
Try wiping internal storage and try script again.
---------- Post added at 01:25 PM ---------- Previous post was at 01:18 PM ----------
Also, you did not say if your friend is using the same rom and rom control or different rom with different rom control.
1. i am using rom control sir , it works on my previous version of rom
2. wiped internal memory with custom/stock recovery alot of times
3. previous version in new version i changed busybox installer by osmosis and su to 2.65
can any of these cause this ??
Has your friend the same rom? May be on your rom is the internal storage writing bug not fixed?
both are using same G varient note 4
currently he is using F based rom and i am on G based rom
how to confirm and sort this issue ?
Delete ur data from internal sd exactly in Android/data/ then try it again if its still same probs then u need to wipe internal sd then 100% it should work unless u make something wrong somewhere mate ..
Sent from my SM-G920F using Tapatalk
bro i had allready wiped internel memory with stock recovery , but still this is same
run it from terminal.. you need an output to see what's going on
What's the exit code for the script?i ran those script codes via terminal it dsnt shows error but when i check my internel sd ...no folder is created
No problem. Just glad you got it sorted out mate ?i am sorry dev's for spamming , i just found out latest SuperSu 2.65 was faulty
used old version and everythings fine again , somehow it was not mounting my initl sd
big thanks you everyone for helping
See, newer isn't always better.i am sorry dev's for spamming , i just found out latest SuperSu 2.65 was faulty
used old version and everythings fine again , somehow it was not mounting my initl sd
big thanks you everyone for helping
See, newer isn't always better.
I'm several versions back on SU, but why update when it still maintains root without issue?
...For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights...
<string-array name="nav_drawer_items">
<item>SystemUI Mods</item>
<item>Phone Mods</item>
<item>Framework and General</item>
[COLOR="Blue"][B]<item>Power Menu</item>[/B][/COLOR]
<item>Useful Apps</item>
<item>Set Theme</item>
</string-array>
//Creates a list of NavItem objects to retrieve elements for the Navigation Drawer list of choices
public List<NavItem> getMenu() {
List<com.wubydax.romcontrol.NavItem> items = new ArrayList<>();
/*String array of item names is located in strings.xml under name nav_drawer_items
* If you wish to add more items you need to:
* 1. Add item to nav_drawer_items array
* 2. Add a valid material design icon/image to dir drawable
* 3. Add that image ID to the integer array below (int[] mIcons
* 4. The POSITION of your new item in the string array MUST CORRESPOND to the position of your image in the integer array mIcons
* 5. Create new PreferenceFragment or your own fragment or a method that you would like to invoke when a user clicks on your new item
* 6. Continue down this file to a method onNavigationDrawerItemSelected(int position) - next method
* 7. Add an action based on position. Remember that positions in array are beginning at 0. So if your item is number 6 in array, it will have a position of 5... etc
* 8. You need to add same items to the int array in NavigationDrawerFragment, which has the same method*/
String[] mTitles = getResources().getStringArray(R.array.nav_drawer_items);
int[] mIcons =
{R.drawable.ic_ui_mods,
R.drawable.ic_phone_mods,
R.drawable.ic_general_framework,
[B][COLOR="Blue"]R.drawable.ic_reboot,[/COLOR][/B]
R.drawable.ic_apps,
R.drawable.ic_settings};
for (int i = 0; i < mTitles.length && i < mIcons.length; i++) {
com.wubydax.romcontrol.NavItem current = new com.wubydax.romcontrol.NavItem();
current.setText(mTitles[i]);
current.setDrawable(mIcons[i]);
items.add(current);
}
return items;
}
@Override
public void onNavigationDrawerItemSelected(int position) {
/* update the main content by replacing fragments
* See more detailed instructions on the thread or in annotations to the previous method*/
setTitle(getMenu().get(position).getText());
switch (position) {
case 0:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new UIPrefsFragment()).commitAllowingStateLoss();
break;
case 1:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new PhonePrefsFragment()).commitAllowingStateLoss();
break;
case 2:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new FrameworksGeneralFragment()).commitAllowingStateLoss();
break;
case 3:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new AppLinksFragment()).commitAllowingStateLoss();
break;
case 4:
showThemeChooserDialog();
break;
}
}
@Override
public void onNavigationDrawerItemSelected(int position) {
/* update the main content by replacing fragments
* See more detailed instructions on the thread or in annotations to the previous method*/
setTitle(getMenu().get(position).getText());
switch (position) {
case 0:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new UIPrefsFragment()).commitAllowingStateLoss();
break;
case 1:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new PhonePrefsFragment()).commitAllowingStateLoss();
break;
case 2:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new FrameworksGeneralFragment()).commitAllowingStateLoss();
break;
[COLOR="blue"][B]case 3:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new PowerMenuFragment()).commitAllowingStateLoss();
break;[/B][/COLOR]
case [COLOR="blue"][B]4[/B][/COLOR]:
getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container, new AppLinksFragment()).commitAllowingStateLoss();
break;
case [COLOR="blue"][B]5[/B][/COLOR]:
showThemeChooserDialog();
break;
}
}
<[COLOR="red"]SwitchPreference[/COLOR]
android:defaultValue="true"
android:key="[COLOR="Red"]toggle_call_recording[/COLOR]"
android:summaryOff="Call recording is disabled"
android:summaryOn="Call recording is enabled"
android:title="Enable/Disable Call Recording" />
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
break;
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
[COLOR="Blue"][B]if (key.equals("toggle_call_recording")) {
Command c = new Command(0, "pkill com.android.incallui");
try {
RootTools.getShell(true).add(c);
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
} catch (RootDeniedException e) {
e.printStackTrace();
}
}[/B][/COLOR]
break;
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
[COLOR="blue"][B]if (key.equals("toggle_call_recording")) {
appRebootRequired("com.android.incallui");
}[/B][/COLOR]
break;
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
[COLOR="blue"][B] if (key.equals("toggle_call_recording")) {
appRebootRequired("com.android.incallui");
} else if (key.equals("some_other_key")) {
//do something you want
} else if (key.equals("again_some_key")) {
//do something different
}[/B][/COLOR]
break;
case "SwitchPreference":
SwitchPreference s = (SwitchPreference) pf.findPreference(key);
s.setChecked(sharedPreferences.getBoolean(key, true));
[COLOR="Blue"][B]switch (key){
case("toggle_call_recording"):
appRebootRequired("com.android.incallui");
break;
case("toggle_clock_visibility"):
appRebootRequired("com.android.systemui");
break;
case("some_other_key"):
//do something
break;
case("some_other_different_key"):
//do something different
break;
}[/B][/COLOR]
break;
<SwitchPreference
android:defaultValue="true"
android:key="clock_visibility"
android:summaryOff="Clock is hidden"
android:summaryOn="Clock is visible"
android:title="Set Clock Visibility" />
<CheckBoxPreference
android:defaultValue="false"
android:key="brightness_visibility"
android:summaryOff="Brightness slider hidden"
android:summaryOn="Brightness slider is visible"
android:title="Notification Brightness Visibility" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="2"
android:entries="@array/clock_position_entries"
android:entryValues="@array/clock_position_values"
android:key="any_clock_position"
android:title="Status Bar Clock Position" />
<com.wubydax.romcontrol.prefs.MyEditTextPreference
android:defaultValue="simpletext"
android:key="carrier_text"
android:title="Set Custom Carrier Text" />
<com.wubydax.romcontrol.prefs.ColorPickerPreference
alphaSlider="true"
android:defaultValue="-16777215"
android:key="clock_color"
android:title="Choose Clock Color" />
<com.wubydax.romcontrol.prefs.SeekBarPreference
min="0"
unitsRight="Kb/s"
android:defaultValue="10"
android:key="network_traffic_autohide_threshold"
android:max="100"
android:title="Autohide Threshold" />
<com.wubydax.romcontrol.prefs.IntentDialogPreference
includeSearch="true"
setSeparatorString="\##"
android:key="choosen_app_gear"
android:title="Choose App" />
<com.wubydax.romcontrol.prefs.FilePreference
android:key=[COLOR="red"]"testfile"[/COLOR]
android:summaryOff="File doesn't exist"
android:summaryOn="File exists"
android:title="Test File Preference" />
[COLOR="Green"]File[/COLOR] [COLOR="Blue"]file[/COLOR] = new [COLOR="green"]File[/COLOR]("[COLOR="Purple"]/data/data/com.wubydax.romcontrol/testfile[/COLOR]");
if(file.exists){
int i = 1;
} else {
i = 0;
}
<PreferenceScreen
android:key=[COLOR="Red"]"script#test"[/COLOR]
android:summary="Click see what happens"
android:title="New Preference Screen" />
if (script.exists()) {
[COLOR="Blue"][B]boolean isChmoded = script.canExecute() ? true : false;
if (!isChmoded) {
script.setExecutable(true);
}[/B][/COLOR]
Command command = new Command(0, pathToScript) {
@Override
public void commandCompleted(int id, int exitcode) {
super.commandCompleted(id, exitcode);
if (exitcode != 0) {
Toast.makeText(c, String.valueOf(exitcode), Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(c, "Executed Successfully", Toast.LENGTH_SHORT).show();
}
}
};
try {
RootTools.getShell(true).add(command);
} catch (IOException e) {
e.printStackTrace();
} catch (TimeoutException e) {
e.printStackTrace();
} catch (RootDeniedException e) {
e.printStackTrace();
}
}
<PreferenceScreen
android:key=[COLOR="Red"]"com.wubydax.gearreboot.RebootActivity"[/COLOR]
android:summary="Opens TWSwipe app to help you choose a different swipe activity"
android:title="Reset TWSwipe Action" />
[COLOR="Red"]<PreferenceScreen
android:summary="New Preference screen"
android:title="New Preference Screen">[/COLOR] [COLOR="Green"]<-- Start of nested preference screen[/COLOR]
<PreferenceCategory android:title="new category" />
<CheckBoxPreference
android:key="text_checkbox"
android:title="Checkbox" />
<SwitchPreference
android:key="test_switch"
android:title="Switch" />
[COLOR="Red"]</PreferenceScreen>[/COLOR] [COLOR="Green"]<-- End of nested preference screen[/COLOR]
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
[COLOR="Red"] <PreferenceCategory android:title="Status Bar Mods">[/COLOR] [COLOR="Green"]<-- start of preference category[/COLOR]
<SwitchPreference
android:defaultValue="true"
android:key="clock_visibility"
android:summaryOff="Clock is hidden"
android:summaryOn="Clock is visible"
android:title="Set Clock Visibility" />
<CheckBoxPreference
android:defaultValue="false"
android:key="brightness_visibility"
android:summaryOff="Brightness slider hidden"
android:summaryOn="Brightness slider is visible"
android:title="Notification Brightness Visibility" />
<com.wubydax.romcontrol.prefs.MyListPreference
android:defaultValue="2"
android:entries="@array/clock_position_entries"
android:entryValues="@array/clock_position_values"
android:key="any_clock_position"
android:title="Status Bar Clock Position" />
<com.wubydax.romcontrol.prefs.MyEditTextPreference
android:defaultValue="simpletext"
android:key="carrier_text"
android:title="Set Custom Carrier Text"
/>
<com.wubydax.romcontrol.prefs.ColorPickerPreference
alphaSlider="true"
android:defaultValue="-16777215"
android:key="clock_color"
android:title="Choose Clock Color" />
<PreferenceScreen
android:key="script#test"
android:summary="Click see what happens"
android:title="New Preference Screen" />
<com.wubydax.romcontrol.prefs.SeekBarPreference
min="0"
unitsRight="Kb/s"
android:defaultValue="10"
android:icon="@null"
android:key="network_traffic_autohide_threshold"
android:max="100"
android:title="Autohide Threshold" />
<PreferenceScreen
android:summary="New Preference screen"
android:title="New Preference Screen">
<PreferenceCategory android:title="new category" />
<CheckBoxPreference
android:key="text_checkbox"
android:title="Checkbox" />
<SwitchPreference
android:key="test_switch"
android:title="Switch" />
</PreferenceScreen>
<com.wubydax.romcontrol.prefs.IntentDialogPreference
includeSearch="true"
setSeparatorString="\##"
android:key="choosen_app_gear"
android:title="Choose App" />
<com.wubydax.romcontrol.prefs.FilePreference
android:key="testfile"
android:summaryOff="File doesn't exist"
android:summaryOn="File exists"
android:title="Test File Preference" />
[COLOR="red"]</PreferenceCategory>[/COLOR] [COLOR="Green"]<-- end of PreferenceCategory[/COLOR]
</PreferenceScreen>
<attr name="my_logo" format="reference"/>
<item name="my_logo">@drawable/logo_dark</item>
<item name="my_logo">@drawable/logo_light</item>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:gravity="center"
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:layout_width="fill_parent"
android:layout_marginLeft="45dp"
android:layout_marginRight="45dp"
android:layout_height="wrap_content"
android:src="?my_logo" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen
android:layout_width="match_parent"
android:layout_height="135dp"
android:layout="@layout/my_logo" >
</PreferenceScreen>
<PreferenceCategory
android:title="External Links" />
<PreferenceScreen
android:icon="@drawable/xda"
android:title="XDA ROM Thread"
android:summary="Click to visit the ROM thread">
<intent
android:action="android.intent.action.VIEW"
android:data="http://xdaforums.com/sprint-galaxy-s5/development/rom-v5-0-mod-control-floating-windows-t3016692" />
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/darksyde"
android:title="Team Darksyde Themes"
android:summary="By willowmaker420 and JoeyDuran ">
<intent
android:action="android.intent.action.VIEW"
android:data="http://xdaforums.com/sprint-galaxy-s5/themes-apps/theme-mod-t3043481" />
</PreferenceScreen>
<PreferenceCategory
android:title="MOAR ROM Developers" />
<PreferenceScreen
android:icon="@drawable/tdunham"
android:title="tdunham"
android:summary="The mod master" >
<intent
android:icon="@drawable/tdunham"
android:action="android.intent.action.VIEW"
android:data="http://xdaforums.com/member.php?u=1042140" />
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/rompnit"
android:title="rompnit"
android:summary="What's he do?">
<intent
android:icon="@drawable/rompnit"
android:action="android.intent.action.VIEW"
android:data="http://xdaforums.com/member.php?u=1167171" />
</PreferenceScreen>
</PreferenceScreen>
public void allGroups(Preference p) {
PreferenceScreen ps = (PreferenceScreen) p;
ps.setOnPreferenceClickListener(this);
[COLOR="Red"]
if(ps.getIntent()!=null){
Intent intent = ps.getIntent();
try {
Drawable iconFromIntent = c.getPackageManager().getActivityIcon(intent);
ps.setIcon(iconFromIntent);
} catch (PackageManager.NameNotFoundException e) {
Map<Preference, PreferenceScreen> preferenceParentTree = buildPreferenceParentTree();
PreferenceScreen preferenceParent = preferenceParentTree.get(ps);
preferenceParent.removePreference(ps);
}
}
/*Initiate icon view for preferences with keys that are interpreted as Intent
*For more info see OnPreferenceClick method*/
if (ps.getKey() != null) {
if (ps.getKey().contains(".")) {
int lastDot = ps.getKey().lastIndexOf(".");
String pkgName = ps.getKey().substring(0, lastDot);
try {
//if application package exists, we will set the icon successfully
Drawable icon = c.getPackageManager().getApplicationIcon(pkgName);
ps.setIcon(icon);
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
/*In case of exception, icon will not be set and we will remove the preference to avoid crashes on clicks
*To find the parent for each preference screen we use HashMap to build the parent tree*/
Map<Preference, PreferenceScreen> preferenceParentTree = buildPreferenceParentTree();
PreferenceScreen preferenceParent = preferenceParentTree.get(ps);
preferenceParent.removePreference(ps);
}
}
}[/COLOR]
for (int i = 0; i < ps.getPreferenceCount(); i++) {
Preference p1 = ps.getPreference(i);
if (p1 instanceof PreferenceScreen) {
/*As we descend further on a preference tree, if we meet another PreferenceScreen, we repeat the allGroups method.
*This method will loop untill we don't have nested screeens anymore.*/
allGroups(p1);
}
}
}
public void allGroups(Preference p) {
PreferenceScreen ps = (PreferenceScreen) p;
ps.setOnPreferenceClickListener(this);
for (int i = 0; i < ps.getPreferenceCount(); i++) {
Preference p1 = ps.getPreference(i);
if (p1 instanceof PreferenceScreen) {
/*As we descend further on a preference tree, if we meet another PreferenceScreen, we repeat the allGroups method.
*This method will loop until we don't have nested screens anymore.*/
allGroups(p1);
}
}
}