MCPcopy Create free account
hub / github.com/ALEX5402/NewBlackbox / disable_resource_loading

Function disable_resource_loading

Bcore/src/main/cpp/hidden_api.cpp:80–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80bool disable_resource_loading() {
81
82 try {
83
84 void* handle = xdl_open("libandroid_runtime.so", XDL_DEFAULT);
85 if (handle) {
86
87 void* nativeLoadAddr = xdl_sym(handle, "_ZN7android8ApkAssets9nativeLoadEPKc", nullptr);
88 if (nativeLoadAddr) {
89 ALOGD("ResourceLoading: Found ApkAssets.nativeLoad at %p", nativeLoadAddr);
90
91 } else {
92 ALOGD("ResourceLoading: Could not find ApkAssets.nativeLoad symbol");
93 }
94 xdl_close(handle);
95 } else {
96 ALOGD("ResourceLoading: Could not open libandroid_runtime.so");
97 }
98 } catch (...) {
99 ALOGD("ResourceLoading: Exception while trying to hook ApkAssets.nativeLoad");
100 }
101
102
103 try {
104
105 void* handle = xdl_open("libc.so", XDL_DEFAULT);
106 if (handle) {
107
108 void* openAddr = xdl_sym(handle, "open", nullptr);
109 if (openAddr) {
110 ALOGD("ResourceLoading: Found open function at %p", openAddr);
111
112 } else {
113 ALOGD("ResourceLoading: Could not find open function symbol");
114 }
115 xdl_close(handle);
116 } else {
117 ALOGD("ResourceLoading: Could not open libc.so");
118 }
119 } catch (...) {
120 ALOGD("ResourceLoading: Exception while trying to hook file system calls");
121 }
122
123 ALOGD("ResourceLoading: Native resource loading hooks initialized (without system properties)");
124 return true;
125}

Callers 1

disableResourceLoadingFunction · 0.85

Calls 3

xdl_openFunction · 0.85
xdl_symFunction · 0.85
xdl_closeFunction · 0.85

Tested by

no test coverage detected