Search code examples
adbls

How to interpret numeric output of `adb` `ls` command?


After much Googling how to use adb at the DOS command prompt, I finally found command syntax to show the actual files I've been struggling with.

Here's the command:

C:\Users\Dov>adb ls /data/data/com.dslomer64.servyhelperton/databases

Here's the output.

000041f9 00001000 59b7bc7d .
000041e9 00001000 59b5a17d ..
000081b0 00005000 59b72501 Dictionary.dic
00008180 00002210 59b72501 Dictionary.dic-journal
000081b0 00005000 59b6e3c3 TEST2.dic
00008180 00002210 59b6e3c3 TEST2.dic-journal
000081b0 00005000 59b710c8 TEST.dic
00008180 00002210 59b710c8 TEST.dic-journal

Yay.

I accidentally left off -R in the ls command, but good since I got 3 more columns than expected.

And that's my question, because it could be related to my problem:

What are the columns of numbers?

Since all 3 .dic files have the same middle column values and also have the same size after being pulled to my PC (20KB) and since 20KB in hex is 5000, surely the middle column is size.

But what are the other columns? Mod/Creation date? And...


Solution

  • The 1st column is file mode and the 3rd is epoch file creation time.

    From adb/client/file_sync_client.cpp

    bool do_sync_ls(const char* path) {
        SyncConnection sc;
        if (!sc.IsValid()) return false;
        return sync_ls(sc, path, [](unsigned mode, unsigned size, unsigned time,
                                const char* name) {
            printf("%08x %08x %08x %s\n", mode, size, time, name);
        });
    }