If you have a pixel, kindly use grapheneOS (sandboxed google play services) , otherwise this guide is pretty useful.
- Unlock bootloader. (If your ROM is too privacy invading / bloated)
- Install any custom OS that gives pixel experience, I use PixelOS.
- Switch off permissions (unlocked) of google apps in settings . (Show system → search google )
- Switch off their background network connectivity in settings.
- Revoke Special Permissions via Settings → Apps & Notifications → Advanced → Special App Access.
- Use adb to uninstall bloatware.
- Use adb to switch off locked permissions.
Pro Tip: You can just disable google apps, then enable them when you need to get those banking apps see google in your phone.
switch on android debugging
get into android shell via:
adb shell
you can list all google apps by:
pm list packages | grep google
you can list dangerous permissions by
dumpsys package com.google.android.gms | grep permission | grep true
pm list permissions -g -d | awk -F: '/permission:/ {print $2}'
list google privileged permissions by:
pm list permissions -g -d | awk -F: '/permission:/ {print $2}' | grep google
then revoke by
for i in "READ_CONTACTS" "READ_SMS" "WAKE_LOCK" "PROCESS_OUTGOING_CALLS" "BLUETOOTH_SCAN" "USE_BIOMETRIC" "READ_MEDIA_AUDIO" "READ_MEDIA_VIDEO" "READ_MEDIA_IMAGES" "BLUETOOTH_CONNECT" "BLUETOOTH_ADVERTISE" "NEARBY_WIFI_DEVICES" "ACCESS_RESTRICTED_SETTINGS"; do appops set com.google.android.gms $i ignore ; done
for i in "READ_CONTACTS" "READ_SMS" "WAKE_LOCK" "PROCESS_OUTGOING_CALLS" "BLUETOOTH_SCAN" "USE_BIOMETRIC" "READ_MEDIA_AUDIO" "READ_MEDIA_VIDEO" "READ_MEDIA_IMAGES" "BLUETOOTH_CONNECT" "BLUETOOTH_ADVERTISE" "NEARBY_WIFI_DEVICES" "ACCESS_RESTRICTED_SETTINGS"; do appops set com.android.vending $i ignore ; done
for i in "READ_CONTACTS" "READ_SMS" "WAKE_LOCK" "PROCESS_OUTGOING_CALLS" "BLUETOOTH_SCAN" "USE_BIOMETRIC" "READ_MEDIA_AUDIO" "READ_MEDIA_VIDEO" "READ_MEDIA_IMAGES" "BLUETOOTH_CONNECT" "BLUETOOTH_ADVERTISE" "NEARBY_WIFI_DEVICES" "ACCESS_RESTRICTED_SETTINGS"; do appops set com.google.android.googlequicksearchbox $i ignore ; done
for i in "READ_CALENDAR" "WRITE_CALENDAR" "CAMERA" "READ_CONTACTS" "WRITE_CONTACTS" "GET_ACCOUNTS" "ACCESS_FINE_LOCATION" "ACCESS_COARSE_LOCATION" "RECORD_AUDIO" "READ_PHONE_STATE" "READ_PHONE_NUMBERS" "CALL_PHONE" "ANSWER_PHONE_CALLS" "READ_CALL_LOG" "WRITE_CALL_LOG" "ADD_VOICEMAIL" "USE_SIP" "PROCESS_OUTGOING_CALLS" "BODY_SENSORS" "SEND_SMS" "RECEIVE_SMS" "READ_SMS" "RECEIVE_WAP_PUSH" "RECEIVE_MMS" "READ_EXTERNAL_STORAGE" "WRITE_EXTERNAL_STORAGE" "ACCESS_MEDIA_LOCATION" "ACCEPT_HANDOVER" "ACCESS_BACKGROUND_LOCATION" "ACTIVITY_RECOGNITION"; do pm revoke com.google.android.gms $i; done
for i in "READ_CALENDAR" "WRITE_CALENDAR" "CAMERA" "READ_CONTACTS" "WRITE_CONTACTS" "GET_ACCOUNTS" "ACCESS_FINE_LOCATION" "ACCESS_COARSE_LOCATION" "RECORD_AUDIO" "READ_PHONE_STATE" "READ_PHONE_NUMBERS" "CALL_PHONE" "ANSWER_PHONE_CALLS" "READ_CALL_LOG" "WRITE_CALL_LOG" "ADD_VOICEMAIL" "USE_SIP" "PROCESS_OUTGOING_CALLS" "BODY_SENSORS" "SEND_SMS" "RECEIVE_SMS" "READ_SMS" "RECEIVE_WAP_PUSH" "RECEIVE_MMS" "READ_EXTERNAL_STORAGE" "WRITE_EXTERNAL_STORAGE" "ACCESS_MEDIA_LOCATION" "ACCEPT_HANDOVER" "ACCESS_BACKGROUND_LOCATION" "ACTIVITY_RECOGNITION"; do pm revoke com.android.vending $i ; done
for i in "READ_CALENDAR" "WRITE_CALENDAR" "CAMERA" "READ_CONTACTS" "WRITE_CONTACTS" "GET_ACCOUNTS" "ACCESS_FINE_LOCATION" "ACCESS_COARSE_LOCATION" "RECORD_AUDIO" "READ_PHONE_STATE" "READ_PHONE_NUMBERS" "CALL_PHONE" "ANSWER_PHONE_CALLS" "READ_CALL_LOG" "WRITE_CALL_LOG" "ADD_VOICEMAIL" "USE_SIP" "PROCESS_OUTGOING_CALLS" "BODY_SENSORS" "SEND_SMS" "RECEIVE_SMS" "READ_SMS" "RECEIVE_WAP_PUSH" "RECEIVE_MMS" "READ_EXTERNAL_STORAGE" "WRITE_EXTERNAL_STORAGE" "ACCESS_MEDIA_LOCATION" "ACCEPT_HANDOVER" "ACCESS_BACKGROUND_LOCATION" "ACTIVITY_RECOGNITION"; do pm revoke om.google.android.googlequicksearchbox $i ; done
note I have only listed app ops / permissions that I was able to change to ignore
via adb.
Revoke android debug permissions, switch off android debugging. switch off developer options. Now all your banking apps should be working with least amount of privacy invasion, cheers
I have set this up in my test device, I will let you know if there are some problems in the coming week. Google apps switch on permissions automatically sometimes as they are privileged + these settings may be reversed by rebooting.
you can get all dangerous app ops in PC via:
wget -qO- https://raw.githubusercontent.com/aosp-mirror/platform_frameworks_base/android-9.0.0_r52/core/res/AndroidManifest.xml | grep -E 'protectionLevel=|<permission android:name=' | grep -B1 'protectionLevel=.*appop' | awk -F'"' '/permission/ {print $2}'
References:
https://android.stackexchange.com/questions/220292/list-of-adb-settable-permissions