Patch: StartAsRoot for File-browser

Rating: 
4
Your rating: None Average: 4 (1 vote)

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-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: 
Application versions: 
Changelog: 

- For updated File Browser (v1.7.1).

Comments

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