From 5246617c697e38ece5dad957163f5798cb8affdd Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Thu, 2 Sep 2021 15:24:09 +0300 Subject: [PATCH] target SDK 30 support scoped storage from Android 10 better permission handling on iOS 14 Signed-off-by: Michele Balistreri --- android/app/build.gradle | 6 +- android/app/src/main/AndroidManifest.xml | 8 +- android/gradle.properties | 6 +- .../status/ethereum/module/StatusModule.java | 3 +- .../ios/RCTStatus/RCTStatus.m | 2 +- nix/deps/gradle/deps.json | 704 +++++++++--------- nix/deps/gradle/deps.list | 72 +- nix/deps/gradle/deps.urls | 126 ++-- nix/pkgs/aapt2/default.nix | 12 +- nix/pkgs/android-sdk/compose.nix | 2 +- nix/pkgs/go-maven-resolver/default.nix | 2 +- package.json | 6 +- src/status_im/chat/models/images.cljs | 4 +- src/status_im/ui/components/permissions.cljs | 3 +- .../ui/screens/status/new/views.cljs | 3 +- src/status_im/utils/logging/core.cljs | 14 +- yarn.lock | 21 +- 17 files changed, 480 insertions(+), 514 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index f1e5ae0dde..95ccbe25ec 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -348,8 +348,8 @@ dependencies { implementation project(':react-native-status') implementation project(':react-native-status-keycard') implementation 'com.github.status-im:function:0.0.1' - implementation 'com.facebook.fresco:fresco:2.0.0' - implementation 'com.facebook.fresco:animated-gif:2.0.0' + implementation 'com.facebook.fresco:fresco:2.2.0' + implementation 'com.facebook.fresco:animated-gif:2.2.0' } def getLocalNDKDir = { -> @@ -371,7 +371,7 @@ task hemroidBuild(type: Exec) { def localNdkDir = getLocalNDKDir() def ndkDir = System.env.ANDROID_NDK_ROOT if (localNdkDir != null) { - ndkDir = localNdkDir + ndkDir = localNdkDir } def execPath = "$ndkDir/ndk-build" diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 33ae65cbfa..7728f9a98f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -17,14 +17,13 @@ - + - - + android:usesCleartextTraffic="true"> (.saveToCameraRoll CameraRoll base64-uri) + (-> (.save CameraRoll base64-uri) (.catch #(utils/show-popup (i18n/label :t/error) (i18n/label :t/external-storage-denied)))) (permissions/request-permissions diff --git a/src/status_im/ui/components/permissions.cljs b/src/status_im/ui/components/permissions.cljs index 61fdd07c99..26a3612b1a 100644 --- a/src/status_im/ui/components/permissions.cljs +++ b/src/status_im/ui/components/permissions.cljs @@ -6,8 +6,7 @@ {:read-external-storage (cond platform/android? (.-READ_EXTERNAL_STORAGE (.-ANDROID PERMISSIONS))) :write-external-storage (cond - platform/android? (.-WRITE_EXTERNAL_STORAGE (.-ANDROID PERMISSIONS)) - platform/ios? (.-PHOTO_LIBRARY (.-IOS PERMISSIONS))) + platform/low-device? (.-WRITE_EXTERNAL_STORAGE (.-ANDROID PERMISSIONS))) :camera (cond platform/android? (.-CAMERA (.-ANDROID PERMISSIONS)) platform/ios? (.-CAMERA (.-IOS PERMISSIONS))) diff --git a/src/status_im/ui/screens/status/new/views.cljs b/src/status_im/ui/screens/status/new/views.cljs index 2f98dfa29e..9af2cb31f7 100644 --- a/src/status_im/ui/screens/status/new/views.cljs +++ b/src/status_im/ui/screens/status/new/views.cljs @@ -41,8 +41,7 @@ [buttons] (for [img camera-roll-photos] ^{:key (str "image" img)} - (when img - [image-preview img]))]])) + [image-preview img])]])) (def message-max-lenght 300) diff --git a/src/status_im/utils/logging/core.cljs b/src/status_im/utils/logging/core.cljs index 9fcaaa9bd8..3a50ca65b3 100644 --- a/src/status_im/utils/logging/core.cljs +++ b/src/status_im/utils/logging/core.cljs @@ -153,17 +153,17 @@ (fx/defn send-email-event {:events [::send-email]} - [{:keys [db] :as cofx} archive-path] + [{:keys [db] :as cofx} archive-uri] (fx/merge cofx (dialog-closed) (send-email - {:subject "Error report" - :recipients [report-email] - :body (email-body db) - :attachment {:path archive-path - :type "zip" - :name "status_logs.zip"}} + {:subject "Error report" + :recipients [report-email] + :body (email-body db) + :attachments [{:uri archive-uri + :type "zip" + :name "status_logs.zip"}]} (fn [event] (when (= event "not_available") (re-frame/dispatch [:show-client-error])))))) diff --git a/yarn.lock b/yarn.lock index 8e4f0796c6..2ed8c81c11 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1246,10 +1246,9 @@ eventemitter3 "^1.2.0" lodash "^4.17.15" -"@react-native-community/cameraroll@^1.6.1": - version "1.6.2" - resolved "https://registry.yarnpkg.com/@react-native-community/cameraroll/-/cameraroll-1.6.2.tgz#a4dedcf8ba7bc938f805dd07dd43a275edb1f411" - integrity sha512-5R/2Tpi7APoNBDmRV23OcRIN9YiaRMJAHrXkGDpj7jVo2yQpJCCrARnZ9qhJ9dYEMybdP/XhXI1vVjuad5xqNQ== +"@react-native-community/cameraroll@git+https://github.com/status-im/react-native-cameraroll.git#v4.0.4-status.0": + version "4.0.4" + resolved "git+https://github.com/status-im/react-native-cameraroll.git#337c5a515e9b0f0728882f73568075553415f523" "@react-native-community/cli-debugger-ui@^4.13.1": version "4.13.1" @@ -6647,10 +6646,9 @@ react-native-haptic-feedback@^1.9.0: resolved "https://registry.yarnpkg.com/react-native-haptic-feedback/-/react-native-haptic-feedback-1.9.0.tgz#7d62c54536f04dd5d8f1c2bb8ee444009f2294b9" integrity sha512-tIRbq8k7HK9AoyvXrOHUEFmJd65ZAh1HP9mDyD/gDisG1ApY4Im9UKn0q0of9z7s8AJY3sZA9GMuSKdSBGdKKQ== -react-native-image-crop-picker@^0.31.1: - version "0.31.1" - resolved "https://registry.yarnpkg.com/react-native-image-crop-picker/-/react-native-image-crop-picker-0.31.1.tgz#b56248a9e31d62f1c6e7c2f85d296869c32af4cd" - integrity sha512-I5z7DcTKYYASevIalkqKdiw9Fe4CVCKPVMMkLGDVGUYgZZWlbOS9G1+oNWtWwoB5S9e931GkDrZ/HL5UhADG/Q== +"react-native-image-crop-picker@git+https://github.com/status-im/react-native-image-crop-picker.git#v0.36.2-status.0": + version "0.36.2" + resolved "git+https://github.com/status-im/react-native-image-crop-picker.git#d14a68dcb643328b91e783d3a83561e7d6e0bd25" react-native-image-resizer@^1.2.3: version "1.2.3" @@ -6675,9 +6673,10 @@ react-native-linear-gradient@^2.5.6: resolved "https://registry.yarnpkg.com/react-native-linear-gradient/-/react-native-linear-gradient-2.5.6.tgz#96215cbc5ec7a01247a20890888aa75b834d44a0" integrity sha512-HDwEaXcQIuXXCV70O+bK1rizFong3wj+5Q/jSyifKFLg0VWF95xh8XQgfzXwtq0NggL9vNjPKXa016KuFu+VFg== -"react-native-mail@git+https://github.com/status-im/react-native-mail.git#v4.0.0-status": - version "4.0.0" - resolved "git+https://github.com/status-im/react-native-mail.git#a5ff17c3e394b5545549fed33883afe4496f127a" +react-native-mail@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/react-native-mail/-/react-native-mail-6.1.1.tgz#f1b1f8034c84d2510a93e4a2a795f0db5a13595e" + integrity sha512-pTs180wwyh7hN/iyTC9SfOX579U4YhDlHOLxi47IGvhPJENqO/QFdBq+wWKxyhNqdQuVSy+LoeIxLreWnIeYmg== react-native-navigation@^7.13.0: version "7.13.0"