From 148ef4732b69cbef06c2e3cb6c0423a8f69c1109 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 2 Nov 2021 11:22:59 +0500 Subject: [PATCH 01/12] add proguard rules --- apps/mobile/android/app/proguard-rules.pro | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/mobile/android/app/proguard-rules.pro b/apps/mobile/android/app/proguard-rules.pro index 091103133..e25229466 100644 --- a/apps/mobile/android/app/proguard-rules.pro +++ b/apps/mobile/android/app/proguard-rules.pro @@ -43,4 +43,6 @@ -dontwarn java.awt.* -keep class com.sun.jna.* { *; } +-keep class net.jpountz.** { *; } +-keep class com.goterl.** { *; } -keepclassmembers class * extends com.sun.jna.* { public *; } \ No newline at end of file From 95fa4e5b6f80f619da7b147f471774f479452216 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 2 Nov 2021 11:23:12 +0500 Subject: [PATCH 02/12] fix share extension crash on android --- apps/mobile/share/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/mobile/share/index.js b/apps/mobile/share/index.js index 8450f3fd7..e50e3f979 100644 --- a/apps/mobile/share/index.js +++ b/apps/mobile/share/index.js @@ -17,7 +17,6 @@ import { View } from 'react-native'; import Animated, { - color, Easing, timing, useValue @@ -34,7 +33,6 @@ import { } from '../src/services/EventManager'; import {getElevation} from '../src/utils'; import {db} from '../src/utils/database'; -import {SIZE} from '../src/utils/SizeUtils'; import Storage from '../src/utils/storage'; import {sleep} from '../src/utils/TimeUtils'; import {Search} from './search'; @@ -425,7 +423,7 @@ const NotesnookShare = ({quicknote = false}) => { Quick note From 4c891a5a91cdd537e3483764561c1f5d5264bcb8 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 2 Nov 2021 11:31:14 +0500 Subject: [PATCH 03/12] fix file upload bug --- apps/mobile/src/utils/filesystem.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/mobile/src/utils/filesystem.js b/apps/mobile/src/utils/filesystem.js index 3738bfe37..d3197af7c 100644 --- a/apps/mobile/src/utils/filesystem.js +++ b/apps/mobile/src/utils/filesystem.js @@ -70,6 +70,7 @@ async function uploadFile(filename, {url, headers}, cancelToken) { }); const uploadUrl = await res.text(); console.log(uploadUrl); + console.log(uploadUrl); let request = RNFetchBlob.config({ IOSBackgroundTask: true }) @@ -100,7 +101,7 @@ async function uploadFile(filename, {url, headers}, cancelToken) { } } - return attachment; + return result; } catch (e) { useAttachmentStore.getState().remove(filename); console.log('upload file: ', e, url, headers); @@ -114,9 +115,10 @@ async function downloadFile(filename, {url, headers}, cancelToken) { let path = `${cacheDir}/${filename}`; let exists = await RNFetchBlob.fs.exists(path); if (exists) { + console.log("file is downloaded"); return true; } - + console.log('downloading again') let res = await fetch(url, { method: 'GET', headers From 62f1d6cd8f19a1583db18dc058d2bb508d04fa7b Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 2 Nov 2021 11:32:07 +0500 Subject: [PATCH 04/12] check if attachment was found --- apps/mobile/src/utils/filesystem.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/mobile/src/utils/filesystem.js b/apps/mobile/src/utils/filesystem.js index d3197af7c..4f24f5dad 100644 --- a/apps/mobile/src/utils/filesystem.js +++ b/apps/mobile/src/utils/filesystem.js @@ -96,6 +96,7 @@ async function uploadFile(filename, {url, headers}, cancelToken) { useAttachmentStore.getState().remove(filename); if (result) { let attachment = db.attachments.attachment(filename); + if (!attachment) return result; if (!attachment.metadata.type.startsWith('image/')) { RNFetchBlob.fs.unlink(`${cacheDir}/${filename}`).catch(console.log); } From 92daa3c5bb11a3293c008896ae5a1e97547d32b7 Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 2 Nov 2021 11:48:28 +0500 Subject: [PATCH 05/12] allow copying debug data if content is null --- .../src/components/ActionSheetComponent/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js index b99bc173e..df402679f 100644 --- a/apps/mobile/src/components/ActionSheetComponent/index.js +++ b/apps/mobile/src/components/ActionSheetComponent/index.js @@ -977,21 +977,25 @@ export const ActionSheetComponent = ({ style={{ width: '100%', paddingHorizontal: 12, - marginTop: 10 + marginTop: 10, }}>