Kodi Community Forum
Changing where special://masterprofile/ redirects to? - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Android (https://forum.kodi.tv/forumdisplay.php?fid=164)
+---- Thread: Changing where special://masterprofile/ redirects to? (/showthread.php?tid=157721)

Pages: 1 2


Changing where special://masterprofile/ redirects to? - makkonen - 2013-02-27

I just updated to a new ROM on my phone. XBMC had been functioning flawlessly before that, but since the update, it crashes on startup.

http://pastebin.com/sfyGNDM3

The source of the problem is obvious. instead of redirecting to /mnt/sdcard/Android/data/.xbmc/files/userdata, special://masterprofile (and a number of other special protocol links) redirect to //.xbmc/files/userdata. Since the XBMC app has no permission to write to the root directory (nor should it), it fails rather abruptly.

I have grepped through every file in the apk, and do not see any way to manually tweak where special://masterprofile/ points. Nor do I see evidence of where in the Android system it is trying to pull a sensible path from.

On my galaxy note II, the internal storage shows up at /sdcard, /mnt/sdcard, and /storage/sdcard0. The sdcard shows up as /mnt/extSdCard and /storage/extSdCard (and possibly others). These are pretty standard, but clearly something is missing. (a shell variable? I don't know.)

Can I manually set this path? Or does someone know how XBMC derives its path, so I can convince the system to pass it what it needs?


RE: Changing where special://masterprofile/ redirects to? - kemonine96 - 2013-02-27

Line 906 in https://github.com/xbmc/xbmc/blob/master/xbmc/android/activity/XBMCApp.cpp looks to be where the trouble lies. It is pulling the external storage location from the Android Environment class.

I was just working with someone about this problem on custom ROMs and have posted a build with extra debugging. Can you try running the build and posting a logcat / xbmc log? It should shed some light on what may be going on.

Build: https://nuskunetworks.box.com/s/2z3900opqvtopzykjgfs

As an aside: which ROM are you running?


RE: Changing where special://masterprofile/ redirects to? - makkonen - 2013-02-28

Just switched from stock to Synergy ROM on my Sprint Galaxy Note 2.

I will install your build and send the log as soon as I am able. Thanks!


RE: Changing where special://masterprofile/ redirects to? - makkonen - 2013-02-28

...which turned out to be pretty soon. Unfortunately, the log looks pretty much identical. Is there a method to turn on more debugging output that is called early enough in the process to be of use here?

http://pastebin.com/XDMRXCrw

Next step is to figure out if I can hack how this ROM populates the Android Environment class, I guess. That doesn't sound very simple. Thanks again.


RE: Changing where special://masterprofile/ redirects to? - cyberguerilla - 2013-02-28

I've been seeing quite a number of reports (see this http://forum.xbmc.org/showthread.php?tid=150676), and I've been experiencing this too.

I guess I'll post the logcat or XBMC output in time with the debug build, as rooting is not an option for me.

(Besides special://masterprofile special://home is also pointing to .xbmc at root, I don't know how many other things are missing with an attempted install like this.)


RE: Changing where special://masterprofile/ redirects to? - kemonine96 - 2013-03-02

(2013-02-28, 01:08)makkonen Wrote: ...which turned out to be pretty soon. Unfortunately, the log looks pretty much identical. Is there a method to turn on more debugging output that is called early enough in the process to be of use here?

http://pastebin.com/XDMRXCrw

Next step is to figure out if I can hack how this ROM populates the Android Environment class, I guess. That doesn't sound very simple. Thanks again.

Interesting, the build I posted should have had some lines prefixed by KmN. Time to go poking around for more spots to add information to. Will post back after I do some digging.


RE: Changing where special://masterprofile/ redirects to? - cyberguerilla - 2013-03-04

Here's what I got when I ran your posted build. log

http://pastebin.com/kV41f7K0

P.S. If only we have a build that allows users to manually define a path. or part of the path, where special://masterprofile and special://home is mapped to, if would be made MUCH easier


RE: Changing where special://masterprofile/ redirects to? - kemonine96 - 2013-03-04

Thanks for the log. Unfortunately my switch and router flaked out this weekend and I am still in the process of repairing them. Hopefully I'll be back up this week and I can put together an updated build with more logging.


RE: Changing where special://masterprofile/ redirects to? - cyberguerilla - 2013-03-07

(2013-03-04, 16:04)kemonine96 Wrote: Thanks for the log. Unfortunately my switch and router flaked out this weekend and I am still in the process of repairing them. Hopefully I'll be back up this week and I can put together an updated build with more logging.

Seems to me that the following file have a lot to do about where special://home and special://masterprofile is mapped to.

https://github.com/xbmc/xbmc/blob/master/xbmc/filesystem/SpecialProtocol.cpp

Is there anything you can tell from this file where we get the special://masterprofile and special://home folders from? Or (I know I'm begging for it) some tweaks that can be done that alters the code...like hardcoding sections here when referencing paths for special://home and special://masterprofile .... I'm almost begging for it!


RE: Changing where special://masterprofile/ redirects to? - cyberguerilla - 2013-03-10

bump


RE: Changing where special://masterprofile/ redirects to? - kemonine96 - 2013-03-11

(2013-03-10, 23:31)cyberguerilla Wrote: bump

Real life has tripped me up some. I'll take a closer look at the code you posted soon. Feel free to PM me if I don't have something posted by the end of the week.


RE: Changing where special://masterprofile/ redirects to? - snotboble - 2013-03-11

I have observed the very same thing on my device (AGPTek TP15H, Android 4.0 upgraded to JB).
It maps the flash to /mnt/local and XBMC does not seem to be able to figure that one out. I tried a hack of synlinking the /.xbmc to a more appropriate path (had to remount rootfs rw, then ro again) but this is not persistent across device reboot, so I'm latching onto this thread.


RE: Changing where special://masterprofile/ redirects to? - cyberguerilla - 2013-03-17

Thanks, eagerly awaiting anything you find.


RE: Changing where special://masterprofile/ redirects to? - kemonine96 - 2013-03-19

(2013-03-17, 14:22)cyberguerilla Wrote: Thanks, eagerly awaiting anything you find.

So far I've found nothing. I was poking at this yesterday some and I can't seem to find the spot where it loses the SD Card location.


Anyone willing to post the output of "env" from a command line (on device) on a working and non-working ROM? That might help me find the right spot to go digging.


RE: Changing where special://masterprofile/ redirects to? - snotboble - 2013-03-19

Sure, here goes:

Works:
-------------------------------------
127|u0_a165@android:/ $ set
ANDROID_ASSETS=/system/app
ANDROID_BOOTLOGO=1
ANDROID_DATA=/data
ANDROID_PROPERTY_WORKSPACE=12,65536
ANDROID_ROOT=/system
ANDROID_SOCKET_zygote=13
ASEC_MOUNTPOINT=/mnt/asec
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework_ext.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar
COLUMNS=80
EXTERNAL_STORAGE=/storage/sdcard0
EXTERNAL_STORAGE_USB=/storage/usbdisk
HOME=/data
HOSTNAME=android
IFS='
'
KSHEGID=10165
KSHGID=10165
KSHUID=10165
KSH_VERSION='@(#)MIRBSD KSH R40 2011/10/07'
LD_LIBRARY_PATH=/vendor/lib:/system/lib
LINES=24
LOOP_MOUNTPOINT=/mnt/obb
MKSH=/system/bin/sh
OPTIND=1
PATH=/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
PGRP=28141
PIPESTATUS[0]=127
PPID=27276
PS1='$(precmd)$USER@$HOSTNAME:${PWD:-?} $ '
PS2='> '
PS3='#? '
PS4='+ '
PWD=/
RANDOM=14375
SECONDARY_STORAGE=/storage/sdcard1
SECONDS=4
SHELL=/system/bin/sh
TERM=vt100
TMOUT=0
USER=u0_a165
USER_ID=10165
_=set
----------------------------------------------------
Does NOT work:
----------------------------------------------------
uid=10088 gid=10088 groups=1015,1028,3003@android:/ $ set
ANDROID_ASSETS=/system/app
ANDROID_BOOTLOGO=1
ANDROID_DATA=/data
ANDROID_PROPERTY_WORKSPACE=8,32768
ANDROID_ROOT=/system
ANDROID_SOCKET_zygote=9
ASEC_MOUNTPOINT=/mnt/asec
BOOTCLASSPATH=/system/framework/core.jar:/system/framework/core-junit.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/framework2.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/apache-xml.jar:/system/framework/wmt.applib.jar
COLUMNS=80
EXTERNAL_STORAGE=/mnt/sdcard
HOME=/
HOSTNAME=android
IFS='
'
KSHEGID=10088
KSHGID=10088
KSHUID=10088
KSH_VERSION='@(#)MIRBSD KSH R40 2011/10/07'
LD_LIBRARY_PATH=/vendor/lib:/system/lib
LINES=24
LOOP_MOUNTPOINT=/mnt/obb
MKSH=/system/bin/sh
OPTIND=1
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/vendor/bin:/system/bin:/system/sbin:/system/xbin
PGRP=2693
PIPESTATUS[0]=0
PPID=2307
PS1='$(precmd)$USER@$HOSTNAME:${PWD:-?} $ '
PS2='> '
PS3='#? '
PS4='+ '
PWD=/
RANDOM=9284
SECONDARY_STORAGE=/mnt/local:/mnt/udisk
SECONDS=9
SHELL=/system/bin/sh
TERM=vt100
TMOUT=0
USER='uid=10088 gid=10088 groups=1015,1028,3003'
USER_ID=10088
_=set