WhatsApp 文件目录结构
本文主要介绍下whatsapp 的文件目录结构.
1:整体目录
以下是whatsapp的私有目录结构.
le_x2:/data/data/com.whatsapp # ls -l
total 40
drwxrwx--x 2 u0_a133 u0_a133 4096 2023-10-05 21:22 app_account_switching
drwxrwx--x 2 u0_a133 u0_a133 4096 2023-10-05 21:22 app_minidumps
drwxrws--x 14 u0_a133 u0_a133_cache 4096 2023-11-25 09:25 cache
drwxrws--x 2 u0_a133 u0_a133_cache 4096 2023-10-05 21:20 code_cache
drwxrwx--x 2 u0_a133 u0_a133 4096 2023-11-25 09:25 databases
drwxrwx--x 17 u0_a133 u0_a133 4096 2023-11-25 09:48 files
drwx------ 2 u0_a133 u0_a133 4096 2023-10-05 21:22 lib-main
drwxrwx--x 2 u0_a133 u0_a133 4096 2023-11-25 09:25 no_backup
drwx------ 3 u0_a133 u0_a133 4096 2023-10-05 21:22 oat
drwxrwx--x 2 u0_a133 u0_a133 4096 2023-11-25 09:48 shared_prefs
2: files目录
打开私有目录的files文件夹,
total 636
4 drwx------ 2 u0_a133 u0_a133 4096 2023-11-25 09:25 Avatars
4 drwx------ 2 u0_a133 u0_a133 4096 2023-11-25 00:00 Logs
4 drwx------ 2 u0_a133 u0_a133 4096 2023-11-25 09:25 NetworkResource
4 drwx------ 3 u0_a133 u0_a133 4096 2024-01-24 15:30 ShortcutInfoCompatSaver_share_targets
4 drwx------ 2 u0_a133 u0_a133 4096 2023-10-05 21:37 Stickers
4 drwx------ 2 u0_a133 u0_a133 4096 2023-10-05 21:37 ViewOnce
4 drwx------ 2 u0_a133 u0_a133 4096 2023-11-25 00:00 WhatsApp\ Images
4 drwx------ 2 u0_a133 u0_a133 4096 2023-11-25 00:00 WhatsApp\ Video
4 drwx------ 2 u0_a133 u0_a133 4096 2023-11-25 09:25 app_state
4 -rw------- 1 u0_a133 u0_a133 331 2023-11-25 09:25 backup_token
4 drwx------ 2 u0_a133 u0_a133 4096 2023-10-05 21:37 biz_directory
212 -rw------- 1 u0_a133 u0_a133 216562 2023-10-05 21:22 cldr_strings_1696512028.pack
216 -rw------- 1 u0_a133 u0_a133 218688 2023-11-25 09:25 cldr_strings_1706145917.pack
4 drwx------ 4 u0_a133 u0_a133 4096 2023-11-25 09:25 decompressed
4 drwx------ 3 u0_a133 u0_a133 4096 2024-01-23 17:34 downloadable
4 -rw------- 1 u0_a133 u0_a133 53 2023-11-25 09:25 invalid_numbers
4 -rw------- 1 u0_a133 u0_a133 158 2023-11-25 09:25 key
4 -rw-rw---- 1 u0_a133 u0_a133 128 2023-11-25 09:25 me
64 -rw------- 1 u0_a133 u0_a133 61639 2023-11-25 09:25 me.jpg
4 -rw------- 1 u0_a133 u0_a133 165 2023-11-25 09:52 network_statistics.json
4 drwx------ 6 u0_a133 u0_a133 4096 2023-11-25 09:25 privacy_disclosure
4 -rw------- 1 u0_a133 u0_a133 535 2023-11-25 09:52 statistics.json
60 -rw------- 1 u0_a133 u0_a133 262144 2023-11-25 09:52 wam.wam
4 -rw------- 1 u0_a133 u0_a133 163840 2023-11-25 09:25 wamprivatestats.wam
4 -rw------- 1 u0_a133 u0_a133 196608 2023-11-25 09:25 wamrealtime.wam
很明显我们可以看到一个文件me.jpg . 查看后可以确定这就是我们当前登录whatsapp的头像.
个人头像路径:
/data/data/com.whatsapp/files/me.jpg
好友头像路径:
好友头像可以查看Avatars目录,可以看到以账户命名的头像.(包含自己的me.j文件)
/data/data/com.whatsapp/files/Avatars
日志输出:
/data/data/com.whatsapp/files/logs
total 1008
-rw------- 1 u0_a133 u0_a133 9061 2023-11-23 17:34 whatsapp-2023-11-23.1.log.gz
-rw------- 1 u0_a133 u0_a133 37930 2023-11-24 15:30 whatsapp-2023-11-24.1.log.gz
-rw------- 1 u0_a133 u0_a133 0 2023-11-24 15:30 whatsapp-2023-11-24.2.log.gz
-rw------- 1 u0_a133 u0_a133 8119 2023-11-25 00:00 whatsapp-2023-11-25.1.log.gz
-rw------- 1 u0_a133 u0_a133 966107 2023-11-25 10:02 whatsapp.log
3: databases 目录
目录结构如下:
/data/data/com.whatsapp/databases # ls -l
total 5624
-rw-rw---- 1 u0_a133 u0_a133 16384 2023-11-25 10:06 _jobqueue-WhatsAppJobManager
-rw-rw---- 1 u0_a133 u0_a133 0 2023-11-25 10:06 _jobqueue-WhatsAppJobManager-journal
-rw-rw---- 1 u0_a133 u0_a133 188416 2023-11-25 09:25 axolotl.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 10:06 axolotl.db-shm
-rw------- 1 u0_a133 u0_a133 465592 2023-11-25 10:06 axolotl.db-wal
-rw-rw---- 1 u0_a133 u0_a133 4096 2023-10-05 21:37 chatsettings.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 09:54 chatsettings.db-shm
-rw------- 1 u0_a133 u0_a133 49472 2023-11-25 09:54 chatsettings.db-wal
-rw-rw---- 1 u0_a133 u0_a133 4096 2023-10-05 21:37 companion_devices.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 09:25 companion_devices.db-shm
-rw------- 1 u0_a133 u0_a133 37112 2023-10-05 21:37 companion_devices.db-wal
-rw-rw---- 1 u0_a133 u0_a133 4096 2023-10-05 21:37 daily_metrics.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 00:00 daily_metrics.db-shm
-rw------- 1 u0_a133 u0_a133 41232 2023-10-05 21:37 daily_metrics.db-wal
-rw-rw---- 1 u0_a133 u0_a133 4096 2023-11-25 09:25 location.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 09:25 location.db-shm
-rw------- 1 u0_a133 u0_a133 53592 2023-11-25 09:25 location.db-wal
-rw-rw---- 1 u0_a133 u0_a133 4096 2023-10-05 21:37 media.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 10:06 media.db-shm
-rw------- 1 u0_a133 u0_a133 148352 2023-11-25 10:06 media.db-wal
-rw------- 1 u0_a133 u0_a133 2355200 2023-11-25 10:05 msgstore.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 10:07 msgstore.db-shm
-rw------- 1 u0_a133 u0_a133 524288 2023-11-25 10:06 msgstore.db-wal
-rw-rw---- 1 u0_a133 u0_a133 4096 2023-11-25 09:25 payments.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 09:25 payments.db-shm
-rw------- 1 u0_a133 u0_a133 82432 2023-11-25 09:25 payments.db-wal
-rw-rw---- 1 u0_a133 u0_a133 4096 2023-10-05 21:22 stickers.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 09:54 stickers.db-shm
-rw------- 1 u0_a133 u0_a133 399672 2023-11-25 09:54 stickers.db-wal
-rw-rw---- 1 u0_a133 u0_a133 4096 2023-10-05 21:22 sync.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 09:25 sync.db-shm
-rw------- 1 u0_a133 u0_a133 119512 2023-10-05 21:22 sync.db-wal
-rw-rw---- 1 u0_a133 u0_a133 417792 2023-11-25 09:25 wa.db
-rw------- 1 u0_a133 u0_a133 32768 2023-11-25 09:55 wa.db-shm
-rw------- 1 u0_a133 u0_a133 436752 2023-11-25 09:55 wa.db-wal
注意 : msgstore.db等文件是登录成功后才有的.
msgstore.db 也就是消息相关的数据库.
导出后可以直接查看数据库信息.
首先可以看到表结构如下:
我们查看message表:
可以看到我们发的消息都存放在这里.
其余的表如: message_media, jid等表有兴趣的可以都打开看看.
4: shared_prefs目录
/data/data/com.whatsapp/shared_prefs # ls -l
total 308
-rw------- 1 u0_a133 u0_a133 65 2024-01-23 17:34 AccountDefenceLocalDataRepository_prefs.xml
-rw-rw---- 1 u0_a133 u0_a133 130 2023-10-05 21:22 _has_set_default_values.xml
-rw------- 1 u0_a133 u0_a133 65 2023-11-25 09:25 ab-prechatd-props.xml
-rw------- 1 u0_a133 u0_a133 153 2023-11-25 09:25 ab-props-backup.xml
-rw------- 1 u0_a133 u0_a133 70845 2023-11-25 09:54 ab-props.xml
-rw------- 1 u0_a133 u0_a133 666 2023-11-25 09:25 block_reasons_prefs.xml
-rw------- 1 u0_a133 u0_a133 1740 2023-11-25 10:06 chatCounts.xml
-rw------- 1 u0_a133 u0_a133 65 2023-11-25 09:54 chatlock_prefs.xml
-rw-rw---- 1 u0_a133 u0_a133 165 2023-11-25 09:25 com.google.android.gms.appid.xml
-rw------- 1 u0_a133 u0_a133 65 2023-11-25 09:25 com.whatsapp_payment_preferences.xml
-rw-rw---- 1 u0_a133 u0_a133 934 2023-11-25 10:06 com.whatsapp_preferences.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 com.whatsapp_preferences_daily_events.xml
-rw------- 1 u0_a133 u0_a133 9250 2023-11-25 10:20 com.whatsapp_preferences_light.xml
-rw------- 1 u0_a133 u0_a133 65 2023-11-25 09:25 community_shared_pref.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 companion_mode_prefs.xml
-rw------- 1 u0_a133 u0_a133 1055 2023-11-25 10:19 contact_sync_prefs.xml
-rw------- 1 u0_a133 u0_a133 356 2023-11-25 09:54 core_health_event_pref_file.xml
-rw------- 1 u0_a133 u0_a133 423 2023-11-25 09:25 critical_event_client_prefs.xml
-rw------- 1 u0_a133 u0_a133 183 2023-11-25 09:55 daily_metrics_prefs.xml
-rw------- 1 u0_a133 u0_a133 188 2023-11-25 09:25 disappearing_mode_prefs.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:22 dropped_wam_events.xml
-rw------- 1 u0_a133 u0_a133 210 2023-11-25 09:25 field-stats-events-sampling.xml
-rw------- 1 u0_a133 u0_a133 112 2023-10-05 21:22 google_bug_154855417.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 hybrid_payment_methods_used.xml
-rw------- 1 u0_a133 u0_a133 751 2023-11-25 09:25 keystore.xml
-rw------- 1 u0_a133 u0_a133 2427 2023-11-25 10:06 media_daily_usage_preferences_v1.xml
-rw------- 1 u0_a133 u0_a133 2061 2023-11-25 10:06 media_engagement_daily_preferences_v1.xml
-rw------- 1 u0_a133 u0_a133 616 2023-11-25 09:27 migration_export.xml
-rw------- 1 u0_a133 u0_a133 577 2023-11-25 09:25 network_resources_pref.xml
-rw------- 1 u0_a133 u0_a133 200 2023-11-25 09:25 ntp-scheduler.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 payment_daily_usage_preferences.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 payment_handle_prefs.xml
-rw------- 1 u0_a133 u0_a133 24536 2023-11-25 09:25 privacy_disclosure_store.xml
-rw------- 1 u0_a133 u0_a133 274 2023-11-25 10:04 privacy_highlight.xml
-rw------- 1 u0_a133 u0_a133 295 2023-11-25 09:26 privatestats_props.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 qr_code_daily_prefs.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 qr_code_txn_prefs.xml
-rw------- 1 u0_a133 u0_a133 710 2023-11-25 09:23 registration.RegisterPhone.xml
-rw------- 1 u0_a133 u0_a133 599 2023-11-25 09:23 registration.VerifyPhoneNumber.xml
-rw------- 1 u0_a133 u0_a133 2703 2023-11-25 10:20 route_selector_prefs.xml
-rw------- 1 u0_a133 u0_a133 3470 2023-11-25 09:25 server_prop_preferences.xml
-rw------- 1 u0_a133 u0_a133 817 2023-11-25 10:07 startup_prefs.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 syncd_prefs.xml
-rw------- 1 u0_a133 u0_a133 357 2023-11-25 10:06 time_spent_logging_prefs.xml
-rw------- 1 u0_a133 u0_a133 790 2023-11-25 10:12 time_spent_prefs.xml
-rw------- 1 u0_a133 u0_a133 273 2023-11-25 09:26 tos_gating_prefs.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 triggered_block_prefs.xml
-rw------- 1 u0_a133 u0_a133 129 2023-11-25 00:00 triggered_block_prefs_purge_ts.xml
-rw------- 1 u0_a133 u0_a133 118 2023-10-05 21:22 user_notice_prefs.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 voip_prefs.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 vpa_daily_prefs.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 vpa_payment_handle_prefs.xml
-rw------- 1 u0_a133 u0_a133 65 2023-10-05 21:37 vpa_txn_prefs.xml
查看startup_prefs.xml 文件:
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
<long name="last_ntp_client_time" value="xxx" />
<boolean name="async_tasks_pending_for_version_change" value="false" />
<int name="companion_registration_state" value="0" />
<boolean name="run_on_connect_tasks_for_version_change" value="false" />
<boolean name="force_db_check" value="false" />
<int name="startup_migrated_version" value="9" />
<int name="profile_photo_full_id" value="xxxx" />
<string name="version">2.xx.xx.xx</string>
<long name="client_server_time_diff" value="1000" />
<int name="profile_photo_thumb_id" value="xxxx" />
<long name="client_ntp_time_diff" value="-698" />
<int name="registration_state" value="3" />
<string name="push_name">zh</string>
</map>
这个文件中push_name就是当前登录的用户的昵称信息. version则是当前whatsapp的版本.