Closed orklann closed 2 years ago
I would like to remove Python 2.7 (as well as PyCrypto) completely from dependencies list, it would be better if the module "decrypt.py" was written in Rust/C++, but I donβt have much time to do it π
Hi @orklann and @shijimasoft, I can confirm you that instead of pycrypto, you can use https://github.com/Legrandin/pycryptodome .
It's a drop-in for pycrypto and works for Python3. So it's just a matter of pip install pycryptodome instead of pycrypto.
Hello @Atem18, did you changed some features or methods in decrypt.py
?
The script should include some python2 things, that must be adjusted for python3
I looked at pycryptodome and I noticed that APIs are the same as pycrypto. Thank you for bringing this to us! π
@shijimasoft Indeed, there are errors about the str and bytes like:
if magic == 'NSCD'
should become
if magic == b'NSCD'
And a few things that should not be too hard to fix as it's seems that it's mostly about string representation that changed between python 2 and 3.
@Atem18, if you have time to do it, could you commit (with a PR) the new python3 changes? I can create a new experimental branch, and merge it after some tests.
I would really appreciate it π
@shijimasoft For sure yes, I can try.
Hello @orklann! I recently released a new "experimental" version of cia-unix that supports python3. Now, I've tested it with few roms, please let me know if it works with yours π
You can find the experimental branch here.
Note You must install
pycryptodome
as python3 dependency and build cia-unix from source
I will leave the issue open while the experimental version has been tested
@Atem18 thank you again for your PR β€οΈ
@shijimasoft Thanks to you for your support !
Also do note that I tested with another rom and Citra is still crashing. With which roms did you do your tests ?
Thanks a lot in advance.
@Atem18 I tried Culdcept Revolt (EUR) and Tetris Ultimate (US). They worked smoothly with citra
@shijimasoft I tried and they also crash. Which OS and citra version are you testing it ?
I have tested it on macOS (Intel) with the latest citra nightly build
@shijimasoft Me too, so I don't understand what is wrong...
@Atem18 try to uninstall citra with appcleaner (it will remove also citra caches and hidden files) and reinstall it, let me know if changed something
@shijimasoft Same issue on Linux so maybe I am missing something somewhere.
It is very strange. Anyway, I will release the preview build (with python3 support) in the next few days, so it will be possible to get more feedback
I have also tried building and running the experimental branch on Arch Linux (Steam Deck) and am having some issues.
(deck@steamdeck cia-unix)$ crystal build cia-unix.cr --release --no-debug
(deck@steamdeck cia-unix)$ ./cia-unix
which: no decrypt.py in (/home/deck/.linuxbrew/bin:/home/deck/.linuxbrew/sbin:/home/deck/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)
Decrypting: TLOZALBWEU.3ds...
Building decrypted TLOZALBWEU 3DS...
Decryption completed
Removing cache...
Log saved
(deck@steamdeck cia-unix)$ ls
build.sh cia-unix cia-unix.cr ctrtool decrypt.py dltools.sh LICENSE makerom README.md TLOZALBWEU.3ds TLOZALBWEU-decrypted.3ds
@skabber I just committed a fix for this error (https://github.com/shijimasoft/cia-unix/commit/9609400373251d1c82fc96cb653a926212adbf20), please try to compile the updated code and let me know if it worked, thank you π
Also, I will close this issue, if you have any other problems, please open a new one.
It took me some effort to make cia-unix work on Ubuntu 22.04 with Python2. It would be nice to have it work for Python3 since Python2 is too old, and maybe later we will not run Python 2 at all.