我正在爲越獄的設計創建一個應用程序,並且需要將.debs安裝到/ Library/Themes /中的功能。我已到處尋找文檔或示例,但並不意外,我沒有發現任何好的使用。我首先想從URL獲取.deb,然後只需將該軟件包安裝到用戶文件夾中即可。如果任何人有任何這方面的經驗或可能會指出我正確的方向,將不勝感激。.Deb Installer for iphone
這是一個類似的問題,但似乎從未真正得到答案。 How to install a .deb file on a jailbroken iphone programmatically?
//SYCRONIZED REQUEST
- (IBAction)grabURL:(id)sender
{
NSURL *url = [NSURL URLWithString:@"http://freeappl3.com/com.freeapple.quickunlock_0.0.1-
25_iphoneos-arm.deb"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
[request startSynchronous];
NSError *error = [request error];
if (!error) {
NSString *response = [request responseString];
NSLog(@"responce String = %@",response);
}
}
- (IBAction)grabURLInBackground:(id)sender
{
NSURL *url = [NSURL URLWithString:@"http://freeappl3.com/com.freeapple.quickunlock_0.0.1-
25_iphoneos-arm.deb"];
ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
NSString *path = @"/Library/Themes/";
[request setDelegate:self];
[request setDownloadDestinationPath:path];
[request setDownloadProgressDelegate:progress];
[request startAsynchronous];
}
- (void)requestFinished:(ASIHTTPRequest *)request
{
// Use when fetching text data
NSString *responseString = [request responseString];
NSLog(@"responce String = %@",responseString);
// Use when fetching binary data
NSData *responseData = [request responseData];
NSLog(@"responce Data = %@",responseData);
}
- (void)requestFailed:(ASIHTTPRequest *)request
{
NSError *error = [request error];
NSLog(@"responce Error = %@",error);
}
日誌
//當我用我的方法 「grabUrl:」
!<arch>
debian-binary 1311198441 0 0 100644 4 `
2.0
control.tar.gz 1311198441 0 0 100644 381 `
/當我用我的方法 「grabUrlInBackground:」
ThemeCatcher2[44212:16a03] responce Error = Error Domain=ASIHTTPRequestErrorDomain Code=8
"Failed to move file from '/var/folders/jw/j5qzb3b51s17ywd9m7vw52y40000gn/T/62973B18-B19A-
47FC-B2FB-A7E7F8C831AA-44212-00042A5738D4841E' to '/Library/Themes/'" UserInfo=0x9151ea0
{NSUnderlyingError=0x9151fa0 "The operation couldn’t be completed. (Cocoa error 4.)",
NSLocalizedDescription=Failed to move file from
'/var/folders/jw/j5qzb3b51s17ywd9m7vw52y40000gn/T/62973B18-B19A-47FC-B2FB-A7E7F8C831AA-
44212-00042A5738D4841E' to '/Library/Themes/'}
最佳答案我發現又是冰是這裏https://github.com/ ripdev/Icy/blob/master/Sources/Backend/Operations/DEBInstallOperation.m – FreeAppl3 2012-07-13 09:15:13