Extracted common methods (#281)

This commit is contained in:
Nikhil Badyal
2023-08-15 15:19:02 +05:30
committed by GitHub
parent a373242773
commit 4d3e82b4fb
3 changed files with 34 additions and 16 deletions
+8
View File
@@ -58,6 +58,14 @@ class Patches(object):
key: (value, "_" + value) for key, value in _revanced_app_ids.items()
}
@staticmethod
def get_package_name(app: str) -> str:
"""Get Package name from app name."""
for package, app_tuple in Patches.revanced_app_ids.items():
if app_tuple[0] == app:
return package
raise AppNotFound("App Not Found.")
@staticmethod
def support_app() -> Dict[str, str]:
"""Return supported apps."""