# Parses all Android config files (json/db/xml) in the /data/ folder and returns an easy-to-handle DataFrame
### Some things you have to know:
- You need root access
- I have only tested it against BlueStacks / Windows 10 / Python 3.9.
- The parsing might take a while and the DataFrame might get huge. (103,000 rows on my BlueStacks emulator with 3 apps installed [Roblox, YouTube, GloboTV]
- It ignores all Exceptions, but prints them out. Usually, you can ignore them because, most of the time, they are thrown because of empty files
- Don't use the sed columns yet (search and replace) on a real device. You could screw up your cell phone.
```python
$pip install a-pandas-ex-adb-settings-to-df
from a_pandas_ex_adb_settings_to_df import pd_add_adb_settings_to_df
pd_add_adb_settings_to_df()
import pandas as pd
adb_path = "C:\\Users\\Gamer\\AppData\\Local\\Android\\Sdk\\platform-tools\\adb.exe"
deviceserial = "localhost:5875"
save_in_folder = "f:\\tempfilesforandroid" # to save the json/db/xml files
df = pd.Q_adb_settings_to_df(
adb_path=adb_path,
deviceserial=deviceserial,
save_in_folder=save_in_folder,
folder="data/", # Should be the same on any android device,
with_sed_columns=False # DON'T USE THIS ON A REAL DEVICE! SEARCH + REPLACE
)
index aa_all_keys ... level_6 level_7
0 0.0 (long, name) ... NaN NaN
1 1.0 (long, value) ... NaN NaN
2 0.0 (boolean, 0, name) ... NaN NaN
3 1.0 (boolean, 0, value) ... NaN NaN
4 2.0 (boolean, 1, name) ... NaN NaN
... ... ... ... ...
103404 NaN (6, desc) ... NaN NaN
103405 NaN (6, label) ... NaN NaN
103406 NaN (6, pkg) ... NaN NaN
103407 NaN (6, source) ... NaN NaN
103408 NaN (6, url) ... NaN NaN
[103409 rows x 15 columns]
print(df[10:20].to_string())
index aa_all_keys aa_value aa_xpath aa_snippet aa_file aa_file_android level_0 level_1 level_2 level_3 level_4 level_5 level_6 level_7
10 8.0 (boolean, 4, name) preferences_home_tz_enabled //boolean[5] <boolean name="preferences_home_tz_enabled" value="false"/> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml boolean 4 name <NA> <NA> <NA> <NA> <NA>
11 9.0 (boolean, 4, value) false //boolean[5] <boolean name="preferences_home_tz_enabled" value="false"/> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml boolean 4 value <NA> <NA> <NA> <NA> <NA>
12 10.0 (boolean, 5, name) preferences_alerts_popup //boolean[6] <boolean name="preferences_alerts_popup" value="false"/> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml boolean 5 name <NA> <NA> <NA> <NA> <NA>
13 11.0 (boolean, 5, value) false //boolean[6] <boolean name="preferences_alerts_popup" value="false"/> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml boolean 5 value <NA> <NA> <NA> <NA> <NA>
14 12.0 (string, 0, name) preferences_week_start_day //string[1] <string name="preferences_week_start_day"> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 0 name <NA> <NA> <NA> <NA> <NA>
15 13.0 (string, 0, string) -1 //string[1] <string name="preferences_week_start_day"> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 0 string <NA> <NA> <NA> <NA> <NA>
16 14.0 (string, 1, name) preferences_version //string[2] <string name="preferences_version"> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 1 name <NA> <NA> <NA> <NA> <NA>
17 15.0 (string, 1, string) 7.1.2 //string[2] <string name="preferences_version"> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 1 string <NA> <NA> <NA> <NA> <NA>
18 16.0 (string, 2, name) preferences_alerts_ringtone //string[3] <string name="preferences_alerts_ringtone"> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 2 name <NA> <NA> <NA> <NA> <NA>
19 17.0 (string, 2, string) content://settings/system/notification_sound //string[3] <string name="preferences_alerts_ringtone"> f:\tempfilesforandroid\data\data\com.android.calendar\shared_prefs\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 2 string <NA> <NA> <NA> <NA> <NA>
```
Raw data
{
"_id": null,
"home_page": "https://github.com/hansalemaos/a_pandas_ex_adb_settings_to_df",
"name": "a-pandas-ex-adb-settings-to-df",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "settings,adb,pandas,DataFrame,content,android,providers",
"author": "Johannes Fischer",
"author_email": "<aulasparticularesdealemaosp@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/75/a2/87f63fa956052acc80705d9af6dabd029b2a6ac9e62338fb749e8a4db863/a_pandas_ex_adb_settings_to_df-0.10.tar.gz",
"platform": null,
"description": "\n# Parses all Android config files (json/db/xml) in the /data/ folder and returns an easy-to-handle DataFrame\n\n\n\n### Some things you have to know:\n\n\n\n- You need root access\u00a0\n\n- I have only tested it against BlueStacks / Windows 10 / Python 3.9.\n\n- The parsing might take a while and the DataFrame might get huge. (103,000 rows on my BlueStacks emulator with 3 apps installed [Roblox, YouTube, GloboTV]\n\n- It ignores all Exceptions, but prints them out. Usually, you can ignore them because, most of the time, they are thrown because of empty files\u00a0\n\n- Don't use the sed columns\u00a0yet\u00a0(search and replace) on a real device. You could screw up your cell phone.\u00a0\n\n\n\n\n\n\n\n```python\n\n\n\n$pip install a-pandas-ex-adb-settings-to-df\n\n\n\nfrom a_pandas_ex_adb_settings_to_df import pd_add_adb_settings_to_df\n\npd_add_adb_settings_to_df()\n\nimport pandas as pd\n\nadb_path = \"C:\\\\Users\\\\Gamer\\\\AppData\\\\Local\\\\Android\\\\Sdk\\\\platform-tools\\\\adb.exe\"\n\ndeviceserial = \"localhost:5875\"\n\nsave_in_folder = \"f:\\\\tempfilesforandroid\" # to save the json/db/xml files\n\ndf = pd.Q_adb_settings_to_df(\n\n adb_path=adb_path,\n\n deviceserial=deviceserial,\n\n save_in_folder=save_in_folder,\n\n folder=\"data/\", # Should be the same on any android device,\n\n\twith_sed_columns=False # DON'T USE THIS ON A REAL DEVICE! SEARCH + REPLACE \n\n)\n\n\n\n\n\n\n\n index aa_all_keys ... level_6 level_7\n\n0 0.0 (long, name) ... NaN NaN\n\n1 1.0 (long, value) ... NaN NaN\n\n2 0.0 (boolean, 0, name) ... NaN NaN\n\n3 1.0 (boolean, 0, value) ... NaN NaN\n\n4 2.0 (boolean, 1, name) ... NaN NaN\n\n ... ... ... ... ...\n\n103404 NaN (6, desc) ... NaN NaN\n\n103405 NaN (6, label) ... NaN NaN\n\n103406 NaN (6, pkg) ... NaN NaN\n\n103407 NaN (6, source) ... NaN NaN\n\n103408 NaN (6, url) ... NaN NaN\n\n[103409 rows x 15 columns]\n\n\n\n\n\nprint(df[10:20].to_string())\n\n index aa_all_keys aa_value aa_xpath aa_snippet aa_file aa_file_android level_0 level_1 level_2 level_3 level_4 level_5 level_6 level_7\n\n10 8.0 (boolean, 4, name) preferences_home_tz_enabled //boolean[5] <boolean name=\"preferences_home_tz_enabled\" value=\"false\"/> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml boolean 4 name <NA> <NA> <NA> <NA> <NA>\n\n11 9.0 (boolean, 4, value) false //boolean[5] <boolean name=\"preferences_home_tz_enabled\" value=\"false\"/> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml boolean 4 value <NA> <NA> <NA> <NA> <NA>\n\n12 10.0 (boolean, 5, name) preferences_alerts_popup //boolean[6] <boolean name=\"preferences_alerts_popup\" value=\"false\"/> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml boolean 5 name <NA> <NA> <NA> <NA> <NA>\n\n13 11.0 (boolean, 5, value) false //boolean[6] <boolean name=\"preferences_alerts_popup\" value=\"false\"/> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml boolean 5 value <NA> <NA> <NA> <NA> <NA>\n\n14 12.0 (string, 0, name) preferences_week_start_day //string[1] <string name=\"preferences_week_start_day\"> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 0 name <NA> <NA> <NA> <NA> <NA>\n\n15 13.0 (string, 0, string) -1 //string[1] <string name=\"preferences_week_start_day\"> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 0 string <NA> <NA> <NA> <NA> <NA>\n\n16 14.0 (string, 1, name) preferences_version //string[2] <string name=\"preferences_version\"> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 1 name <NA> <NA> <NA> <NA> <NA>\n\n17 15.0 (string, 1, string) 7.1.2 //string[2] <string name=\"preferences_version\"> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 1 string <NA> <NA> <NA> <NA> <NA>\n\n18 16.0 (string, 2, name) preferences_alerts_ringtone //string[3] <string name=\"preferences_alerts_ringtone\"> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 2 name <NA> <NA> <NA> <NA> <NA>\n\n19 17.0 (string, 2, string) content://settings/system/notification_sound //string[3] <string name=\"preferences_alerts_ringtone\"> f:\\tempfilesforandroid\\data\\data\\com.android.calendar\\shared_prefs\\com.android.calendar_preferences.xml /data/data/com.android.calendar/shared_prefs/com.android.calendar_preferences.xml string 2 string <NA> <NA> <NA> <NA> <NA>\n\n\n\n\n\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "# Parses all Android config files (json/db/xml) in the /data/ folder and returns an easy-to-handle DataFrame",
"version": "0.10",
"split_keywords": [
"settings",
"adb",
"pandas",
"dataframe",
"content",
"android",
"providers"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "74f9ad1c7003fd00871de393c2e773195aa49657b4cde7d382661085d1f17cb6",
"md5": "faa218344de42f82845d5dd84d974f45",
"sha256": "8b849a6a25e237589aae5c1b73edb0838e76d6e5cd358bf2f2aa9c1bc9a66bb4"
},
"downloads": -1,
"filename": "a_pandas_ex_adb_settings_to_df-0.10-py3-none-any.whl",
"has_sig": false,
"md5_digest": "faa218344de42f82845d5dd84d974f45",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 9134,
"upload_time": "2022-12-09T00:14:51",
"upload_time_iso_8601": "2022-12-09T00:14:51.676282Z",
"url": "https://files.pythonhosted.org/packages/74/f9/ad1c7003fd00871de393c2e773195aa49657b4cde7d382661085d1f17cb6/a_pandas_ex_adb_settings_to_df-0.10-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "75a287f63fa956052acc80705d9af6dabd029b2a6ac9e62338fb749e8a4db863",
"md5": "81c04e3f04c43db320d6497d1e0714c5",
"sha256": "5fc05093ed2837af6c86daa467eedebcda34547954abf04559e1a8d430db9386"
},
"downloads": -1,
"filename": "a_pandas_ex_adb_settings_to_df-0.10.tar.gz",
"has_sig": false,
"md5_digest": "81c04e3f04c43db320d6497d1e0714c5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7083,
"upload_time": "2022-12-09T00:14:53",
"upload_time_iso_8601": "2022-12-09T00:14:53.482990Z",
"url": "https://files.pythonhosted.org/packages/75/a2/87f63fa956052acc80705d9af6dabd029b2a6ac9e62338fb749e8a4db863/a_pandas_ex_adb_settings_to_df-0.10.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-09 00:14:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "hansalemaos",
"github_project": "a_pandas_ex_adb_settings_to_df",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [],
"lcname": "a-pandas-ex-adb-settings-to-df"
}