codehasan / dex2c

🎇 AOT compiler to translate dalvikvm code into cpp code
Apache License 2.0
156 stars 39 forks source link

Failed to generate valid c++ file because of type mismatch #18

Closed lry127 closed 5 months ago

lry127 commented 5 months ago

Error message:

[armeabi-v7a] Compile++ thumb: stub <= Java_com_simplemobiletools_commons_databases_ContactsDatabase_1Impl_clearAllTables__.cpp
jni/nc/Java_com_simplemobiletools_commons_databases_ContactsDatabase_1Impl_clearAllTables__.cpp:244:24: error: cannot initialize a member subobject of type 'jobject' (aka '_jobject *') with an lvalue of type 'jint' (aka 'int')
jvalue args[] = {{.l = v7}};
                       ^~
1 error generated.

the corresponding smali code:

.method public clearAllTables()V
    .registers 5

    .line 163
    const-string v0, "VACUUM"

    const-string v1, "PRAGMA wal_checkpoint(FULL)"

    invoke-super {p0}, Lcom/simplemobiletools/commons/databases/ContactsDatabase;->assertNotMainThread()V

    .line 164
    invoke-super {p0}, Lcom/simplemobiletools/commons/databases/ContactsDatabase;->getOpenHelper()Landroidx/sqlite/db/SupportSQLiteOpenHelper;

    move-result-object v2

    invoke-interface {v2}, Landroidx/sqlite/db/SupportSQLiteOpenHelper;->getWritableDatabase()Landroidx/sqlite/db/SupportSQLiteDatabase;

    move-result-object v2

    .line 166
    .local v2, "_db":Landroidx/sqlite/db/SupportSQLiteDatabase;
    :try_start_f
    invoke-super {p0}, Lcom/simplemobiletools/commons/databases/ContactsDatabase;->beginTransaction()V

    .line 167
    const-string v3, "DELETE FROM `contacts`"

    invoke-interface {v2, v3}, Landroidx/sqlite/db/SupportSQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 168
    const-string v3, "DELETE FROM `groups`"

    invoke-interface {v2, v3}, Landroidx/sqlite/db/SupportSQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 169
    invoke-super {p0}, Lcom/simplemobiletools/commons/databases/ContactsDatabase;->setTransactionSuccessful()V
    :try_end_1f
    .catchall {:try_start_f .. :try_end_1f} :catchall_33

    .line 171
    invoke-super {p0}, Lcom/simplemobiletools/commons/databases/ContactsDatabase;->endTransaction()V

    .line 172
    invoke-interface {v2, v1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->query(Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    .line 173
    invoke-interface {v2}, Landroidx/sqlite/db/SupportSQLiteDatabase;->inTransaction()Z

    move-result v1

    if-nez v1, :cond_32

    .line 174
    invoke-interface {v2, v0}, Landroidx/sqlite/db/SupportSQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 177
    :cond_32
    return-void

    .line 171
    :catchall_33
    move-exception v3

    invoke-super {p0}, Lcom/simplemobiletools/commons/databases/ContactsDatabase;->endTransaction()V

    .line 172
    invoke-interface {v2, v1}, Landroidx/sqlite/db/SupportSQLiteDatabase;->query(Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v1

    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    .line 173
    invoke-interface {v2}, Landroidx/sqlite/db/SupportSQLiteDatabase;->inTransaction()Z

    move-result v1

    if-nez v1, :cond_47

    .line 174
    invoke-interface {v2, v0}, Landroidx/sqlite/db/SupportSQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 176
    :cond_47
    throw v3
.end method

Jadx decompiled method:

    @Override // androidx.room.RoomDatabase
    public void clearAllTables() {
        super.assertNotMainThread();
        SupportSQLiteDatabase _db = super.getOpenHelper().getWritableDatabase();
        try {
            super.beginTransaction();
            _db.execSQL("DELETE FROM `contacts`");
            _db.execSQL("DELETE FROM `groups`");
            super.setTransactionSuccessful();
        } finally {
            super.endTransaction();
            _db.query("PRAGMA wal_checkpoint(FULL)").close();
            if (!_db.inTransaction()) {
                _db.execSQL("VACUUM");
            }
        }
    }

Generated c++ code:

#include "Dex2C.h"

/* Lcom/simplemobiletools/commons/databases/ContactsDatabase_Impl;->clearAllTables()V */
extern "C" JNIEXPORT void JNICALL
Java_com_simplemobiletools_commons_databases_ContactsDatabase_1Impl_clearAllTables__(JNIEnv *env, jobject thiz){
jobject v0 = NULL;
jobject v1 = NULL;
jobject v2 = NULL;
jobject v3 = NULL;
jobject v4 = NULL;
jobject v5 = NULL;
jint v6;
jint v7;
jthrowable exception;
jclass cls0 = NULL,cls1 = NULL,cls2 = NULL,cls3 = NULL;
jmethodID mth0 = NULL, mth1 = NULL, mth2 = NULL, mth3 = NULL, mth4 = NULL, mth5 = NULL, mth6 = NULL, mth7 = NULL, mth8 = NULL, mth9 = NULL;
v0 = (jobject)env->NewLocalRef(thiz);
L0:
LOGD("0:const-string \x76\x30\x2c\x20\x27\x56\x41\x43\x55\x55\x4d\x27");
if (v1) {
LOGD("env->DeleteLocalRef(%p):v1", v1);
env->DeleteLocalRef(v1);
}
v1 = (jstring) env->NewStringUTF("\x56\x41\x43\x55\x55\x4d");
LOGD("4:const-string \x76\x31\x2c\x20\x27\x50\x52\x41\x47\x4d\x41\x20\x77\x61\x6c\x5f\x63\x68\x65\x63\x6b\x70\x6f\x69\x6e\x74\x28\x46\x55\x4c\x4c\x29\x27");
if (v2) {
LOGD("env->DeleteLocalRef(%p):v2", v2);
env->DeleteLocalRef(v2);
}
v2 = (jstring) env->NewStringUTF("\x50\x52\x41\x47\x4d\x41\x20\x77\x61\x6c\x5f\x63\x68\x65\x63\x6b\x70\x6f\x69\x6e\x74\x28\x46\x55\x4c\x4c\x29");
LOGD("8:invoke-super \x76\x34\x2c\x20\x4c\x63\x6f\x6d\x2f\x73\x69\x6d\x70\x6c\x65\x6d\x6f\x62\x69\x6c\x65\x74\x6f\x6f\x6c\x73\x2f\x63\x6f\x6d\x6d\x6f\x6e\x73\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x73\x2f\x43\x6f\x6e\x74\x61\x63\x74\x73\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x61\x73\x73\x65\x72\x74\x4e\x6f\x74\x4d\x61\x69\x6e\x54\x68\x72\x65\x61\x64\x28\x29\x56");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v0);
jclass &clz = cls0;
jmethodID &mid = mth0;
D2C_RESOLVE_METHOD(clz, mid, "com/simplemobiletools/commons/databases/ContactsDatabase", "assertNotMainThread", "()V");
jvalue args[] = {};
env->CallNonvirtualVoidMethodA(v0, clz, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("e:invoke-super \x76\x34\x2c\x20\x4c\x63\x6f\x6d\x2f\x73\x69\x6d\x70\x6c\x65\x6d\x6f\x62\x69\x6c\x65\x74\x6f\x6f\x6c\x73\x2f\x63\x6f\x6d\x6d\x6f\x6e\x73\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x73\x2f\x43\x6f\x6e\x74\x61\x63\x74\x73\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x67\x65\x74\x4f\x70\x65\x6e\x48\x65\x6c\x70\x65\x72\x28\x29\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x4f\x70\x65\x6e\x48\x65\x6c\x70\x65\x72\x3b");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v0);
jclass &clz = cls0;
jmethodID &mid = mth1;
D2C_RESOLVE_METHOD(clz, mid, "com/simplemobiletools/commons/databases/ContactsDatabase", "getOpenHelper", "()Landroidx/sqlite/db/SupportSQLiteOpenHelper;");
jvalue args[] = {};
v3 = (jobject) env->CallNonvirtualObjectMethodA(v0, clz, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("14:move-result-object \x76\x32");
if (v4) {
LOGD("env->DeleteLocalRef(%p):v4", v4);
env->DeleteLocalRef(v4);
}
v4 = (jobject) v3;
LOGD("16:invoke-interface \x76\x32\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x4f\x70\x65\x6e\x48\x65\x6c\x70\x65\x72\x3b\x2d\x3e\x67\x65\x74\x57\x72\x69\x74\x61\x62\x6c\x65\x44\x61\x74\x61\x62\x61\x73\x65\x28\x29\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x44\x61\x74\x61\x62\x61\x73\x65\x3b");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v4);
jclass &clz = cls1;
jmethodID &mid = mth2;
D2C_RESOLVE_METHOD(clz, mid, "androidx/sqlite/db/SupportSQLiteOpenHelper", "getWritableDatabase", "()Landroidx/sqlite/db/SupportSQLiteDatabase;");
jvalue args[] = {};
v3 = (jobject) env->CallObjectMethodA(v4, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("1c:move-result-object \x76\x32");
if (v4) {
LOGD("env->DeleteLocalRef(%p):v4", v4);
env->DeleteLocalRef(v4);
}
v4 = (jobject) v3;
L1:
LOGD("1e:invoke-super \x76\x34\x2c\x20\x4c\x63\x6f\x6d\x2f\x73\x69\x6d\x70\x6c\x65\x6d\x6f\x62\x69\x6c\x65\x74\x6f\x6f\x6c\x73\x2f\x63\x6f\x6d\x6d\x6f\x6e\x73\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x73\x2f\x43\x6f\x6e\x74\x61\x63\x74\x73\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x62\x65\x67\x69\x6e\x54\x72\x61\x6e\x73\x61\x63\x74\x69\x6f\x6e\x28\x29\x56");
{
#define EX_HANDLE EX_LandingPad_1
D2C_NOT_NULL(v0);
jclass &clz = cls0;
jmethodID &mid = mth3;
D2C_RESOLVE_METHOD(clz, mid, "com/simplemobiletools/commons/databases/ContactsDatabase", "beginTransaction", "()V");
jvalue args[] = {};
env->CallNonvirtualVoidMethodA(v0, clz, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("24:const-string \x76\x33\x2c\x20\x27\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x60\x63\x6f\x6e\x74\x61\x63\x74\x73\x60\x27");
if (v5) {
LOGD("env->DeleteLocalRef(%p):v5", v5);
env->DeleteLocalRef(v5);
}
v5 = (jstring) env->NewStringUTF("\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x60\x63\x6f\x6e\x74\x61\x63\x74\x73\x60");
LOGD("28:invoke-interface \x76\x32\x2c\x20\x76\x33\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x65\x78\x65\x63\x53\x51\x4c\x28\x4c\x6a\x61\x76\x61\x2f\x6c\x61\x6e\x67\x2f\x53\x74\x72\x69\x6e\x67\x3b\x29\x56");
{
#define EX_HANDLE EX_LandingPad_1
D2C_NOT_NULL(v4);
jclass &clz = cls2;
jmethodID &mid = mth4;
D2C_RESOLVE_METHOD(clz, mid, "androidx/sqlite/db/SupportSQLiteDatabase", "execSQL", "(Ljava/lang/String;)V");
jvalue args[] = {{.l = v5}};
env->CallVoidMethodA(v4, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("2e:const-string \x76\x33\x2c\x20\x27\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x60\x67\x72\x6f\x75\x70\x73\x60\x27");
if (v5) {
LOGD("env->DeleteLocalRef(%p):v5", v5);
env->DeleteLocalRef(v5);
}
v5 = (jstring) env->NewStringUTF("\x44\x45\x4c\x45\x54\x45\x20\x46\x52\x4f\x4d\x20\x60\x67\x72\x6f\x75\x70\x73\x60");
LOGD("32:invoke-interface \x76\x32\x2c\x20\x76\x33\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x65\x78\x65\x63\x53\x51\x4c\x28\x4c\x6a\x61\x76\x61\x2f\x6c\x61\x6e\x67\x2f\x53\x74\x72\x69\x6e\x67\x3b\x29\x56");
{
#define EX_HANDLE EX_LandingPad_1
D2C_NOT_NULL(v4);
jclass &clz = cls2;
jmethodID &mid = mth4;
D2C_RESOLVE_METHOD(clz, mid, "androidx/sqlite/db/SupportSQLiteDatabase", "execSQL", "(Ljava/lang/String;)V");
jvalue args[] = {{.l = v5}};
env->CallVoidMethodA(v4, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("38:invoke-super \x76\x34\x2c\x20\x4c\x63\x6f\x6d\x2f\x73\x69\x6d\x70\x6c\x65\x6d\x6f\x62\x69\x6c\x65\x74\x6f\x6f\x6c\x73\x2f\x63\x6f\x6d\x6d\x6f\x6e\x73\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x73\x2f\x43\x6f\x6e\x74\x61\x63\x74\x73\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x73\x65\x74\x54\x72\x61\x6e\x73\x61\x63\x74\x69\x6f\x6e\x53\x75\x63\x63\x65\x73\x73\x66\x75\x6c\x28\x29\x56");
{
#define EX_HANDLE EX_LandingPad_1
D2C_NOT_NULL(v0);
jclass &clz = cls0;
jmethodID &mid = mth5;
D2C_RESOLVE_METHOD(clz, mid, "com/simplemobiletools/commons/databases/ContactsDatabase", "setTransactionSuccessful", "()V");
jvalue args[] = {};
env->CallNonvirtualVoidMethodA(v0, clz, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("3e:invoke-super \x76\x34\x2c\x20\x4c\x63\x6f\x6d\x2f\x73\x69\x6d\x70\x6c\x65\x6d\x6f\x62\x69\x6c\x65\x74\x6f\x6f\x6c\x73\x2f\x63\x6f\x6d\x6d\x6f\x6e\x73\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x73\x2f\x43\x6f\x6e\x74\x61\x63\x74\x73\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x65\x6e\x64\x54\x72\x61\x6e\x73\x61\x63\x74\x69\x6f\x6e\x28\x29\x56");
{
#define EX_HANDLE EX_LandingPad_1
D2C_NOT_NULL(v0);
jclass &clz = cls0;
jmethodID &mid = mth6;
D2C_RESOLVE_METHOD(clz, mid, "com/simplemobiletools/commons/databases/ContactsDatabase", "endTransaction", "()V");
jvalue args[] = {};
env->CallNonvirtualVoidMethodA(v0, clz, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("44:invoke-interface \x76\x32\x2c\x20\x76\x31\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x71\x75\x65\x72\x79\x28\x4c\x6a\x61\x76\x61\x2f\x6c\x61\x6e\x67\x2f\x53\x74\x72\x69\x6e\x67\x3b\x29\x4c\x61\x6e\x64\x72\x6f\x69\x64\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x2f\x43\x75\x72\x73\x6f\x72\x3b");
{
#define EX_HANDLE EX_LandingPad_1
D2C_NOT_NULL(v4);
jclass &clz = cls2;
jmethodID &mid = mth7;
D2C_RESOLVE_METHOD(clz, mid, "androidx/sqlite/db/SupportSQLiteDatabase", "query", "(Ljava/lang/String;)Landroid/database/Cursor;");
jvalue args[] = {{.l = v2}};
v3 = (jobject) env->CallObjectMethodA(v4, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("4a:move-result-object \x76\x31");
if (v2) {
LOGD("env->DeleteLocalRef(%p):v2", v2);
env->DeleteLocalRef(v2);
}
v2 = (jobject) v3;
LOGD("4c:invoke-interface \x76\x31\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x2f\x43\x75\x72\x73\x6f\x72\x3b\x2d\x3e\x63\x6c\x6f\x73\x65\x28\x29\x56");
{
#define EX_HANDLE EX_LandingPad_1
D2C_NOT_NULL(v2);
jclass &clz = cls3;
jmethodID &mid = mth8;
D2C_RESOLVE_METHOD(clz, mid, "android/database/Cursor", "close", "()V");
jvalue args[] = {};
env->CallVoidMethodA(v2, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("52:invoke-interface \x76\x32\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x69\x6e\x54\x72\x61\x6e\x73\x61\x63\x74\x69\x6f\x6e\x28\x29\x5a");
{
#define EX_HANDLE EX_LandingPad_1
D2C_NOT_NULL(v4);
jclass &clz = cls2;
jmethodID &mid = mth9;
D2C_RESOLVE_METHOD(clz, mid, "androidx/sqlite/db/SupportSQLiteDatabase", "inTransaction", "()Z");
jvalue args[] = {};
v6 = (jboolean) env->CallBooleanMethodA(v4, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("58:move-result \x76\x31");
v7 = (jint) v6;
LOGD("5a:if-nez \x76\x31\x2c\x20\x2b\x35");
if(v7 != 0){
goto L3;
}
else {
goto L2;
}
L2:
LOGD("5e:invoke-interface \x76\x32\x2c\x20\x76\x30\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x65\x78\x65\x63\x53\x51\x4c\x28\x4c\x6a\x61\x76\x61\x2f\x6c\x61\x6e\x67\x2f\x53\x74\x72\x69\x6e\x67\x3b\x29\x56");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v4);
jclass &clz = cls2;
jmethodID &mid = mth4;
D2C_RESOLVE_METHOD(clz, mid, "androidx/sqlite/db/SupportSQLiteDatabase", "execSQL", "(Ljava/lang/String;)V");
jvalue args[] = {{.l = v1}};
env->CallVoidMethodA(v4, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
L3:
return;
L4:
LOGD("66:move-exception \x76\x33");
if (v5) {
LOGD("env->DeleteLocalRef(%p):v5", v5);
env->DeleteLocalRef(v5);
}
v5 = exception;
LOGD("68:invoke-super \x76\x34\x2c\x20\x4c\x63\x6f\x6d\x2f\x73\x69\x6d\x70\x6c\x65\x6d\x6f\x62\x69\x6c\x65\x74\x6f\x6f\x6c\x73\x2f\x63\x6f\x6d\x6d\x6f\x6e\x73\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x73\x2f\x43\x6f\x6e\x74\x61\x63\x74\x73\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x65\x6e\x64\x54\x72\x61\x6e\x73\x61\x63\x74\x69\x6f\x6e\x28\x29\x56");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v0);
jclass &clz = cls0;
jmethodID &mid = mth6;
D2C_RESOLVE_METHOD(clz, mid, "com/simplemobiletools/commons/databases/ContactsDatabase", "endTransaction", "()V");
jvalue args[] = {};
env->CallNonvirtualVoidMethodA(v0, clz, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("6e:invoke-interface \x76\x32\x2c\x20\x76\x31\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x71\x75\x65\x72\x79\x28\x4c\x6a\x61\x76\x61\x2f\x6c\x61\x6e\x67\x2f\x53\x74\x72\x69\x6e\x67\x3b\x29\x4c\x61\x6e\x64\x72\x6f\x69\x64\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x2f\x43\x75\x72\x73\x6f\x72\x3b");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v4);
jclass &clz = cls2;
jmethodID &mid = mth7;
D2C_RESOLVE_METHOD(clz, mid, "androidx/sqlite/db/SupportSQLiteDatabase", "query", "(Ljava/lang/String;)Landroid/database/Cursor;");
jvalue args[] = {{.l = v7}};
v3 = (jobject) env->CallObjectMethodA(v4, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("74:move-result-object \x76\x31");
if (v2) {
LOGD("env->DeleteLocalRef(%p):v2", v2);
env->DeleteLocalRef(v2);
}
v2 = (jobject) v3;
LOGD("76:invoke-interface \x76\x31\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x2f\x64\x61\x74\x61\x62\x61\x73\x65\x2f\x43\x75\x72\x73\x6f\x72\x3b\x2d\x3e\x63\x6c\x6f\x73\x65\x28\x29\x56");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v2);
jclass &clz = cls3;
jmethodID &mid = mth8;
D2C_RESOLVE_METHOD(clz, mid, "android/database/Cursor", "close", "()V");
jvalue args[] = {};
env->CallVoidMethodA(v2, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("7c:invoke-interface \x76\x32\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x69\x6e\x54\x72\x61\x6e\x73\x61\x63\x74\x69\x6f\x6e\x28\x29\x5a");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v4);
jclass &clz = cls2;
jmethodID &mid = mth9;
D2C_RESOLVE_METHOD(clz, mid, "androidx/sqlite/db/SupportSQLiteDatabase", "inTransaction", "()Z");
jvalue args[] = {};
v6 = (jboolean) env->CallBooleanMethodA(v4, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
LOGD("82:move-result \x76\x31");
v7 = (jint) v6;
LOGD("84:if-nez \x76\x31\x2c\x20\x2b\x35");
if(v7 != 0){
goto L6;
}
else {
goto L5;
}
L5:
LOGD("88:invoke-interface \x76\x32\x2c\x20\x76\x30\x2c\x20\x4c\x61\x6e\x64\x72\x6f\x69\x64\x78\x2f\x73\x71\x6c\x69\x74\x65\x2f\x64\x62\x2f\x53\x75\x70\x70\x6f\x72\x74\x53\x51\x4c\x69\x74\x65\x44\x61\x74\x61\x62\x61\x73\x65\x3b\x2d\x3e\x65\x78\x65\x63\x53\x51\x4c\x28\x4c\x6a\x61\x76\x61\x2f\x6c\x61\x6e\x67\x2f\x53\x74\x72\x69\x6e\x67\x3b\x29\x56");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v4);
jclass &clz = cls2;
jmethodID &mid = mth4;
D2C_RESOLVE_METHOD(clz, mid, "androidx/sqlite/db/SupportSQLiteDatabase", "execSQL", "(Ljava/lang/String;)V");
jvalue args[] = {{.l = v1}};
env->CallVoidMethodA(v4, mid, args);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}
L6:
LOGD("8e:throw \x76\x33");
{
#define EX_HANDLE EX_UnwindBlock
D2C_NOT_NULL(v5);
env->Throw((jthrowable) v5);
D2C_CHECK_PENDING_EX;
#undef EX_HANDLE
}

EX_LandingPad_1:
D2C_GET_PENDING_EX
if(d2c_is_instance_of(env, exception, "java/lang/Throwable")) {
goto L4;
}
D2C_GOTO_UNWINDBLOCK
EX_UnwindBlock: return;
}

filter.txt:

.*ContactsDatabase.*

Python environment: Python 3.12.3 OS: Linux ubuntu 24.04 command executed:

python3 dcc.py -a classes.dex -o out  --source-dir proj-src

P.S. the dex file is here. Besides, I fixed a bug in this PR to make debugging a single dex file possible, it would otherwise throw a exception because the auto_vm method would return a list of bytes if a single dex file was provided. Any help is really appreciated and more info can be provided if needed. :)

lry127 commented 5 months ago

I somehow solved this by myself.