Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to open database '/data/data/com.baidu.searchbox/database/pushinfo.db'. #2

Open
ghost opened this issue May 6, 2024 · 3 comments

Comments

@ghost
Copy link

ghost commented May 6, 2024

应用名:百度
测试手机:华为p20 Android 10

(1)
Failed to open database '/data/data/com.baidu.searchbox/database/pushinfo.db'.
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (Sqlite code 14 SQLITE_CANTOPEN): Could not open database, (OS error - 13:Permission denied)

(2)
E Failed inserting a file into the cache
com.facebook.common.file.FileUtils$CreateDirectoryException: /storage/emulated/0/Android/data/com.baidu.searchbox/cache/image_cache

@ALEX5402
Copy link
Owner

ALEX5402 commented May 7, 2024

应用名:百度 测试手机:华为p20 Android 10

(1) Failed to open database '/data/data/com.baidu.searchbox/database/pushinfo.db'. android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (Sqlite code 14 SQLITE_CANTOPEN): Could not open database, (OS error - 13:Permission denied)

(2) E Failed inserting a file into the cache com.facebook.common.file.FileUtils$CreateDirectoryException: /storage/emulated/0/Android/data/com.baidu.searchbox/cache/image_cache

did you check the permisson ?

@ghost
Copy link
Author

ghost commented May 7, 2024

Test code

Vfs.h

#ifndef VFS_H
#define VFS_H
#include "Log.h"

#define SHADOWHOOK_LIBC_PATH "/apex/com.android.runtime/lib64/bionic/libc.so"

#define SHADOW_HOOK_DEF(ret, func, ...) \
  void * func##_orig = NULL; \
  void * func##_stub = NULL;            \
  ret func##_proxy(__VA_ARGS__)


#define SHADOW_HOOK_SYMBOL(func) \
	func##_stub = shadowhook_hook_sym_name(SHADOWHOOK_LIBC_PATH, #func, (void *)func##_proxy, &func##_orig); \
	if(func##_stub == NULL) {    \
		ALOGD("VfsHook Failed -------------- %s", #func);   \
	}else{   \
		ALOGD("VfsHook Success-------------- %s %p", #func, func##_orig);   \
	}

namespace Vfs {
	void init();
}

#endif //VFS_H

Vfs.cpp

#include "Vfs.h"
#include "IO.h"
#include "shadowhook.h"


SHADOW_HOOK_DEF(int, open, const char *pathname, int flags, int mode) {
	SHADOWHOOK_STACK_SCOPE();
	const char * redirectPath = IO::redirectPath(pathname);
	ALOGD("Vfs open -------------- %s ---- %s", pathname , redirectPath);
	return SHADOWHOOK_CALL_PREV(open_proxy, redirectPath, flags, mode);
}

void Vfs::init(){

	if(shadowhook_init(SHADOWHOOK_MODE_SHARED, false) == 0 ){

		SHADOW_HOOK_SYMBOL(open);
	}
}

Log
NativeCore: Vfs open -------------- /data/data/com.baidu.searchbox/database/pushinfo.db ---- /data/user/0/com.vspace/blackbox/data/user/0/com.baidu.searchbox/database/pushinfo.db

@ghost
Copy link
Author

ghost commented May 7, 2024

NewBlackbox 没有hook native c/c++ io 函数,native c/c++ open(),lstat()等没有对路径进行重定向
是这个问题吗?

NewBlackbox does not hook native c/c++ IO function, native c/c++ open(), lstat() etc. do not redirect paths.
JniHook::HookJniFun(env, "libcore/io/Linux", "open",......) etc. is ineffective for native code.
Is that the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant