Whitespace and minor code cleanup
This is by no means comprehensive, but is quite a bit better already. Change-Id: Ibc8654a5dfb0eec39cbd0b64bdb52bb4fbfe2f7e
@@ -999,7 +999,7 @@ int DataManager::GetMagicValue(const string varName, string& value)
|
||||
int tw_military_time;
|
||||
now = time(0);
|
||||
current = localtime(&now);
|
||||
GetValue(TW_MILITARY_TIME, tw_military_time);
|
||||
GetValue(TW_MILITARY_TIME, tw_military_time);
|
||||
if (current->tm_hour >= 12)
|
||||
{
|
||||
if (tw_military_time == 1)
|
||||
@@ -1009,7 +1009,7 @@ int DataManager::GetMagicValue(const string varName, string& value)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (tw_military_time == 1)
|
||||
if (tw_military_time == 1)
|
||||
sprintf(tmp, "%d:%02d", current->tm_hour, current->tm_min);
|
||||
else
|
||||
sprintf(tmp, "%d:%02d AM", current->tm_hour == 0 ? 12 : current->tm_hour, current->tm_min);
|
||||
|
||||
@@ -319,7 +319,7 @@ int fixPermissions::pchmod(string fn, string mode) {
|
||||
if (mode[n] == '1')
|
||||
mask |= S_IXOTH;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (chmod(fn.c_str(), mask) != 0) {
|
||||
LOGERR("Unable to chmod '%s' %l\n", fn.c_str(), mask);
|
||||
@@ -615,7 +615,7 @@ int fixPermissions::getPackages() {
|
||||
name.clear();
|
||||
next = next->next_sibling("package");
|
||||
}
|
||||
//Get updated packages
|
||||
//Get updated packages
|
||||
next = pkgNode->first_node("updated-package");
|
||||
if (next != NULL) {
|
||||
while (next->first_attribute("name") != NULL) {
|
||||
|
||||
@@ -88,7 +88,7 @@ GUIAction::GUIAction(xml_node<>* node)
|
||||
|
||||
attr = child->first_attribute("function");
|
||||
if (!attr) return;
|
||||
|
||||
|
||||
action.mFunction = attr->value();
|
||||
action.mArg = child->value();
|
||||
mActions.push_back(action);
|
||||
@@ -502,7 +502,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
|
||||
gui_print("Simulating actions...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (function == "restoredefaultsettings")
|
||||
{
|
||||
operation_start("Restore Defaults");
|
||||
@@ -516,7 +516,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
|
||||
operation_end(0, simulate);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (function == "copylog")
|
||||
{
|
||||
operation_start("Copy Log");
|
||||
@@ -533,7 +533,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
|
||||
operation_end(0, simulate);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (function == "compute" || function == "addsubtract")
|
||||
{
|
||||
if (arg.find("+") != string::npos)
|
||||
@@ -589,27 +589,27 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
|
||||
LOGERR("Unable to perform compute '%s'\n", arg.c_str());
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
if (function == "setguitimezone")
|
||||
{
|
||||
string SelectedZone;
|
||||
DataManager::GetValue(TW_TIME_ZONE_GUISEL, SelectedZone); // read the selected time zone into SelectedZone
|
||||
string Zone = SelectedZone.substr(0, SelectedZone.find(';')); // parse to get time zone
|
||||
string DSTZone = SelectedZone.substr(SelectedZone.find(';') + 1, string::npos); // parse to get DST component
|
||||
|
||||
|
||||
int dst;
|
||||
DataManager::GetValue(TW_TIME_ZONE_GUIDST, dst); // check wether user chose to use DST
|
||||
|
||||
|
||||
string offset;
|
||||
DataManager::GetValue(TW_TIME_ZONE_GUIOFFSET, offset); // pull in offset
|
||||
|
||||
|
||||
string NewTimeZone = Zone;
|
||||
if (offset != "0")
|
||||
NewTimeZone += ":" + offset;
|
||||
|
||||
|
||||
if (dst != 0)
|
||||
NewTimeZone += DSTZone;
|
||||
|
||||
|
||||
DataManager::SetValue(TW_TIME_ZONE_VAR, NewTimeZone);
|
||||
DataManager::update_tz_environment_variables();
|
||||
return 0;
|
||||
@@ -619,7 +619,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
|
||||
LOGERR("togglestorage action was deprecated from TWRP\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (function == "overlay")
|
||||
return gui_changeOverlay(arg);
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd res
|
||||
zip -r ../ui.zip *
|
||||
cd ..
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 858 B |
|
Before Width: | Height: | Size: 311 B |
|
Before Width: | Height: | Size: 533 B |
|
Before Width: | Height: | Size: 591 B |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 819 B |
|
Before Width: | Height: | Size: 845 B |
|
Before Width: | Height: | Size: 807 B |
|
Before Width: | Height: | Size: 854 B |
|
Before Width: | Height: | Size: 1.2 KiB |
@@ -279,7 +279,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -560,7 +560,7 @@
|
||||
<data name="tw_filename" />
|
||||
<selection name="tw_file" />
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="sort_options" />
|
||||
|
||||
<object type="action">
|
||||
@@ -616,7 +616,7 @@
|
||||
<placement x="%center_x%" y="%row5_text_y%" placement="5" />
|
||||
<text>%tw_file%</text>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row6_text_y%" placement="5" />
|
||||
@@ -2806,13 +2806,13 @@
|
||||
<touch key="back" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
<page name="timezone">
|
||||
<object type="template" name="header" />
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row1_text_y%" placement="5" />
|
||||
@@ -3291,7 +3291,7 @@
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="htcdumlock">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3381,7 +3381,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="overlay"></action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3389,7 +3389,7 @@
|
||||
</object>
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="filemanagerlist">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3867,7 +3867,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3883,7 +3883,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -560,7 +560,7 @@
|
||||
<data name="tw_filename" />
|
||||
<selection name="tw_file" />
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="sort_options" />
|
||||
|
||||
<object type="action">
|
||||
@@ -616,7 +616,7 @@
|
||||
<placement x="%center_x%" y="%row5_text_y%" placement="5" />
|
||||
<text>%tw_file%</text>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row6_text_y%" placement="5" />
|
||||
@@ -2806,13 +2806,13 @@
|
||||
<touch key="back" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
<page name="timezone">
|
||||
<object type="template" name="header" />
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row1_text_y%" placement="5" />
|
||||
@@ -3291,7 +3291,7 @@
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="htcdumlock">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3381,7 +3381,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="overlay"></action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3389,7 +3389,7 @@
|
||||
</object>
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="filemanagerlist">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3867,7 +3867,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3883,7 +3883,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -3894,7 +3894,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3910,7 +3910,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -3897,7 +3897,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3913,7 +3913,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -560,7 +560,7 @@
|
||||
<data name="tw_filename" />
|
||||
<selection name="tw_file" />
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="sort_options" />
|
||||
|
||||
<object type="action">
|
||||
@@ -616,7 +616,7 @@
|
||||
<placement x="%center_x%" y="%row5_text_y%" placement="5" />
|
||||
<text>%tw_file%</text>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row6_text_y%" placement="5" />
|
||||
@@ -2806,13 +2806,13 @@
|
||||
<touch key="back" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
<page name="timezone">
|
||||
<object type="template" name="header" />
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row1_text_y%" placement="5" />
|
||||
@@ -3291,7 +3291,7 @@
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="htcdumlock">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3381,7 +3381,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="overlay"></action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3389,7 +3389,7 @@
|
||||
</object>
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="filemanagerlist">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3867,7 +3867,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3883,7 +3883,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -271,7 +271,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -560,7 +560,7 @@
|
||||
<data name="tw_filename" />
|
||||
<selection name="tw_file" />
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="sort_options" />
|
||||
|
||||
<object type="action">
|
||||
@@ -616,7 +616,7 @@
|
||||
<placement x="%center_x%" y="%row5_text_y%" placement="5" />
|
||||
<text>%tw_file%</text>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row6_text_y%" placement="5" />
|
||||
@@ -2806,13 +2806,13 @@
|
||||
<touch key="back" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
<page name="timezone">
|
||||
<object type="template" name="header" />
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row1_text_y%" placement="5" />
|
||||
@@ -3291,7 +3291,7 @@
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="htcdumlock">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3381,7 +3381,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="overlay"></action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3389,7 +3389,7 @@
|
||||
</object>
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="filemanagerlist">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3867,7 +3867,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3883,7 +3883,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -1487,7 +1487,7 @@
|
||||
<text>Append Date</text>
|
||||
<action function="appenddatetobackupname"></action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="button">
|
||||
<highlight color="%highlight_color%" />
|
||||
<fill color="%button_fill_color%" />
|
||||
@@ -2505,7 +2505,7 @@
|
||||
<placement x="%center_x%" y="%row_offset_text_y%" placement="5" />
|
||||
<text>Offset (usually 0): %tw_time_zone_guioffset%</text>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="button">
|
||||
<highlight color="%highlight_color%" />
|
||||
<fill color="%button_fill_color%" />
|
||||
@@ -2514,7 +2514,7 @@
|
||||
<text>None</text>
|
||||
<action function="set">tw_time_zone_guioffset=0</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="button">
|
||||
<highlight color="%highlight_color%" />
|
||||
<fill color="%button_fill_color%" />
|
||||
@@ -2523,7 +2523,7 @@
|
||||
<text>15</text>
|
||||
<action function="set">tw_time_zone_guioffset=15</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="button">
|
||||
<highlight color="%highlight_color%" />
|
||||
<fill color="%button_fill_color%" />
|
||||
@@ -2532,7 +2532,7 @@
|
||||
<text>30</text>
|
||||
<action function="set">tw_time_zone_guioffset=30</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="button">
|
||||
<highlight color="%highlight_color%" />
|
||||
<fill color="%button_fill_color%" />
|
||||
@@ -2541,7 +2541,7 @@
|
||||
<text>45</text>
|
||||
<action function="set">tw_time_zone_guioffset=45</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="button">
|
||||
<highlight color="%highlight_color%" />
|
||||
<placement x="%col_center_x%" y="%tz_set_y%" />
|
||||
@@ -3452,7 +3452,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3468,7 +3468,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -560,7 +560,7 @@
|
||||
<data name="tw_filename" />
|
||||
<selection name="tw_file" />
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="sort_options" />
|
||||
|
||||
<object type="action">
|
||||
@@ -616,7 +616,7 @@
|
||||
<placement x="%center_x%" y="%row5_text_y%" placement="5" />
|
||||
<text>%tw_file%</text>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row6_text_y%" placement="5" />
|
||||
@@ -2806,13 +2806,13 @@
|
||||
<touch key="back" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
<page name="timezone">
|
||||
<object type="template" name="header" />
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row1_text_y%" placement="5" />
|
||||
@@ -3291,7 +3291,7 @@
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="htcdumlock">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3381,7 +3381,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="overlay"></action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3389,7 +3389,7 @@
|
||||
</object>
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="filemanagerlist">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3867,7 +3867,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3883,7 +3883,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -3881,7 +3881,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3897,7 +3897,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -3881,7 +3881,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3897,7 +3897,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -3880,7 +3880,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3896,7 +3896,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -3881,7 +3881,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3897,7 +3897,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -3894,7 +3894,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3910,7 +3910,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -345,7 +345,7 @@
|
||||
</template>
|
||||
|
||||
<template name="footer">
|
||||
<object type="console">
|
||||
<object type="console">
|
||||
<slideout resource="slideout" x="355" y="1220" />
|
||||
<placement x="%console_x%" y="0" w="%console_width%" h="1220" />
|
||||
<color foreground="%console_foreground%" background="%console_background%" scroll="%console_scroll%" />
|
||||
@@ -3882,7 +3882,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3898,7 +3898,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@
|
||||
<template name="progress_bar">
|
||||
<object type="progressbar">
|
||||
<placement x="%col_progressbar_x%" y="%row_progressbar_y%" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<resource empty="progress_empty" full="progress_full" />
|
||||
<data name="ui_progress" />
|
||||
</object>
|
||||
|
||||
@@ -568,7 +568,7 @@
|
||||
<data name="tw_filename" />
|
||||
<selection name="tw_file" />
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="sort_options" />
|
||||
|
||||
<object type="action">
|
||||
@@ -624,7 +624,7 @@
|
||||
<placement x="%center_x%" y="%row5_text_y%" placement="5" />
|
||||
<text>%tw_file%</text>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row6_text_y%" placement="5" />
|
||||
@@ -2814,13 +2814,13 @@
|
||||
<touch key="back" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
<page name="timezone">
|
||||
<object type="template" name="header" />
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%row1_text_y%" placement="5" />
|
||||
@@ -3299,7 +3299,7 @@
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="htcdumlock">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3389,7 +3389,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="overlay"></action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3397,7 +3397,7 @@
|
||||
</object>
|
||||
</page>
|
||||
|
||||
|
||||
|
||||
<page name="filemanagerlist">
|
||||
<object type="template" name="header" />
|
||||
|
||||
@@ -3875,7 +3875,7 @@
|
||||
<resource base="slider" used="slider-used" touch="slider-touch" />
|
||||
<action function="page">filemanageracction</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="text" color="%text_color%">
|
||||
<font resource="font" />
|
||||
<placement x="%center_x%" y="%slider_text_y%" placement="4" />
|
||||
@@ -3891,7 +3891,7 @@
|
||||
<touch key="home" />
|
||||
<action function="page">main</action>
|
||||
</object>
|
||||
|
||||
|
||||
<object type="template" name="footer" />
|
||||
</page>
|
||||
|
||||
|
||||
@@ -733,7 +733,7 @@ int GUIFileSelector::NotifyTouch(TOUCH_STATE state, int x, int y)
|
||||
|
||||
isHighlighted = false;
|
||||
last2Y = lastY;
|
||||
lastY = y;
|
||||
lastY = y;
|
||||
startSelection = -1;
|
||||
|
||||
// Handle scrolling
|
||||
@@ -925,7 +925,7 @@ bool GUIFileSelector::fileSort(FileData d1, FileData d2)
|
||||
return -1;
|
||||
if (d2.fileName == TW_FILESELECTOR_UP_A_LEVEL)
|
||||
return 0;
|
||||
|
||||
|
||||
switch (mSortOrder) {
|
||||
case 3: // by size largest first
|
||||
if (d1.fileSize == d2.fileSize || d1.fileType == DT_DIR) // some directories report a different size than others - but this is not the size of the files inside the directory, so we just sort by name on directories
|
||||
|
||||
@@ -429,7 +429,7 @@ static void * input_thread(void *cookie)
|
||||
state = 1;
|
||||
key_repeat = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
@@ -688,9 +688,6 @@ extern "C" int gui_init(void)
|
||||
|
||||
extern "C" int gui_loadResources(void)
|
||||
{
|
||||
// unlink("/sdcard/video.last");
|
||||
// rename("/sdcard/video.bin", "/sdcard/video.last");
|
||||
// gRecorder = open("/sdcard/video.bin", O_CREAT | O_WRONLY);
|
||||
#ifndef TW_OEM_BUILD
|
||||
int check = 0;
|
||||
DataManager::GetValue(TW_IS_ENCRYPTED, check);
|
||||
|
||||
@@ -33,7 +33,7 @@ HardwareKeyboard::HardwareKeyboard(void)
|
||||
|
||||
HardwareKeyboard::~HardwareKeyboard()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
int HardwareKeyboard::KeyDown(int key_code)
|
||||
|
||||
@@ -324,7 +324,7 @@ GUIListBox::GUIListBox(xml_node<>* node) : GUIObject(node)
|
||||
// Get the data for the list
|
||||
child = node->first_node("listitem");
|
||||
if (!child) return;
|
||||
|
||||
|
||||
while (child)
|
||||
{
|
||||
ListData data;
|
||||
@@ -677,7 +677,7 @@ int GUIListBox::NotifyTouch(TOUCH_STATE state, int x, int y)
|
||||
|
||||
isHighlighted = false;
|
||||
last2Y = lastY;
|
||||
lastY = y;
|
||||
lastY = y;
|
||||
startSelection = -1;
|
||||
|
||||
// Handle scrolling
|
||||
|
||||
@@ -56,7 +56,7 @@ GUIObject::GUIObject(xml_node<>* node)
|
||||
|
||||
attr = condition->first_attribute("var2");
|
||||
if (attr) cond.mVar2 = attr->value();
|
||||
|
||||
|
||||
mConditions.push_back(cond);
|
||||
|
||||
condition = condition->next_sibling("condition");
|
||||
@@ -166,7 +166,7 @@ int GUIObject::NotifyVarChange(const std::string& varName, const std::string& va
|
||||
if(varNameEmpty && iter->mCompareOp == "modified")
|
||||
{
|
||||
string val;
|
||||
|
||||
|
||||
// If this fails, val will not be set, which is perfect
|
||||
if (DataManager::GetValue(iter->mVar1, val))
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ int ConvertStrToColor(std::string str, COLOR* color)
|
||||
|
||||
// Translate variables
|
||||
DataManager::GetValue(str, str);
|
||||
|
||||
|
||||
// Look for some defaults
|
||||
if (str == "black") return 0;
|
||||
else if (str == "white") { color->red = color->green = color->blue = 255; return 0; }
|
||||
@@ -150,8 +150,8 @@ int ActionObject::SetActionPos(int x, int y, int w, int h)
|
||||
if (x < 0 || y < 0)
|
||||
return -1;
|
||||
|
||||
mActionX = x;
|
||||
mActionY = y;
|
||||
mActionX = x;
|
||||
mActionY = y;
|
||||
if (w || h)
|
||||
{
|
||||
mActionW = w;
|
||||
@@ -557,7 +557,7 @@ int PageSet::Load(ZipArchive* package)
|
||||
xml_node<>* parent;
|
||||
xml_node<>* child;
|
||||
xml_node<>* templates;
|
||||
|
||||
|
||||
parent = mDoc.first_node("recovery");
|
||||
if (!parent)
|
||||
parent = mDoc.first_node("install");
|
||||
@@ -792,13 +792,13 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string
|
||||
LOGERR("Unable to locate ui.xml in zip file\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
||||
// Allocate the buffer for the file
|
||||
len = mzGetZipEntryUncompLen(ui_xml);
|
||||
xmlFile = (char*) malloc(len + 1);
|
||||
if (!xmlFile)
|
||||
goto error;
|
||||
|
||||
|
||||
if (!mzExtractZipEntryToBuffer(&zip, ui_xml, (unsigned char*) xmlFile))
|
||||
{
|
||||
LOGERR("Unable to extract ui.xml\n");
|
||||
@@ -823,7 +823,7 @@ int PageManager::LoadPackage(std::string name, std::string package, std::string
|
||||
{
|
||||
LOGERR("Package %s failed to load.\n", name.c_str());
|
||||
}
|
||||
|
||||
|
||||
// The first successful package we loaded is the base
|
||||
if (mBaseSet == NULL)
|
||||
mBaseSet = mCurrentSet;
|
||||
|
||||
@@ -691,7 +691,7 @@ int GUIPartitionList::NotifyTouch(TOUCH_STATE state, int x, int y)
|
||||
|
||||
isHighlighted = false;
|
||||
last2Y = lastY;
|
||||
lastY = y;
|
||||
lastY = y;
|
||||
startSelection = -1;
|
||||
|
||||
// Handle scrolling
|
||||
@@ -788,7 +788,7 @@ int GUIPartitionList::NotifyTouch(TOUCH_STATE state, int x, int y)
|
||||
}
|
||||
mList.at(actualSelection).selected = 1;
|
||||
mUpdate = 1;
|
||||
|
||||
|
||||
DataManager::SetValue(mVariable, str);
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -156,11 +156,15 @@ int GUIProgressBar::Update(void)
|
||||
cur -= min;
|
||||
min = 0;
|
||||
|
||||
if (cur < min) cur = min;
|
||||
if (cur > max) cur = max;
|
||||
if (cur < min)
|
||||
cur = min;
|
||||
if (cur > max)
|
||||
cur = max;
|
||||
|
||||
if (max == 0) pos = 0;
|
||||
else pos = (cur * mRenderW) / max;
|
||||
if (max == 0)
|
||||
pos = 0;
|
||||
else
|
||||
pos = (cur * mRenderW) / max;
|
||||
|
||||
if (pos == mLastPos)
|
||||
return 0;
|
||||
|
||||
@@ -143,7 +143,7 @@ AnimationResource::AnimationResource(xml_node<>* node, ZipArchive* pZip)
|
||||
{
|
||||
if (ExtractResource(pZip, "images", fileName.str(), ".png", TMP_RESOURCE_NAME) != 0)
|
||||
break;
|
||||
|
||||
|
||||
if (res_create_surface(TMP_RESOURCE_NAME, &surface))
|
||||
break;
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ protected:
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
TOUCH_START = 0,
|
||||
TOUCH_START = 0,
|
||||
TOUCH_DRAG = 1,
|
||||
TOUCH_RELEASE = 2,
|
||||
TOUCH_HOLD = 3,
|
||||
|
||||
@@ -134,7 +134,7 @@ int GUISlider::NotifyTouch(TOUCH_STATE state, int x, int y)
|
||||
switch (state)
|
||||
{
|
||||
case TOUCH_START:
|
||||
if (x >= mRenderX && x <= mRenderX + sTouchW &&
|
||||
if (x >= mRenderX && x <= mRenderX + sTouchW &&
|
||||
y >= mRenderY && y <= mRenderY + mRenderH)
|
||||
{
|
||||
sCurTouchX = x - (sTouchW / 2);
|
||||
|
||||
@@ -126,8 +126,10 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node)
|
||||
string parsevalue = gui_parse_text(attr->value());
|
||||
int def = atoi(parsevalue.c_str());
|
||||
|
||||
if (def < mMin) def = mMin;
|
||||
else if (def > mMax) def = mMax;
|
||||
if (def < mMin)
|
||||
def = mMin;
|
||||
else if (def > mMax)
|
||||
def = mMax;
|
||||
DataManager::SetValue(mVariable, def);
|
||||
}
|
||||
|
||||
@@ -324,8 +326,10 @@ int GUISliderValue::Render(void)
|
||||
|
||||
int GUISliderValue::Update(void)
|
||||
{
|
||||
if (!isConditionTrue()) return mRendered ? 2 : 0;
|
||||
if (!mRendered) return 2;
|
||||
if (!isConditionTrue())
|
||||
return mRendered ? 2 : 0;
|
||||
if (!mRendered)
|
||||
return 2;
|
||||
|
||||
if(mLabel)
|
||||
return mLabel->Update();
|
||||
@@ -345,7 +349,8 @@ float GUISliderValue::pctFromValue(int value)
|
||||
|
||||
int GUISliderValue::NotifyTouch(TOUCH_STATE state, int x, int y)
|
||||
{
|
||||
if (!isConditionTrue()) return -1;
|
||||
if (!isConditionTrue())
|
||||
return -1;
|
||||
|
||||
static bool dragging = false;
|
||||
switch (state)
|
||||
|
||||
@@ -123,7 +123,7 @@ void get_device_id(void)
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
|
||||
if (hardware_id[0] != 0) {
|
||||
if (verbose)
|
||||
printf("using hardware id for device id: '%s'\n", hardware_id);
|
||||
|
||||
@@ -352,7 +352,7 @@ int main(int argc, char** argv) {
|
||||
printf("This is not a properly formatted Samsung boot image!\nFailed\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
// Find the ramdisk
|
||||
return_val = find_gzip_recovery_ramdisk(boot_image, &address2);
|
||||
if (return_val < 0) {
|
||||
@@ -385,7 +385,7 @@ int main(int argc, char** argv) {
|
||||
printf("This is not a properly formatted Samsung boot image!\nFailed\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
// Find the ramdisk
|
||||
return_val = find_gzip_recovery_ramdisk(boot_image, &address2);
|
||||
if (return_val < 0) {
|
||||
|
||||
@@ -184,9 +184,9 @@ static int vk_init(struct ev *e)
|
||||
close(vk_fd);
|
||||
if (len <= 0)
|
||||
return -1;
|
||||
|
||||
|
||||
vks[len] = '\0';
|
||||
|
||||
|
||||
/* Parse a line like:
|
||||
keytype:keycode:centerx:centery:width:height:keytype2:keycode2:centerx2:...
|
||||
*/
|
||||
@@ -660,7 +660,7 @@ static int vk_modify(struct ev *e, struct input_event *ev)
|
||||
|
||||
vibrate(VIBRATOR_TIME_MS);
|
||||
|
||||
// Mark that all further movement until lift is discard,
|
||||
// Mark that all further movement until lift is discard,
|
||||
// and make sure we don't come back into this area
|
||||
discard = 1;
|
||||
downX = 0;
|
||||
|
||||
@@ -8,7 +8,7 @@ int main(int argc, char *argv)
|
||||
unsigned m;
|
||||
unsigned run_val;
|
||||
unsigned run_count;
|
||||
|
||||
|
||||
n = gimp_image.width * gimp_image.height;
|
||||
m = 0;
|
||||
x = gimp_image.pixel_data;
|
||||
@@ -23,7 +23,7 @@ int main(int argc, char *argv)
|
||||
printf(" .width = %d,\n .height = %d,\n .cwidth = %d,\n .cheight = %d,\n", gimp_image.width, gimp_image.height,
|
||||
gimp_image.width / 96, gimp_image.height);
|
||||
printf(" .rundata = {\n");
|
||||
|
||||
|
||||
run_val = (*x ? 0 : 255);
|
||||
run_count = 1;
|
||||
n--;
|
||||
|
||||
@@ -359,7 +359,7 @@ bool TWPartition::Process_Fstab_Line(string Line, bool Display_Error) {
|
||||
Can_Be_Backed_Up = true;
|
||||
if (Mount(false) && !TWFunc::Path_Exists("/cache/recovery/.")) {
|
||||
LOGINFO("Recreating /cache/recovery folder.\n");
|
||||
if (mkdir("/cache/recovery", S_IRWXU | S_IRWXG | S_IWGRP | S_IXGRP) != 0)
|
||||
if (mkdir("/cache/recovery", S_IRWXU | S_IRWXG | S_IWGRP | S_IXGRP) != 0)
|
||||
return -1;
|
||||
}
|
||||
} else if (Mount_Point == "/datadata") {
|
||||
@@ -1438,7 +1438,7 @@ void TWPartition::Check_FS_Type() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (blkid_probe_lookup_value(pr, "TYPE", &type, NULL) < 0) {
|
||||
if (blkid_probe_lookup_value(pr, "TYPE", &type, NULL) < 0) {
|
||||
blkid_free_probe(pr);
|
||||
LOGINFO("can't find filesystem on device %s\n", Actual_Block_Device.c_str());
|
||||
return;
|
||||
@@ -1976,7 +1976,7 @@ void TWPartition::Recreate_Media_Folder(void) {
|
||||
} else if (!TWFunc::Path_Exists("/data/media")) {
|
||||
PartitionManager.Mount_By_Path(Symlink_Mount_Point, true);
|
||||
LOGINFO("Recreating /data/media folder.\n");
|
||||
mkdir("/data/media", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
|
||||
mkdir("/data/media", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
|
||||
#ifdef HAVE_SELINUX
|
||||
perms.fixDataInternalContexts();
|
||||
#endif
|
||||
@@ -1993,7 +1993,7 @@ void TWPartition::Recreate_AndSec_Folder(void) {
|
||||
} else if (!TWFunc::Path_Exists(Symlink_Path)) {
|
||||
LOGINFO("Recreating %s folder.\n", Backup_Name.c_str());
|
||||
PartitionManager.Mount_By_Path(Symlink_Mount_Point, true);
|
||||
mkdir(Symlink_Path.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
|
||||
mkdir(Symlink_Path.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
|
||||
PartitionManager.UnMount_By_Path(Symlink_Mount_Point, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -510,7 +510,7 @@ int TWPartitionManager::Check_Backup_Name(bool Display_Error) {
|
||||
return 0; // A "0" (zero) means to use the current timestamp for the backup name
|
||||
for (index=0; index<copy_size; index++) {
|
||||
cur_char = (int)backup_name[index];
|
||||
if (cur_char == 32 || (cur_char >= 48 && cur_char <= 57) || (cur_char >= 65 && cur_char <= 91) || cur_char == 93 || cur_char == 95 || (cur_char >= 97 && cur_char <= 123) || cur_char == 125 || cur_char == 45 || cur_char == 46) {
|
||||
if (cur_char == 32 || (cur_char >= 48 && cur_char <= 57) || (cur_char >= 65 && cur_char <= 91) || cur_char == 93 || cur_char == 95 || (cur_char >= 97 && cur_char <= 123) || cur_char == 125 || cur_char == 45 || cur_char == 46) {
|
||||
// These are valid characters
|
||||
// Numbers
|
||||
// Upper case letters
|
||||
@@ -528,7 +528,7 @@ int TWPartitionManager::Check_Backup_Name(bool Display_Error) {
|
||||
DataManager::GetValue(TW_BACKUPS_FOLDER_VAR, Backup_Loc);
|
||||
strcpy(backup_loc, Backup_Loc.c_str());
|
||||
sprintf(tw_image_dir,"%s/%s", backup_loc, Backup_Name.c_str());
|
||||
if (TWFunc::Path_Exists(tw_image_dir)) {
|
||||
if (TWFunc::Path_Exists(tw_image_dir)) {
|
||||
if (Display_Error)
|
||||
LOGERR("A backup with this name already exists.\n");
|
||||
return -4;
|
||||
@@ -544,7 +544,7 @@ bool TWPartitionManager::Make_MD5(bool generate_md5, string Backup_Folder, strin
|
||||
string result;
|
||||
twrpDigest md5sum;
|
||||
|
||||
if (!generate_md5)
|
||||
if (!generate_md5)
|
||||
return true;
|
||||
|
||||
TWFunc::GUI_Operation_Text(TW_GENERATE_MD5_TEXT, "Generating MD5");
|
||||
@@ -618,7 +618,7 @@ bool TWPartitionManager::Backup_Partition(TWPartition* Part, string Backup_Folde
|
||||
pos = (total_time - remain_time) / (float) total_time;
|
||||
DataManager::SetProgress(pos);
|
||||
|
||||
LOGINFO("Estimated Total time: %lu Estimated remaining time: %lu\n", total_time, remain_time);
|
||||
LOGINFO("Estimated total time: %lu\nEstimated remaining time: %lu\n", total_time, remain_time);
|
||||
|
||||
// And get the time
|
||||
if (Part->Backup_Method == 1)
|
||||
@@ -680,7 +680,7 @@ int TWPartitionManager::Run_Backup(void) {
|
||||
time_t start, stop, seconds, total_start, total_stop;
|
||||
size_t start_pos = 0, end_pos = 0;
|
||||
seconds = time(0);
|
||||
t = localtime(&seconds);
|
||||
t = localtime(&seconds);
|
||||
|
||||
time(&total_start);
|
||||
|
||||
@@ -747,7 +747,7 @@ int TWPartitionManager::Run_Backup(void) {
|
||||
}
|
||||
total_bytes = file_bytes + img_bytes;
|
||||
gui_print(" * Total number of partitions to back up: %d\n", partition_count);
|
||||
gui_print(" * Total size of all data: %lluMB\n", total_bytes / 1024 / 1024);
|
||||
gui_print(" * Total size of all data: %lluMB\n", total_bytes / 1024 / 1024);
|
||||
storage = Find_Partition_By_Path(DataManager::GetCurrentStoragePath());
|
||||
if (storage != NULL) {
|
||||
free_space = storage->Free;
|
||||
@@ -762,7 +762,7 @@ int TWPartitionManager::Run_Backup(void) {
|
||||
return false;
|
||||
}
|
||||
img_bytes_remaining = img_bytes;
|
||||
file_bytes_remaining = file_bytes;
|
||||
file_bytes_remaining = file_bytes;
|
||||
|
||||
gui_print("\n[BACKUP STARTED]\n");
|
||||
gui_print(" * Backup Folder: %s\n", Full_Backup_Path.c_str());
|
||||
@@ -802,23 +802,23 @@ int TWPartitionManager::Run_Backup(void) {
|
||||
time(&total_stop);
|
||||
int total_time = (int) difftime(total_stop, total_start);
|
||||
uint64_t actual_backup_size = du.Get_Folder_Size(Full_Backup_Path);
|
||||
actual_backup_size /= (1024LLU * 1024LLU);
|
||||
actual_backup_size /= (1024LLU * 1024LLU);
|
||||
|
||||
int prev_img_bps, use_compression;
|
||||
unsigned long long prev_file_bps;
|
||||
DataManager::GetValue(TW_BACKUP_AVG_IMG_RATE, prev_img_bps);
|
||||
img_bps += (prev_img_bps * 4);
|
||||
img_bps /= 5;
|
||||
img_bps /= 5;
|
||||
|
||||
DataManager::GetValue(TW_USE_COMPRESSION_VAR, use_compression);
|
||||
DataManager::GetValue(TW_USE_COMPRESSION_VAR, use_compression);
|
||||
if (use_compression)
|
||||
DataManager::GetValue(TW_BACKUP_AVG_FILE_COMP_RATE, prev_file_bps);
|
||||
else
|
||||
else
|
||||
DataManager::GetValue(TW_BACKUP_AVG_FILE_RATE, prev_file_bps);
|
||||
file_bps += (prev_file_bps * 4);
|
||||
file_bps /= 5;
|
||||
file_bps /= 5;
|
||||
|
||||
DataManager::SetValue(TW_BACKUP_AVG_IMG_RATE, img_bps);
|
||||
DataManager::SetValue(TW_BACKUP_AVG_IMG_RATE, img_bps);
|
||||
if (use_compression)
|
||||
DataManager::SetValue(TW_BACKUP_AVG_FILE_COMP_RATE, file_bps);
|
||||
else
|
||||
@@ -1201,7 +1201,7 @@ int TWPartitionManager::Wipe_Dalvik_Cache(void) {
|
||||
if (stat("/sd-ext/dalvik-cache", &st) == 0)
|
||||
{
|
||||
TWFunc::removeDir("/sd-ext/dalvik-cache", false);
|
||||
gui_print("Cleaned: /sd-ext/dalvik-cache...\n");
|
||||
gui_print("Cleaned: /sd-ext/dalvik-cache...\n");
|
||||
}
|
||||
}
|
||||
gui_print("-- Dalvik Cache Directories Wipe Complete!\n\n");
|
||||
@@ -1542,7 +1542,7 @@ int TWPartitionManager::Decrypt_Device(string Password) {
|
||||
property_set("ro.crypto.sd_fs_mnt_point", EXPAND(TW_INTERNAL_STORAGE_PATH));
|
||||
#endif
|
||||
|
||||
property_set("rw.km_fips_status", "ready");
|
||||
property_set("rw.km_fips_status", "ready");
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1854,7 +1854,7 @@ int TWPartitionManager::Partition_SDCard(void) {
|
||||
tmpdevice += device;
|
||||
if (tmpdevice == Device) {
|
||||
// Adjust block size to byte size
|
||||
total_size = (int)(blocks * 1024ULL / 1000000LLU);
|
||||
total_size = (int)(blocks * 1024ULL / 1000000LLU);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ LOCAL_MODULE_TAGS := eng
|
||||
LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
|
||||
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
|
||||
|
||||
# Manage list
|
||||
# Manage list
|
||||
RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/dump_image
|
||||
RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/flash_image
|
||||
RELINK_SOURCE_FILES += $(TARGET_RECOVERY_ROOT_OUT)/sbin/erase_image
|
||||
|
||||
@@ -188,12 +188,12 @@ fp_start()
|
||||
$MOUNT /system > /dev/null 2>&1
|
||||
SYSMOUNT=1
|
||||
fi
|
||||
|
||||
|
||||
if $TEST $( $GREP -c " /data " "/proc/mounts" ) -eq 0; then
|
||||
$MOUNT /data > /dev/null 2>&1
|
||||
DATAMOUNT=1
|
||||
fi
|
||||
|
||||
|
||||
if $TEST -e /dev/block/mmcblk0p2 && $TEST $( $GREP -c " $SD_EXT_DIRECTORY " "/proc/mounts" ) -eq 0; then
|
||||
$MOUNT $SD_EXT_DIRECTORY > /dev/null 2>&1
|
||||
SYSSDMOUNT=1
|
||||
@@ -207,7 +207,7 @@ fp_start()
|
||||
if $TEST ! -e "$LOG_FILE"; then
|
||||
> $LOG_FILE
|
||||
fi
|
||||
|
||||
|
||||
fp_print "$0 $VERSION started at $FP_STARTTIME"
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ fp_chown_uid()
|
||||
FP_OLDUID=$1
|
||||
FP_UID=$2
|
||||
FP_FILE=$3
|
||||
|
||||
|
||||
#if user ownership doesn't equal then change them
|
||||
if $TEST "$FP_OLDUID" != "$FP_UID"; then
|
||||
if $TEST $VERBOSE -ne 0; then
|
||||
@@ -233,7 +233,7 @@ fp_chown_gid()
|
||||
FP_OLDGID=$1
|
||||
FP_GID=$2
|
||||
FP_FILE=$3
|
||||
|
||||
|
||||
#if group ownership doesn't equal then change them
|
||||
if $TEST "$FP_OLDGID" != "$FP_GID"; then
|
||||
if $TEST $VERBOSE -ne 0; then
|
||||
@@ -252,7 +252,7 @@ fp_chmod()
|
||||
FP_PERSTR=$2
|
||||
FP_PERNUM=$3
|
||||
FP_FILE=$4
|
||||
|
||||
|
||||
#if the permissions are not equal
|
||||
if $TEST "$FP_OLDPER" != "$FP_PERSTR"; then
|
||||
if $TEST $VERBOSE -ne 0; then
|
||||
@@ -299,22 +299,22 @@ fp_package()
|
||||
GID=$UID
|
||||
APPDIR=$( $ECHO $CODEPATH | $SED 's%^\(.*\)/.*%\1%' )
|
||||
APK=$( $ECHO $CODEPATH | $SED 's%^.*/\(.*\..*\)$%\1%' )
|
||||
|
||||
|
||||
#debug
|
||||
if $TEST $DEBUG -eq 1; then
|
||||
fp_print "CODEPATH: $CODEPATH APPDIR: $APPDIR APK:$APK UID/GID:$UID:$GID"
|
||||
fi
|
||||
|
||||
|
||||
#check for existence of apk
|
||||
if $TEST -e $CODEPATH; then
|
||||
fp_print "Processing ($curnum of $endnum): $PACKAGE..."
|
||||
|
||||
|
||||
#lets get existing permissions of CODEPATH
|
||||
OLD_UGD=$( $LS -ln "$CODEPATH" )
|
||||
OLD_PER=$( $ECHO $OLD_UGD | $CUT -d ' ' -f1 )
|
||||
OLD_UID=$( $ECHO $OLD_UGD | $CUT -d ' ' -f3 )
|
||||
OLD_GID=$( $ECHO $OLD_UGD | $CUT -d ' ' -f4 )
|
||||
|
||||
|
||||
#apk source dirs
|
||||
if $TEST "$APPDIR" = "/system/app"; then
|
||||
#skip system apps if set
|
||||
@@ -345,7 +345,7 @@ fp_package()
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
#the data/data for the package
|
||||
if $TEST -d "/data/data/$PACKAGE"; then
|
||||
#find all directories in /data/data/$PACKAGE
|
||||
@@ -356,14 +356,14 @@ fp_package()
|
||||
OLD_GID=$( $ECHO $dataline | $CUT -d ' ' -f4 )
|
||||
FILEDIR=$( $ECHO $dataline | $CUT -d ' ' -f9 )
|
||||
FOURDIR=$( $ECHO $FILEDIR | $CUT -d '/' -f5 )
|
||||
|
||||
|
||||
#set defaults for iteration
|
||||
ISLIB=0
|
||||
REVPERM=755
|
||||
REVPSTR="rwxr-xr-x"
|
||||
REVUID=$UID
|
||||
REVGID=$GID
|
||||
|
||||
|
||||
if $TEST "$FOURDIR" = ""; then
|
||||
#package directory, perms:755 owner:$UID:$GID
|
||||
fp_chmod $OLD_PER "rwxr-xr-x" 755 "$FILEDIR"
|
||||
@@ -400,7 +400,7 @@ fp_package()
|
||||
REVPSTR="rwxrwx--x"
|
||||
fp_chmod $OLD_PER "rwxrwx--x" 771 "$FILEDIR"
|
||||
fi
|
||||
|
||||
|
||||
#change ownership of directories matched
|
||||
if $TEST "$ISLIB" = "1"; then
|
||||
fp_chown_uid $OLD_UID 1000 "$FILEDIR"
|
||||
@@ -409,21 +409,21 @@ fp_package()
|
||||
fp_chown_uid $OLD_UID $UID "$FILEDIR"
|
||||
fp_chown_gid $OLD_GID $GID "$FILEDIR"
|
||||
fi
|
||||
|
||||
|
||||
#if any files exist in directory with improper permissions reset them
|
||||
$FIND $FILEDIR -type f -maxdepth 1 ! -perm $REVPERM -exec $LS -ln {} \; | while read subline; do
|
||||
OLD_PER=$( $ECHO $subline | $CUT -d ' ' -f1 )
|
||||
SUBFILE=$( $ECHO $subline | $CUT -d ' ' -f9 )
|
||||
fp_chmod $OLD_PER $REVPSTR $REVPERM "$SUBFILE"
|
||||
done
|
||||
|
||||
|
||||
#if any files exist in directory with improper user reset them
|
||||
$FIND $FILEDIR -type f -maxdepth 1 ! -user $REVUID -exec $LS -ln {} \; | while read subline; do
|
||||
OLD_UID=$( $ECHO $subline | $CUT -d ' ' -f3 )
|
||||
SUBFILE=$( $ECHO $subline | $CUT -d ' ' -f9 )
|
||||
fp_chown_uid $OLD_UID $REVUID "$SUBFILE"
|
||||
done
|
||||
|
||||
|
||||
#if any files exist in directory with improper group reset them
|
||||
$FIND $FILEDIR -type f -maxdepth 1 ! -group $REVGID -exec $LS -ln {} \; | while read subline; do
|
||||
OLD_GID=$( $ECHO $subline | $CUT -d ' ' -f4 )
|
||||
@@ -451,24 +451,24 @@ fp_end()
|
||||
if $TEST $SYSREMOUNT -eq 1; then
|
||||
$MOUNT -o remount,ro $DEVICE /system > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
if $TEST $SYSSDMOUNT -eq 1; then
|
||||
$UMOUNT $SD_EXT_DIRECTORY > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
if $TEST $SYSMOUNT -eq 1; then
|
||||
$UMOUNT /system > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
if $TEST $DATAMOUNT -eq 1; then
|
||||
$UMOUNT /data > /dev/null 2>&1
|
||||
fi
|
||||
|
||||
|
||||
FP_ENDTIME=$( $DATE +"%m-%d-%Y %H:%M:%S" )
|
||||
FP_ENDEPOCH=$( $DATE +%s )
|
||||
|
||||
|
||||
date_diff $FP_STARTEPOCH $FP_ENDEPOCH
|
||||
|
||||
|
||||
fp_print "$0 $VERSION ended at $FP_ENDTIME (Runtime:${FP_DDM}m${FP_DDS}s)"
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
/system/xbin/daemonsu --auto-daemon &
|
||||
|
||||
# Some apps like to run stuff from this script as well, that will
|
||||
# Some apps like to run stuff from this script as well, that will
|
||||
# obviously break root - in your code, just search this file
|
||||
# for "install-recovery-2.sh", and if present, write there instead.
|
||||
|
||||
|
||||
@@ -16,4 +16,4 @@ dest=$1
|
||||
for ARG in $*
|
||||
do
|
||||
process_file $dest $ARG
|
||||
done
|
||||
done
|
||||
@@ -550,7 +550,7 @@ int TWFunc::removeDir(const string path, bool skipParent) {
|
||||
if (p->d_type == DT_DIR) {
|
||||
r = removeDir(new_path, true);
|
||||
if (!r) {
|
||||
if (p->d_type == DT_DIR)
|
||||
if (p->d_type == DT_DIR)
|
||||
r = rmdir(new_path.c_str());
|
||||
else
|
||||
LOGINFO("Unable to removeDir '%s': %s\n", new_path.c_str(), strerror(errno));
|
||||
@@ -564,7 +564,7 @@ int TWFunc::removeDir(const string path, bool skipParent) {
|
||||
}
|
||||
closedir(d);
|
||||
|
||||
if (!r) {
|
||||
if (!r) {
|
||||
if (skipParent)
|
||||
return 0;
|
||||
else
|
||||
|
||||