Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, raw_buff):
self.analyzed = False
self._resolved_strings = None
self.buff = BuffHandle(raw_buff)
self.header = ARSCHeader(self.buff)
self.packageCount = unpack('
self.packages[package_name] = []
mTableStrings = StringPoolChunk(self.buff)
mKeyStrings = StringPoolChunk(self.buff)
self.packages[package_name].append(current_package)
self.packages[package_name].append(mTableStrings)
self.packages[package_name].append(mKeyStrings)
pc = PackageContext(current_package, self.stringpool_main,
mTableStrings, mKeyStrings)
current = self.buff.get_idx()
while not self.buff.end():
header = ARSCHeader(self.buff)
self.packages[package_name].append(header)
if header.type == RES_TABLE_TYPE_SPEC_TYPE:
self.packages[package_name].append(ARSCResTypeSpec(
self.buff, pc))
elif header.type == RES_TABLE_TYPE_TYPE:
a_res_type = ARSCResType(self.buff, pc)
self.packages[package_name].append(a_res_type)
self.resource_configs[package_name][a_res_type].add(
a_res_type.config)
self.buff.set_idx(header.start+header.header_size)
entries = []
for j in range(0, a_res_type.entryCount):
current_package.mResId = current_package.mResId & 0xffff0000 | j
def __init__(self, raw_buff):
self.analyzed = False
self._resolved_strings = None
self.buff = BuffHandle(raw_buff)
self.header = ARSCHeader(self.buff)
self.packageCount = unpack('
def _analyse(self):
if self.analyzed:
return
self.analyzed = True
for package_name in self.packages:
self.values[package_name] = {}
nb = 3
while nb < len(self.packages[package_name]):
header = self.packages[package_name][nb]
if isinstance(header, ARSCHeader):
if header.type == RES_TABLE_TYPE_TYPE:
a_res_type = self.packages[package_name][nb + 1]
if a_res_type.config.get_language(
) not in self.values[package_name]:
self.values[package_name][
a_res_type.config.get_language()
] = {}
self.values[package_name][a_res_type.config.get_language(
)]["public"] = []
c_value = self.values[package_name][
a_res_type.config.get_language()
]
entries = self.packages[package_name][nb + 2]