Page 1 of 2 12 LastLast
Results 1 to 10 of 13
Discuss Open Notes.db sqlite DB from iPhoneSDK at the iPhone Developer Exchange - Hackint0sh.org; Is there a way to open Notes.db database from IPhone SDK. I try this : ...
  1. #1
    Rookie Array

    Join Date
    Dec 2007
    Location
    EU
    Posts
    29
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default Open Notes.db sqlite DB from iPhoneSDK

    Is there a way to open Notes.db database from IPhone SDK.
    I try this :
    ================================
    NSString *dbPath =@"/private/var/mobile/Library/Notes/notes.db";
    if(sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK)
    {
    ....
    ....

    }
    ================================
    but doesn't work.

    Any idea ?



  2. #2
    Senior Professional Array

    Join Date
    Sep 2007
    Posts
    370
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    29

    Default

    Hi,

    Yes, you can open the Notes database from the SDK but not using the standard methods. The reason is that the SDK only allows you access to files in your project directory.

    What you can do however is:

    - create your application in the SDK
    - build the project (don't enter any developer certificates)
    - FTP the built project to your /Applications/ directory
    - reboot the iPhone (only have to reboot the first time you FTP)
    - run "ldid -S /Applications/MyApp.app/MyApp" to fake sign the program
    - finally open the application

    If you follow these steps then your application will be able to access Files outside of the Project directory.

    Obviously if you are a member of the iPhone Development Program you would want to just press "Build and Run" and then see your program.

    To do this I would recommend that you take a copy of the Notes database and put it in your Project, then just access this while testing.

    Hope this makes sense.

  3. #3
    Rookie Array

    Join Date
    Dec 2007
    Location
    EU
    Posts
    29
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by rjshearman View Post
    Hi,

    Yes, you can open the Notes database from the SDK but not using the standard methods. The reason is that the SDK only allows you access to files in your project directory.

    What you can do however is:

    - create your application in the SDK
    - build the project (don't enter any developer certificates)
    - FTP the built project to your /Applications/ directory
    - reboot the iPhone (only have to reboot the first time you FTP)
    - run "ldid -S /Applications/MyApp.app/MyApp" to fake sign the program
    - finally open the application

    If you follow these steps then your application will be able to access Files outside of the Project directory.

    Obviously if you are a member of the iPhone Development Program you would want to just press "Build and Run" and then see your program.

    To do this I would recommend that you take a copy of the Notes database and put it in your Project, then just access this while testing.

    Hope this makes sense.
    I created an application. MyApp.app in the SDK
    I copied the (FTP) from the dir “/Users/MacOSX/Documents/ MyApp /build/Release-iphonesimulator/ MyApp.app” on the phone and dir /Applications/ MyApp.app
    Not seen anything on the desktop of the phone
    The closed and opened again, again not seen anything on the desktop of the phone.
    Then run the “ldid -S /Applications/ MyApp.app/ MyApp” which took me the following message (util/ldid.cpp(418): _assert(0:arch != NULL)) and not seen anything on the desktop of the phone.

    Should I done something else before ?

  4. #4
    Senior Professional Array

    Join Date
    Sep 2007
    Posts
    370
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    29

    Default

    Hi,

    Did you turn the iPhone off then on again? This is required the first time you copy an application as it will then be present on the homescreen.

    BTW: You have to run the "ldid" command as Root.

    The default password is : alpine

  5. #5
    Rookie Array

    Join Date
    Dec 2007
    Location
    EU
    Posts
    29
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by rjshearman View Post
    Hi,

    Did you turn the iPhone off then on again? This is required the first time you copy an application as it will then be present on the homescreen.

    BTW: You have to run the "ldid" command as Root.

    The default password is : alpine
    Thanks, You right. But just I running it is closed immediately.
    I check out the folder and program rights and is 777.
    What can I do?

    edit:
    All my test apps when I run the “ldid -S /Applications/xxxx.app/xxxx” returns : "failed with return code 1 and error message 'util/ldid.cpp(418): _assert(0:arch != NULL)'"

    ??
    Last edited by mentor667; 11-02-2008 at 10:38 PM.


  6. #6
    Senior Professional Array

    Join Date
    Sep 2007
    Posts
    370
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    29

    Default

    UPDATE:
    How did you download "ldid"? I ran this command from Terminal : apt-get install ldid


    Here's what I do.

    Inside the SDK there are Debug and Release profiles as standard.

    I fill out the Debug profile with my official iPhone Developer Program profiles (so I can test my application without having to "ldid" each time).

    But for the Release profile I leave everything blank (so that there is no code signing). Then I use "ldid" to sign it.

    When app is ready for testing I:

    - Open finder and go into project directory
    - Go into the Build folder
    - Delete everything
    - In SDK I select "Device" and "Release" and click "Build"
    - In finder I go into Build -> Release folder
    - FTP MyApp.app to /Applications/ directory on iPhone
    - Reboot if first time, otherwise no need
    - Open Terminal
    - Run "su root"
    - Run "alpine"
    - Run the "ldid" then exit Terminal
    - Click application and run.

    Let me know if you're doing anything different
    Last edited by rjshearman; 11-03-2008 at 10:59 AM.

  7. #7
    Rookie Array

    Join Date
    Dec 2007
    Location
    EU
    Posts
    29
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by rjshearman View Post
    UPDATE:
    How did you download "ldid"? I ran this command from Terminal : apt-get install ldid


    Here's what I do.

    Inside the SDK there are Debug and Release profiles as standard.

    I fill out the Debug profile with my official iPhone Developer Program profiles (so I can test my application without having to "ldid" each time).

    But for the Release profile I leave everything blank (so that there is no code signing). Then I use "ldid" to sign it.

    When app is ready for testing I:

    - Open finder and go into project directory
    - Go into the Build folder
    - Delete everything
    - In SDK I select "Device" and "Release" and click "Build"
    - In finder I go into Build -> Release folder
    - FTP MyApp.app to /Applications/ directory on iPhone
    - Reboot if first time, otherwise no need
    - Open Terminal
    - Run "su root"
    - Run "alpine"
    - Run the "ldid" then exit Terminal
    - Click application and run.

    Let me know if you're doing anything different
    Everything is ok except Build “Device -> Release” version.

    I Have Xcode version 3.1.1 and I can’t Build “Device -> Release” version. It raise exception with message “Code sign error………”.

    Can I Build with the "Xcode Template for pwned device" ?

  8. #8
    Senior Professional Array

    Join Date
    Sep 2007
    Posts
    370
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    29

    Default

    I've not tried with the Template for Pwned Device.

    Inside your project settings click on the Build Tab and scroll down to the Code Signing section.

    Make sure you have "Any iPhone OS Device" under the "Code Signing Identity" part but leave the value empty

    And ensure you have "Any iPhone OS Device" under the "Code Signing Provisional Profile" but this time select "Default Provisioning Profile for Code Signing Identity"

    Now select "Device" + "Release" and click "Build" > "Build"

    Does this work?

  9. #9
    Rookie Array

    Join Date
    Dec 2007
    Location
    EU
    Posts
    29
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Wink

    Quote Originally Posted by rjshearman View Post
    I've not tried with the Template for Pwned Device.

    Inside your project settings click on the Build Tab and scroll down to the Code Signing section.

    Make sure you have "Any iPhone OS Device" under the "Code Signing Identity" part but leave the value empty

    And ensure you have "Any iPhone OS Device" under the "Code Signing Provisional Profile" but this time select "Default Provisioning Profile for Code Signing Identity"

    Now select "Device" + "Release" and click "Build" > "Build"

    Does this work?
    Thanks, you are the Best !!!

    I can read all internal DBs.

    Thanks again.

    --

  10. #10
    Senior Professional Array

    Join Date
    Sep 2007
    Posts
    370
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    29

    Default

    That's good news.

    You're welcome.


 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Problems installing Ios and IphoneSDK
    By pompalomp in forum iPhone Developer Exchange
    Replies: 0
    Last Post: 01-04-2011, 03:16 AM
  2. sqlite db in bundle
    By sjurmr in forum iPhone Developer Exchange
    Replies: 1
    Last Post: 12-11-2008, 10:55 AM
  3. PHP + Sqlite
    By fabiopigi in forum Free Toolchain Software (Cydia App's)
    Replies: 0
    Last Post: 10-13-2007, 11:52 AM
  4. SQLite access in iPhone?
    By RVN84 in forum Free Toolchain Software (Cydia App's)
    Replies: 0
    Last Post: 08-22-2007, 11:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 09:48 AM.
twitter, follow us!