StartAsRoot for FileCase

Rating: 
5
Your rating: None Average: 5 (3 votes)

It will create icon to start FileCase app as root. FileCase app should be installed on your device...

v0.1-4
- Changes in SPEC file. Obsoletes changed to Conflicts.

v0.1-3
- Should fix problem with root access.

v0.1-2
- Tablet version.

Beware, use it on your own risk !!!

Donation are welcome :)

Screenshots: 
Application versions: 
AttachmentSizeDate
File filecaseroot-0.1-2.armv7hl.rpm10.56 KB13/10/2015 - 00:24
File filecaseroot-0.1-2.i486.rpm10.54 KB07/02/2019 - 04:41
File filecaseroot-0.1-3.i486.rpm10.86 KB26/07/2017 - 03:08
File filecaseroot-0.1-3.armv7hl.rpm10.84 KB26/07/2017 - 03:08
File filecaseroot-0.1-4.i486.rpm15.43 KB06/02/2019 - 11:23
File filecaseroot-0.1-4.armv7hl.rpm15.16 KB06/02/2019 - 11:23
Changelog: 

- Changes in SPEC file. Obsoletes changed to Conflicts.

Comments

Marold's picture

@Shturman How to manually remove Your Patch ? I did rm'ed i usr/share/openrepos-filecaseroot-patch and files in patchamnager/patches but still it shows some errors. I have problems updating sfos 'coz of this :( Any help would be greatly appreciated. Thanks !

Schturman's picture

If conventional way don't work:
/usr/sbin/patchmanager -u sailfishos-filecaseroot-patch
pkcon remove sailfishos-filecaseroot-patch

Try manual way (as ROOT):
rpm -e --noscripts sailfishos-filecaseroot-patch
/bin/rm -f /usr/share/filecase/qml/pages/CoverPage.qml.webosinternals.orig
/bin/rm -f /usr/share/applications/filecase.desktop.webosinternals.orig
/bin/rm -f /usr/share/applications/harbour-filecase-root-patch.desktop.webosinternals.orig
/bin/rm -f /usr/share/applications/harbour-filecase-root-patch.desktop
/bin/rm -f /usr/share/icons/hicolor/86x86/apps/harbour-filecase-root-patch.png
/bin/rm -f /usr/share/filecase/qml/pages/CoverPage2.qml
/bin/rm -f /usr/share/filecase/qml/filecase2.qml
/bin/rm -f /usr/share/filecase/qml/pages/FileInfo.qml.webosinternals.orig
/bin/rm -f /usr/share/filecase/qml/filecase.qml.webosinternals.orig
/bin/rm -f /usr/share/filecase/qml/pages/TransfersDelegate.qml.webosinternals.orig
/bin/rm -rf /usr/share/openrepos-filecaseroot-patch
/bin/rm -rf /usr/share/patchmanager/patches/sailfishos-filecaseroot-patch

in this steps you will completely remove my package from your phone.

Marold's picture

Thank You very much I will try those, hope it will do the work as intendent :)

levone1's picture

Update didn't change it - i still get patch version automatically installed on refresh...

Schturman's picture

Ok... I don't know why it happens, but I'm sure my patch can't do automaic installation in any way. Aspecially after last update and if you have standalone version installed (StartAsRoot for FileCase).
Or you do something wrong or Storeman app somehow causing to this installation.

levone1's picture

Schturman- just wondering if you've been aware of this - https://talk.maemo.org/showpost.php?p=1553505&postcount=2657 Anything you can do about it? I prefer the non-patch version... Thanks

levone1's picture

I see. Thanks...

levone1's picture

My favorite of SFOS file managers, (somehow thw others are difficult to look at). .. One request - after entering a directory, and then backing out of it, could you make it so it doesn't automatically scroll to the top, but remains in the position you were at? Thanks for your work. 

Schturman's picture

No, I didn't change nothing in the original package, I just given a possibility to run it as root.

Schturman's picture

You need ask it the developer of FileCase, I just provided possibility to open app as root...

levone1's picture

oops - didn't even bother looking ... thanks

Markkyboy's picture

Good luck with that, Cepi Perez hasn't been seen for quite sometime now and as far as I know, doesn;t even have a SFOS device either.

Sailbook's picture

No i dont run patches, is there a source on github so i can fix it?

I have try to run it as root from the terminal i get this:

[nemo@Sailfish ~]$ devel-su filecase
Password:
error: XDG_RUNTIME_DIR not set in the environment.
[C] unknown:0 - Failed to create display (No such file or directory)
Segmentation fault

When i do this it works, mebay you have something on this information...

[root@Sailfish nemo]# export XDG_RUNTIME_DIR=/run/user/100000
[root@Sailfish nemo]# devel-su filecase

 

Schturman's picture

can you show me output of this:

stat -c "%a %U %G" /run/user/100000/dconf

Sailbook's picture

[root@Sailfish nemo]# stat -c "%a %U %G" /run/user/100000/dconf
700 nemo privileged

 

Schturman's picture

Hmmm, I have it
stat -c "%a %U %G" /run/user/100000/dconf
700 nemo nemo
And 
stat -c "%a %U %G" /run/user/100000/dconf/user
600 nemo privileged
try to change permission to the same parameters and:

1. run FileCase normal from desktop (as user)
2. run my RootFileCase from desktop

P.S. when you extract from .rpm, you will get the all files that I have (except .spec).

Sailbook's picture

Hi,

It's not that RootFileCase dont run, the only thing is you dont have is root access when you like to change for example a .desktop file.

I have now dont

[root@Sailfish nemo]# stat -c "%a %U %G" /run/user/100000/dconf
700 nemo privileged

After that i run again the RootFileCase, and now i can change the file and have root access.

But after i close RootFileCase and start it again, then i need to do the above command again or no root access...

Is there a way you can fix this for the X or do i need to do it myself, into your app ?

Thanks!

Schturman's picture

I don't know what to change... it should be or "700 nemo privileged" or "700 nemo nemo" automatically for dconf folder...
If you want I can add checking of this to .spec file and recreate rpm.

P.S.  If I understand right you mean when you close RootFileCase the dconf folder disappear from /run/user/100000 ?

Sailbook's picture

When i set 600 nemo privileged to the dconf/user folder then it works perfect.

If I understand right you mean when you close RootFileCase the dconf folder disappear from /run/user/100000 ? No i check it the folder is still there, i mean with this i need to change again the 600 nemo privileged to run it again as root

Yes you can make a test rpm, if you like you can send it to me via email ? just let me know

 

Schturman's picture

Ok, if it always changed back to 700,, it should be interactive fix... try to do this:
1. Create script named checker.sh inside /usr/share/openrepos-filecaseroot with this content:
----------------

#!/bin/bash

if [[ $(stat -c "%a" /run/user/100000/dconf/user) != 600 ]]; then
chmod 600 /run/user/100000/dconf/user
fi
----------------------

2. Give permission:
chmod 4755 /usr/share/openrepos-filecaseroot/checker.sh
 

3. Edit /usr/share/applications/harbour-filecase-root.desktop
Instead this:
Exec=/usr/share/openrepos-filecaseroot/start-filecaseroot
write this:
Exec=sh -c "/usr/share/openrepos-filecaseroot/checker.sh && /usr/share/openrepos-filecaseroot/start-filecaseroot"

4. Open FileCaseRoot, try to edit any file in root dir and close FileCaseRoot 
5. Try it again
6. Report...

Sailbook's picture

Ok thanks, now it works only ones, when i open FileCaseRoot then it works, but when i close it again and reopen it i dont have any root access anymore (:

I just found out after 3 times open FileCaseRoot again then i have root access again, but i need to reopen it more then one time...

Schturman's picture

I think it have some timeout for changing... Try Open -> use -> close -> wait 2-3 seconds -> Open again -> use. Tell me if work...
The second test that you can do is without checking, just always changing to 600:
1. Restore .desktop file like was before:
Exec=/usr/share/openrepos-filecaseroot/start-filecaseroot

2. Edit /usr/share/openrepos-filecaseroot/start-filecaseroot-helper.c
instead this:
system( "su -c 'mkdir -p /run/user/0/dconf' && su -c 'invoker --type=silica-qt5 -n /usr/bin/filecase'" );
Write this:
system( "su -c 'mkdir -p /run/user/0/dconf' && su -c 'chmod 600 /run/user/100000/dconf/user' && su -c 'invoker --type=silica-qt5 -n /usr/bin/filecase'" );
Save file and run as ROOT:
gcc /usr/share/openrepos-filecaseroot/start-filecaseroot-helper.c -o /usr/share/openrepos-filecaseroot/start-filecaseroot
It will override existed start-filecaseroot file.
and 
chmod 4755 /usr/share/openrepos-filecaseroot/start-filecaseroot

Try again test of Open -> use -> close -> open again -> use again...

Sailbook's picture

Ok i have try it and wait then it works!

I have also try the changes you write here but it dont work as good as with the checker.sh then it works the best, when i do the changes it works one time then not anymore even after wait for 2-3 seconds.

I think it would be great to make a rpm also for the X with this checker.sh in it as i use now, what you think ? Then more people have the solution to run it on there X ;)

PS: The same problem is with the StartAsRoot for File-browser that also dont work on the X, it hink it's the same problem...

Schturman's picture

Ok.. you say it work with checker.sh and break 2-3 sec before opening it again ? I also can add "sleep 2" at the begining of script instead to wait....
Do you know more people that have the same problem with Sailfish X or maybe it localy on your device ?
Do you know how to check what this device C, 1, Tablet, Aqua or Sony ? If no, show me this command output (don't know another way):
grep 'product.device' /opt/alien/system/build.prop|head -1|cut -d '=' -f2
and
grep ID /etc/hw-release|head -1|cut -d= -f2|sed 's/[[:punct:]]//g'
and
grep NAME /etc/hw-release|head -1|cut -d= -f2|sed 's/[[:punct:]]//g'

P.S. Can you do one test please...
Objectifnul wrote on FileBrowser root that he got it working (also all other) by setting pass for root user (by installing sudo).
I'm ask you not install sudo, but just go to terminal -> devel-su + your pass -> passwd root + follow what it ask. Now reinstall my package to get it like was before modifications and try again Open -> try edit -> close -> and the same again.
Thanks.

Sailbook's picture

Ok.. you say it work with checker.sh and break 2-3 sec before opening it again ? I also can add "sleep 2" at the begining of script instead to wait....

Yes indeed hen i wat 2-3 sec it works perfect.
Thanks i will add this.

Do you know more people that have the same problem with Sailfish X or maybe it localy on your device ?

Sorry i dont know.

Outputs:

[nemo@Sailfish ~]$ grep 'product.device' /opt/alien/system/build.prop|head -1|cut -d '=' -f2
f5121

[nemo@Sailfish ~]$ grep ID /etc/hw-release|head -1|cut -d= -f2|sed 's/[[:punct:]]//g'
f5121

[nemo@Sailfish ~]$ grep NAME /etc/hw-release|head -1|cut -d= -f2|sed 's/[[:punct:]]//g'
Sony Xperia X

P.S. Can you do one test please...
Objectifnul wrote on FileBrowser root that he got it working (also all other) by setting pass for root user (by installing sudo).
I'm ask you not install sudo, but just go to terminal -> devel-su + your pass -> passwd root + follow what it ask. Now reinstall my package to get it like was before modifications and try again Open -> try edit -> close -> and the same again.

Ok i have done this, it works also but need to wait for 2-3 sec. before open it again when i close it.

Schturman's picture

Cool, thanks... Did you tried another file managers like FileTugRoot ? It also need to wait 2-3 seconds (after setup of root pass) ?

Sailbook's picture

No sorry i dont have try that.

Sailbook's picture

I have add now a sleep 3 on the script now it works perfect no wait anymore on open en close. thanks for the helpt!

objectifnul's picture

Not 100% sure yet, but apparently Filebrowser 'StartAsRoot' has root privileges only when terminal is open with devel-su. Anyway the behaviour of Filebrowser 'StartAsRoot' appears to be variable: sometimes with, sometimes without root privileges. I don't have the skills to investigate further. (Note: this is with Xperia/SailfishX. No issue with Jolla One)

Pages