Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Best way to preserve such attributes is packing all files into a TAR archive. You can create it via adb and directly save it on the PC: adb exec-out 'cd /sdcard; tar -cf - .' > backup.tar
adb exec-out 'cd /sdcard; tar -cf - .' > backup.tar
backup.tar
(specify an absolute path likeF:\backup.tar
on Windows.