Compare commits
9 Commits
hekate-6.0
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94e60e0ded | ||
|
|
b0233b796e | ||
|
|
99b45cac7b | ||
|
|
ee212a5156 | ||
|
|
dfe42c3991 | ||
|
|
c895266f34 | ||
|
|
6881075fc8 | ||
|
|
09cd6e2bd1 | ||
|
|
23cc913bf2 |
@@ -51,16 +51,18 @@ For question specifically for TegraExplorer, go to [my discord](https://discord.
|
||||
Based on [Lockpick_RCM](https://github.com/shchmue/Lockpick_RCM), and thus also based on [Hekate](https://github.com/CTCaer/hekate)
|
||||
|
||||
Awesome people who helped with this project:
|
||||
- shchmue
|
||||
- Dennthecafebabe
|
||||
- [shchmue](https://github.com/shchmue)
|
||||
- [maddiethecafebabe](https://github.com/maddiethecafebabe/)
|
||||
- [bleck9999](https://github.com/bleck9999)
|
||||
|
||||
Other awesome people:
|
||||
- PhazonicRidley
|
||||
- Dax
|
||||
- Huhen
|
||||
- Bleck9999
|
||||
- Exelix
|
||||
- Emmo
|
||||
- Gengar
|
||||
- Einso
|
||||
|
||||
## Screenshots
|
||||
|
||||
|
||||
@@ -43,7 +43,10 @@ static const pkg1_id_t _pkg1_ids[] = {
|
||||
{ "20210422", 10}, //12.0.2 - 12.0.3
|
||||
{ "20210607", 11}, //12.1.0
|
||||
{ "20210805", 12}, //13.0.0 - 13.2.0
|
||||
{ "20220105", 12}, //13.2.1+
|
||||
{ "20220105", 12}, //13.2.1
|
||||
{ "20220209", 13}, //14.0.0 - 14.1.2
|
||||
{ "20220801", 14}, //15.0.0 - 15.0.1
|
||||
{ "20230111", 15}, //16.0.0+
|
||||
{ NULL } //End.
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# Copyright (c) 2021 bleck9999
|
||||
# https://github.com/bleck9999/ts-minifier
|
||||
# Version: e276c417
|
||||
|
||||
# Version: 49befe92
|
||||
import argparse
|
||||
import itertools
|
||||
import logging
|
||||
@@ -153,12 +152,12 @@ def minify(script: Code, userobjects, usages):
|
||||
# minus the amount of characters it would take to define an alias (len(alias)+len(func)+2), with the 2 being for the
|
||||
# equals and the whitespace needed for a definition
|
||||
# the same principle also applies to introducing a variable for string literals, though since a literal requires
|
||||
# having "s around it then it's uses*(len(str)+2) - (len(minName)+len(str)+4)
|
||||
# having "s around it then it's uses*(len(str)+2) - (len(minName)+len(str)+4) instead
|
||||
# ^ 2 for = and whitespace, 2 for ""
|
||||
#
|
||||
# obviously for a rename you're already defining it so it's just the difference between lengths multiplied by uses
|
||||
short_idents = [x for x in (ascii_letters + '_')] + [x[0] + x[1] for x in
|
||||
itertools.product(ascii_letters + '_', repeat=2)]
|
||||
short_idents = [x for x in (ascii_letters + '_')] + \
|
||||
[x[0] + x[1] for x in itertools.product(ascii_letters + '_', repeat=2)]
|
||||
short_idents.pop(short_idents.index("if"))
|
||||
mcode = script.rawcode
|
||||
aliases = []
|
||||
@@ -267,6 +266,10 @@ def minify(script: Code, userobjects, usages):
|
||||
logging.info("Introducing variables for reused literals" if auto_replace else
|
||||
"Checking for reused literals")
|
||||
for string in str_reuse:
|
||||
if string == '"BYTE[]"':
|
||||
# the type specifier for byte arrays is special because it has to be a literal
|
||||
# if it's a variable then it tries to treat it as a string array then shits the bed if the other items are not strings
|
||||
continue
|
||||
tmpcode = ""
|
||||
candidates = short_idents
|
||||
minName = ""
|
||||
@@ -341,13 +344,13 @@ def minify(script: Code, userobjects, usages):
|
||||
mcode = tmpcode + mcode[bound + diff + len(minName):]
|
||||
aliases.append(f"{minName}={uint} ")
|
||||
else:
|
||||
logging.warning(f"Not introducing variable for string {uint} reused {uses} times "
|
||||
logging.warning(f"Not introducing variable for integer {uint} reused {uses} times "
|
||||
f"(would save {savings} bytes)")
|
||||
else:
|
||||
logging.info(f"Not introducing variable for string {uint} reused {uses} times "
|
||||
logging.info(f"Not introducing variable for integer {uint} reused {uses} times "
|
||||
f"(would save {savings} bytes)")
|
||||
else:
|
||||
logging.info(f"Not introducing variable for int {uint} (only used once)")
|
||||
logging.info(f"Not introducing variable for integer {uint} (only used once)")
|
||||
|
||||
logging.info("Reintroducing REQUIREs")
|
||||
mcode = "".join([x[2] for x in script.comments]) + "".join(aliases) + mcode
|
||||
|
||||
Reference in New Issue
Block a user