Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Commit

Permalink
mini-refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
packmad committed Sep 3, 2019
1 parent 87e6afa commit 76cccbf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/obfuscapk/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,19 @@ def get_smali_method_overload() -> str:


def get_decrypt_asset_smali_code(encryption_secret: str) -> str:
return get_text_from_file(os.path.join(os.path.dirname(__file__),
'resources', 'smali', 'DecryptAsset.smali'
).replace('This-key-need-to-be-32-character', encryption_secret))
text = get_text_from_file(os.path.join(os.path.dirname(__file__),
'resources', 'smali', 'DecryptAsset.smali'))
return replace_default_secret_key(text, encryption_secret)


def get_decrypt_string_smali_code(encryption_secret: str) -> str:
return get_text_from_file(os.path.join(os.path.dirname(__file__),
'resources', 'smali', 'DecryptString.smali')
).replace('This-key-need-to-be-32-character', encryption_secret)
text = get_text_from_file(os.path.join(os.path.dirname(__file__),
'resources', 'smali', 'DecryptString.smali'))
return replace_default_secret_key(text, encryption_secret)


def replace_default_secret_key(text: str, encryption_secret: str) -> str:
return text.replace('This-key-need-to-be-32-character', encryption_secret)


def get_api_reflection_smali_code() -> str:
Expand Down

0 comments on commit 76cccbf

Please sign in to comment.