Home | History | Annotate | Download | only in fs_config

Lines Matching refs:aid

93     def get_login_and_uid_cleansed(aid):
96 This checks that the logon and uid of the AID do not
100 aid (AID): The aid to check
103 logon, uid of the AID after checking its safe.
108 logon = aid.friendly
109 uid = aid.normalized_value
119 class AID(object):
120 """This class represents an Android ID or an AID.
127 friendly (str): The friendly name of aid.
145 value: The value of the AID, aka the uid.
158 friendly = identifier[len(AID.PREFIX):].lower()
159 self.friendly = AID._fixup_friendly(friendly)
169 """Determines if an AID is a freindly name or C define.
178 return not name.startswith(AID.PREFIX)
191 if friendly in AID._FIXUPS:
192 return AID._FIXUPS[friendly]
249 re.compile(r'%sUNUSED[0-9].*' % AID.PREFIX),
250 re.compile(r'%sAPP' % AID.PREFIX), re.compile(r'%sUSER' % AID.PREFIX)
252 _AID_DEFINE = re.compile(r'\s*#define\s+%s.*' % AID.PREFIX)
256 (AID.PREFIX, _OEM_START_KW, _OEM_END_KW))
257 # AID lines cannot end with _START or _END, ie AID_FOO is OK
266 file containing AID entries.
282 """Parses an AID header file. Internal use only.
285 aid_file (file): The open AID header file to parse.
317 """Handle an AID C #define.
319 Handles an AID, sanity checking, generating the friendly name and
330 aid = AID(identifier, value, self._aid_header)
333 if aid.friendly in self._aid_name_to_value:
334 raise ValueError('Duplicate aid "%s"' % identifier)
336 if value in self._aid_value_to_name and aid.identifier not in AIDHeaderParser._COLLISION_OK:
337 raise ValueError('Duplicate aid value "%s" for %s' % (value,
340 self._aid_name_to_value[aid.friendly] = aid
341 self._aid_value_to_name[value] = aid.friendly
346 When encountering special AID defines, notably for the OEM ranges
428 for aid in self._aid_value_to_name:
430 if Utils.in_any_range(aid, self._oem_ranges):
431 name = self._aid_value_to_name[aid]
433 'AID "%s" value: %u within reserved OEM Range: "%s"' %
434 (name, aid, str(self._oem_ranges)))
450 A list of AID() objects.
475 def _is_oem_range(aid):
476 """Detects if a given aid is within the reserved OEM range.
479 aid (int): The aid to test
485 return AIDHeaderParser._OEM_RANGE.match(aid)
514 # These _AID vars work together to ensure that an AID section name
519 _AID_MATCH = re.compile('%s[A-Z0-9_]+' % AID.PREFIX)
540 # (name to file, value to aid)
609 """Verifies an AID entry and adds it to the aid list.
625 FSConfigFileParser._handle_dup_and_add('AID', file_name, section_name,
629 invalid = match.end() if match else len(AID.PREFIX)
631 tmp_errmsg = ('Invalid characters in AID section at "%d" for: "%s"'
641 aid = AID(section_name, value, file_name)
644 error_message('Invalid "value", not aid number, got: \"%s\"' %
648 if not Utils.in_any_range(int(aid.value, 0), self._oem_ranges):
656 'AID', file_name, aid.normalized_value, self._seen_aids[1])
658 # Append aid tuple of (AID_*, base10(value), _path(value))
663 self._aids.append(aid)
755 """Get the list of AID entries.
758 a list of AID() objects.
943 '--aid-header',
959 # {aid.friendly: aid for aid in base_aids}
960 base_friendly = {aid.friendly: aid for aid in base_aids}
961 oem_friendly = {aid.friendly: aid for aid in oem_aids}
969 emsg = 'Following AID Collisions detected for: \n'
1007 if AID.is_friendly(user):
1012 if AID.is_friendly(group):
1037 aids ([AIDS]): A list of AID objects for Android Id entries.
1054 for aid in aids:
1056 print FSConfigGen._FILE_COMMENT % aid.found
1057 print FSConfigGen._GENERIC_DEFINE % (aid.identifier, aid.value)
1104 unsigned aid;
1134 for aid in hdr.aids:
1135 print AIDArrayGen._ID_ENTRY % (aid.friendly, aid.identifier)
1171 '--aid-header',
1186 for aid in parser.aids:
1187 self._print_aid(aid)
1192 def _print_aid(self, aid):
1193 """Prints a valid #define AID identifier to stdout.
1196 aid to print
1199 # print the source file location of the AID
1200 found_file = aid.found
1205 print OEMAidGen._GENERIC_DEFINE % (aid.identifier, aid.value)
1226 '--aid-header',
1245 for aid in aids:
1246 self._print_formatted_line(aid)
1248 def _print_formatted_line(self, aid):
1249 """Prints the aid to stdout in the passwd format. Internal use only.
1261 aid (AID): The aid to print.
1263 if self._old_file != aid.found:
1264 self._old_file = aid.found
1265 print PasswdGen._FILE_COMMENT % aid.found
1268 logon, uid = Utils.get_login_and_uid_cleansed(aid)
1280 def _print_formatted_line(self, aid):
1281 """Prints the aid to stdout in the group format. Internal use only.
1287 aid (AID): The aid to print.
1289 if self._old_file != aid.found:
1290 self._old_file = aid.found
1291 print PasswdGen._FILE_COMMENT % aid.found
1294 logon, uid = Utils.get_login_and_uid_cleansed(aid)