Commit Graph

52304 Commits

Author SHA1 Message Date
Chen Chen
65a63e76b1 BluetoothSecurity: Add BLUETOOTH_PRIVILEGED permission for pairing dialog
Bug: 194300867
Test: Build

Change-Id: I5a496df50550ea7ee6986c960e28ae3e4a056b4b
2021-10-06 18:52:10 +00:00
Weng Su
3678155f90 Merge "[RESTRICT AUTOMERGE] Revert "Add comment to AndroidManifest"" into qt-dev 2021-10-06 18:47:29 +00:00
Weng Su
6a2624e500 [RESTRICT AUTOMERGE] Revert "Add permission checking to WifiDialogActivity"
Revert submission 15220072-add_permission_wifidialog-qt-dev

Reason for revert: rollback CLs to avoid compatibility risks
Reverted Changes:
I1535f6f2d:Add SafetyNet logging
If7ca069c8:Add permission checking to WifiDialogActivity

Bug: 185126813
Change-Id: I3f75adf5bf0eea037dc0c5dfbeeb22b35b2856b6
2021-10-05 03:37:51 +00:00
Weng Su
153b0f03f5 [RESTRICT AUTOMERGE] Revert "Add comment to AndroidManifest"
This reverts commit 4fb84a3737.

Reason for revert: rollback CLs to avoid compatibility risks

Bug: 185126813
Change-Id: I495cd723917db6405ef3b540a6f01eaeaf8a45fe
2021-10-05 03:24:14 +00:00
Weng Su
d05686b431 [RESTRICT AUTOMERGE] Revert "Add SafetyNet logging"
Revert submission 15220072-add_permission_wifidialog-qt-dev

Reason for revert: rollback CLs to avoid compatibility risks
Reverted Changes:
I1535f6f2d:Add SafetyNet logging
If7ca069c8:Add permission checking to WifiDialogActivity

Bug: 185126813
Change-Id: I42b77ac420d9438c741b28ce33bcadf1c74b19eb
2021-10-05 03:23:45 +00:00
Bill Yi
6718e1ee7b [automerger skipped] Import translations. DO NOT MERGE ANYWHERE am: 88a0994ed8 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15608116

Change-Id: Ia7592c1857dab18371f6284e5f6583217b148be9
2021-08-19 18:13:12 +00:00
Bill Yi
88a0994ed8 Import translations. DO NOT MERGE ANYWHERE
BUG:167403112

Auto-generated-cl: translation import
Change-Id: Id5c579245cf72f10f4d15fcb69d24bcf58dd281a
2021-08-17 22:14:24 -07:00
Bill Yi
f391df2089 Import translations. DO NOT MERGE ANYWHERE
BUG:167403112

Auto-generated-cl: translation import
Change-Id: I64cf73c3bf8cfc4e1135a40d5c6fa26066fc287e
2021-08-17 22:10:17 -07:00
TreeHugger Robot
189d26ff2a Merge "Add comment to AndroidManifest" into qt-dev 2021-08-07 17:18:31 +00:00
Weng Su
62041d683b Add SafetyNet logging
- Add SafetyNet log if the calling package is no the permission for
result

Test: checked eventlog in the bugreport
Bug: 185126813

Merged-In: I1535f6f2ded2445702df0d723518b773cd094164
Change-Id: I1535f6f2ded2445702df0d723518b773cd094164
(cherry picked from commit 199528d460)
2021-07-07 08:22:17 +00:00
Weng Su
8800cdf527 Add permission checking to WifiDialogActivity
- Use getCallingPackage() to get calling package.

- Check if the calling package has ACCESS_COARSE_LOCATION or
ACCESS_COARSE_LOCATION permission.

- Only set result data to permission granted callers

Bug: 185126813
Test: manual test
make RunSettingsRoboTests ROBOTEST_FILTER=WifiDialogActivityTest

Merged-In: If7ca069c842ed2bd1aed23f9d4041473c68a4dad
Change-Id: If7ca069c842ed2bd1aed23f9d4041473c68a4dad
(cherry picked from commit 71e728e934)
2021-07-07 08:06:29 +00:00
Weng Su
4fb84a3737 Add comment to AndroidManifest
- Wi-Fi result data will only be returned from WifiDialogActivity if the
calling package has location permission.

Test: add comment only, no test required.
Bug: 185126813

Merged-In: I81c4d801c4ee211f43a1688a62daaff3b47eae1a
Change-Id: I81c4d801c4ee211f43a1688a62daaff3b47eae1a
(cherry picked from commit 56a88885cc)
2021-07-06 07:49:49 +00:00
Hugh Chen
e849d212b7 [automerger skipped] RESTRICT AUTOMERGE Fix phishing attacks over Bluetooth due to unclear warning message am: 8fe8e0fc21 -s ours am: c551f39977 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15016141

Change-Id: I607bc56a88f50087d9e466eaad9a67d0f016463d
2021-06-28 06:37:12 +00:00
Hugh Chen
368ba20c95 [automerger skipped] RESTRICT AUTOMERGE Update string am: 3d6641a468 -s ours am: 9316df9560 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15016140

Change-Id: I3967969e09f69542cc461ca818d5024e7fe33f48
2021-06-28 06:37:08 +00:00
Hugh Chen
c551f39977 [automerger skipped] RESTRICT AUTOMERGE Fix phishing attacks over Bluetooth due to unclear warning message am: 8fe8e0fc21 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15016141

Change-Id: Ifef9d53b072a081c2c78437e4bc77e511024092a
2021-06-28 06:14:41 +00:00
Hugh Chen
9316df9560 [automerger skipped] RESTRICT AUTOMERGE Update string am: 3d6641a468 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15016140

Change-Id: Ic3ca73d1126a07c955e10b7871b9ccec0038b60d
2021-06-28 06:14:38 +00:00
Hugh Chen
505cc44596 [automerger skipped] RESTRICT AUTOMERGE Fix phishing attacks over Bluetooth due to unclear warning message am: 65e3c68e6f -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15021918

Change-Id: Ic4237a93471f2064896492eb607447620c0fc21a
2021-06-28 06:07:26 +00:00
Hugh Chen
1fe494db11 [automerger skipped] RESTRICT AUTOMERGE Update string am: 79ae54ca2d -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15016139

Change-Id: If38bb4a7880b0771648410c2dc11285e07008b34
2021-06-28 06:07:20 +00:00
Hugh Chen
8fe8e0fc21 RESTRICT AUTOMERGE Fix phishing attacks over Bluetooth due to unclear warning message
This CL add more prompts presented for users to avoid phishing attacks.

Screenshot:
https://screenshot.googleplex.com/p5PZbphN46ddPFV.png
https://screenshot.googleplex.com/6Q2wKfPbNQmTtx8.png
https://screenshot.googleplex.com/987VpYgNUZL2K4T.png
https://screenshot.googleplex.com/9eVg6SAGScVXU8U.png

Bug: 167403112
Test: manually test
Change-Id: Iadec059b662fd91754ad573bbe688702cdd3c9af
(cherry picked from commit 10e4599219)
2021-06-18 04:02:52 +00:00
Hugh Chen
3d6641a468 RESTRICT AUTOMERGE Update string
1. Replace "An untrusted Bluetooth device" to "A Bluetooth device".
2. Replace "Deny" to "Don't allow"

https://docs.google.com/document/d/18bVSIAyX4MNpNeCvxqyZu7CXcBUcdV0pnh-gzVprjqU/edit?ts=60709637

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

Change-Id: I38da15d4b1fb08671f6352458cbf3f735b4083bc
(cherry picked from commit 38fc9a91b5)
2021-06-18 04:02:42 +00:00
Hugh Chen
65e3c68e6f RESTRICT AUTOMERGE Fix phishing attacks over Bluetooth due to unclear warning message
This CL add more prompts presented for users to avoid phishing attacks.

Screenshot:
https://screenshot.googleplex.com/p5PZbphN46ddPFV.png
https://screenshot.googleplex.com/6Q2wKfPbNQmTtx8.png
https://screenshot.googleplex.com/987VpYgNUZL2K4T.png
https://screenshot.googleplex.com/9eVg6SAGScVXU8U.png

Bug: 167403112
Test: manually test
Change-Id: Iadec059b662fd91754ad573bbe688702cdd3c9af
(cherry picked from commit 10e4599219)
2021-06-18 03:50:33 +00:00
Hugh Chen
79ae54ca2d RESTRICT AUTOMERGE Update string
1. Replace "An untrusted Bluetooth device" to "A Bluetooth device".
2. Replace "Deny" to "Don't allow"

https://docs.google.com/document/d/18bVSIAyX4MNpNeCvxqyZu7CXcBUcdV0pnh-gzVprjqU/edit?ts=60709637

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

Change-Id: I38da15d4b1fb08671f6352458cbf3f735b4083bc
(cherry picked from commit 38fc9a91b5)
2021-06-18 03:50:24 +00:00
Hugh Chen
fa504b8e01 RESTRICT AUTOMERGE Fix phishing attacks over Bluetooth due to unclear warning message
This CL add more prompts presented for users to avoid phishing attacks.

Screenshot:
https://screenshot.googleplex.com/p5PZbphN46ddPFV.png
https://screenshot.googleplex.com/6Q2wKfPbNQmTtx8.png
https://screenshot.googleplex.com/987VpYgNUZL2K4T.png
https://screenshot.googleplex.com/9eVg6SAGScVXU8U.png

Bug: 167403112
Test: manually test
Change-Id: Iadec059b662fd91754ad573bbe688702cdd3c9af
(cherry picked from commit 10e4599219)
2021-06-18 03:34:32 +00:00
Hugh Chen
7ce80425ee RESTRICT AUTOMERGE Update string
1. Replace "An untrusted Bluetooth device" to "A Bluetooth device".
2. Replace "Deny" to "Don't allow"

https://docs.google.com/document/d/18bVSIAyX4MNpNeCvxqyZu7CXcBUcdV0pnh-gzVprjqU/edit?ts=60709637

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

Change-Id: I38da15d4b1fb08671f6352458cbf3f735b4083bc
(cherry picked from commit 38fc9a91b5)
2021-06-18 03:34:00 +00:00
Jakub Pawlowski
8797825bc1 [automerger skipped] Prevent drawing on top of DevicePickerActivity am: 9d99e0b3ff am: d6ed1528cb -s ours
am skip reason: Merged-In I8b27b397bce1708a42b96b1b647c64e23142c468 with SHA-1 68f799a4c6 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14487882

Change-Id: I65f86808c2d2455c98c022ad52680597c58ff148
2021-05-12 20:04:53 +00:00
Jakub Pawlowski
d6ed1528cb Prevent drawing on top of DevicePickerActivity am: 9d99e0b3ff
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14487882

Change-Id: Iddc0d74ef10d404f8463544683cc913656346a34
2021-05-12 19:47:21 +00:00
Jakub Pawlowski
9d99e0b3ff Prevent drawing on top of DevicePickerActivity
Bug: 182584940
Merged-In: I8b27b397bce1708a42b96b1b647c64e23142c468
Change-Id: I8b27b397bce1708a42b96b1b647c64e23142c468
2021-05-12 19:27:32 +00:00
Jakub Pawlowski
3a2ab54f36 Merge "Prevent drawing on top of DevicePickerActivity" into qt-dev 2021-05-12 19:27:19 +00:00
TreeHugger Robot
fc721d09cb Merge changes Ia51528f2,Id27a7809 into oc-mr1-dev am: 75e33fb315 am: 9724c735da
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14419449

Change-Id: Ie84e9ff000ff0860ec83d704ffe61c2d74164f96
2021-05-11 06:18:45 +00:00
Hugh Chen
9bbcb55a23 [automerger skipped] RESTRICT AUTOMERGE Fix unable to send file via OPP am: 2deb2829ea -s ours am: 53ff99b8b4 -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14419449

Change-Id: Ie3e897ff1e8259b5d24dc1291e0683f325c2d7fe
2021-05-11 06:18:44 +00:00
TreeHugger Robot
38a2b32e94 Merge changes Ia51528f2,Id27a7809 into pi-dev am: f9c99c40d2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14419448

Change-Id: I0431e3135de7bb952fa8e8185b6eef44a1c24dc7
2021-05-11 06:18:37 +00:00
Hugh Chen
8a4f60b143 [automerger skipped] RESTRICT AUTOMERGE Fix unable to send file via OPP am: f727d5cf2a -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14419448

Change-Id: I44435d83016a9c974d704cab9de7fa50df1515f3
2021-05-11 06:18:35 +00:00
TreeHugger Robot
9724c735da Merge changes Ia51528f2,Id27a7809 into oc-mr1-dev am: 75e33fb315
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14419449

Change-Id: Ia0822c53ab65ce90334aee521be99886945d41e8
2021-05-11 06:16:53 +00:00
Hugh Chen
53ff99b8b4 [automerger skipped] RESTRICT AUTOMERGE Fix unable to send file via OPP am: 2deb2829ea -s ours
am skip reason: subject contains skip directive

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14419449

Change-Id: I23ab4bb935d65f3afda82333291d0ea7a187428a
2021-05-11 06:16:53 +00:00
TreeHugger Robot
f9c99c40d2 Merge changes Ia51528f2,Id27a7809 into pi-dev
* changes:
  RESTRICT AUTOMERGE Fix unable to send file via OPP
  RESTRICT AUTOMERGE Fix bluetooth settings will broadcast to anywhere when some cases
2021-05-11 06:03:54 +00:00
TreeHugger Robot
75e33fb315 Merge changes Ia51528f2,Id27a7809 into oc-mr1-dev
* changes:
  RESTRICT AUTOMERGE Fix unable to send file via OPP
  RESTRICT AUTOMERGE Fix bluetooth settings will broadcast to anywhere when some cases
2021-05-11 06:03:45 +00:00
TreeHugger Robot
4074cd5e48 Merge changes Ia51528f2,Id27a7809 into qt-dev
* changes:
  RESTRICT AUTOMERGE Fix unable to send file via OPP
  RESTRICT AUTOMERGE Fix bluetooth settings will broadcast to anywhere when some cases
2021-05-11 06:03:19 +00:00
Jakub Pawlowski
68f799a4c6 Prevent drawing on top of DevicePickerActivity
Bug: 182584940
Change-Id: I8b27b397bce1708a42b96b1b647c64e23142c468
2021-05-10 19:50:49 +02:00
Hugh Chen
2deb2829ea RESTRICT AUTOMERGE Fix unable to send file via OPP
Bluetooth app will indicate BluetoothOppReceiver to receive
device picker intent. But for fix the security issue we
removed the setClassName() method in ag/14111132 to avoid attack.
It causes BluetoothOppReceiver cannot receive the intent.

This CL will compare to calling package name with launch package name.
If they are not equal, the setClassName() will not invoke.

Bug: 186490534
Bug: 179386960
Bug: 179386068

Test: make RunSettingsRoboTests -j56
Change-Id: Ia51528f2a44ab73edbc86899ca0846d3262fe1f0
(cherry picked from commit bb5be240c0)
2021-05-04 08:17:35 +00:00
Hugh Chen
f727d5cf2a RESTRICT AUTOMERGE Fix unable to send file via OPP
Bluetooth app will indicate BluetoothOppReceiver to receive
device picker intent. But for fix the security issue we
removed the setClassName() method in ag/14111132 to avoid attack.
It causes BluetoothOppReceiver cannot receive the intent.

This CL will compare to calling package name with launch package name.
If they are not equal, the setClassName() will not invoke.

Bug: 186490534
Bug: 179386960
Bug: 179386068

Test: make RunSettingsRoboTests -j56
Change-Id: Ia51528f2a44ab73edbc86899ca0846d3262fe1f0
(cherry picked from commit bb5be240c0)
2021-05-04 08:11:01 +00:00
Hugh Chen
51755e9a33 RESTRICT AUTOMERGE Fix unable to send file via OPP
Bluetooth app will indicate BluetoothOppReceiver to receive
device picker intent. But for fix the security issue we
removed the setClassName() method in ag/14111132 to avoid attack.
It causes BluetoothOppReceiver cannot receive the intent.

This CL will compare to calling package name with launch package name.
If they are not equal, the setClassName() will not invoke.

Bug: 186490534
Bug: 179386960
Bug: 179386068

Test: make RunSettingsRoboTests -j56
Change-Id: Ia51528f2a44ab73edbc86899ca0846d3262fe1f0
(cherry picked from commit bb5be240c0)
2021-05-04 06:04:05 +00:00
Weng Su
1f24c6a968 [DO NOT MERGE] Modify Wi-Fi details settings to restricted style
- Show restricted text in guest mode

- Screenshot:
  https://screenshot.googleplex.com/6nYcmazMM46TxaB

Bug: 177573895
Test: manual test
make RunSettingsRoboTests \
       ROBOTEST_FILTER=WifiNetworkDetailsFragmentTest

Change-Id: I5f857b2079e0f550e4be601d27dd54dac56b2f57
Merged-In: I5f857b2079e0f550e4be601d27dd54dac56b2f57
2021-04-29 14:38:27 +00:00
Tsung-Mao Fang
4d7853f35c [automerger skipped] Prevent HTML Injection on the Device Admin request screen am: 80c3f6d4d8 am: 26f3013c32 -s ours
am skip reason: Merged-In I53b460b12da918e022d2f2934f114d205dbaadb0 with SHA-1 52f9039d5c is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14167794

Change-Id: I1433418c4c0ffbf0e0337f6a03c03c22d594d349
2021-04-29 06:38:45 +00:00
Tsung-Mao Fang
26f3013c32 Prevent HTML Injection on the Device Admin request screen am: 80c3f6d4d8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14167794

Change-Id: Iac38c0d7f7517c8d4ecac036e73524d37c66fb6e
2021-04-29 06:21:38 +00:00
Hugh Chen
c2adcb2d3a RESTRICT AUTOMERGE Fix bluetooth settings will broadcast to anywhere when some cases
BluetoothPermissionActivity and DevicePickerFragment will send
broadcast to return the result to calling apps. As this broadcast
intent is from Settings with uid 1000, it will be sent to any
protected BroadcastReceivers in the device. It can make an attacker
send broadcast to protected BroadcastReceivers like factory reset intent
(android/com.android.server.MasterClearReceiver) via
BluetoothPermissionActivity or DevicePickerFragment.

This CL will not allow to set package name and class name to avoid
the attacker.

Bug: 179386960
Bug: 179386068
Test: make -j42 RunSettingsRoboTests and use test apk to manually test
to verify factory reset not started and no system UI notification.

Change-Id: Id27a78091ab578077853b8fbb97a4422cff0a158
(cherry picked from commit 8adedc6249)
2021-04-26 03:45:59 +00:00
Hugh Chen
093ac45cd8 RESTRICT AUTOMERGE Fix bluetooth settings will broadcast to anywhere when some cases
BluetoothPermissionActivity and DevicePickerFragment will send
broadcast to return the result to calling apps. As this broadcast
intent is from Settings with uid 1000, it will be sent to any
protected BroadcastReceivers in the device. It can make an attacker
send broadcast to protected BroadcastReceivers like factory reset intent
(android/com.android.server.MasterClearReceiver) via
BluetoothPermissionActivity or DevicePickerFragment.

This CL will not allow to set package name and class name to avoid
the attacker.

Bug: 179386960
Bug: 179386068
Test: make -j42 RunSettingsRoboTests and use test apk to manually test
to verify factory reset not started and no system UI notification.

Change-Id: Id27a78091ab578077853b8fbb97a4422cff0a158
(cherry picked from commit 8adedc6249)
2021-04-26 03:45:01 +00:00
Hugh Chen
43d093ebe8 RESTRICT AUTOMERGE Fix bluetooth settings will broadcast to anywhere when some cases
BluetoothPermissionActivity and DevicePickerFragment will send
broadcast to return the result to calling apps. As this broadcast
intent is from Settings with uid 1000, it will be sent to any
protected BroadcastReceivers in the device. It can make an attacker
send broadcast to protected BroadcastReceivers like factory reset intent
(android/com.android.server.MasterClearReceiver) via
BluetoothPermissionActivity or DevicePickerFragment.

This CL will not allow to set package name and class name to avoid
the attacker.

Bug: 179386960
Bug: 179386068
Test: make -j42 RunSettingsRoboTests and use test apk to manually test
to verify factory reset not started and no system UI notification.

Change-Id: Id27a78091ab578077853b8fbb97a4422cff0a158
(cherry picked from commit 8adedc6249)
2021-04-26 03:43:57 +00:00
Tsung-Mao Fang
80c3f6d4d8 Prevent HTML Injection on the Device Admin request screen
The root issue is that CharSequence is an interface.
String implements that interface, however, Spanned class
too which is a rich text format that can store HTML code.

The solution is enforce to use String type which won't include
any HTML function.

Test: Rebuilt apk and see the string without HTML style.
Bug: 179042963
Change-Id: I53b460b12da918e022d2f2934f114d205dbaadb0
Merged-In: I53b460b12da918e022d2f2934f114d205dbaadb0
2021-04-14 12:19:21 +00:00
Tsung-Mao Fang
52f9039d5c Prevent HTML Injection on the Device Admin request screen
The root issue is that CharSequence is an interface.
String implements that interface, however, Spanned class
too which is a rich text format that can store HTML code.

The solution is enforce to use String type which won't include
any HTML function.

Test: Rebuilt apk and see the string without HTML style.
Bug: 179042963
Change-Id: I53b460b12da918e022d2f2934f114d205dbaadb0
Merged-In: I53b460b12da918e022d2f2934f114d205dbaadb0
(cherry picked from commit 0bf3c98b2f)
2021-04-14 12:16:57 +00:00
TreeHugger Robot
c3edd0b379 [automerger skipped] Merge "Hide non-system overlay window on ActivityPicker" into pi-dev am: d2ee0db550 -s ours
am skip reason: skip tag Change-Id I6e2845cc19dc012cba2933318a067bbb8db90a23 with SHA-1 8a9fafb37d is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/14108645

Change-Id: Ie4514dfe4f245139b9733d903f8f36ed29af998c
2021-04-09 16:50:18 +00:00