七色猫视频 v9.9.9版本的 MD5 值为:6e3740f68cd7a75ec951b5f356e1fd2c
以下内容为反编译后的 DatabaseOpenHelper.java 源代码,内容仅作参考
package org.greenrobot.greendao.database;
import android.content.Context;
import android.database.DatabaseErrorHandler;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import org.greenrobot.greendao.DaoException;
public abstract class DatabaseOpenHelper extends SQLiteOpenHelper {
private final Context context;
private EncryptedHelper encryptedHelper;
private boolean loadSQLCipherNativeLibs;
private final String name;
private final int version;
public interface EncryptedHelper {
Database getEncryptedReadableDb(String str);
Database getEncryptedReadableDb(char[] cArr);
Database getEncryptedWritableDb(String str);
Database getEncryptedWritableDb(char[] cArr);
}
public void onCreate(Database database) {
}
public void onOpen(Database database) {
}
public void onUpgrade(Database database, int i, int i2) {
}
public DatabaseOpenHelper(Context context, String str, int i) {
this(context, str, null, i);
}
public DatabaseOpenHelper(Context context, String str, SQLiteDatabase.CursorFactory cursorFactory, int i) {
super(context, str, cursorFactory, i);
this.loadSQLCipherNativeLibs = true;
this.context = context;
this.name = str;
this.version = i;
}
public DatabaseOpenHelper(Context context, String str, SQLiteDatabase.CursorFactory cursorFactory, int i, DatabaseErrorHandler databaseErrorHandler) {
super(context, str, cursorFactory, i, databaseErrorHandler);
this.loadSQLCipherNativeLibs = true;
this.context = context;
this.name = str;
this.version = i;
}
public void setLoadSQLCipherNativeLibs(boolean z) {
this.loadSQLCipherNativeLibs = z;
}
public Database getWritableDb() {
return wrap(getWritableDatabase());
}
public Database getReadableDb() {
return wrap(getReadableDatabase());
}
protected Database wrap(SQLiteDatabase sQLiteDatabase) {
return new StandardDatabase(sQLiteDatabase);
}
@Override
public void onCreate(SQLiteDatabase sQLiteDatabase) {
onCreate(wrap(sQLiteDatabase));
}
@Override
public void onUpgrade(SQLiteDatabase sQLiteDatabase, int i, int i2) {
onUpgrade(wrap(sQLiteDatabase), i, i2);
}
@Override
public void onOpen(SQLiteDatabase sQLiteDatabase) {
onOpen(wrap(sQLiteDatabase));
}
private EncryptedHelper checkEncryptedHelper() {
if (this.encryptedHelper == null) {
try {
Class.forName("net.sqlcipher.database.SQLiteOpenHelper");
try {
this.encryptedHelper = (EncryptedHelper) Class.forName("org.greenrobot.greendao.database.SqlCipherEncryptedHelper").getConstructor(DatabaseOpenHelper.class, Context.class, String.class, Integer.TYPE, Boolean.TYPE).newInstance(this, this.context, this.name, Integer.valueOf(this.version), Boolean.valueOf(this.loadSQLCipherNativeLibs));
} catch (Exception e) {
throw new DaoException(e);
}
} catch (ClassNotFoundException unused) {
throw new DaoException("Using an encrypted database requires SQLCipher, make sure to add it to dependencies: https://greenrobot.org/greendao/documentation/database-encryption/");
}
}
return this.encryptedHelper;
}
public Database getEncryptedWritableDb(String str) {
return checkEncryptedHelper().getEncryptedWritableDb(str);
}
public Database getEncryptedWritableDb(char[] cArr) {
return checkEncryptedHelper().getEncryptedWritableDb(cArr);
}
public Database getEncryptedReadableDb(String str) {
return checkEncryptedHelper().getEncryptedReadableDb(str);
}
public Database getEncryptedReadableDb(char[] cArr) {
return checkEncryptedHelper().getEncryptedReadableDb(cArr);
}
}