From b600d89ccfacd191f6808e386199c1c886d210f2 Mon Sep 17 00:00:00 2001 From: Matteo Filippi Date: Tue, 30 Nov 2021 17:53:03 +0100 Subject: [PATCH 1/4] android 12 fix --- plugin.xml | 4 ++-- src/android/nl/xservices/plugins/SocialSharing.java | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plugin.xml b/plugin.xml index 3d433d25..aa98af4c 100755 --- a/plugin.xml +++ b/plugin.xml @@ -2,7 +2,7 @@ + version="6.0.4"> SocialSharing @@ -72,7 +72,7 @@ - + diff --git a/src/android/nl/xservices/plugins/SocialSharing.java b/src/android/nl/xservices/plugins/SocialSharing.java index e60340ef..390aef44 100644 --- a/src/android/nl/xservices/plugins/SocialSharing.java +++ b/src/android/nl/xservices/plugins/SocialSharing.java @@ -271,8 +271,7 @@ public void run() { final boolean hasMultipleAttachments = files.length() > 1; final Intent sendIntent = new Intent(hasMultipleAttachments ? Intent.ACTION_SEND_MULTIPLE : Intent.ACTION_SEND); final Intent receiverIntent = new Intent(cordova.getActivity().getApplicationContext(), ShareChooserPendingIntent.class); - final PendingIntent pendingIntent = PendingIntent.getBroadcast(cordova.getActivity().getApplicationContext(), 0, receiverIntent, PendingIntent.FLAG_UPDATE_CURRENT); - sendIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); +final PendingIntent pendingIntent = PendingIntent.getBroadcast(cordova.getActivity().getApplicationContext(), 0, receiverIntent, PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_IMMUTABLE); sendIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); try { if (files.length() > 0 && !"".equals(files.getString(0))) { From 4d310a378144d697ee22a384743be3cd9e32cfb6 Mon Sep 17 00:00:00 2001 From: FilippiMatteo <58559797+FilippiMatteo@users.noreply.github.com> Date: Mon, 10 Jan 2022 10:57:58 +0000 Subject: [PATCH 2/4] Update plugin.xml Co-authored-by: Jerome Vouillon --- plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.xml b/plugin.xml index aa98af4c..b688ed39 100755 --- a/plugin.xml +++ b/plugin.xml @@ -72,7 +72,7 @@ - + From 0c879e20049f64735b61a6bc5ffe028580a5e38d Mon Sep 17 00:00:00 2001 From: Matteo Filippi Date: Mon, 10 Jan 2022 12:01:25 +0100 Subject: [PATCH 3/4] fix android exported=true --- plugin.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.xml b/plugin.xml index aa98af4c..b688ed39 100755 --- a/plugin.xml +++ b/plugin.xml @@ -72,7 +72,7 @@ - + From 5e9d58e035f74768bb70dba492a84d97ce27711e Mon Sep 17 00:00:00 2001 From: Matteo Filippi Date: Mon, 10 Jan 2022 12:07:52 +0100 Subject: [PATCH 4/4] indend lines --- src/android/nl/xservices/plugins/SocialSharing.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/android/nl/xservices/plugins/SocialSharing.java b/src/android/nl/xservices/plugins/SocialSharing.java index 390aef44..a722bc60 100644 --- a/src/android/nl/xservices/plugins/SocialSharing.java +++ b/src/android/nl/xservices/plugins/SocialSharing.java @@ -271,7 +271,8 @@ public void run() { final boolean hasMultipleAttachments = files.length() > 1; final Intent sendIntent = new Intent(hasMultipleAttachments ? Intent.ACTION_SEND_MULTIPLE : Intent.ACTION_SEND); final Intent receiverIntent = new Intent(cordova.getActivity().getApplicationContext(), ShareChooserPendingIntent.class); -final PendingIntent pendingIntent = PendingIntent.getBroadcast(cordova.getActivity().getApplicationContext(), 0, receiverIntent, PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_IMMUTABLE); sendIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); + final PendingIntent pendingIntent = PendingIntent.getBroadcast(cordova.getActivity().getApplicationContext(), 0, receiverIntent, PendingIntent.FLAG_UPDATE_CURRENT|PendingIntent.FLAG_IMMUTABLE); + sendIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET); try { if (files.length() > 0 && !"".equals(files.getString(0))) {