Skip to content

Commit 888f1b3

Browse files
committed
add better logging to the root module installer
1 parent 9a4d561 commit 888f1b3

File tree

2 files changed

+16
-24
lines changed

2 files changed

+16
-24
lines changed

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,10 @@ This tray app communicates with a daemon with the help of a UNIX socket. The dae
3737
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.
3838

3939
> [!CAUTION]
40-
> **This workaround requires root access.** Try at your own risk.
40+
> **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.
4141
4242
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.
4343

44-
Tested with
45-
- KernelSU
46-
4744
### Features
4845

4946
#### Renaming the Airpods

root-module/customize.sh

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ mkdir -p "$TEMP_DIR"
1212
mkdir -p "$UNZIP_DIR"
1313

1414
# Manually extract the $ZIPFILE to a temporary directory
15-
ui_print "Extracting $ZIPFILE to $UNZIP_DIR"
15+
ui_print "Extracting module files..."
1616
unzip -o "$ZIPFILE" -d "$UNZIP_DIR" > /dev/null 2>&1
1717
if [ $? -ne 0 ]; then
18-
ui_print "Failed to unzip $ZIPFILE"
18+
ui_print "Error: Failed to extract module files."
1919
abort "Failed to unzip $ZIPFILE"
2020
fi
2121

22-
ui_print "Extracted module files to $UNZIP_DIR"
23-
2422
# Determine architecture
2523
IS64BIT=false
2624
if [ "$(uname -m)" = "aarch64" ]; then
@@ -42,48 +40,45 @@ fi
4240
set_perm "$CURL_CMD" 0 0 755
4341

4442
if [ -f "$CURL_CMD" ]; then
45-
ui_print "curl binary found."
43+
ui_print "curl binary is ready."
4644
else
47-
ui_print "curl binary not found. Exiting."
45+
ui_print "Error: curl binary not found."
4846
abort "curl binary not found."
4947
fi
5048

5149
if [ -f "/apex/com.android.btservices/lib64/libbluetooth_jni.so" ]; then
5250
SOURCE_FILE="/apex/com.android.btservices/lib64/libbluetooth_jni.so"
5351
LIBRARY_NAME="libbluetooth_jni.so"
5452
PATCHED_FILE_NAME="libbluetooth_jni_patched.so"
55-
ui_print "Detected library: libbluetooth_jni.so in /apex/com.android.btservices/lib64/"
53+
ui_print "Detected library: libbluetooth_jni.so"
5654
elif [ -f "/system/lib64/libbluetooth_jni.so" ]; then
5755
SOURCE_FILE="/system/lib64/libbluetooth_jni.so"
5856
LIBRARY_NAME="libbluetooth_jni.so"
5957
PATCHED_FILE_NAME="libbluetooth_jni_patched.so"
60-
ui_print "Detected library: libbluetooth_jni.so in /system/lib64/"
58+
ui_print "Detected library: libbluetooth_jni.so"
6159
elif [ -f "/system/lib64/libbluetooth_qti.so" ]; then
6260
SOURCE_FILE="/system/lib64/libbluetooth_qti.so"
6361
LIBRARY_NAME="libbluetooth_qti.so"
6462
PATCHED_FILE_NAME="libbluetooth_qti_patched.so"
65-
ui_print "Detected QTI library: libbluetooth_qti.so in /system/lib64/"
63+
ui_print "Detected QTI library: libbluetooth_qti.so"
6664
elif [ -f "/system_ext/lib64/libbluetooth_qti.so" ]; then
6765
SOURCE_FILE="/system_ext/lib64/libbluetooth_qti.so"
6866
LIBRARY_NAME="libbluetooth_qti.so"
6967
PATCHED_FILE_NAME="libbluetooth_qti_patched.so"
70-
ui_print "Detected QTI library: libbluetooth_qti.so in /system_ext/lib64/"
68+
ui_print "Detected QTI library: libbluetooth_qti.so"
7169
else
72-
ui_print "No target library found. Exiting."
70+
ui_print "Error: No target library found."
7371
abort "No target library found."
7472
fi
7573

76-
ui_print "Uploading $LIBRARY_NAME to the API for patching..."
77-
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"
74+
ui_print "Uploading $LIBRARY_NAME for patching..."
7875
PATCHED_FILE_NAME="patched_$LIBRARY_NAME"
7976

80-
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"
81-
82-
$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
77+
$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
8378

8479
if [ -f "$TEMP_DIR/$PATCHED_FILE_NAME" ]; then
85-
ui_print "Received patched file from the API."
86-
ui_print "Installing patched file to the module's directory..."
80+
ui_print "Patched file received."
81+
ui_print "Installing patched file..."
8782

8883
if [[ "$SOURCE_FILE" == *"/system/lib64"* ]]; then
8984
TARGET_DIR="$MODPATH/system/lib64"
@@ -118,10 +113,10 @@ mount -t overlay overlay -o lowerdir=$APEX_LIB_DIR,upperdir=$MOD_APEX_LIB_DIR,wo
118113
EOF
119114

120115
set_perm "$POST_DATA_FS_SCRIPT" 0 0 755
121-
ui_print "Created post-data-fs.sh script for apex library handling."
116+
ui_print "Created script for apex library handling."
122117
fi
123118
else
124-
ui_print "Failed to receive patched file from the API."
119+
ui_print "Error: Failed to receive patched file."
125120
rm -rf "$TEMP_DIR"
126121
abort "Failed to patch the library."
127122
fi

0 commit comments

Comments
 (0)