diff --git a/android/app/build.gradle b/android/app/build.gradle index f9613a4f..7b9568f5 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -306,7 +306,7 @@ dependencies { implementation "com.github.anrwatchdog:anrwatchdog:1.4.0" - implementation 'com.navi.medici:alfred:navi_v1.0.0-20230915.101204-28' + implementation 'com.navi.medici:alfred:navi_v1.0.0-20230915.154049-35' implementation(platform("com.google.firebase:firebase-bom:32.2.3")) diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index 65353ce6..e67ec080 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -8,4 +8,10 @@ # http://developer.android.com/guide/developing/tools/proguard.html # Add any project specific keep options here: --keep public class com.horcrux.svg.** {*;} \ No newline at end of file +-keep public class com.horcrux.svg.** {*;} + +#Alfred specific classes +-keep class com.navi.alfred.model.** { *; } +-keep class com.navi.alfred.network.model.** { *; } +-keep class com.navi.alfred.db.** { *; } +-keep class com.navi.alfred.AlfredConfig { *; } \ No newline at end of file diff --git a/android/app/src/main/java/com/avapp/DeviceUtilsModule.java b/android/app/src/main/java/com/avapp/DeviceUtilsModule.java index 43870b0a..a14a6222 100644 --- a/android/app/src/main/java/com/avapp/DeviceUtilsModule.java +++ b/android/app/src/main/java/com/avapp/DeviceUtilsModule.java @@ -18,6 +18,8 @@ import com.facebook.react.bridge.ReadableMap; import com.navi.alfred.AlfredManager; import android.content.pm.PackageInfo; +import android.os.Handler; +import android.os.Looper; import android.util.Log; import org.json.JSONArray; @@ -108,9 +110,18 @@ public class DeviceUtilsModule extends ReactContextBaseJavaModule implements Act } @ReactMethod public void handleANR() { - while (true){ - Log.d("Alfred", "handleANR"); - } + simulateANR(); + } + + public void simulateANR() { + Handler mainHandler = new Handler(Looper.getMainLooper()); + mainHandler.postDelayed(() -> { + try { + Thread.sleep(10000); // Sleep for 10 seconds + } catch (InterruptedException e) { + e.printStackTrace(); + } + }, 1000); // Delay the ANR simulation by 1 second } @ReactMethod diff --git a/src/components/utlis/DeviceUtils.ts b/src/components/utlis/DeviceUtils.ts index 82325814..1cd7bbeb 100644 --- a/src/components/utlis/DeviceUtils.ts +++ b/src/components/utlis/DeviceUtils.ts @@ -22,3 +22,5 @@ export const alfredSetPhoneNumber = (phoneNumber: string) => export const alfredSetCodePushVersion = (codePushVersion: string) => DeviceUtilsModule.setCodePushVersion(codePushVersion); + +export const alfredSetUserId = (userId: string) => DeviceUtilsModule.setUserId(userId);