How hook execSQL method?
wyhuan opened this issue · 3 comments
wyhuan commented
how hook "android.database.sqlite.SQLiteDatabase->execSQL"?
I try fail
File folder = this.getFilesDir();
File f = new File(folder.getAbsolutePath() + "/test");
SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(f, null);
String sql = ".......";
db.execSQL(sql);
@Hook("android.database.sqlite.SQLiteDatabase->execSQL")
public void SQLiteDatabase_execSQL(String sql) throws SQLException {
Log.e(TAG, "SQLiteDatabase_execSQL: " + sql);
OriginalMethod.by("SQLiteDatabase_execSQL").invoke(sql);
}
mar-v-in commented
What is not working? Be more precise!
You invoke the original method by identifier, but don't declare the identifier via @BackupIdentifier("SQLiteDatabase_execSQL")
wyhuan commented
I tried your way, but without success
@Hook("android.database.sqlite.SQLiteDatabase->execSQL")
@BackupIdentifier("SQLiteDatabase_execSQL")
public void SQLiteDatabase_execSQL(String sql) throws SQLException {
Log.e("neil", "SQLiteDatabase_execSQL: " + sql);
OriginalMethod.by("SQLiteDatabase_execSQL").invoke(sql);
}
Can you hook to this method?
android.database.sqlite.SQLiteDatabase->execSQL
You can try
File folder = this.getFilesDir();
File f = new File(folder.getAbsolutePath() + "/test");
SQLiteDatabase db = SQLiteDatabase.openOrCreateDatabase(f, null);
String sql = ".......";
db.execSQL(sql);
wyhuan commented
I have solved the problem is to find the original function of the problem。3Q