Panagiotis Triantafyllou

android 13 support

1 apply plugin: 'com.android.application' 1 apply plugin: 'com.android.application'
2 2
3 android { 3 android {
4 - compileSdkVersion 31 4 + compileSdkVersion 33
5 - buildToolsVersion "31.0.0" 5 + buildToolsVersion "33.0.2"
6 6
7 defaultConfig { 7 defaultConfig {
8 applicationId "warp.ly.android_sdk" 8 applicationId "warp.ly.android_sdk"
9 minSdkVersion 23 9 minSdkVersion 23
10 - targetSdkVersion 31 10 + targetSdkVersion 33
11 versionCode 100 11 versionCode 100
12 versionName "1.0.0" 12 versionName "1.0.0"
13 } 13 }
...@@ -46,8 +46,8 @@ dependencies { ...@@ -46,8 +46,8 @@ dependencies {
46 implementation project(':warply_android_sdk') 46 implementation project(':warply_android_sdk')
47 47
48 //Support 48 //Support
49 - implementation 'androidx.appcompat:appcompat:1.4.1' 49 + implementation 'androidx.appcompat:appcompat:1.6.1'
50 - implementation 'androidx.recyclerview:recyclerview:1.2.1' 50 + implementation 'androidx.recyclerview:recyclerview:1.3.0'
51 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0' 51 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
52 52
53 implementation 'org.altbeacon:android-beacon-library:2.19.3' 53 implementation 'org.altbeacon:android-beacon-library:2.19.3'
......
1 # {@link ly.warp.sdk.utils.WarplyProperty} 1 # {@link ly.warp.sdk.utils.WarplyProperty}
2 2
3 # The app uuid the warply sdk need to connect to the engage server 3 # The app uuid the warply sdk need to connect to the engage server
4 -Uuid= 4 +Uuid=b13ade8ef743468b89a7aaa8efbfc468
5 5
6 # If we need to see logs in Logcat 6 # If we need to see logs in Logcat
7 Debug=false 7 Debug=false
......
...@@ -79,7 +79,6 @@ public class SplashActivity extends BaseActivity { ...@@ -79,7 +79,6 @@ public class SplashActivity extends BaseActivity {
79 runOnUiThread(new Runnable() { 79 runOnUiThread(new Runnable() {
80 public void run() { 80 public void run() {
81 if (!isFinishing()) { 81 if (!isFinishing()) {
82 - Warply.registerGCM(SENDER_ID);
83 startActivity(new Intent(SplashActivity.this, 82 startActivity(new Intent(SplashActivity.this,
84 MainActivity.class)); 83 MainActivity.class));
85 finish(); 84 finish();
......
...@@ -9,8 +9,8 @@ buildscript { ...@@ -9,8 +9,8 @@ buildscript {
9 } 9 }
10 dependencies { 10 dependencies {
11 classpath 'com.android.tools.build:gradle:7.0.4' 11 classpath 'com.android.tools.build:gradle:7.0.4'
12 - classpath 'com.google.gms:google-services:4.3.10' 12 + classpath 'com.google.gms:google-services:4.3.15'
13 - classpath 'com.huawei.agconnect:agcp:1.6.2.300' 13 + classpath 'com.huawei.agconnect:agcp:1.7.2.300'
14 classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' 14 classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
15 15
16 // NOTE: Do not place your application dependencies here; they belong 16 // NOTE: Do not place your application dependencies here; they belong
......
...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
2 2
3 ext { 3 ext {
4 PUBLISH_GROUP_ID = 'ly.warp' 4 PUBLISH_GROUP_ID = 'ly.warp'
5 - PUBLISH_VERSION = '4.5.4.6' 5 + PUBLISH_VERSION = '4.5.5.0'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
...@@ -10,18 +10,30 @@ apply from: "${rootProject.projectDir}/scripts/publish-module.gradle" ...@@ -10,18 +10,30 @@ apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
10 10
11 android { 11 android {
12 12
13 - compileSdkVersion 31 13 + compileSdkVersion 33
14 - buildToolsVersion "31.0.0" 14 + buildToolsVersion "33.0.2"
15 15
16 defaultConfig { 16 defaultConfig {
17 minSdkVersion 23 17 minSdkVersion 23
18 - targetSdkVersion 31 18 + targetSdkVersion 33
19 consumerProguardFiles 'proguard-rules.pro' 19 consumerProguardFiles 'proguard-rules.pro'
20 } 20 }
21 + splits {
22 + abi {
23 + reset()
24 + enable false
25 + universalApk false // If true, also generate a universal APK
26 + include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
27 + }
28 + }
21 lintOptions { 29 lintOptions {
22 abortOnError false 30 abortOnError false
23 } 31 }
24 - 32 + sourceSets {
33 + main {
34 + jniLibs.srcDirs = ['src/main/jniLibs']
35 + }
36 + }
25 buildTypes { 37 buildTypes {
26 release { 38 release {
27 minifyEnabled false 39 minifyEnabled false
...@@ -34,38 +46,38 @@ android { ...@@ -34,38 +46,38 @@ android {
34 46
35 dependencies { 47 dependencies {
36 //------------------------------ Support -----------------------------// 48 //------------------------------ Support -----------------------------//
37 - api 'androidx.appcompat:appcompat:1.4.1' 49 + api 'androidx.appcompat:appcompat:1.6.1'
38 - api 'androidx.recyclerview:recyclerview:1.2.1' 50 + api 'androidx.recyclerview:recyclerview:1.3.0'
39 api 'androidx.cardview:cardview:1.0.0' 51 api 'androidx.cardview:cardview:1.0.0'
40 - api "androidx.security:security-crypto:1.1.0-alpha03" // For minSDK 23 use 1.0.0, for minSDK 21 use 1.1.0 that is currently in alpha 52 + api 'androidx.security:security-crypto:1.1.0-alpha06' // For minSDK 23 use 1.0.0, for minSDK 21 use 1.1.0 that is currently in alpha
41 api 'org.altbeacon:android-beacon-library:2.19.3' 53 api 'org.altbeacon:android-beacon-library:2.19.3'
42 api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2' 54 api 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
43 api "commons-logging:commons-logging:1.2" 55 api "commons-logging:commons-logging:1.2"
44 56
45 //------------------------------ Firebase -----------------------------// 57 //------------------------------ Firebase -----------------------------//
46 - api platform('com.google.firebase:firebase-bom:29.0.3') 58 + api platform('com.google.firebase:firebase-bom:32.0.0')
47 api 'com.google.firebase:firebase-messaging' 59 api 'com.google.firebase:firebase-messaging'
48 60
49 //------------------------------ GMS -----------------------------// 61 //------------------------------ GMS -----------------------------//
50 - api 'com.google.android.gms:play-services-base:18.0.1' 62 + api 'com.google.android.gms:play-services-base:18.2.0'
51 - api 'com.google.android.gms:play-services-location:19.0.1' 63 + api 'com.google.android.gms:play-services-location:21.0.1'
52 64
53 //------------------------------ Work Manager -----------------------------// 65 //------------------------------ Work Manager -----------------------------//
54 - api 'androidx.work:work-runtime:2.7.1' 66 + api 'androidx.work:work-runtime:2.8.1'
55 67
56 //------------------------------ Glide -----------------------------// 68 //------------------------------ Glide -----------------------------//
57 api 'com.github.bumptech.glide:glide:4.12.0' 69 api 'com.github.bumptech.glide:glide:4.12.0'
58 annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0' 70 annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
59 71
60 //------------------------------ Huawei -----------------------------// 72 //------------------------------ Huawei -----------------------------//
61 - api 'com.huawei.agconnect:agconnect-core:1.7.2.300' 73 + api 'com.huawei.agconnect:agconnect-core:1.9.0.300'
62 - api 'com.huawei.hms:base:6.6.0.300' 74 + api 'com.huawei.hms:base:6.9.0.300'
63 - api 'com.huawei.hms:push:6.7.0.300' 75 + api 'com.huawei.hms:push:6.10.0.300'
64 - api 'com.huawei.hms:ads-identifier:3.4.56.300' 76 + api 'com.huawei.hms:ads-identifier:3.4.62.300'
65 77
66 //------------------------------ SQLCipher -----------------------------// 78 //------------------------------ SQLCipher -----------------------------//
67 - api "net.zetetic:android-database-sqlcipher:4.5.0" 79 + api 'net.zetetic:android-database-sqlcipher:4.5.2'
68 - api "androidx.sqlite:sqlite:2.2.0" 80 + api 'androidx.sqlite:sqlite:2.3.1'
69 } 81 }
70 82
71 // In every export please update the version number 83 // In every export please update the version number
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
11 <uses-permission 11 <uses-permission
12 android:name="android.permission.REQUEST_INSTALL_PACKAGES" 12 android:name="android.permission.REQUEST_INSTALL_PACKAGES"
13 tools:node="remove" /> 13 tools:node="remove" />
14 + <uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
14 15
15 <application> 16 <application>
16 <!-- For Huawei Push --> 17 <!-- For Huawei Push -->
......
...@@ -158,7 +158,7 @@ public class WarpViewActivity extends WarpBaseActivity { ...@@ -158,7 +158,7 @@ public class WarpViewActivity extends WarpBaseActivity {
158 } 158 }
159 } 159 }
160 }); 160 });
161 - root.addView(progressBar, progressBarParams); 161 +// root.addView(progressBar, progressBarParams);
162 setContentView(root); 162 setContentView(root);
163 } 163 }
164 164
......
...@@ -103,6 +103,7 @@ public class HurlStack implements HttpStack { ...@@ -103,6 +103,7 @@ public class HurlStack implements HttpStack {
103 } 103 }
104 URL parsedUrl = new URL(url); 104 URL parsedUrl = new URL(url);
105 HttpURLConnection connection = openConnection(parsedUrl, request); 105 HttpURLConnection connection = openConnection(parsedUrl, request);
106 + connection.setInstanceFollowRedirects(false);
106 for (String headerName : map.keySet()) { 107 for (String headerName : map.keySet()) {
107 connection.addRequestProperty(headerName, map.get(headerName)); 108 connection.addRequestProperty(headerName, map.get(headerName));
108 } 109 }
......
...@@ -5,6 +5,7 @@ import android.content.Context; ...@@ -5,6 +5,7 @@ import android.content.Context;
5 import android.content.pm.PackageManager; 5 import android.content.pm.PackageManager;
6 import android.os.Handler; 6 import android.os.Handler;
7 import android.os.HandlerThread; 7 import android.os.HandlerThread;
8 +
8 import androidx.annotation.NonNull; 9 import androidx.annotation.NonNull;
9 import androidx.annotation.Nullable; 10 import androidx.annotation.Nullable;
10 import androidx.core.content.ContextCompat; 11 import androidx.core.content.ContextCompat;
...@@ -26,15 +27,16 @@ import ly.warp.sdk.dexter.listener.multi.MultiplePermissionsListener; ...@@ -26,15 +27,16 @@ import ly.warp.sdk.dexter.listener.multi.MultiplePermissionsListener;
26 /** 27 /**
27 * Created by Antonis Moustakos on 3/28/2017. 28 * Created by Antonis Moustakos on 3/28/2017.
28 */ 29 */
29 -public class PermissionsUtil{ 30 +public class PermissionsUtil {
30 // =========================================================== 31 // ===========================================================
31 // Constants 32 // Constants
32 // =========================================================== 33 // ===========================================================
33 private static final int SLEEP_TIME = 5000; 34 private static final int SLEEP_TIME = 5000;
34 public static final String PERMISSION_LOCATION_FINE = android.Manifest.permission.ACCESS_FINE_LOCATION, 35 public static final String PERMISSION_LOCATION_FINE = android.Manifest.permission.ACCESS_FINE_LOCATION,
35 - PERMISSION_LOCATION_COARSE = android.Manifest.permission.ACCESS_COARSE_LOCATION, 36 + PERMISSION_LOCATION_COARSE = android.Manifest.permission.ACCESS_COARSE_LOCATION,
36 - PERMISSION_PHONE_STATE = Manifest.permission.READ_PHONE_STATE, 37 + PERMISSION_PHONE_STATE = Manifest.permission.READ_PHONE_STATE,
37 - SAFE_PERMISSION_BLUETOOTH = Manifest.permission.BLUETOOTH; 38 + PERMISSION_POST_NOTIFICATIONS = Manifest.permission.POST_NOTIFICATIONS,
39 + SAFE_PERMISSION_BLUETOOTH = Manifest.permission.BLUETOOTH;
38 // PERMISSION_WRITE_EXTERNAL = Manifest.permission.WRITE_EXTERNAL_STORAGE; 40 // PERMISSION_WRITE_EXTERNAL = Manifest.permission.WRITE_EXTERNAL_STORAGE;
39 41
40 private static final String[] DANGEROUS_PERMISSIONS = { 42 private static final String[] DANGEROUS_PERMISSIONS = {
...@@ -42,6 +44,7 @@ public class PermissionsUtil{ ...@@ -42,6 +44,7 @@ public class PermissionsUtil{
42 // PERMISSION_LOCATION_COARSE, 44 // PERMISSION_LOCATION_COARSE,
43 // PERMISSION_PHONE_STATE, 45 // PERMISSION_PHONE_STATE,
44 // PERMISSION_WRITE_EXTERNAL 46 // PERMISSION_WRITE_EXTERNAL
47 + PERMISSION_POST_NOTIFICATIONS
45 }; 48 };
46 49
47 // =========================================================== 50 // ===========================================================
...@@ -64,7 +67,7 @@ public class PermissionsUtil{ ...@@ -64,7 +67,7 @@ public class PermissionsUtil{
64 this.context = new WeakReference<>(context); 67 this.context = new WeakReference<>(context);
65 this.callback = callback; 68 this.callback = callback;
66 this.requestedPerms = requestedPerms; 69 this.requestedPerms = requestedPerms;
67 - if(this.requestedPerms == null) 70 + if (this.requestedPerms == null)
68 this.requestedPerms = DANGEROUS_PERMISSIONS; 71 this.requestedPerms = DANGEROUS_PERMISSIONS;
69 72
70 HandlerThread mHandlerThread = new HandlerThread("PermissionsUtil"); 73 HandlerThread mHandlerThread = new HandlerThread("PermissionsUtil");
...@@ -75,60 +78,68 @@ public class PermissionsUtil{ ...@@ -75,60 +78,68 @@ public class PermissionsUtil{
75 // =========================================================== 78 // ===========================================================
76 // Methods 79 // Methods
77 // =========================================================== 80 // ===========================================================
78 - public boolean requestNeeded(){ 81 + public boolean requestNeeded() {
79 - for(String p : requestedPerms) 82 + for (String p : requestedPerms)
80 - if(!hasPermission(context.get(), p)) 83 + if (!hasPermission(context.get(), p))
81 return true; 84 return true;
82 return false; 85 return false;
83 } 86 }
84 - public static boolean hasPermission(Context con, String permission){ 87 +
88 + public static boolean hasPermission(Context con, String permission) {
85 return ContextCompat.checkSelfPermission(con, permission) == PackageManager.PERMISSION_GRANTED; 89 return ContextCompat.checkSelfPermission(con, permission) == PackageManager.PERMISSION_GRANTED;
86 } 90 }
87 - public void requestPermissions(){ 91 +
92 + public void requestPermissions() {
88 final DexterBuilder builder = 93 final DexterBuilder builder =
89 - Dexter.withContext(context.get()) 94 + Dexter.withContext(context.get())
90 - .withPermissions(requestedPerms) 95 + .withPermissions(requestedPerms)
91 - .withListener(new MultiplePermissionsListener() { 96 + .withListener(new MultiplePermissionsListener() {
92 - @Override 97 + @Override
93 - public void onPermissionsChecked(MultiplePermissionsReport report) { 98 + public void onPermissionsChecked(MultiplePermissionsReport report) {
94 - if(callback != null) 99 + if (callback != null)
95 - if(report.areAllPermissionsGranted()) 100 + if (report.areAllPermissionsGranted())
96 - callback.onPermissionsGranted(); 101 + callback.onPermissionsGranted();
97 - else 102 + else
98 - callback.onPermissionDenied(report.getDeniedPermissionResponses()); 103 + callback.onPermissionDenied(report.getDeniedPermissionResponses());
99 - } 104 + }
100 - @Override 105 +
101 - public void onPermissionRationaleShouldBeShown(List<PermissionRequest> permissions, PermissionToken token) { 106 + @Override
102 - //TODO: Rationale can be shown here 107 + public void onPermissionRationaleShouldBeShown(List<PermissionRequest> permissions, PermissionToken token) {
103 - token.continuePermissionRequest(); 108 + //TODO: Rationale can be shown here
104 - } 109 + token.continuePermissionRequest();
105 - }) 110 + }
106 - .withErrorListener(new PermissionRequestErrorListener() { 111 + })
107 - @Override 112 + .withErrorListener(new PermissionRequestErrorListener() {
108 - public void onError(DexterError error) { 113 + @Override
109 - if(callback != null) 114 + public void onError(DexterError error) {
110 - callback.onError(error); 115 + if (callback != null)
111 - } 116 + callback.onError(error);
112 - }) 117 + }
113 - .onSameThread(); 118 + })
119 + .onSameThread();
114 120
115 handler.post( 121 handler.post(
116 - new Runnable() { 122 + new Runnable() {
117 - public void run() { 123 + public void run() {
118 - while(!prefs.isForeground()) 124 + while (!prefs.isForeground())
119 - try {Thread.sleep(SLEEP_TIME);} catch (InterruptedException ignored) {} 125 + try {
120 - builder.check(); 126 + Thread.sleep(SLEEP_TIME);
127 + } catch (InterruptedException ignored) {
128 + }
129 + builder.check();
130 + }
121 } 131 }
122 - }
123 ); 132 );
124 } 133 }
125 134
126 // =========================================================== 135 // ===========================================================
127 // Inner and Anonymous Classes 136 // Inner and Anonymous Classes
128 // =========================================================== 137 // ===========================================================
129 - public interface PermissionCallback{ 138 + public interface PermissionCallback {
130 void onPermissionDenied(List<PermissionDeniedResponse> denied); 139 void onPermissionDenied(List<PermissionDeniedResponse> denied);
140 +
131 void onPermissionsGranted(); 141 void onPermissionsGranted();
142 +
132 void onError(DexterError error); 143 void onError(DexterError error);
133 } 144 }
134 145
......
...@@ -117,7 +117,7 @@ public class WarpView extends WebView { ...@@ -117,7 +117,7 @@ public class WarpView extends WebView {
117 setFadingEdgeLength(0); 117 setFadingEdgeLength(0);
118 118
119 WebSettings settings = getSettings(); 119 WebSettings settings = getSettings();
120 - settings.setAppCacheEnabled(true); 120 + settings.setCacheMode(WebSettings.LOAD_DEFAULT);
121 settings.setJavaScriptEnabled(true); 121 settings.setJavaScriptEnabled(true);
122 settings.setDatabaseEnabled(true); 122 settings.setDatabaseEnabled(true);
123 settings.setDomStorageEnabled(true); 123 settings.setDomStorageEnabled(true);
......