Make fixing su perms automatic

In 4.3+ with SELinux, su perms will be lost on every reboot so
users will get the prompt to fix su perms in TWRP every time. Make
fixing the su perms automatic instead of nagging the user.

Change-Id: Ia8a2652018db5e1f6ffc5fec2a4ac0db3a8f32bb
diff --git a/gui/action.cpp b/gui/action.cpp
index 78e8625..36f4006 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -603,6 +603,7 @@
 	}
 
 	if (function == "togglestorage") {
+		LOGERR("togglestorage action was deprecated from TWRP\n");
 		if (arg == "internal") {
 			DataManager::SetValue(TW_USE_EXTERNAL_STORAGE, 0);
 		} else if (arg == "external") {
@@ -1290,8 +1291,8 @@
 			if (simulate) {
 				simulate_progress_bar();
 			} else {
-				if (!TWFunc::Fix_su_Perms())
-					op_status = 1;
+				LOGERR("Fixing su permissions was deprecated from TWRP.\n");
+				LOGERR("4.3+ ROMs with SELinux will always lose su perms.\n");
 			}
 
 			operation_end(op_status, simulate);
diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml
index bbcaae1..569a5bd 100755
--- a/gui/devices/1024x600/res/ui.xml
+++ b/gui/devices/1024x600/res/ui.xml
@@ -3861,59 +3861,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_text_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_medium_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/1024x768/res/ui.xml b/gui/devices/1024x768/res/ui.xml
index 97b98c0..6f8797a 100644
--- a/gui/devices/1024x768/res/ui.xml
+++ b/gui/devices/1024x768/res/ui.xml
@@ -3861,59 +3861,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_text_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_medium_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/1080x1920/res/ui.xml b/gui/devices/1080x1920/res/ui.xml
index 5ba884b..beaf373 100644
--- a/gui/devices/1080x1920/res/ui.xml
+++ b/gui/devices/1080x1920/res/ui.xml
@@ -3855,59 +3855,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_header_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row3_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/1280x800/res/ui.xml b/gui/devices/1280x800/res/ui.xml
index 66861f2..115a391 100644
--- a/gui/devices/1280x800/res/ui.xml
+++ b/gui/devices/1280x800/res/ui.xml
@@ -3861,59 +3861,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_text_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_medium_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/1920x1200/res/ui.xml b/gui/devices/1920x1200/res/ui.xml
index d1a7829..fb615c1 100644
--- a/gui/devices/1920x1200/res/ui.xml
+++ b/gui/devices/1920x1200/res/ui.xml
@@ -3861,59 +3861,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_text_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_medium_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/2560x1600/res/ui.xml b/gui/devices/2560x1600/res/ui.xml
index 23b7c3e..9ce330a 100644
--- a/gui/devices/2560x1600/res/ui.xml
+++ b/gui/devices/2560x1600/res/ui.xml
@@ -3861,59 +3861,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_text_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_medium_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/320x480/res/ui.xml b/gui/devices/320x480/res/ui.xml
index 893c90c..dbee885 100644
--- a/gui/devices/320x480/res/ui.xml
+++ b/gui/devices/320x480/res/ui.xml
@@ -3842,59 +3842,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_header_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row3_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/480x800/res/ui.xml b/gui/devices/480x800/res/ui.xml
index 6900281..bb90e70 100644
--- a/gui/devices/480x800/res/ui.xml
+++ b/gui/devices/480x800/res/ui.xml
@@ -3842,59 +3842,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_header_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row3_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/480x854/res/ui.xml b/gui/devices/480x854/res/ui.xml
index 09c5077..08c3ddc 100644
--- a/gui/devices/480x854/res/ui.xml
+++ b/gui/devices/480x854/res/ui.xml
@@ -3841,59 +3841,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_header_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row3_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/540x960/res/ui.xml b/gui/devices/540x960/res/ui.xml
index f636e2e..e03704e 100644
--- a/gui/devices/540x960/res/ui.xml
+++ b/gui/devices/540x960/res/ui.xml
@@ -3842,59 +3842,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_header_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row3_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/720x1280/res/ui.xml b/gui/devices/720x1280/res/ui.xml
index 316b20e..c9a4c0a 100644
--- a/gui/devices/720x1280/res/ui.xml
+++ b/gui/devices/720x1280/res/ui.xml
@@ -3855,59 +3855,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_header_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row3_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/800x1280/res/ui.xml b/gui/devices/800x1280/res/ui.xml
index b850841..9b7a063 100755
--- a/gui/devices/800x1280/res/ui.xml
+++ b/gui/devices/800x1280/res/ui.xml
@@ -3843,59 +3843,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_header_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row3_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/gui/devices/800x480/res/ui.xml b/gui/devices/800x480/res/ui.xml
index cbd3b7d..9c391b3 100755
--- a/gui/devices/800x480/res/ui.xml
+++ b/gui/devices/800x480/res/ui.xml
@@ -3869,59 +3869,5 @@
 				<text>Swipe to Install</text>
 			</object>
 		</page>
-
-		<page name="fixsu">
-			<object type="template" name="header" />
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row1_text_y%" placement="5"/>
-				<text>Fix Superuser Permissions?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row2_text_y%" placement="5"/>
-				<text>Root permissions appear to be lost.</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row3_text_y%" placement="5"/>
-				<text>Fix root permissions now?</text>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%row4_text_y%" placement="5"/>
-				<text>(Fixes permissions on su binary & app)</text>
-			</object>
-
-			<object type="button">
-				<highlight color="%highlight_color%" />
-				<placement x="%col_center_x%" y="%row2_medium_y%" />
-				<font resource="font" color="%button_text_color%" />
-				<text>Do Not Fix</text>
-				<image resource="main_button" />
-				<action function="set">tw_page_done=1</action>
-			</object>
-
-			<object type="slider">
-				<placement x="%slider_x%" y="%slider_y%" />
-				<resource base="slider" used="slider-used" touch="slider-touch" />
-				<actions>
-					<action function="set">tw_action=fixsu</action>
-					<action function="set">tw_action_text1=Fixing Root Permissions</action>
-					<action function="set">tw_action_text2=</action>
-					<action function="page">singleaction_page</action>
-				</actions>
-			</object>
-
-			<object type="text" color="%text_color%">
-				<font resource="font" />
-				<placement x="%center_x%" y="%slider_text_y%" placement="4" />
-				<text>Swipe to Fix Root</text>
-			</object>
-		</page>
 	</pages>
 </recovery>
diff --git a/twrp.cpp b/twrp.cpp
index 5e1956f..57e1657 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -249,14 +249,12 @@
 			// Device doesn't have su installed
 			DataManager::SetValue("tw_busy", 1);
 			if (gui_startPage("installsu") != 0) {
-				LOGERR("Failed to start decrypt GUI page.\n");
+				LOGERR("Failed to start SuperSU install page.\n");
 			}
 		} else if (TWFunc::Check_su_Perms() > 0) {
 			// su perms are set incorrectly
-			DataManager::SetValue("tw_busy", 1);
-			if (gui_startPage("fixsu") != 0) {
-				LOGERR("Failed to start decrypt GUI page.\n");
-			}
+			LOGINFO("Root permissions appear to be lost... fixing. (This will always happen on 4.3+ ROMs with SELinux.\n");
+			TWFunc::Fix_su_Perms();
 		}
 		sync();
 		PartitionManager.UnMount_By_Path("/system", false);