Skip to content

Commit

Permalink
1.4.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ttwj committed Feb 2, 2014
1 parent 2dd4821 commit 703f868
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Classes/Binary.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#define local_cputype [Device cpu_type]

#define iOS5 1

@interface Binary ()
{
NSString *oldbinaryPath;
Expand Down
7 changes: 4 additions & 3 deletions Classes/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@

#define CLUTCH_TITLE "Clutch"
#define CLUTCH_VERSION "1.4"
#define CLUTCH_RELEASE "git-9"
#define CLUTCH_BUILD 14009
#define CLUTCH_DEV 1
#define CLUTCH_RELEASE "git-10"
#define CLUTCH_BUILD 14010
#define CLUTCH_DEV 0 //1


void sha1(uint8_t *hash, uint8_t *data, size_t size);
typedef int (*ptrace_ptr_t)(int _request, pid_t _pid, caddr_t _addr, int _data);
Expand Down
14 changes: 12 additions & 2 deletions Classes/Cracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,13 @@ static BOOL copyFile(NSString *infile, NSString *outfile)
// set up application cracking from an installed application
-(BOOL)prepareFromInstalledApp:(Application*)app
{
if (![[NSFileManager defaultManager] fileExistsAtPath:@"/etc/clutch/overdrive.dylib" isDirectory:nil]) {
if ([[Preferences sharedInstance] useOverdrive]) {
printf("\nerror: could not find overdrive.dylib at /etc/clutch/overdrive.dylib, disabling overdrive!\n\n");
[[Preferences sharedInstance] tempSetObject:@"NO" forKey:@"UseOverdrive"];
}
}

DEBUG(@"------Prepairing from Installed App------");
// Create the app description
_app = app;
Expand Down Expand Up @@ -461,7 +468,6 @@ void yopainstalld_peer_event_handler(Cracker* cracker, xpc_connection_t peer, xp

}


-(void)packageYOPA
{

Expand Down Expand Up @@ -571,7 +577,7 @@ -(void)packageIPA

DEBUG(@"old metadata %@ %@", [_app.applicationContainer stringByAppendingPathComponent:@"iTunesMetadata.plist"], [[[_workingDir stringByDeletingLastPathComponent]stringByDeletingLastPathComponent] stringByAppendingPathComponent:@"iTunesMetadata.plist"])

if ([[Preferences sharedInstance] removeMetadata])
if (([[Preferences sharedInstance] removeMetadata]) || ([[[Preferences sharedInstance] metadataEmail] length] > 0))
{
MSG(PACKAGING_ITUNESMETADATA);
DEBUG(@"Generating fake iTunesMetadata");
Expand Down Expand Up @@ -652,6 +658,8 @@ -(void)yopaEnabled:(BOOL)flag {

void generateMetadata(NSString *origPath,NSString *output)
{
DEBUG(@"generate metdata %@, %@", origPath, output);

struct stat statbuf_metadata;
stat(origPath.UTF8String, &statbuf_metadata);
time_t mst_atime = statbuf_metadata.st_atime;
Expand Down Expand Up @@ -730,6 +738,8 @@ void generateMetadata(NSString *origPath,NSString *output)

[metadataPlist removeObjectForKey:@"com.apple.iTunesStore.downloadInfo"];

DEBUG(@"metadataplist %@", metadataPlist);

[metadataPlist writeToFile:output atomically:NO];

utime(output.UTF8String, &oldtimes_metadata);
Expand Down
1 change: 1 addition & 0 deletions Classes/Preferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
+ (void)setConfigPath:(NSString*)path;

- (void)setBool:(BOOL)value forKey:(NSString *)defaultName;
- (void)tempSetObject:(id)value forKey:(NSString *)defaultName;
- (void)setObject:(id)value forKey:(NSString *)defaultName;
- (BOOL)boolForKey:(NSString *)defaultName;
- (id)objectForKey:(NSString *)defaultName;
Expand Down
9 changes: 8 additions & 1 deletion Classes/Preferences.m
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ - (void)setBool:(BOOL)value forKey:(NSString *)defaultName
[_dict writeToFile:prefsPath atomically:YES];
}

- (void)setObject:(id)value forKey:(NSString *)defaultName
- (void)tempSetObject:(id)value forKey:(NSString *)defaultName
{
if (_dict == nil)
{
Expand All @@ -67,11 +67,18 @@ - (void)setObject:(id)value forKey:(NSString *)defaultName
else
{
[_dict setObject:value forKey:defaultName];

}
DEBUG(@"da dict %@", _dict);

}

- (void)setObject:(id)value forKey:(NSString *)defaultName {
[self tempSetObject:value forKey:defaultName];
[_dict writeToFile:prefsPath atomically:YES];
}


- (BOOL)boolForKey:(NSString *)defaultName
{
return [[_dict objectForKey:defaultName]boolValue];
Expand Down
13 changes: 11 additions & 2 deletions Classes/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,12 @@ void print_results()

void cmd_version()
{
fprintf(stderr, "%s %s (%s)\n", CLUTCH_TITLE, CLUTCH_VERSION, CLUTCH_RELEASE);
if (CLUTCH_DEV == 1) {
fprintf(stderr, "%s %s (%s)\n", CLUTCH_TITLE, CLUTCH_VERSION, CLUTCH_RELEASE);
}
else {
fprintf(stderr, "%s %s\n", CLUTCH_TITLE, CLUTCH_VERSION);
}
fprintf(stderr, "---------------------------------\n");
}

Expand All @@ -177,7 +182,8 @@ void cmd_help()
printf("-f Clears cache\n");
printf("-v Shows version\n");
printf("-i <IPA> <Binary> <OutBinary> Installs IPA and cracks it\n");
printf("--yopa Creates a YOPA package\n");
//printf("--yopa Creates a YOPA package\n");
//printf("-d Shows debug messages\n");
printf("\n");
}

Expand Down Expand Up @@ -388,6 +394,9 @@ int main(int argc, char *argv[])
goto endMain;

}
//else if ([arg isEqualToString:@"-d"] || [arg isEqualToString:@"-debug"]) {

//}
else if ([arg isEqualToString:@"-a"] || [arg isEqualToString:@"-all"])
{
applist = [[ApplicationLister sharedInstance] installedApps];
Expand Down
2 changes: 1 addition & 1 deletion Classes/out.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

#define NSPrint(M, ...) fprintf(stderr, "%s \n", [[NSString stringWithFormat:M, ##__VA_ARGS__] UTF8String]);

#define CLUTCH_DEBUG 1
//#define CLUTCH_DEBUG 1

#ifdef CLUTCH_DEBUG
# define FILE_NAME (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__) // shortened path of __FILE__ is there is one
Expand Down
2 changes: 1 addition & 1 deletion Clutch.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
E9ABBFB8188D4154000B442F /* sha1 */,
E9ABBFB7188D3F29000B442F /* ZipArchive */,
AD30146718714C3D00E06315 /* CLI */,
BC871C7817E7122500048636 /* main.m */,
ADAA367C1870606D0029AF7D /* Preferences.h */,
ADAA367D1870606D0029AF7D /* Preferences.m */,
ADC8A6E81880FAA30063B6BD /* Localization.h */,
Expand Down Expand Up @@ -224,7 +225,6 @@
AD30146718714C3D00E06315 /* CLI */ = {
isa = PBXGroup;
children = (
BC871C7817E7122500048636 /* main.m */,
);
name = CLI;
sourceTree = "<group>";
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion yopa-package

0 comments on commit 703f868

Please sign in to comment.