Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple issues (return values) #8

Open
Randy-420 opened this issue May 3, 2022 · 1 comment
Open

Multiple issues (return values) #8

Randy-420 opened this issue May 3, 2022 · 1 comment

Comments

@Randy-420
Copy link

The method (¿sometimes?) doesn't return anything if return value not overriden (it should return %orig;)
Also, when setting an id to an int, you need to use

origValue = [NSString stringWithFormat:@"[NSNumber numberWithInteger:%@]", origValue];

Here's the code that gets generated for the different id options

#import <UIKit/UIKit.h>

%hook HGYLaunchScreenController
-  (long long)numberOfSectionsInCollectionView:(id)arg1 {
arg1 = @"B";
return %orig;
}
%end

%hook HGYLaunchScreenController
-  (long long)collectionView:(id)arg1 numberOfItemsInSection:(long long)arg2 {
arg1 = 6;
return %orig;
}
%end

%hook HGYLaunchScreenController
-  (id)collectionView:(id)arg1 cellForItemAtIndexPath:(id)arg2 {
arg2 = @"FLDate:2022-05-03T12:27:09-0400";
arg1 = [UIColor colorWithRed:255/255.0 green:127/255.0 blue:0/255.0 alpha:255/255.0];
}
%end

%hook HGYLaunchScreenController
-  (void)collectionView:(id)arg1 willDisplayCell:(id)arg2 forItemAtIndexPath:(id)arg3 {
arg1 = 6;
return %orig;
}
%end

@Randy-420
Copy link
Author

Randy-420 commented May 3, 2022

It should return something like this

#import <UIKit/UIKit.h>

%hook HGYLaunchScreenController

  • (long long)numberOfSectionsInCollectionView:(id)arg1 {
    arg1 = @"B";
    return %orig;
    }

  • (long long)collectionView:(id)arg1 numberOfItemsInSection:(long long)arg2 {
    arg1 = [NSNumber numberWithInteger:6];
    return %orig;
    }

  • (id)collectionView:(id)arg1 cellForItemAtIndexPath:(id)arg2 {
    arg2 = @"FLDate:2022-05-03T12:27:09-0400";
    arg1 = [UIColor colorWithRed:255/255.0 green:127/255.0 blue:0/255.0 alpha:255/255.0];
    return %orig;
    }

  • (void)collectionView:(id)arg1 willDisplayCell:(id)arg2 forItemAtIndexPath:(id)arg3 {
    arg1 = [NSNumber numberWithInteger:6];
    %orig;
    }
    %end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant