@crckd:
Ok thought of a good workaround to fix the patches :-)
In the batch file you created you can also search for this: SDK Version: xxx, then create a text file with the sdk version, that can then be read by the makeips file.
Example:
Firmware 11.0.1
SDK Version: 11.4.0.0
Version: 11.0.0-1280 (738198784)
Firmware 10.2
SDK Version: 10.4.0.0
Version: 10.1.0-256 (672137472)
Then in your makeips file, use 2 sets of patches - 1 set for firmware with SDK version 10 or less use patch set 1, if the SDK version is greater than 10 - use patch set 2. That way if the patches change again on higher sdk, that patch set could also be added to the script easily. That would be an easy way to solve our problem.
This was added to the end of the python file to check sdk version & create a txt file containing that info:
Code:
outlines = subprocess.check_output(['hactool','--keyset=' + keyset,'--disablekeywarns', FIRMWARE_DIR + '/' + ES_NCA])
for line in outlines.splitlines():
line = line.decode('ascii').replace(" ","")
if line.startswith("SDKVersion:"):
f = open("sdk.txt", "w")
f.write((line).replace("SDKVersion:", "").replace(".", ""))
f.close()
#read back file to make sure our file got created properly...
f = open("sdk.txt", "r")
data = f.read()
f.close()
print("SDK:" + data)
break
Output:
Next - read data in makeips file and check if greater than: xxx - example:
Code:
f = open("sdk.txt", "r")
data = f.read()
f.close()
value = int(data)
if value < 11400:
patterns = patterns2
else:
patterns = patterns1