conflict resolution and update of get_app_name signature

This commit is contained in:
erev0s 2024-05-07 18:01:48 +03:00
parent 33c99a1695
commit 6539218fcc
2 changed files with 4 additions and 4 deletions

View File

@ -447,7 +447,7 @@ class APK:
"""
return self.filename
def get_app_name(self, **kwargs):
def get_app_name(self, locale=None) -> str:
"""
Return the appname of the APK
@ -500,7 +500,7 @@ class APK:
return app_name
try:
config = ARSCResTableConfig(None, **kwargs) if kwargs else ARSCResTableConfig.default_config()
config = ARSCResTableConfig(None, locale=locale) if locale else ARSCResTableConfig.default_config()
app_name = res_parser.get_resolved_res_configs(
res_id,
config)[0][1]

View File

@ -2568,7 +2568,7 @@ class ARSCResTableConfig:
char_out += chr(char_in[1])
return char_out
def _pack_language_or_region(self, char_in):
def _pack_language_or_region(self, char_in: str) -> list[int]:
char_out = [0x00, 0x00]
if len(char_in) != 2:
return char_out
@ -2588,7 +2588,7 @@ class ARSCResTableConfig:
region_bytes = [0x00, 0x00]
self.locale = language_bytes[0] | (language_bytes[1] << 8) | (region_bytes[0] << 16) | (region_bytes[1] << 24)
def get_language_and_region(self):
def get_language_and_region(self) -> str:
"""
Returns the combined language+region string or \x00\x00 for the default locale
:return: