Yes. I understand that. I also understand how one application can access the private data of another application [using sharedUserId].
I think I missed a point in my earlier explanation. The native code that is trying to create a file in a application specific folder has been invoked by the same application using JNI. Example: Music app has its private folder called /data/data/com.android.music/. When creating a file, it does create it in /data/data/ com.android.music/files. Now, mediaplayer.cpp, which is the native code version of the mediaplayer, is not able to create a file in the same folder. -Ravi On Dec 24, 3:22 pm, freepine <[email protected]> wrote: > Each Android package (.apk) file installed on the device is given its own > unique Linux user ID and any files created by that application will be > assigned its user ID which is not normally accessible to other packages > > You can refer to below > link:http://code.google.com/intl/zh-CN/android/devel/security.html > > On Wed, Dec 24, 2008 at 4:58 PM, rktb <[email protected]> wrote: > > > Hi, > > > Need some pointers about file access permissions: > > > Here is what I have tried: > > > From the Java app., I can create a file in /data/data/ > > <my_package_name>/files/ using the API openFileOutput(). The > > permissions of the file is as follows: > > -rw-rw---- app_10 app_10 0 2008-12-23 09:17 testFile1.txt > > > The files folder itself has the permissions: > > drwxrwx--x app_10 app_10 2008-12-23 09:17 files > > > When I create a file using native code on /sdcard, the permissions are > > as follows: > > ----rw-rw- system system 0 2008-12-23 09:17 > > fromNativeCode.txt > > Is it right to say that native code process has "system" rights? > > > Now, when I create a file using the Java layer, I can open the same > > file for "reading" through native code. But, I cannot open a file in > > the same place using the native code with "writing" capability. The > > permissions of the "files" folder is "app_10", which is the userID of > > the app. Right? Doesn't "system" trump "app_10" in terms of > > permissions? > > > In other words, the objective that I am trying to achieve is to create > > a file inside native code at a place other than sdcard. Preferably, > > application specific location. > > > Any document that anybody could point that would detail more about > > security and permissions? I have already read > >http://code.google.com/android/devel/security.html. But, it does not > > deal with native code details. > > > Thanks, > > Ravi --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "android-framework" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-framework?hl=en -~----------~----~----~----~------~----~------~--~---
