Patch: StartAsRoot for File-browser

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

Similar to StartAsRoot for File-browser, but created as patch. It add indicators "NEMO" and "ROOT" to the cover (see screenshot) and you also can open more than one windows as nemo.
REMEMBER: Editing files in root directories can KILL your phone/tablet!

NOTE:
Don't forget to unapply patch before you update/reinstall File browser app!

Known (possible) issues:
For me it happened only on v2.1.1.12. If app starts as nemo instead as root, try this workaround. For some mysterious reasons the phone sometimes remove "dconf" folder, and you need to recreate it. Do it as root = or as "su" or as "devel-su", try both variations.
mkdir -p /run/user/0/dconf
It should stay here, but sometimes when you close fingerterm, the folder deleted again.

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

v0.1-3
- For updated File Browser (v1.7.1).

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

v0.1-1
- Initial release.

Beware, use it on your own risk !!!

Donation are welcome :)

Screenshots: 
Changelog: 

- Changes in SPEC file. Obsoletes changed to Conflicts.

Comments

rdomschk's picture

Could you make a version for 64bit systems and SFOS 4.3.0.12  please?

pichlo's picture

Would it be possible to stop this patch overriding the standalone StartAsRoot for File-browser application?

It is getting really frustrating that every single time I update any package in Storeman, I automatically lose the StartAsRoot icon from launcher and gain the patch instead.

I do not want the patch. I have never installed it myself and do not want to but it still happens every single time.

Schturman's picture

Look... I really don't know why it happens. See the SPEC files from both of them:
sailfishos-filebrowserroot-patch:
Requires: harbour-file-browser, patchmanager
Obsoletes: filebrowserroot

filebrowserroot:
Requires: harbour-file-browser

I don't see a reason for the problem that you described... I really don't know what cause this. Maybe problem in Storeman ? Don't know...
I only can add to the "filebrowserroot" this line: Obsoletes: sailfishos-filebrowserroot-patch or Conflicts: sailfishos-filebrowserroot-patch. Maybe it will help.

pichlo's picture
  • sailfishos-filebrowserroot-patch:
  • Requires: harbour-file-browser, patchmanager
  • Obsoletes: filebrowserroot

Isn't that exactly the problem? The package I always end up losing is called, you've guessed it, filebrowserroot.

I agree it should not happen unless you explicitly install the patch and it is possible that Storeman is being too proactive and trying to do things "for your own good" without you asking it to. It did not use to be the case, it started happening only about a year ago. So maybe I should ask the Storeman developer too.

But, is there any good reason for that obsoletion? Can the same effect not be achieved by some other means? Maybe use "Conflicts:" instead of "Obsoletes:"?

Schturman's picture

Please, install new version and try to reproduce your problem. Report here.

Schturman's picture

The reason because the changes in the files... But like I said I will try to change "Obsoletes:" to "Conflicts:" in the both packages...
I Just don't have so much time and still didn't update to the latest version of SeilfishOS. Also Jolla is not my primary device anymore for the last 1 year.
I will try to update in the next few days...

objectifnul's picture

'ROOT mode' warning no longer appears in the cover after recent Filebrowser upgrade.

Schturman's picture

Did you unapplied patch before update of file browser?

objectifnul's picture

No. Should I? If so, is it too late now?

Schturman's picture

Yes, you should unapply and reapply after update. Because update override the patched files, exactly like we do before system update.

objectifnul's picture

Unfortunately, I can't unapply it ("Failed to remove patch")

Schturman's picture

Ok, try this...
Run this 3 commands as ROOT:
/bin/rm -f /usr/share/harbour-file-browser/qml/cover/FileBrowserCover.qml.webosinternals.orig
/bin/rm -f /usr/share/applications/harbour-file-browser.desktop.webosinternals.orig
/bin/rm -f /usr/share/applications/harbour-file-browser-root-patch.desktop.webosinternals.orig

Now try unapply and apply patch...
Report here...

P.S. Added new version, compatible with last update of FileBrowser.

objectifnul's picture

Thx. Unfortunately, still "Failed to remove patch" (same error when trying to unapply or trying to uninstall the patch, also when trying to upgrade the patch to 0.1-3).

EDIT: also same error when trying to uninstall Filebrowser.

Schturman's picture

3 commands above and this one:
/bin/rm -f /usr/share/applications/harbour-filetug-root-patch.desktop

Now try unapply... It should work... After this install new version and apply.

Also show me output from terminal for all this 4 commands.

objectifnul's picture

(Continued by direct contact message)

EDIT - problem solved, thx

Schturman's picture

When I get home, I will write you what to do...

Alex's picture

So which command is needd to remove this patch?

Schturman's picture

Hi.
This is a steps if you also updated filebrowser app without unapplying patch (as ROOT):

  1. rpm -e --noscripts sailfishos-filebrowserroot-patch
  2. /bin/rm -f /usr/share/harbour-file-browser/qml/cover/FileBrowserCover.qml.webosinternals.orig
    /bin/rm -f /usr/share/applications/harbour-file-browser.desktop.webosinternals.orig
    /bin/rm -f /usr/share/applications/harbour-file-browser-root-patch.desktop.webosinternals.orig
    /bin/rm -f /usr/share/applications/harbour-filetug-root-patch.desktop
    /bin/rm -f /usr/share/icons/hicolor/86x86/apps/harbour-file-browser-root-patch.png
    /bin/rm -rf /usr/share/openrepos-filebrowserroot-patch
    /bin/rm -rf /usr/share/patchmanager/patches/sailfishos-filebrowserroot-patch

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

  3. Install File Browser from store
  4. Install new version of patch from Openrepos
  5. Apply it.

    DON’T forget anymore to unapply patches when you update patched app or system !!!
    Emil

birdzhang's picture

Is this open source?

I want to know how to make an app "StartAsRoot"?

Thank you.

Schturman's picture

Yes, just see this file: /usr/share/openrepos-filebrowserroot-patch/start-filebrowserroot-helper.c.
To create binary, run this command:
gcc /path/to/helper.c -o /path/to/your_binary
chmod 4755 /path/to/your_binary