morpheuslord / QuadraInspect

QuadraInspect is an Android framework that integrates AndroPass, APKUtil, and MobFS, providing a powerful tool for analyzing the security of Android applications.
MIT License
339 stars 51 forks source link

Problem on Linux for "Match mode" #2

Closed SSHad0w closed 1 year ago

SSHad0w commented 1 year ago

I'm experiencing an issue while running main.py file.

$ python3 main.py 
  File "/home/sshad0w/Documents/launderer/QuadraInspect/main.py", line 47
    match mode:
          ^
SyntaxError: invalid syntax

Currently trying to find the patch.

morpheuslord commented 1 year ago

Yes Linux is not a fan of switch case statements working on it

SSHad0w commented 1 year ago

I've actually reproduced the bug on windows 10.

morpheuslord commented 1 year ago

Can you send a pic

SSHad0w commented 1 year ago

Is it okay if I just provide the code block?

  File "C:\Users\SSHad0w\OneDrive\Desktop\tool.py", line 49
    match mode:
          ^
SyntaxError: invalid syntax
[Finished in 96ms]

It's just the same error.

SSHad0w commented 1 year ago

This only supports python3.10 and above.

After some research, I learned that match statements are only supported in python 3.10 and later, while python 3.9 and earlier don't have that feature.

Basically, if you want this to be backwards compatible, you'll need to change the match [case] statements to if [case] statements instead. You may also need to change the end of the statements to the elif format as well.

I'm changing my version to see if this works, but I'm pretty sure that's the "bug". I'm using Python3.9, you must be using 3.10.

morpheuslord commented 1 year ago

This only supports python3.10 and above.

After some research, I learned that match statements are only supported in python 3.10 and later, while python 3.9 and earlier don't have that feature.

Basically, if you want this to be backwards compatible, you'll need to change the match [case] statements to if [case] statements instead. You may also need to change the end of the statements to the elif format as well.

I'm changing my version to see if this works, but I'm pretty sure that's the "bug". I'm using Python3.9, you must be using 3.10.

Yup confirmed that the bug is related to the Python version, I will mention in the readme to use version 3.10 for compatibility.

Check the README for the updates