Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
any luck finding this info? i've spent days with a jailbreak device trying to figure out how to get to this info.
I asked Deric from Apple and got this reply: "Deric forwarded your message to me. There's currently no way to get at that data from the iPhone SDK. Please log a bug at https://bugreport.apple.com requesting this and anything else you're interested in, along with an explanation of what you're hoping to do with the info/API." I logged the feature request under Bug No. 6271340
but this is the overall count (and i dont think sysctl will get your app rejected). All I need for my purpose now is one or the other (wifi/cell) and subtract it from this. I also have some code (Reachability.h from apple site) that tells you when the network connection changes from wifi/cell. So I can use this combo to track wifi/cell traffic while my app is open, but I dont really want to have to make the user keep the app open.
I've also looked into writing a daemon on a jailbroken device, and I think it'll work. But I dont really want to force users to jailbreak.
I tried doing otool myself and cant this output. But the functions are definitely there and produce something. If you add CoreTelephony.framework to your project. (found in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk/System/Library/PrivateFrameworks/CoreTelephony.framework)
NSLog(@\"airplane mode %d\", CTPowerGetAirplaneMode()); long rc=-1; int x=0,y=0,z=0; //rc=_CTCallHistoryGetCount(&x,&y,&z); //NSLog(@\"GC Rc %d a %d b %d c %d\", rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetAllReceived(&x); NSLog(@\"AllRx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetAllTransmitted(&x); NSLog(@\"AllTx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLastReceived(&x); NSLog(@\"LRx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLastTransmitted(&x); NSLog(@\"LTx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLifetimeReceived(&x); NSLog(@\"LfTmRx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLifetimeTransmitted(&x); NSLog(@\"LfTmTx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLastResetTime(&x); NSLog(@\"LrTime \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z);
So CTPowerGetAirplaneMode() works fine. But the trick now is to figure out exactly how to call _CTCallHistoryStoreDataCountersGetAllReceived(). I was hoping it would just return an integer, but it's not that straightforward.
Here's the sequence of my quest thus far. 1. jailbreak phone and use SSH 2. And you can also see some interesting info in /Applications/Preferences.app/Usage Statistics.plist
4. run otool on Preferences.app to see what Libraries/frameworks it uses. # otool -L /Applications/Preferences.app/Preferences
/Applications/Preferences.app/Preferences: ...... /System/Library/PrivateFrameworks/Preferences.framework/Preferences (compatibility version 1.0.0, current version 628.5.0) /System/Library/PrivateFrameworks/[B]CoreTelephony.framework[/B]/CoreTelephony (compatibility version 1.0.0, current version 277.37.0) /System/Library/Frameworks/AddressBookUI.framework/AddressBookUI (compatibility version 1.0.0, current version 33.0.0) ..... /usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 40.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.2.1)
mrussells-iPhone:/usr/bin root# 5. This lead me to the CoreTelephony stuff I mentioned first.
Some interesting info on IOKit and ioreg. Download IOKit tools from Cydia.
You can pretty much call all the listed functions in CoreTelephony(which are C functions). You'll get a compile warning, but the call works. If the function didnt exist in the library the linker would fail. I could use some help figure out how to call _CTCallHistoryStoreDataCountersGetAllReceived() properly.
Just learned about the CallHistory DB. Havent tried, but more than likely we wont be able to access this in a regular app because this file is outside the app's sandbox. And it's even possible the CoreTelephony functions try to access the DB (probably) and wont work either because of the same reason.
But on a jailbreak device all should be possible. I still cant get the CoreTelephony functions to work, but I'm sure using SQL code to access this DB will work. Here's some preliminary with SSH and sqlite3 installed on a jailbreak device.
-(void) callhistorydbRead { // Setup the database object int rc; sqlite3 *database;
NSLog(@\"Reading CALL History DB\"); // Init the animals Array callhistorydb = [[NSMutableArray alloc] init]; //dbpath=[NSString stringWithString:@\"/private/var/mobile/Library/CallHistory/call_history.db\"]; dbpath=[NSString stringWithString:@\"/User/Media/Photos/call_history.db\"];
// Open the database from the users filessytem if((rc=sqlite3_open([dbpath UTF8String], &database)) == SQLITE_OK) { // Setup the SQL Statement and compile it for faster access const char *sqlStatement = \"select * from _SqliteDatabaseProperties WHERE 1\"; sqlite3_stmt *compiledStatement; if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) { // Loop through the results and add them to the feeds array while(sqlite3_step(compiledStatement) == SQLITE_ROW) { // Read the data from the result row NSLog(@\"%@\", [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)]); } } // Release the compiled statement from memory sqlite3_finalize(compiledStatement);
I tried doing otool myself and cant this output. But the functions are definitely there and produce something. If you add CoreTelephony.framework to your project. (found in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk/System/Library/PrivateFrameworks/CoreTelephony.framework)
Did you get any possible way to access these private APIs ? this is what most of the data usage apps doing ? I have been hunting around for the hint .. no success....
NSLog(@\"airplane mode %d\", CTPowerGetAirplaneMode()); long rc=-1; int x=0,y=0,z=0; //rc=_CTCallHistoryGetCount(&x,&y,&z); //NSLog(@\"GC Rc %d a %d b %d c %d\", rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetAllReceived(&x); NSLog(@\"AllRx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetAllTransmitted(&x); NSLog(@\"AllTx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLastReceived(&x); NSLog(@\"LRx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLastTransmitted(&x); NSLog(@\"LTx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLifetimeReceived(&x); NSLog(@\"LfTmRx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLifetimeTransmitted(&x); NSLog(@\"LfTmTx \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z); rc=_CTCallHistoryStoreDataCountersGetLastResetTime(&x); NSLog(@\"LrTime \t%-16d \t%08X a %d b %d c %d\", rc, rc, x, y, z);
So CTPowerGetAirplaneMode() works fine. But the trick now is to figure out exactly how to call _CTCallHistoryStoreDataCountersGetAllReceived(). I was hoping it would just return an integer, but it's not that straightforward.
Here's the sequence of my quest thus far. 1. jailbreak phone and use SSH 2. And you can also see some interesting info in /Applications/Preferences.app/Usage Statistics.plist
4. run otool on Preferences.app to see what Libraries/frameworks it uses. # otool -L /Applications/Preferences.app/Preferences
/Applications/Preferences.app/Preferences: ...... /System/Library/PrivateFrameworks/Preferences.framework/Preferences (compatibility version 1.0.0, current version 628.5.0) /System/Library/PrivateFrameworks/[B]CoreTelephony.framework[/B]/CoreTelephony (compatibility version 1.0.0, current version 277.37.0) /System/Library/Frameworks/AddressBookUI.framework/AddressBookUI (compatibility version 1.0.0, current version 33.0.0) ..... /usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 40.0.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.2.1)
mrussells-iPhone:/usr/bin root# 5. This lead me to the CoreTelephony stuff I mentioned first.
Some interesting info on IOKit and ioreg. Download IOKit tools from Cydia.
You can pretty much call all the listed functions in CoreTelephony(which are C functions). You'll get a compile warning, but the call works. If the function didnt exist in the library the linker would fail. I could use some help figure out how to call _CTCallHistoryStoreDataCountersGetAllReceived() properly.
Replies
i've spent days with a jailbreak device trying to figure out how to get to this info.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome"Deric forwarded your message to me. There's currently no way to get at that data from the iPhone SDK. Please log a bug at https://bugreport.apple.com requesting this and anything else you're interested in, along with an explanation of what you're hoping to do with the info/API."
I logged the feature request under Bug No. 6271340
Cheers,
Phil
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomebut this is the overall count (and i dont think sysctl will get your app rejected).
All I need for my purpose now is one or the other (wifi/cell) and subtract it from this.
I also have some code (Reachability.h from apple site) that tells you when the network connection changes from wifi/cell. So I can use this combo to track wifi/cell traffic while my app is open, but I dont really want to have to make the user keep the app open.
I've also looked into writing a daemon on a jailbroken device, and I think it'll work. But I dont really want to force users to jailbreak.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeBasically it's in the private CoreTelephony.framework.
There are several functions in this library related to these counts
I came upon this information from an otool dump of CoreTelephony here
CoreTelephonyFunctions.wiki - iphone-wireless - Project Hosting on Google Code
I tried doing otool myself and cant this output. But the functions are definitely there and produce something. If you add CoreTelephony.framework to your project. (found in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.2.sdk/System/Library/PrivateFrameworks/CoreTelephony.framework)
So CTPowerGetAirplaneMode() works fine. But the trick now is to figure out exactly how to call _CTCallHistoryStoreDataCountersGetAllReceived(). I was hoping it would just return an integer, but it's not that straightforward.
Here's the sequence of my quest thus far.
1. jailbreak phone and use SSH
2. And you can also see some interesting info in /Applications/Preferences.app/Usage Statistics.plist
3. And I also found some interesting info using class-dump-z on Preferences.app
(you'll have to jailbreak, SSH into the phone for this)
class_dump_z - networkpx - class-dump-z ? Extracting class interface for Objective-C version 2 ABI. - Project Hosting on Google Code
4. run otool on Preferences.app to see what Libraries/frameworks it uses.
# otool -L /Applications/Preferences.app/Preferences
mrussells-iPhone:/usr/bin root#
5. This lead me to the CoreTelephony stuff I mentioned first.
I also found some interesting information on CoreTelephony
iphone-wireless - Project Hosting on Google Code
Some interesting info on IOKit and ioreg. Download IOKit tools from Cydia.
You can pretty much call all the listed functions in CoreTelephony(which are C functions).
You'll get a compile warning, but the call works. If the function didnt exist in the library the linker would fail.
I could use some help figure out how to call _CTCallHistoryStoreDataCountersGetAllReceived() properly.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeBut on a jailbreak device all should be possible. I still cant get the CoreTelephony functions to work, but I'm sure using SQL code to access this DB will work. Here's some preliminary with SSH and sqlite3 installed on a jailbreak device.
Yeah! there it is.
I'm going to go the SQL route for now and least be able to run this on jailbreak.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomehere's a decent example i used to write the sql code
iPhone SDK Tutorial: Reading data from a SQLite Database | dBlog.com.au
and here's the code
-(void) callhistorydbRead {
// Setup the database object
int rc;
sqlite3 *database;
NSLog(@\"Reading CALL History DB\");
// Init the animals Array
callhistorydb = [[NSMutableArray alloc] init];
//dbpath=[NSString stringWithString:@\"/private/var/mobile/Library/CallHistory/call_history.db\"];
dbpath=[NSString stringWithString:@\"/User/Media/Photos/call_history.db\"];
// Open the database from the users filessytem
if((rc=sqlite3_open([dbpath UTF8String], &database)) == SQLITE_OK) {
// Setup the SQL Statement and compile it for faster access
const char *sqlStatement = \"select * from _SqliteDatabaseProperties WHERE 1\";
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
// Loop through the results and add them to the feeds array
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
// Read the data from the result row
NSLog(@\"%@\", [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 1)]);
}
}
// Release the compiled statement from memory
sqlite3_finalize(compiledStatement);
} else {
NSLog(@\"SQL error %d\", rc);
}
sqlite3_close(database);
}
and here's the output
maybe _CTCallHistoryStoreDataCountersGetAllReceived() is returning some SQL thing or a string? or accepting a string arg?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome