Fix Android push encryption check
This commit is contained in:
parent
472874f615
commit
e03e03f841
|
@ -65,21 +65,6 @@ class Encryption {
|
|||
private ReactApplicationContext reactContext;
|
||||
|
||||
public Room readRoom(final Ejson ejson) throws NoSuchFieldException {
|
||||
int resId = reactContext.getResources().getIdentifier("rn_config_reader_custom_package", "string", reactContext.getPackageName());
|
||||
String className = reactContext.getString(resId);
|
||||
Class clazz = null;
|
||||
Boolean isOfficial = false;
|
||||
try {
|
||||
clazz = Class.forName(className + ".BuildConfig");
|
||||
Field IS_OFFICIAL = clazz.getField("IS_OFFICIAL");
|
||||
isOfficial = (Boolean) IS_OFFICIAL.get(null);
|
||||
} catch (ClassNotFoundException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String dbName = ejson.serverURL().replace("https://", "");
|
||||
if (!isOfficial) {
|
||||
dbName += "-experimental";
|
||||
}
|
||||
dbName += ".db";
|
||||
Database database = new Database(dbName, reactContext, SQLiteDatabase.CREATE_IF_NECESSARY);
|
||||
String[] query = {ejson.rid};
|
||||
|
|
Loading…
Reference in New Issue