Pages

Saturday, October 26, 2019

Part 3 - ADB keyvalue backups - Wifi and System settings

This is Part 3 of the continuing blog series on ADB keyvalue backups. Today we focus on Wifi settings and other system configuration available from-
<Backup.adb>/apps/com.android.providers.settings/k/com.android.providers.settings.data
They are backed up only if you specified the -keyvalue option and are available on non-rooted devices too.

This file follows the Key-Value Data format as outlined earlier in part 1. There are 8 different types of data seen here. The Key name represents the type of data and Value represents either a single structure or a set of name-value pairs (both name and value are strings). The table below shows the data seen here.

Key Name
Description
system
settings about font sizes, screen brightness, hearing aids, haptic feedback among others
secure
more system settings on gestures, button behaviors, spell checker, screensaver, accessibility, etc..
global
Boolean settings that enable/disable options like wifi wakeup,   auto_time, sounds enabled, call auto-retry, etc..
locale
a locale string like ‘en-US’
lock_settings
owner info for display on screen if enabled
softap_config
Access point settings for Mobile hotspot
network_policies
unknown
wifi_new_config
xml data having wifi settings for connected access points

Perhaps the most interesting aspect here is the presence of wifi passwords (WPA pre-shared keys) in the wifi_new_config data as see in screenshot below. Yes, you can get wifi passwords from an adb backup now!

Figure 1 - Snippet of Wifi saved settings from com.android.providers.settings.data showing SSIDs & passwords
Here is a python script to read com.android.providers.settings.data and export the information to json files. Below you can see some of the data parsed by the this script for one of my test devices.


Figure 2 - Data from 'global' key
Figure 3 - Data from 'system' key


Figure 4 - Data from 'secure' key





Figure 5 - Data from 'softap_config' key
Figure 6 - Data from 'lock_settings' key

1 comment: