0

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)

Coler234
  • 67
  • 1
  • 3
  • 11
  • 1
    You password hook looks ok, it should work. Problem might be that your dylib doesn't get loaded into the SpringBoard. Check the console when you kill the SpringBoard. CydiaSubstrate will log all the dylib being loaded into the process. Check that bundle ID is right. They're case sensitive and on some iOS instead of `com.apple.springboard` you need to use `com.apple.SpringBoard` – creker Jul 07 '16 at 23:43
  • What console? Sorry if this is stupid, I'm new. I'm running this on my iPhone 6s running iOS 9.1. – Coler234 Jul 07 '16 at 23:46
  • If you have Xcode go to `Devices` window, select your device and there should be the console. Or you can build this https://github.com/rpetrich/deviceconsole I suggest the latter as it's easier to use and will help you a lot when building iOS tweaks and jailbreak applications. – creker Jul 07 '16 at 23:54
  • Jul 7 20:15:54 iPhone SpringBoard[2641] : MS:Notice: Loading: /Library/MobileSubstrate/DynamicLibraries/FirstTweak.dylib – Coler234 Jul 08 '16 at 00:18
  • So I guess it is loading... Do you think the exporting issue is why its not working? – Coler234 Jul 08 '16 at 00:18

0 Answers0