Skip to content

Commit

Permalink
"""Resolve""" issue with main abi not being extracted - #4
Browse files Browse the repository at this point in the history
Also adds alternative source for serial number

all available abis are now mwerged, instead of being replaced by
the value in 'abilist'. Which means that there will be duplicates.
I have yet to resolve that.
  • Loading branch information
rmmbear committed Oct 23, 2017
1 parent 462c003 commit d6cf058
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions helper/extract_device_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,16 +223,22 @@ def _format_value(self, extracted_value):
(("getprop",), (("as_list", False), ("return_output", True)), "getprop") : (
InfoSpec(
extraction_commands=(
(re.search, ('(?<=\\[ro\\.boot\\.serialno\\]: \\[).*(?=\\])', '$source')),),
var_name='Serial #', var_dict_1='Device', var_dict_2='_info'),
(re.search, ("(?<=\\[ro\\.boot\\.serialno\\]: \\[).*(?=\\])", "$source")),
),
var_name="Serial #", var_dict_1="Device", var_dict_2="_info"
),
InfoSpec(
extraction_commands=(
(re.search, ('(?<=\\[ro\\.product\\.model\\]: \\[).*(?=\\])', '$source')),),
var_name='Model', var_dict_1='Device', var_dict_2='_info'),
(re.search, ('(?<=\\[ro\\.product\\.model\\]: \\[).*(?=\\])', '$source')),
),
var_name="Model", var_dict_1="Device", var_dict_2="_info"
),
InfoSpec(
extraction_commands=(
(re.search, ('(?<=\\[ro\\.product\\.manufacturer\\]: \\[).*(?=\\])', '$source')),),
var_name='Manufacturer', var_dict_1='Device', var_dict_2='_info'),
(re.search, ("(?<=\\[ro\\.product\\.manufacturer\\]: \\[).*(?=\\])", "$source")),
),
var_name="Manufacturer", var_dict_1="Device", var_dict_2="_info"
),
InfoSpec(
extraction_commands=(
(re.search, ('(?<=\\[ro\\.product\\.device\\]: \\[).*(?=\\])', '$source')),),
Expand Down Expand Up @@ -285,14 +291,13 @@ def _format_value(self, extracted_value):
(re.search, ('(?<=\\[ro\\.product\\.cpu\\.abi\\]\\: \\[).*(?=\\])', '$source')),
(re.search, ('(?<=\\[ro\\.product\\.cpu\\.abi2\\]\\: \\[).*(?=\\])', '$source'))),
var_name='Available ABIs', var_dict_1='Chipset', var_dict_2='_info'),
# replace the above info if abilist is available
# abilist does not always include the primary abi
InfoSpec(
extraction_commands=(
(re.search, ('(?<=\\[ro\\.product\\.cpu\\.abilist\\]\\: \\[).*(?=\\])', '$source')),),
var_name='Available ABIs', var_dict_1='Chipset', var_dict_2='_info', resolve_existing_values='replace',
var_name='Available ABIs', var_dict_1='Chipset', var_dict_2='_info',
post_extraction_commands=(
('method', 'replace', (',', ', ')),
('method', 'replace', (' ', ' ')))),
('method', 'split'),)),
InfoSpec(
extraction_commands=(
(re.search, ('(?<=\\[dalvik\\.vm\\.stack\\-trace\\-file\\]: \\[).*(?=\\])', '$source')),),
Expand All @@ -306,6 +311,12 @@ def _format_value(self, extracted_value):
(re.search, ('(?<=\\[external\\_sd\\_path\\]: \\[).*(?=\\])', '$source')),),
var_name='external_sd_path', resolve_existing_values='drop'),
),
(("cat", "/sys/class/android_usb/android0/iSerial"), (("as_list", False), ("return_output", True)), "iserial"): (
InfoSpec(
var_name="Serial #", var_dict_1="Device", var_dict_2="_info",
resolve_existing_values="drop",
),
),
(("cat", "/proc/cpuinfo"), (("as_list", False), ("return_output", True)), "cpuinfo"): (
InfoSpec(
extraction_commands=(
Expand Down

0 comments on commit d6cf058

Please sign in to comment.