• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisão9037e43fa8dfebaceea752e137a754593d752eb7 (tree)
Hora2020-12-31 11:31:22
AutorHugh Chen <hughchen@goog...>
CommiterBryan Ferris

Mensagem de Log

RESTRICT AUTOMERGE Fix phishing attacks over Bluetooth due to unclear warning message

Before this CL, there is a possible phishing attack allowing a malicious
BT device to acquire permissions based on insufficient information
presented to the user in the consent dialog. This could lead to local
escalation of privilege with no additional execution privileges needed.
User interaction is needed for exploitation.

This CL add more prompts presented for users to avoid phishing attacks.

Merge Conflict Notes:
There were a number of entries in strings.xml that did not exist on this
branch. However, as the CL only adds new entries rather than modifying
old ones this should not cause a problem. There were no merge conflicts
in the java files.

Bug: 167403112
Test: send intent to test right prompts message is pop up. make -j42 RunSettingsRoboTests
Change-Id: Idc6ef558b692115bb82ea58cf223f5919b618633

Mudança Sumário

Diff

--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -9052,4 +9052,17 @@
90529052
90539053 <!-- Note displayed when certain features are not available on low ram devices. [CHAR LIMIT=NONE] -->
90549054 <string name="disabled_low_ram_device">This feature is not available on this device</string>
9055+
9056+ <!-- Bluetooth message permission alert for notification content [CHAR LIMIT=none] -->
9057+ <string name="bluetooth_message_access_notification_content">Untrusted device wants to access your messages. Tap for details.</string>
9058+ <!-- Bluetooth message permission alert for dialog title [CHAR LIMIT=none] -->
9059+ <string name="bluetooth_message_access_dialog_title">Allow access to messages?</string>
9060+ <!-- Bluetooth message permission alert for dialog content [CHAR LIMIT=none] -->
9061+ <string name="bluetooth_message_access_dialog_content">An untrusted Bluetooth device, [<xliff:g id="device_name" example="My device">%1$s</xliff:g>], wants to access your messages.\n\nYou haven\u2019t connected to [<xliff:g id="device_name" example="My device">%2$s</xliff:g>] before.</string>
9062+ <!-- Bluetooth phonebook permission alert for notification content [CHAR LIMIT=none] -->
9063+ <string name="bluetooth_phonebook_access_notification_content">Untrusted device wants to access your contacts and call log. Tap for details.</string>
9064+ <!-- Bluetooth phonebook permission alert for dialog title [CHAR LIMIT=none] -->
9065+ <string name="bluetooth_phonebook_access_dialog_title">Allow access to contacts and call log?</string>
9066+ <!-- Bluetooth phonebook permission alert for dialog content [CHAR LIMIT=none] -->
9067+ <string name="bluetooth_phonebook_access_dialog_content">An untrusted Bluetooth device, [<xliff:g id="device_name" example="My device">%1$s</xliff:g>], wants to access your contacts and call log. This includes data about incoming and outgoing calls.\n\nYou haven\u2019t connected to [<xliff:g id="device_name" example="My device">%2$s</xliff:g>] before.</string>
90559068 </resources>
--- a/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java
+++ b/src/com/android/settings/bluetooth/BluetoothPermissionActivity.java
@@ -101,9 +101,9 @@ public class BluetoothPermissionActivity extends AlertActivity implements
101101 if (mRequestType == BluetoothDevice.REQUEST_TYPE_PROFILE_CONNECTION) {
102102 showDialog(getString(R.string.bluetooth_connection_permission_request), mRequestType);
103103 } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS) {
104- showDialog(getString(R.string.bluetooth_phonebook_request), mRequestType);
104+ showDialog(getString(R.string.bluetooth_phonebook_access_dialog_title), mRequestType);
105105 } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS) {
106- showDialog(getString(R.string.bluetooth_map_request), mRequestType);
106+ showDialog(getString(R.string.bluetooth_message_access_dialog_title), mRequestType);
107107 } else if (mRequestType == BluetoothDevice.REQUEST_TYPE_SIM_ACCESS) {
108108 showDialog(getString(R.string.bluetooth_sap_request), mRequestType);
109109 }
@@ -138,9 +138,9 @@ public class BluetoothPermissionActivity extends AlertActivity implements
138138 p.mView = createSapDialogView();
139139 break;
140140 }
141- p.mPositiveButtonText = getString(R.string.yes);
141+ p.mPositiveButtonText = getString(R.string.allow);
142142 p.mPositiveButtonListener = this;
143- p.mNegativeButtonText = getString(R.string.no);
143+ p.mNegativeButtonText = getString(R.string.deny);
144144 p.mNegativeButtonListener = this;
145145 mOkButton = mAlert.getButton(DialogInterface.BUTTON_POSITIVE);
146146 setupAlert();
@@ -170,7 +170,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements
170170 String mRemoteName = Utils.createRemoteName(this, mDevice);
171171 mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null);
172172 messageView = (TextView)mView.findViewById(R.id.message);
173- messageView.setText(getString(R.string.bluetooth_pb_acceptance_dialog_text,
173+ messageView.setText(getString(R.string.bluetooth_phonebook_access_dialog_content,
174174 mRemoteName, mRemoteName));
175175 return mView;
176176 }
@@ -179,7 +179,7 @@ public class BluetoothPermissionActivity extends AlertActivity implements
179179 String mRemoteName = Utils.createRemoteName(this, mDevice);
180180 mView = getLayoutInflater().inflate(R.layout.bluetooth_access, null);
181181 messageView = (TextView)mView.findViewById(R.id.message);
182- messageView.setText(getString(R.string.bluetooth_map_acceptance_dialog_text,
182+ messageView.setText(getString(R.string.bluetooth_message_access_dialog_content,
183183 mRemoteName, mRemoteName));
184184 return mView;
185185 }
--- a/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java
+++ b/src/com/android/settings/bluetooth/BluetoothPermissionRequest.java
@@ -140,13 +140,13 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
140140 switch (mRequestType) {
141141 case BluetoothDevice.REQUEST_TYPE_PHONEBOOK_ACCESS:
142142 title = context.getString(R.string.bluetooth_phonebook_request);
143- message = context.getString(R.string.bluetooth_pb_acceptance_dialog_text,
144- deviceAlias, deviceAlias);
143+ message = context.getString(
144+ R.string.bluetooth_phonebook_access_notification_content);
145145 break;
146146 case BluetoothDevice.REQUEST_TYPE_MESSAGE_ACCESS:
147147 title = context.getString(R.string.bluetooth_map_request);
148- message = context.getString(R.string.bluetooth_map_acceptance_dialog_text,
149- deviceAlias, deviceAlias);
148+ message = context.getString(
149+ R.string.bluetooth_message_access_notification_content);
150150 break;
151151 case BluetoothDevice.REQUEST_TYPE_SIM_ACCESS:
152152 title = context.getString(R.string.bluetooth_sap_request);
@@ -172,6 +172,7 @@ public final class BluetoothPermissionRequest extends BroadcastReceiver {
172172 .setContentTitle(title)
173173 .setTicker(message)
174174 .setContentText(message)
175+ .setStyle(new Notification.BigTextStyle().bigText(message))
175176 .setSmallIcon(android.R.drawable.stat_sys_data_bluetooth)
176177 .setAutoCancel(true)
177178 .setPriority(Notification.PRIORITY_MAX)