Added proguard rules for Alfred

This commit is contained in:
Girish Suragani
2023-09-16 13:30:40 +05:30
parent a3a5fa0203
commit 6cb5042f2f
4 changed files with 24 additions and 5 deletions

View File

@@ -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"))

View File

@@ -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.** {*;}
-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 { *; }

View File

@@ -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

View File

@@ -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);