mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-04-20 21:23:30 +00:00
add better logging to the root module installer
This commit is contained in:
@@ -37,13 +37,10 @@ This tray app communicates with a daemon with the help of a UNIX socket. The dae
|
|||||||
Currently, there's a [bug in the Android Bluetooth stack](https://issuetracker.google.com/issues/371713238) that prevents the app from working (upvote the issue - click the '+1' icon on the top right corner of IssueTracker). This project provides a root module which patches the bug.
|
Currently, there's a [bug in the Android Bluetooth stack](https://issuetracker.google.com/issues/371713238) that prevents the app from working (upvote the issue - click the '+1' icon on the top right corner of IssueTracker). This project provides a root module which patches the bug.
|
||||||
|
|
||||||
> [!CAUTION]
|
> [!CAUTION]
|
||||||
> **This workaround requires root access.** Try at your own risk.
|
> **This workaround requires root access.** Try at your own risk. It may break your bluetooth, and I am not responsible for any damage caused by this module.
|
||||||
|
|
||||||
To install it, just download the `btl2capfix.zip` from [a release](https://github.com/kavishdevar/aln/releases) and install it from your root manager app.
|
To install it, just download the `btl2capfix.zip` from [a release](https://github.com/kavishdevar/aln/releases) and install it from your root manager app.
|
||||||
|
|
||||||
Tested with
|
|
||||||
- KernelSU
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
#### Renaming the Airpods
|
#### Renaming the Airpods
|
||||||
|
|||||||
@@ -12,15 +12,13 @@ mkdir -p "$TEMP_DIR"
|
|||||||
mkdir -p "$UNZIP_DIR"
|
mkdir -p "$UNZIP_DIR"
|
||||||
|
|
||||||
# Manually extract the $ZIPFILE to a temporary directory
|
# Manually extract the $ZIPFILE to a temporary directory
|
||||||
ui_print "Extracting $ZIPFILE to $UNZIP_DIR"
|
ui_print "Extracting module files..."
|
||||||
unzip -o "$ZIPFILE" -d "$UNZIP_DIR" > /dev/null 2>&1
|
unzip -o "$ZIPFILE" -d "$UNZIP_DIR" > /dev/null 2>&1
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
ui_print "Failed to unzip $ZIPFILE"
|
ui_print "Error: Failed to extract module files."
|
||||||
abort "Failed to unzip $ZIPFILE"
|
abort "Failed to unzip $ZIPFILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ui_print "Extracted module files to $UNZIP_DIR"
|
|
||||||
|
|
||||||
# Determine architecture
|
# Determine architecture
|
||||||
IS64BIT=false
|
IS64BIT=false
|
||||||
if [ "$(uname -m)" = "aarch64" ]; then
|
if [ "$(uname -m)" = "aarch64" ]; then
|
||||||
@@ -42,9 +40,9 @@ fi
|
|||||||
set_perm "$CURL_CMD" 0 0 755
|
set_perm "$CURL_CMD" 0 0 755
|
||||||
|
|
||||||
if [ -f "$CURL_CMD" ]; then
|
if [ -f "$CURL_CMD" ]; then
|
||||||
ui_print "curl binary found."
|
ui_print "curl binary is ready."
|
||||||
else
|
else
|
||||||
ui_print "curl binary not found. Exiting."
|
ui_print "Error: curl binary not found."
|
||||||
abort "curl binary not found."
|
abort "curl binary not found."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -52,38 +50,35 @@ if [ -f "/apex/com.android.btservices/lib64/libbluetooth_jni.so" ]; then
|
|||||||
SOURCE_FILE="/apex/com.android.btservices/lib64/libbluetooth_jni.so"
|
SOURCE_FILE="/apex/com.android.btservices/lib64/libbluetooth_jni.so"
|
||||||
LIBRARY_NAME="libbluetooth_jni.so"
|
LIBRARY_NAME="libbluetooth_jni.so"
|
||||||
PATCHED_FILE_NAME="libbluetooth_jni_patched.so"
|
PATCHED_FILE_NAME="libbluetooth_jni_patched.so"
|
||||||
ui_print "Detected library: libbluetooth_jni.so in /apex/com.android.btservices/lib64/"
|
ui_print "Detected library: libbluetooth_jni.so"
|
||||||
elif [ -f "/system/lib64/libbluetooth_jni.so" ]; then
|
elif [ -f "/system/lib64/libbluetooth_jni.so" ]; then
|
||||||
SOURCE_FILE="/system/lib64/libbluetooth_jni.so"
|
SOURCE_FILE="/system/lib64/libbluetooth_jni.so"
|
||||||
LIBRARY_NAME="libbluetooth_jni.so"
|
LIBRARY_NAME="libbluetooth_jni.so"
|
||||||
PATCHED_FILE_NAME="libbluetooth_jni_patched.so"
|
PATCHED_FILE_NAME="libbluetooth_jni_patched.so"
|
||||||
ui_print "Detected library: libbluetooth_jni.so in /system/lib64/"
|
ui_print "Detected library: libbluetooth_jni.so"
|
||||||
elif [ -f "/system/lib64/libbluetooth_qti.so" ]; then
|
elif [ -f "/system/lib64/libbluetooth_qti.so" ]; then
|
||||||
SOURCE_FILE="/system/lib64/libbluetooth_qti.so"
|
SOURCE_FILE="/system/lib64/libbluetooth_qti.so"
|
||||||
LIBRARY_NAME="libbluetooth_qti.so"
|
LIBRARY_NAME="libbluetooth_qti.so"
|
||||||
PATCHED_FILE_NAME="libbluetooth_qti_patched.so"
|
PATCHED_FILE_NAME="libbluetooth_qti_patched.so"
|
||||||
ui_print "Detected QTI library: libbluetooth_qti.so in /system/lib64/"
|
ui_print "Detected QTI library: libbluetooth_qti.so"
|
||||||
elif [ -f "/system_ext/lib64/libbluetooth_qti.so" ]; then
|
elif [ -f "/system_ext/lib64/libbluetooth_qti.so" ]; then
|
||||||
SOURCE_FILE="/system_ext/lib64/libbluetooth_qti.so"
|
SOURCE_FILE="/system_ext/lib64/libbluetooth_qti.so"
|
||||||
LIBRARY_NAME="libbluetooth_qti.so"
|
LIBRARY_NAME="libbluetooth_qti.so"
|
||||||
PATCHED_FILE_NAME="libbluetooth_qti_patched.so"
|
PATCHED_FILE_NAME="libbluetooth_qti_patched.so"
|
||||||
ui_print "Detected QTI library: libbluetooth_qti.so in /system_ext/lib64/"
|
ui_print "Detected QTI library: libbluetooth_qti.so"
|
||||||
else
|
else
|
||||||
ui_print "No target library found. Exiting."
|
ui_print "Error: No target library found."
|
||||||
abort "No target library found."
|
abort "No target library found."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ui_print "Uploading $LIBRARY_NAME to the API for patching..."
|
ui_print "Uploading $LIBRARY_NAME for patching..."
|
||||||
ui_print "If you're concerned about privacy, review the source code of the API at https://github.com/kavishdevar/aln/blob/main/root-module-manual/server.py"
|
|
||||||
PATCHED_FILE_NAME="patched_$LIBRARY_NAME"
|
PATCHED_FILE_NAME="patched_$LIBRARY_NAME"
|
||||||
|
|
||||||
ui_print "calling command $CURL_CMD --verbose -k -X POST $API_URL -F file=@$SOURCE_FILE -F library_name=$LIBRARY_NAME -o $TEMP_DIR/$PATCHED_FILE_NAME"
|
$CURL_CMD -k -X POST $API_URL -F file=@"$SOURCE_FILE" -F library_name="$LIBRARY_NAME" -o "$TEMP_DIR/$PATCHED_FILE_NAME" > "$TEMP_DIR/headers.txt" 2>&1
|
||||||
|
|
||||||
$CURL_CMD --verbose -k -X POST $API_URL -F file=@"$SOURCE_FILE" -F library_name="$LIBRARY_NAME" -o "$TEMP_DIR/$PATCHED_FILE_NAME" > "$TEMP_DIR/headers.txt" 2>&1
|
|
||||||
|
|
||||||
if [ -f "$TEMP_DIR/$PATCHED_FILE_NAME" ]; then
|
if [ -f "$TEMP_DIR/$PATCHED_FILE_NAME" ]; then
|
||||||
ui_print "Received patched file from the API."
|
ui_print "Patched file received."
|
||||||
ui_print "Installing patched file to the module's directory..."
|
ui_print "Installing patched file..."
|
||||||
|
|
||||||
if [[ "$SOURCE_FILE" == *"/system/lib64"* ]]; then
|
if [[ "$SOURCE_FILE" == *"/system/lib64"* ]]; then
|
||||||
TARGET_DIR="$MODPATH/system/lib64"
|
TARGET_DIR="$MODPATH/system/lib64"
|
||||||
@@ -118,10 +113,10 @@ mount -t overlay overlay -o lowerdir=$APEX_LIB_DIR,upperdir=$MOD_APEX_LIB_DIR,wo
|
|||||||
EOF
|
EOF
|
||||||
|
|
||||||
set_perm "$POST_DATA_FS_SCRIPT" 0 0 755
|
set_perm "$POST_DATA_FS_SCRIPT" 0 0 755
|
||||||
ui_print "Created post-data-fs.sh script for apex library handling."
|
ui_print "Created script for apex library handling."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
ui_print "Failed to receive patched file from the API."
|
ui_print "Error: Failed to receive patched file."
|
||||||
rm -rf "$TEMP_DIR"
|
rm -rf "$TEMP_DIR"
|
||||||
abort "Failed to patch the library."
|
abort "Failed to patch the library."
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user