Jump to content

[Obj-C] Does this look like it makes any sense


Go to solution Solved by Guest,

4 posts in this topic

Recommended Posts

Posted (edited)

Haven't tested this, I'm not sure if I'm fully understanding the code I wrote but I tried explaining what I do know!

Please feedback helps me a lot!

Thanks!

 

//Text Color Per Username (NOT TESTED)


//'Reaching' = Hooking, kind of, we are pulling functions from other classes
//so we can achieve what we are trying to do (to my understanding)

//'Reaching' into the other classes so they work with HybridSmileyLabel
//even though they aren't in the class 'HybridSmileyLabel'
@interface HybridSmileyLabel : NSObject

//From the class XMPPJID
- (XMPPJID *)userJid;

//From the class KikUser
- (KikUser *)username;
- (KikUser *)user;

//Closing the interface with an @end (to my understanding it is like the %end, but I may be wrong)
@end


//Hooking into the class that deals with the message color
%hook HybridSmileyLabel

//This is the function that deals with the specific text color
//We put UIColor * as the id because we are dealing with color
//The word after UIColor * can be anything, in this case I put color, but it could be arg1, eric, niro, etc
-(void)setTextColor:(UIColor *)color {
	
	//'Reaching' into the KikUser Class and is searching if the username is nooneloves me (niro)
	if([self.user.username isEqualToString:@"noonelovesme"])
		
		//If it is equal it sets the color to a nice blue
		color = [UIColor colorWithRed:0.43 green:0.62 blue:0.92 alpha:1.0];
	
	//Instead of 'reaching' into KikUser, it is 'Reaching' into XMPPJID to see if the jid is equal to yours (EricLegend)
	if([self.userJid.user isEqualToString:@"[email protected]"])
		
		//If it is equal it sets the color to a dark red
		color =	[UIColor colorWithRed:0.60 green:0.00 blue:0.00 alpha:1.0];
	
	//Returns all other possibilities to the original color
	return %orig;
}

//Closing the hook and all the modifications
%end
Updated by niro
  • Solution
Posted

Haven't tested this, I'm not sure if I'm fully understanding the code I wrote but I tried explaining what I do know!

Please feedback helps me a lot!

Thanks!

//Text Color Per Username (NOT TESTED)


//'Reaching' = Hooking, kind of, we are pulling functions from other classes
//so we can achieve what we are trying to do (to my understanding)

//'Reaching' into the other classes so they work with HybridSmileyLabel
//even though they aren't in the class 'HybridSmileyLabel'
@interface HybridSmileyLabel : NSObject

//From the class XMPPJID
- (XMPPJID *)userJid;

//From the class KikUser
- (KikUser *)username;
- (KikUser *)user;

//Closing the interface with an @end (to my understanding it is like the %end, but I may be wrong)
@end


//Hooking into the class that deals with the message color
%hook HybridSmileyLabel

//This is the function that deals with the specific text color
//We put UIColor * as the id because we are dealing with color
//The word after UIColor * can be anything, in this case I put color, but it could be arg1, eric, niro, etc
-(void)setTextColor:(UIColor *)color {
	
	//'Reaching' into the KikUser Class and is searching if the username is nooneloves me (niro)
	if([self.user.username isEqualToString:@"noonelovesme"])
		
		//If it is equal it sets the color to a nice blue
		color = [UIColor colorWithRed:0.43 green:0.62 blue:0.92 alpha:1.0];
	
	//Instead of 'reaching' into KikUser, it is 'Reaching' into XMPPJID to see if the jid is equal to yours (EricLegend)
	if([self.userJid.user isEqualToString:@"[email protected]"])
		
		//If it is equal it sets the color to a dark red
		color =	[UIColor colorWithRed:0.60 green:0.00 blue:0.00 alpha:1.0];
	
	//Returns all other possibilities to the original color
	return %orig;
}

//Closing the hook and all the modifications
%end

Use MSHookIvar to hook the JID or the username from another class, and then put that into a global variable so all methods can use it. Then in the setTextColor, check for that username and then set the color accordingly

 

That's what I would do

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Our picks

    • Heroes vs. Hordes v5.0.1 +6 Jailed Cheats [God Mode]
      Modded/Hacked App: Heroes vs. Hordes By Swift Games UG haftungsbeschraenkt
      Bundle ID: com.swiftgames.roguelikesurvival
      iTunes Store Link: https://apps.apple.com/us/app/heroes-vs-hordes/id1608898173?uo=4


      Hack Features:
      - Free iAP
      - Infinite Currency/Resources
      - Instant Kill


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/

        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 341 replies
    • Heroes vs. Hordes v5.0.1 +6 [God Mode]
      Modded/Hacked App: Heroes vs. Hordes By Swift Games UG haftungsbeschraenkt
      Bundle ID: com.swiftgames.roguelikesurvival
      iTunes Store Link: https://apps.apple.com/us/app/heroes-vs-hordes/id1608898173?uo=4


      Hack Features:
      - Free iAP
      - God Mode
      - Infinite Currency/Resources
      - Instant Kill
      - Kill All Enemies
      - Fast Enemies
      - Freeze Enemies
      - Poison Enemies


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 305 replies
    • Brick Out - Shoot the ball v25.0619.00 +5 Jailed Cheats [Currency Hack]
      Modded/Hacked App: Brick Out - Shoot the ball By Puzzle1Studio,inc.
      Bundle ID: com.puzzle1studio.ap.brickoutshoottheball
      iTunes Store Link: https://apps.apple.com/us/app/brick-out-shoot-the-ball/id1489900957?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - No Ads
      - Free Revives


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 110 replies
    • Brick Out - Shoot the ball v25.0619.00 +5 [Currency Hack]
      Modded/Hacked App: Brick Out - Shoot the ball By Puzzle1Studio,inc.
      Bundle ID: com.puzzle1studio.ap.brickoutshoottheball
      iTunes Store Link: https://apps.apple.com/us/app/brick-out-shoot-the-ball/id1489900957?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - No Ads
      - Add 10000 Rubies
      - Free Revives


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 113 replies
    • Tap Away 3D v159.5.4 +12 Jailed Cheats [Infinite Moves]
      Modded/Hacked App: Tap Away 3D By Popcore GmbH
      Bundle ID: com.jctswbglsm.SwipeAway
      iTunes Store Link: https://apps.apple.com/us/app/tap-away-3d/id1568058543?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - No Ads
      - Infinite Moves
      - Freeze Challenge Moves
      - Disable Timer for Challenge


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/

        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 59 replies
    • Tap Away 3D v159.5.4 +12 [Infinite Moves]
      Modded/Hacked App: Tap Away 3D By Popcore GmbH
      Bundle ID: com.jctswbglsm.SwipeAway
      iTunes Store Link: https://apps.apple.com/us/app/tap-away-3d/id1568058543?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - No Ads
      - Add Coins
      - Add Tokens
      - Make Me VIP
      - Spawn Bomb
      - Spawn Coin Block
      - Spawn Bomb
      - Spawn Coin Block
      - Spawn Special Blocks
      - Unlock All Puzzles
      - Unlock All Skins
      - Unlock All Challenges
      - Infinite Moves
      - Freeze Challenge Moves
      - Disable Timer for Challenge


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/

        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 55 replies
    • Tetris v7.3.0 +3 [Freeze Falldown]
      Modded/Hacked App: Tetris® By Playstudios, Inc.
      Bundle ID: com.n3twork.tetris
      iTunes Store Link: https://apps.apple.com/us/app/tetris/id1491074310?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - No Ads
      - Freeze Falldown


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 52 replies
    • Pocket Land! v0.113.2 +3 Jailed Cheats [Currency Hack]
      Modded/Hacked App: Pocket Land! By GRAND-ATTIC LIMITED
      Bundle ID: gs.hadi.pocketisland
      iTunes Store Link: https://apps.apple.com/us/app/pocket-land/id6446137216?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Freeze Currency
      - Freeze Resources


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 75 replies
    • Pocket Land! v0.113.2 +3 [Currency Hack]
      Modded/Hacked App: Pocket Land! By GRAND-ATTIC LIMITED
      Bundle ID: gs.hadi.pocketisland
      iTunes Store Link: https://apps.apple.com/us/app/pocket-land/id6446137216?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Freeze Currency
      - Freeze Resources
      - Upgrade without Resources (Dont Abuse)


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 42 replies
    • Brave Merge - Battle & Defense v1.6.7 [Currency Hack/Debug Menu +50 Options]
      Modded/Hacked App: Brave Merge - Battle & Defense By SayGames LTD
      Bundle ID: com.brave.merge
      iTunes Store Link: https://apps.apple.com/us/app/brave-merge-battle-defense/id6444832814?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - Debug Menu (Open settings then click support button to open the Debug Menu)


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 59 replies
    • Brave Merge - Battle & Defense v1.6.7 [Currency Hack/Debug Menu +50 Options]
      Modded/Hacked App: Brave Merge - Battle & Defense By SayGames LTD
      Bundle ID: com.brave.merge
      iTunes Store Link: https://apps.apple.com/us/app/brave-merge-battle-defense/id6444832814?uo=4


      Mod Requirements:
      - Jailbroken iPhone/iPad/iPod Touch.
      - iGameGod / Filza / iMazing or any other file managers for iOS.
      - Cydia Substrate, Substitute or libhooker depending on your jailbreak.
      - PreferenceLoader (from Cydia, Sileo or Zebra).


      Hack Features:
      - Debug Menu


      Non-Jailbroken & No Jailbreak required hack(s): https://iosgods.com/forum/79-no-jailbreak-section/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 87 replies
    • Tetris v7.3.0 +3 Jailed Cheats [Freeze Falldown]
      Modded/Hacked App: Tetris® By Playstudios, Inc.
      Bundle ID: com.n3twork.tetris
      iTunes Store Link: https://apps.apple.com/us/app/tetris/id1491074310?uo=4


      Mod Requirements:
      - Non-Jailbroken/Jailed or Jailbroken iPhone/iPad/iPod Touch.
      - Sideloadly / Cydia Impactor or alternatives.
      - A Computer Running Windows/macOS/Linux with iTunes installed.


      Hack Features:
      - No Ads
      - Freeze Falldown


      Jailbreak required hack(s): https://iosgods.com/forum/5-game-cheats-hack-requests/
      Modded Android APK(s): https://iosgods.com/forum/68-android-section/
      For more fun, check out the Club(s): https://iosgods.com/clubs/


        • Informative
        • Agree
        • Haha
        • Thanks
        • Winner
        • Like
      • 63 replies
×
  • Create New...

Important Information

We would like to place cookies on your device to help make this website better. The website cannot give you the best user experience without cookies. You can accept or decline our cookies. You may also adjust your cookie settings. Privacy Policy - Guidelines