1

I have reviewed this link. I am installing a debian package with iOSOpenDev. I want to write in sqlite database using this hook. So I put the DB in /var/mobile/Documents/xxx.sqlite.

When I call NSFileManager to check if sqlite file exists, I can verify that it exists. sqlite3_open call succeeds and it opens the database. I have given chmod 666 access to this file. When I call sqlite3_exec with insert query, it fails with error message "unable to open database file".

This is really wiered. Is there a "right" folder where I should put my sqlite file when I want to write through a debian hook?

Community
  • 1
  • 1
TorukMakto
  • 2,066
  • 2
  • 24
  • 38
  • 1
    Have you seen [this answer, too](http://stackoverflow.com/a/17801373/119114)? In general, a jailbreak app should store its documents in `/var/mobile/Library/APPNAME`. But, it's not clear to me from your question whether you want **multiple** apps to be able to use this same file or not. – Nate Jul 25 '13 at 21:37
  • @Nate- Thanks for reply. My debian package gets installed at /var/root/iOSOpenDevPackages/xxx.deb. So I do not have /var/mobile/Library/APPNAME path to write to. I am 99% sure that my deb package is running as "mobile" user. when i execute "ps -u mobile" I see process called "notification_proxy" where notification is the name of my debian package. – TorukMakto Jul 26 '13 at 06:03
  • The `.deb` file is just the name of the package itself. Copying it to the phone doesn't actually install any software. Once the .deb file exists on the phone, it can be installed with `dpkg -i /var/root/iOSOpenDevPackages/mypackage.deb`. And then, the contents of the deb package will be installed, usually in some other location. Normally, jailbreak apps would be installed (unpackaged) in `/Applications`, and `/var/mobile/Library/APPNAME` would be the correct location for the app's files to be store. Does that make sense? – Nate Jul 26 '13 at 06:08
  • on extracting .deb it installed my library on path: /Library/MobileSubstrate/DynamicLibraries/Notification.dylib. Library directory is part of admin group and does not have write permission for others. So mobile user won't be able to write in here. – TorukMakto Jul 26 '13 at 06:48
  • The location of the .dylib file isn't really important here. That does not determine the permissions, or sandbox limits, of the code that **runs**, and loads that dylib. The process (app) that runs and loads that dylib is the key. – Nate Jul 26 '13 at 20:48
  • Great suggestion. Finally I had all apps send distributed notification to SpringBoard. And in /var/mobile/Library/SpringBoard I was able to write and read files without any issues. If you put it as answer, I will accept it. Thanks again. – TorukMakto Aug 08 '13 at 02:58

0 Answers0