UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. BodoW
    3. Best
    B
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 7
    • Posts 24
    • Groups 0

    Posts

    Recent Best Controversial
    • My Solution for Moving WhatsApp Chats from Android to Anbox

      I just flashed my Nexus5 to UT and of course ran into some problems. One of which was how to make a newly anbox installed Whatsapp (WA) import my msgstore.db.crypt12 .
      The way recommended by WA doesnt work, as reinstalling WA erases the complete app directory structure.
      Another problem for a behind the curtain android noob like me is: Where to put it. The key to the solution is: The folder to put it in doesn't exist yet after a fresh install.

      Thus the tl;dr:

      • Install WA
      • Start WA
      • Backup Messages in WA
      • Close WA
      • Delete the msgstore.db* files in /home/phablet/anbox-data/data/data/com.whatsapp/databases
      • Delete the msgstore.db* files in /home/phablet/anbox-data/media/0/WhatsApp/Database
      • Copy your old msgstore.db* files to /home/phablet/anbox-data/media/0/WhatsApp/Database
      • Set user and group like the directory itself and mode to 664
      • Start WA and now it will ask if you want to import your old chats. Do so. And hopefully you will be able to go on as you're used to.

      Other media should work the same, but I wasn't in that so far, therefore I didn't try it yet.

      posted in Off topic
      B
      BodoW
    • RE: Changing files in anbox-data

      I found out, how to do it. I will start a new topic for that.

      posted in Support
      B
      BodoW
    • Changing the Layout of a Physical Keyboard in anbox on a Nexus 5

      I use a Bluetooth keyboard for my Nexus 5 and as long as it is in Ubuntu everything is fine. However, since it has a German layout, things get messy when you use it in anbox as there is only an English layout available.

      So, here is what I did:

      • Own a Ubuntu PC.
      • Copy /home/phablet/anbox-data/android.img to your desktop system
      • Mount the image (if you transferred it to your desktop's Download folder a simple double click might do the trick)
      • Copy the content to an empty directory (lets call it newandroid_img)
      • Go to newandroid_img/system/usr/keychars
      • Delete all .kcm files except virtual.kcm
      • Download the appropriate .kcm file from here and put it in the system/usr/keychars directory and rename it to Generic.kcm
      • Do a "chown -R 100000:100000 newandroid_img
      • Create a new image by "mksquashfs newandroid_img/* newandroid.img"
      • Copy newandroid.img to /home/phablet/anbox-data/ on the phone.
      • Reboot your phone into recovery mode
      • Connect your phone via "adb shell"
      • Go to /data/user-data/phablet/anbox-data/
      • Do "mv android.img oldandroid.img" (Just in case)
      • Do "mv newandroid.img android.img"
      • Reboot

      That should be it.
      It could be that you can replace the images in a freshly rebooted system as well, but the revovery method appeared to be the safest to me.
      Have fun with your äöüßs! (or çs if you feel like it😏 )

      posted in Off topic
      B
      BodoW
    • Kind of solved: Anbox: How to refresh Android gallery, "reboot" the sandbox?

      EDIT: Workaround was appended to the script (last three lines)
      Unfortunately WhatsApp is still neccesary to have as most people are totally incapable of grasping the concept of alternative programs. Well, here we go.
      As I'd like to sent a photo from time to time I wrote the script down below and have a cron job running to synchronize the Android DCIM directory with the UBports side every minute.
      This works great, however the Android side completely ignores any change in the DCIM directory. Only after a full reboot of the phone the files are in the gallery.

      So the question is: Do you have any idea how to force anbox to notice the changes? "Rebooting" anbox would be ok for the start. But how?

      import os
      import stat
      import shutil
      
      refresh_flag=0 
      ubports_dirname="/home/phablet/Pictures/com.ubuntu.camera/"
      android_dirname="/home/phablet/anbox-data/data/media/0/DCIM/"
      
      # Copy new images
      ubports_filenames=os.listdir(ubports_dirname)
      android_filenames=os.listdir(android_dirname)
      
      for ubports_filename in ubports_filenames:
      	try:
      		android_filenames.index(ubports_filename)
      	except: # If file is not yet in DCIM
      		if not stat.S_ISDIR(os.stat(ubports_dirname+ubports_filename).st_mode): # Ignore directories
      			shutil.copy(ubports_dirname+ubports_filename, android_dirname)
      			os.chown(android_dirname+ubports_filename, 1023, 1023)
      			refresh_flag=1
      
      # Delete deleted images
      ubports_filenames=os.listdir(ubports_dirname)
      android_filenames=os.listdir(android_dirname)
      
      for android_filename in android_filenames:
      	try:
      		ubports_filenames.index(android_filename)
      	except: # If file is deleted
      		if not stat.S_ISDIR(os.stat(android_dirname+android_filename).st_mode): # Ignore directories
      			os.remove(android_dirname+android_filename)
      			refresh_flag=1
      
      if refresh_flag==1: # If something changed "reboot" the anbox
      	os.popen("anbox-tool disable")
      	os.popen("anbox-tool enable")
      
      posted in Support
      B
      BodoW
    • RE: Changing the Layout of a Physical Keyboard in anbox on a Nexus 5

      Thanks for the hint. I changed

      • Copy newandroid.img to /home/phablet/anbox-data/

      to

      • Copy newandroid.img to /home/phablet/anbox-data/ on the phone.

      That should make it clear.

      posted in Off topic
      B
      BodoW
    • RE: Kind of solved: Anbox: How to refresh Android gallery, "reboot" the sandbox?

      @ThrillSeeker
      Good to know that someone else considers it useful too. Thank you.

      posted in Support
      B
      BodoW
    • RE: Kind of solved: Anbox: How to refresh Android gallery, "reboot" the sandbox?

      Thank you @Ingo. I've added it to the code and it works.
      As this is the reboot approach I'd still leave the issue open as maybe someone might come up with the preferred refresh solution.

      posted in Support
      B
      BodoW
    • RE: One method to encrypt /home/phablet

      @ernest said in One method to encrypt /home/phablet:

      @trainailleur
      Lomiri cannot restart thus the screen remains black, while ssh access works fine.

      I ran into the same problem on my Nexus 5.
      The solution is to lock the screen (Power Button) before initiating the force-reload.
      For some reason lightdm does not come back when it was shut down while the display was lit. (It took me quite a while and several WTFs to stumble over this. :grinning_squinting_face: )
      Thus my script is as follows:

      #!/bin/bash
      
      cryptsetup luksOpen /home/phablet.img phablet
      e2fsck /dev/mapper/phablet
      mount /dev/mapper/phablet /home/phablet && \
      
      echo "Lock the screen now!"
      echo "Restart in"
      for ((t=5;t>0;t--))
      do
      	echo "$t s"
      	sleep 1
      done
      
      cd /tmp
      nohup /etc/init.d/lightdm force-reload </dev/null >/dev/null 2>&1 &
      
      posted in Support
      B
      BodoW