NetMirror.apk
Download file
package com.reactnativecommunity.asyncstorage;
import android.database.Cursor;
import android.os.AsyncTask;
import com.facebook.react.bridge.Arguments;
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.GuardedAsyncTask;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.bridge.ReactMethod;
import com.facebook.react.bridge.ReadableArray;
import com.facebook.react.bridge.WritableArray;
import java.util.HashSet;
import java.util.concurrent.Executor;
import v1.InterfaceC0756a;
/* JADX INFO: loaded from: classes.dex */
@InterfaceC0756a(name = "RNCAsyncStorage")
public final class AsyncStorageModule extends NativeAsyncStorageModuleSpec {
private static final int MAX_SQL_KEYS = 999;
public static final String NAME = "RNCAsyncStorage";
private final l executor;
private k mReactDatabaseSupplier;
private boolean mShuttingDown;
class a extends GuardedAsyncTask {
/* JADX INFO: renamed from: a, reason: collision with root package name */
final /* synthetic */ Callback f8419a;
/* JADX INFO: renamed from: b, reason: collision with root package name */
final /* synthetic */ ReadableArray f8420b;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
a(ReactContext reactContext, Callback callback, ReadableArray readableArray) {
super(reactContext);
this.f8419a = callback;
this.f8420b = readableArray;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // com.facebook.react.bridge.GuardedAsyncTask
/* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
public void doInBackgroundGuarded(Void... voidArr) {
if (!AsyncStorageModule.this.ensureDatabase()) {
this.f8419a.invoke(com.reactnativecommunity.asyncstorage.b.a(null), null);
return;
}
String[] strArr = {"key", "value"};
HashSet<String> hashSet = new HashSet();
WritableArray writableArrayCreateArray = Arguments.createArray();
for (int i3 = 0; i3 < this.f8420b.size(); i3 += AsyncStorageModule.MAX_SQL_KEYS) {
int iMin = Math.min(this.f8420b.size() - i3, AsyncStorageModule.MAX_SQL_KEYS);
Cursor cursorQuery = AsyncStorageModule.this.mReactDatabaseSupplier.y().query("catalystLocalStorage", strArr, com.reactnativecommunity.asyncstorage.a.a(iMin), com.reactnativecommunity.asyncstorage.a.b(this.f8420b, i3, iMin), null, null, null);
hashSet.clear();
try {
try {
if (cursorQuery.getCount() != this.f8420b.size()) {
for (int i4 = i3; i4 < i3 + iMin; i4++) {
hashSet.add(this.f8420b.getString(i4));
}
}
if (cursorQuery.moveToFirst()) {
do {
WritableArray writableArrayCreateArray2 = Arguments.createArray();
writableArrayCreateArray2.pushString(cursorQuery.getString(0));
writableArrayCreateArray2.pushString(cursorQuery.getString(1));
writableArrayCreateArray.pushArray(writableArrayCreateArray2);
hashSet.remove(cursorQuery.getString(0));
} while (cursorQuery.moveToNext());
}
cursorQuery.close();
for (String str : hashSet) {
WritableArray writableArrayCreateArray3 = Arguments.createArray();
writableArrayCreateArray3.pushString(str);
writableArrayCreateArray3.pushNull();
writableArrayCreateArray.pushArray(writableArrayCreateArray3);
}
hashSet.clear();
} catch (Exception e4) {
Y.a.J("ReactNative", e4.getMessage(), e4);
this.f8419a.invoke(com.reactnativecommunity.asyncstorage.b.b(null, e4.getMessage()), null);
cursorQuery.close();
return;
}
} catch (Throwable th) {
cursorQuery.close();
throw th;
}
}
this.f8419a.invoke(null, writableArrayCreateArray);
}
}
class b extends GuardedAsyncTask {
/* JADX INFO: renamed from: a, reason: collision with root package name */
final /* synthetic */ Callback f8422a;
/* JADX INFO: renamed from: b, reason: collision with root package name */
final /* synthetic */ ReadableArray f8423b;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
b(ReactContext reactContext, Callback callback, ReadableArray readableArray) {
super(reactContext);
this.f8422a = callback;
this.f8423b = readableArray;
}
/* JADX INFO: Access modifiers changed from: protected */
/* JADX WARN: Removed duplicated region for block: B:58:0x015b */
/* JADX WARN: Removed duplicated region for block: B:59:0x0165 */
@Override // com.facebook.react.bridge.GuardedAsyncTask
/* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public void doInBackgroundGuarded(java.lang.Void... r8) {
/*
Method dump skipped, instruction units count: 395
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.reactnativecommunity.asyncstorage.AsyncStorageModule.b.doInBackgroundGuarded(java.lang.Void[]):void");
}
}
class c extends GuardedAsyncTask {
/* JADX INFO: renamed from: a, reason: collision with root package name */
final /* synthetic */ Callback f8425a;
/* JADX INFO: renamed from: b, reason: collision with root package name */
final /* synthetic */ ReadableArray f8426b;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
c(ReactContext reactContext, Callback callback, ReadableArray readableArray) {
super(reactContext);
this.f8425a = callback;
this.f8426b = readableArray;
}
/* JADX INFO: Access modifiers changed from: protected */
/* JADX WARN: Removed duplicated region for block: B:28:0x00bd */
/* JADX WARN: Removed duplicated region for block: B:29:0x00c7 */
@Override // com.facebook.react.bridge.GuardedAsyncTask
/* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public void doInBackgroundGuarded(java.lang.Void... r9) {
/*
Method dump skipped, instruction units count: 237
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.reactnativecommunity.asyncstorage.AsyncStorageModule.c.doInBackgroundGuarded(java.lang.Void[]):void");
}
}
class d extends GuardedAsyncTask {
/* JADX INFO: renamed from: a, reason: collision with root package name */
final /* synthetic */ Callback f8428a;
/* JADX INFO: renamed from: b, reason: collision with root package name */
final /* synthetic */ ReadableArray f8429b;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
d(ReactContext reactContext, Callback callback, ReadableArray readableArray) {
super(reactContext);
this.f8428a = callback;
this.f8429b = readableArray;
}
/* JADX INFO: Access modifiers changed from: protected */
/* JADX WARN: Removed duplicated region for block: B:68:0x0173 */
/* JADX WARN: Removed duplicated region for block: B:69:0x017d */
@Override // com.facebook.react.bridge.GuardedAsyncTask
/* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct code enable 'Show inconsistent code' option in preferences
*/
public void doInBackgroundGuarded(java.lang.Void... r8) {
/*
Method dump skipped, instruction units count: 419
To view this dump change 'Code comments level' option to 'DEBUG'
*/
throw new UnsupportedOperationException("Method not decompiled: com.reactnativecommunity.asyncstorage.AsyncStorageModule.d.doInBackgroundGuarded(java.lang.Void[]):void");
}
}
class e extends GuardedAsyncTask {
/* JADX INFO: renamed from: a, reason: collision with root package name */
final /* synthetic */ Callback f8431a;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
e(ReactContext reactContext, Callback callback) {
super(reactContext);
this.f8431a = callback;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // com.facebook.react.bridge.GuardedAsyncTask
/* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
public void doInBackgroundGuarded(Void... voidArr) {
if (!AsyncStorageModule.this.mReactDatabaseSupplier.v()) {
this.f8431a.invoke(com.reactnativecommunity.asyncstorage.b.a(null));
return;
}
try {
AsyncStorageModule.this.mReactDatabaseSupplier.a();
this.f8431a.invoke(new Object[0]);
} catch (Exception e4) {
Y.a.J("ReactNative", e4.getMessage(), e4);
this.f8431a.invoke(com.reactnativecommunity.asyncstorage.b.b(null, e4.getMessage()));
}
}
}
class f extends GuardedAsyncTask {
/* JADX INFO: renamed from: a, reason: collision with root package name */
final /* synthetic */ Callback f8433a;
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
f(ReactContext reactContext, Callback callback) {
super(reactContext);
this.f8433a = callback;
}
/* JADX INFO: Access modifiers changed from: protected */
@Override // com.facebook.react.bridge.GuardedAsyncTask
/* JADX INFO: renamed from: a, reason: merged with bridge method [inline-methods] */
public void doInBackgroundGuarded(Void... voidArr) {
if (!AsyncStorageModule.this.ensureDatabase()) {
this.f8433a.invoke(com.reactnativecommunity.asyncstorage.b.a(null), null);
return;
}
WritableArray writableArrayCreateArray = Arguments.createArray();
Cursor cursorQuery = AsyncStorageModule.this.mReactDatabaseSupplier.y().query("catalystLocalStorage", new String[]{"key"}, null, null, null, null, null);
try {
try {
if (cursorQuery.moveToFirst()) {
do {
writableArrayCreateArray.pushString(cursorQuery.getString(0));
} while (cursorQuery.moveToNext());
}
cursorQuery.close();
this.f8433a.invoke(null, writableArrayCreateArray);
} catch (Exception e4) {
Y.a.J("ReactNative", e4.getMessage(), e4);
this.f8433a.invoke(com.reactnativecommunity.asyncstorage.b.b(null, e4.getMessage()), null);
cursorQuery.close();
}
} catch (Throwable th) {
cursorQuery.close();
throw th;
}
}
}
public AsyncStorageModule(ReactApplicationContext reactApplicationContext) {
this(reactApplicationContext, AsyncTask.THREAD_POOL_EXECUTOR);
}
/* JADX INFO: Access modifiers changed from: private */
public boolean ensureDatabase() {
return !this.mShuttingDown && this.mReactDatabaseSupplier.v();
}
@Override // com.reactnativecommunity.asyncstorage.NativeAsyncStorageModuleSpec
@ReactMethod
public void clear(Callback callback) {
new e(getReactApplicationContext(), callback).executeOnExecutor(this.executor, new Void[0]);
}
public void clearSensitiveData() {
this.mReactDatabaseSupplier.i();
}
@Override // com.reactnativecommunity.asyncstorage.NativeAsyncStorageModuleSpec
@ReactMethod
public void getAllKeys(Callback callback) {
new f(getReactApplicationContext(), callback).executeOnExecutor(this.executor, new Void[0]);
}
@Override // com.reactnativecommunity.asyncstorage.NativeAsyncStorageModuleSpec, com.facebook.react.bridge.NativeModule
public String getName() {
return "RNCAsyncStorage";
}
@Override // com.facebook.react.bridge.BaseJavaModule, com.facebook.react.bridge.NativeModule, com.facebook.react.turbomodule.core.interfaces.TurboModule
public void initialize() {
super.initialize();
this.mShuttingDown = false;
}
@Override // com.facebook.react.bridge.BaseJavaModule, com.facebook.react.bridge.NativeModule, com.facebook.react.turbomodule.core.interfaces.TurboModule
public void invalidate() {
this.mShuttingDown = true;
this.mReactDatabaseSupplier.o();
}
@Override // com.reactnativecommunity.asyncstorage.NativeAsyncStorageModuleSpec
@ReactMethod
public void multiGet(ReadableArray readableArray, Callback callback) {
if (readableArray == null) {
callback.invoke(com.reactnativecommunity.asyncstorage.b.c(null), null);
} else {
new a(getReactApplicationContext(), callback, readableArray).executeOnExecutor(this.executor, new Void[0]);
}
}
@Override // com.reactnativecommunity.asyncstorage.NativeAsyncStorageModuleSpec
@ReactMethod
public void multiMerge(ReadableArray readableArray, Callback callback) {
new d(getReactApplicationContext(), callback, readableArray).executeOnExecutor(this.executor, new Void[0]);
}
@Override // com.reactnativecommunity.asyncstorage.NativeAsyncStorageModuleSpec
@ReactMethod
public void multiRemove(ReadableArray readableArray, Callback callback) {
if (readableArray.size() == 0) {
callback.invoke(new Object[0]);
} else {
new c(getReactApplicationContext(), callback, readableArray).executeOnExecutor(this.executor, new Void[0]);
}
}
@Override // com.reactnativecommunity.asyncstorage.NativeAsyncStorageModuleSpec
@ReactMethod
public void multiSet(ReadableArray readableArray, Callback callback) {
if (readableArray.size() == 0) {
callback.invoke(new Object[0]);
} else {
new b(getReactApplicationContext(), callback, readableArray).executeOnExecutor(this.executor, new Void[0]);
}
}
AsyncStorageModule(ReactApplicationContext reactApplicationContext, Executor executor) throws Throwable {
super(reactApplicationContext);
this.mShuttingDown = false;
h.g(reactApplicationContext);
this.executor = new l(executor);
this.mReactDatabaseSupplier = k.z(reactApplicationContext);
}
}
⚠️ This content was hidden by an advertisement filtering extension in your browser. Please disable it and reload the page to access the decompiled content.
We only display one small text ad to keep this service free. Here's what it looks like:
Read the Docs for Business: You write the docs. We do the rest.
Try it today!Ad by EthicalAds
Download file