A blog documenting projects and ideas

Qpython Bluetooth admin permission patch

Qpython for android is very handy for getting an idea up and running quickly. There is a problem with its bluetooth permissions though which means that whenever any Bluetooth related function is run, a permissions error occurs. Sometimes the error message says something about Bluetooth requiring administrator permission to be used but in this case I received a connection refused message:

After searching online, there was only one post related to this on a forum. Luckily a user suggested that decompiling the .apk file, editing the AndroidManifest.xml file to give the Qpython app the correct permissions and then rebuilding the .apk file should fix the issue. To work with the .apk file I used apktool for decompiling and rebuilding. Here are the commands used:

Place the .apk file (in this case I renamed mine to test.apk) in the same directory as the apktool.jar file and run the following command to decompile the .apk file:

java -jar d test.apk

After the file is decompiled, open up the AndroidManifest.xml and add in the following line:

This will take test.apk, sign it and output test_signed.apk. Now the app can be transferred to a smartphone and installed. After the modified app was installed I managed to find and connect to my computer with no errors. Here is what it looked like in the terminal: