User Tools

Site Tools


docs:tips_n_tricks:android:index.html

Android

HTC Desire Z

FIXME :!: Work in progress :!: :!: Do not use :!:

HTC Desire ZHTC Desire Z

Gain temporary root and create Backup on HTC Desire Z Android 2.3

On Linux:

adb push fre3vo   /data/local/tmp
adb install Superuser.apk
# from Vision-fre3vo-temp-root.zip
adb push su       /data/local/tmp
adb push fixsu.sh /data/local/tmp
adb push busybox  /data/local/tmp
adb shell

In adb shell:

chmod 777 /data/local/tmp/fre3vo
/data/local/tmp/fre3vo -debug -start FAA90000 -end FFFFFFFF

Dropping back to Linux!

~ $ adb shell
# /data/local/tmp/fixsu.sh
# exit

Yeah, this time it's root! Now run Titanium Backup *root* and save everything to SD Card!

Downgrade HTC Desire Z to Android 2.2

see Google ;-)

/data/local/tmp/misc_version -s 1.33.405.5

Root and ugrade HTC Desire Z to Android 2.3

On Linux:

adb push psneuter /data/local/tmp/
adb push hboot-eng.img /data/local/tmp/
adb push busybox /data/local/tmp/
adb push flashgc /data/local/tmp/
adb push gfree /data/local/tmp/
adb push root_psn /data/local/tmp/
adb push recovery-clockwork-touch-5.8.1.0-vision.img /data/local/tmp/recovery.img
adb push su /sdcard/
adb push Superuser.apk /sdcard/
adb shell

In adb Shell:

chmod 755 /data/local/tmp/* 
/data/local/tmp/psneuter

In Linux:

adb shell

In adb Shell (note the '#' sign):

cd /data/local/tmp 
./gfree -f -b hboot-eng.img -y recovery.img 
./root_psn
sync

References:

Use QR Code to configure Wifi Access

To get WifiWifi access by use of common QR CodeQR Code scanning apps, you have to QR encode the string

WIFI:S:MySSID;T:WPA2;P:MyPassword;;

which can be generated with the open source tool qrencode:

qrencode -t PNG -s 12 -l L -o MyNetwork.png 'WIFI:S:MySSID;T:WPA;P:MyPassword;;'

WIFI:S:MySSID;T:WPA;P:MyPassword;;Apart from replacing MySSID and MyPassword by the right values for your network, you might need to replace WPA by WEP. I was told, a WPA2 might work as well, but WPA seems to be generic for both WPA and WPA2.

For a hidden network, a H:true is expecte as a last value, seperated by another ; and finished by a pair of them. In case of no password (no encryption), just omit the respective tags completely1).

qrencode -t ANSIUTF8 -l L 'WIFI:S:MySSID;T:WPA;P:MyPassword;;'

References:

Thanks to Generate QR Codes for WiFi networks for pointing out the basiscs.

Wileyfox Swift

Install TWRP 3.0.2 unofficial on Wileyfox Swift

Some time ago, I found an unofficial build of TWRPTWRP for the Wileyfox SwiftWileyfox Swift (crackling): TWRP_3.0.2-0_crackling_20160524.zip

For some reason, twrp-3.2.1-0-crackling.img from https://dl.twrp.me/crackling/ did not work for me2)

Steps done:

  1. Enable developer options/tools on phone
  2. Enable adb on phone
  3. Enable oem unlock on phone
  4. Extract recovery.img from TWRP_3.0.2-0_crackling_20160524.zip
  5. Boot Wileyfox Swift into fastboot
  6. Connect by USB
  7. Run
    fastboot oem unlock
    fastboot -i 0x2970 oem unlock-go
    fastboot oem unlock-go

    on connected computer

  8. Run
    fastboot flash recovery recovery.img

    on connected computer

  9. Reboot by command
    fastboot boot recovery.img

    on connected computer3)

  10. Reboot or shutdown from TWRP Menu

Transfer system from one Wileyfox Swift to another with TWRP

This is a guide to transfer an Android system to a new hardware of the same type in case the old hardware is somewhat broken, but the system ist still running.
:!:This will not work as described to transfer the system to different hardware.:!:

Obviously, TWRP saves backups into a phone specific subdirectory and offers restores only for backups found in the appropriate subdirectory
TWRP does not backup the data of your “internal” (emulated) SD-Card
  1. Install TWRP on both systems (see above)
  2. Put old phone into flight mode to avoid sync operations during backup and restore
  3. Boot old phone into recovery mode
  4. Check time and timezone, select correct timezone eventually
  5. :!: Connect computer via USB and backup all data from internal storage to computer by mtp:!:
  6. Select “Backup”
  7. Select storage “MicroSD”
  8. Select partitions for backup
    • System
    • Data
    • Boot
  9. Start Backup
  10. After backup finished, shutdown old phone by choosing Power off from the Reboot Menu
  11. Move all SIM cards and the SD card from old phone to new one4)
  12. Boot new phone directly into recovery mode by pressing Volume down and Power, let go after approx. 5 seconds.
  13. Check time and timezone, select correct timezone eventually
  14. Select Terminal from TWRP menu
    or
    Connect to computer by USB and run adb shell
  15. Set current time by running
    date -s YYYYMMDDHHMM00

    on phone

  16. Do a dummy backup of some small partition (e.g. boot) to get TWRP subdirectory name of new phone
  17. Find new subdirectory either in /sdcard/TWRP/BACKUP or in /sdcard1/TWRP/BACKUP
  18. Rename
    /sdcard1/TWRP/BACKUP/<old name>
    to
    /sdcard1/TWRP/BACKUP/<new name>
  19. Select WipeAdvanced Wipe
  20. Select5)
    • Dalvik / ART Cache
    • System
    • Data
    • Internal Storage
    • Cache
  21. Start Wiping by Swipe to Wipe
  22. Select Restore
  23. Select storage “MicroSD”
  24. Select most recent backup
  25. Select partitions to be restored:
    • System
    • Data
    • Boot
  26. Wait for restore to finish
  27. :!: Connect computer via USB and restore all data to internal storage from computer by mtp:!:
  28. Reboot into System via the Reboot menu.
  29. Connect to computer by USB
  30. On connected computer run6)
    adb shell date YYYYMMDD.HHMM00
  31. Reboot new phone
  32. Check date and time on new phone
  33. Have fun!
I recommend not to go online with the existing system on the old phone to avoid sync mischief. Factory reset the old phone as soon as you are confident, that the transfer worked well.

Upgrad from CyanogenOS to Android

Disable disk encryption first!

Change disk encryption PIN on Android 7.2.1 Nougat

adb shell
su
vdc cryptfs changepw pin <old> <new>

Install F-Droid Privilege Extension systemless

(e.g. needed for system on sqashfs which can not be modified by TWRP)

  1. Install Magisk
  2. Install Magisk Systemizer extension
  3. Download F-Droid Privilege Exteion APK. (downloading, not installing!)
  4. connect via USB from PC and run
    adb shell
    su
    cd /sdcard/Download
    systemizer
  5. Select “Install from APK”
  6. Enter filename of apk
  7. Choose destination /system/priv-app/
  8. Reboot Phone

Install LineageOS 14.1

Installing the LineageOS 14.1 update.zip on Android 7.2.1 Nougat following the simple7) update process did not work for me.

Install everything (but System) from Cyanogen 13.1.2 via fastboot first:

unzip cm-13.1.2-ZNH2KAS3LG-crackling-signed-fastboot-84f0d5200b.zip \
      NON-HLOS.bin hyp.mbn emmc_appsboot.mbn rpm.mbn tz.mbn sbl1.mbn \
      splash.img flash-radio.sh cache.img userdata.img boot.img recovery.img \
      android-info.txt filesmap
su -
for file in boot.img cache.img recovery.img userdata.img ; do fastboot flash "${file%.img}" "$file" ; sleep 1 ; done

Depending where you came from (i.e. what has been the previous OS Revision on the phone) you might want to flash further firmware:

./flash-radio.sh

Then reboot the Swift into the new fastboot:

fastboot reboot-bootloader

In fastboot, boot TWRP:

fastboot boot twrp-3.2.3-0-crackling.img
exit # finish su

In TWRP select “Advanced”, then “ADB Sideload”.

You might want to tick “Wipe Dalvik Cache” and “Wipe Cache” to avoid problems due to cache inconsistency. Then start the sideload mode by doing the “Swipe to Start Sideload”

Then install Lineage from PC8)

adb sideload lineage-14.1-20180905-nightly-crackling-signed.zip

In TWRP select “Reboot System”

After reboot, wait for the installation process to finish. (If you think, its stuck - keep waiting provided the animated LineageOS Logo is still running)

If you want to have root for apps, you need to install addonsu-14.1-arm64-signed.zip

If you want to use f-droid with privilege extension, you need to install org.fdroid.fdroid.privileged.ota_2070.zip9)

Install LineageOS 16.0 over Android 7.1.2

Haven't done it exactly this way - but in the end, it should be the same

  1. Unlock phone
  2. Install TWRP 3.2.3-0
  3. Flash emmc_appsboot.mbn from cm-13.1.2-ZNH2KAS3LG-crackling-signed-fastboot-84f0d5200b.zip to aboot
    unzip cm-13.1.2-ZNH2KAS3LG-crackling-signed-fastboot-84f0d5200b.zip emmc_appsboot.mbn
    fastboot flash aboot emmc_appsboot.mbn
  4. Boot into recovery (i.e. TWRP)
  5. Wipe all data partitions (Well … archive all needed data before …)
  6. Reformat /system with ext4
  7. Format data
  8. Reboot

Conversations / adb

How to remove lines from conversations (1.23.4) history:

cd /scratch/peter/Anja/MotoG
mkdir adb-backup
cd adb-backup
adb devices -l
adb backup -f eu.siacs.conversations.ab -apk -obb eu.siacs.conversations
cp -vip eu.siacs.conversations.ab eu.siacs.conversations.ab.save
java -jar ~/Downloads/Android/abe-all.jar unpack eu.siacs.conversations.ab eu.siacs.conversations.tar
cd /tmp
mkdir unpack 
cd unpack/
tar -xvkpf /scratch/peter/Anja/MotoG/adb-backup/eu.siacs.conversations.tar 
sqlitebrowser apps/eu.siacs.conversations/db/history # remove lines from table "messages"
tar -tf /scratch/peter/Anja/MotoG/adb-backup/eu.siacs.conversations.tar | grep -v 'apps/eu.siacs.conversations/db/history-journal' > files.list
tar -cvf eu.siacs.conversations-modified.tar -T files.list
java -jar ~/Downloads/Android/abe-all.jar pack eu.siacs.conversations-modified.tar eu.siacs.conversations.ab
adb restore eu.siacs.conversations.ab

References:

Android eu.siacs.conversations XMPP Jabber Java adb

1)
meaning no ;T:…;P… at all
2)
Flashing was possible, but fastboot boot <imgfile> gave an error and forcing boot into recovery by pressing Power and Volume down did stall on “Wileyfox” screen
3)
If you boot reboot into system first, the recovery image will be overwritten by the factory default
4)
You might want to do a image backup of the SD card befor exposing it to the recovered system
5)
should be all but MicroSD
6)
Yes, this ist different from the syntax above
7)
i.e. TWRP → Install from ZIP
8)
Might finish with “(~47%) * failed to read command: Success” on the PC while everything is reported OK in TWRP
9)
ZIP herunterladen
docs/tips_n_tricks/android/index.html.txt · Last modified: 13.08.2022 17:07 CEST by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki