Skip to content

Commit

Permalink
Added entrypoint, rewrote readme, major refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
190nm committed Aug 2, 2021
1 parent ec5f364 commit c4c05f7
Show file tree
Hide file tree
Showing 4 changed files with 214 additions and 113 deletions.
68 changes: 41 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,64 @@


## Installing
Extract the release zip, then compile like so:
Extract the release zip, then compile it:

```python setup.py build_ext --inplace```
```
python setup.py build_ext --inplace
```

On windows you may need to install the [Python native development tools](https://docs.microsoft.com/en-us/visualstudio/python/installing-python-support-in-visual-studio?view=vs-2019#:~:text=Installs%20the%20C%2B%2B%20compiler%20and%20other%20necessary%20components) from visual studio first.

## Usage
Then, install the package:

```
python setup.py install
```
## For those who c[A]re:

* *As a courtesy to other fans, please refrain from spoiling unreleased story contents if any are found after decrypting.*
* *As a courtesy to other fans, please refrain from spoiling unreleased **story contents** if any are found after decrypting.*

* **An android device with root access is required, such as an emulator**

```
Default behavior with no arguments is to attempt to decrypt the cache and export json lists of new and changed resources.
## First time setup

optional arguments:
-r , --revision The target cache revision to read during parsing for new assets. Defaults to None.
-d, --decrypt Decrypt and export assets after processing the database. Defaults to False.
-e {all,new}, --export {all,new}
Which assets to export. Defaults to new
-k , --key Magic alphanumeric numbers.
-iv , --iv Magic base64-ish numbers.
```
* **An android device with root access (such as an emulator) is required to use this tool.**

Place the encrypted cache file `octocacheevai` in the root folder next to `reincli.py`.
It can be found at:
* Create a new folder at **`/caches/<platform>/`** in the ***current working directory*** where **`<platform>`** is the localization to decrypt.

`\data\data\com.square_enix.android_googleplay.nierspjp\files\octo\pdb\201\<numbers>\octocacheevai`
*(i.e for the japanese release: **`/caches/jp/`**.)*

The encrypted resources are located at:
* Move the encrypted cache file **`octocacheevai`** to the new folder. It can be found at:

`\data\data\com.square_enix.android_googleplay.nierspjp\files\v1\201\`
**`\data\data\com.square_enix.android_googleplay.nierspjp\files\octo\pdb\201\<numbers>\octocacheevai`**

Move all of the files within to a folder in the script directory named `resources`. (Though only the ones with 32 character filenames such as `c2e196279db8b6a49db81e1a64cd344a` are necessary.)
* Create another new folder at **`/resources/<platform>/`** using the same localization as before for **`<platform>`**.

Move *ALL* of the encrypted resources there. They can be found at:

## Decrypting all resources
`\data\data\com.square_enix.android_googleplay.nierspjp\files\v1\201\`.

*(In particular, only the ones with 32 character filenames such as `c2e196279db8b6a49db81e1a64cd344a` are necessary.)*

The tool is now ready to be used.

## Usage



* Example: Decrypting all english resources
```
python reincli.py --decrypt --export all
reinkuro --localization english --decrypt all
```

## Decrypting new resources
If it has been used before with an older cache version, the script may also decrypt only the new/changed resources found in the updated cache version.
(This is the default behaviour)
* When run with no arguments, the default behavior is to decrypt the japanese cache and export the differences to json.
```
python reincli.py --decrypt
optional arguments:
-h, --help show this help message and exit
-d {cache_only,new,all}, --decrypt {cache_only,new,all}
Which assets to decrypt. Defaults to cache_only, which will only export differences to json.
-l {en,jp,encbt,jpcbt}, --localization {en,jp,encbt,jpcbt}
Which localization to target. Defaults to jp. Also supports cache files from the closed beta releases.
-r , --revision The target cache revision to read during parsing for new assets. Defaults to None.
-k , --key Manually specifcy a new key. Hint: Magic alphanumeric numbers.
-iv , --iv Manually specify a new iv. Hint: Magic base64-ish numbers.
```
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ exclude = '''
'''

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
Loading

0 comments on commit c4c05f7

Please sign in to comment.