This shows you the differences between two versions of the page.
Previous revisionNext revision | |||
— | fuss:android [2020/10/24 18:07] – [Fixing MicroG/UnifiedNLP Permissions] office | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Enable Developer Options ====== | ||
+ | |||
+ | There are several ways to do this depending on the device, but usually the procedure is to open the Android settings application and find something along the lines of '' | ||
+ | |||
+ | ====== Access Android via The Command Line ====== | ||
+ | |||
+ | First, developer mode has to be enabled and '' | ||
+ | |||
+ | On OSX, adb can be installed via Homebrew: | ||
+ | <code bash> | ||
+ | brew install caskroom/ | ||
+ | </ | ||
+ | |||
+ | Once the device is connected via USB, issue: | ||
+ | <code bash> | ||
+ | adb shell | ||
+ | </ | ||
+ | |||
+ | You may get the error message: | ||
+ | < | ||
+ | error: device unauthorized. | ||
+ | This adb server' | ||
+ | Try 'adb kill-server' | ||
+ | </ | ||
+ | |||
+ | in which case, issue '' | ||
+ | |||
+ | |||
+ | ====== Write to Root Filesystem ====== | ||
+ | |||
+ | In order to be able to write to the root filesystem, issue: | ||
+ | <code bash> | ||
+ | mount -o remount,rw / | ||
+ | </ | ||
+ | |||
+ | Some folders in the root are symlinked into the ''/ | ||
+ | <code bash> | ||
+ | mount -o remount,rw /system | ||
+ | </ | ||
+ | |||
+ | ====== Generating Keys and Signing Packages ====== | ||
+ | |||
+ | Keys can be generated by issuing: | ||
+ | <code bash> | ||
+ | openssl genrsa -out key.pem 1024 | ||
+ | openssl req -new -key key.pem -out request.pem | ||
+ | openssl x509 -req -days 9999 -in request.pem -signkey key.pem -out certificate.pem | ||
+ | openssl pkcs8 -topk8 -outform DER -in key.pem -inform PEM -out key.pk8 -nocrypt | ||
+ | </ | ||
+ | |||
+ | and then can be signed using {{fuss: | ||
+ | < | ||
+ | java -jar SignApk.jar certificate.pem key.pk8 Application.apk Application_signed.apk | ||
+ | </ | ||
+ | where: | ||
+ | * '' | ||
+ | * '' | ||
+ | |||
+ | A package can be opened with a simple zip program and you do not need to use '' | ||
+ | |||
+ | ====== Disable Hardware Keys ====== | ||
+ | |||
+ | To disable hardware keys, root is needed and then a hardware key map file must be edited. Using a root explorer, navigate to ''/ | ||
+ | |||
+ | Edit the file and place a hash sign (''#'' | ||
+ | < | ||
+ | key 115 VOLUME_UP | ||
+ | </ | ||
+ | |||
+ | will turn into: | ||
+ | < | ||
+ | #key 115 VOLUME_UP | ||
+ | </ | ||
+ | |||
+ | Finally, restart the device for the changes to take effect. Note that this is a good and reliable way to disable the power button. | ||
+ | |||
+ | ====== Completely Disable Calls ====== | ||
+ | |||
+ | An easy trick to disable calls (such as the emergency call button from the lock screen), is to go to the phone settings, manage applications and disable the '' | ||
+ | |||
+ | ====== Android x86 on LibVirt ====== | ||
+ | |||
+ | In case Android x86 under qemu/kvm boots to a command prompt (or just displays a blank screen with a curor) and does not go any further then most likely the problem is that '' | ||
+ | |||
+ | After installing Android under libvirt, the domain name has to be edited, for instance: | ||
+ | <code bash> | ||
+ | virsh -c qemu:/// | ||
+ | </ | ||
+ | |||
+ | followed by: | ||
+ | < | ||
+ | edit android.domain | ||
+ | </ | ||
+ | |||
+ | The '' | ||
+ | < | ||
+ | < | ||
+ | <model type=' | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | to allow Android to boot the window manager. | ||
+ | |||
+ | Even better: | ||
+ | < | ||
+ | < | ||
+ | <model type=' | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | can be used for 3D acceleration. | ||
+ | |||
+ | ====== Delivering Input Events via ADB ====== | ||
+ | |||
+ | Input events can be sent to a device connected to a computer with the Android Platform Tools installed via the '' | ||
+ | |||
+ | Here is a list of useful commands: | ||
+ | <code bash> | ||
+ | adb shell input tap 500 600 | ||
+ | </ | ||
+ | |||
+ | will tap the screen at $(x, | ||
+ | |||
+ | <code bash> | ||
+ | adb shell input text 'Hello Android' | ||
+ | </ | ||
+ | |||
+ | will type in the text 'Hello Android' | ||
+ | |||
+ | Even raw key events can be sent: | ||
+ | <code bash> | ||
+ | adb shell input keyevent 66 | ||
+ | </ | ||
+ | |||
+ | will press the enter key. | ||
+ | |||
+ | Similarly, D-PAD events can be triggered: | ||
+ | |||
+ | ^ Direction ^ KeyCode ^ | ||
+ | | Up | '' | ||
+ | | Down | '' | ||
+ | | Left | '' | ||
+ | | Right | '' | ||
+ | |||
+ | For instance: | ||
+ | <code bash> | ||
+ | adb shell input keyevent 19 | ||
+ | </ | ||
+ | |||
+ | will press D-PAD up. | ||
+ | |||
+ | ====== Fixing MicroG/ | ||
+ | |||
+ | Issue the following commands via ADB to fix permissions for most packages involved with UnifiedNLP: | ||
+ | <code bash> | ||
+ | pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION | ||
+ | pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION | ||
+ | pm grant com.google.android.gms android.permission.GET_ACCOUNTS | ||
+ | pm grant com.google.android.gms android.permission.READ_EXTERNAL_STORAGE | ||
+ | pm grant com.google.android.gms android.permission.READ_PHONE_STATE | ||
+ | pm grant com.google.android.gms android.permission.WRITE_EXTERNAL_STORAGE | ||
+ | |||
+ | pm grant com.android.vending android.permission.ACCESS_COARSE_LOCATION | ||
+ | pm grant com.android.vending android.permission.ACCESS_FINE_LOCATION | ||
+ | pm grant com.android.vending android.permission.GET_ACCOUNTS | ||
+ | pm grant com.android.vending android.permission.READ_EXTERNAL_STORAGE | ||
+ | pm grant com.android.vending android.permission.READ_PHONE_STATE | ||
+ | pm grant com.android.vending android.permission.WRITE_EXTERNAL_STORAGE | ||
+ | |||
+ | pm grant org.microg.nlp.backend.ichnaea android.permission.ACCESS_COARSE_LOCATION | ||
+ | pm grant org.microg.nlp.backend.ichnaea android.permission.ACCESS_FINE_LOCATION | ||
+ | pm grant org.microg.nlp.backend.ichnaea android.permission.READ_PHONE_STATE | ||
+ | |||
+ | pm grant org.fitchfamily.android.dejavu android.permission.ACCESS_COARSE_LOCATION | ||
+ | pm grant org.fitchfamily.android.dejavu android.permission.ACCESS_FINE_LOCATION | ||
+ | |||
+ | pm grant com.google.android.gms android.permission.ACCESS_COARSE_LOCATION | ||
+ | pm grant com.google.android.gms android.permission.ACCESS_FINE_LOCATION | ||
+ | pm grant com.google.android.gms android.permission.GET_ACCOUNTS | ||
+ | pm grant com.google.android.gms android.permission.READ_EXTERNAL_STORAGE | ||
+ | pm grant com.google.android.gms android.permission.READ_PHONE_STATE | ||
+ | pm grant com.google.android.gms android.permission.WRITE_EXTERNAL_STORAGE | ||
+ | |||
+ | pm grant com.android.vending android.permission.ACCESS_COARSE_LOCATION | ||
+ | pm grant com.android.vending android.permission.ACCESS_FINE_LOCATION | ||
+ | pm grant com.android.vending android.permission.GET_ACCOUNTS | ||
+ | pm grant com.android.vending android.permission.READ_EXTERNAL_STORAGE | ||
+ | pm grant com.android.vending android.permission.READ_PHONE_STATE | ||
+ | pm grant com.android.vending android.permission.WRITE_EXTERNAL_STORAGE | ||
+ | |||
+ | pm grant org.microg.nlp.backend.ichnaea android.permission.ACCESS_COARSE_LOCATION | ||
+ | pm grant org.microg.nlp.backend.ichnaea android.permission.ACCESS_FINE_LOCATION | ||
+ | pm grant org.microg.nlp.backend.ichnaea android.permission.READ_PHONE_STATE | ||
+ | |||
+ | pm grant org.fitchfamily.android.dejavu android.permission.ACCESS_COARSE_LOCATION | ||
+ | pm grant org.fitchfamily.android.dejavu android.permission.ACCESS_FINE_LOCATION | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | ====== Unlock via TWRP ====== | ||
+ | |||
+ | Delete the files under ''/ | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||