Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: python refactor #65

Closed
jxdv opened this issue Jan 1, 2024 · 2 comments
Closed

feat: python refactor #65

jxdv opened this issue Jan 1, 2024 · 2 comments

Comments

@jxdv
Copy link
Contributor

jxdv commented Jan 1, 2024

Hi, first of all thanks for this tool. I was reading the code, and noticed there's some room for improvements.

Few examples:

def isNewInstallation():
	if (os.path.exists(rootDir)==False):
		myPrint("Thank you for installing APKEnum", "OUTPUT_WS")
		os.mkdir(rootDir)
		return True
	else:
		return False

The above function could be rewritten for easier readability like this:

def isNewInstallation():
        if os.path.exists(rootDir):
                return False

	myPrint("Thank you for installing APKEnum", "OUTPUT_WS")
	os.mkdir(rootDir)
	return True

Class parenthesis are redundant in python3, and since medusa doesn't support python2 they are no longer needed:

class nativeHandler() -> class nativeHandler

The parenthesis here are also redundant:

if(type=="INFO"):
	print(bcolors.INFO+bcolors.BOLD+text+bcolors.ENDC)
	return

Could just be:

if type == "INFO":
	print(bcolors.INFO+bcolors.BOLD+text+bcolors.ENDC)
	return

And a lot more..I think it'd be better to have well formatted code that follows the best practices. LMK if you care about this at all, and I can create some PRs.

@Ch0pin
Copy link
Owner

Ch0pin commented Jan 1, 2024

thanks @jxdv , feel free to do the PRs , although expect some delays on their review, since I am out of office.

@jxdv
Copy link
Contributor Author

jxdv commented Jan 4, 2024

Closing this since I've already opened up some cleanup PRs.

@jxdv jxdv closed this as completed Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants