mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[AltServer] Fixes incorrectly parsing thread state as decimal value when enabling JIT
Thread state is hexadecimal, so we now explicitly use NSScanner to parse string as base-16.
This commit is contained in:
@@ -258,8 +258,13 @@ char *bin2hex(const unsigned char *bin, size_t length)
|
||||
NSString *mainThread = components[1];
|
||||
NSString *threadState = [[mainThread componentsSeparatedByString:@":"] lastObject];
|
||||
|
||||
NSScanner *scanner = [NSScanner scannerWithString:threadState];
|
||||
|
||||
unsigned long long mainThreadState = 0;
|
||||
[scanner scanHexLongLong:&mainThreadState];
|
||||
|
||||
// If main thread state == 0, app is not running.
|
||||
if ([threadState longLongValue] == 0)
|
||||
if (mainThreadState == 0)
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user