Skip to content

Android 13 Data and Obb Folder Access (Work Around)

GusindaGusinda Member Posts: 1,915
Hi All,

I have been living the good life and was able to access Android/Data and Android/Obb using the 'X-plore File Manager' which still works for Android 11 and Android 12 (at least on my devices). On Friday, I had the displeasure (? want to see what it improves first) of my tablet being upgraded to Android 13 which put a halt on all such access. I am sure my phone will follow very shortly (my devices are both Samsung).

I started the problem solving with a quick search and found some writing and work around on the problem.

I installed 'Files' and had no problems accessing either of the folders. I skipped part of their recommended procedure but not worrying about disabling the File Manager that came with my device. I figured that I would give it a go and see what happens. I found that I didn't need to as it worked, at least on my devices. If you own other brands of devices, you may need to disable... worth a shot.

I was able to rename files and create folders within a single window (but couldn't copy into either folder on a single window). Using the dual window method described in the weblink, I had no problems moving both folders and files...

This just adds a small step in the procedure of adding to the games folder but I was still able to do it... (the small addition is to create the folder outside of Android/Data or Android/Obb and make all the changes needed prior to moving it into the 'Google driven restricted areas'). These 'security' changes have nothing to do with Beamdog...

I have installed the Files app on my phone which still has Android 12 and was able to access and make the same changes as well without any problems.

I called this a work around because I am sure that the Android File Manager devs out there are working furiously to update their apps to provide access (if they can).


Happy Gaming
Gus

Comments

  • ProlericProleric Member Posts: 1,283
    edited August 2023
    Having problems with this method (Galaxy Tab Android 13) for Neverwinter Nights.

    The split-screen native Files approach works for unrestricted folders.

    I can see the contents of com.beamdog.nwnandroid/files/data but not the contents of /user where the mods are held.

    Attempting to copy files to /user results in the error "file operation is not supported".

    I also tried USB connection to the PC via ADB without success:
    > adb devices
    > adb shell 
    > cd data
    
    works OK but
    
    > ls                         
    
    results in "permission denied"
    
     > cd com.beamdog.nwnandroid  
    
    results in "no such file or directory" 
    

    If anyone has either method working, could you post details?

    P.S. I have read that Beamdog might be looking into this, at least for some other games, but right now NWN:EE won't let me install modules on Android 13 - can't even back up my saves.
    Post edited by Proleric on
  • Ɲ????Ʀ????Ɲ????Ʀ???? Member Posts: 29
    edited August 2023
    While I cant offer anything specific to Android 13, my last android device(Note9) is on Android 10 as I havent replaced it yet but that time is rapidly approaching, I can offer some general android/adb knowledge-



    You'll likely need root access and in the past this could be accomplished, which may have changed, by using commands like:

    adb root

    adb remount

    The last time I fooled with android innards was 9 or 10- been a while, I had to use both those commands actually- once to gain access and then remount mounts the files with root access.

    Plan on getting a zFold5 at some point in future.

    Edit:
    The other commands worth looking into, off the top of my head, if you want to fool with android innards-

    adb --help - Shows general help info and list of available commands.

    adb shell - Puts you in remote shell to execute commands directly on the device. This is very similar to linux in many ways at least as far as commands available to you.

    - You can also issue commands like this without entering the shell directly- adb shell ls /system/bin. Within the shell you can issue Toybox or busybox commands generally depending on your Android Version. Toybox is more current I do believe.
    - You cannot issue adb commands within the shell once you enter without exiting the shell with cmd- exit. Side Note: when using ls you may want to use ls -la so that it shows all files/folders with their permissions as a list even if they are hidden. -l = list view ..... -a = all files viewable

    adb push local remote && adb pull remote local - Example Command: adb push myfile.txt /sdcard/myfile.txt -- Copies myfile.txt from your current folder/directory to the sdcard folder/directory on your device. The pull command is just the reverse of that- copying from the device to your pc.

    adb shell pm - Shell Command- can just use pm after entering shell. Androids Package Manager

    adb shell dpm - Shell Command- can just use dpm after entering shell. Android Device Policy Manager

    Post edited by Ɲ????Ʀ???? on
  • GusindaGusinda Member Posts: 1,915
    HI @Proleric, I just tested adding a mod to NWN and had no problems using the dual screen method (Samsung TAB S7 Plus with Android 13).

    Now I already have the /modules folder in place with some other mods and not starting from a new install. Perhaps try and add the /modules folder first, then copy into that...

    Hope that helps



    ????Ʀ????, thank you for those commands. I have dabbled with adb to do some work on a different device and it is powerful. Hope you enjoy your zFold (bit jealous :smile: as I just love new toys).

    Gus
  • ProlericProleric Member Posts: 1,283
    edited August 2023
    @Gusinda you mentioned you had nwn installed before the upgrade to Android 13.

    In my case, it's a new tablet with 13, on which I've installed NWN.

    Maybe that's created the Beamdog folders with different permissions?

    I tried creating /modules first, with no success. Files presents the Beamdog /user folder as empty, and does not offer the New Folder option. I tried creating the folder elsewhere, then dragging across the split screen, but, as before, it results in the error "file operation is not supported".

    P.S. In case it matters, creating the split screen doesn't work exactly as described in the original article. When I click the Files icon in Recents, there is no Split top option. The option I use is "open in split-screen view". This results in a split screen with Files on one side and an Apps list on the other, from which I choose Files. It doesn'f seem to matter whether I open a new Window in Files first or not.

    The Samsung My Files app has Disable greyed out, too, but you said that step doesn't seem to matter?
    Post edited by Proleric on
  • ProlericProleric Member Posts: 1,283
    ????Ʀ???? Thanks - will look into that.
  • ProlericProleric Member Posts: 1,283
    In a nutshell - the problem seems to be that the Beamdog /user folder has invisible contents and will not allow the creation of new files or folders.

    This is not true of the Beamdog /data folder, which I can modify at will via a USB connection to PC etc.

    So the question might simply be - can I change the permissions on the Beamdog /user folder without rooting?
  • Ɲ????Ʀ????Ɲ????Ʀ???? Member Posts: 29
    edited August 2023
    Gusinda wrote: »
    HI @Proleric, I just tested adding a mod to NWN and had no problems using the dual screen method (Samsung TAB S7 Plus with Android 13).

    Now I already have the /modules folder in place with some other mods and not starting from a new install. Perhaps try and add the /modules folder first, then copy into that...

    Hope that helps

    ????Ʀ????, thank you for those commands. I have dabbled with adb to do some work on a different device and it is powerful. Hope you enjoy your zFold (bit jealous :smile: as I just love new toys).

    Gus


    @Gusinda-
    Your welcome. adb is indeed pretty powerful, as is learning command line nearly anywhere as most users expect things done for them simply and easily. You can do nearly anything with it including wipe your device completely and brick it. But as long as your comfortable and have a basic understanding its not too difficult to branch your knowledge from there.

    Yes looking forward to the zfolds bigger fold out screen. I like tinkering with my devices and is why I have far too many of them since I like tinkering with the new toys probably more than most-
    All separate devices but I have 4 PCs, ages vary one is 10+ years old and still going- only 3 actually working as I dont have a case or power supply for the 4th. 2 Raspberry Pi (3B & 4B), 3 consoles, 3 handheld consoles, 2 Apple devices, 2 Android devices and an Android TV Box.

    Ive tinkered with the internals of every one of them in some form or another. Everything from flashing them to fooling with boot, partitions, and system files. In the case of android devices- even fooled around in recovery, uboot and fastboot areas.

    Proleric wrote: »
    In a nutshell - the problem seems to be that the Beamdog /user folder has invisible contents and will not allow the creation of new files or folders.

    This is not true of the Beamdog /data folder, which I can modify at will via a USB connection to PC etc.

    So the question might simply be - can I change the permissions on the Beamdog /user folder without rooting?

    @Proleric -
    Usually isnt needed to actually root your device, majority of the time, unless you want to flash a rooted rom or something else like boot movie etc. Should only need to give adb the proper permissions(root/admin permissions) to alter the files/folder you want and then should be able to alter or change anything including file & folder permissions. In the case of Windows, for example in some cases, this may mean you need to open powershell or command prompt as an admin in Windows and get admin access in adb also.


    Also Androids Package Manager (pm within the shell) maybe worth looking at as it does a hair more than just manage the packages(read apps) on your device. It manages Permission also for packages for instance. and if that doesnt lead to what you want there is the below commands.




    You need to be in Shell(adb shell) to use these commands or at least connected with adb and use the adb shell yourcommand, but if your comfy with command line- in standard linux fashion, which has helped me multiple times in areas like this, the commands your looking for are chown and chmod to change the permissions unless android has since changed them.

    The commands work same as linux. If you want to know all the commands your device is capable of- start checking all the bin and sbin folders. Some will be soft links to the toybox on your device and others will be standalone commands.

    Toybox itself is a command container of many commands that might not be immediately visible in those folders also. You can view them with toybox --help if memory serves. Often times its in the sbin folder/directory.

    chown - This command gives the user & group you specify- ownership over the files altered with the command.
    Example:
    chown proleric:proleric /path/to/file-or-folder
    *The first proleric is your user and the second is your group.

    chmod - This command actually changes permissions(read,write,execute permissions) on the files altered with the command.
    Example: chmod 755 -R /path/to/file-or-folder

    The -R option above is to change all files in the directory and the directory itself and stands for recursive. Without the -R option it would affect only the directory individually but not anything else like the files within that directory. Hope that makes sense. It works for both chown and chmod. To only affect files/folders after the one in the command put a forward slash at the end like below.

    Putting an * at the end of the aforementioned slash only affects the files in that directory but not the folders/directories themselves even if they're in other directories will affect files but not directories iirc. Just the files within them example also shown below-

    chmod 755 -R /path/to/file-or-folder/

    chmod 755 -R /path/to/file-or-folder/*

    The numbers behind the above command tell it what permissions to give. The first 7 is user permissions, the second middle 5 is group permissions, and the last 5 is the World permissions which is everyone else outside your user and group aka the rest of the world. This affects the current owner/group of the file.

    If you want an easy calculator to help know what numbers you want/need you can use things like-
    Chmod Calculator

    I guess the simple answer would be yes you can if your comfy doing such.

    Edit:
    Glancing around about android 13 managed to find some framework info which may also help.

    Android 13 Compatibility Framework Changes

    Hope some of it helps someone.



    Post edited by Ɲ????Ʀ???? on
  • ProlericProleric Member Posts: 1,283
    edited August 2023
    Limited progress with ADB.

    I discovered that I can reach the NWN data with the command

    cd /storage/emulated/0/android/data/com.beamdog.nwnandroid/files/data

    and view the files with ls.

    However

    cd /storage/emulated/0/android/data/com.beamdog.nwnandroid/files/user

    results in "permission denied" i.e. exactly the same problem as USB-connected PC or Files app.

    Will keep plugging away at it.
    Post edited by Proleric on
  • ProlericProleric Member Posts: 1,283
    edited August 2023
    More on ADB...

    Using stat command, I find that the permissions on the NWN /data and /user folders are different:
    /data = 2770 drwxws---
    /user = 2700 drwx--S---

    The user and group are Uid=u0_a343, Gid=ext_data_rw

    Using the chmod command gives "operation not permitted" on /data and "permission denied" on /user.

    I guess this might be fixed by using the chown command first, however I don't know how to discover my user and group - and don't know whether that would stop NWN from using the folder.

    Any help welcome.
  • ProlericProleric Member Posts: 1,283
    SOLUTION

    From a USB-connected PC, rename the NWN /user folder.

    Make a new folder called /user.

    Copy all the mods into /user.

    ... works for me, at any rate.
  • ProlericProleric Member Posts: 1,283
  • Ɲ????Ʀ????Ɲ????Ʀ???? Member Posts: 29
    edited August 2023
    Proleric wrote: »
    More on ADB...

    Using stat command, I find that the permissions on the NWN /data and /user folders are different:
    /data = 2770 drwxws---
    /user = 2700 drwx--S---

    The user and group are Uid=u0_a343, Gid=ext_data_rw

    Using the chmod command gives "operation not permitted" on /data and "permission denied" on /user.

    I guess this might be fixed by using the chown command first, however I don't know how to discover my user and group - and don't know whether that would stop NWN from using the folder.

    Any help welcome.

    Im glad a workaround solution was at least found. And if you change them it is possible that it could keep NWN from using the folder. As the user and group that previously had ownership no longer does.

    The other option besides changing permissions and user or group on the directories themselves, which can make your device both more or less secure and you should be aware of, is to add your user account to the admin or other group you want to be in that does have access or even to create your own and add that to the group.

    The "operation not permitted" and "permission denied" youve been getting is adb not having permission to alter files on your device or run commands that require elevated permissions. I do recall some devices to gain access needed to use something similar to adb insecure or use other commands to give adb admin/root access to your device.

    When using shell for example, this means that adb has started the shell with a basic user account rather than an admin root type account. Its possible to get admin/root type privileges inside shell/on your device also. Adb would just autogrant it if it had the proper permissions. if that makes sense.

    Other times its as simple as switching to the proper user/account for a moment for temporary access then switching back in shell or gaining access through a simple command like adb root. It varies greatly between device manufacturers. Samsung devices for example, at least last I did any digging, required gaining access in their extra security software like Knox or if wanted to flash a rooted rom- a custom flasher(outside of other android devices) was required to be able to do things like alter internal software or root the device.

    Mobile device manufacturers have been, over time, making access more difficult in efforts to protect customers/users data and deny access to any internal software by normal(read not dev) users who dont use software like Android Studio or the SDK tools themselves to dev on the platform.

    In linux-
    Uid=u0_a343, Gid=ext_data_rw --

    Yes this is the account user/group that has access to those directories- (/data & /user). The Uid=u0_a343 is the user id(shown as uid) and Gid=ext_data_rw is the group ID(shown as gid). Normally this is set by the user, app, or OS on first run or set by user with commands and such.

    The 2770 & 2700 are the numbered representations of the permissions allowed on those directories by the user that owns them. You can safely ignore the first number(2)(chmod calculator in above post can tell you what its for if curious) as it does something special/specific- its the last three numbers(770 & 700) that actually set the permissions. 770 = user has rwx, group has rwx, world has no access. 700 = group user has rwx, other users in group no access, world no access. rwx=read, write, execute.

    Typical numbered permissions you'll see often- 700, 750, 751, 755, 770, 771, 775

    The user id appears mostly normal for any android device it just stands for user0 (typical admin/root user in linux is user0) and the rest is just a random identifier. But the random identifier at the end may make it a normal unprivileged(no access to anything important system wise) user account. The first user created by a person in linux is often times user 1000 or 1001.

    The group id is an odd man out but could be set that way intentionally and is likely permissions related. The group name is just short for external_data_readwrite (ext_data_rw) group.

    There are a few general ways to determine user and group related info. You appear to have found it yourself so wont go too much into that in interest of clarity. Another obvious place may want to look is /etc/group. Android also has/had its own Volume Daemon called vold.

    If your curious to see your disks, mount points, and read write type access to them and other such info you could try checking /etc/fstab. Sometimes Read/Write is restricted here also. But then you'll want to know more about Fstab before doing anything with it and even more so in Androids case if you really want to do anything with it. It can render your device unusable/unbootable except into recovery if improper entries are used.

    A few other generally helpful linux(use in adb shell) commands- (Its also possible some of these fail if you dont have elevated privileges)
    df -h, fdisk -l, & blkid - They all give a generally helpful list of disks and disk information. The information presented varies depending on which of the 3 you use.

    uname -a - Will typically show the general kernel version your running, 32 or 64bit, and the date/time it was compiled. The -a option tells it to list everything/all.

    whoami - Gives at least your account name and sometimes more than that.

    cat - Example: cat /etc/passwd. This command catalogues the information you want and shows it as a list and you can also use it to copy the cataloged information to a general or text file. Example: cat /etc/passwd >> /path/to/file.txt
    The echo command can be used in similar fashion but repeats what you type versus cataloging information from somewhere else like a file.



    Post edited by Ɲ????Ʀ???? on
  • ProlericProleric Member Posts: 1,283
    Thanks.
Sign In or Register to comment.