Unlocker Expiring Date
-
@ustk hard to guess what's wrong, I think you need to step through the debugger then to find out where it fails in the unlocked class. Just hit a breakpoint in the scripting functions and then crawl your way through it.
-
@Christoph-Hart Investigating...
-
This post is deleted! -
@Christoph-Hart Ok I got it to work!
Although it appears that just using"0x"
as argument string unlocks the product... In fact any string starting with"0x"
as per thecheckExpirationData
methodif
statement will unlock successfully, returning either a delta of 19369 or 49369 days! Quite a generous demo indeed :)But with the intended encrypted timestamp the method returns the expected number of days (30 in my case)
-
@Christoph-Hart I see that the substring of the
encodedTimeString
in Hise is:bi.parseString(encodedTimeString.substring(2), 16);
It goes up to the 16th char but shouldn't it be
encodedTimeString.length()
?Mine has a bit more chars:
0x0bf63c9d8c7c71c0f0b9b8fb4b12e460c4ab3457844f9da5decc7740f6479b2b505591e35ac8d8655cc19f5fff751d5702aef9b750b1c63f161fac9d0eb2030c
This is what/ how I encode:
$TIME = dechex(round(microtime(true) / 1000)); $data['encryptedTime'] = "0x" . applyToValue($TIME, $private_keys['private_key_part1'], $private_keys['private_key_part2']);
-
@ustk I think the
16
argument of the juce::BigInteger::parseString() method isn't the length but the base (so it tells it to parse it as hex number). -
@Christoph-Hart Oh you're right I just checked (and I obviously didn't read the code carefully as it's not part of the substring method...)
Wondering even more where my mistake is then -
Alright, this is making me crazy, so I take a deep breath and try to simplify manually...
$TIME = dechex(1673481600000); /* Today in ms */ $EXPIRY = dechex(1676160000000); /* Expiry in ms ($TIME + 30 days) */ /* For the encodedTimeString */ $data['encodedTimeString'] = "0x" . applyToValue($TIME, $private_keys['private_key_part1'], $private_keys['private_key_part2']); /* For the XML containing the $EXPIRY (among the other things) */ $root->setAttribute("expiryTime", $EXPIRY); $root->setAttribute("expiring_mach", $MACHINE); $ENCRYPTED_XML = "#" . applyToValue($XML_STRING, $private_keys['private_key_part1'], $private_keys['private_key_part2']);
Result from
unlocker.checkExpirationData(encodedTimeString)
=> Unlocked with19400 days remainingI'm just lost...
-
This post is deleted! -
This post is deleted!