From 77d4e15b55ce321bc3aff3641889f4cf5043c367 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 26 Mar 2011 07:37:25 -0700 Subject: [PATCH 01/16] Improve state machine that protects against automatic fail-directs. --- CyteKit/WebViewController.mm | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 580a9ca1..2d489b35 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -453,10 +453,26 @@ float CYScrollViewDecelerationRateNormal; } - (void) webView:(WebView *)view didDecidePolicy:(CYWebPolicyDecision)decision forNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame { - if ([frame parentFrame] == nil) - if (decision == CYWebPolicyDecisionUse) - if (!error_) - request_ = request; +#if LogBrowser + NSLog(@"didDecidePolicy:%u forNavigationAction:%@ request:%@ frame:%@", decision, action, request, [request allHTTPHeaderFields], frame); +#endif + + if ([frame parentFrame] == nil) { + switch (decision) { + case CYWebPolicyDecisionIgnore: + if ([[request_ URL] isEqual:[request URL]]) + request_ = nil; + break; + + case CYWebPolicyDecisionUse: + if (!error_) + request_ = request; + break; + + default: + break; + } + } } - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id)listener { -- 2.45.2 From 1209b7de89029e86e45b6b1c4ccbf5f5d689ff6f Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 26 Mar 2011 07:46:32 -0700 Subject: [PATCH 02/16] Add back the original X-Unique-ID behavior for Add Source. --- MobileCydia.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index d919a7fb..f11037ff 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -8801,11 +8801,12 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi if (Machine_ != NULL) [request setValue:[NSString stringWithUTF8String:Machine_] forHTTPHeaderField:@"X-Machine"]; + if (UniqueID_ != nil) + [request setValue:UniqueID_ forHTTPHeaderField:@"X-Unique-ID"]; + if ([url isCydiaSecure]) { - if (UniqueID_ != nil) { - [request setValue:UniqueID_ forHTTPHeaderField:@"X-Unique-ID"]; + if (UniqueID_ != nil) [request setValue:UniqueID_ forHTTPHeaderField:@"X-Cydia-Id"]; - } } return [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease]; -- 2.45.2 From 64cc10e299272c00f01bdc2937cb45bc4b0ff118 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 29 Mar 2011 02:42:54 -0700 Subject: [PATCH 03/16] Guard setOfflineWebApplicationCacheEnabled: for 2.0. --- CyteKit/WebViewController.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index 2d489b35..e5cfbb47 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -871,7 +871,9 @@ float CYScrollViewDecelerationRateNormal; [preferences setCacheModel:WebCacheModelDocumentBrowser]; [preferences setJavaScriptCanOpenWindowsAutomatically:YES]; - [preferences setOfflineWebApplicationCacheEnabled:YES]; + + if ([preferences respondsToSelector:@selector(setOfflineWebApplicationCacheEnabled:)]) + [preferences setOfflineWebApplicationCacheEnabled:YES]; if (NSString *agent = [self applicationNameForUserAgent]) [webview setApplicationNameForUserAgent:agent]; -- 2.45.2 From 0bc841deb0831ca123af56a7e7b1f219dba0ac55 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 29 Mar 2011 02:43:07 -0700 Subject: [PATCH 04/16] Do not trust iterator.Section(): use version. --- MobileCydia.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index f11037ff..34ca69bd 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -2373,7 +2373,7 @@ struct PackageNameOrdering : _end _profile(Package$initWithVersion$Section) - section_ = iterator.Section(); + section_ = version_.Section(); _end _profile(Package$initWithVersion$Flags) -- 2.45.2 From 0c28a403f79dda44d497404d38b55ff9f3cf2dcf Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 1 Apr 2011 22:30:43 -0700 Subject: [PATCH 05/16] Parse APT sources before packages. --- MobileCydia.mm | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 34ca69bd..fe43e500 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -1338,6 +1338,7 @@ static void PackageImport(const void *key, const void *value, void *context) { - (NSString *) depictionForPackage:(NSString *)package; - (NSString *) supportForPackage:(NSString *)package; +- (metaIndex *) metaIndex; - (NSDictionary *) record; - (BOOL) trusted; @@ -1426,6 +1427,10 @@ static void PackageImport(const void *key, const void *value, void *context) { return ![[self _attributeKeys] containsObject:[NSString stringWithUTF8String:name]] && [super isKeyExcludedFromWebScript:name]; } +- (metaIndex *) metaIndex { + return index_; +} + - (void) setMetaIndex:(metaIndex *)index inPool:(apr_pool_t *)pool { [self _clear]; @@ -3539,6 +3544,15 @@ class CydiaLogCleaner : NSString *title(UCLocalize("DATABASE")); + list_ = new pkgSourceList(); + if ([self popErrorWithTitle:title forOperation:list_->ReadMainList()]) + return; + + for (pkgSourceList::const_iterator source = list_->begin(); source != list_->end(); ++source) { + Source *object([[[Source alloc] initWithMetaIndex:*source forDatabase:self inPool:pool_] autorelease]); + [sourceList_ addObject:object]; + } + _trace(); OpProgress progress; while (!cache_.Open(progress, true)) { pop: @@ -3575,10 +3589,6 @@ class CydiaLogCleaner : fetcher_ = new pkgAcquire(&status_); lock_ = NULL; - list_ = new pkgSourceList(); - if ([self popErrorWithTitle:title forOperation:list_->ReadMainList()]) - return; - if (cache_->DelCount() != 0 || cache_->InstCount() != 0) { [delegate_ addProgressEventOnMainThread:[CydiaProgressEvent eventWithMessage:UCLocalize("COUNTS_NONZERO_EX") ofType:kCydiaProgressEventTypeError] forTask:title]; return; @@ -3600,11 +3610,9 @@ class CydiaLogCleaner : return; } - for (pkgSourceList::const_iterator source = list_->begin(); source != list_->end(); ++source) { - Source *object([[[Source alloc] initWithMetaIndex:*source forDatabase:self inPool:pool_] autorelease]); - [sourceList_ addObject:object]; - - std::vector *indices = (*source)->GetIndexFiles(); + for (Source *object in (id) sourceList_) { + metaIndex *source([object metaIndex]); + std::vector *indices = source->GetIndexFiles(); for (std::vector::const_iterator index = indices->begin(); index != indices->end(); ++index) // XXX: this could be more intelligent if (dynamic_cast(*index) != NULL) { -- 2.45.2 From 3df46e741e620f87bf965cbef15b422189783f24 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 1 Apr 2011 22:51:59 -0700 Subject: [PATCH 06/16] SourcesController does not need a pkgSourceList. --- MobileCydia.mm | 4 ---- 1 file changed, 4 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index fe43e500..1f2fcddc 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -8918,10 +8918,6 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi @synchronized (database_) { era_ = [database_ era]; - pkgSourceList list; - if ([database_ popErrorWithTitle:UCLocalize("SOURCES") forOperation:list.ReadMainList()]) - return; - sources_ = [NSMutableArray arrayWithCapacity:16]; [sources_ addObjectsFromArray:[database_ sources]]; _trace(); -- 2.45.2 From 780cdb3b979c2fac81795d5eba4b3c4cd26c77eb Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 2 Apr 2011 00:41:09 -0700 Subject: [PATCH 07/16] Only do uicache during installation. --- MobileCydia.mm | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 1f2fcddc..01b8c3d5 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -5332,12 +5332,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { ] autorelease]; } -- (void) uicache { - _trace(); - system("su -c /usr/bin/uicache mobile"); - _trace(); -} - - (void) invoke:(NSInvocation *)invocation withTitle:(NSString *)title { UpdateExternalStatus(1); @@ -5415,11 +5409,6 @@ bool DepSubstrate(const pkgCache::VerIterator &iterator) { case 4: [progress_ setFinish:UCLocalize("REBOOT_DEVICE")]; break; } - UIProgressHUD *hud([delegate_ addProgressHUD]); - [hud setText:UCLocalize("LOADING")]; - [self yieldToSelector:@selector(uicache)]; - [delegate_ removeProgressHUD:hud]; - UpdateExternalStatus(Finish_ == 0 ? 0 : 2); [progress_ setRunning:false]; @@ -9690,9 +9679,23 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi } } +- (void) _uicache { + _trace(); + system("su -c /usr/bin/uicache mobile"); + _trace(); +} + +- (void) uicache { + UIProgressHUD *hud([self addProgressHUD]); + [hud setText:UCLocalize("LOADING")]; + [self yieldToSelector:@selector(_uicache)]; + [self removeProgressHUD:hud]; +} + - (void) perform_ { [database_ perform]; [self performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:YES]; + [self performSelectorOnMainThread:@selector(uicache) withObject:nil waitUntilDone:YES]; } - (void) confirmWithNavigationController:(UINavigationController *)navigation { -- 2.45.2 From 17c763ff9de9b6a9051415b4cd56da5d55d51548 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 2 Apr 2011 00:42:37 -0700 Subject: [PATCH 08/16] Remove broken/unused repairWithSelector:update. --- MobileCydia.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 01b8c3d5..1ec3187c 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -3562,8 +3562,8 @@ class CydiaLogCleaner : if (error == "dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. ") [delegate_ repairWithSelector:@selector(configure)]; - else if (error == "The package lists or status file could not be parsed or opened.") - [delegate_ repairWithSelector:@selector(update)]; + //else if (error == "The package lists or status file could not be parsed or opened.") + // [delegate_ repairWithSelector:@selector(update)]; // else if (error == "Could not get lock /var/lib/dpkg/lock - open (35 Resource temporarily unavailable)") // else if (error == "Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)") // else if (error == "Malformed Status line") -- 2.45.2 From 2b49cff9c356b460efefc1786a13002ad5f028c5 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 2 Apr 2011 00:43:13 -0700 Subject: [PATCH 09/16] Reorganize cache_.Open() to not lose errors. --- MobileCydia.mm | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 1ec3187c..ea858e99 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -3555,27 +3555,36 @@ class CydiaLogCleaner : _trace(); OpProgress progress; - while (!cache_.Open(progress, true)) { pop: - std::string error; - bool warning(!_error->PopMessage(error)); - lprintf("cache_.Open():[%s]\n", error.c_str()); - - if (error == "dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. ") - [delegate_ repairWithSelector:@selector(configure)]; - //else if (error == "The package lists or status file could not be parsed or opened.") - // [delegate_ repairWithSelector:@selector(update)]; - // else if (error == "Could not get lock /var/lib/dpkg/lock - open (35 Resource temporarily unavailable)") - // else if (error == "Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)") - // else if (error == "Malformed Status line") - // else if (error == "The list of sources could not be read.") - else { + open: + if (!cache_.Open(progress, true)) { + // XXX: what if there are errors, but Open() == true? this should be merged with popError: + while (!_error->empty()) { + std::string error; + bool warning(!_error->PopMessage(error)); + + lprintf("cache_.Open():[%s]\n", error.c_str()); + [delegate_ addProgressEventOnMainThread:[CydiaProgressEvent eventWithMessage:[NSString stringWithUTF8String:error.c_str()] ofType:(warning ? kCydiaProgressEventTypeWarning : kCydiaProgressEventTypeError)] forTask:title]; - return; + + SEL repair(NULL); + if (false); + else if (error == "dpkg was interrupted, you must manually run 'dpkg --configure -a' to correct the problem. ") + repair = @selector(configure); + //else if (error == "The package lists or status file could not be parsed or opened.") + // repair = @selector(update); + // else if (error == "Could not get lock /var/lib/dpkg/lock - open (35 Resource temporarily unavailable)") + // else if (error == "Could not open lock file /var/lib/dpkg/lock - open (13 Permission denied)") + // else if (error == "Malformed Status line") + // else if (error == "The list of sources could not be read.") + + if (repair != NULL) { + _error->Discard(); + [delegate_ repairWithSelector:repair]; + goto open; + } } - if (warning) - goto pop; - _error->Discard(); + return; } _trace(); -- 2.45.2 From f9cda597ef28710bf82474dba9a1e74b716d3287 Mon Sep 17 00:00:00 2001 From: Grant Paul Date: Wed, 6 Apr 2011 21:05:16 -0700 Subject: [PATCH 10/16] Update Swedish translation. --- MobileCydia.app/Swedish.lproj/Localizable.strings | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MobileCydia.app/Swedish.lproj/Localizable.strings b/MobileCydia.app/Swedish.lproj/Localizable.strings index 5a623195..4d29c0b0 100644 --- a/MobileCydia.app/Swedish.lproj/Localizable.strings +++ b/MobileCydia.app/Swedish.lproj/Localizable.strings @@ -28,7 +28,7 @@ "COMMA_DELIMITED" = "%@, %@"; "COMING_SOON" = "Kommer snart!"; "COMPLETE" = "Klar"; -"COMPLETE_UPGRADE" = "Uppgraderingen avklarad"; +"COMPLETE_UPGRADE" = "Uppgradera allt"; "CONFIGURATION_UPGRADE" = "Uppgradering av konfiguration"; "CONFIGURATION_UPGRADE_EX" = "Följande fil har ändrats av både paketägaren och av dig (eller för dig av ett skript)."; "COMMERCIAL_APPLICATIONS" = "Kommersiella applikationer"; @@ -141,7 +141,7 @@ "QUEUED_FOR" = "Köad för %@"; "QUESTION" = "%@?"; "REBOOT_DEVICE" = "Starta om enheten"; -"RECENT_CHANGES_UPDATES" = "Senaste ändringarna/uppdateringarna"; +"RECENT_CHANGES_UPDATES" = "Senaste ändringarna/uppgraderingarna"; "RECOMMENDED_BOOKS" = "Rekommenderade böcker"; "REFRESH" = "Uppdatera"; "REFRESHING_DATA" = "Uppdaterar data"; @@ -202,7 +202,7 @@ "UPDATING_DATABASE" = "Uppdaterar databasen"; "UPDATING_SOURCES" = "Uppdaterar källorna"; "UPGRADE" = "Uppdatera"; -"UPGRADE_ESSENTIAL" = "Uppdatera grundläggande"; +"UPGRADE_ESSENTIAL" = "Uppgradera grundläggande"; "UPGRADING_TO_READ_THIS" = "Uppdatering till %@? Läs följande"; "USER" = "Användare"; "USER_EX" = "Appar, Anpassningar, och Teman."; -- 2.45.2 From 38eb4ea9ac7acfbe96bfd6b41d87ab8afd91ed71 Mon Sep 17 00:00:00 2001 From: Grant Paul Date: Sat, 9 Apr 2011 14:38:42 -0700 Subject: [PATCH 11/16] Update Chinese translations. --- .../zh_CN.lproj/Localizable.strings | 2 +- .../zh_TW.lproj/Localizable.strings | 110 +++++++++--------- 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/MobileCydia.app/zh_CN.lproj/Localizable.strings b/MobileCydia.app/zh_CN.lproj/Localizable.strings index f7cecbc2..d3a1e600 100644 --- a/MobileCydia.app/zh_CN.lproj/Localizable.strings +++ b/MobileCydia.app/zh_CN.lproj/Localizable.strings @@ -145,7 +145,7 @@ "REFRESH" = "刷新"; "REFRESHING_DATA" = "刷新数据"; "REINSTALL" = "重新安装"; -"RELOAD" = "重建加载"; +"RELOAD" = "重新加载"; "RELOADING_DATA" = "重新加载数据"; "RELOAD_SPRINGBOARD" = "重新加载 SpringBoard"; "REMOVE" = "卸载"; diff --git a/MobileCydia.app/zh_TW.lproj/Localizable.strings b/MobileCydia.app/zh_TW.lproj/Localizable.strings index 8a761852..b0c3eb19 100644 --- a/MobileCydia.app/zh_TW.lproj/Localizable.strings +++ b/MobileCydia.app/zh_TW.lproj/Localizable.strings @@ -1,12 +1,12 @@ "ABOUT" = "關於"; "ABOUT_CYDIA" = "關於 Cydia Installer"; "ACCEPT_NEW_COPY" = "接受新的副本"; -"ADD" = "添加"; -"ADD_ANYWAY" = "仍然添加"; -"ADD_SOURCE" = "添加源"; +"ADD" = "新增"; +"ADD_ANYWAY" = "仍然新增"; +"ADD_SOURCE" = "新增源"; "ADMINISTRATIVE_INFORMATION" = "管理資訊"; "ADVANCED_SEARCH" = "進階搜尋"; -"ALL_PACKAGES" = "所有軟體包"; +"ALL_PACKAGES" = "所有套件"; "APPLE" = "Apple"; "AUTHOR" = "作者"; "AVAILABLE_UPGRADES" = "可用更新"; @@ -16,10 +16,10 @@ "CANCEL_CLEAR" = "取消並清除"; "CANCEL_OPERATION" = "取消操作"; "CANNOT_COMPLY" = "無法執行"; -"CANNOT_COMPLY_EX" = "因所依賴的軟體包未找到或存在衝突軟體包,操作無法完成。"; -"CANNOT_LOCATE_PACKAGE" = "找不到軟體包"; +"CANNOT_COMPLY_EX" = "因所依賴的套件未找到或存在衝突套件,操作無法完成。"; +"CANNOT_LOCATE_PACKAGE" = "找不到套件"; "CHANGES" = "變更"; -"CHANGE_PACKAGE_SETTINGS" = "更改軟體包設定"; +"CHANGE_PACKAGE_SETTINGS" = "更改套件設定"; "CLEAN_ARCHIVES" = "清除存檔"; "CLEAR" = "清除"; "CLOSE" = "關閉"; @@ -31,16 +31,16 @@ "COMPLETE" = "完成"; "COMPLETE_UPGRADE" = "全部更新"; "CONFIGURATION_UPGRADE" = "更新設定"; -"CONFIGURATION_UPGRADE_EX" = "下列檔案已被軟體包維護者和您自己(或腳本)更改過。"; +"CONFIGURATION_UPGRADE_EX" = "下列檔案已被套件維護者和您自己(或安裝指令)更改過。"; "CONFIRM" = "確認"; "CONSOLE_PACKAGE" = "終端程式"; "CONSOLE_UTILITIES_DAEMONS" = "終端工具及駐留進程"; -"CONTINUE_QUEUING" = "繼續隊列"; +"CONTINUE_QUEUING" = "繼續安裝佇列"; "COUNTS_NONZERO_EX" = "我只不過計算了一些看起來很重要的數值,而且這些數值加起來不為零。這很嚇人。我不知道我為什麼不喜歡這樣,但我仍然認為 APT 應該是很穩定的,這個不應該發生。"; "CREDITS" = "軟體資訊"; "CYDIA_STORE" = "Cydia 線上商店"; "DATABASE" = "資料庫"; -"DETAILS" = "詳情"; +"DETAILS" = "資訊"; "DEVELOPER" = "開發者"; "DEVELOPERS_ONLY" = "僅限開發者"; "DEVELOPER_EX" = "所有內容,包括底層的內容。"; @@ -54,50 +54,50 @@ "DOWNLOADING_" = "下載 %@"; "EDIT" = "編輯"; "ELISION" = "%@…"; -"ENTERED_BY_USER" = "由用戶添加"; +"ENTERED_BY_USER" = "由使用者新增"; "ENTER_APT_URL" = "輸入 Cydia/APT URL"; "ERROR" = "錯誤"; "ESSENTIAL_UPGRADE" = "必要更新"; "ESSENTIAL_UPGRADES" = "%d 個必要更新"; -"ESSENTIAL_UPGRADE_EX" = "一個或多個必要軟體包已過期,不更新有可能會導致系統錯誤。"; +"ESSENTIAL_UPGRADE_EX" = "一個或多個必要套件已過期,不更新有可能會導致系統錯誤。"; "EXCLAMATION" = "%@!"; "EXIT_WHEN_COMPLETE" = "(Cydia 會在完成時退出。)"; -"EXPANDED_SIZE" = "展開大小"; -"EXPERT" = "專業人士"; +"EXPANDED_SIZE" = "安裝大小"; +"EXPERT" = "進階"; "FAQ" = "常見問題"; -"FEATURED_PACKAGES" = "精選軟體包"; +"FEATURED_PACKAGES" = "精選套件"; "FEATURED_THEMES" = "精選佈景"; "FILES" = "檔案"; -"FILESYSTEM_CONTENT" = "檔案系統"; +"FILESYSTEM_CONTENT" = "檔案內容"; "FILES_INSTALLED_TO" = "檔案安裝到 %@"; "FOLLOW_ON_TWITTER" = "在 Twitter 上收聽 %@"; "FORCE_REMOVAL" = "強制移除"; "FORCIBLY_CLEAR" = "強制清除"; "FREE_APPLICATIONS" = "免費軟體"; -"FREE_EXTENSIONS" = "免費擴展"; +"FREE_EXTENSIONS" = "免費外掛"; "FREQUENTLY_ASKED_QUESTIONS" = "常見問題"; "FROM" = "來自 %@"; "FROWNY_PANTS" = "Frowny Pants"; "FUTURE_FEATURE_ROADMAP" = "開發路線圖"; -"HACKER" = "Hacker"; -"HACKER_EX" = "添加終端工具。"; -"HALFINSTALLED_PACKAGE" = "半安裝軟體包"; -"HALFINSTALLED_PACKAGES" = "%d 個半安裝軟體包"; -"HALFINSTALLED_PACKAGE_EX" = "若軟體包的腳本執行失敗,該軟體包便會成為“半配置”或“半安裝”狀態。這些錯誤不會自行消失,並可能造成持續的影響。您可以先手動刪除有錯誤的腳本,然後強制移除軟體包。"; +"HACKER" = "進階"; +"HACKER_EX" = "新增終端工具。"; +"HALFINSTALLED_PACKAGE" = "半安裝套件"; +"HALFINSTALLED_PACKAGES" = "%d 個半安裝套件"; +"HALFINSTALLED_PACKAGE_EX" = "若套件的安裝指令執行失敗,該套件便會成為“半配置”或“半安裝”狀態。這些錯誤不會自行消失,並可能造成後續的影響。您可以先手動刪除有錯誤的安裝指令,然後強制移除套件。"; "HOME" = "主頁"; -"ID" = "標識"; +"ID" = "ID"; "IGNORED_UPGRADES" = "已忽略的更新"; "IGNORE_UPGRADES" = "忽略更新"; -"IGNORE_UPGRADES_EX" = "選擇全部更新時排除該軟體包。"; -"ILLEGAL_PACKAGE_IDENTIFIER" = "非法軟體包標識"; +"IGNORE_UPGRADES_EX" = "選擇全部更新時排除該套件。"; +"ILLEGAL_PACKAGE_IDENTIFIER" = "非法套件ID"; "INSTALL" = "安裝"; "INSTALLED" = "已安裝"; -"INSTALLED_BY_PACKAGE" = "由軟體包安裝"; -"INSTALLED_DETAILS" = "已安裝軟體包"; +"INSTALLED_BY_PACKAGE" = "由套件安裝"; +"INSTALLED_DETAILS" = "已安裝套件"; "INSTALLED_FILES" = "已安裝檔案"; "KEEP_OLD_COPY" = "保留舊的副本"; "LOADING" = "載入中"; -"LOADING_DATA" = "加載數據"; +"LOADING_DATA" = "載入資料"; "LOCAL" = "本地"; "LOGIN" = "登入"; "MAILING_LISTS" = "郵件列表"; @@ -117,17 +117,17 @@ "NOTE" = "記錄"; "NOT_RATED" = "未評級"; "NOT_REPOSITORY" = "未找到軟體源"; -"NOT_REPOSITORY_EX" = "軟體源未找到。可能是因為您添加的是 Cydia 不支援的 Installer 軟體源。並且,此介面僅適用於完整的軟體源網路位址。如果您自己搭建了一個軟體源,歡迎聯繫 Cydia 的作者。"; +"NOT_REPOSITORY_EX" = "軟體源未找到。可能是因為您新增的是 Cydia 不支援的 Installer 軟體源。並且,此介面僅適用於完整的軟體源網路位址。如果您自己搭建了一個軟體源,歡迎聯繫 Cydia 的作者。"; "NO_SECTION" = "(無分類)"; "OK" = "確定"; "OKAY" = "確定"; -"PACKAGES" = "軟體包"; -"PACKAGES_EX" = "查看或卸載已安裝的軟體包。"; -"PACKAGE_CANNOT_BE_FOUND" = "在當前軟體源中無法找到軟體包:\n%@\n添加更多軟體源或許能夠解決此問題。"; -"PACKAGE_CANNOT_BE_FOUND_EX" = "該問題亦可能由其它因素引起。最常見的情況是您的軟體包目錄已過期。請點擊“變更”中的“刷新”按鈕以手動刷新目錄。該軟體包也許不存在。也有可能是您使用的是較老的韌體版本:用戶應該儘量根據 Apple 官方資訊保持韌體的更新。"; -"PACKAGE_DAMAGED" = "軟體包已損壞"; -"PACKAGE_DETAILS" = "軟體包詳情"; -"PACKAGE_QUEUE" = "軟體包隊列"; +"PACKAGES" = "安裝套件"; +"PACKAGES_EX" = "查看或移除已安裝的套件。"; +"PACKAGE_CANNOT_BE_FOUND" = "在當前軟體源中無法找到套件:\n%@\n新增更多軟體源或許能夠解決此問題。"; +"PACKAGE_CANNOT_BE_FOUND_EX" = "該問題亦可能由其它因素引起。最常見的情況是您的套件目錄已過期。請點擊“變更”中的“刷新”按鈕以手動刷新目錄。該套件也許不存在。也有可能是您使用的是較老的韌體版本:使用者應該儘量根據 Apple 官方資訊保持韌體的更新。"; +"PACKAGE_DAMAGED" = "套件已損壞"; +"PACKAGE_DETAILS" = "套件資訊"; +"PACKAGE_QUEUE" = "套件安裝佇列"; "PARENTHETICAL" = "%@(%@)"; "PASSWORD" = "密碼"; "PERFORM_SELECTIONS" = "執行選定"; @@ -136,9 +136,9 @@ "PRODUCTS" = "產品"; "PURGE" = "清除"; "QUESTION" = "%@?"; -"QUEUE" = "隊列"; -"QUEUED_FOR" = "隊列 %@"; -"Q_D" = "隊列"; +"QUEUE" = "安裝佇列"; +"QUEUED_FOR" = "安裝佇列 %@"; +"Q_D" = "安裝佇列"; "REBOOT_DEVICE" = "重啟設備"; "RECENT_CHANGES_UPDATES" = "最近更新"; "RECOMMENDED_BOOKS" = "推薦書目"; @@ -146,20 +146,20 @@ "REFRESHING_DATA" = "更新資料"; "REINSTALL" = "重新安裝"; "RELOAD" = "重新載入"; -"RELOADING_DATA" = "重新載入數據"; +"RELOADING_DATA" = "更新資料"; "RELOAD_SPRINGBOARD" = "重新載入 SpringBoard"; "REMOVE" = "移除"; -"REMOVING_ESSENTIALS" = "移除必要軟體包"; -"REMOVING_ESSENTIALS_EX" = "此操作涉及卸載一個或多個 Cydia 或 iPhoneOS 運行所必需的軟體包。如果繼續操作,您可能無法使用 Cydia 修復任何錯誤。"; +"REMOVING_ESSENTIALS" = "移除必要套件"; +"REMOVING_ESSENTIALS_EX" = "此操作涉及移除一個或多個 Cydia 或 iOS 運行所必需的套件。如果繼續操作,您可能無法使用 Cydia 修復任何錯誤。"; "REPAIRING" = "修復"; "REPOSITORY_SIGNATURE" = "查看軟體源簽名"; "REQUEST_ADVERTISING_SPACE" = "獲取廣告欄"; "REQUIREMENTS_FOR_LISTING" = "列表需求"; "RESTART_SPRINGBOARD" = "重啟 SpringBoard"; -"RESUBMIT_FORM" = "您確定要再次提交此表格?"; +"RESUBMIT_FORM" = "您確定要再次送出此表格?"; "RESUMING_AT" = "繼續在"; "RETURN_TO_CYDIA" = "回到 Cydia"; -"ROLE_EX" = "Cydia 中可下載的軟體包並非為所有用戶而設計,因此請明確自己的身份以説明 Cydia 過濾顯示某些軟體包。\n\n該項設定可在“管理”標簽(iPhone 或 iPod Touch)或“軟體源”標簽(iPad)中的“設定”更改。"; +"ROLE_EX" = "Cydia 中可下載的套件並非為所有使用者而設計,因此請明確自己的身份以説明 Cydia 過濾顯示某些套件。\n\n該項設定可在“管理”標籤(iPhone 或 iPod Touch)或“軟體源”標籤(iPad)中的“設定”更改。"; "RUNNING" = "運行中"; "SAFE" = "安全"; "SAMPLE" = "示例"; @@ -171,30 +171,30 @@ "SECTION" = "分類"; "SECTIONS" = "分類"; "SECTION_VISIBILITY" = "可見分類"; -"SEE_WHAT_CHANGED" = "查看更新詳情"; +"SEE_WHAT_CHANGED" = "查看更新資訊"; "SETTINGS" = "設定"; "SHOW_ALL_CHANGES" = "顯示所有變更"; -"SHOW_ALL_CHANGES_EX" = "Cydia 只會顯示已安裝軟體包的更新以避免某些軟體發展者的騷擾。\n\n啟用此選項以使 Cydia 顯示未安裝軟體包的更新。"; -"SIGNED_PACKAGE" = "此軟體包已通過驗證。"; +"SHOW_ALL_CHANGES_EX" = "Cydia 只會顯示已安裝套件的更新以避免某些軟體開發者的騷擾。\n\n啟用此選項以使 Cydia 顯示未安裝套件的更新。"; +"SIGNED_PACKAGE" = "此套件已通過驗證。"; "SIMPLE" = "簡單"; "SINGLE_QUOTED" = "‘%@’"; "SLASH_DELIMITED" = "%@ / %@"; "SOURCES" = "軟體源"; -"SOURCES_EX" = "列出現有軟體源或添加軟體源。"; +"SOURCES_EX" = "列出現有軟體源或新增軟體源。"; "SOURCE_DETAILS" = "軟體源資訊"; "SOURCE_WARNING" = "軟體源警告"; "SPONSOR" = "保證"; "SPONSORING_PRODUCTS" = "保證產品"; "STATISTICS" = "統計資料"; "STILL_BROKEN_EX" = "嘗試修正損壞選擇失敗。"; -"STORAGE" = "存儲詳情"; -"STORAGE_EX" = "查看您還有多少剩餘空間以供安裝新的軟體包。"; -"SUBMIT" = "提交"; +"STORAGE" = "儲存空間資訊"; +"STORAGE_EX" = "查看您還有多少剩餘空間以供安裝新的套件。"; +"SUBMIT" = "送出"; "SUPPORT_KNOWN_ISSUES" = "支持與已知問題"; "TEMPORARY_IGNORE" = "暫時忽略"; "THANK_YOU" = "感謝"; "UNABLE_TO_COMPLY" = "無法執行"; -"UNABLE_TO_COMPLY_EX" = "此操作涉及卸載一個或多個 Cydia 或 iPhoneOS 運行所必需的軟體包。如果您確定要繼續強制執行此操作,請在設定中打開進階模式。"; +"UNABLE_TO_COMPLY_EX" = "此操作涉及移除一個或多個 Cydia 或 iPhoneOS 運行所必需的套件。如果您確定要繼續強制執行此操作,請在設定中打開進階模式。"; "UNABLE_TO_LOAD" = "無法載入"; "UNKNOWN" = "未知"; "UNSAFE" = "不安全"; @@ -203,14 +203,14 @@ "UPGRADE" = "更新"; "UPGRADE_ESSENTIAL" = "必要更新"; "UPGRADING_TO_READ_THIS" = "升級到 %@?先看看這個"; -"USER" = "用戶"; -"USERNAME" = "用戶名"; +"USER" = "使用者"; +"USERNAME" = "使用者名稱"; "USER_EX" = "軟體、工具和佈景。"; "USER_GUIDES" = "使用者指南"; "VERIFICATION_ERROR" = "驗證錯誤"; "VERIFYING_URL" = "正在驗證 URL"; "VERSION" = "版本"; "WARNING" = "警告"; -"WELCOME_TO_CYDIA" = "歡飲使用 Cydia™"; +"WELCOME_TO_CYDIA" = "歡迎使用 Cydia™"; "WHO_ARE_YOU" = "您的身份是?"; "YES" = "是"; -- 2.45.2 From 0c4fe0f48ff1555422b6d2a17d625e15bc5493e8 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 16 Apr 2011 03:48:38 -0700 Subject: [PATCH 12/16] You must autorelease mutableCopy. --- MobileCydia.mm | 10 +++++----- SDURLCache | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index f11037ff..a6b61fed 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -4453,7 +4453,7 @@ static _H Diversions_; } - (NSString *) substitutePackageNames:(NSString *)message { - NSMutableArray *words([[message componentsSeparatedByString:@" "] mutableCopy]); + NSMutableArray *words([[[message componentsSeparatedByString:@" "] mutableCopy] autorelease]); for (size_t i(0), e([words count]); i != e; ++i) { NSString *word([words objectAtIndex:i]); if (Package *package = [[Database sharedInstance] packageWithName:word]) @@ -4629,7 +4629,7 @@ static _H Diversions_; } + (NSURLRequest *) requestWithHeaders:(NSURLRequest *)request { - NSMutableURLRequest *copy([request mutableCopy]); + NSMutableURLRequest *copy([[request mutableCopy] autorelease]); NSURL *url([copy URL]); NSString *href([url absoluteString]); @@ -6896,7 +6896,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi } return; } - NSMutableArray *controllers = [[self viewControllers] mutableCopy]; + NSMutableArray *controllers = [[[self viewControllers] mutableCopy] autorelease]; if (transient != nil) { UINavigationController *navigation([[[UINavigationController alloc] init] autorelease]); [navigation setViewControllers:[NSArray arrayWithObject:transient]]; @@ -10238,7 +10238,7 @@ _trace(); [self disemulate]; int savedIndex = [[Metadata_ objectForKey:@"InterfaceIndex"] intValue]; - NSArray *saved = [[Metadata_ objectForKey:@"InterfaceState"] mutableCopy]; + NSArray *saved = [[[Metadata_ objectForKey:@"InterfaceState"] mutableCopy] autorelease]; int standardIndex = 0; NSArray *standard = [self defaultStartPages]; @@ -10391,7 +10391,7 @@ MSHook(void *, CFXPreferencesPropertyListSource$createPlistFromDisk, CFXPreferen Class $NSURLConnection; MSHook(id, NSURLConnection$init$, NSURLConnection *self, SEL _cmd, NSURLRequest *request, id delegate, BOOL usesCache, int64_t maxContentLength, BOOL startImmediately, NSDictionary *connectionProperties) { - NSMutableURLRequest *copy([request mutableCopy]); + NSMutableURLRequest *copy([[request mutableCopy] autorelease]); NSURL *url([copy URL]); diff --git a/SDURLCache b/SDURLCache index fc6417ef..0544cf53 160000 --- a/SDURLCache +++ b/SDURLCache @@ -1 +1 @@ -Subproject commit fc6417ef3ce6cc1749e5313168f512290788dffe +Subproject commit 0544cf53dd9cfdb33d55df13668869b341d32535 -- 2.45.2 From 0dbada51f076f376e3ea625de5b6a0bced0412fe Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sat, 16 Apr 2011 03:57:12 -0700 Subject: [PATCH 13/16] Create bins directory if nonexistent. --- makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/makefile b/makefile index be9ae5f7..f7933f7c 100644 --- a/makefile +++ b/makefile @@ -121,6 +121,7 @@ sysroot: sysroot.sh MobileCydia: sysroot $(object) entitlements.xml @echo "[link] $(object:Objects/%=%)" @$(cycc) $(filter %.o,$^) $(flags) $(link) $(uikit) + @mkdir -p bins @cp -a $@ bins/$@-$(version) @echo "[strp] $@" @strip -no_uuid $@ -- 2.45.2 From 058813ae78aec1b25c7c44b2a6188b7ae2264107 Mon Sep 17 00:00:00 2001 From: Grant Paul Date: Mon, 6 Jun 2011 03:38:40 -0700 Subject: [PATCH 14/16] Simple change to search view: if the keyboard was shown before, show it again when you go back to it. --- MobileCydia.mm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/MobileCydia.mm b/MobileCydia.mm index 1acb5eac..a2936ef2 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -8050,13 +8050,6 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi [self reloadData]; } -- (void) viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - - if ([self filter] == @selector(isUnfilteredAndSelectedForBy:)) - [self useSearch]; -} - - (void) searchBarTextDidBeginEditing:(UISearchBar *)searchBar { [self setObject:[search_ text] forFilter:@selector(isUnfilteredAndSelectedForBy:)]; [self clearData]; @@ -8134,6 +8127,9 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi [textField setEnablesReturnKeyAutomatically:NO]; [[self navigationItem] setTitleView:textField]; } + + if ([self isSummarized]) + [search_ becomeFirstResponder]; } - (void) reloadData { -- 2.45.2 From 4cc9e99a32a73858f3b9739c0cf8ec82bb35e93e Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 8 Jun 2011 22:42:18 -0700 Subject: [PATCH 15/16] Make compilations with clang succeed. --- CyteKit/WebView.h | 3 +++ CyteKit/WebView.mm | 4 ++++ CyteKit/WebViewController.h | 2 ++ CyteKit/WebViewController.mm | 4 ++-- CyteKit/WebViewTableViewCell.h | 4 +++- CyteKit/dispatchEvent.mm | 2 +- MobileCydia.mm | 17 +++++++++------ makefile | 38 +++++++++++++++++++++++++--------- 8 files changed, 54 insertions(+), 20 deletions(-) diff --git a/CyteKit/WebView.h b/CyteKit/WebView.h index c9e10c8f..39fd8ffe 100644 --- a/CyteKit/WebView.h +++ b/CyteKit/WebView.h @@ -58,6 +58,7 @@ enum CYWebPolicyDecision { }; @protocol CyteWebViewDelegate +@optional - (void) webView:(WebView *)view addMessageToConsole:(NSDictionary *)message; - (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id)listener; - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id)listener; @@ -81,6 +82,8 @@ enum CYWebPolicyDecision { } - (id) delegate; +- (void) setDelegate:(id)delegate; + - (void) dispatchEvent:(NSString *)event; - (void) reloadFromOrigin; - (UIScrollView *) scrollView; diff --git a/CyteKit/WebView.mm b/CyteKit/WebView.mm index 1706cc03..084926b0 100644 --- a/CyteKit/WebView.mm +++ b/CyteKit/WebView.mm @@ -138,6 +138,10 @@ return (id) [super delegate]; } +- (void) setDelegate:(id)delegate { + [super setDelegate:delegate]; +} + /*- (WebView *) webView:(WebView *)view createWebViewWithRequest:(NSURLRequest *)request { id delegate([self delegate]); WebView *created(nil); diff --git a/CyteKit/WebViewController.h b/CyteKit/WebViewController.h index 9b9ba940..5807e785 100644 --- a/CyteKit/WebViewController.h +++ b/CyteKit/WebViewController.h @@ -138,6 +138,8 @@ - (void) applyLeftButton; - (UIBarButtonItem *) leftButton; +- (void) removeButton; + - (void) _didStartLoading; - (void) _didFinishLoading; diff --git a/CyteKit/WebViewController.mm b/CyteKit/WebViewController.mm index e5cfbb47..25e9aebb 100644 --- a/CyteKit/WebViewController.mm +++ b/CyteKit/WebViewController.mm @@ -534,7 +534,7 @@ float CYScrollViewDecelerationRateNormal; if ([frame parentFrame] == nil) { if (DOMDocument *document = [frame DOMDocument]) - if (DOMNodeList *bodies = [document getElementsByTagName:@"body"]) + if (DOMNodeList *bodies = [document getElementsByTagName:@"body"]) for (DOMHTMLBodyElement *body in (id) bodies) { DOMCSSStyleDeclaration *style([document getComputedStyle:body pseudoElement:nil]); @@ -697,7 +697,7 @@ float CYScrollViewDecelerationRateNormal; - (UIBarButtonItem *) customButton { if (custom_ == nil) return nil; - else if (custom_ == [NSNull null]) + else if ((/*clang:*/id) custom_ == [NSNull null]) return (UIBarButtonItem *) [NSNull null]; return [[[UIBarButtonItem alloc] diff --git a/CyteKit/WebViewTableViewCell.h b/CyteKit/WebViewTableViewCell.h index c328e33d..bff680e6 100644 --- a/CyteKit/WebViewTableViewCell.h +++ b/CyteKit/WebViewTableViewCell.h @@ -45,7 +45,9 @@ #include "Menes/ObjectHandle.h" #include "CyteKit/WebView.h" -@interface CyteWebViewTableViewCell : UITableViewCell { +@interface CyteWebViewTableViewCell : UITableViewCell < + CyteWebViewDelegate +> { // XXX: I'm not really the delegate here: fix this! _H webview_; } diff --git a/CyteKit/dispatchEvent.mm b/CyteKit/dispatchEvent.mm index 76e24afc..81b7089b 100644 --- a/CyteKit/dispatchEvent.mm +++ b/CyteKit/dispatchEvent.mm @@ -94,7 +94,7 @@ MSHook(void, UIWebBrowserView$_webTouchEventsRecognized$, UIWebBrowserView *self __attribute__((__constructor__)) static void $() { if (Class $UIWebBrowserView = objc_getClass("UIWebBrowserView")) { if (Method method = class_getInstanceMethod($UIWebBrowserView, @selector(_webTouchEventsRecognized:))) { - _UIWebBrowserView$_webTouchEventsRecognized$ = reinterpret_cast(method_getImplementation(method)); + _UIWebBrowserView$_webTouchEventsRecognized$ = reinterpret_cast(method_getImplementation(method)); method_setImplementation(method, reinterpret_cast(&$UIWebBrowserView$_webTouchEventsRecognized$)); } } diff --git a/MobileCydia.mm b/MobileCydia.mm index a2936ef2..a21a2130 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -211,6 +211,10 @@ void PrintTimes() { #define _end } /* }}} */ +// XXX: I hate clang. Apple: please get over your petty hatred of GPL and fix your gcc fork +#define synchronized(lock) \ + synchronized(static_cast(lock)) + extern NSString *Cydia_; #define lprintf(args...) fprintf(stderr, args) @@ -1327,7 +1331,7 @@ static void PackageImport(const void *key, const void *value, void *context) { CYString defaultIcon_; - _H record_; + _H record_; BOOL trusted_; } @@ -3970,7 +3974,7 @@ static _H Diversions_; @end @interface CydiaObject : NSObject { - _H indirect_; + _H indirect_; _transient id delegate_; } @@ -3996,7 +4000,7 @@ static _H Diversions_; - (id) initWithDelegate:(IndirectDelegate *)indirect { if ((self = [super init]) != nil) { - indirect_ = indirect; + indirect_ = (CyteWebViewController *) indirect; } return self; } @@ -7659,12 +7663,13 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi /* Changes Controller {{{ */ @interface ChangesController : CyteViewController < + CyteWebViewDelegate, UITableViewDataSource, UITableViewDelegate > { _transient Database *database_; unsigned era_; - _H packages_; + _H packages_; _H sections_; _H list_; _H dickbar_; @@ -7903,7 +7908,7 @@ static void HomeControllerReachabilityCallback(SCNetworkReachabilityRef reachabi } } - (void) _reloadData { - NSArray *packages; + NSMutableArray *packages; reload: if (true) { @@ -10438,7 +10443,7 @@ MSHook(id, NSURLConnection$init$, NSURLConnection *self, SEL _cmd, NSURLRequest Class $WAKWindow; -static CGSize $WAKWindow$screenSize(WAKWindow self, SEL _cmd) { +static CGSize $WAKWindow$screenSize(WAKWindow *self, SEL _cmd) { CGSize size([[UIScreen mainScreen] bounds].size); /*if ([$WAKWindow respondsToSelector:@selector(hasLandscapeOrientation)]) if ([$WAKWindow hasLandscapeOrientation]) diff --git a/makefile b/makefile index f7933f7c..931ec83a 100644 --- a/makefile +++ b/makefile @@ -1,9 +1,17 @@ -sdks := /Developer/Platforms/iPhoneOS.platform/Developer/SDKs +dev := /Developer/Platforms/iPhoneOS.platform/Developer +sdks := $(dev)/SDKs ioss := $(sort $(patsubst $(sdks)/iPhoneOS%.sdk,%,$(wildcard $(sdks)/iPhoneOS*.sdk))) - ios := $(word $(words $(ioss)),$(ioss)) + +# if you can tolerate clang, set this to blank gcc := 4.2 +ifeq ($(gcc),) +gxx := $(dev)/usr/bin/clang++ +else +gxx := $(dev)/usr/bin/g++-$(gcc) +endif + flags := link := @@ -21,18 +29,29 @@ endif sdk := $(sdks)/iPhoneOS$(ios).sdk flags += -F$(sdk)/System/Library/PrivateFrameworks -flags += -I. -isystem sysroot/usr/include -Lsysroot/usr/lib -flags += -Wall -Werror -Wno-deprecated-declarations +flags += -I. -isystem sysroot/usr/include flags += -fmessage-length=0 flags += -g0 -O2 +flags += -fvisibility=hidden + +flags += -Wall + +ifeq ($(gcc),) +flags += -Wno-unknown-warning-option +flags += -Wno-logical-op-parentheses +else flags += -fobjc-exceptions flags += -fno-guess-branch-probability -flags += -fvisibility=hidden +endif + +flags += -Wno-deprecated-declarations xflags := xflags += -fobjc-call-cxx-cdtors xflags += -fvisibility-inlines-hidden +link += -Lsysroot/usr/lib + link += -framework CoreFoundation link += -framework CoreGraphics link += -framework Foundation @@ -59,9 +78,8 @@ backrow += -FAppleTV -framework BackRow -framework AppleTV version := $(shell ./version.sh) -#cycc = cycc -r4.2 -i$(ios) -o$@ -gxx := /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/g++-$(gcc) cycc = $(gxx) -mthumb -arch armv6 -o $@ -mcpu=arm1176jzf-s -miphoneos-version-min=2.0 -isysroot $(sdk) -idirafter /usr/include -F{sysroot,}/Library/Frameworks +#cycc = cycc -r4.2 -i$(ios) -o$@ dirs := Menes CyteKit Cydia SDURLCache @@ -94,17 +112,17 @@ clean: Objects/%.o: %.c $(header) @mkdir -p $(dir $@) @echo "[cycc] $<" - @$(cycc) -c -o $@ -x c $< + @$(cycc) -c -x c $< Objects/%.o: %.m $(header) @mkdir -p $(dir $@) @echo "[cycc] $<" - @$(cycc) -c -o $@ $< $(flags) + @$(cycc) -c $< $(flags) Objects/%.o: %.mm $(header) @mkdir -p $(dir $@) @echo "[cycc] $<" - @$(cycc) -c -o $@ $< $(flags) $(xflags) + @$(cycc) -c $< $(flags) $(xflags) Objects/Version.o: version.h -- 2.45.2 From 543e172ac58fea0cdaa244dadfa9538c975cccc6 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 9 Jun 2011 08:42:46 -0700 Subject: [PATCH 16/16] Fix postinst compile post-clang. --- makefile | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/makefile b/makefile index 931ec83a..f98a9029 100644 --- a/makefile +++ b/makefile @@ -14,6 +14,7 @@ endif flags := link := +libs := ifeq (o,O) # gzip is actually better dpkg := /Library/Cydia/bin/dpkg-deb @@ -51,25 +52,24 @@ xflags += -fobjc-call-cxx-cdtors xflags += -fvisibility-inlines-hidden link += -Lsysroot/usr/lib - -link += -framework CoreFoundation -link += -framework CoreGraphics -link += -framework Foundation -link += -framework GraphicsServices -link += -framework IOKit -link += -framework JavaScriptCore -link += -framework QuartzCore -link += -framework SpringBoardServices -link += -framework SystemConfiguration -link += -framework WebCore -link += -framework WebKit - -link += -lapr-1 -link += -lapt-pkg -link += -lpcre - link += -multiply_defined suppress +libs += -framework CoreFoundation +libs += -framework CoreGraphics +libs += -framework Foundation +libs += -framework GraphicsServices +libs += -framework IOKit +libs += -framework JavaScriptCore +libs += -framework QuartzCore +libs += -framework SpringBoardServices +libs += -framework SystemConfiguration +libs += -framework WebCore +libs += -framework WebKit + +libs += -lapr-1 +libs += -lapt-pkg +libs += -lpcre + uikit := uikit += -framework UIKit @@ -138,7 +138,7 @@ sysroot: sysroot.sh MobileCydia: sysroot $(object) entitlements.xml @echo "[link] $(object:Objects/%=%)" - @$(cycc) $(filter %.o,$^) $(flags) $(link) $(uikit) + @$(cycc) $(filter %.o,$^) $(flags) $(link) $(libs) $(uikit) @mkdir -p bins @cp -a $@ bins/$@-$(version) @echo "[strp] $@" @@ -147,14 +147,14 @@ MobileCydia: sysroot $(object) entitlements.xml @ldid -T0 -Sentitlements.xml $@ || { rm -f $@ && false; } CydiaAppliance: CydiaAppliance.mm - $(cycc) $(filter %.mm,$^) $(flags) -bundle $(link) $(backrow) + $(cycc) $(filter %.mm,$^) $(flags) $(link) -bundle $(libs) $(backrow) cfversion: cfversion.mm $(cycc) $(filter %.mm,$^) $(flags) -framework CoreFoundation @ldid -T0 -S $@ postinst: postinst.mm Sources.mm Sources.h CyteKit/stringWithUTF8Bytes.mm CyteKit/stringWithUTF8Bytes.h CyteKit/UCPlatform.h - $(cycc) $(filter %.mm,$^) $(flags) -framework CoreFoundation -framework Foundation -framework UIKit -lpcre + $(cycc) $(filter %.mm,$^) $(flags) $(link) -framework CoreFoundation -framework Foundation -framework UIKit -lpcre @ldid -T0 -S $@ debs/cydia_$(version)_iphoneos-arm.deb: MobileCydia preinst postinst cfversion $(images) $(shell find MobileCydia.app) cydia.control Library/firmware.sh -- 2.45.2