Skip to content

Commit

Permalink
add some missing pieces
Browse files Browse the repository at this point in the history
  • Loading branch information
nift4 committed Feb 24, 2025
1 parent 5608424 commit bf97529
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/config/libraries/linkernsbypass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"uniqueId": "io.github.bylaws.liblinkernsbypass:liblinkernsbypass",
"developers": [{
"name": "Billy Laws",
"organisationUrl": "https://github.com/bylaws"
}],
"artifactVersion": "aa3975893d83ef1bc84c321ec60c65fbf1287887",
"description": "A simple library to expose the linker namespace functionality in Android 9+ together with symbol hooking",
"name": "liblinkernsbypass",
"tag": "custom",
"website": "https://github.com/bylaws/liblinkernsbypass",
"licenses": [
"BSD-2-Clause"
]
}
19 changes: 19 additions & 0 deletions app/src/main/cpp/gramophone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ typedef aaudio_format_t(*AAudioConvert_androidToAAudioDataFormat_t)(audio_format
static AAudioConvert_androidToAAudioDataFormat_t AAudioConvert_androidToAAudioDataFormat = nullptr;

bool initLib() {
if (android_get_device_api_level() < 28) {
if (!handle) {
handle = dlopen("libaudioclient.so", RTLD_GLOBAL);
if (handle == nullptr) {
__android_log_print(ANDROID_LOG_ERROR, "AudioTrackHalInfo(JNI)",
"dlopen returned nullptr for libaudioclient.so: %s", dlerror());
return false;
}
}
if (!handle2) {
handle2 = dlopen("libaaudio.so", RTLD_GLOBAL);
if (handle2 == nullptr) {
__android_log_print(ANDROID_LOG_ERROR, "AudioTrackHalInfo(JNI)",
"dlopen returned nullptr for libaaudio.so: %s", dlerror());
return false;
}
}
return true;
}
if (!linkernsbypass_load_status()) {
__android_log_print(ANDROID_LOG_ERROR, "AudioTrackHalInfo(JNI)", "linker namespace bypass init failed");
return false;
Expand Down

0 comments on commit bf97529

Please sign in to comment.