2013-01-09 35 views
-1

我需要一些幫助從plist文件讀取數據。 這是我的代碼,但它不工作,我沒有想法了。我想建立一個讀取plist com.mi.pp1.plist的整數的dylib。從iOS中的plist文件中讀取int

Bux = [[[NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences/com.mi.pp1.plist"]valueForKey:@"kBux"]intValue]; 

%hook PPPlayerData 
- (int)bux 
{ 
    return Bux; 
} 
%end 
+0

這意味着越獄的設備?在普通設備上運行的普通應用程序無法訪問這樣的文件。 – rmaddy

+0

是的。我不確定是否可以爲非監獄破壞創建dylib。 – user1965024

+0

%鉤子和%結束? –

回答

0
int Bux; 

Bux = [[[NSDictionary dictionaryWithContentsOfFile:@"/var/mobile/Library/Preferences /com.mi.pp1.plist"]objectForKey:@"kBux"]intValue]; 

%hook PPPlayerData 
- (int)bux 
{ 
return Bux; 
} 

工作