mieszko4 / react-native-zoom-us

MIT License
126 stars 118 forks source link

[Android] Implement onPermissionRequested on Android #213

Closed mieszko4 closed 2 years ago

mieszko4 commented 2 years ago

For Android 12 android.permission.READ_PHONE_STATE is required.

See https://marketplacefront.zoom.us/sdk/meeting/android/us/zoom/sdk/InMeetingServiceListener.html#onPermissionRequested(java.lang.String%5B%5D)

mieszko4 commented 2 years ago

It looks that there is no need for that. The SDK is already asking for READ_PHONE_STATE after joining the meeting. image

It does not crash for me even if you deny the permission. I tried on release build on LG and Samsung with Android 12. I also tried on emulator Android 9.

mieszko4 commented 2 years ago

Ok, it looks like if app requests permissions then they must be declared (https://developer.android.com/training/permissions/declaring#:~:text=As%20mentioned%20in%20the%20workflow,that%20your%20app%20might%20request.):

As mentioned in the workflow for using permissions, if your app requests app permissions, you must declare these permissions in your app's manifest file. These declarations help app stores and users understand the set of permissions that your app might request.

I will update the docs.

mieszko4 commented 2 years ago

Based on ZoomUs SDK docs it is not clear which permissions are required to be declared in your app because they mention:

Depending on the features you add to the Meeting SDK, your app may require the same permissions as the Zoom Client. Click View details under the Permissions header in the ZOOM Cloud Meetings Android app in the Google Play store for a list of permissions required by the Zoom Client.

However, Google Play removed the list of permissions recently and currently on their page is says No information available. Luckily, we can read permissions from downloaded apk using aapt d permissions us.zoom.videomeetings.apk | grep uses-permission.

uses-permission: name='com.google.android.c2dm.permission.RECEIVE'
uses-permission: name='us.zoom.videomeetings.permission.KUBI_MESSAGE'
uses-permission: name='us.zoom.videomeetings.permission.MEETING_NOTIFICATION'
uses-permission: name='android.permission.WRITE_EXTERNAL_STORAGE'
uses-permission: name='android.permission.READ_EXTERNAL_STORAGE'
uses-permission: name='android.permission.INTERNET'
uses-permission: name='android.permission.READ_PHONE_STATE'
uses-permission: name='android.permission.ACCESS_NETWORK_STATE'
uses-permission: name='android.permission.ACCESS_WIFI_STATE'
uses-permission: name='android.permission.MODIFY_AUDIO_SETTINGS'
uses-permission: name='android.permission.RECORD_AUDIO'
uses-permission: name='android.permission.CAMERA'
uses-permission: name='android.permission.VIBRATE'
uses-permission: name='android.permission.BLUETOOTH'
uses-permission: name='android.permission.BLUETOOTH_ADMIN'
uses-permission: name='android.permission.BLUETOOTH_CONNECT'
uses-permission: name='android.permission.BLUETOOTH_SCAN'
uses-permission: name='android.permission.BROADCAST_STICKY'
uses-permission: name='android.permission.READ_CALENDAR'
uses-permission: name='android.permission.WRITE_CALENDAR'
uses-permission: name='android.permission.READ_CONTACTS'
uses-permission: name='android.permission.WAKE_LOCK'
uses-permission: name='android.permission.CALL_PHONE'
uses-permission: name='android.permission.ACCESS_FINE_LOCATION'
uses-permission: name='android.permission.ACCESS_COARSE_LOCATION'
uses-permission: name='android.permission.SYSTEM_ALERT_WINDOW'
uses-permission: name='android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS'
uses-permission: name='android.permission.USE_FINGERPRINT'
uses-permission: name='android.permission.REQUEST_INSTALL_PACKAGES'
uses-permission: name='android.permission.FOREGROUND_SERVICE'
uses-permission: name='com.android.vending.BILLING'
uses-permission: name='android.permission.REORDER_TASKS'
uses-permission: name='android.permission.USE_FULL_SCREEN_INTENT'
uses-permission: name='android.permission.READ_PHONE_NUMBERS'
uses-permission: name='us.zoom.videomeetings.permission-group.ipc.sender'

Note that I got the apk with adb:

  1. Install ZOOM Cloud Meetings Android app from Play Store
  2. Find the path to .apk file adb shell pm list packages -f | grep zoom
  3. Download it adb pull "/data/app/~~random-hash==/us.zoom.videomeetings-random-hash==/base.apk" us.zoom.videomeetings.apk
  4. Install aapt (On Linux Mint apt-get install -y aapt)
mieszko4 commented 2 years ago

Based on ZoomUs SDK docs it is not clear which permissions are required to be declared in your app because they mention:

Depending on the features you add to the Meeting SDK, your app may require the same permissions as the Zoom Client. Click View details under the Permissions header in the ZOOM Cloud Meetings Android app in the Google Play store for a list of permissions required by the Zoom Client.

That is still not very useful because this app does much more than the basic usage of the lib so I will just in the docs permissions that were requested while using the test app, i.e.:

uses-permission: name='android.permission.READ_PHONE_STATE'
uses-permission: name='android.permission.CAMERA'
uses-permission: name='android.permission.RECORD_AUDIO'