Skip to content

Commit

Permalink
Merge pull request #136 from nicoboss/android-support
Browse files Browse the repository at this point in the history
Android CLI support
  • Loading branch information
nicoboss authored Aug 5, 2023
2 parents 5209d6e + d863eba commit cc02cde
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ Use the following command to install the console-only version:\
Use the following command to install the GUI version:\
`pip3 install --upgrade nsz[gui]`

### Android
1. Install "Pydroid 3" and the "Pydroid repository plugin" from the Play Store
2. Open "Pydroid 3" and navigate to "Pip"
3. Enter "nsz" and unselect "use prebuild" then press install
4. Navigate to "Terminal" to use the "nsz" command
5. The first time it will tell you where to copy your prod.keys which you should do using the "cp" command
6. Use any command line arguments you want like "nsz -D file.nsz" to decompress your game

### Running from source
The tool can also be run by cloning the repository, installing the requirements and then executing nsz using `python3 nsz.py`

Expand Down
4 changes: 2 additions & 2 deletions nsz/BlockCompressor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def blockCompressContainer(readContainer, writeContainer, compressionLevel, keep
blockSize = 2**blockSizeExponent
manager = Manager()
results = manager.list()
readyForWork = Counter(0)
pleaseKillYourself = Counter(0)
readyForWork = Counter(manager, 0)
pleaseKillYourself = Counter(manager, 0)
TasksPerChunk = 209715200//blockSize
for i in range(TasksPerChunk):
results.append(b"")
Expand Down
8 changes: 3 additions & 5 deletions nsz/ThreadSafeCounter.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from multiprocessing import Value, Lock

class Counter(object):
def __init__(self, initval=0):
self.val = Value('i', initval)
self.lock = Lock()
def __init__(self, manager, initval=0):
self.val = manager.Value('i', initval)
self.lock = manager.Lock()
def set(self, newValue):
with self.lock:
self.val.value = newValue
Expand Down
10 changes: 5 additions & 5 deletions nsz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def main():
argOutFolder = Path(argOutFolderToPharse).resolve() if args.output else None

Print.info('')
Print.info(' NSZ v4.3 ,;:;;,')
Print.info(' NSZ v4.4 ,;:;;,')
Print.info(' ;;;;;')
Print.info(' .=\', ;:;;:,')
Print.info(' /_\', "=. \';:;:;')
Expand All @@ -113,12 +113,12 @@ def main():
barManager = enlighten.get_manager()
poolManager = Manager()
statusReport = poolManager.list()
readyForWork = Counter(0)
pleaseNoPrint = Counter(0)
pleaseKillYourself = Counter(0)
readyForWork = Counter(poolManager, 0)
pleaseNoPrint = Counter(poolManager, 0)
pleaseKillYourself = Counter(poolManager, 0)
pool = []
work = poolManager.Queue()
amountOfTastkQueued = Counter(0)
amountOfTastkQueued = Counter(poolManager, 0)
targetDictNsz = dict()
targetDictXcz = dict()

Expand Down
2 changes: 1 addition & 1 deletion nsz/gui/NSZ_GUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def build(self):
Window.minimum_height = 600
Logger.setLevel(realLevl)
Builder.load_file(getGuiPath('layout/GUI.kv'))
self.title = 'NSZ GUI 4.3'
self.title = 'NSZ GUI 4.4'
self.icon = getGuiPath('nsZip.png')
root = FloatLayout()
with open(getGuiPath('shaders/plasma.shader')) as stream:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='nsz',
version='4.3.0',
version='4.4.0',
script="nsz.py",
author="Nico Bosshard",
author_email="[email protected]",
Expand Down

0 comments on commit cc02cde

Please sign in to comment.