wallet icon indicating copy to clipboard operation
wallet copied to clipboard

Android: Identity Permissions

Open xbtdev opened this issue 11 years ago • 17 comments

Just curious as to the purpose for the new permissions request on Android. screenshot_20150819-193558

xbtdev avatar Aug 22 '15 04:08 xbtdev

:-( wrong direction.

dan-da avatar Aug 22 '15 06:08 dan-da

https://github.com/bitpay/copay/blob/master/cordova/android/AndroidManifest.xml

Nothing in here about identity permissions...

Maybe the Cordova library requires it now?... (Basically, a third party library called Cordova compiles Copay into Android and iPhone apps.)

dabura667 avatar Aug 22 '15 06:08 dabura667

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.FLASHLIGHT" />

The only permissions in the file linked above.

dabura667 avatar Aug 22 '15 06:08 dabura667

" The device ID is used to encrypt the local storage of Copay on the device. It is only used there: (https://github.com/bitpay/copay/blob/master/src/js/services/storageService.js#L15). This provide protection if the storage is removed and access from other device. It can be audited on the code that the device Id is not used in any other place. Some people has expressed their concern about Copay asking this permission on Android, maybe we should remove it on the future. " from: https://www.reddit.com/r/Bitcoin/comments/3cszc4/new_features_for_copay_users_in_version_11/cszbjo0

That is the only usage device ID in Copay.

matiu avatar Aug 22 '15 12:08 matiu

Wow... just by looking at the UUID of the device, Android basically says:

OMG THIS APP IS LOOKING AT ONE OF THE FOLLOWING: YOUR MOMS ADDRESS, ALL YOUR PHONE NUMBERS, THE DNA OF YOUR FIRSTBORN CHILD, or a useless random number which is unique to your device.

Way to go Google...

Though I kind of understand the reasoning... explaining a UUID to a layman in a small blurb would be near impossible... so I guess "Identity" fits it as a classification...

Protecting the data in the event that it was somehow stolen from the device is very important... I wish Google would change the classification of UUID...

dabura667 avatar Aug 22 '15 13:08 dabura667

Look at my screenshot more closely. It says it already has access to my device ID... The identity permission is new. Please clarify why both are needed.

xbtdev avatar Aug 23 '15 08:08 xbtdev

https://github.com/bitpay/copay/compare/v1.1.2...v1.1.3

Just looked through the diff between 1.1.2 and 1.1.3 from top to bottom...

Nowhere in the diff does anything touch your contacts or identity info (besides UUID, which was already in 1.1.2 like you said.)

The only thing that even remotely looked like it might be accidentally pulling data could be: https://github.com/bitpay/copay/blob/aefff5a831e83fa3f5c4609cf03881bd85f76676/src/js/services/profileService.js#L229

But all it does is check it in an if statement, and does nothing with the data. But the fact that it's searching it for something called "walletId" it leads me to think that even this might not be touching the Android profile at all.

@matiu @cmgustavo Any ideas?

dabura667 avatar Aug 23 '15 10:08 dabura667

we were able to reproduce this in a new install. as @dabura667 mention, the 'Identity' permission is not required explicitly in the code by Copay, we will investigate further.

matiu avatar Aug 24 '15 13:08 matiu

it seems the plugin email composer requires that information:

grep -nr android.permission .|grep uses
./android/AndroidManifest.xml:4:    <uses-permission android:name="android.permission.INTERNET" />
./android/AndroidManifest.xml:32:    <uses-permission android:name="android.permission.CAMERA" />
./android/AndroidManifest.xml:33:    <uses-permission android:name="android.permission.FLASHLIGHT" />
./project/plugins/de.appplant.cordova.plugin.email-composer/plugin.xml:87:            <uses-permission android:name="android.permission.GET_ACCOUNTS" />
./project/plugins/de.appplant.cordova.plugin.email-composer/plugin.xml:111:            <uses-permission android:name="android.permission.GET_ACCOUNTS" />
./project/plugins/hu.dpal.phonegap.plugins.UniqueDeviceID/plugin.xml:29:            <uses-permission android:name="android.permission.READ_PHONE_STATE" />
./project/plugins/nl.x-services.plugins.socialsharing/plugin.xml:59:      <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
./project/plugins/nl.x-services.plugins.socialsharing/README.md:119:<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
./project/plugins/org.apache.cordova.file/plugin.xml:115:            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
./project/plugins/org.apache.cordova.file/plugin.xml:154:            <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
./project/plugins/org.apache.cordova.network-information/plugin.xml:58:            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
./project/plugins/org.apache.cordova.network-information/plugin.xml:74:            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
./project/plugins/phonegap-plugin-barcodescanner/plugin.xml:96:            <uses-permission android:name="android.permission.CAMERA" />
./project/plugins/phonegap-plugin-barcodescanner/plugin.xml:97:            <uses-permission android:name="android.permission.FLASHLIGHT" />
./project/plugins/phonegap-plugin-barcodescanner/src/android/LibraryProject/AndroidManifest.xml:23:  <uses-permission android:name="android.permission.CAMERA"/>
./project/plugins/phonegap-plugin-barcodescanner/src/android/LibraryProject/AndroidManifest.xml:24:  <uses-permission android:name="android.permission.INTERNET"/>
./project/plugins/phonegap-plugin-barcodescanner/src/android/LibraryProject/AndroidManifest.xml:25:  <uses-permission android:name="android.permission.VIBRATE"/>
./project/plugins/phonegap-plugin-barcodescanner/src/android/LibraryProject/AndroidManifest.xml:26:  <uses-permission android:name="android.permission.FLASHLIGHT"/>
./project/plugins/phonegap-plugin-barcodescanner/src/android/LibraryProject/AndroidManifest.xml:27:  <uses-permission android:name="android.permission.READ_CONTACTS"/>
./project/plugins/phonegap-plugin-barcodescanner/src/android/LibraryProject/AndroidManifest.xml:29:  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
./project/plugins/phonegap-plugin-barcodescanner/src/android/LibraryProject/AndroidManifest.xml:30:  <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
./project/plugins/phonegap-plugin-barcodescanner/src/android/LibraryProject/AndroidManifest.xml:31:  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

matiu avatar Aug 24 '15 13:08 matiu

This is the change at the email-composer plugin: https://github.com/katzer/cordova-plugin-email-composer/commit/41100fa8f2c5e395fe5f39ba2a8ee4357e8d0ce8

from July 20th

matiu avatar Aug 24 '15 14:08 matiu

@XBTdev I knew it was probably a new thing in cordova, but was too lazy to actually look at cordova.

Thanks @matiu, problem solved.

@XBTdev does this answer satisfy you?

It is required by the new e-mail composer plugin that is used by cordova (and since Copay uses cordova, and Copay composes e-mails (in the share button for invite code etc)).

This was added to cordova 3 days after 1.1.2 released of Copay, which is why it is only starting in 1.1.3.

dabura667 avatar Aug 24 '15 14:08 dabura667

Maybe the pluggin works anyway, removing the permissions. We could monkey patch it before bundling the Android version, will try that in the upcoming v1.2

On Mon, Aug 24, 2015 at 11:14 AM, dabura667 [email protected] wrote:

@XBTdev https://github.com/XBTdev I knew it was probably a new thing in cordova, but was too lazy to actually look at cordova.

Thanks @matiu https://github.com/matiu, problem solved.

@XBTdev https://github.com/XBTdev does this answer satisfy you?

It is required by the new e-mail composer plugin that is used by cordova (and since Copay uses cordova, and Copay composes e-mails (in the share button for invite code etc)).

This was added to cordova 3 days after 1.1.2 released of Copay, which is why it is only starting in 1.1.3.

— Reply to this email directly or view it on GitHub https://github.com/bitpay/copay/issues/3114#issuecomment-134219872.

Matías Alejo Garcia @ematiu Roads? Where we're going, we don't need roads!

matiu avatar Aug 24 '15 14:08 matiu

monkey patch it

So build > manually change permissions from built app > check to see if it breaks?

lol, if that works then awesome.

dabura667 avatar Aug 24 '15 14:08 dabura667

Wait, lol.

So I just checked the plugin, and the ONLY place the accounts are used is a function to check whether you have an e-mail app installed or not.

Worst case scenario is that someone doesn't have e-mail and Copay explodes into a supernova... (aka it will never happen :-P)

I think monkey patching it will work well.

dabura667 avatar Aug 24 '15 14:08 dabura667

It would be:

  • make android-prod
  • edit plugin.xml and remove get_accounts
  • test composer (i would think it just wont pull the contact's emails for autocompletion)
  • ship it if it works

On Mon, Aug 24, 2015 at 11:18 AM, dabura667 [email protected] wrote:

monkey patch it

So build > manually change permissions from built app > check to see if it breaks?

lol, if that works then awesome.

— Reply to this email directly or view it on GitHub https://github.com/bitpay/copay/issues/3114#issuecomment-134221438.

Matías Alejo Garcia @ematiu Roads? Where we're going, we don't need roads!

matiu avatar Aug 24 '15 14:08 matiu

thanks for looking into this guys.

I read that upcoming android M will let the user selectively disable perms and apps will just have to deal with it. I can't wait for that.

dan-da avatar Aug 24 '15 16:08 dan-da

Yes, I'm running Android M. Would love to see copay start using the new permissions api. :)

xbtdev avatar Aug 25 '15 09:08 xbtdev