Pour mémoire:
https://chromium.googlesource.com/chromium/src/+/master/docs/linux_eclipse_dev.md
Blog de Chrystophe Vergnaud
This dialog contains the following message : « An app wants to make your device visible to other Bluetooth devices… »
if you look in the code you’ll see that this dialog is related to the Settings application, particularly RequestPermissionActivty.java. You’ll see also that a boolean can automatically click on the yes button, exactly what we need:
if (getResources().getBoolean(R.bool.auto_confirm_bluetooth_activation_dialog) == true) { // dismiss dialog immediately if settings say so onClick(null, DialogInterface.BUTTON_POSITIVE); }
So the trick is to find where is this boolean. It is quite obvious and it must be in the res folder in the bools file. So looking in packages/apps/Settings/res/values/bools.xml we find what we need:
<!-- Whether the bluetooth activation confirmation dialogs should be auto dismissed. Can be overridden for specific product builds. --> <bool name="auto_confirm_bluetooth_activation_dialog">false</bool>
switching the value to true and the trick is done.
Enjoy !
___
Docs officielles android pour le build d’une ROM: https://source.android.com/source/building-running.html
Configurer l’environnement pour avoir les actions dans l’environnement.
$ . ./build/envsetup.sh
===============================
voir les usb:
$ lsusb $ dmesg
Faire un udev pour avoir un nom potable dans le /dev et avoir l’adb qui le detecte vi /etc/udev/conf.d/50-custom_device.conf
ajouter la ligne suivante en faisant matcher le vendor et le product avec la sortie de lsusb (ici 04e8:6860) le group est le group (systeme) authorisé a utiliser le device, le symlink est le nom affiché SUBSYSTEM== »usb », ATTRS{idVendor}== »04e8″, ATTRS{idProduct}== »6860″, MODE= »0666″ GROUP= »my_group », SYMLINK+= »i9305″
recharger la config udev
udevadm control --reload-rules
optionnel : update adb list
$ android update adb
ajouter le product id dans la liste adbf Edit $HOME/.android/adb_usb.ini, add 0x2207 at the end of the file Restart adb server
$ adb kill-server && adb start-server
List android device
$ adb devices
lien pour la doc sur udev: http://www.reactivated.net/writing_udev_rules.html#syntax https://wiki.debian.org/udev
==================================
doc sur : https://github.com/spion/adbfs-rootless
adbfs /chemin_de_mount
Suivre le readme Attention il faut avoir les droit pour lancer l’outil car il lance fuse qui accede a bas niveau:
============
taper sur le tel *#06#
=============
backup dans le repertoire courant (cree le fichier backup.ab)
adb backup -apk -shared -all
restaurer depuis le fichier backup.ab
adb restore backup.ab
arreter le server proprement
adb kill-server
=====================
Telecharger recovery clockwork puis installer heimdall lancer l’installation de la recovery:
$ heimdall flash --RECOVERY /home/ow-cve/dev/RCW/recovery-clockwork-6.0.4.7-i9305.img
========================================
You’ll first need to build rk-tools:
git clone https://github.com/rk3066/rk-tools.git cd rk-tools sudo apt-get install libssl-dev libcrypto++-dev make
Then use img_unpack tools to unpack the firmware to another format:
./img_unpack update_mk908_106j2107_04.img update_mk908_106j2107_04_unpack.img rom header code: 1060000 rom version: 4.1.1 build time: 2013-09-07 10:39:22 chip: 70 checking md5sum....OK
Finally, run afptool to extract the files from the resulting file into “firmware” directory:
./afptool -unpack update_mk908_106j2107_04_unpack.img firmware Check file...OK- UNPACK- package-file 0x00000800 0x00000242 RK3188Loader(L)_V1.20.bin 0x00001000 0x0002F8AE parameter 0x00031000 0x00000264 Image/misc.img 0x00031800 0x0000C000 Image/boot.img 0x0003D800 0x00A2C000 Image/recovery.img 0x00A69800 0x00BFC000 Image/system.img 0x01665800 0x1A630000 backupimage/backup.img 0x1BC95800 0x01665004 update-script 0x1D2FB000 0x000003A5 recover-script 0x1D2FB800 0x0000010A UnPack OK!
==================================
copier l’app dans /packages/apps/<mon_app_dir> copier un Android.mk d’une autre app et mettre a jour les parametres de celui-ci.
=================================
Configurer l’environnement pour avoir les actions dans l’environnement.
$ . build/envsetup.sh $ mmm /packages/apps/<mon_app_dir>
===================================
afptool et img_pack ne gere pas bien les chemin absolu donc : – faire un lien sym « tmp » dans le repertoire d’afptool qui pointe vers les img du build android
– puis creer le script suivant dans le repertoire afptool:
#!/bin/bash set -e cd `dirname $0` rm -f tmp.img rm -f update.img # put all img in one single img ./afptool -pack tmp tmp.img # add RockChip specific param and bootloader ./img_maker -rk31 tmp/RK3188Loader_2.16.bin 1 0 0 tmp.img update.img rm -f tmp.img echo "update.img is at `pwd`/update.img"
ca genere un fichier update.img dans le repertoire d’afptool.
If you have the sources of your box and you want to disable permanently some services you can use system properties.
first look at there, you’ll see how services are started :
frameworks/base/services/java/com/android/server/SystemServer.java
then you’ll see that most of the services have a boolean related to a system property, for instance location :
boolean disableLocation = SystemProperties.getBoolean("config.disable_location", false);
and deeper in the file, you’ll see that this boolean is used to disable the service :
if (!disableLocation) { try { Slog.i(TAG, "Location Manager"); location = new LocationManagerService(context); ServiceManager.addService(Context.LOCATION_SERVICE, location);
so basically you just have to find your system property file in your device tree, and force the value to true. Use a « find » to get it.
On rockchip device it is easy : the file name is system.prop. This file is used to generate the build.prop in the out folder.
Another way to force system properties is to use the Android.mk and force value with this specific token:
PRODUCT_PROPERTY_OVERRIDES += \ config.disable_location = true
Enjoy!