понеделник, 5 декември 2016 г.

How to root Xperia X8 trough Linux and export mmssms.db

To backup the sms from my old phone, it turned out I have to first root it. Which I never did for unknown reasons. Anyway, because my ex-phone is with some ridiculously old Android (not even Gingerbread), I had to root it in the konsole adb way. I found this great tutorial how to do it.
1. Download SuperOneClickv2.3.3-ShortFuse.zip and extract it to a folder
2. Cd into SuperOneClickv2.3.3-ShortFuse/
3. Turn on USB Debugging mode (Settings --> Applications --> Development --> USB Debugging)
4. Unmount the SD Card (Settings --> SD Card --> Unmount SD Card)
5. Connect your phone to the computer using the USB lead, when the phone asks chose "Charge Phone".
6. Go to your konsole (BASH):
Execute the following commands:
$adb push Exploits/psneuter /data/local/tmp/psneuter
$adb push Root/su-v2 /data/local/tmp/su                      
$adb push Root/Superuser.apk /data/local/tmp/superuser.apk
$adb shell
$cd /data/local/tmp
$chmod 755 psneuter
.$/psneuter

$adb shell
$cd /data/local/tmp
$mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system
$cat su > /system/bin/su
$cat superuser.apk > /system/app/superuser.apk
$chmod 06777 /system/bin/su
$chmod 777 /system/app/superuser.apk
$reboot

Then you should have "su" on your phone. You can test this by typing:
$adb shell
$su
If you don't get an error, you're good to go. If you get an error, get to the link above and see possible solutions.

Then on to copying your text messages.
You need the following file: /data/data/com.android.providers.telephony/databases/mmssms.db
 I tried pulling it as it is, but I got permission error.
So what I did is the following:
$adb shell
$su
$chmod 777 /data/data/com.android.providers.telephony/databases/mmssms.db
$exit
$cd ~/Downloads
$adb pull /data/data/com.android.providers.telephony/databases/mmssms.db
And the file was in ~/Downloads.
To import this file to your new phone, you need to do:
$adb push mmssms.db /data/data/com.android.providers.telephony/databases/
Obviously, your new phone will have to be rooted, which is somewhat inconvenient if your phone is brand new. But in principle you can.
This is a database file. You can play with it using sqlite. For example: 
$sqlite3 -header mmssms.db 'select address from sms' | sort -n | uniq -c | sort -n
will tell you who is the person you communicated with the most.
$sqlite3 mmssms.db
$ SELECT * FROM sms WHERE read=1;
will show you all the read messages and read=0 will show you the unread messages.
The same funtion without entering sqlite
$ echo 'select address,body from sms;' | sqlite3 -csv mmssms.db
If you want to, you can export them to a file (db.txt) with:
$echo 'select address,body from sms;' | sqlite3 -csv mmssms.db >> dx.txt
Then you can replace all the phones with names and happily read your sms.

петък, 16 септември 2016 г.

How to make dropbox sync

From the Dropbox help:
1.Stop Dropbox on the PC
2. In a termina write: 
  1. sudo chown "$USER" "$HOME"
    sudo chown -R "$USER" ~/Dropbox ~/.dropbox
    sudo chattr -R -i ~/Dropbox
    sudo chmod -R u+rw ~/Dropbox ~/.dropbox

    where Dropbox is the name of your dropbox folder 
3. Restart Dropbox 

вторник, 6 септември 2016 г.

Odd virtual machine error

Just tried to start my virtual machine and got this odd error:
Error starting domain: Failed to connect socket to '/var/run/libvirt/virtlogd-sock': No such file or Directory
I have no idea where it came from, since I haven't used my virtual machine for a month. In any case, the solution was very simple:
$ systemctl start virtlogd.socket
And then restart the virtual machine manager. 
Now it works: