[Q] AppArmor rights to read from SD Card - Ubuntu Touch Q&A, Help & Troubleshooting

Hello, I am developing an app for offline navigation, the development goes steady and a more or less usable app is ready now. I am just struggling with one thing, I now put the map files in <SD_CARD>/Pictures/osmscout and add picture_files_read to the apparmor file. Of course Pictures is not the right location for maps, but how can I give my app rights for another location on the sd card, like <SD_CARD>/Maps/osmscout or something?
The description of picture_files_read in the ubuntu-sdk apparmor dialog says that this apparmor profile should give read access to /media/*/r (at least temporarily) however it doesn't actually give me permissions to any other location than Pictures.
Any ideas?
Thanks

Ubuntu prevents file system access to any other location than your own data, cache and config directories by design. That decision was made to improve the security of the system.
However, as noted, you do have write access to three directories:
Code:
~/.local/share/package.name (for user data)
~/.cache/package.name (for caching)
~/.config/package.name (for config files)
The directory which would be best for your purposes would probably be the cache directory.
That one isn't located on the sd card but it's the only option you have.
Sent from my awesome Ubuntu Touch device using the Forum Browser app

Well, the cache directory is just in the home directory and probably not big enough. I don't even need write access, just read access for now, as the user is putting the files there manually.
Until I have found a workaround, I am putting the files in Pictures.
At least for the Aquaris, the home partition is too small to store any serious map files, they can easily be a few GB.
nikwen said:
Ubuntu prevents file system access to any other location than your own data, cache and config directories by design. That decision was made to improve the security of the system.
However, as noted, you do have write access to three directories:
Code:
~/.local/share/package.name (for user data)
~/.cache/package.name (for caching)
~/.config/package.name (for config files)
The directory which would be best for your purposes would probably be the cache directory.
That one isn't located on the sd card but it's the only option you have.
Sent from my awesome Ubuntu Touch device using the Forum Browser app
Click to expand...
Click to collapse

Sadly, I don't see many options here.
The only one which I can think of is the following: Ask your users to download the terminal app and copy over a command which either creates a (persistent) symbolic link from /home to their data directories on their sd cards or mounts the said folders in their home directories (the latter wouldn't be persistent after a reboot).
You still have to check out if that works but I'm confident that at least the mount scenario works.
Otherwise, I believe this would be a good question for the Ubuntu Phone mailing list where the OS developers hang out, too: http://launchpad.net/~ubuntu-phone.
Sent from my awesome Ubuntu Touch device using the Forum Browser app

Related

[App]Files by neilers

Hello there!
I've chosen to work on building a user interface for file managing on android tablets for my special problem, one of my subjects this semester. So in order to graduate, I need the help of some willing testers to test out my app.
Here's a demonstration of the features it has:
http://www.youtube.com/watch?v=gNcyT5iwLyU
Some things to take note of:
There's no up folder button, so you can't go past /mnt/sdcard when going up the directory hierarchy
if /mnt/sdcard is not your internal sdcard's default mount path, then it'll crash
When you swipe horizontally too fast to switch tabs, it does some funky stuff making one pane invisible. touch the other pane again to make it appear again.
You CAN'T cancel a copy or past operation when it has started.
Don't do stuff like copying or moving a file to the same folder it currently is in. if you move a file or folder to the same folder, it will get deleted.
Just perform normal file operations. Avoid trivial cases as mentioned above.
I'll admit, it's not the best file manager. Features are scarce, the code is not that optimized both in running time and in memory allocation, and there are a lot of checking that needs to be done (like when your sdcard is currently mounted in usb mass storage mode). But my focus is the user interface and not the back end, so please excuse these things.
So here's the link for the app: http://dl.dropbox.com/u/16398746/Files.apk
And here's the link for the evaluation form: https://docs.google.com/spreadsheet/viewform?formkey=dEVQeElJb3QyR05kLUN0akliV0ExbEE6MQ#gid=0
Thank you very much! I'm open to comments here in XDA so just comment ahead and please be gentle with me, it's my first app.

Possible? Trick dropbox into mounting as sdcard2

As far as I can tell dropbox for android doesnt make a mount point like it does on a PC, but the function is there. Could android be tricked into doing this?
Hello, i a, looking for for something like this aswell. The only posibility i know is dropsync, but this mirrors the dropbox to the local storage... It would be great to be able to Mount the dropbox like a network drive
Es file Explorer can add your dropbox folder as a share in its app. Actually it supports GDrive and Box too...
david279 said:
Es file Explorer can add your dropbox folder as a share in its app. Actually it supports GDrive and Box too...
Click to expand...
Click to collapse
Yes but the share in not available to other apps as if it were mounted as another external SD drive. I want to use an encryption software but I need to point it to the encrypted file. For that the dropbox folder needs to look like an android system folder.
ParrSt said:
Yes but the share in not available to other apps as if it were mounted as another external SD drive. I want to use an encryption software but I need to point it to the encrypted file. For that the dropbox folder needs to look like an android system folder.
Click to expand...
Click to collapse
I have been looking for something similar. so far, (apart from apps like es file explorer) the closest i have found is [puts on protective suit] this
https ://github.com/arekzb/dropfuse
now - yes, I know that it is linux and not android, but given the similiarities in the systems (ducks flaming posts), it may server as a planning base for a (much smarter/more knowledgeable) person to expand upon.
My thoughts (possibly invalid) would be that the mount point could be created at/after(?) boot via some sort of script - not sure if this is even possible, but if it could be done, you could then potentially modify for other storage services.
Purpose's could be to - stream media, store files for online viewing/editing/reading etc...
******
update - just tested and have not got it working on my ubuntu system - possibly due to a backend dropbox change (or just me not being able to follow instructions)
*******
okay - so tried again and it works (for ubuntu) - help read instructions and google - works wonders
needed to install setuptools and pyquery, and it only works while the terminal window is open (there may be a way to run as a service or something - but not checked yet).
so all good - so far.
Did some checking and there is python for Android around, so am thinking (once i get a chance) I will try to see if i can emulate the linux success.....
Great for Ubuntu, any chance for Android

Partitioning SD card in u8150

I partitioned my SD card in huawei u8150 everything for me is ok but when I look in cyanogenmod settings then application the check box in the expanded internal expanded storage is not clickable please help
ROM: CYANOGENMOD 7.2 STABLE
Sent from my U8150 using xda app-developers app
Don't know the specific device but when running into similar issues I usually do the following
1 back up everything
2 back those backups up somewhere other than the SD
3 reformat the SD with the device you intend to use it for
4 check if re-partitioning is needed
4a if not then; skip to 5
4b if so then; re-partition and go to 5
5 check that things seem ok, try moving an app to SD, try reading/writing/deleting a few junk files
6 if all is ok then move backed up data back to SD card and chock it up to the oddness of electronics, if all is not ok then perhaps your ROM or kernel or device has something sooooo check for bug reports on the sites that you get those from and or check the lists of features.
Currently I run cm 7 on my HTC device and have a multi-partition set up on the SD card, no issues other than Android only seeing the first one in the list.
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey
S0AndS0 said:
Don't know the specific device but when running into similar issues I usually do the following
1 back up everything
2 back those backups up somewhere other than the SD
3 reformat the SD with the device you intend to use it for
4 check if re-partitioning is needed
4a if not then; skip to 5
4b if so then; re-partition and go to 5
5 check that things seem ok, try moving an app to SD, try reading/writing/deleting a few junk files
6 if all is ok then move backed up data back to SD card and chock it up to the oddness of electronics, if all is not ok then perhaps your ROM or kernel or device has something sooooo check for bug reports on the sites that you get those from and or check the lists of features.
Click to expand...
Click to collapse
I can move applications but the sd card partition does not increase my internal memory which is 163 mb by the way thanks bro for your help in advance
bonsoljoshua said:
I can move applications but the sd card partition does not increase my internal memory which is 163 mb by the way thanks bro for your help in advance
Click to expand...
Click to collapse
I mean that if i can move the full application in that partitioned aprt of the sd card that would increase my memory
I've written a few guides here and there, if you search hard enough you'll find one about
Folders plug
http://forum.xda-developers.com/showthread.php?t=1502893
that I wrote once about that app... I think so anyways if not then here is a quickey to save time for all readers that stumble across this work around
1. Get some warnings out of the way
~ this app is in beta (currently)
~ requires root
~ use at your own risk
~ don't use on system apps (like your phone or contacts)
~ don't use on apps that you rely on (anti theft apps for example)
~ I'm not the dev of the app just a supporter
~ make a backup (nandroid style) then back all that up and what ever you value on you sdcard somewhere else
~ I've done some hard testing with this app and put two devices into boot loops / simi-bricked states. So know how to recover from this and be careful.
~ I have yet to fully brick any device ever, even with this app, so it might be safe when used properly.
2. Provided the warnings don't bother you, then download and install the above app
3. Open the app and be presented with a few options
~ under menu + Preferences = Mount on boot
~~ I would not use this until playing with the other options first and seeing how your device responds
~ under menu + Edit = a screen that will say something like "no mount points selected"
~~ this is where the magic happens, move to step 4
4. Under 'menu + Edit'
4a~ now press menu and then "Insert"
~ this is where things may be confusing
4b~ For source folder you may want to make a new folder on your sdcard with an app like root browser (hint this app comes bundeled with ROM Toolbox; another fantastic app) I put mine under '/sdcard/Adev/Internal_Spoof/' and then make a new folder path per app from there
4c~ For Target folder things get a bit complex; you've got to find the folder on the device's internal folder structure (root browser for the win on this again) that contains the apps data.
... be back to edit the rest in in a sec, just posting to ensure you know I'm still here
5. Before finalizing any links you should probably back up the app data somewhere else too. For example '/sdcard/Adev/Internal_Spoof/backups/'
6. So you've got a good target for both now there are more options.
6a~ you can press accept and then press and hold on the connection you've just made and then select mount
6b~ or after setting a bunch up the main screen with the red plug icon can be pressed like a button to activate all the ones in the list that have a green check box next to it at once.
7. Once you've tested this... for example I used;
~ for Source I used '/sdcard/Adev/Internal_Spoof/download
~ for Target I used '/data/download'
And kinda get what's going on here and know where you app data is saved (hint I think mine is under '/data/data' but yours maybe different) it's time to make it useful for your quest for more space to install apps (among other things too maybe?)
7b~ so if an app like Pandora is under 'data/data/com.pandora' and you map it like so--
~ source '/sdcard/Adev/Internal_Spoof/Pandora'
~ target 'data/data/com.pandora'
-- and back the data from '*/com.pandora' to '*/Internal_Spoof/Pandora' and then activate the link... then nothing will look different... except when you view the available space that its
8. Rinse and repeat for each app and don't forget to copy the data (otherwise it'll brake the app till you un-link and copy the data ) and remember not to do it to certain apps.
9. Once you've verified that it's all good and your apps run with ok levels of lag you can try testing the "mount on boot" option that I told you not to use yet. If it works after a reboot then opening and interacting with the affected apps, then rebooting again and interacting again and rebooting again, then it's time to do something dangerous...
10. Provided that your with me so far and things are good on your device its time to do the risky bit; deleting the data from 'data/data/com.pandora' and running it strait from sdcard and re-testing for broken apps with a reboot.
This will effectively open real system memory back up for other tasks but like I said use at your own risk.
final edit before seeing any feedback- this work around may seem a bit complex at first but once you've got a list of apps that work when short-cutted like this it can make a big difference in how much available space can be accessed, however, this may cause force closures on some apps, and may degrade the life of your sdcard. Furthermore in some usage scenarios I had better battery life but that's for another guide on another day
I'll be linking in a google doc version of this guide when I get it shairable and maybe link in screen shots or screen casts for better guidance. If I've really helped then consider hitting the thanks button and happy hacking and modding.
Sent from either my SPH-D700 or myTouch3Gs
Debian Kit/QEMU Linux Install guide for all android devices that I'm writing:
http://forum.xda-developers.com/showthread.php?t=2240397
Now have working Installers for ARM Java 7 JDK + Maptools + jMonkey

Storage and File System After Update

I've read a number of forums and such concerning the way this update changes the file system, creating "legacy" and "0" folders and how that may be related to Other category in my Storage settings, which shows over 18 GB used by something I haven't determined.
However, I'm just a simple mechanical engineer and don't really understand what I'm reading regarding this topic. Would it be possible for someone to explain if in more simple terms?
Sent from my HTC One using xda app-developers app
This has actually been a change in Android itself since 4.2, which included as one of its updates the ability to set up multiple user logins that share the same device. The file structure was rearranged to reflect that change, and the "0" folder represents the main admin user. As for the bloated SD card, I think it's due to some data repetition and needs a full wipe to correct the problem, if I'm not mistaken.
Tremendo Slap said:
This has actually been a change in Android itself since 4.2, which included as one of its updates the ability to set up multiple user logins that share the same device. The file structure was rearranged to reflect that change, and the "0" folder represents the main admin user. As for the bloated SD card, I think it's due to some data repetition and needs a full wipe to correct the problem, if I'm not mistaken.
Click to expand...
Click to collapse
I don't have access to a command prompt on my phone, but I suspect that the legacy and /0 directories are not duplicates. One of the two is what is called a soft link, where the file is listed as in that directory but actually resides somewhere else. When I create a new photo, it shows up in both directory structures.

[Q] How to access Android data from Touch in dual-boot.

I set up the dual boot on my Maguro, and I want to have a shared directory to drop my music into that will play on both Ubuntu touch and CM 10.2. However, I cannot find the ubuntu data folder from Android. I understand that there is supposed to be an ubuntu folder in /data from the android side, but I don't see it. On the Ubuntu side, I can see everything in my home folder, but when I go up to filesystem, I see nothing, and can't go any further up. Any ideas?
i used ES for this. check root explorer then go up to /data/. you'll find ubuntu's user & system data folders. as for ubuntu, since /data is mounted there must be a way to see the files in android. i think with root permission you might be able to do it . my terminal app doesn't work (trusty r79, already a thread for it) and my ssh connections are rejected. i'll report back when i get it to work
there should be a way (using root ofcourse) to make both OSes see each other's user space (again after i get my terminal working i'll see if i can find something)
ES worked well for this. Once I found /data/user-data/phablet/Music, I just moved all my music into it, and set a custom path in VLC to point there. It's not as nice as being able to share the whole user space between OS's, but it works well enough for me.

Categories

Resources