├── .DS_Store ├── AppTapp_Prefix.pch ├── Background.png ├── Categories.png ├── Category.png ├── CategorySmart.png ├── Classes ├── .DS_Store ├── ATCategoriesCell.h ├── ATCategoriesCell.m ├── ATCategoriesTableViewController.h ├── ATCategoriesTableViewController.m ├── ATDatabase.h ├── ATDatabase.m ├── ATEntity.h ├── ATEntity.m ├── ATError.h ├── ATFeaturedViewController.h ├── ATFeaturedViewController.m ├── ATIconView.h ├── ATIconView.m ├── ATIncompleteDownload.h ├── ATIncompleteDownload.m ├── ATIncompleteDownloads.h ├── ATIncompleteDownloads.m ├── ATInstaller.h ├── ATInstaller.m ├── ATPackage.h ├── ATPackage.m ├── ATPackageCell.h ├── ATPackageCell.m ├── ATPackageDetailsTableViewController.h ├── ATPackageDetailsTableViewController.m ├── ATPackageIconFetch.h ├── ATPackageIconFetch.m ├── ATPackageInfoController.h ├── ATPackageInfoController.m ├── ATPackageInfoFetch.h ├── ATPackageInfoFetch.m ├── ATPackageInstallTask.h ├── ATPackageInstallTask.m ├── ATPackageManager.h ├── ATPackageManager.m ├── ATPackageMoreInfoView.h ├── ATPackageMoreInfoView.m ├── ATPackageUSBInstallTask.h ├── ATPackageUSBInstallTask.m ├── ATPackageUSBUninstallTask.h ├── ATPackageUSBUninstallTask.m ├── ATPackageUninstallTask.h ├── ATPackageUninstallTask.m ├── ATPackages.h ├── ATPackages.m ├── ATPackagesTableViewController.h ├── ATPackagesTableViewController.m ├── ATPipeline.h ├── ATPipeline.m ├── ATPipelineManager.h ├── ATPipelineManager.m ├── ATPlatform.h ├── ATPlatform.m ├── ATQueueFutureInstall.h ├── ATQueueFutureInstall.m ├── ATResultSet.h ├── ATResultSet.m ├── ATScript.h ├── ATScript.m ├── ATSearch.h ├── ATSearch.m ├── ATSearchTableViewController.h ├── ATSearchTableViewController.m ├── ATSearchTask.h ├── ATSearchTask.m ├── ATSource.h ├── ATSource.m ├── ATSourceInfoController.h ├── ATSourceInfoController.m ├── ATSourceRefresh.h ├── ATSourceRefresh.m ├── ATSourceTableViewCell.h ├── ATSourceTableViewCell.m ├── ATSources.h ├── ATSources.m ├── ATSourcesTableViewController.h ├── ATSourcesTableViewController.m ├── ATTableViewController.h ├── ATTableViewController.m ├── ATTask.h ├── ATTaskTableViewCell.h ├── ATTaskTableViewCell.m ├── ATTasksTableViewController.h ├── ATTasksTableViewController.m ├── ATTrustedSourcesRefresh.h ├── ATTrustedSourcesRefresh.m ├── ATURLDownload.h ├── ATURLDownload.m ├── ATUnpacker.h ├── ATUnpacker.m ├── ATViewController.h ├── ATViewController.m ├── NSDate+AppTappExtensions.h ├── NSDate+AppTappExtensions.m ├── NSFileManager+AppTappExtensions.h ├── NSFileManager+AppTappExtensions.m ├── NSNumber+AppTappExtensions.h ├── NSNumber+AppTappExtensions.m ├── NSString+AppTappExtensions.h ├── NSString+AppTappExtensions.m ├── NSURL+AppTappExtensions.h ├── NSURL+AppTappExtensions.m ├── NSURLRequest+AppTappExtensions.h ├── NSURLRequest+AppTappExtensions.m ├── Reachability.h ├── Reachability.m ├── Scythe.c ├── crypt.h ├── ioapi.c ├── ioapi.h ├── kali-key.h ├── md5.c ├── md5.h ├── md5global.h ├── unzip.c └── unzip.h ├── Default.png ├── English.lproj ├── CategoryMapping.strings ├── Errors.strings ├── Localizable.strings └── MainWindow.xib ├── GUIImages ├── ATCAT_Installed.png ├── ATCAT_Other.png ├── ATCAT_Updated.png ├── ATCatBackground.png ├── ATIconBackShadow.png ├── ATInfoBackTop.png ├── ATMailIcon.png ├── ATNewIcon.png ├── ATPCBackShadow.png ├── ATPack_Package.png ├── ATRatingBackground.png ├── ATRatingMask.png ├── ATRatingMyStars.png ├── ATRatingPopup.png ├── ATRatingPopup1.png ├── ATRatingPopup2.png ├── ATRatingPopup3.png ├── ATRatingPopup4.png ├── ATRatingPopup5.png ├── ATRatingUserStars.png ├── ATSeparator.png ├── ATSource.png ├── ATSource_Trusted.png ├── ATStopIcon.png ├── ATTask_Download.png ├── ATTask_Refresh.png ├── ATTrustedIcon.png ├── ATWhiteBack1.png ├── ATWhiteBack2.png ├── ATWhiteBack3.png ├── IconClipingMask.png ├── IconMirror.png ├── SampleIcon.png ├── SourceMirror.png ├── SourceTrustedMirror.png └── about.html ├── German.lproj ├── CategoryMapping.strings ├── Errors.strings ├── Localizable.strings └── MainWindow.xib ├── Info.plist ├── Install-Info.plist ├── Installer.png ├── Installer.xcodeproj ├── project.pbxproj ├── zigzag.pbxuser └── zigzag.perspectivev3 ├── InstallerPrefs.plist ├── InstallerPrefs_Info.plist ├── Package.png ├── README.md ├── Repository ├── Info.plist ├── config.inc.default.php ├── index.php ├── instructions.php └── regenerate.php ├── Schema.plist ├── Sources.png ├── Tasks.png ├── UnexportedFrameworkSymbols.exp ├── el.lproj ├── CategoryMapping.strings ├── Errors.strings ├── Localizable.strings └── MainWindow.xib ├── icon.png ├── libcrypto_i386.a ├── libcurl.a ├── libcurl_i386.a ├── libssl.a ├── libssl_i386.a ├── lua-5.1.4 ├── COPYRIGHT ├── HISTORY ├── INSTALL ├── Makefile ├── README ├── doc │ ├── amazon.gif │ ├── contents.html │ ├── cover.png │ ├── logo.gif │ ├── lua.1 │ ├── lua.css │ ├── lua.html │ ├── luac.1 │ ├── luac.html │ ├── manual.css │ ├── manual.html │ └── readme.html ├── etc │ ├── Makefile │ ├── README │ ├── all.c │ ├── lua.hpp │ ├── lua.ico │ ├── lua.pc │ ├── luavs.bat │ ├── min.c │ ├── noparser.c │ └── strict.lua ├── make-installer-lua.sh ├── src │ ├── Makefile │ ├── lapi.c │ ├── lapi.h │ ├── lauxlib.c │ ├── lauxlib.h │ ├── lbaselib.c │ ├── lcode.c │ ├── lcode.h │ ├── ldblib.c │ ├── ldebug.c │ ├── ldebug.h │ ├── ldo.c │ ├── ldo.h │ ├── ldump.c │ ├── lfunc.c │ ├── lfunc.h │ ├── lgc.c │ ├── lgc.h │ ├── linit.c │ ├── liolib.c │ ├── llex.c │ ├── llex.h │ ├── llimits.h │ ├── lmathlib.c │ ├── lmem.c │ ├── lmem.h │ ├── loadlib.c │ ├── lobject.c │ ├── lobject.h │ ├── lopcodes.c │ ├── lopcodes.h │ ├── loslib.c │ ├── lparser.c │ ├── lparser.h │ ├── lstate.c │ ├── lstate.h │ ├── lstring.c │ ├── lstring.h │ ├── lstrlib.c │ ├── ltable.c │ ├── ltable.h │ ├── ltablib.c │ ├── ltm.c │ ├── ltm.h │ ├── lua.c │ ├── lua.h │ ├── luac.c │ ├── luaconf.h │ ├── lualib.h │ ├── lundump.c │ ├── lundump.h │ ├── lvm.c │ ├── lvm.h │ ├── lzio.c │ ├── lzio.h │ └── print.c └── test │ ├── README │ ├── bisect.lua │ ├── cf.lua │ ├── echo.lua │ ├── env.lua │ ├── factorial.lua │ ├── fib.lua │ ├── fibfor.lua │ ├── globals.lua │ ├── hello.lua │ ├── life.lua │ ├── luac.lua │ ├── printf.lua │ ├── readonly.lua │ ├── sieve.lua │ ├── sort.lua │ ├── table.lua │ ├── trace-calls.lua │ ├── trace-globals.lua │ └── xd.lua ├── main.m ├── ru.lproj ├── CategoryMapping.strings ├── Errors.strings ├── Localizable.strings └── MainWindow.xib └── uk.lproj ├── CategoryMapping.strings ├── Errors.strings ├── Localizable.strings └── MainWindow.xib /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/.DS_Store -------------------------------------------------------------------------------- /AppTapp_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Installer' target in the 'Installer' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #if !defined(__i386__) 8 | #import 9 | #import 10 | #endif 11 | #import "ATError.h" 12 | #endif 13 | 14 | #define InstallerPreferences [NSUserDefaults standardUserDefaults] 15 | #define __REFRESH_INTERVAL__ 60 * 60 16 | 17 | #if !defined(INSTALLER_APP) && !defined(__i386__) 18 | #define __PRIVATE_PATH__ [@"/var/mobile/Library/Application Support/Installer" stringByExpandingTildeInPath] 19 | #else 20 | #define __PRIVATE_PATH__ [@"~/Library/Application Support/Installer" stringByExpandingTildeInPath] 21 | #endif 22 | 23 | #define __DB_PATH__ [__PRIVATE_PATH__ stringByAppendingPathComponent:@"Installer.db"] 24 | #define __ICON_CACHE_PATH__ [__PRIVATE_PATH__ stringByAppendingPathComponent:@"IconCache"] 25 | #define __DOWNLOADS_PATH__ [__PRIVATE_PATH__ stringByAppendingPathComponent:@"Downloads"] 26 | 27 | #define __FEATURED_LOCATION__ @"http://featured.i.ripdev.com/" 28 | #define __TRUSTED_SOURCES_LOCATION__ @"http://featured.i.ripdev.com/assets/" 29 | 30 | #define __DEFAULT_SOURCE_NAME__ @"Ripdev" 31 | #define __DEFAULT_SOURCE_CATEGORY__ @"Community Sources" 32 | #define __DEFAULT_SOURCE_LOCATION__ @"http://i.ripdev.com/" 33 | #define __DEFAULT_SOURCE_MAINTAINER__ @"Ripdev" 34 | #define __DEFAULT_SOURCE_CONTACT__ @"support@ripdev.com" 35 | 36 | #define __INSTALLER_NAME__ @"Installer" 37 | #define __INSTALLER_VERSION__ [[NSBundle bundleForClass:[NSClassFromString(@"ATDatabase") class]] objectForInfoDictionaryKey:@"CFBundleVersion"] 38 | #define __USER_AGENT__ [NSString stringWithFormat:@"Install/%@ (%@/%@, like CFNetwork/220.0)", __INSTALLER_VERSION__, [ATPlatform platformName], [ATPlatform firmwareVersion]] 39 | #define __INSTALLER_BUNDLE_IDENTIFIER__ @"com.ripdev.install" 40 | #define __INSTALLER_CONTACT__ @"support@ripdev.com" 41 | #define __INSTALLER_CATEGORY__ @"System" 42 | #define __INSTALLER_DESCRIPTION__ @"THE Installer." 43 | 44 | #define __COMMUNITY_SOURCES_CATEGORY__ @"Community Sources" 45 | #define __UNCATEGORIZED__ @"Uncategorized" 46 | 47 | #ifdef DEBUG 48 | #define Log(...) NSLog(__VA_ARGS__) 49 | #else 50 | #define Log(...) {} 51 | #endif 52 | -------------------------------------------------------------------------------- /Background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/Background.png -------------------------------------------------------------------------------- /Categories.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/Categories.png -------------------------------------------------------------------------------- /Category.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/Category.png -------------------------------------------------------------------------------- /CategorySmart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/CategorySmart.png -------------------------------------------------------------------------------- /Classes/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/Classes/.DS_Store -------------------------------------------------------------------------------- /Classes/ATCategoriesCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATCategoriesCell.h 3 | // Installer 4 | // 5 | // Created by DigitalStealth on 17.07.08. 6 | // Copyright 2008 DIGITAL STEALTH DESIGN GROUP. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATTableViewCell.h" 11 | 12 | #define ATCAtegoriesType_AllPackages 0 13 | #define ATCategoriesTYPE_UpdatedPackages 1 14 | #define ATCategoriesTYPE_InstalledPackages 2 15 | #define ATCategoriesTYPE_RecentPackages 3 16 | #define ATCategoriesTYPE_OtherCategories 4 17 | 18 | @interface ATCategoriesCell : ATTableViewCell { 19 | NSString *text; 20 | UILabel *textViewer; 21 | UILabel *subtitle; 22 | NSUInteger packageCount; 23 | } 24 | 25 | @property (nonatomic, assign) NSUInteger packageCount; 26 | 27 | - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier categoriesType:(int)type; 28 | - (void) setCategoriesType:(int)type; 29 | 30 | - (void)_reconcileViews; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/ATCategoriesTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATCategoriesTableViewController.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 11/07/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATSource.h" 11 | #import "ATPackage.h" 12 | #import "ATTableViewController.h" 13 | #import "ATPackagesTableViewController.h" 14 | #import "ATPackage.h" 15 | #import "ATPackageCell.h" 16 | #import "ATCategoriesCell.h" 17 | 18 | 19 | @interface ATCategoriesTableViewController : ATTableViewController { 20 | IBOutlet ATPackagesTableViewController * packagesTableViewController; 21 | 22 | NSMutableArray* categoryCache; 23 | } 24 | 25 | - (void)_rebuildCache:(id)sender; 26 | @end 27 | -------------------------------------------------------------------------------- /Classes/ATDatabase.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "sqlite3.h" 3 | #import "ATResultSet.h" 4 | 5 | #define BUSY_MAX_WAIT_ITERATIONS 1000 6 | 7 | @interface ATDatabase : NSObject 8 | { 9 | sqlite3* db; 10 | NSString* databasePath; 11 | BOOL logsErrors; 12 | } 13 | 14 | + (ATDatabase*)sharedDatabase; 15 | 16 | + (id)databaseWithPath:(NSString*)inPath; 17 | - (id)initWithPath:(NSString*)inPath; 18 | 19 | - (sqlite3*)db; 20 | 21 | - (BOOL)open; 22 | - (void)close; 23 | 24 | - (NSString*)lastErrorMessage; 25 | - (int)lastErrorCode; 26 | - (sqlite_int64)lastInsertRowId; 27 | - (sqlite_int64)affectedRows; 28 | 29 | - (int)executeUpdate:(NSString*)objs, ...; 30 | - (id)executeQuery:(NSString*)obj, ...; 31 | - (int)executeUpdate:(NSString*)query withArray:(NSArray*)objs; 32 | 33 | - (BOOL)rollback; 34 | - (BOOL)commit; 35 | - (BOOL)beginTransaction; 36 | 37 | - (BOOL)logsErrors; 38 | - (void)setLogsErrors:(BOOL)flag; 39 | 40 | + (NSString*) sqliteLibVersion; 41 | 42 | - (void)_createOrUpgradeSchema; 43 | 44 | @end 45 | 46 | @interface ATDatabaseThreadPool : NSObject 47 | { 48 | NSMutableDictionary* instances; 49 | 50 | NSLock* lock; 51 | } 52 | 53 | + (ATDatabaseThreadPool*)sharedPool; 54 | 55 | - (ATDatabase*)databaseInstanceForThread:(NSThread*)thread; 56 | - (id)dictionaryKeyForThread:(NSThread*)thread; 57 | - (void)threadDidEndNotification:(NSNotification*)notification; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Classes/ATEntity.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATEntity.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/3/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ATEntity : NSObject { 13 | NSString* tableName; 14 | sqlite_int64 entryID; 15 | BOOL autocommit; 16 | 17 | @private 18 | NSMutableDictionary* pendingChanges; 19 | } 20 | 21 | @property (retain) NSString* tableName; 22 | @property (assign) sqlite_int64 entryID; 23 | @property (assign) BOOL autocommit; 24 | 25 | - (id)initWithTable:(NSString*)table entryID:(sqlite_int64)entryID; 26 | - (BOOL)commit; 27 | - (void)remove; // subclassers can override to remove associated items 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/ATError.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATError.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/15/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /* Various errors returned from the AppTapp framework */ 12 | #define AppTappErrorDomain @"com.apptapp.installer" 13 | #define CURLErrorDomain @"se.haxx.curl" 14 | 15 | typedef enum { 16 | kATErrorDependencyNotFound = 1, // [userInfo objectForKey:@"packageID"] = failed depenedency ID 17 | kATErrorPackageInfoDecodeFailed = 2, // [userInfo objectForKey:@"packageID"] = failed package ID 18 | kATErrorPackageHashInvalid = 3, // [userInfo objectForKey:@"package"] = failed ATPackage*, [userInfo objectForKey:@"task"] = failed ATTask* 19 | kATErrorPackageFileSizeInvalid = 4, // [userInfo objectForKey:@"package"] = failed ATPackage*, [userInfo objectForKey:@"task"] = failed ATTask* 20 | kATErrorScriptError = 5, // [userInfo objectForKey:@"package"] = failed ATPackage*, [userInfo objectForKey:@"task"] = failed ATTask*, [userInfo objectForKey:@"script"] = failed NSArray* with script 21 | kATErrorPackageNotInstalled = 6, // [userInfo objectForKey:@"package"] = failed ATPackage* 22 | kATErrorTrustedSourcesRefreshFailed = 7, // 23 | kATErrorPackageNotFound = 8, // [userInfo objectForKey:@"packageID"] = failed package ID 24 | kATErrorJailbreakRequired = 9, // [userInfo objectForKey:@"package"] = failed ATPackage*, [userInfo objectForKey:@"task"] = failed ATTask* 25 | kATErrorPackageNotUninstalled = 10, // [userInfo objectForKey:@"package"] = failed ATPackage* 26 | kATErrorPhoneRegistration = 11, 27 | kATErrorPackageInvalidLocation = 12, 28 | kATErrorInstallationPackage = 13, 29 | kATErrorBackupDevice = 14, 30 | kATErrorRestoreDevice = 15, 31 | kATErrorSynchronization = 16 32 | } ATErrorValue; 33 | 34 | -------------------------------------------------------------------------------- /Classes/ATFeaturedViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATFeaturedViewController.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 25/04/08. 6 | // Copyright Nullriver, Inc. 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATViewController.h" 11 | 12 | @class ATPackage; 13 | @class ATPackageInfoController; 14 | @class ATPackageMoreInfoView; 15 | @class ATSearchTableViewController; 16 | 17 | @interface ATFeaturedViewController : ATViewController { 18 | IBOutlet UIWebView * webView; 19 | 20 | IBOutlet ATPackageInfoController *packageInfoController; 21 | IBOutlet ATPackageMoreInfoView *packageCustomInfoController; 22 | 23 | IBOutlet ATSearchTableViewController *searchTableController; 24 | 25 | IBOutlet UISegmentedControl* titleControl; 26 | 27 | ATPackage* moreInfoPackage; 28 | } 29 | 30 | @property (retain, nonatomic) ATPackage* moreInfoPackage; 31 | 32 | - (IBAction)segmentedControlChanged:(UISegmentedControl*)sender; 33 | 34 | - (void)showPackageInfo:(NSString*)packageID; 35 | 36 | - (NSString*)renderAbout; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/ATIconView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATIconView.h 3 | // Installer 4 | // 5 | // Created by DigitalStealth on 19.07.08. 6 | // Copyright 2008 DIGITAL STEALTH DESIGN GROUP. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ATIconView : UIView { 13 | UIImage *icon; 14 | UIImage *iconMirror; 15 | bool isTrusted; 16 | bool isNew; 17 | 18 | BOOL hasErrors; 19 | BOOL drawShadow; 20 | } 21 | 22 | @property (assign, nonatomic) BOOL hasErrors; 23 | @property (assign, nonatomic) BOOL drawShadow; 24 | 25 | - (void) setIcon:(UIImage*) iconSource; 26 | - (void) setTrusted:(bool)isT; 27 | - (void) setNew:(bool) isN; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/ATIncompleteDownload.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATIncompleteDownload.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 25/08/2008. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATEntity.h" 11 | 12 | @interface ATIncompleteDownload : ATEntity { 13 | } 14 | 15 | @property (assign, getter=_get_url_url, setter=_set_url:) NSURL * url; 16 | @property (assign, getter=_get_str_path, setter=_set_path:) NSString * path; 17 | @property (assign, getter=_get_dte_date, setter=_set_date:) NSDate * date; 18 | @property (assign, getter=_get_int_size, setter=_set_size:) NSNumber * size; 19 | @property (assign, getter=_get_dte_mod_date, setter=_set_mod_date:) NSDate * modDate; 20 | 21 | + downloadWithID:(sqlite_int64)uid; 22 | 23 | - (id)initWithID:(sqlite_int64)uid; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/ATIncompleteDownload.m: -------------------------------------------------------------------------------- 1 | // 2 | // ATIncompleteDownload.m 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 25/08/2008. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import "ATIncompleteDownload.h" 10 | 11 | 12 | @implementation ATIncompleteDownload 13 | 14 | + downloadWithID:(sqlite_int64)uid 15 | { 16 | return [[[ATIncompleteDownload alloc] initWithID:uid] autorelease]; 17 | } 18 | 19 | - (id)init 20 | { 21 | if (self = [super initWithTable:@"incomplete_downloads" entryID:0]) 22 | { 23 | } 24 | 25 | return self; 26 | } 27 | 28 | - (id)initWithID:(sqlite_int64)uid 29 | { 30 | if (self = [super initWithTable:@"incomplete_downloads" entryID:uid]) 31 | { 32 | } 33 | 34 | return self; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Classes/ATIncompleteDownloads.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATIncompleteDownloads.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 25/08/2008. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ATIncompleteDownload; 12 | 13 | @interface ATIncompleteDownloads : NSObject { 14 | 15 | } 16 | 17 | - (ATIncompleteDownload *)downloadWithLocation:(NSURL*)url; 18 | - (void)cleanupTempFolder; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Classes/ATIncompleteDownloads.m: -------------------------------------------------------------------------------- 1 | // 2 | // ATIncompleteDownloads.m 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 25/08/2008. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import "ATIncompleteDownloads.h" 10 | #import "ATDatabase.h" 11 | #import "ATResultSet.h" 12 | #import "ATPackageManager.h" 13 | #import "ATIncompleteDownload.h" 14 | #import "NSFileManager+AppTappExtensions.h" 15 | 16 | @implementation ATIncompleteDownloads 17 | 18 | - (ATIncompleteDownload *)downloadWithLocation:(NSURL*)url 19 | { 20 | ATResultSet * res = [[ATDatabase sharedDatabase] executeQuery:@"SELECT RowID FROM incomplete_downloads WHERE url = ? LIMIT 1", [url absoluteString]]; 21 | 22 | if(res && [res next]) { 23 | ATIncompleteDownload* dl = [[[ATIncompleteDownload alloc] initWithID:[res intForColumn:@"RowID"]] autorelease]; 24 | [res close]; 25 | return dl; 26 | } 27 | [res close]; 28 | 29 | return nil; 30 | } 31 | 32 | - (void)cleanupTempFolder 33 | { 34 | if(![[NSFileManager defaultManager] fileExistsAtPath:__DOWNLOADS_PATH__]) { 35 | [[NSFileManager defaultManager] createPath:__DOWNLOADS_PATH__ handler:nil]; 36 | } 37 | 38 | NSDate* cutoffDate = [NSDate dateWithTimeIntervalSinceNow:-(60.*60.*24.*3.)]; 39 | 40 | ATResultSet * res = [[ATDatabase sharedDatabase] executeQuery:@"SELECT RowID, path FROM incomplete_downloads WHERE date < ?", cutoffDate]; 41 | 42 | while (res && [res next]) { 43 | ATIncompleteDownload* dl = [[[ATIncompleteDownload alloc] initWithID:[res intForColumn:@"RowID"]] autorelease]; 44 | 45 | if (dl && dl.path) 46 | [[NSFileManager defaultManager] removeItemAtPath:dl.path error:nil]; 47 | 48 | [dl remove]; 49 | } 50 | 51 | [res close]; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Classes/ATInstaller.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATInstaller.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 25/04/08. 6 | // Copyright Nullriver, Inc. 2008. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATPackageManager.h" 11 | 12 | 13 | @interface ATInstaller : NSObject { 14 | IBOutlet UIWindow * window; 15 | 16 | UITabBarController * tabBarController; 17 | IBOutlet UIViewController * featuredViewController; 18 | IBOutlet UITableViewController * categoriesTableViewController; 19 | IBOutlet UITableViewController * sourcesTableViewController; 20 | IBOutlet UITableViewController * tasksTableViewController; 21 | IBOutlet UITableViewController * searchTableViewController; 22 | 23 | ATPackageManager * packageManager; 24 | UIActionSheet * progressSheet; 25 | UIProgressView * progressBar; 26 | 27 | BOOL canContinue; 28 | BOOL needsSuspend; 29 | BOOL shouldShowProgressSheet; 30 | int confirmedButton; 31 | 32 | BOOL offeredUpdate; 33 | 34 | NSNotificationQueue* notificationQueue; 35 | } 36 | 37 | @property (nonatomic, retain) UIWindow * window; 38 | @property (nonatomic, retain) UITabBarController * tabBarController; 39 | @property (nonatomic, retain) ATPackageManager * packageManager; 40 | @property (retain) NSNotificationQueue* notificationQueue; 41 | 42 | + (ATInstaller *)sharedInstaller; 43 | 44 | // Actions 45 | - (IBAction)refreshAllSources:(id)sender; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /Classes/ATPackageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackageCell.h 3 | // Installer 4 | // 5 | // Created by DigitalStealth on 17.07.08. 6 | // Copyright 2008 DIGITAL STEALTH DESIGN GROUP. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATPackageManager.h" 11 | #import "ATInstaller.h" 12 | #import "ATPackage.h" 13 | #import "ATIconView.h" 14 | #import "ATTableViewCell.h" 15 | 16 | 17 | @interface ATPackageCell : ATTableViewCell { 18 | UILabel *packageNameView; 19 | UILabel *packageDescriptionView; 20 | UILabel *packageVersionView; 21 | ATIconView *iconView; 22 | bool isIndicatorShown; 23 | UIActivityIndicatorView *indicator; 24 | 25 | ATPackage* package; 26 | 27 | BOOL iconFetched; 28 | } 29 | 30 | @property (retain) ATPackage* package; 31 | 32 | - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier package:(ATPackage*)pack; 33 | - (void) setShowIndicator:(bool)show; 34 | - (void) _didEndHideIndicatorAnimation:(id)sender; 35 | - (void)setPackage:(ATPackage*)package; 36 | @end 37 | -------------------------------------------------------------------------------- /Classes/ATPackageDetailsTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackageDetailsTableViewController.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 12/07/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ATPackageDetailsTableViewController : NSObject { 13 | 14 | } 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /Classes/ATPackageDetailsTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackageDetailsTableViewController.m 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 12/07/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import "ATPackageDetailsTableViewController.h" 10 | 11 | 12 | @implementation ATPackageDetailsTableViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /Classes/ATPackageIconFetch.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackageInfoFetch.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/11/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATTask.h" 11 | 12 | @class ATPackage; 13 | @class ATURLDownload; 14 | @class ATSource; 15 | 16 | @interface ATPackageIconFetch : NSObject { 17 | ATPackage * package; 18 | ATSource * source; 19 | ATURLDownload * download; 20 | NSString * tempFileName; 21 | } 22 | 23 | @property (retain) ATPackage * package; 24 | @property (retain) ATSource * source; 25 | @property (retain) ATURLDownload * download; 26 | @property (retain) NSString * tempFileName; 27 | 28 | - initWithPackage:(ATPackage*)pack source:(ATSource*)source; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Classes/ATPackageInfoController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | 5 | #import "ATViewController.h" 6 | #import "ATIconView.h" 7 | #import "ATPackageMoreInfoView.h" 8 | #import "ATSourceInfoController.h" 9 | 10 | #import "ATRatingView.h" 11 | 12 | @interface ATPackageInfoController : ATViewController { 13 | IBOutlet ATPackageMoreInfoView *moreInfoView; 14 | IBOutlet UILabel *packageDateLabel; 15 | IBOutlet UILabel *packageDescriptionLabel; 16 | IBOutlet UILabel *packageSizeLabel; 17 | IBOutlet UILabel *packageSourceLabel; 18 | IBOutlet UILabel *packageVersionLabel; 19 | IBOutlet UILabel *packageNameLabel; 20 | IBOutlet UILabel *packageEMailLabel; 21 | IBOutlet ATSourceInfoController *sourceInfoView; 22 | IBOutlet UIImageView *movingDownSeparator; 23 | IBOutlet UIButton *movingMailButton; 24 | IBOutlet UIButton *sourceInfoButton; 25 | IBOutlet UIButton *movingMoreInfoButton; 26 | IBOutlet UILabel *movingMoreInfoLabel; 27 | IBOutlet UIButton *movingSponsorButton; 28 | IBOutlet UILabel *movingSponsorLabel; 29 | 30 | IBOutlet UIView *movingBottomView; 31 | IBOutlet ATRatingView* ratingView; 32 | IBOutlet UIView *scrollerContentView; 33 | IBOutlet UIScrollView* scrollerView; 34 | 35 | ATPackage *package; 36 | ATIconView *iconView; 37 | 38 | UIBarButtonItem *installButton; 39 | UIBarButtonItem *uninstallButton; 40 | UIBarButtonItem *updateButton; 41 | 42 | // @private 43 | // CGRect mOriginalViewSize; 44 | } 45 | - (IBAction)moreInfoButtonPressed:(id)sender; 46 | - (IBAction)sourceInfoButtonPressed:(id)sender; 47 | - (IBAction)mailButtonPressed:(id)sender; 48 | - (IBAction)installButtonPressed:(id)sender; 49 | - (IBAction)sponsorButtonPressed:(id)sender; 50 | 51 | @property (retain, nonatomic) ATPackage *package; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Classes/ATPackageInfoFetch.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackageInfoFetch.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/11/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATTask.h" 11 | 12 | @class ATPackage; 13 | @class ATURLDownload; 14 | 15 | @interface ATPackageInfoFetch : NSObject { 16 | ATPackage * package; 17 | ATURLDownload * download; 18 | NSString * tempFileName; 19 | } 20 | 21 | @property (retain) ATPackage * package; 22 | @property (retain) ATURLDownload * download; 23 | @property (retain) NSString * tempFileName; 24 | 25 | - initWithPackage:(ATPackage*)pack; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/ATPackageInstallTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackageInstallTask.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/12/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ATTask.h" 12 | 13 | @class ATPackage; 14 | @class ATURLDownload; 15 | @class ATScript; 16 | 17 | @interface ATPackageInstallTask : NSObject { 18 | ATPackage * package; 19 | ATURLDownload * download; 20 | NSString * tempFileName; 21 | ATScript * script; 22 | 23 | NSNumber * progress; 24 | NSString * status; 25 | 26 | NSUInteger downloadBytes; 27 | 28 | BOOL canCancel; 29 | } 30 | 31 | @property (retain) ATPackage * package; 32 | @property (retain) ATURLDownload * download; 33 | @property (retain) NSString * tempFileName; 34 | @property (retain) ATScript * script; 35 | @property (retain) NSNumber * progress; 36 | @property (retain) NSString * status; 37 | @property (assign) NSUInteger downloadBytes; 38 | @property (assign) BOOL canCancel; 39 | 40 | - initWithPackage:(ATPackage*)pack; 41 | - (void)embedLuaObjectsInto:(NSMutableArray*)array; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Classes/ATPackageManager.h: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | 5 | #import "NSNumber+AppTappExtensions.h" 6 | #import "ATSources.h" 7 | #import "ATPackages.h" 8 | #import "ATScript.h" 9 | #import "ATPlatform.h" 10 | 11 | @class ATSources; 12 | @class ATPackages; 13 | @class ATScript; 14 | @class ATSearch; 15 | @class ATIncompleteDownloads; 16 | 17 | // This should be set BEFORE you call any AT* class to properly function. You can initialize it with a bitwise OR of any of the following flags: 18 | enum { 19 | kATBehavior_NoGUI = (1L << 1), // run in GUIless mode: alerts and popups will be suppressed, and no source refreshes will be done 20 | // upon startup 21 | kATBehavior_NoNetwork = (1L << 2), // run in networkless mode, certain network operations will be suppressed (such as source refreshes upon startup) 22 | }; 23 | extern NSUInteger gATBehaviorFlags; 24 | 25 | 26 | @interface ATPackageManager : NSObject { 27 | ATSources * sources; 28 | ATPackages * packages; 29 | ATSearch * search; 30 | ATIncompleteDownloads * incompleteDownloads; 31 | BOOL springboardNeedsRefresh; 32 | BOOL springboardNeedsHardRefresh; 33 | id delegate; 34 | BOOL scriptCanContinue; 35 | NSUInteger scriptConfirmationButton; 36 | 37 | NSMutableArray * installedApplications; 38 | NSMutableArray * removedApplications; 39 | } 40 | 41 | 42 | @property (nonatomic, retain) ATSources * sources; 43 | @property (nonatomic, retain) ATPackages * packages; 44 | @property (nonatomic, retain) ATSearch * search; 45 | @property (nonatomic, assign) BOOL springboardNeedsRefresh; 46 | @property (nonatomic, assign) BOOL springboardNeedsHardRefresh; 47 | @property (nonatomic, assign) BOOL scriptCanContinue; 48 | @property (nonatomic, assign) NSUInteger scriptConfirmationButton; 49 | @property (nonatomic, assign) id delegate; 50 | @property (nonatomic, retain) ATIncompleteDownloads * incompleteDownloads; 51 | 52 | @property (retain) NSMutableArray* installedApplications; 53 | @property (retain) NSMutableArray* removedApplications; 54 | 55 | // Factory 56 | + (ATPackageManager*)sharedPackageManager; 57 | 58 | // Methods 59 | - (ATSource *)defaultSource; 60 | 61 | - (BOOL)refreshIsNeeded; 62 | - (BOOL)refreshTrustedSources; 63 | - (BOOL)refreshAllSources; 64 | - (BOOL)refreshSource:(ATSource *)aSource; 65 | 66 | - (void)restartSpringBoardIfNeeded; 67 | - (void)propogateMobileInstallation; 68 | 69 | - (void)updateApplicationBadge; 70 | @end 71 | -------------------------------------------------------------------------------- /Classes/ATPackageMoreInfoView.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import "ATViewController.h" 5 | #import "ATInstaller.h" 6 | 7 | @interface ATPackageMoreInfoView : ATViewController { 8 | IBOutlet UIWebView *webView; 9 | 10 | NSURL* urlToLoad; 11 | 12 | ATPackage *package; 13 | 14 | UIBarButtonItem *installButton; 15 | UIBarButtonItem *uninstallButton; 16 | UIBarButtonItem *updateButton; 17 | } 18 | 19 | @property (nonatomic, retain) NSURL* urlToLoad; 20 | 21 | - (IBAction)installButtonPressed:(id)sender; 22 | 23 | @property (retain, nonatomic) ATPackage* package; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Classes/ATPackageUSBInstallTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackageUSBInstallTask.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/12/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ATTask.h" 12 | 13 | @class ATPackage; 14 | @class ATURLDownload; 15 | @class ATScript; 16 | 17 | @interface ATPackageUSBInstallTask : NSObject { 18 | ATPackage * package; 19 | ATURLDownload * download; 20 | NSString * tempFileName; 21 | ATScript * script; 22 | 23 | NSNumber * progress; 24 | NSString * status; 25 | 26 | NSUInteger downloadBytes; 27 | BOOL canCancel; 28 | } 29 | 30 | @property (retain) ATPackage * package; 31 | @property (retain) ATURLDownload * download; 32 | @property (retain) NSString * tempFileName; 33 | @property (retain) ATScript * script; 34 | @property (retain) NSNumber * progress; 35 | @property (retain) NSString * status; 36 | @property (assign) NSUInteger downloadBytes; 37 | @property (assign) BOOL canCancel; 38 | 39 | - (id)initWithPackage:(ATPackage*)pack; 40 | 41 | - (void)embedLuaObjectsInto:(NSMutableArray*)array; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Classes/ATPackageUSBUninstallTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackageUSBUninstallTask.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/12/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ATTask.h" 12 | 13 | @class ATPackage; 14 | @class ATScript; 15 | 16 | @interface ATPackageUSBUninstallTask : NSObject { 17 | ATPackage * package; 18 | 19 | NSNumber * progress; 20 | NSString * status; 21 | } 22 | 23 | @property (retain) ATPackage * package; 24 | @property (retain) NSNumber * progress; 25 | @property (retain) NSString * status; 26 | 27 | - (id)initWithPackage:(ATPackage*)pack; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/ATPackageUninstallTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackageUninstallTask.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/12/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ATTask.h" 12 | 13 | @class ATPackage; 14 | @class ATScript; 15 | 16 | @interface ATPackageUninstallTask : NSObject { 17 | ATPackage * package; 18 | ATScript * script; 19 | 20 | NSNumber * progress; 21 | NSString * status; 22 | } 23 | 24 | @property (retain) ATPackage * package; 25 | @property (retain) ATScript * script; 26 | @property (retain) NSNumber * progress; 27 | @property (retain) NSString * status; 28 | 29 | - initWithPackage:(ATPackage*)pack; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/ATPackages.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackages.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 05/07/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ATSource; 12 | @class ATPackage; 13 | @class ATResultSet; 14 | 15 | @interface ATPackages : NSObject { 16 | NSString * sortCriteria; 17 | NSString * whereClause; 18 | NSString * customQuery; 19 | BOOL sortAscending; 20 | NSUInteger resultsLimit; 21 | NSUInteger setCount; 22 | NSUInteger sectionCount; 23 | 24 | NSLock * lock; 25 | 26 | NSString* sortPackagesTableName; 27 | NSString* packageSectionNamesTableName; 28 | } 29 | 30 | @property (retain) NSString * sortCriteria; 31 | @property (retain) NSString * whereClause; 32 | @property (retain) NSString * customQuery; 33 | @property (assign) BOOL sortAscending; 34 | @property (assign) NSUInteger resultsLimit; 35 | @property (assign) NSUInteger setCount; 36 | @property (assign) NSUInteger sectionCount; 37 | 38 | - (void)rebuildWithAllPackagesSortedByCategory; 39 | - (void)rebuildWithAllPackagesSortedAlphabeticallyWithSortCriteria:(NSString*)criteria; 40 | - (void)rebuildWithAllPackagesSortedAlphabetically; 41 | - (void)rebuildWithInstalledPackages; 42 | - (void)rebuildWithUpdatedPackagesWithSortCriteria:(NSString*)criteria; 43 | - (void)rebuildWithUpdatedPackages; 44 | - (void)rebuildWithRecentPackagesWithSortCriteria:(NSString*)criteria; 45 | - (void)rebuildWithRecentPackages; 46 | - (void)rebuildWithSelectPackagesSortedAlphabeticallyForCategory:(NSString *)category sortCriteria:(NSString*)criteria; 47 | - (void)rebuildWithSelectPackagesSortedAlphabeticallyForCategory:(NSString *)category; 48 | - (void)rebuild; 49 | 50 | - (NSUInteger)count; 51 | - (NSUInteger)numberOfSections; 52 | - (NSString *)sectionTitleAtIndex:(NSUInteger)section; 53 | - (NSString *)trimmedSectionTitleAtIndex:(NSUInteger)section; 54 | - (NSUInteger)numberOfPackagesInSection:(NSUInteger)section; 55 | - (ATPackage*)packageAtIndex:(NSUInteger)index; 56 | - (ATPackage *)packageAtIndex:(NSUInteger)index ofSection:(NSUInteger)section; 57 | 58 | - (ATPackage*)packageWithIdentifier:(NSString*)identifier; 59 | - (ATPackage*)packageWithIdentifier:(NSString *)identifier forSource:(ATSource *)source; 60 | 61 | - (NSArray*)packagesWithIdentifier:(NSString*)identifier; 62 | 63 | - (BOOL)packageIsInstalled:(NSString*)identifier; 64 | 65 | #ifdef INSTALLER_APP 66 | - (BOOL)packageIsEssential:(NSString*)identifier; 67 | - (BOOL)packageIsCydiaPackage:(NSString*)identifier; 68 | #endif // INSTALLER_APP 69 | 70 | - (NSUInteger)countOfUpdatedPackages; 71 | - (ATPackage*)hasInstallerUpdate; 72 | - (NSUInteger)countOfPackagesInCategory:(NSString*)category; 73 | 74 | //- (void)_sanityCheck; 75 | 76 | - (NSString*)sortPackagesTableName; 77 | - (void)setSortPackagesTableName:(NSString*)tableName; 78 | 79 | - (NSString*)packageSectionNamesTableName; 80 | - (void)setPackageSectionNamesTableName:(NSString*)tableName; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /Classes/ATPackagesTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPackagesTableViewController.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 12/07/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATTableViewController.h" 11 | #import "ATPackage.h" 12 | #import "ATPackageCell.h" 13 | #import "ATPackageInfoController.h" 14 | 15 | extern NSString* kCategorySpecial_AllPackages; 16 | extern NSString* kCategorySpecial_InstalledPackages; 17 | extern NSString* kCategorySpecial_RecentPackages; 18 | extern NSString* kCategorySpecial_UpdatedPackages; 19 | 20 | @interface ATPackagesTableViewController : ATTableViewController { 21 | IBOutlet ATPackageInfoController *packageInfoController; 22 | IBOutlet ATPackageMoreInfoView *packageCustomInfoController; 23 | 24 | NSString * category; 25 | int fetchCellNumber; 26 | int fetchSection; 27 | ATPackageCell *fetchCell; 28 | } 29 | 30 | @property (retain, nonatomic) NSString * category; 31 | 32 | - (void) fetchDone:(NSNotification*)sender; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/ATPipeline.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPipeline.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/5/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATTask.h" 11 | 12 | /* 13 | An abstract class representing a "pipeline" of tasks. When one task finishes, next task executes. If the task finishes with an error, 14 | stop execution and nuke all other tasks that depend on it in the pipeline. 15 | 16 | There are different pipeline types coerced into groups. This all is managed by ATPipelineManager. 17 | */ 18 | 19 | @interface ATPipeline : NSObject 20 | { 21 | @private 22 | NSMutableArray* tasks; 23 | id currentTask; 24 | 25 | NSThread* thread; 26 | NSRecursiveLock* lock; 27 | } 28 | 29 | - (id)currentTask; 30 | 31 | - (BOOL)addTask:(id)task; 32 | 33 | - (void)markTaskAsDone:(id)task withError:(NSError*)error; 34 | 35 | - (id)taskForIdentifier:(NSString*)identifier; 36 | 37 | - (NSUInteger)indexOfTask:(id)task; 38 | 39 | - (BOOL)existTaskWithPrefix:(NSString*)prefix ignoreTask:(id)ignoreTask; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Classes/ATPipelineManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATPipelineManager.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/5/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // Pipeline types 12 | extern NSString* ATPipelinePackageOperation; 13 | extern NSString* ATPipelineSourceRefresh; 14 | extern NSString* ATPipelineMisc; 15 | extern NSString* ATPipelineSearch; 16 | extern NSString* ATPipelineErrors; 17 | extern NSString* ATPipelineSynchronization; 18 | 19 | // Notifications 20 | extern NSString* ATPipelineTaskQueuedNotification; 21 | extern NSString* ATPipelineTaskChangedNotification; 22 | extern NSString* ATPipelineTaskFinishedNotification; 23 | extern NSString* ATPipelineTaskProgressNotification; 24 | extern NSString* ATPipelineTaskStatusNotification; 25 | 26 | // Keys for the userInfo dictionary 27 | extern NSString* ATPipelineUserInfoPipelineID; 28 | extern NSString* ATPipelineUserInfoTaskID; 29 | extern NSString* ATPipelineUserInfoSuccess; 30 | extern NSString* ATPipelineUserInfoError; // if ATPipelineUserInfoSuccess == [NSNumber boolValue] == NO 31 | extern NSString* ATPipelineUserInfoProgress; // NSNumber, [0.0, 1.0] 32 | extern NSString* ATPipelineUserInfoStatus; // NSString 33 | 34 | @class ATPipeline; 35 | 36 | @interface ATPipelineManager : NSObject { 37 | NSMutableDictionary* pipelines; 38 | NSLock* pipelinesLock; 39 | } 40 | 41 | @property (nonatomic, retain) NSMutableDictionary* pipelines; 42 | 43 | + (ATPipelineManager*)sharedManager; 44 | 45 | - (BOOL)queueTask:(id)task forPipeline:(NSString*)pipelineID; 46 | - (BOOL)cancelTask:(id)task; 47 | - (id)findTaskForID:(NSString*)identifier outPipeline:(NSString**)pipelineID; 48 | - (ATPipeline*)findPipelineForTask:(id)task; 49 | - (NSString*)piplineIDForTask:(id)task; 50 | 51 | - (void)taskDoneWithError:(id)task error:(NSError*)error; 52 | - (void)taskDoneWithSuccess:(id)task; 53 | 54 | - (void)taskProgressChanged:(id)task; 55 | - (void)taskStatusChanged:(id)task; 56 | 57 | - (void)pipelineDone:(ATPipeline*)pipeline; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /Classes/ATPlatform.h: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | 5 | @interface ATPlatform : NSObject { 6 | } 7 | 8 | + (NSString *)platformName; 9 | + (NSString *)firmwareVersion; 10 | + (NSString *)deviceName; 11 | + (NSString *)deviceUUID; 12 | + (NSString *)applicationsPath; 13 | + (BOOL)isDeviceRootLocked; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/ATPlatform.m: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | #import "ATPlatform.h" 5 | 6 | #ifndef INSTALLER_APP 7 | #import "kali.h" 8 | #endif // INSTALLER_APP 9 | 10 | #import 11 | 12 | static NSString* sDeviceUUID = nil; 13 | 14 | @implementation ATPlatform 15 | 16 | + (NSString *)platformName { 17 | #ifdef INSTALLER_APP 18 | return @"Mac"; 19 | #else 20 | return [UIDevice currentDevice].model; 21 | #endif // INSTALLER_APP 22 | } 23 | 24 | + (NSString *)firmwareVersion { 25 | #ifdef INSTALLER_APP 26 | return @"2.2"; 27 | #else 28 | return [UIDevice currentDevice].systemVersion; 29 | #endif // INSTALLER_APP 30 | } 31 | 32 | + (NSString *)deviceName { 33 | #ifdef INSTALLER_APP 34 | return @"Mac"; 35 | #else 36 | return [UIDevice currentDevice].name; 37 | #endif // INSTALLER_APP 38 | } 39 | 40 | + (NSString *)deviceUUID { 41 | if (!sDeviceUUID) 42 | { 43 | #if !(__i386__) && !defined(INSTALLER_APP) 44 | 45 | #if defined(ATCORE) 46 | void * kali = kali_start((void *)&_mh_execute_header); 47 | #else 48 | void * kali = kali_start((void *)&_mh_dylib_header); 49 | #endif 50 | if (kali != NULL) // kali failure, bail. 51 | { 52 | char deviceID[32] = { 0 }; 53 | 54 | if (kali_deviceid_get(kali, KALI_DEVICEID_MAC, deviceID) == 0) 55 | { 56 | sDeviceUUID = [[NSString stringWithCString:deviceID] retain]; 57 | } 58 | else 59 | { 60 | exit(1); 61 | } 62 | } 63 | 64 | kali_stop(kali); 65 | #else 66 | sDeviceUUID = [@"m000000000000" retain]; 67 | #endif 68 | } 69 | 70 | return sDeviceUUID; 71 | } 72 | 73 | + (NSString *)applicationsPath { 74 | return [@"~/Applications" stringByExpandingTildeInPath]; 75 | } 76 | 77 | + (BOOL)isDeviceRootLocked 78 | { 79 | static BOOL deviceRootLocked = YES; 80 | static BOOL deviceRootLockedInitialized = NO; 81 | 82 | if (deviceRootLockedInitialized) 83 | return deviceRootLocked; 84 | 85 | deviceRootLockedInitialized = YES; 86 | 87 | NSError* err = nil; 88 | 89 | if ([[NSFileManager defaultManager] createDirectoryAtPath:@"/Library/InstallerTest" withIntermediateDirectories:NO attributes:nil error:&err]) 90 | { 91 | deviceRootLocked = NO; 92 | [[NSFileManager defaultManager] removeItemAtPath:@"/Library/InstallerTest" error:nil]; 93 | } 94 | 95 | return deviceRootLocked; 96 | } 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /Classes/ATQueueFutureInstall.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATQueueFutureInstall.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 21/08/2008. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATTask.h" 11 | 12 | @interface ATQueueFutureInstall : NSObject { 13 | NSString* packageID; 14 | } 15 | 16 | @property (retain) NSString* packageID; 17 | 18 | - initWithPackageID:(NSString*)identifier; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /Classes/ATQueueFutureInstall.m: -------------------------------------------------------------------------------- 1 | // 2 | // ATQueueFutureInstall.m 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 21/08/2008. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import "ATQueueFutureInstall.h" 10 | #import "ATPackageManager.h" 11 | #import "ATPackage.h" 12 | #import "ATPackages.h" 13 | #import "ATPipelineManager.h" 14 | 15 | @implementation ATQueueFutureInstall 16 | 17 | @synthesize packageID; 18 | 19 | - initWithPackageID:(NSString*)identifier; 20 | { 21 | if (self = [super init]) 22 | { 23 | self.packageID = identifier; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | - (void)dealloc 30 | { 31 | self.packageID = nil; 32 | [super dealloc]; 33 | } 34 | 35 | #pragma mark - 36 | 37 | - (NSString*)taskID 38 | { 39 | return [NSString stringWithFormat:@"future-install:%@", self.packageID]; 40 | } 41 | 42 | - (NSString*)taskDescription 43 | { 44 | return NSLocalizedString(@"Queueing package install...", @""); 45 | } 46 | 47 | - (double)taskProgress 48 | { 49 | return -1.; 50 | } 51 | 52 | - (NSArray*)taskDependencies 53 | { 54 | return nil; 55 | } 56 | 57 | - (void)taskStart 58 | { 59 | ATPackage* pack = [[ATPackageManager sharedPackageManager].packages packageWithIdentifier:self.packageID]; 60 | if (pack) 61 | { 62 | NSError* err = nil; 63 | 64 | if (![pack install:&err]) 65 | { 66 | [[ATPipelineManager sharedManager] taskDoneWithError:self error:err]; 67 | } 68 | else 69 | [[ATPipelineManager sharedManager] taskDoneWithSuccess:self]; 70 | } 71 | else 72 | { 73 | NSDictionary* userInfo = [NSDictionary dictionaryWithObjectsAndKeys: self.packageID, @"packageID", 74 | [NSString stringWithFormat:NSLocalizedString(@"Cannot install package \"%@\" as it was not found. Sorry!", @""), self.packageID], NSLocalizedDescriptionKey, 75 | nil]; 76 | 77 | NSError* err = [NSError errorWithDomain:AppTappErrorDomain code:kATErrorPackageNotFound userInfo:userInfo]; 78 | 79 | [[ATPipelineManager sharedManager] taskDoneWithError:self error:err]; 80 | } 81 | } 82 | 83 | @end 84 | -------------------------------------------------------------------------------- /Classes/ATResultSet.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "sqlite3.h" 3 | 4 | @interface ATResultSet : NSObject { 5 | sqlite3_stmt *pStmt; 6 | NSString *query; 7 | NSMutableDictionary *columnNameToIndexMap; 8 | BOOL columnNamesSetup; 9 | } 10 | 11 | + (id)resultSetWithStatement:(sqlite3_stmt *)stmt; 12 | 13 | - (void) close; 14 | 15 | - (NSString *)query; 16 | - (void)setQuery:(NSString *)value; 17 | 18 | - (sqlite3_stmt *)pStmt; 19 | - (void)setPStmt:(sqlite3_stmt *)value; 20 | 21 | - (BOOL)next; 22 | 23 | - (int)intForColumn:(NSString*)columnName; 24 | - (BOOL)boolForColumn:(NSString*)columnName; 25 | - (double)doubleForColumn:(NSString*)columnName; 26 | - (NSString*)stringForColumn:(NSString*)columnName; 27 | - (NSDate*)dateForColumn:(NSString*)columnName; 28 | - (NSData*)dataForColumn:(NSString*)columnName; 29 | 30 | - (void)kvcMagic:(id)object; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /Classes/ATSearch.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATSearch.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 20/08/2008. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ATResultSet; 12 | @class ATPackage; 13 | 14 | extern NSString* ATSearchResultsUpdatedNotification; 15 | 16 | @interface ATSearch : NSObject 17 | { 18 | NSString* searchCriteria; 19 | NSString* _sortCriteria; 20 | } 21 | 22 | @property (retain) NSString* searchCriteria; 23 | 24 | - (unsigned int)count; 25 | - (ATPackage *)packageAtIndex:(unsigned int)index; 26 | 27 | - (void)searchImmediately; 28 | - (void)_search; 29 | - (void)_externalSearch; 30 | 31 | - (NSString*)sortCriteria; 32 | - (void)setSortCriteria:(NSString*)sortCriteria; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/ATSearchTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATSearchTableViewController.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 20/08/2008. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ATPackageMoreInfoView; 12 | @class ATPackageInfoController; 13 | @class ATPackageCell; 14 | 15 | @interface ATSearchTableViewController : UIViewController { 16 | IBOutlet ATPackageInfoController *packageInfoController; 17 | IBOutlet ATPackageMoreInfoView *packageCustomInfoController; 18 | IBOutlet UITableView * tableView; 19 | IBOutlet UISearchBar * searchBar; 20 | 21 | int fetchCellNumber; 22 | ATPackageCell *fetchCell; 23 | } 24 | 25 | - (void)setSearch:(NSString*)text; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/ATSearchTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATSearchTask.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 21/08/2008. 6 | // Copyright 2008 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATTask.h" 11 | 12 | @class ATSearch; 13 | @class ATURLDownload; 14 | 15 | @interface ATSearchTask : NSObject { 16 | NSString * search; 17 | ATURLDownload * download; 18 | NSString * tempFileName; 19 | } 20 | 21 | @property (retain) NSString * search; 22 | @property (retain) ATURLDownload * download; 23 | @property (retain) NSString * tempFileName; 24 | 25 | - initWithSearch:(ATSearch*)srch; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/ATSource.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATSource.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 22/06/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #ifdef INSTALLER_APP 10 | #import 11 | #else 12 | #import 13 | #endif // INSTALLER_APP 14 | 15 | #import "ATEntity.h" 16 | 17 | extern NSString* ATSourceUpdatedNotification; 18 | extern NSString* ATSourceInfoIconChangedNotification; 19 | @interface ATSource : ATEntity { 20 | } 21 | 22 | @property (assign, getter=_get_url_location, setter=_set_location:) NSURL * location; 23 | @property (assign, getter=_get_str_name, setter=_set_name:) NSString * name; 24 | @property (assign, getter=_get_str_maintainer, setter=_set_maintainer:) NSString * maintainer; 25 | @property (assign, getter=_get_str_contact, setter=_set_contact:) NSString * contact; 26 | @property (assign, getter=_get_str_category, setter=_set_category:) NSString * category; 27 | @property (assign, getter=_get_url_url, setter=_set_url:) NSURL * url; 28 | @property (assign, getter=_get_str_description, setter=_set_description:) NSString * description; 29 | @property (assign, getter=_get_int_istrusted, setter=_set_istrusted:) NSNumber * isTrusted; 30 | @property (assign, getter=_get_dte_lastrefresh, setter=_set_lastrefresh:) NSDate * lastrefresh; 31 | @property (assign, getter=_get_int_isUnsafe, setter=_set_isUnsafe:) NSNumber * isUnsafe; 32 | @property (assign, getter=_get_int_hasErrors, setter=_set_hasErrors:) NSNumber * hasErrors; 33 | @property (assign, getter=_get_url_icon, setter=_set_icon:) NSURL * iconURL; 34 | 35 | #ifdef INSTALLER_APP 36 | @property (assign, getter=_get_int_iscydiasource, setter=_set_iscydiasource:) NSNumber * isCydiaSource; 37 | @property (assign, readonly) NSImage* icon; 38 | @property (assign, readonly) NSImage* localIcon; 39 | #else 40 | @property (assign, readonly) UIImage* icon; 41 | @property (assign, readonly) UIImage* localIcon; 42 | #endif // INSTALLER_APP 43 | 44 | + (id)sourceWithID:(sqlite_int64)uid; 45 | 46 | - (id)initWithID:(sqlite_int64)uid; 47 | - (BOOL)isTrustedSource; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Classes/ATSourceInfoController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATSourceInfoController.h 3 | // Installer 4 | // 5 | // Created by DigitalStealth on 20.07.08. 6 | // Copyright 2008 DIGITAL STEALTH DESIGN GROUP. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATViewController.h" 11 | #import "ATInstaller.h" 12 | 13 | 14 | @interface ATSourceInfoController : ATViewController { 15 | IBOutlet UILabel *categoryLabel; 16 | IBOutlet UILabel *contactLabel; 17 | IBOutlet UILabel *definitionLabel; 18 | IBOutlet UIImageView *imageView; 19 | IBOutlet UILabel *sourceNameLabel; 20 | IBOutlet UITextField *urlLabel; 21 | IBOutlet UIImageView *movingBottomSeparator; 22 | IBOutlet UIButton *movingMailButton; 23 | 24 | ATSource *source; 25 | 26 | } 27 | - (IBAction)emailButtonPressed:(id)sender; 28 | - (IBAction)refreshSource:(id)sender; 29 | - (IBAction)editingDidEnd:(UITextField*)sender; 30 | - (void)updateSource; 31 | 32 | @property (retain, nonatomic) ATSource *source; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Classes/ATSourceRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATSourceRefresh.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/8/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATTask.h" 11 | #import "ATCydiaRepositoryNode.h" 12 | 13 | @class ATSource, ATURLDownload; 14 | 15 | @interface ATSourceRefresh : NSObject { 16 | ATSource* source; 17 | ATURLDownload* download; 18 | NSString* tempFileName; 19 | 20 | NSString* description; 21 | 22 | BOOL cydiaSource; 23 | ATCydiaRepositoryNode* rootNode; 24 | 25 | double progress; 26 | BOOL canCancel; 27 | } 28 | 29 | @property (retain) ATSource* source; 30 | @property (retain) ATURLDownload* download; 31 | @property (retain) NSString* tempFileName; 32 | @property (retain) NSString* description; 33 | @property (assign) BOOL canCancel; 34 | 35 | + (ATSourceRefresh*)sourceRefreshWithSourceLocation:(NSString*)location; 36 | + (ATSourceRefresh*)sourceRefreshWithSource:(ATSource*)src; 37 | - (ATSourceRefresh*)initWithSource:(ATSource*)src; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Classes/ATSourceTableViewCell.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import "ATInstaller.h" 5 | #import "ATSource.h" 6 | #import "ATTableViewCell.h" 7 | 8 | @interface ATSourceTableViewCell : ATTableViewCell { 9 | UILabel *sourceNameView; 10 | UILabel *sourceDescriptionView; 11 | UIImageView *iconView; 12 | 13 | ATSource* source; 14 | } 15 | 16 | @property (retain) ATSource* source; 17 | 18 | - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier source:(ATSource*)s; 19 | - (void)setSource:(ATSource*)source; 20 | @end 21 | -------------------------------------------------------------------------------- /Classes/ATSourceTableViewCell.m: -------------------------------------------------------------------------------- 1 | #import "ATSourceTableViewCell.h" 2 | #import "ATIconView.h" 3 | 4 | @implementation ATSourceTableViewCell 5 | 6 | - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier source:(ATSource*)src 7 | { 8 | if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) { 9 | // Initialization code 10 | 11 | sourceNameView = [[UILabel alloc] initWithFrame:CGRectMake(80, 3, 200, 35)]; 12 | sourceDescriptionView = [[UILabel alloc] initWithFrame:CGRectMake(80, 25, 220, 55)]; 13 | [sourceNameView setTextColor:[UIColor blackColor]]; 14 | [sourceNameView setBackgroundColor:[UIColor clearColor]]; 15 | sourceNameView.shadowColor = [UIColor colorWithWhite:0.8 alpha:1.]; 16 | sourceNameView.shadowOffset = CGSizeMake(0,1); 17 | sourceNameView.adjustsFontSizeToFitWidth = YES; 18 | sourceNameView.numberOfLines = 1; 19 | sourceNameView.minimumFontSize = 9.; 20 | 21 | [sourceNameView setFont:self.font]; 22 | 23 | UIFont *fontDescr = [UIFont fontWithName:@"Helvetica" size:12]; 24 | [sourceDescriptionView setTextColor:[UIColor colorWithRed:.15 green:.3 blue:.45 alpha:1]]; 25 | [sourceDescriptionView setBackgroundColor:[UIColor clearColor]]; 26 | sourceDescriptionView.shadowColor = [UIColor colorWithWhite:0.8 alpha:1.]; 27 | sourceDescriptionView.shadowOffset = CGSizeMake(0,1); 28 | 29 | [sourceDescriptionView setFont:fontDescr]; 30 | sourceDescriptionView.numberOfLines = 3; 31 | [self.contentView addSubview:sourceNameView]; 32 | [self.contentView addSubview:sourceDescriptionView]; 33 | 34 | [self setSource:src]; 35 | } 36 | return self; 37 | } 38 | 39 | - (void)dealloc 40 | { 41 | [source release]; 42 | [sourceDescriptionView release]; 43 | [sourceNameView release]; 44 | 45 | [super dealloc]; 46 | } 47 | 48 | - (ATSource*)source 49 | { 50 | return source; 51 | } 52 | 53 | - (void)setSource:(ATSource*)src 54 | { 55 | [source release]; 56 | source = [src retain]; 57 | 58 | if ([source.name length]) 59 | [sourceNameView setText:source.name]; 60 | else 61 | [sourceNameView setText:NSLocalizedString(source.hasErrors ? @"Invalid Source" : @"New Source", @"")]; 62 | 63 | if ([source.description length]) 64 | [sourceDescriptionView setText:source.description]; 65 | else 66 | [sourceDescriptionView setText:[source.location host]]; 67 | 68 | if (iconView) 69 | { 70 | [iconView removeFromSuperview]; 71 | } 72 | 73 | UIImage * icon = source.icon; 74 | 75 | iconView = [[ATIconView alloc] initWithFrame:CGRectMake(0, 0, 80, 80)]; 76 | 77 | if (!icon) 78 | { 79 | icon = [UIImage imageNamed:@"ATSource.png"]; 80 | if(source.isTrustedSource) 81 | icon = [UIImage imageNamed:@"ATSource_Trusted.png"]; 82 | 83 | //iconView = [[UIImageView alloc] initWithImage:icon]; 84 | [(ATIconView*)iconView setIcon:icon]; 85 | } 86 | else 87 | { 88 | [(ATIconView*)iconView setIcon:icon]; 89 | } 90 | 91 | ((ATIconView*)iconView).hasErrors = [source.hasErrors boolValue]; 92 | 93 | [self.contentView addSubview:iconView]; 94 | 95 | [iconView release]; 96 | } 97 | 98 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 99 | if(selected) 100 | { 101 | [sourceNameView setTextColor:[UIColor whiteColor]]; 102 | [sourceDescriptionView setTextColor:[UIColor colorWithRed:0.85 green:.7 blue:.55 alpha:1]]; 103 | }else 104 | { 105 | [sourceNameView setTextColor:[UIColor blackColor]]; 106 | [sourceDescriptionView setTextColor:[UIColor colorWithRed:0.15 green:.3 blue:.45 alpha:1]]; 107 | } 108 | 109 | [super setSelected:selected animated:animated]; 110 | 111 | // Configure the view for the selected state 112 | } 113 | 114 | 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /Classes/ATSources.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATSources.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 05/07/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATSource.h" 11 | 12 | 13 | @interface ATSources : NSObject { 14 | 15 | } 16 | 17 | - (unsigned int)count; 18 | - (ATSource *)sourceAtIndex:(unsigned int)index; 19 | - (ATSource *)sourceWithLocation:(NSString*)locationString; 20 | - (BOOL)addSourceWithLocation:(NSString *)locationString; 21 | - (BOOL)removeSourceWithLocation:(NSString *)locationString; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Classes/ATSources.m: -------------------------------------------------------------------------------- 1 | // 2 | // ATSources.m 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 05/07/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import "ATSources.h" 10 | #import "ATDatabase.h" 11 | #import "ATResultSet.h" 12 | #import "ATPackageManager.h" 13 | 14 | @implementation ATSources 15 | 16 | - (unsigned int)count { 17 | NSString * query = @"SELECT COUNT(RowID) AS count FROM sources"; 18 | ATResultSet * res = [[ATDatabase sharedDatabase] executeQuery:query]; 19 | 20 | if(res && [res next]) { 21 | unsigned int count = [res intForColumn:@"count"]; 22 | [res close]; 23 | 24 | return count; 25 | } 26 | 27 | [res close]; 28 | 29 | return 0; 30 | } 31 | 32 | - (ATSource *)sourceAtIndex:(unsigned int)index { 33 | NSString * query = [NSString stringWithFormat:@"SELECT RowID FROM sources ORDER BY name ASC, category ASC LIMIT %u,1", index]; 34 | ATResultSet * res = [[ATDatabase sharedDatabase] executeQuery:query]; 35 | 36 | if(res && [res next]) { 37 | ATSource* src = [[[ATSource alloc] initWithID:[res intForColumn:@"RowID"]] autorelease]; 38 | [res close]; 39 | return src; 40 | } 41 | 42 | [res close]; 43 | 44 | return nil; 45 | } 46 | 47 | - (ATSource *)sourceWithLocation:(NSString*)locationString { 48 | ATResultSet * res = [[ATDatabase sharedDatabase] executeQuery:@"SELECT RowID FROM sources WHERE location = ? LIMIT 1", locationString]; 49 | 50 | if(res && [res next]) { 51 | ATSource* src = [[[ATSource alloc] initWithID:[res intForColumn:@"RowID"]] autorelease]; 52 | [res close]; 53 | return src; 54 | } 55 | 56 | [res close]; 57 | 58 | return nil; 59 | } 60 | 61 | - (BOOL)addSourceWithLocation:(NSString *)locationString { 62 | ATSource * source = [self sourceWithLocation:locationString]; 63 | 64 | if(source) return NO; 65 | 66 | source = [[[ATSource alloc] init] autorelease]; 67 | 68 | source.location = [NSURL URLWithString:locationString]; 69 | source.name = @"Untitled Source"; 70 | 71 | [source commit]; 72 | 73 | [[ATPackageManager sharedPackageManager] refreshSource:source]; 74 | 75 | return YES; 76 | } 77 | 78 | - (BOOL)removeSourceWithLocation:(NSString *)locationString { 79 | ATSource * source = [self sourceWithLocation:locationString]; 80 | 81 | if(source != nil) { 82 | [source remove]; 83 | 84 | //[delegate performSelector:@selector(packageManager:didRemoveSource:) withObject:self withObject:source]; 85 | 86 | return YES; 87 | } 88 | 89 | return NO; 90 | } 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /Classes/ATSourcesTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATSourcesTableViewController.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 08/05/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATSource.h" 11 | #import "ATTableViewController.h" 12 | #import "ATSourceInfoController.h" 13 | #import "ATSourceTableViewCell.h" 14 | 15 | 16 | @interface ATSourcesTableViewController : ATTableViewController { 17 | IBOutlet ATSourceInfoController *sourceInfoView; 18 | UIBarButtonItem *refreshAllButton; 19 | UIBarButtonItem *editButton; 20 | UIBarButtonItem *addButton; 21 | UIBarButtonItem *doneButton; 22 | bool editMode; 23 | 24 | } 25 | 26 | // Actions 27 | - (IBAction) refreshAllSources:(id)sender; 28 | - (IBAction) doEdit:(id)sender; 29 | - (IBAction) addSource:(id)sender; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /Classes/ATTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATTableViewController.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 08/05/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface ATTableViewController : UITableViewController { 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/ATTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ATTableViewController.m 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 08/05/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import "ATTableViewController.h" 10 | 11 | 12 | @implementation ATTableViewController 13 | 14 | - (id)initWithCoder:(NSCoder *)decoder { 15 | if(self = [super initWithCoder:decoder]) { 16 | 17 | UITableView *table = self.tableView; 18 | table.rowHeight = 80.0; 19 | [table setBackgroundColor:[UIColor colorWithRed:.68 green:.68 blue:.69 alpha:1]]; 20 | 21 | table.separatorStyle = UITableViewCellSeparatorStyleNone; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 28 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 29 | } 30 | 31 | - (void)didReceiveMemoryWarning { 32 | [super didReceiveMemoryWarning]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Classes/ATTask.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATTask.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/5/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /* An abstract protocol representing a task. Each task belongs to a pipeline. */ 12 | 13 | @protocol ATTask 14 | 15 | - (NSString*)taskID; // task identifier 16 | - (NSString*)taskDescription; // user-readable task description 17 | - (double)taskProgress; // [0.0, 1.0] or -1 for indeterminate progress 18 | - (NSArray*)taskDependencies; // an array of task identifiers that this task depends on. if one of these aborts, this task 19 | // gets aborted too. 20 | 21 | - (void)taskStart; // Launch the task execution 22 | 23 | @optional 24 | - (BOOL)taskCanCancel; 25 | - (void)taskCancel; // This task was cancelled, perform necessary teardowns. 26 | - (NSString*)taskLocalizedObjectName; 27 | - (NSString*)taskLocalizedTitle; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/ATTaskTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATTaskTableViewCell.h 3 | // Installer 4 | // 5 | // Created by DigitalStealth on 21.07.08. 6 | // Copyright 2008 DIGITAL STEALTH DESIGN GROUP. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATInstaller.h" 11 | #import "ATPipeline.h" 12 | #import "ATPipelineManager.h" 13 | #import "ATTableViewCell.h" 14 | 15 | typedef enum { 16 | ATTaskTableCellDownload = 0, 17 | ATTaskTableCellInstall = 1, 18 | ATTaskTableCellRefresh = 2 19 | } ATTaskTableCellTypes; 20 | 21 | 22 | 23 | typedef enum { 24 | // ATTaskTableCellStatusPause = 0, 25 | ATTaskTableCellStatusFail = 1, 26 | ATTaskTableCellStatusActive = 2, 27 | ATTaskTableCellStatusDone = 3, 28 | ATTaskTableCellStatusIdle = 4, 29 | // ATTaskTableCellStatusStopByUser = 5 30 | } ATTaskTableCellStatus; 31 | 32 | 33 | 34 | @interface ATTaskTableViewCell : ATTableViewCell { 35 | UILabel *taskName; 36 | UILabel *taskDescription; 37 | UILabel *taskStatus; 38 | UILabel *taskStatusLabel; 39 | ATTaskTableCellStatus status; 40 | bool isProgressShown; 41 | bool isIndicatorShown; 42 | UIProgressView *progress; 43 | UIActivityIndicatorView *indicator; 44 | UIImageView *iconView; 45 | 46 | } 47 | @property (readonly) ATTaskTableCellStatus status; 48 | 49 | - (void) setType:(ATTaskTableCellTypes)type; 50 | - (void) setTitle:(NSString*)title; 51 | - (void) setDescription:(NSString*)descr; 52 | - (void) setStatus:(ATTaskTableCellStatus)st; 53 | - (void) setShowProgress:(bool)show; 54 | - (void) setProgress:(float)pr; 55 | - (void) _didEndHideIndicatorAnimation:(id)sender; 56 | - (void) _didEndHideProgressAnimation:(id)sender; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Classes/ATTasksTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATTasksTableViewController.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 12/07/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATTableViewController.h" 11 | #import "ATTaskTableViewCell.h" 12 | 13 | 14 | @interface ATTasksTableViewController : ATTableViewController { 15 | NSMutableArray* tasks; 16 | } 17 | 18 | @property (retain) NSMutableArray* tasks; 19 | 20 | - (void)pipelineManagerNotification:(NSNotification*)notification; 21 | @end 22 | -------------------------------------------------------------------------------- /Classes/ATTrustedSourcesRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATTrustedSourcesRefresh.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/30/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "ATTask.h" 12 | #import "ATURLDownload.h" 13 | 14 | @interface ATTrustedSourcesRefresh : NSObject { 15 | ATURLDownload * download; 16 | NSString * tempFileName; 17 | } 18 | 19 | @property (retain) ATURLDownload * download; 20 | @property (retain) NSString * tempFileName; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /Classes/ATURLDownload.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATURLDownload.h 3 | // Installer 4 | // 5 | // Created by Slava Karpenko on 7/10/08. 6 | // Copyright 2008 RiP Dev. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ATURLDownload : NSObject { 13 | //NSURLConnection* connection; 14 | CURL* curl; 15 | NSFileHandle* downloadFile; 16 | NSString* downloadFilePath; 17 | id delegate; 18 | NSURL* url; 19 | BOOL cancel; 20 | NSString* userAgent; 21 | 22 | void* refcon; 23 | } 24 | 25 | @property (retain) NSFileHandle* downloadFile; 26 | @property (retain) NSString* downloadFilePath; 27 | @property (nonatomic, assign) id delegate; 28 | @property (retain) NSURL* url; 29 | @property (assign) BOOL cancel; 30 | @property (assign) void* refcon; 31 | 32 | - (id)initWithRequest:(NSURLRequest *)request delegate:(id)del; 33 | - (id)initWithRequest:(NSURLRequest *)request delegate:(id)del userAgent:(NSString*)agent; 34 | - (id)initWithRequest:(NSURLRequest *)request delegate:(id)del resumeable:(BOOL)resumeable; 35 | - (id)initWithRequest:(NSURLRequest *)request delegate:(id)del resumeable:(BOOL)resumeable userAgent:(NSString*)agent; 36 | 37 | - (void)cancelDownload; // you will be called a download:didFailWithError: when the actual abort is done. 38 | 39 | @end 40 | 41 | @interface NSObject (ATURLDownloadDelegate) 42 | 43 | /*! 44 | @method downloadDidBegin: 45 | @abstract This method is called immediately after the download has started. 46 | @param download The download that just started downloading. 47 | */ 48 | - (void)downloadDidBegin:(ATURLDownload *)download; 49 | 50 | /*! 51 | @method download:didReceiveDataOfLength: 52 | @abstract This method is called when the download has loaded data. 53 | @param download The download that has received data. 54 | @param length The length of the received data. 55 | @discussion This method will be called one or more times. 56 | */ 57 | - (void)download:(ATURLDownload *)download didReceiveDataOfLength:(NSUInteger)length; 58 | 59 | /*! 60 | @method download:didCreateDestination: 61 | @abstract This method is called after the download creates the downloaded file. 62 | @param download The download that created the downloaded file. 63 | @param path The path of the downloaded file. 64 | */ 65 | - (void)download:(ATURLDownload *)download didCreateDestination:(NSString *)path; 66 | 67 | /*! 68 | @method downloadDidFinish: 69 | @abstract This method is called when the download has finished downloading. 70 | @param download The download that has finished downloading. 71 | @discussion This method is called after all the data has been received and written to disk. 72 | This method or download:didFailWithError: will only be called once. 73 | */ 74 | - (void)downloadDidFinish:(ATURLDownload *)download; 75 | 76 | /*! 77 | @method download:didFailWithError: 78 | @abstract This method is called when the download has failed. 79 | @param download The download that ended in error. 80 | @param error The error caused the download to fail. 81 | @discussion This method is called when the download encounters a network or file I/O related error. 82 | This method or downloadDidFinish: will only be called once. 83 | */ 84 | - (void)download:(ATURLDownload *)download didFailWithError:(NSError *)error; 85 | 86 | @end 87 | -------------------------------------------------------------------------------- /Classes/ATUnpacker.h: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | 5 | #import "unzip.h" 6 | #import "NSFileManager+AppTappExtensions.h" 7 | #import "NSDate+AppTappExtensions.h" 8 | #import "NSString+AppTappExtensions.h" 9 | 10 | // Taken from unzip.c 11 | #ifndef UNZ_MAXFILENAMEINZIP 12 | #define UNZ_MAXFILENAMEINZIP (256) 13 | #endif 14 | 15 | #define BUFFER_SIZE 4096 16 | 17 | 18 | @interface ATUnpacker : NSObject { 19 | NSArray * ignoredPaths; 20 | unzFile zipFile; 21 | unz_file_info currentFileInfo; 22 | 23 | NSString * packageID; 24 | } 25 | 26 | @property (retain) NSString * packageID; 27 | 28 | // Factory 29 | - (id)initWithPath:(NSString *)path packageID:(NSString*)pid; 30 | 31 | // Accessors 32 | - (void)setIgnoredPaths:(NSArray *)pathsToIgnore; 33 | - (NSArray *)ignoredPaths; 34 | 35 | // Methods 36 | - (BOOL)copyCompressedPath:(NSString *)source toFileSystemPath:(NSString *)destination; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Classes/ATViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ATViewController.h 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 22/06/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ATPackageManager.h" 11 | #import "ATInstaller.h" 12 | 13 | 14 | @interface ATViewController : UIViewController { 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/ATViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ATViewController.m 3 | // Installer 4 | // 5 | // Created by Maksim Rogov on 22/06/08. 6 | // Copyright 2008 Nullriver, Inc.. All rights reserved. 7 | // 8 | 9 | #import "ATViewController.h" 10 | 11 | 12 | @implementation ATViewController 13 | 14 | - (id)initWithCoder:(NSCoder *)decoder { 15 | if(self = [super initWithCoder:decoder]) { 16 | } 17 | 18 | return self; 19 | } 20 | 21 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 22 | return (interfaceOrientation == UIInterfaceOrientationPortrait); 23 | } 24 | 25 | - (void)didReceiveMemoryWarning { 26 | [super didReceiveMemoryWarning]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Classes/NSDate+AppTappExtensions.h: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | 5 | @interface NSDate (AppTappExtensions) 6 | 7 | + (NSDate *)dateWithDOSDate:(unsigned long int)dosDate; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Classes/NSDate+AppTappExtensions.m: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | #import "NSDate+AppTappExtensions.h" 5 | 6 | 7 | @implementation NSDate (AppTappExtensions) 8 | 9 | + (NSDate *)dateWithDOSDate:(unsigned long int)dosDate { 10 | int gmtDiff = [[NSTimeZone systemTimeZone] secondsFromGMT]; 11 | NSString * timeZone = [NSString stringWithFormat:@"%@%04i",(gmtDiff<0)?@"-":@"+", gmtDiff]; 12 | 13 | // YYYY-MM-DD HH:MM:SS 14 | NSString * dateString = [NSString stringWithFormat:@"%4i-%02i-%02i %02i:%02i:%02i %@", 15 | (((dosDate>>25)&0x7F)+1980), // year 16 | ((dosDate>>21)&0xF), // month 17 | ((dosDate>>16)&0x1F), // day 18 | ((dosDate>>11)&0x1F), // hour 19 | ((dosDate>>5)&0x3F), // minutes 20 | ((dosDate)&0x1F), // seconds 21 | timeZone]; // time zone (local) 22 | 23 | return [NSDate performSelector:@selector(dateWithString:) withObject:dateString]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /Classes/NSFileManager+AppTappExtensions.h: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | 5 | #import "md5.h" 6 | 7 | @interface NSFileManager (AppTappExtensions) 8 | 9 | - (NSString *)fileHashAtPath:(NSString *)aPath; 10 | - (BOOL)createPath:(NSString *)aPath handler:(id)handler; 11 | - (BOOL)copyPath:(NSString *)source toPath:(NSString *)destination handler:(id)handler; 12 | - (NSNumber *)freeSpaceAtPath:(NSString *)aPath; 13 | 14 | - (NSString*)tempFilePath; 15 | @end 16 | -------------------------------------------------------------------------------- /Classes/NSNumber+AppTappExtensions.h: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | 5 | @interface NSNumber (AppTappExtensions) 6 | 7 | - (NSString *)byteSizeDescription; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /Classes/NSNumber+AppTappExtensions.m: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | #import "NSNumber+AppTappExtensions.h" 5 | 6 | 7 | @implementation NSNumber (AppTappExtensions) 8 | 9 | - (NSString *)byteSizeDescription { 10 | double dBytes = [self doubleValue]; 11 | 12 | if(dBytes == 0) { 13 | return @"0 bytes"; 14 | } else if(dBytes <= pow(2, 10)) { 15 | return [NSString stringWithFormat:@"%0.0f bytes", dBytes]; 16 | } else if(dBytes <= pow(2, 20)) { 17 | return [NSString stringWithFormat:@"%0.1f KB", dBytes / pow(1024, 1)]; 18 | } else if(dBytes <= pow(2, 30)) { 19 | return [NSString stringWithFormat:@"%0.1f MB", dBytes / pow(1024, 2)]; 20 | } else if(dBytes <= pow(2, 40)) { 21 | return [NSString stringWithFormat:@"%0.1f GB", dBytes / pow(1024, 3)]; 22 | } else { 23 | return [NSString stringWithFormat:@"%0.1f TB", dBytes / pow(1024, 4)]; 24 | } 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Classes/NSString+AppTappExtensions.h: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | 5 | #import "ATPlatform.h" 6 | 7 | @interface NSString (AppTappExtensions) 8 | 9 | - (NSString *)stringByRemovingPathPrefix:(NSString *)pathPrefix; 10 | - (BOOL)isContainedInPath:(NSString *)aPath; 11 | - (NSString *)stringByExpandingSpecialPathsInPath; 12 | - (NSString*)sqliteEscapedString; 13 | 14 | - (unsigned long long)versionNumber; 15 | 16 | - (NSString *)MD5Hash; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Classes/NSURL+AppTappExtensions.h: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | 5 | @interface NSURL (AppTappExtensions) 6 | 7 | - (BOOL)isEqualToURL:(NSURL *)aURL; 8 | - (NSString *)comparableStringValue; 9 | - (NSURL *)URLWithInstallerParameters; 10 | 11 | - (NSString*)tempDownloadFileName; 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Classes/NSURL+AppTappExtensions.m: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | #import "NSURL+AppTappExtensions.h" 5 | #import "NSString+AppTappExtensions.h" 6 | #import "ATPlatform.h" 7 | 8 | @implementation NSURL (AppTappExtensions) 9 | 10 | - (BOOL)isEqualToURL:(NSURL *)aURL { 11 | if([[self comparableStringValue] isEqualToString:[aURL comparableStringValue]]) return YES; 12 | else return NO; 13 | } 14 | 15 | - (NSString *)comparableStringValue { 16 | return [[[self standardizedURL] absoluteString] stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"/"]]; 17 | } 18 | 19 | - (NSURL *)URLWithInstallerParameters { 20 | if (![[self standardizedURL] absoluteString]) 21 | return nil; 22 | 23 | NSMutableString* newURLString = [NSMutableString stringWithString:[[self standardizedURL] absoluteString]]; 24 | 25 | if (![self query] || ![[self query] length]) 26 | { 27 | [newURLString appendString:@"?"]; 28 | } 29 | 30 | NSMutableDictionary* installerParams = [NSMutableDictionary dictionaryWithCapacity:0]; 31 | 32 | NSString* objectString = [ATPlatform deviceUUID]; 33 | if (objectString != nil) 34 | [installerParams setObject:objectString forKey:@"deviceUUID"]; 35 | 36 | objectString = [ATPlatform platformName]; 37 | if (objectString != nil) 38 | [installerParams setObject:objectString forKey:@"platform"]; 39 | 40 | objectString = [ATPlatform firmwareVersion]; 41 | if (objectString != nil) 42 | [installerParams setObject:objectString forKey:@"firmwareVersion"]; 43 | 44 | [installerParams setObject:__INSTALLER_VERSION__ forKey:@"installerVersion"]; 45 | 46 | NSArray* languages = [NSLocale preferredLanguages]; 47 | 48 | if (languages && [languages count]) 49 | [installerParams setObject:[languages objectAtIndex:0] forKey:@"locale"]; 50 | 51 | for (NSString* key in installerParams) 52 | { 53 | [newURLString appendFormat:@"&%@=%@", [key stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], [[installerParams objectForKey:key] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; 54 | } 55 | 56 | //Log(@"url = %@", newURLString); 57 | 58 | return [NSURL URLWithString:newURLString]; 59 | } 60 | 61 | - (NSString*)tempDownloadFileName 62 | { 63 | NSString* hash = [[self absoluteString] MD5Hash]; 64 | NSString* path = [NSString stringWithFormat:@"%@#%.0f", hash, [[NSDate date] timeIntervalSinceReferenceDate]]; 65 | 66 | //Log(@"temp name for %@: %@", self, path); 67 | return path; 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Classes/NSURLRequest+AppTappExtensions.h: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | 5 | @interface NSURLRequest (AppTappExtensions) 6 | @end 7 | -------------------------------------------------------------------------------- /Classes/NSURLRequest+AppTappExtensions.m: -------------------------------------------------------------------------------- 1 | // AppTapp Framework 2 | // Copyright 2007 Nullriver, Inc. 3 | 4 | #import "NSURLRequest+AppTappExtensions.h" 5 | #import "ATPlatform.h" 6 | 7 | @implementation NSURLRequest (AppTappExtensions) 8 | 9 | + (id)requestWithURL:(NSURL *)aURL { 10 | NSMutableURLRequest * request = [NSMutableURLRequest requestWithURL:aURL cachePolicy:/*NSURLRequestReloadIgnoringCacheData*/NSURLRequestUseProtocolCachePolicy timeoutInterval:30.0]; 11 | [request setValue:__USER_AGENT__ forHTTPHeaderField:@"User-Agent"]; 12 | [request setValue:[ATPlatform deviceUUID] forHTTPHeaderField:@"X-Device-UUID"]; 13 | 14 | return request; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Classes/Scythe.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Scythe.c 3 | * Installer 4 | * 5 | * Created by Slava Karpenko on 7/24/08. 6 | * Copyright 2008 RiP Dev. All rights reserved. 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | int main(int argc, char * argv[]) 15 | { 16 | char fullpath[1024]; 17 | 18 | strncpy(fullpath, argv[0], strlen(argv[0]) - strlen("Scythe")); 19 | strcat(fullpath, "Installer"); 20 | 21 | char* newArgv[] = { fullpath, NULL }; 22 | 23 | return execve(fullpath, newArgv, NULL); 24 | } -------------------------------------------------------------------------------- /Classes/ioapi.h: -------------------------------------------------------------------------------- 1 | /* ioapi.h -- IO base function header for compress/uncompress .zip 2 | files using zlib + zip or unzip API 3 | 4 | Version 1.01e, February 12th, 2005 5 | 6 | Copyright (C) 1998-2005 Gilles Vollant 7 | */ 8 | 9 | #ifndef _ZLIBIOAPI_H 10 | #define _ZLIBIOAPI_H 11 | 12 | 13 | #define ZLIB_FILEFUNC_SEEK_CUR (1) 14 | #define ZLIB_FILEFUNC_SEEK_END (2) 15 | #define ZLIB_FILEFUNC_SEEK_SET (0) 16 | 17 | #define ZLIB_FILEFUNC_MODE_READ (1) 18 | #define ZLIB_FILEFUNC_MODE_WRITE (2) 19 | #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) 20 | 21 | #define ZLIB_FILEFUNC_MODE_EXISTING (4) 22 | #define ZLIB_FILEFUNC_MODE_CREATE (8) 23 | 24 | 25 | #ifndef ZCALLBACK 26 | 27 | #if (defined(WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) 28 | #define ZCALLBACK CALLBACK 29 | #else 30 | #define ZCALLBACK 31 | #endif 32 | #endif 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); 39 | typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); 40 | typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); 41 | typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); 42 | typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); 43 | typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); 44 | typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); 45 | 46 | typedef struct zlib_filefunc_def_s 47 | { 48 | open_file_func zopen_file; 49 | read_file_func zread_file; 50 | write_file_func zwrite_file; 51 | tell_file_func ztell_file; 52 | seek_file_func zseek_file; 53 | close_file_func zclose_file; 54 | testerror_file_func zerror_file; 55 | voidpf opaque; 56 | } zlib_filefunc_def; 57 | 58 | 59 | 60 | void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 61 | 62 | #define ZREAD(filefunc,filestream,buf,size) ((*((filefunc).zread_file))((filefunc).opaque,filestream,buf,size)) 63 | #define ZWRITE(filefunc,filestream,buf,size) ((*((filefunc).zwrite_file))((filefunc).opaque,filestream,buf,size)) 64 | #define ZTELL(filefunc,filestream) ((*((filefunc).ztell_file))((filefunc).opaque,filestream)) 65 | #define ZSEEK(filefunc,filestream,pos,mode) ((*((filefunc).zseek_file))((filefunc).opaque,filestream,pos,mode)) 66 | #define ZCLOSE(filefunc,filestream) ((*((filefunc).zclose_file))((filefunc).opaque,filestream)) 67 | #define ZERROR(filefunc,filestream) ((*((filefunc).zerror_file))((filefunc).opaque,filestream)) 68 | 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | 76 | -------------------------------------------------------------------------------- /Classes/kali-key.h: -------------------------------------------------------------------------------- 1 | // just key. let's say 32 will be enough.. oops, no GOST here, so say 20. 2 | // very random sequence of key obtained from /etc/random :) 3 | // 4 | // 32 -> 7EC76281162D1A9780A25A0EC8754466014A877C0E631B8DEC9100168B364D1E 5 | // 6 | 7 | // note: GOST is back. recompile of kali needed 8 | 9 | #ifndef _KALI_KEY_H 10 | #define _KALI_KEY_H 11 | 12 | #define kaliS_KEY "\x7E\xC7\x62\x81\x16\x2D\x1A\x97\x80\xA2\x5A\x0E\xC8\x75\x44\x66" \ 13 | "\x01\x4A\x87\x7C\x0E\x63\x1B\x8D\xEC\x91\x00\x16\x8B\x36\x4D\x1E" 14 | 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Classes/md5.h: -------------------------------------------------------------------------------- 1 | /* MD5.H - header file for MD5C.C 2 | */ 3 | 4 | /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All 5 | rights reserved. 6 | 7 | License to copy and use this software is granted provided that it 8 | is identified as the "RSA Data Security, Inc. MD5 Message-Digest 9 | Algorithm" in all material mentioning or referencing this software 10 | or this function. 11 | 12 | License is also granted to make and use derivative works provided 13 | that such works are identified as "derived from the RSA Data 14 | Security, Inc. MD5 Message-Digest Algorithm" in all material 15 | mentioning or referencing the derived work. 16 | 17 | RSA Data Security, Inc. makes no representations concerning either 18 | the merchantability of this software or the suitability of this 19 | software for any particular purpose. It is provided "as is" 20 | without express or implied warranty of any kind. 21 | 22 | These notices must be retained in any copies of any part of this 23 | documentation and/or software. 24 | */ 25 | 26 | #include "md5global.h" 27 | 28 | /* MD5 context. */ 29 | typedef struct { 30 | UINT4 state[4]; /* state (ABCD) */ 31 | UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ 32 | unsigned char buffer[64]; /* input buffer */ 33 | } MD5_CTX; 34 | 35 | void MD5Init PROTO_LIST ((MD5_CTX *)); 36 | void MD5Update PROTO_LIST 37 | ((MD5_CTX *, unsigned char *, unsigned int)); 38 | void MD5Final PROTO_LIST ((unsigned char [16], MD5_CTX *)); -------------------------------------------------------------------------------- /Classes/md5global.h: -------------------------------------------------------------------------------- 1 | /* GLOBAL.H - RSAREF types and constants 2 | */ 3 | 4 | /* PROTOTYPES should be set to one if and only if the compiler supports 5 | function argument prototyping. 6 | The following makes PROTOTYPES default to 0 if it has not already 7 | been defined with C compiler flags. 8 | */ 9 | #ifndef PROTOTYPES 10 | #define PROTOTYPES 0 11 | #endif 12 | 13 | /* POINTER defines a generic pointer type */ 14 | typedef unsigned char *POINTER; 15 | 16 | /* UINT2 defines a two byte word */ 17 | typedef unsigned short int UINT2; 18 | 19 | /* UINT4 defines a four byte word */ 20 | typedef unsigned long int UINT4; 21 | 22 | /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. 23 | If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it 24 | returns an empty list. 25 | */ 26 | #if PROTOTYPES 27 | #define PROTO_LIST(list) list 28 | #else 29 | #define PROTO_LIST(list) () 30 | #endif -------------------------------------------------------------------------------- /Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/Default.png -------------------------------------------------------------------------------- /English.lproj/CategoryMapping.strings: -------------------------------------------------------------------------------- 1 | "CarrierBundle" = "Carrier Bundles"; 2 | "Themes (SpringBoard)" = "Themes"; 3 | "Themes (WinterBoard)" = "Themes"; 4 | "Themes-SpringBoard" = "Themes"; 5 | "Themes-System" = "Themes (System)"; 6 | 7 | /* Common categories (no real use for English, but good to be localized) */ 8 | "Maps" = "Maps"; 9 | "Fun" = "Fun"; 10 | "Power Management" = "Power Management"; 11 | "Utilities" = "Utilities"; 12 | "Network" = "Network"; 13 | "System" = "System"; 14 | "Multimedia" = "Multimedia"; 15 | "Games" = "Games"; 16 | "Beta" = "Beta"; 17 | "Messaging" = "Messaging"; 18 | "Toys" = "Toys"; 19 | "Themes-SpringBoard" = "Themes"; 20 | "Themes-Apps" = "Themes (Apps)"; 21 | "Productivity" = "Productivity"; 22 | "eBooks" = "eBooks"; 23 | "Mods" = "Mods"; 24 | "Localization" = "Localization"; 25 | "Networking" = "Network"; 26 | "Tweaks" = "Tweaks"; 27 | "Applications" = "Applications"; 28 | "Customization" = "Customization"; 29 | "Webclips" = "Webclips"; 30 | "Themes-Complete" = "Themes"; 31 | "Wallpapers" = "Wallpapers"; 32 | "Themes-Misc" = "Themes (Misc)"; 33 | "Sources" = "Sources"; 34 | "App Addons" = "App Addons"; 35 | "Entertainment" = "Entertainment"; 36 | "Health and Fitness" = "Health and Fitness"; 37 | "Ringtones" = "Ringtones"; 38 | "Pictures" = "Pictures"; 39 | "Sport" = "Sport"; 40 | "Themes (Apps)" = "Themes (Apps)"; 41 | "Themes (Battery)" = "Themes (Battery)"; 42 | "Themes (Complete)" = "Themes"; 43 | "Themes (Keyboard)" = "Themes (Keyboard)"; 44 | "Themes (Lockscreen)" = "Themes (Lockscreen)"; 45 | "Themes (SBSettings)" = "Themes (SBSettings)"; 46 | "Themes (Sounds)" = "Themes (Sounds)"; 47 | "Themes (System)" = "Themes (System)"; 48 | "Themes (Videos)" = "Themes (Videos)"; 49 | "Wallpaper" = "Wallpapers"; 50 | "Widgets" = "Widgets"; 51 | "Terminal_Support" = "Terminal Support"; 52 | "Text_Editors" = "Text Editors"; 53 | "Data_Storage" = "Data Storage"; 54 | -------------------------------------------------------------------------------- /English.lproj/Errors.strings: -------------------------------------------------------------------------------- 1 | 1 = "Required dependency (%@) was not found."; 2 | 2 = "Decoding of the information for the package %@ failed."; 3 | 3 = "File hash does not match the downloaded file for package %@. Try again, or refresh the source - the file may have changed."; 4 | 4 = "File size does not match the downloaded file for package %@. Try again, or refresh the source - the file may have changed."; 5 | 5 = "Script Error"; 6 | 6 = "Package is not installed."; 7 | 7 = "Cannot receive information about trusted sources from Ripdev. Please try again later."; 8 | 8 = "Package not found."; 9 | 9 = "This package requires a device with an unlocked system disk, also known as \"jailbroken\". Since your system partition is secure, it cannot be installed. Sorry."; 10 | -------------------------------------------------------------------------------- /English.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "__ALL_PACKAGES__" = "All Packages"; 2 | "__INSTALLED_PACKAGES__" = "Installed Packages"; 3 | "__RECENT_PACKAGES__" = "Recent Packages"; 4 | "__UPDATED_PACKAGES__" = "Updated Packages"; 5 | 6 | "%u package" = "%u package"; 7 | "%u total packages" = "%u total packages"; 8 | "An Installer update is available. Would you like to update it now? It is strongly recommended you stay up-to-date with the latest version." = "An Installer update is available. Would you like to update it now? It is strongly recommended you stay up-to-date with the latest version."; 9 | "Cancel" = "Cancel"; 10 | "Cannot install package \"%@\" as it was not found. Sorry!" = "Cannot install package \"%@\" as it was not found. Sorry!"; 11 | "Checking %@" = "Checking %@"; 12 | "Contact" = "Contact"; 13 | "Downloading %@" = "Downloading %@"; 14 | "Error" = "Error"; 15 | "Featured" = "Featured"; 16 | "Fetching icon for %@..." = "Fetching icon for %@…"; 17 | "Fetching info for %@..." = "Fetching info for %@…"; 18 | "Getting rating for \"%@\"..." = "Getting rating for \"%@\"…"; 19 | "Install" = "Install"; 20 | "Installer Update Available" = "Installer Update Available"; 21 | "Installer was not installed correctly. It should be run as root:wheel. We will continue but please remember that it may not function correctly." = "Installer was not installed correctly. It should be run as root:wheel. We will continue but please remember that it may not function correctly."; 22 | "Installing %@" = "Installing %@"; 23 | "Insufficient Permissions" = "Insufficient Permissions"; 24 | "Invalid Source" = "Invalid Source"; 25 | "New Source" = "New Source"; 26 | "Notice" = "Notice"; 27 | "OK" = "OK"; 28 | "Please input the valid source URL above to add the source." = "Please input the valid source URL above to add the source."; 29 | "Post-flight for %@" = "Post-flight for %@"; 30 | "Pre-flight for %@" = "Pre-flight for %@"; 31 | "Preparing %@" = "Preparing %@"; 32 | "Proceed" = "Proceed"; 33 | "Processing" = "Processing"; 34 | "Processing index..." = "Processing index…"; 35 | "Processing packages..." = "Processing packages…"; 36 | "Queueing package install..." = "Queueing package install…"; 37 | "Refreshing" = "Refreshing"; 38 | "Refreshing %@..." = "Refreshing %@…"; 39 | "Refreshing trusted sources" = "Refreshing trusted sources"; 40 | "Searching" = "Searching"; 41 | "Searching for \"%@\"..." = "Searching for \"%@\"…"; 42 | "Status:" = "Status:"; 43 | "Source" = "Source"; 44 | "The package \"%@\" comes from a source that is not yet added to Installer. If you Proceed, the source \"%@\" will be first added to your sources list, and then the package will be installed as normal." = "The package \"%1$@\" comes from a source that is not yet added to Installer. If you Proceed, the source \"%2$@\" will be first added to your sources list, and then the package will be installed as normal."; 45 | "There were errors while trying to refresh this source. Please double-check the URL and try refreshing again." = "There were errors while trying to refresh this source. Please double-check the URL and try refreshing again."; 46 | "Uninstall" = "Uninstall"; 47 | "Update" = "Update"; 48 | "Update All" = "Update All"; 49 | "Updated" = "Updated"; 50 | "Waiting on %@..." = "Waiting on %@…"; 51 | 52 | /* Task statuses */ 53 | "Idle" = "Idle"; 54 | "Active" = "Active"; 55 | "Done" = "Done"; 56 | "Failed" = "Failed"; 57 | 58 | /* Recent Packages */ 59 | "Today" = "Today"; 60 | "Yesterday" = "Yesterday"; 61 | "Older" = "Older"; 62 | -------------------------------------------------------------------------------- /GUIImages/ATCAT_Installed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATCAT_Installed.png -------------------------------------------------------------------------------- /GUIImages/ATCAT_Other.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATCAT_Other.png -------------------------------------------------------------------------------- /GUIImages/ATCAT_Updated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATCAT_Updated.png -------------------------------------------------------------------------------- /GUIImages/ATCatBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATCatBackground.png -------------------------------------------------------------------------------- /GUIImages/ATIconBackShadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATIconBackShadow.png -------------------------------------------------------------------------------- /GUIImages/ATInfoBackTop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATInfoBackTop.png -------------------------------------------------------------------------------- /GUIImages/ATMailIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATMailIcon.png -------------------------------------------------------------------------------- /GUIImages/ATNewIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATNewIcon.png -------------------------------------------------------------------------------- /GUIImages/ATPCBackShadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATPCBackShadow.png -------------------------------------------------------------------------------- /GUIImages/ATPack_Package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATPack_Package.png -------------------------------------------------------------------------------- /GUIImages/ATRatingBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingBackground.png -------------------------------------------------------------------------------- /GUIImages/ATRatingMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingMask.png -------------------------------------------------------------------------------- /GUIImages/ATRatingMyStars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingMyStars.png -------------------------------------------------------------------------------- /GUIImages/ATRatingPopup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingPopup.png -------------------------------------------------------------------------------- /GUIImages/ATRatingPopup1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingPopup1.png -------------------------------------------------------------------------------- /GUIImages/ATRatingPopup2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingPopup2.png -------------------------------------------------------------------------------- /GUIImages/ATRatingPopup3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingPopup3.png -------------------------------------------------------------------------------- /GUIImages/ATRatingPopup4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingPopup4.png -------------------------------------------------------------------------------- /GUIImages/ATRatingPopup5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingPopup5.png -------------------------------------------------------------------------------- /GUIImages/ATRatingUserStars.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATRatingUserStars.png -------------------------------------------------------------------------------- /GUIImages/ATSeparator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATSeparator.png -------------------------------------------------------------------------------- /GUIImages/ATSource.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATSource.png -------------------------------------------------------------------------------- /GUIImages/ATSource_Trusted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATSource_Trusted.png -------------------------------------------------------------------------------- /GUIImages/ATStopIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATStopIcon.png -------------------------------------------------------------------------------- /GUIImages/ATTask_Download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATTask_Download.png -------------------------------------------------------------------------------- /GUIImages/ATTask_Refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATTask_Refresh.png -------------------------------------------------------------------------------- /GUIImages/ATTrustedIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATTrustedIcon.png -------------------------------------------------------------------------------- /GUIImages/ATWhiteBack1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATWhiteBack1.png -------------------------------------------------------------------------------- /GUIImages/ATWhiteBack2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATWhiteBack2.png -------------------------------------------------------------------------------- /GUIImages/ATWhiteBack3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/ATWhiteBack3.png -------------------------------------------------------------------------------- /GUIImages/IconClipingMask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/IconClipingMask.png -------------------------------------------------------------------------------- /GUIImages/IconMirror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/IconMirror.png -------------------------------------------------------------------------------- /GUIImages/SampleIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/SampleIcon.png -------------------------------------------------------------------------------- /GUIImages/SourceMirror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/SourceMirror.png -------------------------------------------------------------------------------- /GUIImages/SourceTrustedMirror.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/GUIImages/SourceTrustedMirror.png -------------------------------------------------------------------------------- /German.lproj/CategoryMapping.strings: -------------------------------------------------------------------------------- 1 | "CarrierBundle" = "Carrier Bundles"; 2 | "Themes (SpringBoard)" = "Themes"; 3 | "Themes (WinterBoard)" = "Themes"; 4 | "Themes-SpringBoard" = "Themes"; 5 | "Themes-System" = "Themes (System)"; 6 | 7 | /* Common categories (no real use for English, but good to be localized) */ 8 | "Maps" = "Karten"; 9 | "Fun" = "Spaß"; 10 | "Power Management" = "Power Management"; 11 | "Utilities" = "Utilities"; 12 | "Network" = "Netzwerk"; 13 | "System" = "System"; 14 | "Multimedia" = "Multimedia"; 15 | "Games" = "Spiele"; 16 | "Beta" = "Beta"; 17 | "Messaging" = "Messaging"; 18 | "Toys" = "Toys"; 19 | "Themes-SpringBoard" = "Themes"; 20 | "Themes-Apps" = "Themes (Apps)"; 21 | "Productivity" = "Produktivität"; 22 | "eBooks" = "eBooks"; 23 | "Mods" = "Mods"; 24 | "Localization" = "Lokalisationen"; 25 | "Networking" = "Netzwerk"; 26 | "Tweaks" = "Tweaks"; 27 | "Applications" = "Programme"; 28 | "Customization" = "Customization"; 29 | "Webclips" = "Webclips"; 30 | "Themes-Complete" = "Themes"; 31 | "Wallpapers" = "Hintergrundbilder"; 32 | "Themes-Misc" = "Themes (Misc)"; 33 | "Sources" = "Quellen"; 34 | "App Addons" = "App Addons"; 35 | "Entertainment" = "Entertainment"; 36 | "Health and Fitness" = "Gesundheit und Fitness"; 37 | "Ringtones" = "Klingeltöne"; 38 | "Pictures" = "Bilder"; 39 | "Sport" = "Sport"; 40 | "Themes (Apps)" = "Themes (Apps)"; 41 | "Themes (Battery)" = "Themes (Battery)"; 42 | "Themes (Complete)" = "Themes"; 43 | "Themes (Keyboard)" = "Themes (Keyboard)"; 44 | "Themes (Lockscreen)" = "Themes (Lockscreen)"; 45 | "Themes (SBSettings)" = "Themes (SBSettings)"; 46 | "Themes (Sounds)" = "Themes (Sounds)"; 47 | "Themes (System)" = "Themes (System)"; 48 | "Themes (Videos)" = "Themes (Videos)"; 49 | "Wallpaper" = "Hintergrundbilder"; 50 | "Widgets" = "Widgets"; 51 | -------------------------------------------------------------------------------- /German.lproj/Errors.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/German.lproj/Errors.strings -------------------------------------------------------------------------------- /German.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "__ALL_PACKAGES__" = "Alle Pakete"; 2 | "__INSTALLED_PACKAGES__" = "Installierte Pakete"; 3 | "__RECENT_PACKAGES__" = "Aktuelle Pakete"; 4 | "__UPDATED_PACKAGES__" = "Paketupdates"; 5 | 6 | "%u package" = "%u Pakete"; 7 | "%u total packages" = "%u Pakete"; 8 | "An Installer update is available. Would you like to update it now? It is strongly recommended you stay up-to-date with the latest version." = "Ein Installer Update ist Verfügbar. Soll es jetzt installiert werden? Es wird dringend empfohlen, bleiben Sie immer auf der aktuellsten Version."; 9 | "Cancel" = "Abbrechen"; 10 | "Cannot install package \"%@\" as it was not found. Sorry!" = "Das Paket \"%@\" konnte nicht installiert werden, da es nicht gefunden wurde! Sorry!"; 11 | "Checking %@" = "Prüfe %@"; 12 | "Contact" = "Kontakt"; 13 | "Downloading %@" = "Lade %@"; 14 | "Error" = "Fehler"; 15 | "Featured" = "Empfohlen"; 16 | "Fetching icon for %@..." = "Lade Icon für %@…"; 17 | "Fetching info for %@..." = "Lade Info für %@…"; 18 | "Getting rating for \"%@\"..." = "Lade Bewertung für \"%@\"…"; 19 | "Install" = "Installieren"; 20 | "Installer Update Available" = "Installer Update verfügbar"; 21 | "Installer was not installed correctly. It should be run as root:wheel. We will continue but please remember that it may not function correctly." = "Der Installer ist nicht korrekt installiert! Er sollte unter root:wheel ausgeführt werden. Er wird weiterhin ausgeführt, könnte aber möglichweise nicht korrekt funktionieren."; 22 | "Installing %@" = "Installiere %@"; 23 | "Insufficient Permissions" = "Unzureichende Berechtigungen"; 24 | "Invalid Source" = "Ungültige Quelle"; 25 | "New Source" = "Neue Quelle"; 26 | "Notice" = "Hinweis"; 27 | "OK" = "OK"; 28 | "Please input the valid source URL above to add the source." = "Bitte geben Sie oben eine gültige URL ein, um eine Quelle hinzuzufügen."; 29 | "Post-flight for %@" = "Post-Installation für %@"; 30 | "Pre-flight for %@" = "Pre-Installation für %@"; 31 | "Preparing %@" = "Vorbereite %@"; 32 | "Proceed" = "Bearbeite"; 33 | "Processing" = "Bearbeite"; 34 | "Processing index..." = "Bearbeite Index…"; 35 | "Processing packages..." = "Bearbeite Paket…"; 36 | "Queueing package install..." = "Paketinstallation wartend…"; 37 | "Refreshing" = "Aktualisieren"; 38 | "Refreshing %@..." = "Aktualisiere %@…"; 39 | "Refreshing trusted sources" = "Aktualisiere vertrauenswürdige Quellen"; 40 | "Searching" = "Suche"; 41 | "Searching for \"%@\"..." = "Suche nach \"%@\"…"; 42 | "Status:" = "Status:"; 43 | "Source" = "Quelle"; 44 | "The package \"%@\" comes from a source that is not yet added to Installer. If you Proceed, the source \"%@\" will be first added to your sources list, and then the package will be installed as normal." = "Das Paket \"%1$@\" kommt aus einer noch nicht eingebundenen Quelle (%2$@). Wenn Sie das Paket installieren möchten, wird erst die Quelle eingebunden und erst dann wird das Paket installiert."; 45 | "There were errors while trying to refresh this source. Please double-check the URL and try refreshing again." = "Beim aktualisieren der Quellen sind Fehler aufgetreten. Bitte überprüfen Sie die URL und versuchen Sie es erneut."; 46 | "Uninstall" = "Deinstallieren"; 47 | "Update" = "Updaten"; 48 | "Update All" = "Alle Updaten"; 49 | "Updated" = "Aktualisiert"; 50 | "Waiting on %@..." = "Warte auf %@…"; 51 | 52 | /* Task statuses */ 53 | "Idle" = "Wartend"; 54 | "Active" = "Aktiv"; 55 | "Done" = "Fertig"; 56 | "Failed" = "Fehlgeschlagen"; 57 | 58 | /* Recent Packages */ 59 | "Today" = "Heute"; 60 | "Yesterday" = "Gestern"; 61 | "Older" = "Älter"; 62 | -------------------------------------------------------------------------------- /Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | Scythe 11 | CFBundleIconFile 12 | Installer.png 13 | CFBundleIdentifier 14 | com.ripdev.install 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 4.1.2 25 | NSMainNibFile 26 | MainWindow 27 | UIPrerenderedIcon 28 | 29 | CFBundleURLTypes 30 | 31 | 32 | CFBundleURLName 33 | com.ripdev.install 34 | CFBundleTypeRole 35 | Editor 36 | CFBundleURLSchemes 37 | 38 | install 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /Install-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.ripdev.install.framework 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | FMWK 15 | CFBundleSignature 16 | ???? 17 | CFBundleVersion 18 | 4.1.2 19 | 20 | 21 | -------------------------------------------------------------------------------- /Installer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/Installer.png -------------------------------------------------------------------------------- /InstallerPrefs.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | label 11 | General 12 | 13 | 14 | cell 15 | PSSwitchCell 16 | default 17 | 18 | defaults 19 | com.ripdev.install 20 | get 21 | get: 22 | key 23 | FetchIcons 24 | label 25 | Fetch Package Icons 26 | set 27 | set:specifier: 28 | 29 | 30 | cell 31 | PSGroupCell 32 | label 33 | Advanced 34 | 35 | 36 | cell 37 | PSSwitchCell 38 | default 39 | 40 | defaults 41 | com.ripdev.install 42 | get 43 | get: 44 | key 45 | ShowPackageID 46 | label 47 | Display Package IDs 48 | set 49 | set:specifier: 50 | 51 | 52 | title 53 | Installer 54 | 55 | 56 | -------------------------------------------------------------------------------- /InstallerPrefs_Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrincipalClass 6 | InstallerPrefsController 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleDisplayName 10 | Installer 11 | CFBundleExecutable 12 | HoodPrefs 13 | CFBundleIconFile 14 | 15 | CFBundleIdentifier 16 | com.ripdev.install.preferences 17 | CFBundleInfoDictionaryVersion 18 | 6.0 19 | CFBundleName 20 | ${PRODUCT_NAME} 21 | CFBundlePackageType 22 | APPL 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 4.0 27 | LSRequiresIPhoneOS 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/Package.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Installer 4 2 | 3 | Installer 4, a package manager for iPhoneOS 2 4 | 5 | Original Source Code for Installer 4, with a few files removed due to legal reasons. 6 | 7 | ### What is this? 8 | 9 | When we open sourced Installer 3, a lot of people wanted to know about Installer 4 too. 10 | After a decade, we are glad to be able to open source Installer 4. 11 | 12 | Installer 4 was one of the two package managers for iPhoneOS 2 developed by Ripdev & Nullriver Software (company). It uses the AppTapp framework for managing packages. 13 | 14 | ### What is included? 15 | 16 | Installer source code and Translation strings. 17 | 18 | ### What is missing? 19 | 20 | There are some files (9) which were removed for legal reasons. We cannot open source them. If you want to get a feel for what they did feel free to ask us or decompile a executable =) 21 | 22 | ### Building 23 | 24 | Installer 4 is an Xcode project. It builds on Xcode 3.2 with iPhone 2.0 SDK and later. You will have to modify the project settings for it to build on recent xcode versions. A separate version of Installer 4 which was edited to work on recent versions along with other changes will also be open sourced soon. 25 | 26 | 27 | ### Credit 28 | 29 | Ripdev 30 | 31 | Nullriver Software 32 | 33 | ### Translations 34 | 35 | English 36 | 37 | Russian 38 | 39 | French 40 | 41 | ### Future Development 42 | 43 | Installer 4 is being further developed by AppTapp & members of the Legacy Jailbreak community for iPhone OS 2. See /r/LegacyJailbreak & https://discord.gg/4qec5AV 44 | 45 | 46 | ### License 47 | 48 | The Installer 4 source code is being released under the MIT license. See the LICENSE file for more information. 49 | 50 | ###### Copyright Ripdev 2008-2009 51 | ###### Copyright Nullriver Software 2007-2008 52 | ###### Copyright AppTapp 2008-2009 53 | -------------------------------------------------------------------------------- /Repository/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | info 5 | 6 | name 7 | My Great Repository 8 | maintainer 9 | John Doe 10 | contact 11 | jdoe@email.com 12 | url 13 | http://mygreatsite.com 14 | category 15 | Fun 16 | description 17 | This is my great repository for Installer 4. Woo hoo! 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Repository/config.inc.default.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Repository/index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Repository/instructions.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | Installer 4.0 Repository 8 | 25 | 26 | 27 | 28 |
 
29 |
30 |
31 |

Вы попали на эту страницу, несмотря на то, что она на самом деле является repository для Installer.app. Это значит, что если Вы добавите адрес в Ваш Installer.app, вам будут доступны многие интересные программы. Вот как это сделать:

32 |
    33 |
  • Запустите Installer.app и перейдите на вкладку Sources.
  • 34 |
  • В правом верхнем углу нажмите на кнопку Edit, затем на Add (в левом верхнем углу).
  • 35 |
  • В появившемся окошке введите:
  • 36 |
  • Нажмите Done, затем Refresh.
  • 37 |
38 |
39 |
40 |

You've got to this page in your browser, but in fact, it is a repository for Installer.app. This means that if you add the URL into your Installer.app, you'll get access to many interesting and useful iPhone apps. Here's how:

41 |
    42 |
  • Launch Installer.app and go to the Sources section.
  • 43 |
  • In the upper right corner, click Edit, then add (in the upper left corner).
  • 44 |
  • In the screen that appears enter:
  • 45 |
  • Click Done, then Refresh.
  • 46 |
47 |
48 |
 
49 |
50 |

Εαν έχετε αυτή την σελίδα στον φυλλομετρητή σας, αυτό είναι το repository για το Installer.app.Αυτό σημαίνει ότι αν προσθέσετε το σύνδεσμο στο installer.app , θα έχετε πρόσβαση σε πολύ χρήσιμες εφαρμογές για το iPhone.Ορίστε πώς 51 |

    52 |
  • Ανοίξτε τον Installer.app και πηγαίνεται στην περιοχή των Sources .Στην πάνω δεξιά γωνία, πατήστε Edit, και μετά add
  • 53 |
  • Στην οθόνη που εμφανίζεται δώστε αυτό το σύνδεσμο
  • 54 |
  • Πατήστε Done και μετά Refresh
  • 55 |
56 |
57 |
 
58 |
59 | 60 |
© 2007-2008, RiP Dev. All rights reserved.
61 | 62 | 63 | -------------------------------------------------------------------------------- /Schema.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CREATE TABLE sources ( 6 | location TEXT, 7 | name TEXT, 8 | maintainer TEXT, 9 | contact TEXT, 10 | url TEXT, 11 | category TEXT, 12 | description TEXT, 13 | isTrusted INTEGER DEFAULT 0, 14 | isUnsafe INTEGER DEFAULT 0, 15 | hasErrors INTEGER DEFAULT 0, 16 | 17 | lastrefresh REAL 18 | ); 19 | 20 | CREATE INDEX lastrefresh_idx ON sources ( lastrefresh ); 21 | CREATE TABLE packages ( 22 | source INTEGER, 23 | 24 | identifier TEXT, 25 | name TEXT, 26 | 27 | moreURL TEXT, 28 | customInfo TEXT, 29 | 30 | version TEXT, 31 | location TEXT, 32 | size INTEGER, 33 | hash TEXT, 34 | maintainer TEXT, 35 | contact TEXT, 36 | description TEXT, 37 | url TEXT, 38 | category TEXT, 39 | date REAL, 40 | dependencies BLOB, 41 | icon TEXT, 42 | sponsor TEXT, 43 | sponsorURL TEXT, 44 | uninstallScript BLOB, 45 | isInstalled INTEGER DEFAULT 0 46 | ); 47 | 48 | CREATE INDEX source_idx ON packages ( source ); 49 | CREATE INDEX date_idx ON packages ( date ); 50 | CREATE INDEX identifier_idx ON packages ( identifier ); 51 | CREATE INDEX installed_idx ON packages ( isInstalled ); 52 | ALTER TABLE sources ADD COLUMN icon TEXT; 53 | DELETE FROM packages WHERE isInstalled <> 1; 54 | CREATE TABLE search ( 55 | packageID INTEGER DEFAULT NULL, 56 | 57 | sourceName TEXT, 58 | sourceURL TEXT, 59 | identifier TEXT, 60 | name TEXT, 61 | customInfo TEXT, 62 | 63 | description TEXT, 64 | version TEXT, 65 | icon TEXT, 66 | date REAL 67 | ); 68 | 69 | CREATE TABLE incomplete_downloads ( 70 | url TEXT, 71 | path TEXT, 72 | date REAL, 73 | size INTEGER, 74 | mod_date REAL 75 | ); 76 | 77 | ALTER TABLE packages ADD COLUMN rating REAL; 78 | ALTER TABLE packages ADD COLUMN myRating REAL; 79 | ALTER TABLE packages ADD COLUMN ratingRefresh REAL; 80 | ALTER TABLE packages ADD COLUMN preflightScript BLOB; 81 | ALTER TABLE packages ADD COLUMN postflightScript BLOB; 82 | 83 | 84 | -------------------------------------------------------------------------------- /Sources.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/Sources.png -------------------------------------------------------------------------------- /Tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/Tasks.png -------------------------------------------------------------------------------- /el.lproj/CategoryMapping.strings: -------------------------------------------------------------------------------- 1 | "CarrierBundle" = "Bundles Παροχέων"; 2 | "Themes (SpringBoard)" = "Θέματα"; 3 | "Themes (WinterBoard)" = "Θέματα"; 4 | "Themes-SpringBoard" = "Θέματα"; 5 | "Themes-System" = "Θέματα (Σύστημα)"; 6 | 7 | /* Common categories (no real use for English, but good to be localized) */ 8 | "Maps" = "Χάρτες"; 9 | "Fun" = "Διασκέδαση"; 10 | "Power Management" = "Διαχείρηση Ενέργιας"; 11 | "Utilities" = "Βοηθήματα"; 12 | "Network" = "Δίκτυο"; 13 | "System" = "Σύστημα"; 14 | "Multimedia" = "Πολυμέσα"; 15 | "Games" = "Παιχνίδια"; 16 | "Beta" = "Beta Εκδόσεις"; 17 | "Messaging" = "Μηνύματα κειμένου"; 18 | "Toys" = "Toys"; 19 | "Themes-SpringBoard" = "Θέματα"; 20 | "Themes-Apps" = "Θέματα (Εφαρμογές)"; 21 | "Productivity" = "Παραγωγικότητα"; 22 | "eBooks" = "Βιβλία"; 23 | "Mods" = "Μόντες"; 24 | "Localization" = "Μεταφράσεις"; 25 | "Networking" = "Δικτυακά"; 26 | "Tweaks" = "Κόλπακια"; 27 | "Applications" = "Εφαρμογές"; 28 | "Customization" = "Προσαρμογή"; 29 | "Webclips" = "Webclips"; 30 | "Themes-Complete" = "Θέματα-Ολοκληρωμένα"; 31 | "Wallpapers" = "Ταπετσαρίες"; 32 | "Themes-Misc" = "Θέματα (άλλο)"; 33 | "Sources" = "Πηγές"; 34 | "App Addons" = "App Addons"; 35 | "Entertainment" = "Entertainment"; 36 | "Health and Fitness" = "Health and Fitness"; 37 | "Ringtones" = "Ringtones"; 38 | "Pictures" = "Pictures"; 39 | "Sport" = "Sport"; 40 | "Themes (Apps)" = "Θέματα (Apps)"; 41 | "Themes (Battery)" = "Θέματα (Battery)"; 42 | "Themes (Keyboard)" = "Θέματα (Keyboard)"; 43 | "Themes (Complete)" = "Θέματα"; 44 | "Themes (Lockscreen)" = "Θέματα (Lockscreen)"; 45 | "Themes (SBSettings)" = "Θέματα (SBSettings)"; 46 | "Themes (Sounds)" = "Θέματα (Sounds)"; 47 | "Themes (System)" = "Θέματα (Σύστημα)"; 48 | "Themes (Videos)" = "Θέματα (Videos)"; 49 | "Wallpaper" = "Ταπετσαρίες"; 50 | "Widgets" = "Widgets"; 51 | -------------------------------------------------------------------------------- /el.lproj/Errors.strings: -------------------------------------------------------------------------------- 1 | 2 | /*1 = "Required dependency (%@) was not found.";*/ 3 | 1 = "Απαιτείται εξάρτηση του πακέτου (%@) το οποίο δεν βρέθηκε."; 4 | 5 | /*2 = "Decoding of the information for the package %@ failed.";*/ 6 | 2 = "Η αποκρυπτογράφηση των πληροφοριών του πακέτου %@ απέτυχε."; 7 | 8 | /*3 = "File hash does not match the downloaded file for package %@. Try again, or refresh the source - the file may have changed.";*/ 9 | 3 = "Το hash του αρχείου δεν είναι ίδιο με το φορτωμένο πακέτο %@. Δοκιμάστε ξανά, ή ανανεώστε την πηγή - το αρχείο μπορεί να έχει αλλάξει."; 10 | 11 | /*4 = "File size does not match the downloaded file for package %@. Try again, or refresh the source - the file may have changed.";*/ 12 | 4 = "Το μέγεθος του αρχείου δεν είναι ίδιο με το κατεβασμένο πακέτο %@. Δοκιμάστε ξανά, ή ανανεώστε την πηγή - το αρχείο μπορεί να έχει αλλάξει."; 13 | 14 | /*5 = "Script Error";*/ 15 | 5 = "Σφάλμα Script"; 16 | 17 | /*6 = "Package is not installed.";*/ 18 | 6 = "Το πακέτο δεν είναι εγκατεστημένο."; 19 | 20 | /*7 = "Cannot receive information about trusted sources from RiP Dev. Please try again later.";*/ 21 | 7 = "Δεν γίνετε να ληφθούν πληροφορίες απο την έμπιστη πηγή Ripdev. Παρακαλώ δοκιμάστε αργότερα."; 22 | 23 | 9 = "This package requires a device with an unlocked system disk, also known as \"jailbroken\". Since your system partition is secure, it cannot be installed. Sorry."; 24 | -------------------------------------------------------------------------------- /el.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "__ALL_PACKAGES__" = "Όλα τα πακέτα"; 2 | "__INSTALLED_PACKAGES__" = "Εγκατεστημένα πακέτα"; 3 | "__RECENT_PACKAGES__" = "Πρόσφατα πακέτα"; 4 | "__UPDATED_PACKAGES__" = "Αναβαθμισμένα πακέτα"; 5 | 6 | "%u package" = "%u πακέτα"; 7 | "%u total packages" = "%u συν. πακέτα"; 8 | "An Installer update is available. Would you like to update it now? It is strongly recommended you stay up-to-date with the latest version." = "Μια αναβάθμιση του Installer είναι διαθέσιμη. Θέλετε να το αναβαθμίσετε τώρα; Σας συνιστούμε να είναι αναβαθμισμένος στην τελευταία έκδοση."; 9 | "Cancel" = "Άκυρο"; 10 | "Cannot install package \"%@\" as it was not found. Sorry!" = "Αδυναμία εγκατάστασης πακέτου \"%@\" καθώς δεν βρέθηκε. Συγνώμη!"; 11 | "Checking %@" = "Έλεγχος %@"; 12 | "Contact" = "Επαφή"; 13 | "Downloading %@" = "Λήψη %@"; 14 | "Error" = "Σφάλμα"; 15 | "Featured" = "Περιεχόμενα"; 16 | "Fetching icon for %@..." = "Λήψη εικονιδίου για %@…"; 17 | "Fetching info for %@..." = "Λήψη πληροφοριών για %@…"; 18 | "Getting rating for \"%@\"..." = "Λήψη αξιολόγησης για \"%@\"…"; 19 | "Install" = "Εγκατάσταση"; 20 | "Installer Update Available" = "Αναβάθμιση Installer διαθέσιμη"; 21 | "Installer was not installed correctly. It should be run as root:wheel. We will continue but please remember that it may not function correctly." = "Ο Installer δεν εγκαταστάθηκε σωστά. Πρέπει να το τρέξετε σαν root:wheel. Θα συνεχίσουμε αλλά παρακαλώ θυμηθείτε ότι δεν θα λειτουργεί σωστά."; 22 | "Installing %@" = "Εγκατάσταση %@"; 23 | "Insufficient Permissions" = "Ανεπαρκής δικαιώματα"; 24 | "Invalid Source" = "Μη έγκυρη πηγή"; 25 | "New Source" = "Νέα πηγή"; 26 | "Notice" = "Σημείωση"; 27 | "OK" = "OK"; 28 | "Please input the valid source URL above to add the source." = "Παρακαλώ εισάγετε το URL της έγκυρης πηγής για να προσθέσετε μια πηγή."; 29 | "Post-flight for %@" = "Post-flight για %@"; 30 | "Pre-flight for %@" = "Pre-flight για %@"; 31 | "Preparing %@" = "Προετοιμασία %@"; 32 | "Proceed" = "Συνέχεια"; 33 | "Processing" = "Επεξεργασία"; 34 | "Processing index..." = "Επεξεργασία ευρετηρίασης…"; 35 | "Processing packages..." = "Επεξεργασία πακέτων…"; 36 | "Queueing package install..." = "Δρομολόγηση πακέτου εγκατάστασης σε σειρά…"; 37 | "Refreshing" = "Ανανέωση"; 38 | "Refreshing %@..." = "Ανανέωση %@…"; 39 | "Refreshing trusted sources" = "Ανανέωση έμπιστων πηγών"; 40 | "Searching" = "Αναζήτηση"; 41 | "Searching for \"%@\"..." = "Αναζήτηση για \"%@\"…"; 42 | "Source" = "Πηγή"; 43 | "The package \"%@\" comes from a source that is not yet added to Installer. If you Proceed, the source \"%@\" will be first added to your sources list, and then the package will be installed as normal." = "Το πακέτο \"%@\" προέρχεται από πηγή που δεν έχει προστεθεί στον Installer. Αν συνεχίσετε, η πηγή \"%@\" θα εγκατασταθεί στην λίστα σας και το πακέτο θα εγκατασταθεί κανονικά."; 44 | "There were errors while trying to refresh this source. Please double-check the URL and try refreshing again." = "Εμφανίστηκαν σφάλματα κατά την ανανέωση της πηγής. Παρακαλώ ελέγξτε το URL και ανανεώστε ξανά."; 45 | "Uninstall" = "Απεγκατάσταση"; 46 | "Update" = "Ανανέωση"; 47 | "Update All" = "Ανανέωση όλων"; 48 | "Updated" = "Ανανεώθηκε"; 49 | "Waiting on %@..." = "Αναμονή σε %@…"; 50 | 51 | /* Task statuses */ 52 | "Idle" = "Αδράνης"; 53 | "Active" = "Ενεργή"; 54 | "Done" = "Επιτυχής"; 55 | "Failed" = "Αποτυχής"; 56 | "Status:" = "Κατάσταση:"; 57 | 58 | /* Recent Packages */ 59 | "Today" = "Today"; 60 | "Yesterday" = "Yesterday"; 61 | "Older" = "Older"; 62 | 63 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/icon.png -------------------------------------------------------------------------------- /libcrypto_i386.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/libcrypto_i386.a -------------------------------------------------------------------------------- /libcurl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/libcurl.a -------------------------------------------------------------------------------- /libcurl_i386.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/libcurl_i386.a -------------------------------------------------------------------------------- /libssl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/libssl.a -------------------------------------------------------------------------------- /libssl_i386.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/libssl_i386.a -------------------------------------------------------------------------------- /lua-5.1.4/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Lua License 2 | ----------- 3 | 4 | Lua is licensed under the terms of the MIT license reproduced below. 5 | This means that Lua is free software and can be used for both academic 6 | and commercial purposes at absolutely no cost. 7 | 8 | For details and rationale, see http://www.lua.org/license.html . 9 | 10 | =============================================================================== 11 | 12 | Copyright (C) 1994-2008 Lua.org, PUC-Rio. 13 | 14 | Permission is hereby granted, free of charge, to any person obtaining a copy 15 | of this software and associated documentation files (the "Software"), to deal 16 | in the Software without restriction, including without limitation the rights 17 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 18 | copies of the Software, and to permit persons to whom the Software is 19 | furnished to do so, subject to the following conditions: 20 | 21 | The above copyright notice and this permission notice shall be included in 22 | all copies or substantial portions of the Software. 23 | 24 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 25 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 26 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 27 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 28 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 29 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 30 | THE SOFTWARE. 31 | 32 | =============================================================================== 33 | 34 | (end of COPYRIGHT) 35 | -------------------------------------------------------------------------------- /lua-5.1.4/README: -------------------------------------------------------------------------------- 1 | README for Lua 5.1 2 | 3 | See INSTALL for installation instructions. 4 | See HISTORY for a summary of changes since the last released version. 5 | 6 | * What is Lua? 7 | ------------ 8 | Lua is a powerful, light-weight programming language designed for extending 9 | applications. Lua is also frequently used as a general-purpose, stand-alone 10 | language. Lua is free software. 11 | 12 | For complete information, visit Lua's web site at http://www.lua.org/ . 13 | For an executive summary, see http://www.lua.org/about.html . 14 | 15 | Lua has been used in many different projects around the world. 16 | For a short list, see http://www.lua.org/uses.html . 17 | 18 | * Availability 19 | ------------ 20 | Lua is freely available for both academic and commercial purposes. 21 | See COPYRIGHT and http://www.lua.org/license.html for details. 22 | Lua can be downloaded at http://www.lua.org/download.html . 23 | 24 | * Installation 25 | ------------ 26 | Lua is implemented in pure ANSI C, and compiles unmodified in all known 27 | platforms that have an ANSI C compiler. In most Unix-like platforms, simply 28 | do "make" with a suitable target. See INSTALL for detailed instructions. 29 | 30 | * Origin 31 | ------ 32 | Lua is developed at Lua.org, a laboratory of the Department of Computer 33 | Science of PUC-Rio (the Pontifical Catholic University of Rio de Janeiro 34 | in Brazil). 35 | For more information about the authors, see http://www.lua.org/authors.html . 36 | 37 | (end of README) 38 | -------------------------------------------------------------------------------- /lua-5.1.4/doc/amazon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/lua-5.1.4/doc/amazon.gif -------------------------------------------------------------------------------- /lua-5.1.4/doc/contents.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/lua-5.1.4/doc/contents.html -------------------------------------------------------------------------------- /lua-5.1.4/doc/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/lua-5.1.4/doc/cover.png -------------------------------------------------------------------------------- /lua-5.1.4/doc/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/lua-5.1.4/doc/logo.gif -------------------------------------------------------------------------------- /lua-5.1.4/doc/lua.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #000000 ; 3 | background-color: #FFFFFF ; 4 | font-family: sans-serif ; 5 | text-align: justify ; 6 | margin-right: 20px ; 7 | margin-left: 20px ; 8 | } 9 | 10 | h1, h2, h3, h4 { 11 | font-weight: normal ; 12 | font-style: italic ; 13 | } 14 | 15 | a:link { 16 | color: #000080 ; 17 | background-color: inherit ; 18 | text-decoration: none ; 19 | } 20 | 21 | a:visited { 22 | background-color: inherit ; 23 | text-decoration: none ; 24 | } 25 | 26 | a:link:hover, a:visited:hover { 27 | color: #000080 ; 28 | background-color: #E0E0FF ; 29 | } 30 | 31 | a:link:active, a:visited:active { 32 | color: #FF0000 ; 33 | } 34 | 35 | hr { 36 | border: 0 ; 37 | height: 1px ; 38 | color: #a0a0a0 ; 39 | background-color: #a0a0a0 ; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /lua-5.1.4/doc/manual.css: -------------------------------------------------------------------------------- 1 | h3 code { 2 | font-family: inherit ; 3 | } 4 | 5 | pre { 6 | font-size: 105% ; 7 | } 8 | 9 | span.apii { 10 | float: right ; 11 | font-family: inherit ; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /lua-5.1.4/doc/readme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Lua documentation 4 | 5 | 6 | 7 | 8 | 9 |
10 |

11 | Lua 12 | Documentation 13 |

14 | 15 | This is the documentation included in the source distribution of Lua 5.1.4. 16 | 17 | 25 | 26 | Lua's 27 | official web site 28 | contains updated documentation, 29 | especially the 30 | reference manual. 31 |

32 | 33 |


34 | 35 | Last update: 36 | Tue Aug 12 14:46:07 BRT 2008 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /lua-5.1.4/etc/Makefile: -------------------------------------------------------------------------------- 1 | # makefile for Lua etc 2 | 3 | TOP= .. 4 | LIB= $(TOP)/src 5 | INC= $(TOP)/src 6 | BIN= $(TOP)/src 7 | SRC= $(TOP)/src 8 | TST= $(TOP)/test 9 | 10 | CC= gcc 11 | CFLAGS= -O2 -Wall -I$(INC) $(MYCFLAGS) 12 | MYCFLAGS= 13 | MYLDFLAGS= -Wl,-E 14 | MYLIBS= -lm 15 | #MYLIBS= -lm -Wl,-E -ldl -lreadline -lhistory -lncurses 16 | RM= rm -f 17 | 18 | default: 19 | @echo 'Please choose a target: min noparser one strict clean' 20 | 21 | min: min.c 22 | $(CC) $(CFLAGS) $@.c -L$(LIB) -llua $(MYLIBS) 23 | echo 'print"Hello there!"' | ./a.out 24 | 25 | noparser: noparser.o 26 | $(CC) noparser.o $(SRC)/lua.o -L$(LIB) -llua $(MYLIBS) 27 | $(BIN)/luac $(TST)/hello.lua 28 | -./a.out luac.out 29 | -./a.out -e'a=1' 30 | 31 | one: 32 | $(CC) $(CFLAGS) all.c $(MYLIBS) 33 | ./a.out $(TST)/hello.lua 34 | 35 | strict: 36 | -$(BIN)/lua -e 'print(a);b=2' 37 | -$(BIN)/lua -lstrict -e 'print(a)' 38 | -$(BIN)/lua -e 'function f() b=2 end f()' 39 | -$(BIN)/lua -lstrict -e 'function f() b=2 end f()' 40 | 41 | clean: 42 | $(RM) a.out core core.* *.o luac.out 43 | 44 | .PHONY: default min noparser one strict clean 45 | -------------------------------------------------------------------------------- /lua-5.1.4/etc/README: -------------------------------------------------------------------------------- 1 | This directory contains some useful files and code. 2 | Unlike the code in ../src, everything here is in the public domain. 3 | 4 | If any of the makes fail, you're probably not using the same libraries 5 | used to build Lua. Set MYLIBS in Makefile accordingly. 6 | 7 | all.c 8 | Full Lua interpreter in a single file. 9 | Do "make one" for a demo. 10 | 11 | lua.hpp 12 | Lua header files for C++ using 'extern "C"'. 13 | 14 | lua.ico 15 | A Lua icon for Windows (and web sites: save as favicon.ico). 16 | Drawn by hand by Markus Gritsch . 17 | 18 | lua.pc 19 | pkg-config data for Lua 20 | 21 | luavs.bat 22 | Script to build Lua under "Visual Studio .NET Command Prompt". 23 | Run it from the toplevel as etc\luavs.bat. 24 | 25 | min.c 26 | A minimal Lua interpreter. 27 | Good for learning and for starting your own. 28 | Do "make min" for a demo. 29 | 30 | noparser.c 31 | Linking with noparser.o avoids loading the parsing modules in lualib.a. 32 | Do "make noparser" for a demo. 33 | 34 | strict.lua 35 | Traps uses of undeclared global variables. 36 | Do "make strict" for a demo. 37 | 38 | -------------------------------------------------------------------------------- /lua-5.1.4/etc/all.c: -------------------------------------------------------------------------------- 1 | /* 2 | * all.c -- Lua core, libraries and interpreter in a single file 3 | */ 4 | 5 | #define luaall_c 6 | 7 | #include "lapi.c" 8 | #include "lcode.c" 9 | #include "ldebug.c" 10 | #include "ldo.c" 11 | #include "ldump.c" 12 | #include "lfunc.c" 13 | #include "lgc.c" 14 | #include "llex.c" 15 | #include "lmem.c" 16 | #include "lobject.c" 17 | #include "lopcodes.c" 18 | #include "lparser.c" 19 | #include "lstate.c" 20 | #include "lstring.c" 21 | #include "ltable.c" 22 | #include "ltm.c" 23 | #include "lundump.c" 24 | #include "lvm.c" 25 | #include "lzio.c" 26 | 27 | #include "lauxlib.c" 28 | #include "lbaselib.c" 29 | #include "ldblib.c" 30 | #include "liolib.c" 31 | #include "linit.c" 32 | #include "lmathlib.c" 33 | #include "loadlib.c" 34 | #include "loslib.c" 35 | #include "lstrlib.c" 36 | #include "ltablib.c" 37 | 38 | #include "lua.c" 39 | -------------------------------------------------------------------------------- /lua-5.1.4/etc/lua.hpp: -------------------------------------------------------------------------------- 1 | // lua.hpp 2 | // Lua header files for C++ 3 | // <> not supplied automatically because Lua also compiles as C++ 4 | 5 | extern "C" { 6 | #include "lua.h" 7 | #include "lualib.h" 8 | #include "lauxlib.h" 9 | } 10 | -------------------------------------------------------------------------------- /lua-5.1.4/etc/lua.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/lua-5.1.4/etc/lua.ico -------------------------------------------------------------------------------- /lua-5.1.4/etc/lua.pc: -------------------------------------------------------------------------------- 1 | # lua.pc -- pkg-config data for Lua 2 | 3 | # vars from install Makefile 4 | 5 | # grep '^V=' ../Makefile 6 | V= 5.1 7 | # grep '^R=' ../Makefile 8 | R= 5.1.4 9 | 10 | # grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' 11 | prefix= /usr/local 12 | INSTALL_BIN= ${prefix}/bin 13 | INSTALL_INC= ${prefix}/include 14 | INSTALL_LIB= ${prefix}/lib 15 | INSTALL_MAN= ${prefix}/man/man1 16 | INSTALL_LMOD= ${prefix}/share/lua/${V} 17 | INSTALL_CMOD= ${prefix}/lib/lua/${V} 18 | 19 | # canonical vars 20 | exec_prefix=${prefix} 21 | libdir=${exec_prefix}/lib 22 | includedir=${prefix}/include 23 | 24 | Name: Lua 25 | Description: An Extensible Extension Language 26 | Version: ${R} 27 | Requires: 28 | Libs: -L${libdir} -llua -lm 29 | Cflags: -I${includedir} 30 | 31 | # (end of lua.pc) 32 | -------------------------------------------------------------------------------- /lua-5.1.4/etc/luavs.bat: -------------------------------------------------------------------------------- 1 | @rem Script to build Lua under "Visual Studio .NET Command Prompt". 2 | @rem Do not run from this directory; run it from the toplevel: etc\luavs.bat . 3 | @rem It creates lua51.dll, lua51.lib, lua.exe, and luac.exe in src. 4 | @rem (contributed by David Manura and Mike Pall) 5 | 6 | @setlocal 7 | @set MYCOMPILE=cl /nologo /MD /O2 /W3 /c /D_CRT_SECURE_NO_DEPRECATE 8 | @set MYLINK=link /nologo 9 | @set MYMT=mt /nologo 10 | 11 | cd src 12 | %MYCOMPILE% /DLUA_BUILD_AS_DLL l*.c 13 | del lua.obj luac.obj 14 | %MYLINK% /DLL /out:lua51.dll l*.obj 15 | if exist lua51.dll.manifest^ 16 | %MYMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2 17 | %MYCOMPILE% /DLUA_BUILD_AS_DLL lua.c 18 | %MYLINK% /out:lua.exe lua.obj lua51.lib 19 | if exist lua.exe.manifest^ 20 | %MYMT% -manifest lua.exe.manifest -outputresource:lua.exe 21 | %MYCOMPILE% l*.c print.c 22 | del lua.obj linit.obj lbaselib.obj ldblib.obj liolib.obj lmathlib.obj^ 23 | loslib.obj ltablib.obj lstrlib.obj loadlib.obj 24 | %MYLINK% /out:luac.exe *.obj 25 | if exist luac.exe.manifest^ 26 | %MYMT% -manifest luac.exe.manifest -outputresource:luac.exe 27 | del *.obj *.manifest 28 | cd .. 29 | -------------------------------------------------------------------------------- /lua-5.1.4/etc/min.c: -------------------------------------------------------------------------------- 1 | /* 2 | * min.c -- a minimal Lua interpreter 3 | * loads stdin only with minimal error handling. 4 | * no interaction, and no standard library, only a "print" function. 5 | */ 6 | 7 | #include 8 | 9 | #include "lua.h" 10 | #include "lauxlib.h" 11 | 12 | static int print(lua_State *L) 13 | { 14 | int n=lua_gettop(L); 15 | int i; 16 | for (i=1; i<=n; i++) 17 | { 18 | if (i>1) printf("\t"); 19 | if (lua_isstring(L,i)) 20 | printf("%s",lua_tostring(L,i)); 21 | else if (lua_isnil(L,i)) 22 | printf("%s","nil"); 23 | else if (lua_isboolean(L,i)) 24 | printf("%s",lua_toboolean(L,i) ? "true" : "false"); 25 | else 26 | printf("%s:%p",luaL_typename(L,i),lua_topointer(L,i)); 27 | } 28 | printf("\n"); 29 | return 0; 30 | } 31 | 32 | int main(void) 33 | { 34 | lua_State *L=lua_open(); 35 | lua_register(L,"print",print); 36 | if (luaL_dofile(L,NULL)!=0) fprintf(stderr,"%s\n",lua_tostring(L,-1)); 37 | lua_close(L); 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /lua-5.1.4/etc/noparser.c: -------------------------------------------------------------------------------- 1 | /* 2 | * The code below can be used to make a Lua core that does not contain the 3 | * parsing modules (lcode, llex, lparser), which represent 35% of the total core. 4 | * You'll only be able to load binary files and strings, precompiled with luac. 5 | * (Of course, you'll have to build luac with the original parsing modules!) 6 | * 7 | * To use this module, simply compile it ("make noparser" does that) and list 8 | * its object file before the Lua libraries. The linker should then not load 9 | * the parsing modules. To try it, do "make luab". 10 | * 11 | * If you also want to avoid the dump module (ldump.o), define NODUMP. 12 | * #define NODUMP 13 | */ 14 | 15 | #define LUA_CORE 16 | 17 | #include "llex.h" 18 | #include "lparser.h" 19 | #include "lzio.h" 20 | 21 | LUAI_FUNC void luaX_init (lua_State *L) { 22 | UNUSED(L); 23 | } 24 | 25 | LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { 26 | UNUSED(z); 27 | UNUSED(buff); 28 | UNUSED(name); 29 | lua_pushliteral(L,"parser not loaded"); 30 | lua_error(L); 31 | return NULL; 32 | } 33 | 34 | #ifdef NODUMP 35 | #include "lundump.h" 36 | 37 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) { 38 | UNUSED(f); 39 | UNUSED(w); 40 | UNUSED(data); 41 | UNUSED(strip); 42 | #if 1 43 | UNUSED(L); 44 | return 0; 45 | #else 46 | lua_pushliteral(L,"dumper not loaded"); 47 | lua_error(L); 48 | #endif 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /lua-5.1.4/etc/strict.lua: -------------------------------------------------------------------------------- 1 | -- 2 | -- strict.lua 3 | -- checks uses of undeclared global variables 4 | -- All global variables must be 'declared' through a regular assignment 5 | -- (even assigning nil will do) in a main chunk before being used 6 | -- anywhere or assigned to inside a function. 7 | -- 8 | 9 | local getinfo, error, rawset, rawget = debug.getinfo, error, rawset, rawget 10 | 11 | local mt = getmetatable(_G) 12 | if mt == nil then 13 | mt = {} 14 | setmetatable(_G, mt) 15 | end 16 | 17 | mt.__declared = {} 18 | 19 | local function what () 20 | local d = getinfo(3, "S") 21 | return d and d.what or "C" 22 | end 23 | 24 | mt.__newindex = function (t, n, v) 25 | if not mt.__declared[n] then 26 | local w = what() 27 | if w ~= "main" and w ~= "C" then 28 | error("assign to undeclared variable '"..n.."'", 2) 29 | end 30 | mt.__declared[n] = true 31 | end 32 | rawset(t, n, v) 33 | end 34 | 35 | mt.__index = function (t, n) 36 | if not mt.__declared[n] and what() ~= "C" then 37 | error("variable '"..n.."' is not declared", 2) 38 | end 39 | return rawget(t, n) 40 | end 41 | 42 | -------------------------------------------------------------------------------- /lua-5.1.4/make-installer-lua.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | make clean 4 | make iphone 5 | make clean 6 | make macosx 7 | 8 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Auxiliary functions from Lua API 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lapi_h 8 | #define lapi_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Code generator for Lua 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lcode_h 8 | #define lcode_h 9 | 10 | #include "llex.h" 11 | #include "lobject.h" 12 | #include "lopcodes.h" 13 | #include "lparser.h" 14 | 15 | 16 | /* 17 | ** Marks the end of a patch list. It is an invalid value both as an absolute 18 | ** address, and as a list link (would link an element to itself). 19 | */ 20 | #define NO_JUMP (-1) 21 | 22 | 23 | /* 24 | ** grep "ORDER OPR" if you change these enums 25 | */ 26 | typedef enum BinOpr { 27 | OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW, 28 | OPR_CONCAT, 29 | OPR_NE, OPR_EQ, 30 | OPR_LT, OPR_LE, OPR_GT, OPR_GE, 31 | OPR_AND, OPR_OR, 32 | OPR_NOBINOPR 33 | } BinOpr; 34 | 35 | 36 | typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; 37 | 38 | 39 | #define getcode(fs,e) ((fs)->f->code[(e)->u.s.info]) 40 | 41 | #define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx) 42 | 43 | #define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET) 44 | 45 | LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); 46 | LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); 47 | LUAI_FUNC void luaK_fixline (FuncState *fs, int line); 48 | LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); 49 | LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); 50 | LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); 51 | LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); 52 | LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r); 53 | LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); 54 | LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); 55 | LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); 56 | LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); 57 | LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); 58 | LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); 59 | LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); 60 | LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); 61 | LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); 62 | LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); 63 | LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e); 64 | LUAI_FUNC int luaK_jump (FuncState *fs); 65 | LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret); 66 | LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target); 67 | LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list); 68 | LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2); 69 | LUAI_FUNC int luaK_getlabel (FuncState *fs); 70 | LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v); 71 | LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); 72 | LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2); 73 | LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); 74 | 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /lua-5.1.4/src/ldebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Auxiliary functions from Debug Interface module 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldebug_h 8 | #define ldebug_h 9 | 10 | 11 | #include "lstate.h" 12 | 13 | 14 | #define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) 15 | 16 | #define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0) 17 | 18 | #define resethookcount(L) (L->hookcount = L->basehookcount) 19 | 20 | 21 | LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o, 22 | const char *opname); 23 | LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2); 24 | LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1, 25 | const TValue *p2); 26 | LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1, 27 | const TValue *p2); 28 | LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...); 29 | LUAI_FUNC void luaG_errormsg (lua_State *L); 30 | LUAI_FUNC int luaG_checkcode (const Proto *pt); 31 | LUAI_FUNC int luaG_checkopenop (Instruction i); 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /lua-5.1.4/src/ldo.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Stack and Call structure of Lua 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ldo_h 8 | #define ldo_h 9 | 10 | 11 | #include "lobject.h" 12 | #include "lstate.h" 13 | #include "lzio.h" 14 | 15 | 16 | #define luaD_checkstack(L,n) \ 17 | if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \ 18 | luaD_growstack(L, n); \ 19 | else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); 20 | 21 | 22 | #define incr_top(L) {luaD_checkstack(L,1); L->top++;} 23 | 24 | #define savestack(L,p) ((char *)(p) - (char *)L->stack) 25 | #define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) 26 | 27 | #define saveci(L,p) ((char *)(p) - (char *)L->base_ci) 28 | #define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n))) 29 | 30 | 31 | /* results from luaD_precall */ 32 | #define PCRLUA 0 /* initiated a call to a Lua function */ 33 | #define PCRC 1 /* did a call to a C function */ 34 | #define PCRYIELD 2 /* C funtion yielded */ 35 | 36 | 37 | /* type of protected functions, to be ran by `runprotected' */ 38 | typedef void (*Pfunc) (lua_State *L, void *ud); 39 | 40 | LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name); 41 | LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line); 42 | LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); 43 | LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); 44 | LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, 45 | ptrdiff_t oldtop, ptrdiff_t ef); 46 | LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); 47 | LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); 48 | LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); 49 | LUAI_FUNC void luaD_growstack (lua_State *L, int n); 50 | 51 | LUAI_FUNC void luaD_throw (lua_State *L, int errcode); 52 | LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); 53 | 54 | LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); 55 | 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /lua-5.1.4/src/ldump.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ldump.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** save precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #include 8 | 9 | #define ldump_c 10 | #define LUA_CORE 11 | 12 | #include "lua.h" 13 | 14 | #include "lobject.h" 15 | #include "lstate.h" 16 | #include "lundump.h" 17 | 18 | typedef struct { 19 | lua_State* L; 20 | lua_Writer writer; 21 | void* data; 22 | int strip; 23 | int status; 24 | } DumpState; 25 | 26 | #define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) 27 | #define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) 28 | 29 | static void DumpBlock(const void* b, size_t size, DumpState* D) 30 | { 31 | if (D->status==0) 32 | { 33 | lua_unlock(D->L); 34 | D->status=(*D->writer)(D->L,b,size,D->data); 35 | lua_lock(D->L); 36 | } 37 | } 38 | 39 | static void DumpChar(int y, DumpState* D) 40 | { 41 | char x=(char)y; 42 | DumpVar(x,D); 43 | } 44 | 45 | static void DumpInt(int x, DumpState* D) 46 | { 47 | DumpVar(x,D); 48 | } 49 | 50 | static void DumpNumber(lua_Number x, DumpState* D) 51 | { 52 | DumpVar(x,D); 53 | } 54 | 55 | static void DumpVector(const void* b, int n, size_t size, DumpState* D) 56 | { 57 | DumpInt(n,D); 58 | DumpMem(b,n,size,D); 59 | } 60 | 61 | static void DumpString(const TString* s, DumpState* D) 62 | { 63 | if (s==NULL || getstr(s)==NULL) 64 | { 65 | size_t size=0; 66 | DumpVar(size,D); 67 | } 68 | else 69 | { 70 | size_t size=s->tsv.len+1; /* include trailing '\0' */ 71 | DumpVar(size,D); 72 | DumpBlock(getstr(s),size,D); 73 | } 74 | } 75 | 76 | #define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D) 77 | 78 | static void DumpFunction(const Proto* f, const TString* p, DumpState* D); 79 | 80 | static void DumpConstants(const Proto* f, DumpState* D) 81 | { 82 | int i,n=f->sizek; 83 | DumpInt(n,D); 84 | for (i=0; ik[i]; 87 | DumpChar(ttype(o),D); 88 | switch (ttype(o)) 89 | { 90 | case LUA_TNIL: 91 | break; 92 | case LUA_TBOOLEAN: 93 | DumpChar(bvalue(o),D); 94 | break; 95 | case LUA_TNUMBER: 96 | DumpNumber(nvalue(o),D); 97 | break; 98 | case LUA_TSTRING: 99 | DumpString(rawtsvalue(o),D); 100 | break; 101 | default: 102 | lua_assert(0); /* cannot happen */ 103 | break; 104 | } 105 | } 106 | n=f->sizep; 107 | DumpInt(n,D); 108 | for (i=0; ip[i],f->source,D); 109 | } 110 | 111 | static void DumpDebug(const Proto* f, DumpState* D) 112 | { 113 | int i,n; 114 | n= (D->strip) ? 0 : f->sizelineinfo; 115 | DumpVector(f->lineinfo,n,sizeof(int),D); 116 | n= (D->strip) ? 0 : f->sizelocvars; 117 | DumpInt(n,D); 118 | for (i=0; ilocvars[i].varname,D); 121 | DumpInt(f->locvars[i].startpc,D); 122 | DumpInt(f->locvars[i].endpc,D); 123 | } 124 | n= (D->strip) ? 0 : f->sizeupvalues; 125 | DumpInt(n,D); 126 | for (i=0; iupvalues[i],D); 127 | } 128 | 129 | static void DumpFunction(const Proto* f, const TString* p, DumpState* D) 130 | { 131 | DumpString((f->source==p || D->strip) ? NULL : f->source,D); 132 | DumpInt(f->linedefined,D); 133 | DumpInt(f->lastlinedefined,D); 134 | DumpChar(f->nups,D); 135 | DumpChar(f->numparams,D); 136 | DumpChar(f->is_vararg,D); 137 | DumpChar(f->maxstacksize,D); 138 | DumpCode(f,D); 139 | DumpConstants(f,D); 140 | DumpDebug(f,D); 141 | } 142 | 143 | static void DumpHeader(DumpState* D) 144 | { 145 | char h[LUAC_HEADERSIZE]; 146 | luaU_header(h); 147 | DumpBlock(h,LUAC_HEADERSIZE,D); 148 | } 149 | 150 | /* 151 | ** dump Lua function as precompiled chunk 152 | */ 153 | int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) 154 | { 155 | DumpState D; 156 | D.L=L; 157 | D.writer=w; 158 | D.data=data; 159 | D.strip=strip; 160 | D.status=0; 161 | DumpHeader(&D); 162 | DumpFunction(f,NULL,&D); 163 | return D.status; 164 | } 165 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lfunc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Auxiliary functions to manipulate prototypes and closures 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lfunc_h 8 | #define lfunc_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | #define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ 15 | cast(int, sizeof(TValue)*((n)-1))) 16 | 17 | #define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ 18 | cast(int, sizeof(TValue *)*((n)-1))) 19 | 20 | 21 | LUAI_FUNC Proto *luaF_newproto (lua_State *L); 22 | LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); 23 | LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); 24 | LUAI_FUNC UpVal *luaF_newupval (lua_State *L); 25 | LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); 26 | LUAI_FUNC void luaF_close (lua_State *L, StkId level); 27 | LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); 28 | LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c); 29 | LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); 30 | LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, 31 | int pc); 32 | 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lgc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Garbage Collector 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lgc_h 8 | #define lgc_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | /* 15 | ** Possible states of the Garbage Collector 16 | */ 17 | #define GCSpause 0 18 | #define GCSpropagate 1 19 | #define GCSsweepstring 2 20 | #define GCSsweep 3 21 | #define GCSfinalize 4 22 | 23 | 24 | /* 25 | ** some userful bit tricks 26 | */ 27 | #define resetbits(x,m) ((x) &= cast(lu_byte, ~(m))) 28 | #define setbits(x,m) ((x) |= (m)) 29 | #define testbits(x,m) ((x) & (m)) 30 | #define bitmask(b) (1<<(b)) 31 | #define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2)) 32 | #define l_setbit(x,b) setbits(x, bitmask(b)) 33 | #define resetbit(x,b) resetbits(x, bitmask(b)) 34 | #define testbit(x,b) testbits(x, bitmask(b)) 35 | #define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2))) 36 | #define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2))) 37 | #define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2))) 38 | 39 | 40 | 41 | /* 42 | ** Layout for bit use in `marked' field: 43 | ** bit 0 - object is white (type 0) 44 | ** bit 1 - object is white (type 1) 45 | ** bit 2 - object is black 46 | ** bit 3 - for userdata: has been finalized 47 | ** bit 3 - for tables: has weak keys 48 | ** bit 4 - for tables: has weak values 49 | ** bit 5 - object is fixed (should not be collected) 50 | ** bit 6 - object is "super" fixed (only the main thread) 51 | */ 52 | 53 | 54 | #define WHITE0BIT 0 55 | #define WHITE1BIT 1 56 | #define BLACKBIT 2 57 | #define FINALIZEDBIT 3 58 | #define KEYWEAKBIT 3 59 | #define VALUEWEAKBIT 4 60 | #define FIXEDBIT 5 61 | #define SFIXEDBIT 6 62 | #define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) 63 | 64 | 65 | #define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) 66 | #define isblack(x) testbit((x)->gch.marked, BLACKBIT) 67 | #define isgray(x) (!isblack(x) && !iswhite(x)) 68 | 69 | #define otherwhite(g) (g->currentwhite ^ WHITEBITS) 70 | #define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS) 71 | 72 | #define changewhite(x) ((x)->gch.marked ^= WHITEBITS) 73 | #define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT) 74 | 75 | #define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x))) 76 | 77 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) 78 | 79 | 80 | #define luaC_checkGC(L) { \ 81 | condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \ 82 | if (G(L)->totalbytes >= G(L)->GCthreshold) \ 83 | luaC_step(L); } 84 | 85 | 86 | #define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ 87 | luaC_barrierf(L,obj2gco(p),gcvalue(v)); } 88 | 89 | #define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \ 90 | luaC_barrierback(L,t); } 91 | 92 | #define luaC_objbarrier(L,p,o) \ 93 | { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ 94 | luaC_barrierf(L,obj2gco(p),obj2gco(o)); } 95 | 96 | #define luaC_objbarriert(L,t,o) \ 97 | { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); } 98 | 99 | LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all); 100 | LUAI_FUNC void luaC_callGCTM (lua_State *L); 101 | LUAI_FUNC void luaC_freeall (lua_State *L); 102 | LUAI_FUNC void luaC_step (lua_State *L); 103 | LUAI_FUNC void luaC_fullgc (lua_State *L); 104 | LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt); 105 | LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv); 106 | LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); 107 | LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t); 108 | 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /lua-5.1.4/src/linit.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Initialization of libraries for lua.c 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #define linit_c 9 | #define LUA_LIB 10 | 11 | #include "lua.h" 12 | 13 | #include "lualib.h" 14 | #include "lauxlib.h" 15 | 16 | 17 | static const luaL_Reg lualibs[] = { 18 | {"", luaopen_base}, 19 | {LUA_LOADLIBNAME, luaopen_package}, 20 | {LUA_TABLIBNAME, luaopen_table}, 21 | {LUA_IOLIBNAME, luaopen_io}, 22 | {LUA_OSLIBNAME, luaopen_os}, 23 | {LUA_STRLIBNAME, luaopen_string}, 24 | {LUA_MATHLIBNAME, luaopen_math}, 25 | {LUA_DBLIBNAME, luaopen_debug}, 26 | {NULL, NULL} 27 | }; 28 | 29 | 30 | LUALIB_API void luaL_openlibs (lua_State *L) { 31 | const luaL_Reg *lib = lualibs; 32 | for (; lib->func; lib++) { 33 | lua_pushcfunction(L, lib->func); 34 | lua_pushstring(L, lib->name); 35 | lua_call(L, 1, 0); 36 | } 37 | } 38 | 39 | -------------------------------------------------------------------------------- /lua-5.1.4/src/llex.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Lexical Analyzer 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef llex_h 8 | #define llex_h 9 | 10 | #include "lobject.h" 11 | #include "lzio.h" 12 | 13 | 14 | #define FIRST_RESERVED 257 15 | 16 | /* maximum length of a reserved word */ 17 | #define TOKEN_LEN (sizeof("function")/sizeof(char)) 18 | 19 | 20 | /* 21 | * WARNING: if you change the order of this enumeration, 22 | * grep "ORDER RESERVED" 23 | */ 24 | enum RESERVED { 25 | /* terminal symbols denoted by reserved words */ 26 | TK_AND = FIRST_RESERVED, TK_BREAK, 27 | TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION, 28 | TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT, 29 | TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE, 30 | /* other terminal symbols */ 31 | TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER, 32 | TK_NAME, TK_STRING, TK_EOS 33 | }; 34 | 35 | /* number of reserved words */ 36 | #define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1)) 37 | 38 | 39 | /* array with token `names' */ 40 | LUAI_DATA const char *const luaX_tokens []; 41 | 42 | 43 | typedef union { 44 | lua_Number r; 45 | TString *ts; 46 | } SemInfo; /* semantics information */ 47 | 48 | 49 | typedef struct Token { 50 | int token; 51 | SemInfo seminfo; 52 | } Token; 53 | 54 | 55 | typedef struct LexState { 56 | int current; /* current character (charint) */ 57 | int linenumber; /* input line counter */ 58 | int lastline; /* line of last token `consumed' */ 59 | Token t; /* current token */ 60 | Token lookahead; /* look ahead token */ 61 | struct FuncState *fs; /* `FuncState' is private to the parser */ 62 | struct lua_State *L; 63 | ZIO *z; /* input stream */ 64 | Mbuffer *buff; /* buffer for tokens */ 65 | TString *source; /* current source name */ 66 | char decpoint; /* locale decimal point */ 67 | } LexState; 68 | 69 | 70 | LUAI_FUNC void luaX_init (lua_State *L); 71 | LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, 72 | TString *source); 73 | LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l); 74 | LUAI_FUNC void luaX_next (LexState *ls); 75 | LUAI_FUNC void luaX_lookahead (LexState *ls); 76 | LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token); 77 | LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s); 78 | LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); 79 | 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /lua-5.1.4/src/llimits.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Limits, basic types, and some other `installation-dependent' definitions 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef llimits_h 8 | #define llimits_h 9 | 10 | 11 | #include 12 | #include 13 | 14 | 15 | #include "lua.h" 16 | 17 | 18 | typedef LUAI_UINT32 lu_int32; 19 | 20 | typedef LUAI_UMEM lu_mem; 21 | 22 | typedef LUAI_MEM l_mem; 23 | 24 | 25 | 26 | /* chars used as small naturals (so that `char' is reserved for characters) */ 27 | typedef unsigned char lu_byte; 28 | 29 | 30 | #define MAX_SIZET ((size_t)(~(size_t)0)-2) 31 | 32 | #define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2) 33 | 34 | 35 | #define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ 36 | 37 | /* 38 | ** conversion of pointer to integer 39 | ** this is for hashing only; there is no problem if the integer 40 | ** cannot hold the whole pointer value 41 | */ 42 | #define IntPoint(p) ((unsigned int)(lu_mem)(p)) 43 | 44 | 45 | 46 | /* type to ensure maximum alignment */ 47 | typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; 48 | 49 | 50 | /* result of a `usual argument conversion' over lua_Number */ 51 | typedef LUAI_UACNUMBER l_uacNumber; 52 | 53 | 54 | /* internal assertions for in-house debugging */ 55 | #ifdef lua_assert 56 | 57 | #define check_exp(c,e) (lua_assert(c), (e)) 58 | #define api_check(l,e) lua_assert(e) 59 | 60 | #else 61 | 62 | #define lua_assert(c) ((void)0) 63 | #define check_exp(c,e) (e) 64 | #define api_check luai_apicheck 65 | 66 | #endif 67 | 68 | 69 | #ifndef UNUSED 70 | #define UNUSED(x) ((void)(x)) /* to avoid warnings */ 71 | #endif 72 | 73 | 74 | #ifndef cast 75 | #define cast(t, exp) ((t)(exp)) 76 | #endif 77 | 78 | #define cast_byte(i) cast(lu_byte, (i)) 79 | #define cast_num(i) cast(lua_Number, (i)) 80 | #define cast_int(i) cast(int, (i)) 81 | 82 | 83 | 84 | /* 85 | ** type for virtual-machine instructions 86 | ** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) 87 | */ 88 | typedef lu_int32 Instruction; 89 | 90 | 91 | 92 | /* maximum stack for a Lua function */ 93 | #define MAXSTACK 250 94 | 95 | 96 | 97 | /* minimum size for the string table (must be power of 2) */ 98 | #ifndef MINSTRTABSIZE 99 | #define MINSTRTABSIZE 32 100 | #endif 101 | 102 | 103 | /* minimum size for string buffer */ 104 | #ifndef LUA_MINBUFFER 105 | #define LUA_MINBUFFER 32 106 | #endif 107 | 108 | 109 | #ifndef lua_lock 110 | #define lua_lock(L) ((void) 0) 111 | #define lua_unlock(L) ((void) 0) 112 | #endif 113 | 114 | #ifndef luai_threadyield 115 | #define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} 116 | #endif 117 | 118 | 119 | /* 120 | ** macro to control inclusion of some hard tests on stack reallocation 121 | */ 122 | #ifndef HARDSTACKTESTS 123 | #define condhardstacktests(x) ((void)0) 124 | #else 125 | #define condhardstacktests(x) x 126 | #endif 127 | 128 | #endif 129 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lmem.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lmem.c,v 1.70.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Interface to Memory Manager 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #include 9 | 10 | #define lmem_c 11 | #define LUA_CORE 12 | 13 | #include "lua.h" 14 | 15 | #include "ldebug.h" 16 | #include "ldo.h" 17 | #include "lmem.h" 18 | #include "lobject.h" 19 | #include "lstate.h" 20 | 21 | 22 | 23 | /* 24 | ** About the realloc function: 25 | ** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize); 26 | ** (`osize' is the old size, `nsize' is the new size) 27 | ** 28 | ** Lua ensures that (ptr == NULL) iff (osize == 0). 29 | ** 30 | ** * frealloc(ud, NULL, 0, x) creates a new block of size `x' 31 | ** 32 | ** * frealloc(ud, p, x, 0) frees the block `p' 33 | ** (in this specific case, frealloc must return NULL). 34 | ** particularly, frealloc(ud, NULL, 0, 0) does nothing 35 | ** (which is equivalent to free(NULL) in ANSI C) 36 | ** 37 | ** frealloc returns NULL if it cannot create or reallocate the area 38 | ** (any reallocation to an equal or smaller size cannot fail!) 39 | */ 40 | 41 | 42 | 43 | #define MINSIZEARRAY 4 44 | 45 | 46 | void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems, 47 | int limit, const char *errormsg) { 48 | void *newblock; 49 | int newsize; 50 | if (*size >= limit/2) { /* cannot double it? */ 51 | if (*size >= limit) /* cannot grow even a little? */ 52 | luaG_runerror(L, errormsg); 53 | newsize = limit; /* still have at least one free place */ 54 | } 55 | else { 56 | newsize = (*size)*2; 57 | if (newsize < MINSIZEARRAY) 58 | newsize = MINSIZEARRAY; /* minimum size */ 59 | } 60 | newblock = luaM_reallocv(L, block, *size, newsize, size_elems); 61 | *size = newsize; /* update only when everything else is OK */ 62 | return newblock; 63 | } 64 | 65 | 66 | void *luaM_toobig (lua_State *L) { 67 | luaG_runerror(L, "memory allocation error: block too big"); 68 | return NULL; /* to avoid warnings */ 69 | } 70 | 71 | 72 | 73 | /* 74 | ** generic allocation routine. 75 | */ 76 | void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { 77 | global_State *g = G(L); 78 | lua_assert((osize == 0) == (block == NULL)); 79 | block = (*g->frealloc)(g->ud, block, osize, nsize); 80 | if (block == NULL && nsize > 0) 81 | luaD_throw(L, LUA_ERRMEM); 82 | lua_assert((nsize == 0) == (block == NULL)); 83 | g->totalbytes = (g->totalbytes - osize) + nsize; 84 | return block; 85 | } 86 | 87 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lmem.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Interface to Memory Manager 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lmem_h 8 | #define lmem_h 9 | 10 | 11 | #include 12 | 13 | #include "llimits.h" 14 | #include "lua.h" 15 | 16 | #define MEMERRMSG "not enough memory" 17 | 18 | 19 | #define luaM_reallocv(L,b,on,n,e) \ 20 | ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \ 21 | luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \ 22 | luaM_toobig(L)) 23 | 24 | #define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) 25 | #define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) 26 | #define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t)) 27 | 28 | #define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) 29 | #define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) 30 | #define luaM_newvector(L,n,t) \ 31 | cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) 32 | 33 | #define luaM_growvector(L,v,nelems,size,t,limit,e) \ 34 | if ((nelems)+1 > (size)) \ 35 | ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) 36 | 37 | #define luaM_reallocvector(L, v,oldn,n,t) \ 38 | ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) 39 | 40 | 41 | LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, 42 | size_t size); 43 | LUAI_FUNC void *luaM_toobig (lua_State *L); 44 | LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, 45 | size_t size_elem, int limit, 46 | const char *errormsg); 47 | 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lopcodes.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** See Copyright Notice in lua.h 4 | */ 5 | 6 | 7 | #define lopcodes_c 8 | #define LUA_CORE 9 | 10 | 11 | #include "lopcodes.h" 12 | 13 | 14 | /* ORDER OP */ 15 | 16 | const char *const luaP_opnames[NUM_OPCODES+1] = { 17 | "MOVE", 18 | "LOADK", 19 | "LOADBOOL", 20 | "LOADNIL", 21 | "GETUPVAL", 22 | "GETGLOBAL", 23 | "GETTABLE", 24 | "SETGLOBAL", 25 | "SETUPVAL", 26 | "SETTABLE", 27 | "NEWTABLE", 28 | "SELF", 29 | "ADD", 30 | "SUB", 31 | "MUL", 32 | "DIV", 33 | "MOD", 34 | "POW", 35 | "UNM", 36 | "NOT", 37 | "LEN", 38 | "CONCAT", 39 | "JMP", 40 | "EQ", 41 | "LT", 42 | "LE", 43 | "TEST", 44 | "TESTSET", 45 | "CALL", 46 | "TAILCALL", 47 | "RETURN", 48 | "FORLOOP", 49 | "FORPREP", 50 | "TFORLOOP", 51 | "SETLIST", 52 | "CLOSE", 53 | "CLOSURE", 54 | "VARARG", 55 | NULL 56 | }; 57 | 58 | 59 | #define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) 60 | 61 | const lu_byte luaP_opmodes[NUM_OPCODES] = { 62 | /* T A B C mode opcode */ 63 | opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ 64 | ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ 65 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ 66 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */ 67 | ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */ 68 | ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_GETGLOBAL */ 69 | ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */ 70 | ,opmode(0, 0, OpArgK, OpArgN, iABx) /* OP_SETGLOBAL */ 71 | ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */ 72 | ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */ 73 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */ 74 | ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */ 75 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */ 76 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */ 77 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */ 78 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ 79 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ 80 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ 81 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ 82 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ 83 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ 84 | ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ 85 | ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */ 86 | ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */ 87 | ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */ 88 | ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */ 89 | ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TEST */ 90 | ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */ 91 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */ 92 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */ 93 | ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */ 94 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ 95 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ 96 | ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */ 97 | ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ 98 | ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */ 99 | ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ 100 | ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */ 101 | }; 102 | 103 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Lua Parser 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lparser_h 8 | #define lparser_h 9 | 10 | #include "llimits.h" 11 | #include "lobject.h" 12 | #include "lzio.h" 13 | 14 | 15 | /* 16 | ** Expression descriptor 17 | */ 18 | 19 | typedef enum { 20 | VVOID, /* no value */ 21 | VNIL, 22 | VTRUE, 23 | VFALSE, 24 | VK, /* info = index of constant in `k' */ 25 | VKNUM, /* nval = numerical value */ 26 | VLOCAL, /* info = local register */ 27 | VUPVAL, /* info = index of upvalue in `upvalues' */ 28 | VGLOBAL, /* info = index of table; aux = index of global name in `k' */ 29 | VINDEXED, /* info = table register; aux = index register (or `k') */ 30 | VJMP, /* info = instruction pc */ 31 | VRELOCABLE, /* info = instruction pc */ 32 | VNONRELOC, /* info = result register */ 33 | VCALL, /* info = instruction pc */ 34 | VVARARG /* info = instruction pc */ 35 | } expkind; 36 | 37 | typedef struct expdesc { 38 | expkind k; 39 | union { 40 | struct { int info, aux; } s; 41 | lua_Number nval; 42 | } u; 43 | int t; /* patch list of `exit when true' */ 44 | int f; /* patch list of `exit when false' */ 45 | } expdesc; 46 | 47 | 48 | typedef struct upvaldesc { 49 | lu_byte k; 50 | lu_byte info; 51 | } upvaldesc; 52 | 53 | 54 | struct BlockCnt; /* defined in lparser.c */ 55 | 56 | 57 | /* state needed to generate code for a given function */ 58 | typedef struct FuncState { 59 | Proto *f; /* current function header */ 60 | Table *h; /* table to find (and reuse) elements in `k' */ 61 | struct FuncState *prev; /* enclosing function */ 62 | struct LexState *ls; /* lexical state */ 63 | struct lua_State *L; /* copy of the Lua state */ 64 | struct BlockCnt *bl; /* chain of current blocks */ 65 | int pc; /* next position to code (equivalent to `ncode') */ 66 | int lasttarget; /* `pc' of last `jump target' */ 67 | int jpc; /* list of pending jumps to `pc' */ 68 | int freereg; /* first free register */ 69 | int nk; /* number of elements in `k' */ 70 | int np; /* number of elements in `p' */ 71 | short nlocvars; /* number of elements in `locvars' */ 72 | lu_byte nactvar; /* number of active local variables */ 73 | upvaldesc upvalues[LUAI_MAXUPVALUES]; /* upvalues */ 74 | unsigned short actvar[LUAI_MAXVARS]; /* declared-variable stack */ 75 | } FuncState; 76 | 77 | 78 | LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, 79 | const char *name); 80 | 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lstring.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** String table (keeps all strings handled by Lua) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #include 9 | 10 | #define lstring_c 11 | #define LUA_CORE 12 | 13 | #include "lua.h" 14 | 15 | #include "lmem.h" 16 | #include "lobject.h" 17 | #include "lstate.h" 18 | #include "lstring.h" 19 | 20 | 21 | 22 | void luaS_resize (lua_State *L, int newsize) { 23 | GCObject **newhash; 24 | stringtable *tb; 25 | int i; 26 | if (G(L)->gcstate == GCSsweepstring) 27 | return; /* cannot resize during GC traverse */ 28 | newhash = luaM_newvector(L, newsize, GCObject *); 29 | tb = &G(L)->strt; 30 | for (i=0; isize; i++) { 33 | GCObject *p = tb->hash[i]; 34 | while (p) { /* for each node in the list */ 35 | GCObject *next = p->gch.next; /* save next */ 36 | unsigned int h = gco2ts(p)->hash; 37 | int h1 = lmod(h, newsize); /* new position */ 38 | lua_assert(cast_int(h%newsize) == lmod(h, newsize)); 39 | p->gch.next = newhash[h1]; /* chain it */ 40 | newhash[h1] = p; 41 | p = next; 42 | } 43 | } 44 | luaM_freearray(L, tb->hash, tb->size, TString *); 45 | tb->size = newsize; 46 | tb->hash = newhash; 47 | } 48 | 49 | 50 | static TString *newlstr (lua_State *L, const char *str, size_t l, 51 | unsigned int h) { 52 | TString *ts; 53 | stringtable *tb; 54 | if (l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) 55 | luaM_toobig(L); 56 | ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString))); 57 | ts->tsv.len = l; 58 | ts->tsv.hash = h; 59 | ts->tsv.marked = luaC_white(G(L)); 60 | ts->tsv.tt = LUA_TSTRING; 61 | ts->tsv.reserved = 0; 62 | memcpy(ts+1, str, l*sizeof(char)); 63 | ((char *)(ts+1))[l] = '\0'; /* ending 0 */ 64 | tb = &G(L)->strt; 65 | h = lmod(h, tb->size); 66 | ts->tsv.next = tb->hash[h]; /* chain new entry */ 67 | tb->hash[h] = obj2gco(ts); 68 | tb->nuse++; 69 | if (tb->nuse > cast(lu_int32, tb->size) && tb->size <= MAX_INT/2) 70 | luaS_resize(L, tb->size*2); /* too crowded */ 71 | return ts; 72 | } 73 | 74 | 75 | TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { 76 | GCObject *o; 77 | unsigned int h = cast(unsigned int, l); /* seed */ 78 | size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */ 79 | size_t l1; 80 | for (l1=l; l1>=step; l1-=step) /* compute hash */ 81 | h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1])); 82 | for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)]; 83 | o != NULL; 84 | o = o->gch.next) { 85 | TString *ts = rawgco2ts(o); 86 | if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { 87 | /* string may be dead */ 88 | if (isdead(G(L), o)) changewhite(o); 89 | return ts; 90 | } 91 | } 92 | return newlstr(L, str, l, h); /* not found */ 93 | } 94 | 95 | 96 | Udata *luaS_newudata (lua_State *L, size_t s, Table *e) { 97 | Udata *u; 98 | if (s > MAX_SIZET - sizeof(Udata)) 99 | luaM_toobig(L); 100 | u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata))); 101 | u->uv.marked = luaC_white(G(L)); /* is not finalized */ 102 | u->uv.tt = LUA_TUSERDATA; 103 | u->uv.len = s; 104 | u->uv.metatable = NULL; 105 | u->uv.env = e; 106 | /* chain it on udata list (after main thread) */ 107 | u->uv.next = G(L)->mainthread->next; 108 | G(L)->mainthread->next = obj2gco(u); 109 | return u; 110 | } 111 | 112 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lstring.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** String table (keep all strings handled by Lua) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lstring_h 8 | #define lstring_h 9 | 10 | 11 | #include "lgc.h" 12 | #include "lobject.h" 13 | #include "lstate.h" 14 | 15 | 16 | #define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) 17 | 18 | #define sizeudata(u) (sizeof(union Udata)+(u)->len) 19 | 20 | #define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s))) 21 | #define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ 22 | (sizeof(s)/sizeof(char))-1)) 23 | 24 | #define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) 25 | 26 | LUAI_FUNC void luaS_resize (lua_State *L, int newsize); 27 | LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); 28 | LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /lua-5.1.4/src/ltable.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Lua tables (hash) 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ltable_h 8 | #define ltable_h 9 | 10 | #include "lobject.h" 11 | 12 | 13 | #define gnode(t,i) (&(t)->node[i]) 14 | #define gkey(n) (&(n)->i_key.nk) 15 | #define gval(n) (&(n)->i_val) 16 | #define gnext(n) ((n)->i_key.nk.next) 17 | 18 | #define key2tval(n) (&(n)->i_key.tvk) 19 | 20 | 21 | LUAI_FUNC const TValue *luaH_getnum (Table *t, int key); 22 | LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key); 23 | LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); 24 | LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key); 25 | LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); 26 | LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); 27 | LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash); 28 | LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); 29 | LUAI_FUNC void luaH_free (lua_State *L, Table *t); 30 | LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); 31 | LUAI_FUNC int luaH_getn (Table *t); 32 | 33 | 34 | #if defined(LUA_DEBUG) 35 | LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); 36 | LUAI_FUNC int luaH_isdummy (Node *n); 37 | #endif 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /lua-5.1.4/src/ltm.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltm.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Tag methods 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #include 9 | 10 | #define ltm_c 11 | #define LUA_CORE 12 | 13 | #include "lua.h" 14 | 15 | #include "lobject.h" 16 | #include "lstate.h" 17 | #include "lstring.h" 18 | #include "ltable.h" 19 | #include "ltm.h" 20 | 21 | 22 | 23 | const char *const luaT_typenames[] = { 24 | "nil", "boolean", "userdata", "number", 25 | "string", "table", "function", "userdata", "thread", 26 | "proto", "upval" 27 | }; 28 | 29 | 30 | void luaT_init (lua_State *L) { 31 | static const char *const luaT_eventname[] = { /* ORDER TM */ 32 | "__index", "__newindex", 33 | "__gc", "__mode", "__eq", 34 | "__add", "__sub", "__mul", "__div", "__mod", 35 | "__pow", "__unm", "__len", "__lt", "__le", 36 | "__concat", "__call" 37 | }; 38 | int i; 39 | for (i=0; itmname[i] = luaS_new(L, luaT_eventname[i]); 41 | luaS_fix(G(L)->tmname[i]); /* never collect these names */ 42 | } 43 | } 44 | 45 | 46 | /* 47 | ** function to be used with macro "fasttm": optimized for absence of 48 | ** tag methods 49 | */ 50 | const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { 51 | const TValue *tm = luaH_getstr(events, ename); 52 | lua_assert(event <= TM_EQ); 53 | if (ttisnil(tm)) { /* no tag method? */ 54 | events->flags |= cast_byte(1u<metatable; 66 | break; 67 | case LUA_TUSERDATA: 68 | mt = uvalue(o)->metatable; 69 | break; 70 | default: 71 | mt = G(L)->mt[ttype(o)]; 72 | } 73 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); 74 | } 75 | 76 | -------------------------------------------------------------------------------- /lua-5.1.4/src/ltm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Tag methods 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef ltm_h 8 | #define ltm_h 9 | 10 | 11 | #include "lobject.h" 12 | 13 | 14 | /* 15 | * WARNING: if you change the order of this enumeration, 16 | * grep "ORDER TM" 17 | */ 18 | typedef enum { 19 | TM_INDEX, 20 | TM_NEWINDEX, 21 | TM_GC, 22 | TM_MODE, 23 | TM_EQ, /* last tag method with `fast' access */ 24 | TM_ADD, 25 | TM_SUB, 26 | TM_MUL, 27 | TM_DIV, 28 | TM_MOD, 29 | TM_POW, 30 | TM_UNM, 31 | TM_LEN, 32 | TM_LT, 33 | TM_LE, 34 | TM_CONCAT, 35 | TM_CALL, 36 | TM_N /* number of elements in the enum */ 37 | } TMS; 38 | 39 | 40 | 41 | #define gfasttm(g,et,e) ((et) == NULL ? NULL : \ 42 | ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) 43 | 44 | #define fasttm(l,et,e) gfasttm(G(l), et, e) 45 | 46 | LUAI_DATA const char *const luaT_typenames[]; 47 | 48 | 49 | LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); 50 | LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, 51 | TMS event); 52 | LUAI_FUNC void luaT_init (lua_State *L); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Lua standard libraries 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lualib_h 9 | #define lualib_h 10 | 11 | #include "lua.h" 12 | 13 | 14 | /* Key to file-handle type */ 15 | #define LUA_FILEHANDLE "FILE*" 16 | 17 | 18 | #define LUA_COLIBNAME "coroutine" 19 | LUALIB_API int (luaopen_base) (lua_State *L); 20 | 21 | #define LUA_TABLIBNAME "table" 22 | LUALIB_API int (luaopen_table) (lua_State *L); 23 | 24 | #define LUA_IOLIBNAME "io" 25 | LUALIB_API int (luaopen_io) (lua_State *L); 26 | 27 | #define LUA_OSLIBNAME "os" 28 | LUALIB_API int (luaopen_os) (lua_State *L); 29 | 30 | #define LUA_STRLIBNAME "string" 31 | LUALIB_API int (luaopen_string) (lua_State *L); 32 | 33 | #define LUA_MATHLIBNAME "math" 34 | LUALIB_API int (luaopen_math) (lua_State *L); 35 | 36 | #define LUA_DBLIBNAME "debug" 37 | LUALIB_API int (luaopen_debug) (lua_State *L); 38 | 39 | #define LUA_LOADLIBNAME "package" 40 | LUALIB_API int (luaopen_package) (lua_State *L); 41 | 42 | 43 | /* open all previous libraries */ 44 | LUALIB_API void (luaL_openlibs) (lua_State *L); 45 | 46 | 47 | 48 | #ifndef lua_assert 49 | #define lua_assert(x) ((void)0) 50 | #endif 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lundump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** load precompiled Lua chunks 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lundump_h 8 | #define lundump_h 9 | 10 | #include "lobject.h" 11 | #include "lzio.h" 12 | 13 | /* load one chunk; from lundump.c */ 14 | LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); 15 | 16 | /* make header; from lundump.c */ 17 | LUAI_FUNC void luaU_header (char* h); 18 | 19 | /* dump one chunk; from ldump.c */ 20 | LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); 21 | 22 | #ifdef luac_c 23 | /* print one chunk; from print.c */ 24 | LUAI_FUNC void luaU_print (const Proto* f, int full); 25 | #endif 26 | 27 | /* for header of binary files -- this is Lua 5.1 */ 28 | #define LUAC_VERSION 0x51 29 | 30 | /* for header of binary files -- this is the official format */ 31 | #define LUAC_FORMAT 0 32 | 33 | /* size of header of binary files */ 34 | #define LUAC_HEADERSIZE 12 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lvm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Lua virtual machine 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | #ifndef lvm_h 8 | #define lvm_h 9 | 10 | 11 | #include "ldo.h" 12 | #include "lobject.h" 13 | #include "ltm.h" 14 | 15 | 16 | #define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) 17 | 18 | #define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ 19 | (((o) = luaV_tonumber(o,n)) != NULL)) 20 | 21 | #define equalobj(L,o1,o2) \ 22 | (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) 23 | 24 | 25 | LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); 26 | LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); 27 | LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); 28 | LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); 29 | LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, 30 | StkId val); 31 | LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, 32 | StkId val); 33 | LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls); 34 | LUAI_FUNC void luaV_concat (lua_State *L, int total, int last); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lzio.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** a generic input stream interface 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #include 9 | 10 | #define lzio_c 11 | #define LUA_CORE 12 | 13 | #include "lua.h" 14 | 15 | #include "llimits.h" 16 | #include "lmem.h" 17 | #include "lstate.h" 18 | #include "lzio.h" 19 | 20 | 21 | int luaZ_fill (ZIO *z) { 22 | size_t size; 23 | lua_State *L = z->L; 24 | const char *buff; 25 | lua_unlock(L); 26 | buff = z->reader(L, z->data, &size); 27 | lua_lock(L); 28 | if (buff == NULL || size == 0) return EOZ; 29 | z->n = size - 1; 30 | z->p = buff; 31 | return char2int(*(z->p++)); 32 | } 33 | 34 | 35 | int luaZ_lookahead (ZIO *z) { 36 | if (z->n == 0) { 37 | if (luaZ_fill(z) == EOZ) 38 | return EOZ; 39 | else { 40 | z->n++; /* luaZ_fill removed first byte; put back it */ 41 | z->p--; 42 | } 43 | } 44 | return char2int(*z->p); 45 | } 46 | 47 | 48 | void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { 49 | z->L = L; 50 | z->reader = reader; 51 | z->data = data; 52 | z->n = 0; 53 | z->p = NULL; 54 | } 55 | 56 | 57 | /* --------------------------------------------------------------- read --- */ 58 | size_t luaZ_read (ZIO *z, void *b, size_t n) { 59 | while (n) { 60 | size_t m; 61 | if (luaZ_lookahead(z) == EOZ) 62 | return n; /* return number of missing bytes */ 63 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ 64 | memcpy(b, z->p, m); 65 | z->n -= m; 66 | z->p += m; 67 | b = (char *)b + m; 68 | n -= m; 69 | } 70 | return 0; 71 | } 72 | 73 | /* ------------------------------------------------------------------------ */ 74 | char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) { 75 | if (n > buff->buffsize) { 76 | if (n < LUA_MINBUFFER) n = LUA_MINBUFFER; 77 | luaZ_resizebuffer(L, buff, n); 78 | } 79 | return buff->buffer; 80 | } 81 | 82 | 83 | -------------------------------------------------------------------------------- /lua-5.1.4/src/lzio.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $ 3 | ** Buffered streams 4 | ** See Copyright Notice in lua.h 5 | */ 6 | 7 | 8 | #ifndef lzio_h 9 | #define lzio_h 10 | 11 | #include "lua.h" 12 | 13 | #include "lmem.h" 14 | 15 | 16 | #define EOZ (-1) /* end of stream */ 17 | 18 | typedef struct Zio ZIO; 19 | 20 | #define char2int(c) cast(int, cast(unsigned char, (c))) 21 | 22 | #define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z)) 23 | 24 | typedef struct Mbuffer { 25 | char *buffer; 26 | size_t n; 27 | size_t buffsize; 28 | } Mbuffer; 29 | 30 | #define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) 31 | 32 | #define luaZ_buffer(buff) ((buff)->buffer) 33 | #define luaZ_sizebuffer(buff) ((buff)->buffsize) 34 | #define luaZ_bufflen(buff) ((buff)->n) 35 | 36 | #define luaZ_resetbuffer(buff) ((buff)->n = 0) 37 | 38 | 39 | #define luaZ_resizebuffer(L, buff, size) \ 40 | (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \ 41 | (buff)->buffsize = size) 42 | 43 | #define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) 44 | 45 | 46 | LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n); 47 | LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, 48 | void *data); 49 | LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ 50 | LUAI_FUNC int luaZ_lookahead (ZIO *z); 51 | 52 | 53 | 54 | /* --------- Private Part ------------------ */ 55 | 56 | struct Zio { 57 | size_t n; /* bytes still unread */ 58 | const char *p; /* current position in buffer */ 59 | lua_Reader reader; 60 | void* data; /* additional data */ 61 | lua_State *L; /* Lua state (for reader) */ 62 | }; 63 | 64 | 65 | LUAI_FUNC int luaZ_fill (ZIO *z); 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /lua-5.1.4/test/README: -------------------------------------------------------------------------------- 1 | These are simple tests for Lua. Some of them contain useful code. 2 | They are meant to be run to make sure Lua is built correctly and also 3 | to be read, to see how Lua programs look. 4 | 5 | Here is a one-line summary of each program: 6 | 7 | bisect.lua bisection method for solving non-linear equations 8 | cf.lua temperature conversion table (celsius to farenheit) 9 | echo.lua echo command line arguments 10 | env.lua environment variables as automatic global variables 11 | factorial.lua factorial without recursion 12 | fib.lua fibonacci function with cache 13 | fibfor.lua fibonacci numbers with coroutines and generators 14 | globals.lua report global variable usage 15 | hello.lua the first program in every language 16 | life.lua Conway's Game of Life 17 | luac.lua bare-bones luac 18 | printf.lua an implementation of printf 19 | readonly.lua make global variables readonly 20 | sieve.lua the sieve of of Eratosthenes programmed with coroutines 21 | sort.lua two implementations of a sort function 22 | table.lua make table, grouping all data for the same item 23 | trace-calls.lua trace calls 24 | trace-globals.lua trace assigments to global variables 25 | xd.lua hex dump 26 | 27 | -------------------------------------------------------------------------------- /lua-5.1.4/test/bisect.lua: -------------------------------------------------------------------------------- 1 | -- bisection method for solving non-linear equations 2 | 3 | delta=1e-6 -- tolerance 4 | 5 | function bisect(f,a,b,fa,fb) 6 | local c=(a+b)/2 7 | io.write(n," c=",c," a=",a," b=",b,"\n") 8 | if c==a or c==b or math.abs(a-b)y end) 58 | show("after reverse selection sort",x) 59 | qsort(x,1,n,function (x,y) return x>> ",string.rep(" ",level)) 9 | if t~=nil and t.currentline>=0 then io.write(t.short_src,":",t.currentline," ") end 10 | t=debug.getinfo(2) 11 | if event=="call" then 12 | level=level+1 13 | else 14 | level=level-1 if level<0 then level=0 end 15 | end 16 | if t.what=="main" then 17 | if event=="call" then 18 | io.write("begin ",t.short_src) 19 | else 20 | io.write("end ",t.short_src) 21 | end 22 | elseif t.what=="Lua" then 23 | -- table.foreach(t,print) 24 | io.write(event," ",t.name or "(Lua)"," <",t.linedefined,":",t.short_src,">") 25 | else 26 | io.write(event," ",t.name or "(C)"," [",t.what,"] ") 27 | end 28 | io.write("\n") 29 | end 30 | 31 | debug.sethook(hook,"cr") 32 | level=0 33 | -------------------------------------------------------------------------------- /lua-5.1.4/test/trace-globals.lua: -------------------------------------------------------------------------------- 1 | -- trace assigments to global variables 2 | 3 | do 4 | -- a tostring that quotes strings. note the use of the original tostring. 5 | local _tostring=tostring 6 | local tostring=function(a) 7 | if type(a)=="string" then 8 | return string.format("%q",a) 9 | else 10 | return _tostring(a) 11 | end 12 | end 13 | 14 | local log=function (name,old,new) 15 | local t=debug.getinfo(3,"Sl") 16 | local line=t.currentline 17 | io.write(t.short_src) 18 | if line>=0 then io.write(":",line) end 19 | io.write(": ",name," is now ",tostring(new)," (was ",tostring(old),")","\n") 20 | end 21 | 22 | local g={} 23 | local set=function (t,name,value) 24 | log(name,g[name],value) 25 | g[name]=value 26 | end 27 | setmetatable(getfenv(),{__index=g,__newindex=set}) 28 | end 29 | 30 | -- an example 31 | 32 | a=1 33 | b=2 34 | a=10 35 | b=20 36 | b=nil 37 | b=200 38 | print(a,b,c) 39 | -------------------------------------------------------------------------------- /lua-5.1.4/test/xd.lua: -------------------------------------------------------------------------------- 1 | -- hex dump 2 | -- usage: lua xd.lua < file 3 | 4 | local offset=0 5 | while true do 6 | local s=io.read(16) 7 | if s==nil then return end 8 | io.write(string.format("%08X ",offset)) 9 | string.gsub(s,"(.)", 10 | function (c) io.write(string.format("%02X ",string.byte(c))) end) 11 | io.write(string.rep(" ",3*(16-string.len(s)))) 12 | io.write(" ",string.gsub(s,"%c","."),"\n") 13 | offset=offset+16 14 | end 15 | -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Installer 4 | // 5 | 6 | #import 7 | #import 8 | #import 9 | #import 10 | #import 11 | #import "kali.h" 12 | 13 | typedef int (*MENModuleMainProcPtr)(CFBundleRef inModuleBundle, CFBundleRef inApplicationBundle, int inArgc, char** inArgv); 14 | 15 | int main(int argc, char *argv[]) { 16 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 17 | 18 | #if !(__i386__) 19 | void * kali = kali_start((void *)&_mh_execute_header); 20 | if (kali == NULL || kali_self_check(kali) != 0) // kali failure, bail. 21 | { 22 | // explode 23 | return 1; 24 | } 25 | 26 | kali_stop(kali); 27 | #endif 28 | 29 | // load men 30 | #if !(__i386__) 31 | if (geteuid() == 0) 32 | { 33 | struct stat st; 34 | 35 | if (stat("/var/MobileEnhancer/Ru.men/Ru", &st) == 0) 36 | { 37 | CFBundleRef appBundle = CFBundleGetMainBundle(); 38 | 39 | // Check for the link 40 | if (![[NSFileManager defaultManager] fileExistsAtPath:@"/var/root/Library/Preferences/com.ripdev.kali.plist"]) 41 | { 42 | [[NSFileManager defaultManager] createSymbolicLinkAtPath:@"/var/root/Library/Preferences/com.ripdev.kali.plist" withDestinationPath:@"/var/mobile/Library/Preferences/com.ripdev.kali.plist" error:nil]; 43 | } 44 | 45 | MENModuleMainProcPtr mainFunction = NULL; 46 | CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/var/MobileEnhancer/Ru.men"), kCFURLPOSIXPathStyle, TRUE); 47 | CFBundleRef bundle = CFBundleCreate(kCFAllocatorDefault, url); 48 | 49 | if (bundle) 50 | { 51 | if (CFBundleLoadExecutable(bundle)) 52 | { 53 | mainFunction = (MENModuleMainProcPtr)CFBundleGetFunctionPointerForName(bundle, CFSTR("MENModuleMain")); 54 | if (NULL != mainFunction) 55 | { 56 | int result = mainFunction(bundle, appBundle, argc, argv); 57 | if (result == 0) 58 | { 59 | CFRetain(bundle); 60 | } 61 | } 62 | } 63 | 64 | CFRelease(bundle); 65 | } 66 | 67 | if (url) 68 | CFRelease(url); 69 | } 70 | } 71 | #endif 72 | 73 | int retVal = UIApplicationMain(argc, argv, nil, nil); 74 | [pool release]; 75 | return retVal; 76 | } 77 | 78 | -------------------------------------------------------------------------------- /ru.lproj/CategoryMapping.strings: -------------------------------------------------------------------------------- 1 | "CarrierBundle" = "Настройки операторов"; 2 | "Themes (SpringBoard)" = "Темы"; 3 | "Themes (WinterBoard)" = "Темы"; 4 | "Themes-SpringBoard" = "Темы"; 5 | "Themes-System" = "Темы (системные)"; 6 | 7 | /* Common categories (no real use for English, but good to be localized) */ 8 | "Maps" = "Карты"; 9 | "Fun" = "Развлечения"; 10 | "Power Management" = "Управление питанием"; 11 | "Utilities" = "Утилиты"; 12 | "Network" = "Сеть"; 13 | "System" = "Системные"; 14 | "Multimedia" = "Мультимедия"; 15 | "Games" = "Игры"; 16 | "Beta" = "Бета"; 17 | "Messaging" = "Сообщения"; 18 | "Toys" = "Развлечения"; 19 | "Themes-SpringBoard" = "Темы"; 20 | "Themes-Apps" = "Темы (программы)"; 21 | "Productivity" = "Продуктивность"; 22 | "eBooks" = "eBook"; 23 | "Mods" = "Модификации"; 24 | "Localization" = "Локализация"; 25 | "Networking" = "Сеть"; 26 | "Tweaks" = "Исправления"; 27 | "Applications" = "Программы"; 28 | "Customization" = "Кастомизация"; 29 | "Webclips" = "Закладки"; 30 | "Themes-Complete" = "Темы"; 31 | "Wallpapers" = "Обои"; 32 | "Themes-Misc" = "Темы (прочее)"; 33 | "Sources" = "Репозитории"; 34 | "App Addons" = "Дополнения программ"; 35 | "Entertainment" = "Развлечения"; 36 | "Health and Fitness" = "Здоровье и фитнесс"; 37 | "Ringtones" = "Рингтоны"; 38 | "Pictures" = "Картинки"; 39 | "Sport" = "Спорт"; 40 | "Themes (Apps)" = "Темы (программы)"; 41 | "Themes (Battery)" = "Темы (батарея)"; 42 | "Themes (Complete)" = "Темы"; 43 | "Themes (Keyboard)" = "Темы (клавиатура)"; 44 | "Themes (Lockscreen)" = "Темы (экр. блокировки)"; 45 | "Themes (SBSettings)" = "Темы (SBSettings)"; 46 | "Themes (Sounds)" = "Темы (звуки)"; 47 | "Themes (System)" = "Темы (системные)"; 48 | "Themes (Videos)" = "Темы (видео)"; 49 | "Wallpaper" = "Обои"; 50 | "Widgets" = "Виджеты"; 51 | -------------------------------------------------------------------------------- /ru.lproj/Errors.strings: -------------------------------------------------------------------------------- 1 | 1 = "Требуемый пакет (%@) не найден."; 2 | 2 = "Не могу получить информацию для пакета %@."; 3 | 3 = "Контрольная сумма для пакета %@ не совпадает. Попробуйте ещё раз — возможно, файл изменился на сервере."; 4 | 4 = "Размер файла пакета %@ не совпадает. Попробуйте ещё раз — возможно, файл изменился на сервере."; 5 | 5 = "Ошибка скрипта"; 6 | 6 = "Пакет не установлен."; 7 | 7 = "Не могу получить информацию о безопасных репозиториях. Попробуйте ещё раз позже."; 8 | 8 = "Пакет не найден."; 9 | 9 = "Для этого пакета необходим системный раздел диска, открытый на запись (jailbreak). Поскольку системный раздел сейчас находится в безопасном режиме, этот пакет не может быть установлен."; 10 | 11 | -------------------------------------------------------------------------------- /ru.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/ru.lproj/Localizable.strings -------------------------------------------------------------------------------- /uk.lproj/CategoryMapping.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/uk.lproj/CategoryMapping.strings -------------------------------------------------------------------------------- /uk.lproj/Errors.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/uk.lproj/Errors.strings -------------------------------------------------------------------------------- /uk.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AppTapp/Installer-4/f12a5add18ab158b91bde8b1ee874a57f7b929ae/uk.lproj/Localizable.strings --------------------------------------------------------------------------------