0

Hi guys: refering to this: Restore Whatsapp

Get the same issue.

I just reset all my phone after an OTA bricked.

I made an nandroid backup, but, i dunno how to acces - on my phone - the "data/data/com.whatsapp" file to read owner and group. I think for the nandroid its going to be ok.

Cheers

0

install WhatsApp, then boot in TWRP and look from adb shell

  • show the folder attributes with the ls command

    ls -dln /data/data/com.whatsapp
    

example output:

mint@debian ~ $ adb shell
/ # ls -dln /data/data/com.whatsapp
drwx------   13 10104    10104         4096 Jan 15 04:15 /data/data/com.whatsapp  

next, restore the backup (or part of it)

  • download open-gapps-pico.zip for your platform (ARM) to PC

  • extract the tar binary (tar-arm for ARM) and push it to phone (in TWRP)

    adb push C:\adb\tar-arm /tmp/
    
  • open adb shell and make the binary executable (TWRP)

    chmod 0750 /tmp/tar-arm
    

example output:

mint@debian ~/Downloads $ adb push tar-arm /tmp/
387 KB/s (427448 bytes in 1.075s)
mint@debian ~/Downloads $ adb shell
/ # chmod 0750 /tmp/tar-arm 
  • in TWRP look for the location where your (internal/external) sdcard is mounted

    df
    

example output:

/ # df
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                  1010636        44   1010592   0% /dev
tmpfs                  1010636        28   1010608   0% /tmp
/dev/block/mmcblk0p19   253920      2380    246300   1% /cache
/dev/block/mmcblk0p20 11608792   9847780   1728244  85% /data
/dev/block/mmcblk0p20 11608792   9847780   1728244  85% /sdcard
/dev/block/mmcblk1p1  31150720  22588512   8562208  73% /external_sd
  • find the backup folder with the ls and cd commands

example output for cd change directory:

/ # cd /external_sd
/external_sd # cd TWRP
/external_sd/TWRP # cd BACKUPS/CUBOT_KING_KONG

example output for ls list files and folders:

/external_sd/TWRP/BACKUPS/CUBOT_KING_KONG # ls
2019-03-20--03-44-24_CUBOT_KING_KONG_7081C_V16_20180517
2019-04-16--08-03-32_CUBOT_KING_KONG_7081C_V16_20180517
2019-04-21--07-15-28_CUBOT_KING_KONG_7081C_V22_20181228
2019-06-18--20-30-44_CUBOT_KING_KONG_7081C_V16_20180517
2019-06-23--05-37-30_CUBOT_KING_KONG_7081C_V16_20180517
2019-06-26--08-30-17_du_s3ve3g-userdebug_712_NZH54D_engroot20180

enter the latest backup folder (you can also use * as wildcard)

/external_sd/TWRP/BACKUPS/CUBOT_KING_KONG # cd 2019-06-26*

list ls the backup file names inside. the interesting is the data.ext4.win* backup

/external_sd/TWRP/BACKUPS/CUBOT_KING_KONG/2019-06-26--08-30-17_du_s3ve3g-userdebug_712_NZH54D_engroot20180 # ls
boot.emmc.win          data.ext4.win002       recovery.emmc.win.md5
boot.emmc.win.md5      data.ext4.win002.md5   recovery.log
data.ext4.win000       data.ext4.win003       system.ext4.win
data.ext4.win000.md5   data.ext4.win003.md5   system.ext4.win.md5
data.ext4.win001       data.info              system.info
data.ext4.win001.md5   recovery.emmc.win
  • Before unpacking, find the required file name(s) which contains your whatsapp files. use the tar-arm binary with parameters -t (test) and look into each file -f data.ext4.win*, while the error output is filtered out with 2> /dev/null and the the file list is filtered for folder name /data/data/com.whatsapp with the grep command

    /tmp/tar-arm -tf data.ext4.win000 2> /dev/null | grep /data/data/com.whatsapp
    

example output: (no result for data.ext4.win000 data.ext4.win001 data.ext4.win002)

/external_sd/TWRP/BACKUPS/CUBOT_KING_KONG/2019-06-26--08-30-17_du_s3ve3g-userdebug_712_NZH54D_engroot20180 # /tmp/tar-arm -tf data.ext4.win000 2> /dev/null | grep /data/data/com.whatsapp
/external_sd/TWRP/BACKUPS/CUBOT_KING_KONG/2019-06-26--08-30-17_du_s3ve3g-userdebug_712_NZH54D_engroot20180 # /tmp/tar-arm -tf data.ext4.win001 2> /dev/null | grep /data/data/com.whatsapp
/external_sd/TWRP/BACKUPS/CUBOT_KING_KONG/2019-06-26--08-30-17_du_s3ve3g-userdebug_712_NZH54D_engroot20180 # /tmp/tar-arm -tf data.ext4.win002 2> /dev/null | grep /data/data/com.whatsapp
/external_sd/TWRP/BACKUPS/CUBOT_KING_KONG/2019-06-26--08-30-17_du_s3ve3g-userdebug_712_NZH54D_engroot20180 # /tmp/tar-arm -tf data.ext4.win003 2> /dev/null | grep /data/data/com.whatsapp
/data/data/com.whatsapp/
/data/data/com.whatsapp/cache/
/data/data/com.whatsapp/code_cache/
/data/data/com.whatsapp/lib
/data/data/com.whatsapp/app_minidumps/
^C
  • now you can extract the folder /data/data/com.whatsapp (as last argument) from the file(s) -f data.ext4.win003 with the tar-arm binary with -x and additional parameters --selinux --xattrs -p for file attributes, while -P will keep the leading / which will restore everything to /data and -v make the whole thing more visible for you. handle each data.ext4.win* file for its own:

    /tmp/tar-arm --selinux --xattrs -vxpPf data.ext4.win003 /data/data/com.whatsapp
    

example output:

/external_sd/TWRP/BACKUPS/CUBOT_KING_KONG/2019-06-26--08-30-17_du_s3ve3g-userdebug_712_NZH54D_engroot20180 # /tmp/tar-arm --selinux --xattrs -vxpPf data.ext4.win003 /data/data/com.whatsapp
/data/data/com.whatsapp/
/data/data/com.whatsapp/cache/
/data/data/com.whatsapp/code_cache/
/data/data/com.whatsapp/lib
/data/data/com.whatsapp/app_minidumps/
^C

finally, change the owner and group

/ # chown -Rh 10104.10104 /data/data/com.whatsapp
|improve this answer|||||
  • Hum... So, as a Windows user: - reinstall Whatsapp - reboot on TWRP - on computer, go in my ADB Folder, open a CMD, and go for a -> adb shell - check with -> ls -dln /data/data/com.whatsapp - take a note on group number and owner number Next: how to restore my data/data/com.whatsapp ? Then: - go back on my ADB shell, and change group and owner - reboot phone Am i right ? – Mangaku Jun 27 '19 at 8:59
  • so your question is, how to extract a single app from nandroid backup - i will update my answer in a few hours – alecxs Jun 27 '19 at 12:25
  • hi @alecxs and thx for your help. That's huge. Unfortunately, after the chown -Rh 10238.10238 /data/data/com.whatsapp, i reboot to android, and when i try to launch WhatsApp, i have a really quick message (have to take a video screen and look at it slowly): WhatsApp immediately stopped. Any idea ? – Mangaku Jun 28 '19 at 11:50
  • maybe the secontext must also changed, or folder permissions. try chmod 0775 /data/data/com.whatsapp or chcon -Rh u:object_r:app_data_file:s0 /data/data/com.whatsapp – alecxs Jun 28 '19 at 13:27
  • My GOD: LOVE YOU SO HARD BRO !!! Works perfectly with a 0775 <3<3 – Mangaku Jun 28 '19 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.