Things to note (unsorted until now) about the BQ Aquaris E 4.5 Ubuntu phone Matthias Apitz http://www.unixarea.de/bq/bq-aquaris-e45-ubuntu.txt ********************************************************************************** * * * As of October 18, 2015 this is now not longer updated, use the GibtBook in * * * * https://www.gitbook.com/book/gurucubano/bq-aquaris-e-4-5-ubuntu-phone/details * * * * and there in English and Spanish (Español) * * * ********************************************************************************** 1. How to get SSH access to the ubuntu-phone via Wifi: 2. The files (pictures, ...) end up in: 3. The touchscreen 4. The available disk space is like this: 5. USB networking: tethering 6. GPS, OSM maps && app 7. Capturing the MIR screen for presentation, talks etc. on a X11 desktop 8. Development resources from where to start reading 9. Firewall 10. Using the phone as a router to Internet for the netbook 11. Import and export of Contacts 12. ssh localhost 13. How to lauch apps from the phablet's cmd line 14. How to alter presented keyboard's Control keys 15. Call and SMS history 17. Access to logs in the device 18. How to alter presented apps in the app scope (UNTESTED) 19. Developmen and SDK (completely UNTESTED until now) 20. Sending SMS from shell 21. MUA (Dekko) 22. Hardware test menus 23. Cron jobs 24. GPRS config file 25. Restart the Unity UI 26. Sanitisation 27. Usefull links 28. Webbrowser history 29. Flashing the device 30. Installing an additional root FS and run 'mutt' 31. Compiling the Telegram client "telegram-cli" in the jail 32. Compiling the MUA mutt and making a click app of it (UNFINISHED) 33. Click making the ubuntu-terminal-app 34. Exporting notes from app 'reminder' 35. Using ubuntu-device-flash xx. Other usefull commands (unsorted) 1. How to get SSH access to the ubuntu-phone via Wifi: login via terminal app, you will be user 'phablet' (the password is the unlock number) enable SSH service with (remains after boot): $ android-gadget-service enable ssh fetch your public key to the Phone from some place: $ wget http://www.unixarea.de/id_rsa.pub $ mkdir .ssh $ chmod 0700 .ssh $ mv id_rsa.pub .ssh/authorized_keys Now you can look up your IP on the phone and use ssh to connect: $ ip addr show wlan0|grep inet from your workstation use: ssh phablet@ SSH-in is even possible when the device is locked and black; don't know if this is intention that it does not suspend; the configuration goes like this see also: http://askubuntu.com/questions/348714/how-can-i-access-my-ubuntu-phone-over-ssh/599041#599041 2. The files (pictures, ...) end up in: ~/Downloads ~/Pictures ~/Pictures/Screenshots ~/Pictures/com.ubuntu.camera ~/Pictures/com.ubuntu.camera/image20150329_183823514.jpg ~/Videos ~/Videos/com.ubuntu.camera ~/Documents You may copy file to ~/Pictures/com.ubuntu.camera/ but the app only accepts .jpg files; JPEG fotos are of the following dates: $ jhead image20150329_183823514.jpg File name : image20150329_183823514.jpg File size : 568513 bytes File date : 2015:03:29 18:39:43 Camera make : bq Camera model : Aquaris E4.5 Date/Time : 2015:03:29 18:38:24 Resolution : 2448 x 4352 Flash used : Yes Focal length : 3.5mm Digital Zoom : 1.140x Exposure time: 0.030 s (1/33) Aperture : f/2.4 ISO equiv. : 132 Whitebalance : Auto Metering Mode: center weight JPEG Quality : 80 3. The touchscreen is capacitive (the Openmoko Freerunner's is resistive) which makes it difficult to use some pen; 4. The available disk space is like this: Filesystem Size Used Avail Use% Mounted on /dev/mmcblk0p6 2.0G 1.6G 369M 81% / /dev/mmcblk0p7 4.4G 273M 4.0G 7% /home 5. USB networking: tethering For networking the bq supports tethering via an USB device (run the following in the terminal app): $ android-gadget-service enable rndis see script ~/rndis.sh. that will switch USB from MTP to tethering and create a 'rndis0' network device whith the IP addr 10.42.0.1; it offers to the connected computer an IP via DHCP (somehow it takes sometime) and SSH is fine too as: $ ssh phablet@10.42.0.1 Welcome to Ubuntu Utopic Unicorn (development branch) (GNU/Linux 3.4.67 armv7l) > I fill figure out how to permanently set this IP addr inside the Ubuntu, maybe an DHCP-server on the host side is to much. $ netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.2.1 0.0.0.0 UG 0 0 0 wlan0 10.42.0.0 0.0.0.0 255.255.255.0 U 0 0 0 rndis0 172.28.23.131 0.0.0.0 255.255.255.255 UH 0 0 0 ccmni0 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0 How can I set it as default to rndis enabled? Oliver Grawert: you cant, it is hardcoded on boot to always have working mtp (until here is a UI option to turn it on or off, we want regular users to lways be able to exchange files), but you can override it in a user pstart job that runs at a later point ... Create /home/phablet/.config/upstart/rndis.conf with the following content: --------------- snip ------------------ start on started indicator-network task script android-gadget-service enable rndis end script --------------- snap ---------------- When the interface rndis0 is enabled, somehow HTTPS access to the Ubuntu's app store is no longer possible; investigationg ... 6. GPS, OSM maps && app foxtrotGPS: Unresolved; foxtrotGPS is not ported, and the existings apps are somewhat crappy; OSMTouch: the app OSMTouch stores (uses?) the data from this dir: /home/phablet/.cache/me.yohanboniface.osmtouch/osm_100-1-9-260-172.png The default location is hardcoded at https://bazaar.launchpad.net/~yohanboniface/osmtouch/trunk/view/head:/OSMTouch.qml#L100 but this seems for another version; in r22 I have found them here and changed the default values for the location I'm in: Havana, Taufkirchen # ls -l /userdata/system-data/opt/click.ubuntu.com/me.yohanboniface.osmtouch/0.2.1/components/MapPa* -rw-r--r-- 1 clickpkg clickpkg 12415 jun 13 12:09 MapPage.qml -rw-r--r-- 1 clickpkg clickpkg 12416 jun 13 12:05 MapPage.qml.Havana -rw-r--r-- 1 clickpkg clickpkg 12408 dic 7 2014 MapPage.qml.orig -rw-r--r-- 1 clickpkg clickpkg 12415 jun 13 12:09 MapPage.qml.Taufkirchen Offline maps: I have in my FreeBSD netbook ~120.000 tiles of the locations Munich and Havana to make use of the maps even without Internet. I fetch them from time to time for the OpenStreetMap servers. Here are some technical notes about: The OSM wiki at http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames explains the name structure of the tiles and the different styles. The names are like this 'zoom/x/y.png' and tiles gets delivered in different styles: Standard: http://a.tile.openstreetmap.org/9/266/170.png ^----- [abc] MapQuest: http://otile1.mqcdn.com/tiles/1.0.0/osm/9/266/170.png ^----- [1234] http://otile1.mqcdn.com/tiles/1.0.0/osm/9/266/170.jpg ^----- [1234] OpenCycleMap Transport (experimental): http://a.tile2.opencyclemap.org/transport/9/266/170.png ^----- [abc] OSMTouch is normaly using 'MapQuest' style, I'm used to use 'Standard' style. ... (unfinished work about pre-fetching tiles) GPS in general: Things one can do to check the state of GPS: Make sure all switches for the GPS are on: 1. system settings -> security and privacy -> location access 2. system settings -> battery -> GPS 3. pull down top bar -> location -> location detection and GPS. $ sudo dmesg | grep GPS That will give output like: [142058.709985] [GPS] GPS_close: WMT turn off GPS OK! [142059.154167] GPS_open: major 191 minor 0 (pid 21501) [142059.154506] [WMT-CTRL][I]wmt_ctrl_gps_sync_set:ctrl GPS_SYNC(4) [142059.154526] [WMT-FUNC][I]wmt_func_gps_pre_ctrl:ctrl GPS_SYNC_SET(0) ok [142059.155455] [WMT-FUNC][I]wmt_func_gps_pre_ctrl:set reg for GPS_SYNC function okay by chip ic_pin_ctrl [142059.155492] [WMT-CTRL][I]wmt_ctrl_gps_lna_set:ctrl GPS_LNA(2) [142059.158530] [GPS] GPS_open: WMT turn on GPS OK! so you know the state of the GPS. to list the space vehicles: $ ubuntu-location-serviced-cli --bus system --get --property visible_space_vehicles Visible space vehicles: (type: gps, prn: 1, snr: 0, has_almanac_data: 0, has_ephimeris_data: 0, used_in_fix: 0, azimuth: 3 deg, elevation: 23 deg) Satellites with a snr > 0 are visible; to run a test: $ sudo GLOG_v=1000 GLOG_logtostderr=1 ubuntu-location-serviced-cli --bus system --test The test will try to acquire a fix from GPS only 3 times from cold start, and print out diagnostics together with a summary containing the mean/std.dev. of time to first fix. to activate more / better logging: the logs are in this dir: /var/log/ubuntu-location-service/ they would help in tracking down any potential issues; alter the config file: /etc/init/ubuntu-location-service.override and add the following two lines before the exec line: export GLOG_v=100 export GLOG_logtostderr=1 and reboot the phone. After having tried to acquire a position, the same log files as mentioned before contain very verbose information about the GPS operation. Using the dbus-monitor: $ dbus-monitor --system "path=/com/ubuntu/espoo/Service/Provider, interface=com.ubuntu.remote.Service.Provider, member=PositionChanged" But you need to switch on system settings -> security and privacy -> location access -> ..anonymized wifi... i believe 7. Capturing the MIR screen for presentation, talks etc. on a X11 desktop Launch on the phone my script ~/cast.sh which will do: +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+----- #!/bin/sh srcIP=`echo $SSH_CLIENT | cut -f1 -d' '` port=12345 printf "mirscreencast'ing to %s port %s\n" $srcIP $port # note about --cap-interval / -n and resulting fps (for mplayer): # --cap-interval 10 -n 6 gives: 6 frames per sec (use fps=6 in myplayer) # --cap-interval 1 -n 1 gives: 60 frames per sec (use fps=60 in myplayer) # the later of course with a high cost of launching 60 time per sec # the application 'mirscreencast' :-( # and this only due to a bug in 'mirscreencast'; see: # https://bugs.launchpad.net/mir/+bug/1439549 # # the bug was fixed with OTA-4 (r23) in June 2015, we do not need the while loop # anymore, but who know; we keep it for now ### while true; do ### mirscreencast -m /run/mir_socket --stdout --cap-interval 1 -s 270 480 -n 1 || break ### done | gzip -c | nc $srcIP $port mirscreencast -m /run/mir_socket --stdout --cap-interval 1 -s 270 480 \ | gzip -c | nc $srcIP $port +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+----- one must use USB tethering (Wifi seems to be to poor for the mass data of the frames); and launch first on the host 10.42.0.64 the presenter script ~/readScreenCast.sh which uses mplayer to present the cast: +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+----- #!/bin/sh # read the 'mirscreencast' from the Ubuntu phone's MIR server # see there 'cast.sh' # # co guru@unixarea.de, April 2015 nc -l 12345 | gzip -dc |\ mplayer -demuxer rawvideo -rawvideo fps=60:w=270:h=480:format=rgba - +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+----- works fine! 8. Development resources from where to start reading https://developer.ubuntu.com/en/start/ubuntu-for-devices/porting-new-device/ 9. Firewall The phone is completely open while connected to Wifi :-( but, 'ufw' is shipped on the phone. You can open a terminal and do: $ sudo ufw enable see also https://wiki.ubuntu.com/UncomplicatedFirewal XXX: not yet tested: $ sudo ufw allow ssh/tcp $ sudo ufw logging on $ sudo ufw enable $ sudo ufw status Firewall loaded 10. Using the phone as a router to Internet for the netbook Disable Wifi in the phone and in the netbook (if the Wifi is not routed to Internet); enable USB network with the phone; adjust default route and DNS (/etc/resolv.conf) in the netbook to the IP of the phone 10.42.0.1; restart sendmail in the netbook; and all is fine I crafted a script ~guru/route2BQ.sh for this: +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+----- #!/bin/sh # # change routing (...) to the Ubuntu phone BQ Aqaris E4.5 # ifconfig ue0 || { printf "interface ue0 not found -- exit.\n" exit 1 } ifconfig wlan0 down route delete default killall dhclient rm -f /etc/resolv.conf dhclient ue0 # route add default 10.42.0.1 test -f /etc/resolv.conf || { cat < /etc/resolv.conf # Generated by ~guru/route2BQ.sh nameserver 10.42.0.1 EOF } /etc/rc.d/sendmail stop sleep 3 /etc/rc.d/sendmail start +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+----- This script is executed on the fly (i.e. on plug-in of the USB with tethering enabled) by a FreeBSD devd(8) hook in /usr/local/etc/devd/bq.conf: +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+----- # # When the interface ue0 comes up we do in a script: # 1) start of dhclient for interface ue0 # 2) default route to interface ue0 # 3) restart of sendmail # # , June 2015 # notify 1 { match "system" "IFNET"; match "subsystem" "ue0"; match "type" "ATTACH"; action "/usr/local/etc/devd/bq.sh $subsystem $type"; }; +-----+-----++-----+-----+-----+-----+-----+-----+-----+-----+-----+----- 11. Import and export of Contacts Contacts can be imported from vCard files: $ syncevolution --import test.vcf backend=evolution-contacts #0: pas-id-552B785D00000008 see also: http://askubuntu.com/a/372342 If you have many vcf files, put them in a directory and pass the directory name as the --import argument. For export use: $ syncevolution --export /home/phablet/Documents/utcontacts.vcf backend=evolution-contacts More operations, see also https://syncevolution.org/wiki/item-operations $ syncevolution --print-databases | more ... Evolution Address Book = Evolution Contacts = evolution-contacts: Personal (system-address-book) $ syncevolution --print-items backend=evolution-contacts | more ... pas-id-55290E7600000002: Sparda Bank pas-id-5529531900000006: Hofpfisterei Deisenhofen pas-id-552B785D00000008: Gemeinde Taufkirchen ... The first word before the colon is an item ID. It is guaranteed to not contain a colon or characters that are special in a shell. The other item operation commands take such item IDs as optional parameters. Print to stdout (mind the hyphen after --export!), using the native data format of the storage (no conversion): $ syncevolution --export - backend=evolution-contacts --luids pas-id-55290E7600000002 BEGIN:VCARD VERSION:3.0 N:;Sparda Bank;;; X-EVOLUTION-FILE-AS:Sparda Bank TEL;TYPE=voice,work:08007009050 FN:Sparda Bank UID:pas-id-55290E7600000002 REV:2015-04-11T12:07:18Z(10) END:VCARD When several IDs are given, the vCards are seperated by empty lines, which are guaranteed to not occur in the items themselves. When no ID is given, all items are exported. How to update a single contact: $ syncevolution --export /tmp/sparda.vcf backend=evolution-contacts --luids pas-id-55290E7600000002 modify the file /tmp/sparda.vcf and reload it: $ syncevolution --update /tmp/sparda.vcf backend=evolution-contacts --luids pas-id-55290E7600000002 #0: pas-id-55290E7600000002 or you may delete it with: $ syncevolution --delete-items backend=evolution-contacts --luids pas-id-55290E7600000002 [INFO] deleting "Sparda Bank" and restore it again from the file with: $ syncevolution --import /tmp/sparda.vcf backend=evolution-contacts #0: pas-id-5579DC5D00000000 It is also possible to wipe out all items at once: $ syncevolution --delete-items backend=evolution-contacts --luids '*' 12. ssh localhost The terminal app is limited in its rights for good reasons; to get rid of this you must SSH from outside (Wifi, USB) or inside the terminal app SSH to localhost, which all is only posible with RSA keys; generate one and use it to connect from the terminal to localhost as: generate a key pair just for use on the phone itself (without a passphrase): $ cd ~/.ssh $ ssh-keygen -t rsa -f localhost_rsa $ cat localhost_rsa.pub >> authorized_keys edit ~/.ssh/authorized_keys and add this to the start of the last line: from="127.0.0.1" ssh-rsa AAAA... edit or create ~/.ssh/config and add: Host localhost Hostname 127.0.0.1 IdentityFile /home/phablet/.ssh/localhost_rsa now you can: $ ssh localhost 13. How to lauch apps from the phablet's cmd line There is a common app-launcher 'ubuntu-app-launch' and you may run: $ ubuntu-app-launch mediaplayer-app http://stream.dradio.de/7/251/142684/v1/gnl.akacast.akamaistream.net/dradio_mp3_dlf_s or to play files in the phone: $ ubuntu-app-launch mediaplayer-app file:///home/phablet/Music/VoiceMessage.wav $ ubuntu-app-launch mediaplayer-app file:///home/phablet/Music/mutti.mp3 I have a small script in ~phablet/pl.sh: $ cat pl.sh ubuntu-app-launch mediaplayer-app $1 and use just something like $ sh pl.sh VoiceMessage.wav Here is another example how to feed the Spanish Dictionara DRAE from the shell, the script 'rae.sh' sends the word is ISO coded to the server using the browser: #!/bin/sh # the server lema.rae.es only understands ISO 8859-1 coded words # but we have to send them via the 'ubuntu-app-launch' either in ASCII or in UTF-8, # so we rewrite the spanish tilded chars in ISO coding, but as %xx values iso=`echo $1 | sed 's/ñ/%f1/g' |\ sed 's/á/%e1/g' |\ sed 's/é/%e9/g' |\ sed 's/í/%ed/g' |\ sed 's/ó/%f3/g' |\ sed 's/ú/%fa/g' |\ sed 's/ü/%fc/g'` # ubuntu-app-launch webbrowser-app "http://lema.rae.es/drae/srv/search?val=$iso" ubuntu-app-launch webbrowser-app "http://lema.rae.es/drae/?val=$iso" 14. How to alter presented keyboard's Control keys I started with copying the file presenting the Control Keys: $ mkdir ~/.config/com.ubuntu.terminal/Layouts $ cp /opt/click.ubuntu.com/com.ubuntu.terminal/0.*/qml/KeyboardRows/Layouts/ScrollKeys.json ~/.config/com.ubuntu.terminal/Layouts/BashKeys.json name the target file 'BashKeys.json' and modified the main section: { "name" : "Bash Keys", "short_name" : "Bash", "buttons": [ ... and inserted one new key (after the 'Up' key): { "main_action" : { "type": "key", "text" : "\u21b2", "key" : "Enter" } }, after restarting the terminal there is a new function key to select named 'Bash'; see also: https://swordfishslabs.wordpress.com/2015/02/27/json-profiles-in-ubuntu-terminal-app/ and: http://www.unixarea.de/bq/screenshot20151222_081224450.png http://www.unixarea.de/bq/BashKeys.json and a new file for some network related cmd short-cuts: http://www.unixarea.de/bq/NetworkCommands.json BashKeys.json MuttKeys.json NetworkCommands.json 15. Call and SMS history The history of calls and messages are stored in a MySQL database; for safety reasons, we make a copy of it and look into it: $ cp .local/share/history-service/history.sqlite ~ $ sqlite3 history.sqlite SQLite version 3.8.5 2014-06-04 14:06:34 Enter ".help" for usage hints. sqlite> .schema voice_events CREATE TABLE voice_events ( accountId varchar(255), threadId varchar(255), eventId varchar(255), senderId varchar(255), timestamp datetime, newEvent bool, duration int, missed bool, remoteParticipant varchar(255)); ... sqlite> .schema text_events CREATE TABLE text_events ( accountId varchar(255), threadId varchar(255), eventId varchar(255), senderId varchar(255), timestamp datetime, newEvent bool, message varchar(512), messageType tinyint, messageStatus tinyint, readTimestamp datetime, subject varchar(256) ); ... sqlite> .output messages.txt sqlite> select * from text_events ; sqlite> .output calls.txt sqlite> select * from voice_events ; sqlite> .quit $ cat messages.txt ... ofono/ofono/account0|+49160xxxxxxx|2015-04-18T19:10:23+0200-1|+49160xxxxxxx|2015-04-18T17:10:29.000|0|amor|0|0|2015-04-18T17:11:12.160| $ cat calls.txt ... ofono/ofono/account0|089xxxxxxxx|089xxxxxxxx:mié. abr. 22 20:17:35 2015|self|2015-04-22T18:17:35.645|0|0|0|+4989xxxxxxxx Note: The column accountId (here: "ofono/ofono/account0") is the reference to the used SIM1 or SIM2 during the call. It can be probed which SIM is which account with: $ mc-tool dump ... Account: ofono/ofono/account0 Display Name: SIM 1 Normalized: +49176xxxxxxxx Enabled: enabled Icon: im-ofono Connects: automatically Nickname: +49176xxxxxxxx Service: ofono Presences: Automatic: available (2) "" Current: registered (2) "FONIC" Requested: available (2) "" Changing: no (string) modem-objpath = /ril_0 17. Access to logs in the device As root you have access to some ring buffer logs; the default size is 4 x 16 KBytes and you may read the ring buffer with something like $ sudo /system/bin/logcat -b radio -v time which lists and waits for further data written to the ring; or with $ sudo /system/bin/logcat -db radio -v time > /tmp/radio.log to copy the actual content for 'radio' away; other -b values are: 'main', 'system', 'radio' or 'events' and there are a lot of filter flags; just run the command with -h to understand them; Side note: DTMF data is visible in the ring for around 7 minutes; be careful after entering PIN or other sensitive data as DTMF into phone calls; 18. How to alter presented apps in the app scope (UNTESTED) I have one question regarding the app scope: Currently, there are 6 apps listed/pinned to the top (phone, contacts, messages, camera, browser and clock). Can I add/remove/change them? Replace clock with Dekko for example? Actually, you can, but there is no UI to alter that list. It is just a dconf key, so it can be customized. To change the clock app in the list, one just needs to set the key with all the apps, like so: $ gsettings set com.canonical.Unity.ClickScope core-apps '["dialer-app", "messaging-app", "address-book-app", "com.ubuntu.camera_camera", "webbrowser-app", "dekko.dekkoproject"]' To restore to default, just run: $ gsettings reset com.canonical.Unity.ClickScope core-apps It should be possible to run these from the Terminal app, though I am not sure if the gsettings command is blocked by apparmor. If so, you can enable developer mode and use phablet-shell while connected over USB, to run these commands. 19. Developmen and SDK (completely UNTESTED until now) From: Alberto Mardegan : SDK: See this IRC logs for instructions: http://irclogs.ubuntu.com/2015/03/23/%23ubuntu-app-devel.txt Start at 14:20, then see 14:28 and 14:37. Basically you need to get those debs Mirv mentioned and just copy the needed files into your chroot (which in my machine is in /var/lib/schroot/chroots/click-ubuntu-sdk-14.10-armhf/). 20. Sending SMS from shell How to send a SMS from the shell smd line: $ /usr/share/ofono/scripts/send-sms /ril_0 +4915122xxxxxx "hola amor" 0 Send message using modem /ril_0 ... /ril_0/message_9E43FC88AB4794131903B8CD3BF4D1254D18DBD9 21. MUA (Dekko) I figured out that the signature string (and other values) are stored in a file ~/.config/dekko.dekkoproject/dekko.dekkoproject.conf, for example the signature like this: ... identities\1\signature=Sent from my Ubuntu phone\nhttp://www.unixarea.de/ ... while one can insert \n for line breaks, if the string is longer no signature is attached to the mail; maybe just a small bug in the expected length of the string... It is a good idea to make backups of this file from time to time. If one is deleting mail via IMAP, these must be expunched by hand. Go to the lists of mailboxes of the account, slide left and click + symbol. Dekko's log files are in ~/.cache/upstart/application-click-dekko.dekkoproject_dekko_*.log ~/.cache/upstart/application-click-dekko.dekkoproject_dekko_*.log.1.gz ~/.cache/upstart/application-click-dekko.dekkoproject_dekko_*.log.2.gz ... To view PDF attachments install the "document viewer" app. 22. Hardware test menus Date: Tue, 05 May 2015 00:26:13 +0200 From: sturmflut To: ubuntu-phone today I discovered a "hidden" Factory Mode in the bq Aquaris E4.5 Ubuntu Edition. It can be accessed the following way: - Power off the device - Press the POWER and VOLUME DOWN buttons for more than ten seconds. The device will boot while you are pressing the buttons, so keep pressing. In short it offers tests for all of the device's hardware components, including cameras, Bluetooth, GPS, FM Radio etc. As far as I know this mode is only available on devices manufactured by HTC, such as the Aquaris E4.5 (krillin), and not on other devices such as the Meizu MX4. I documented my findings at [1]. Would be great if somebody could fill in the blanks, e.g. the necessary environment for the WiFi test http://sturmflut.github.io/ubuntu/bq/2015/05/04/hacking-the-bq-part-2-factory-mode/ 23. Cron jobs To run crontab jobs one must remount the rootfs: # mount -o remount,rw / crontatab -e # mount -o remount,ro / With this I installed a cron job for user 'phablet' which saves every five minutes the current list of all processes to catch this run away / battery drain problem $ sudo crontab -e -u phablet 00,05,10,15,20,25,30,35,40,45,50,55 * * * * /home/phablet/mon1.sh $ cat mon1.sh #!/bin/sh printf "\n\n" >> /home/phablet/mon.out date >> /home/phablet/mon.out printf "battery capacity%%: " >> /home/phablet/mon.out cat /sys/devices/platform/battery/power_supply/battery/capacity >> /home/phablet/mon.out printf "battery temp : " >> /home/phablet/mon.out cat /sys/devices/platform/battery/power_supply/battery/temp >> /home/phablet/mon.out top -b -n1 -o %CPU | head -n 20 >> /home/phablet/mon.out 24. GPRS config file The GPRS config file is in /var/lib/ofono/*/gprs Jonas Drange said: ... Take a backup, but if you are editing that file you might have to stop ofono. Otherwise ofono will ignore the changes. Maybe it's easier to execute “/usr/share/ofono/scripts/remove-contexts” and reboot? You can use the terminal app on the phone. We are currently working on the UI for this. 25. Restart the Unity UI Michael Zanetti said: $ restart unity8 26. Sanitisation 1. Wifi credentials for all known AP are stored in /userdata/system-data/etc/NetworkManager/system-connections/* (all known SSID names) 2. SMS sent/receive $ sqlite3 .local/share/history-service/history.sqlite sqlite> delete from text_events ; sqlite> vacuum ; the above only deletes the text, but not the numbers; you must issue as well: sqlite> delete from threads ; sqlite> vacuum ; 3. numbers dialed / called from $ sqlite3 .local/share/history-service/history.sqlite sqlite> delete from voice_events ; sqlite> vacuum ; 4. Contact data The are stored in the file ~phablet/.local/share/evolution/addressbook/system/contacts.db and one can wipe ALL out with: $ syncevolution --delete-items backend=evolution-contacts --luids '*' 5. Dekko MUA config and logs: $ rm ~/.config/dekko.dekkoproject/dekko.dekkoproject.conf and: $ rm ~/.cache/upstart/application-click-dekko.dekkoproject_dekko_* 27. Usefull links Installing adb and fastboot: http://bernaerts.dyndns.org/linux/74-ubuntu/328-ubuntu-trusty-android-adb-fastboot-qtadb Installation and flashing: http://sturmflut.github.io/ubuntu/touch/2015/05/07/hacking-ubuntu-touch-index/ : -- Hacking the bq, Part 1: Bootloader, Fastboot and Recovery -- Hacking the bq, Part 2: Factory Mode -- Hacking Ubuntu Touch, Part 1: ubuntu-device-flash -- Hacking Ubuntu Touch, Part 2: Devices and Images -- Hacking Ubuntu Touch, Part 3: How images are flashed -- Hacking Ubuntu Touch, Part 4: Developer mode and ADB -- Hacking Ubuntu Touch, Part 5: adb shell vs. phablet-shell -- Hacking Ubuntu Touch, Part 6: Logfiles -- Hacking the bq, Part 3: Supported media plugins and codecs -- Hacking Ubuntu Touch, Part 7: System and process monitoring tools (part 1) Flashing the E4.5: http://askubuntu.com/questions/602035/how-do-i-use-ubuntu-device-flash-with-the-bq-aquaris-e4-5-and-aquaris-e5 https://developer.ubuntu.com/en/start/ubuntu-for-devices/installing-ubuntu-for-devices/ http://wiki.ubuntuusers.de/Baustelle/Ubuntu_Touch_Erweiterte_Konfiguration https://bugs.launchpad.net/canonical-devices-system-image/+bug/1458756 List of where to file a bug report: https://wiki.ubuntu.com/Avengers Repair instructions and screen replacement (in Spanish): http://yoloreparo.com/manuales/smartphones-1/bq-41/bq-aquaris-e4-5-183/pantalla-display-y-digitalizador-1011 28. Webbrowser history The webbrowser-app's history is stored in: .local/share/webbrowser-app/history.sqlite Make a copy and read it as: $ cp .local/share/webbrowser-app/history.sqlite . $ sqlite3 history.sqlite SQLite version 3.8.5 2014-06-04 14:06:34 Enter ".help" for usage hints. sqlite> .tables history sqlite> .schema history CREATE TABLE history ( url VARCHAR, domain VARCHAR, title VARCHAR, icon VARCHAR, visits INTEGER, lastVisit DATETIME ); sqlite> .output url.txt sqlite> select * from history ; sqlite> .quit $ cat url.txt http://www.openstreetmap.org/about|openstreetmap.org|OpenStreetMap|http://www.openstreetmap.org/assets/osm_logo_228-da06200e84d502f8a9a91965aa72a97e.png|1|1427640513 http://www.openstreetmap.org/traces|openstreetmap.org|OpenStreetMap | Public GPS traces|http://www.openstreetmap.org/assets/osm_logo_228-da06200e84d502f8a9a91965aa72a97e.png|1|1427729840 http://pass.telekom.de/|telekom.de|Data usage - Xtra Handy DayFlat|http://pass.telekom.de/images/favicon.png|8|1428334325 ... 29. Flashing the device Hopefully not needed ever... http://askubuntu.com/questions/602035/how-do-i-use-ubuntu-device-flash-with-the-bq-aquaris-e4-5-and-aquaris-e5 says: For production Ubuntu Phone devices, adb has been disabled in recovery, and this affects ubuntu-device-flash operation. You must supply a recovery image with adb enabled, which ubuntu-device-flash will use temporarily while doing its work: For BQ Aquaris E4.5 Ubuntu Edition (aka krillin), use recovery-krillin.img (http://people.canonical.com/~jhm/barajas/recovery-krillin.img) For BQ Aquaris E5 Ubuntu Edition (aka vegetahd), use recovery-vegetahd.img ubuntu-device-flash can then be supplied with the --recovery-image argument, eg: $ ubuntu-device-flash touch --channel ubuntu-touch/stable/bq-aquaris.en \ --bootstrap --recovery-image path/to/downloaded/recovery.img Note that when the command prompts you with: Expecting the device to be in the bootloader... waiting You can put a Aquaris E4.5 and Aquaris E5 in the 'bootloader' by holding down Power + Volume Up for a few seconds, releasing the Power button when the red LED lights as the machine reboots, and then selecting 'fastboot' from the device's boot menu. unknown flag `recovery-image' If you get this error, that means you are still using an older version of ubuntu-device-flash. Please install the latest version using the ppa: $ sudo add-apt-repository ppa:phablet-team/tools $ sudo apt-get update; sudo apt-get upgrade 30. Installing an additional root FS and run 'mutt' This is loosely based on https://askubuntu.com/questions/620740 (which is fine but does not work as given). We do this while ssh'ed into the device. If you later want to use this system from the terminal-app see below about the ssh into localhost. Install the chrooted system as: $ wget http://cdimage.ubuntu.com/ubuntu-touch/vivid/daily-preinstalled/current/vivid-preinstalled-touch-armhf.tar.gz $ mkdir myRoot $ cd myRoot $ sudo tar xzf ../vivid-preinstalled-touch-armhf.tar.gz $ sudo chroot . # # echo "nameserver 127.0.1.1" > /etc/resolv.conf I don't know why the addr must be 127.0.1.1, but it's used as this in the host system of the BQ; in any case, this should make network happy and we can test it with: # ping www.muc.de and go to install, best while connected via Wifi: # apt-get update # apt-get install mutt # apt-get install libsasl2-modules # mutt needs this # apt-get install telnet # apt-get install vim # apt-get install tcpdump # apt-get install traceroute # apt-get install lynx # apt-get install qtbase5-dev # compile qt5, g++ ... stuff # apt-get install g++ # apt-get install ubuntu-device-flash # to get the image list # su phablet $ cd $ pwd /home/phablet # which is in real ~/myRoot/home/phablet $ mkdir tmp # needed by vim $ mkdir Mail # needed by mutt I copied some files from my netbook into the chrooted system, files needed by mutt: $ scp .muttrc phablet@ubuntu-phablet:~/myRoot/home/phablet $ scp -p .mutt-mail_aliases phablet@ubuntu-phablet:~/myRoot/home/phablet $ scp -rp .elm phablet@ubuntu-phablet:~/myRoot/home/phablet configure .muttrc for SMTP and IMAP, i.e. the essential changes are set record=+outboxBQ # save copies of outgoing messages in +outboxBQ # disable sendmail # set sendmail="/usr/sbin/sendmail -oi -oem -f guru@unixarea.de -t" # configure IMAP and SMTP as: set smtp_url="smtp://XXXXXXXXXXXXX@smtp.1blu.de" set smtp_pass="YYYYYYYYYYYYYYY" Now we can run mutt as: $ mutt -f imap://imap.1blu.de Note: The terminal-app is limited in its permisions to access the file system. We need to use "ssh localhost" to get full rights into the session (see above chapter 12). Start the terminal-app and do: $ ssh localhost $ cd myRoot $ sudo chroot . # su phablet $ cd $ mutt -f imap://imap.1blu.de So. And now, what about running X11 applications? For another way to set up a chroot see also: https://askubuntu.com/questions/620740/recommended-way-to-install-regularcli-deb-packages-on-ubuntu-phone/678031#678031 31. Compiling the Telegram client "telegram-cli" in the jail How to compile telegram-cli directly on the BQ. Make sure you have in the above constructed jail (see chap. 30) a working gcc: # apt-get update # apt-get install install gcc libc6-dev Download the sources with 'git', and install its dependency. The required Python does not match the installed version: # apt-get install git # apt-get install libreadline-dev libconfig-dev libssl-dev # apt-get install lua5.2 liblua5.2-dev libevent-dev libjansson-dev make $ git clone --recursive https://github.com/vysheng/tg.git $ cd tg $ ./configure --disable-python ... $ sudo mkdir /etc/telegram-cli $ sudo cp server.pub /etc/telegram-cli $ cp telegram-cli .. $ ~/telegram-cli Telegram-cli version 1.3.3, Copyright (C) 2013-2015 Vitaly Valtman Telegram-cli comes with ABSOLUTELY NO WARRANTY; for details type `show_license'. This is free software, and you are welcome to redistribute it under certain conditions; type `show_license' for details. Telegram-cli uses libtgl version 2.0.3 Telegram-cli includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/) I: config dir=[/home/phablet/.telegram-cli] > contact_list Emil Apitz ... Now Emil sends a message from his mobile 'Got it?' which arrives in telegram-cli and I replied with 'ok' [12:17] Emil Apitz >>> Got it? > msg Emil_Apitz ok [12:18] Emil Apitz <<< ok User Emil Apitz marked read 1 outbox and 0 inbox messages Note: The user Emit sent the message 'Got it?' and I received it with the Telegram client telegram-cli, and read it, but it stays in the device of Emil with only one single marker 'v'. This is what we wanted to have as PRIVACY. And here is how to run this from outside the jail: #!/bin/sh # to run the telegram-cli which we have compiled in a jail below /home/phablet/myRoot # from outside the jail # LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/phablet/myRoot/usr/lib/arm-linux-gnueabihf export LD_LIBRARY_PATH eval ~/myRoot/home/phablet/telegram-cli -k ~/myRoot/etc/telegram-cli/server.pub 32. Compiling the MUA mutt and making a click app of it (UNFINISHED) We compile the MUA 'mutt' in the same jail as used above. It requires some more dev infrastructure: # apt-get install libncursesw5-dev phablet@ubuntu-phablet:~$ sudo chroot myRoot root@ubuntu-phablet:/# su phablet phablet@ubuntu-phablet:/$ cd phablet@ubuntu-phablet:~$ cd mutt-1.5.23 phablet@ubuntu-phablet:~/mutt-1.5.23$ I configured mutt with the following values (in a small script c.sh): $ cat c.sh ./configure --with-curses --with-sasl=/usr --disable-fcntl --with-ssl=/usr --enable-external-dotlock --enable-pop --enable-imap --disable-warnings --disable-flock --enable-locales-fix --with-idn=no --disable-gpgme --enable-smtp --enable-debug $ make clean ; sh c.sh && make the resulting bin needs the following shared libs: $ ldd ./mutt libncursesw.so.5 => /lib/arm-linux-gnueabihf/libncursesw.so.5 (0xb6f9b000) libtinfo.so.5 => /lib/arm-linux-gnueabihf/libtinfo.so.5 (0xb6f70000) libssl.so.1.0.0 => /lib/arm-linux-gnueabihf/libssl.so.1.0.0 (0xb6f29000) libcrypto.so.1.0.0 => /lib/arm-linux-gnueabihf/libcrypto.so.1.0.0 (0xb6e11000) libsasl2.so.2 => /usr/lib/arm-linux-gnueabihf/libsasl2.so.2 (0xb6df0000) libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6 (0xb6d02000) /lib/ld-linux-armhf.so.3 (0xb6fde000) libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2 (0xb6cee000) and in addition (via libdl.so.2): $ ls -l /usr/lib/arm-linux-gnueabihf/sasl2/ total 148 lrwxrwxrwx 1 root root 22 mar 10 10:15 libanonymous.so -> libanonymous.so.2.0.25 lrwxrwxrwx 1 root root 22 mar 10 10:15 libanonymous.so.2 -> libanonymous.so.2.0.25 -rw-r--r-- 1 root root 13728 mar 10 10:15 libanonymous.so.2.0.25 lrwxrwxrwx 1 root root 20 mar 10 10:15 libcrammd5.so -> libcrammd5.so.2.0.25 lrwxrwxrwx 1 root root 20 mar 10 10:15 libcrammd5.so.2 -> libcrammd5.so.2.0.25 -rw-r--r-- 1 root root 13740 mar 10 10:15 libcrammd5.so.2.0.25 lrwxrwxrwx 1 root root 22 mar 10 10:15 libdigestmd5.so -> libdigestmd5.so.2.0.25 lrwxrwxrwx 1 root root 22 mar 10 10:15 libdigestmd5.so.2 -> libdigestmd5.so.2.0.25 -rw-r--r-- 1 root root 38524 mar 10 10:15 libdigestmd5.so.2.0.25 lrwxrwxrwx 1 root root 18 mar 10 10:15 liblogin.so -> liblogin.so.2.0.25 lrwxrwxrwx 1 root root 18 mar 10 10:15 liblogin.so.2 -> liblogin.so.2.0.25 -rw-r--r-- 1 root root 13728 mar 10 10:15 liblogin.so.2.0.25 lrwxrwxrwx 1 root root 17 mar 10 10:15 libntlm.so -> libntlm.so.2.0.25 lrwxrwxrwx 1 root root 17 mar 10 10:15 libntlm.so.2 -> libntlm.so.2.0.25 -rw-r--r-- 1 root root 21924 mar 10 10:15 libntlm.so.2.0.25 lrwxrwxrwx 1 root root 18 mar 10 10:15 libplain.so -> libplain.so.2.0.25 lrwxrwxrwx 1 root root 18 mar 10 10:15 libplain.so.2 -> libplain.so.2.0.25 -rw-r--r-- 1 root root 13728 mar 10 10:15 libplain.so.2.0.25 lrwxrwxrwx 1 root root 19 mar 10 10:15 libsasldb.so -> libsasldb.so.2.0.25 lrwxrwxrwx 1 root root 19 mar 10 10:15 libsasldb.so.2 -> libsasldb.so.2.0.25 -rw-r--r-- 1 root root 17744 mar 10 10:15 libsasldb.so.2.0.2 We move out of jail and create a top level dir for our new 'app' phablet@ubuntu-phablet:~$ mkdir ~/mutt.clico phablet@ubuntu-phablet:~$ cp -p myRoot/home/phablet/mutt-1.5.23/mutt ~/mutt.clico phablet@ubuntu-phablet:~$ cp -p myRoot/home/phablet/mutt-1.5.23/mutt_dotlock ~/mutt.clico In addition we need some files and the above mentioned shared libs below ~/mutt.clico: phablet@ubuntu-phablet:~$ find mutt.click/ mutt.click/ mutt.click/lib mutt.click/lib/arm-linux-gnueabihf mutt.click/lib/arm-linux-gnueabihf/libanonymous.so mutt.click/lib/arm-linux-gnueabihf/libanonymous.so.2 ... mutt.click/lib/arm-linux-gnueabihf/libpython2.7.so.1.0 mutt.click/lib/arm-linux-gnueabihf/libsasl2.so.2 mutt.click/.muttrc mutt.click/mutt_dotlock mutt.click/mutt mutt.click/Mail mutt.click/tmp mutt.click/.mutt-mail_aliases mutt.click/signature mutt.click/.mailcap mutt.click/mutt.sh mutt.click/evolution-mail.svg mutt.click/ubuntu-mutt-app.desktop mutt.click/ubuntu-mutt-app.json mutt.click/manifest.json The file mutt.sh sirves later to launch mutt with the correct environment: #!/bin/sh # to run the MUA mutt which we have compiled in a jail below /home/phablet/myRoot # from outside the jail LD_LIBRARY_PATH=/home/phablet/mutt.click/lib/arm-linux-gnueabihf export LD_LIBRARY_PATH SASL_PATH=/home/phablet/mutt.click/lib/arm-linux-gnueabihf export SASL_PATH MUTT=/home/phablet/mutt.click/mutt cd $MUTT -F ./.muttrc With a well constructed .muttrc file it works fine to read (IMAPS) and send (SMTP AUTH) mails. We even tried zo build our 1st 'click app' from this: construct the requested files: mutt.click/evolution-mail.svg mutt.click/ubuntu-mutt-app.desktop mutt.click/ubuntu-mutt-app.json mutt.click/manifest.json and run: # click build mutt.click Successfully built package in './com.ubuntu.developer.mapitz.ubuntu-mutt-app_0.1_all.click'. install it with: $ pkcon --allow-untrusted install-local com.ubuntu.developer.mapitz.ubuntu-mutt-app_0.1_all.click Instalando archivos [=========================] Finalizado [=========================] Instalando archivos [=========================] Esperando autenticación [=========================] Comenzando [=========================] Finalizado [=========================] Instalado com.ubuntu.developer.mapitz.ubuntu-mutt-app-0.1. (installed:click,removable=1,app_name=ubuntu-mutt-app) summary goes here and try to register is (which fails): $ sudo click udo click register --user=phablet com.ubuntu.mutt-terminal_0.1._multiegister --user=phablet com.ubuntu.developer.mapitz.ubuntu-mutt-app 0.1 ** (process:1270): WARNING **: Desktop file '/opt/click.ubuntu.com/.click/users/phablet/com.ubuntu.developer.mapitz.ubuntu-mutt-app/ubuntu-mutt-app.desktop' is set to run in a terminal, not copying after changing in the file mutt.click/ubuntu-mutt-app.desktop Terminal=false the register goes fine, the icon is in the Applications but does not work because there is no way to start a click app which needs a terminal to run inside :-( https://bugs.launchpad.net/ubuntu-terminal-app/+bug/1484412 $ sudo click unregister com.ubuntu.developer.mapitz.ubuntu-mutt-app 0.1 33. Click making the ubuntu-terminal-app How to click make the ubuntu-terminal-app, with the target to integrate mutt into it. Guided by Alan Pope (thanks) $ bzr launchpad-login gubu $ bzr branch lp:ubuntu-terminal-app/reboot ubuntu-terminal-app mail from Alan: I tend to build mine (outside the SDK) like this:- Setup an armhf schroot:- $ sudo click chroot -a armhf -f ubuntu-sdk-15.04 create I would also make one for amd64 and i386 because I may want to make a "fat" package containing binaries for phone and laptop/desktop computers too. The SDK doesn't yet support this directly using cmake so we kinda fudge it a bit. $ sudo click chroot -a amd64 -f ubuntu-sdk-15.04 create $ sudo click chroot -a i386 -f ubuntu-sdk-15.04 create # When I want to build, I just navigate to where the code is, and run this "make_fat_package.sh" script:- http://paste.ubuntu.com/12072962/ (which I got from Dan Chapman). This basically builds for all 3 arches and then crams all three builds into one click package. There's a few apps in the store built like this. If you only want one arch, just change line 12 in that script. Some things will need dependencies installing inside the schroot. You can get a shell inside the schroot with this:- $ sudo click chroot -a armhf -f ubuntu-sdk-15.04 maint You can then use the standard apt commands to get whatever dependencies are needed. Note that you need to specify the architecture if you're installing dev packages inside the schroot such as:- $ apt-get install libfoo-dev:armhf Hope that helps. Here's the typical output of me running "make_fat_package.sh" against terminal. http://paste.ubuntu.com/12073031/ Cheers, -- Alan Pope Community Manager Canonical - Product Strategy +44 (0) 7973 620 164 alan.pope@canonical.com http://ubuntu.com/ I did on the Ubuntu laptop $ sudo apt-get install click-dev (was alread there) $ sudo apt-get install schroot (was alread there) $ sudo apt-get install debootstrap (was alread there) $ sudo click chroot -a armhf -f ubuntu-sdk-15.04 create A chroot for that name and architecture already exists. (perhaps from my tries to build a Qt app) $ bzr launchpad-login gubu $ bzr branch lp:ubuntu-terminal-app/reboot ubuntu-mutt-terminal-app $ scp ......:scp make_fat_package.sh ubuntu-mutt-terminal-app $ cd ubuntu-mutt-terminal-app XXX: for sure there are file which must be changed from 'ubuntu-terminal-app' (the original name) to 'ubuntu-mutt-terminal-app' $ ./make_fat_package.sh ... No such file or directory #include ... fixed it with: $ sudo click chroot -a armhf -f ubuntu-sdk-15.04 maint (click-ubuntu-sdk-15.04-armhf)root@linchen-ubuntu:/home/guru/ubuntu-terminal-app# # apt-get install libpam0g-dev:armhf # exit $ ./make_fat_package.sh ... [ armhf ] Cleaning up build dir [ ubuntu-sdk-15.04 ] Modifying manifest.json [ ubuntu-sdk-15.04 ] Build *multi.click package WARNING:root:Ignoring missing framework "ubuntu-sdk-15.04" Now executing: click-review ./com.ubuntu.terminal_0.7._multi.click Errors ------ - security_template_valid (terminal.apparmor) (MANUAL REVIEW) 'unconfined' not allowed ./com.ubuntu.terminal_0.7._multi.click: FAIL Successfully built package in './com.ubuntu.terminal_0.7._multi.click'. And were done!! \o/ $ ls -l ../com.ubuntu.terminal_0.7._multi.click -rw-rw-r-- 1 guru guru 423502 Aug 14 19:08 ../com.ubuntu.terminal_0.7._multi.click Modified files to integrate mutt support: AUTHORS CMakeLists.txt com.ubuntu.terminal.desktop.in.in manifest.json.in new files: src/app/qml/ubuntu-mutt-terminal-app.qml mutt-terminal.apparmor com.ubuntu.mutt-terminal.desktop.in.in evolution-mail.svg tests/autopilot/ubuntu_mutt-terminal_app tests/autopilot/ubuntu_mutt-terminal_app/tests tests/autopilot/ubuntu_mutt-terminal_app/tests/test_terminal.py tests/autopilot/ubuntu_mutt-terminal_app/tests/__init__.py tests/autopilot/ubuntu_mutt-terminal_app/__init__.py $ pkcon --allow-untrusted install-local com.ubuntu.mutt-terminal_0.1._multi.click $ sudo click register --user=phablet com.ubuntu.mutt-terminal 0.1. (use 'click list' to find the correct name) $ diff src/plugin/qmltermwidget/src/ksession.cpp* 78c78 < QStringList args("$APP_DIR/lib/arm-linux-gnueabihf/bin/mutt.sh"); --- > QStringList args(""); 80c80 < session->setAutoClose(true); // set to false to see invocation errors --- > session->setAutoClose(true); $ cat ../mutt.click/mutt.sh #!/bin/sh # where we have installed the sasl2 modules # SASL_PATH=${APP_DIR}/lib/arm-linux-gnueabihf export SASL_PATH # we need lynx to read mails in HTML # LYNX_CFG=${APP_DIR}/lib/arm-linux-gnueabihf/bin/lynx.cfg export LYNX_CFG LYNX_LSS=${APP_DIR}/lib/arm-linux-gnueabihf/bin/lynx.lss export LYNX_LSS # we use a 'vim.basic' installed in the jail too, together with its config files # VIM=${APP_DIR}/lib/arm-linux-gnueabihf/bin export VIM # if the user 'phablet' has a file ~/.muttrc, we use this; else we stopp # if [ -f ~/.muttrc ]; then mutt -F ~/.muttrc else echo You must have a file ~/.muttrc, but you dont have. echo Hit ENTER to close the app. read a fi 34. Exporting notes from app 'reminder' The app 'reminders' (spanish name 'Notas') stores the notes in the directory ~/.local/share/com.ubuntu.reminders/@local as: $ cat notes.cache [notebooks] 4d853cee-9476-4e19-82fe-5f577b01698e=2 [notes] a0ae2c53-1c7d-4d2a-b1c5-ea876e3f4ca1=10 da5e2110-d1a8-4470-a8bc-d5115720db57=21 efc58768-d28a-4df0-9e41-4893e5c2af54=2 deleted notes stay in the directory, like this one: note-09f23799-df97-40f9-b4ff-6835688ed644.enml (a deleted one) they are just not referenced in the notes.cache file, like this one which is still valid: note-efc58768-d28a-4df0-9e41-4893e5c2af54.enml (a valid one) for every note exist two files, a *.info file and the note itself in *.enml file: $ ls -l total 40 -rw-rw-r-- 1 phablet phablet 133 sep 7 17:17 note-09f23799-df97-40f9-b4ff-6835688ed644.enml -rw------- 1 phablet phablet 427 sep 7 17:17 note-09f23799-df97-40f9-b4ff-6835688ed644.info -rw-rw-r-- 1 phablet phablet 567 sep 8 15:36 note-a0ae2c53-1c7d-4d2a-b1c5-ea876e3f4ca1.enml -rw------- 1 phablet phablet 522 sep 8 15:36 note-a0ae2c53-1c7d-4d2a-b1c5-ea876e3f4ca1.info -rw------- 1 phablet phablet 110 sep 7 17:33 notebook-4d853cee-9476-4e19-82fe-5f577b01698e.info -rw-rw-r-- 1 phablet phablet 725 sep 8 06:35 note-da5e2110-d1a8-4470-a8bc-d5115720db57.enml -rw------- 1 phablet phablet 529 sep 8 06:35 note-da5e2110-d1a8-4470-a8bc-d5115720db57.info -rw-rw-r-- 1 phablet phablet 318 sep 9 11:26 note-efc58768-d28a-4df0-9e41-4893e5c2af54.enml -rw------- 1 phablet phablet 530 sep 9 11:26 note-efc58768-d28a-4df0-9e41-4893e5c2af54.info -rw------- 1 phablet phablet 179 sep 9 11:26 notes.cache the *.enml files contain the notes itself, HTML snipsets packed in XML, text is in UTF-8 encoded (enotacion format): $ cat note-efc58768-d28a-4df0-9e41-4893e5c2af54.enml


9 de septiembre


  • día de compras en la tienda de la Coop. Possidenti Oliveti Limone sul Garda, por unos 88 euro aceite del lugar, vino, etc.
  • gasolinera 43 euro, debe alcanzar la casa,
  • ...
as the titel of the note is stored in the *.info file, it is a good idea to repeat the title in the note itself, for example if you have one note for any day, as I did showed it here with title "9 de septiembre"; With the help of Michael Zanetti I got to work a small Qt5 application to parse the structure of the *.info file: https://code.launchpad.net/~mzanetti/+junk/infodump #include #include #include #include #include int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); if (a.arguments().count() < 2) { qDebug() << "Error: No info file given"; qDebug() << "usage:" << a.arguments().at(0) << ""; return 1; } qDebug() << "File:" << a.arguments().at(1); QSettings s(a.arguments().at(1), QSettings::IniFormat); qDebug() << "Title:" << s.value("title").toString(); // qDebug() << "Tagline:" << s.value("tagline").toString().trimmed(); qDebug() << "Created:" << s.value("created").toDateTime().toString("yyyy-MM-dd"); qDebug() << "Updated:" << s.value("updated").toDateTime().toString("yyyy-MM-dd"); // qDebug() << "Created:" << s.value("created").toString(); // qDebug() << "Created:" << s.value("created").toDateTime().toMSecsSinceEpoch()/1000; return 0; } I compiled this in my chroot'ed env an use it together with a small shell script to export the files day by day: #!/bin/sh cd ~/.local/share/com.ubuntu.reminders/@local foundnotes=0 while read line; do echo $line | fgrep -q '[notes]' && { foundnotes=1 continue } if [ $foundnotes = 1 ]; then name=`echo $line | sed 's/=.*$//'` /home/phablet/myRoot/home/phablet/infodump/infodump note-$name.info > /tmp/info 2>&1 title=`fgrep Title: /tmp/info | sed 's/Title: "//' | sed 's/"//g' | sed 's/ /-/g'` created=`fgrep Created: /tmp/info | sed 's/Created: "//' | sed 's/"//g'` updated=`fgrep Updated: /tmp/info | sed 's/Updated: "//' | sed 's/"//g'` echo /tmp/${updated}:${title}.txt cat note-$name.enml > /tmp/${updated}:${title}.txt else continue fi done < notes.cache exit The files end up in /tmp and can be fetched from there by SSH: $ ls -l /tmp/*.txt -rw-rw-r-- 1 phablet phablet 1122 sep 15 15:28 /tmp/2015-09-09:7-de-septiembre.txt -rw-rw-r-- 1 phablet phablet 961 sep 15 15:28 /tmp/2015-09-09:8-de-septiembre.txt -rw-rw-r-- 1 phablet phablet 1457 sep 15 15:28 /tmp/2015-09-09:9-de-septiembre.txt -rw-rw-r-- 1 phablet phablet 2871 sep 15 15:28 /tmp/2015-09-11:10-de-septiembre.txt -rw-rw-r-- 1 phablet phablet 1798 sep 15 15:28 /tmp/2015-09-11:11-de-septiembre.txt -rw-rw-r-- 1 phablet phablet 980 sep 15 15:28 /tmp/2015-09-12:12-de-septiembre.txt -rw-rw-r-- 1 phablet phablet 402 sep 15 15:28 /tmp/2015-09-15:13-de-septiembre.txt 35. Using ubuntu-device-flash Run in the BQ the command to get the information about the actual used device and channel (this formation is stored in the phone in the file /etc/system-image/channel.ini): $ system-image-cli -i current build number: 25 device name: krillin channel: ubuntu-touch/stable/bq-aquaris.en last update: 2015-09-13 07:21:14 version version: 25 version ubuntu: 20150825.1 version device: 20150821-736d127 version custom: 20150821-887-33-32-vivid Install in the chrooted file system: $ sudo chroot myRoot # apt-get install ubuntu-device-flash and run with the parameters of the actual device/channel this command to get the information about the file list: $ ubuntu-device-flash query --device=krillin --channel=ubuntu-touch/stable/bq-aquaris.en --show-image Device: krillin Description: ubuntu=20150825.1,device=20150821-736d127,custom=20150821-887-33-32-vivid,version=25 Version: 25 Channel: ubuntu-touch/stable/bq-aquaris.en Files: 0 https://system-image.ubuntu.com/pool/ubuntu-59b0c7aa8af63dda3a06005a6087c1faa4ed8993321293b276e7f7021d0cb0a3.tar.xz 299755828 b449f0a89060593e2322c9e79b46952f5f0ed6f1c1e26c7a1b0ccbe0433ce95f 1 https://system-image.ubuntu.com/pool/device-169bc102d21754e91d142385ffadb32b63cfa92831b82f221b5f38d9bc65b687.tar.xz 71632928 9cb3cc46c6407eac581260e1ab40ce4d72bae459319c1723030b053df7dc543b 2 https://system-image.ubuntu.com/pool/custom-996a0631cdd3014deb88bfa3c228a70922d68ea953607e3133d94713b351f650.tar.xz 57496184 281c6b0d2c9046059a51502f98daebe8755b0fd9947140aa37bac29d00918c76 3 https://system-image.ubuntu.com/ubuntu-touch/stable/bq-aquaris.en/krillin/version-25.tar.xz 456 6473519267732e42cf46056fc994e5196d11206f98e3baeb62488c57ccfd4608 (see also: https://sturmflut.github.io/ubuntu/touch/2015/05/06/hacking-ubuntu-touch-part-2-devices-and-images/ ) The above files are the full images URL; You can find these and the delta file names manually by looking in the index.json files on https://system-image.ubuntu.com/ for the relevant channel, in our case here exatly in http://system-image.ubuntu.com/ubuntu-touch/stable/bq-aquaris.en/krillin/index.json (at the end, while writing this the delta between r24 and r25) the r24-r25 delta files are: 0 https://system-image.ubuntu.com/pool/ubuntu-59b0c7aa8af63dda3a06005a6087c1faa4ed8993321293b276e7f7021d0cb0a3.delta-ubuntu-61dbd90be1acf5c2e4c9341f77e7054c98d4a53e90b1a211bcda9d2a02894368.tar.xz 1 https://system-image.ubuntu.com/pool/device-169bc102d21754e91d142385ffadb32b63cfa92831b82f221b5f38d9bc65b687.delta-device-168ccf6a391da4f83feb0325783f02b313e3892675bfea9e4a036bd63fd24f93.tar.xz 2 https://system-image.ubuntu.com/pool/custom-996a0631cdd3014deb88bfa3c228a70922d68ea953607e3133d94713b351f650.delta-custom-04c0e82d52c90b32483b261b61b691a52144954614ff6d50e1de9c5bfc8a03c0.tar.xz 3 https://system-image.ubuntu.com/ubuntu-touch/stable/bq-aquaris.en/krillin/version-25.tar.xz The first file in each delta-tar is a file with the name 'removed': removed system/bin/dmesg system/bin/findmnt system/bin/ip system/bin/journalctl system/bin/loginctl system/bin/lsblk which contains a list of the files to be removed; than all other files are after removal just tar'ed in into the target file system which is mounted on .../system xx. Other usefull commands (unsorted) What app is running and consuming time: $ ubuntu-app-usage unity8-dash 73963 seconds ubuntu-system-settings 27909 seconds dekko.dekkoproject_dekko 25067 seconds com.ubuntu.terminal_terminal 22741 seconds com.ubuntu.clock_clock 18282 seconds dialer-app 8463 seconds webbrowser-app 6207 seconds ... $ system-image-cli --info current build number: 21 device name: krillin channel: ubuntu-touch/stable/bq-aquaris.en alias: ubuntu-touch/ubuntu-rtm/14.09 last update: 2015-04-17 01:26:41 version version: 21 version ubuntu: 20150410.1 version device: 20150408-4f14058 version custom: 20150409-665-29-206 ... reload and install the full image without damage the user space: $ system-image-cli -b 0 $ click list com.canonical.scopes.bbc-sport 1.3.1 com.canonical.scopes.euronews 0.5 com.popey.osm 0.7 com.ubuntu.developer.mzanetti.tagger 0.11.0.0 ... From: Alan Pope see also: http://bazaar.launchpad.net/~popey/ubuntu-terminal-app/ubuntu-commands/view/head:/UbuntuCommands.json UNTESTED (be carfully) From: Jonas Drange $ /usr/share/ofono/scripts/dial-number ... Though, not sure if placing a call like that will spawn the Dialer App. $ /usr/share/ofono/scripts/answer-calls to be continued