Hey.
I have a problem when compile the my tweak.
I think it cause calling getPrefBool But I don't know what should I do:/
I tried to add ARCHS = armv7 arm64 to Makefile But still get error
Please help me ..
Error
mafu:~/mcohack root# make package install
> Making all for tweak mcohack…
==> Preprocessing Tweak.x…
==> Preprocessing Tweak.x…
==> Compiling Tweak.x (arm64)…
==> Compiling Tweak.x (armv7)…
==> Linking tweak mcohack (armv7)…
Undefined symbols for architecture armv7:
"_GetPrefBool", referenced from:
__logos_method$_ungrouped$AppController$applicationDidBecomeActive$ in Tweak.x.ad486fbc.o
ld: symbol(s) not found for architecture armv7
Not signing file
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/var/root/theos/makefiles/instance/library.mk:33: /var/root/mcohack/.theos/obj/debug/armv7/mcohack.dylib] Error 1
==> Linking tweak mcohack (arm64)…
Undefined symbols for architecture arm64:
"_GetPrefBool", referenced from:
__logos_method$_ungrouped$AppController$applicationDidBecomeActive$ in Tweak.x.86cf346b.o
ld: symbol(s) not found for architecture arm64
Not signing file
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [/var/root/theos/makefiles/instance/library.mk:33: /var/root/mcohack/.theos/obj/debug/arm64/mcohack.dylib] Error 1
make[2]: *** [/var/root/theos/makefiles/instance/library.mk:33: /var/root/mcohack/.theos/obj/debug/arm64/mcohack.dylib] Error 2
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [/var/root/theos/makefiles/instance/library.mk:33: /var/root/mcohack/.theos/obj/debug/armv7/mcohack.dylib] Error 2
make[1]: *** [/var/root/theos/makefiles/instance/library.mk:24: internal-library-all_] Error 2
make: *** [/var/root/theos/makefiles/master/rules.mk:111: mcohack.all.tweak.variables] Error 2
Tweak.x
#define PLIST_PATH @"/var/mobile/Library/Preferences/com.zorba.prefbundle.plist"
inline bool GetPrefBool(NSString *key)
{
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}
%hook AppController
-(void)applicationDidBecomeActive:(id)argument {
if(GetPrefBool(@"DetectOpened")) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Detected App opened!" delegate:nil cancelButtonTitle:@"Continue" otherButtonTitles:nil];
[alert show];
} else {
return %orig;
}
}
%end
prefbundle's plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Settings</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true/>
<key>defaults</key>
<string>com.zorba.prefbundle</string>
<key>key</key>
<string>DetectOpened</string>
<key>label</key>
<string>DetectOpened</string>
</dict>
<dict>
<key>cell</key>
<string>PSGroupCell</string>
<key>label</key>
<string>Contact</string>
</dict>
<dict>
<key>cell</key>
<string>PSButtonCell</string>
<key>label</key>
<string>Twitter</string>
<key>action</key>
<string>OpenTwitter</string>
</dict>
</array>
<key>title</key>
<string>mcohack</string>
</dict>
</plist>
Theos Version: Latest Version got from https://github.com/theos/theos
Device Info : iPhone8 / IOS13.3.1 / jailbroken