Skip to content

Instantly share code, notes, and snippets.

@uchks
Last active July 2, 2025 06:56
Show Gist options
  • Save uchks/8decdca7d318ee193dbd820de6db74b7 to your computer and use it in GitHub Desktop.
Save uchks/8decdca7d318ee193dbd820de6db74b7 to your computer and use it in GitHub Desktop.
Sometimes, you just want your battery to stop charging - without paying for it.

AlDente LicenseHook 🍝

Patch the AlDente macOS app to always think you're licensed.
This dynamic library hooks into AlDente's license checks and makes it believe you're Pro.
Because sometimes, you just want your battery to stop charging - without paying for it.

How It Works

Hooks into PADProduct methods like:

  • activated
  • licenseCode
  • licenseExpiryDate
  • verifyActivationWithCompletion
  • verifyActivationDetailsWithCompletion

And forces them to return responses with fake license info.

Example Usage

DYLD_INSERT_LIBRARIES="/Users/uchks/Desktop/libAlDente LicenseHook.dylib" /Applications/AlDente.app/Contents/MacOS/AlDente

Boilerplate Disclaimer

This is for educational purposes only. I am not responsible for how you use or abuse this code.
Respect developers, especially if you find their tools useful.

DWTFYW License
Do What The Fuck You Want. No warranties, no liabilities, no asking for support.

//
// AlDente_LicenseHook.m
// AlDente License Verification Hook
//
// Created by piracybound.
// Β© 2025 piracybound. Licensed under the DWTFYW License.
//
// This file is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// In short: Do What The F*** You Want.
//
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
#import <dispatch/dispatch.h>
BOOL hooked_activated(id self, SEL _cmd) {
NSLog(@"[piracybound: AlDente LicenseHook] βœ… [CALLED] -(BOOL)activated. Returning YES.");
return YES;
}
NSString* hooked_licenseCode(id self, SEL _cmd) {
NSLog(@"[piracybound: AlDente LicenseHook] βœ… [CALLED] -(NSString *)licenseCode. Returning fake key.");
return @"piracybound-type-shit";
}
NSDate* hooked_licenseExpiryDate(id self, SEL _d) {
NSLog(@"[piracybound: AlDente LicenseHook] βœ… [CALLED] -(NSDate *)licenseExpiryDate. Returning future date.");
return [NSDate distantFuture];
}
void hooked_verifyActivationWithCompletion(id self, SEL _cmd, void (^completion)(BOOL)) {
NSLog(@"[piracybound: AlDente LicenseHook] βœ… [CALLED] -(void)verifyActivationWithCompletion:. Forcing success.");
if (completion) {
dispatch_async(dispatch_get_main_queue(), ^{
completion(YES);
});
}
}
void hooked_verifyActivationDetailsWithCompletion(id self, SEL _cmd, void (^completion)(NSDictionary *, NSError *)) {
NSLog(@"[piracybound: AlDente LicenseHook] βœ… [CALLED] -(void)verifyActivationDetailsWithCompletion:. Forcing success with fake details.");
if (completion) {
NSDictionary *fakeDetails = @{
@"activated": @(YES),
@"activation_id": @"piracybound-type-shit",
@"email": @"[email protected]",
@"license_code": @"piracybound-type-shit",
@"plan": @"AlDente Pro",
@"expires": @(NO)
};
dispatch_async(dispatch_get_main_queue(), ^{
completion(fakeDetails, nil);
});
}
}
@implementation NSObject (AlDenteHook)
+ (void)load {
if ([[[NSProcessInfo processInfo] processName] isEqualToString:@"AlDente"]) {
NSLog(@"[piracybound: AlDente LicenseHook] +load method invoked in AlDente process. Installing hooks...");
Class padProductClass = NSClassFromString(@"PADProduct");
if (!padProductClass) {
NSLog(@"[piracybound: AlDente LicenseHook] ❌ ERROR: Could not find PADProduct class in +load. Aborting hook installation.");
return;
}
struct { SEL selector; IMP replacement; } hooks[] = {
{ @selector(activated), (IMP)hooked_activated },
{ @selector(licenseCode), (IMP)hooked_licenseCode },
{ @selector(licenseExpiryDate), (IMP)hooked_licenseExpiryDate },
{ @selector(verifyActivationWithCompletion:), (IMP)hooked_verifyActivationWithCompletion },
{ @selector(verifyActivationDetailsWithCompletion:), (IMP)hooked_verifyActivationDetailsWithCompletion }
};
for (int i = 0; i < sizeof(hooks)/sizeof(hooks[0]); i++) {
Method method = class_getInstanceMethod(padProductClass, hooks[i].selector);
if (method) {
method_setImplementation(method, hooks[i].replacement);
NSLog(@"[piracybound: AlDente LicenseHook] πŸ‘ Successfully hooked: %@", NSStringFromSelector(hooks[i].selector));
} else {
NSLog(@"[piracybound: AlDente LicenseHook] ⚠️ WARNING: Could not find method to hook: %@", NSStringFromSelector(hooks[i].selector));
}
}
NSLog(@"[piracybound: AlDente LicenseHook] Hook installation from +load is complete. Monitoring for calls...");
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment