android:scaleType="fitXY"
android:src="@drawable/dialog_divider" />
- <TextView android:id="@+id/message"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:text="@string/request_message" />
-
- <LinearLayout android:id="@+id/details_layout"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:paddingTop="5dip"
- android:paddingBottom="10dip"
- android:paddingLeft="15dip"
- android:paddingRight="15dip"
- android:orientation="vertical">
-
- <include layout="@layout/request_details" />
-
- </LinearLayout>
+ <include layout="@layout/request_details" />
<include layout="@layout/request_buttons" />
</LinearLayout>
android:scaleType="fitXY"
android:src="@drawable/dialog_divider" />
- <TextView android:id="@+id/message"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:text="@string/request_message" />
-
- <LinearLayout android:id="@+id/details_layout"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingTop="5dip"
- android:paddingBottom="10dip"
- android:paddingLeft="15dip"
- android:paddingRight="15dip"
- android:orientation="vertical">
-
- <include layout="@layout/request_details" />
-
- </LinearLayout>
+ <include layout="@layout/request_details" />
<CheckBox android:id="@+id/check_remember"
android:layout_width="fill_parent"
android:scaleType="fitXY"
android:src="@drawable/dialog_divider" />
- <TextView android:id="@+id/message"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:text="@string/request_message" />
-
- <LinearLayout android:id="@+id/details_layout"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingTop="5dip"
- android:paddingBottom="10dip"
- android:paddingLeft="15dip"
- android:paddingRight="15dip"
- android:orientation="vertical">
-
- <include layout="@layout/request_details" />
-
- </LinearLayout>
+ <include layout="@layout/request_details" />
<include layout="@layout/request_buttons" />
android:scaleType="fitXY"
android:src="@drawable/dialog_divider" />
- <TextView android:id="@+id/message"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:gravity="center_horizontal"
- android:text="@string/request_message" />
-
- <LinearLayout android:id="@+id/details_layout"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingTop="5dip"
- android:paddingBottom="10dip"
- android:paddingLeft="15dip"
- android:paddingRight="15dip"
- android:orientation="vertical">
-
- <include layout="@layout/request_details" />
-
- </LinearLayout>
+ <include layout="@layout/request_details" />
<include layout="@layout/pin_layout" />
limitations under the License.
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">
- <LinearLayout
+ <ViewFlipper android:id="@+id/flipper"
android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <TextView android:id="@+id/app_name_label"
- style="@style/DetailsLabel"
- android:layout_width="wrap_content"
- android:paddingRight="3dp"
- android:text="@string/request_app_name" />
- <TextView android:id="@+id/app_name"
- style="@style/DetailsInfo"
- android:singleLine="true"
- android:ellipsize="middle" />
- </LinearLayout>
+ android:layout_height="wrap_content">
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <TextView android:id="@+id/package_name_label"
- style="@style/DetailsLabel"
- android:layout_width="wrap_content"
- android:paddingRight="3dp"
- android:text="@string/detail_package" />
- <TextView android:id="@+id/package_name"
- style="@style/DetailsInfo"
- android:singleLine="true"
- android:ellipsize="middle" />
- </LinearLayout>
+ <TextView android:id="@+id/message"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal"
+ android:text="@string/request_message" />
- <LinearLayout
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:orientation="horizontal">
- <TextView android:id="@+id/request_detail_label"
- style="@style/DetailsLabel"
- android:layout_width="wrap_content"
- android:paddingRight="3dp"
- android:text="@string/detail_request" />
- <TextView android:id="@+id/request_detail"
- style="@style/DetailsInfo"
- android:singleLine="true"
- android:ellipsize="middle" />
- </LinearLayout>
+ <LinearLayout android:id="@+id/details_layout"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:paddingTop="5dip"
+ android:paddingBottom="10dip"
+ android:paddingLeft="15dip"
+ android:paddingRight="15dip"
+ android:orientation="vertical">
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <TextView android:id="@+id/app_name_label"
+ style="@style/DetailsLabel"
+ android:layout_width="wrap_content"
+ android:paddingRight="3dp"
+ android:text="@string/request_app_name" />
+ <TextView android:id="@+id/app_name"
+ style="@style/DetailsInfo"
+ android:singleLine="true"
+ android:ellipsize="middle" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <TextView android:id="@+id/package_name_label"
+ style="@style/DetailsLabel"
+ android:layout_width="wrap_content"
+ android:paddingRight="3dp"
+ android:text="@string/detail_package" />
+ <TextView android:id="@+id/package_name"
+ style="@style/DetailsInfo"
+ android:singleLine="true"
+ android:ellipsize="middle" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <TextView android:id="@+id/request_detail_label"
+ style="@style/DetailsLabel"
+ android:layout_width="wrap_content"
+ android:paddingRight="3dp"
+ android:text="@string/detail_request" />
+ <TextView android:id="@+id/request_detail"
+ style="@style/DetailsInfo"
+ android:singleLine="true"
+ android:ellipsize="middle" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+ <TextView android:id="@+id/command_label"
+ style="@style/DetailsLabel"
+ android:layout_width="wrap_content"
+ android:paddingRight="3dp"
+ android:text="@string/detail_command" />
+ <TextView android:id="@+id/command"
+ style="@style/DetailsInfo"
+ android:singleLine="true"
+ android:ellipsize="middle" />
+ </LinearLayout>
+
+ </LinearLayout>
+
+ </ViewFlipper>
- <LinearLayout
+ <TextView android:id="@+id/more_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal">
- <TextView android:id="@+id/command_label"
- style="@style/DetailsLabel"
- android:layout_width="wrap_content"
- android:paddingRight="3dp"
- android:text="@string/detail_command" />
- <TextView android:id="@+id/command"
- style="@style/DetailsInfo"
- android:singleLine="true"
- android:ellipsize="middle" />
- </LinearLayout>
+ android:gravity="right"
+ android:text="@string/request_more_info" />
</merge>
\ No newline at end of file
<string name="detail_command">Command</string>
<string name="detail_status">Status</string>
- <string name="request_message">The following app is requesting superuser access:</string>
+ <string name="request_message">%1$s is requesting Superuser access.\n\nWarning: If you did not initiate this action, or if you do not understand this request, it\'s generally a good idea to deny it.</string>
+ <string name="request_more_info">Tap for more info</string>
+ <string name="request_less_info">Tap for less info</string>
<string name="request_app_name">App</string>
<string name="pref_title">Preferences</string>
<item quantity="one">One app and preferences restored</item>
<item quantity="other">%1$d apps and preferences restored</item>
</plurals>
- <string name="pref_category_info_title">Superuser information</string>
+ <string name="pref_category_info_title">General</string>
<string name="pref_version_title">Superuser v%1$s (%2$d)</string>
<string name="pref_version_summary">Database version %s</string>
<string name="pref_bin_version_title_loading">Loading su binary version</string>
<string name="pref_outdated_notification_title">Outdated binary notification</string>
<string name="pref_outdated_notification_summary_on">Show notification when binary is outdated</string>
<string name="pref_outdated_notification_summary_off">Do not show notification when binary is outdated</string>
+ <string name="pref_advanced_prompt_title">Use advanced prompt</string>
+ <string name="pref_advanced_prompt_summary_on">Do not show warning on request prompts</string>
+ <string name="pref_advanced_prompt_summary_off">Show warning on request prompts</string>
<string name="pref_changelog_title">Changelog</string>
<string name="pref_changelog_summary">Display the changelog</string>
<string name="pref_get_elite_title">Go Elite!</string>
android:summaryOn="@string/pref_outdated_notification_summary_on"
android:summaryOff="@string/pref_outdated_notification_summary_off"
android:defaultValue="true" />
+ <CheckBoxPreference
+ android:key="pref_advanced_prompt"
+ android:title="@string/pref_advanced_prompt_title"
+ android:summaryOn="@string/pref_advanced_prompt_summary_on"
+ android:summaryOff="@string/pref_advanced_prompt_summary_off"
+ android:defaultValue="false" />
<Preference
android:key="pref_changelog"
android:title="@string/pref_changelog_title"
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
+import android.widget.ViewFlipper;
import java.io.IOException;
import java.io.OutputStream;
private CheckBox mRememberCheckBox;
private EditText mPinText;
+ private ViewFlipper mFlipper;
+ private TextView mMoreInfo;
@Override
public void onCreate(Bundle savedInstanceState) {
return;
}
- this.setContentView(R.layout.activity_request);
-
mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
Intent intent = this.getIntent();
Util.showOutdatedNotification(this);
}
+ TextView message = (TextView) findViewById(R.id.message);
+ message.setText(getString(R.string.request_message, Util.getAppName(this, mCallerUid, false)));
+
TextView appNameView = (TextView) findViewById(R.id.app_name);
appNameView.setText(Util.getAppName(this, mCallerUid, true));
mRememberCheckBox = (CheckBox) findViewById(R.id.check_remember);
mRememberCheckBox.setChecked(mPrefs.getBoolean("last_remember_value", true));
+
+ mFlipper = (ViewFlipper) findViewById(R.id.flipper);
+ mMoreInfo = (TextView)findViewById(R.id.more_info);
+
+ if (mPrefs.getBoolean(Preferences.ADVANCED_PROMPT, false)) {
+ mFlipper.setDisplayedChild(1);
+ mMoreInfo.setVisibility(View.GONE);
+ } else {
+ mFlipper.setOnClickListener(this);
+ mMoreInfo.setOnClickListener(this);
+ }
}
@Override
case R.id.pin_cancel:
sendResult(false, mRememberCheckBox.isChecked());
break;
+ case R.id.flipper:
+ case R.id.more_info:
+ flipInfo();
+ }
+ }
+
+ private void flipInfo() {
+ mFlipper.showNext();
+ if (mFlipper.getDisplayedChild() == 0) {
+ mMoreInfo.setText(R.string.request_more_info);
+ } else {
+ mMoreInfo.setText(R.string.request_less_info);
}
}
public static final String VERSION = "pref_version";
public static final String BIN_VERSION = "pref_bin_version";
public static final String OUTDATED_NOTIFICATION = "pref_outdated_notification";
+ public static final String ADVANCED_PROMPT = "pref_advanced_prompt";
public static final String CHANGELOG = "pref_changelog";
public static final String GET_ELITE = "pref_get_elite";