Ask / Submit
2

Possible to access Linux file system?

asked 2015-10-12 15:37:51 +0300

Fiery gravatar image

updated 2015-10-12 16:08:49 +0300

r0kk3rz gravatar image

I'm considering porting my existing app -- which is already ported for the 3 major mobile app platforms -- to Sailfish. The only thing that may stand in the way, or let's say make things a bit more complicated, is the lack of access to the underlying Linux file system. Is it possible to read e.g. /proc/cpuinfo or /proc/version from a Sailfish app? If it's not, are there existing plans to make it possible? And if it is possible, are there any plans to remove that "feature" to make the whole platform more roboust against potential security threats?

When it comes to strict security and sandboxing, I of course fully understand why mobile platforms do that, and I agree that it's the best way to assure apps are confined. However, I don't understand why something like a read-only access to e.g. /proc could be so dangerous that it is not provided on other platforms -- for example the one with the hot fox ;) In my app I wouldn't want to poke around in other apps' stuff, but only the kernel's stuff.

Please let me know if it's possible. And if it is not, why not? And if it is, then giving me a short hint on what's the best way to access those files would also be very much appreciated. Do I have to start a process like awk, or is there a QT5 call to use, etc?

Thank you for your time.

edit retag flag offensive close delete

1 Answer

Sort by » oldest newest most voted
3

answered 2015-10-12 15:44:24 +0300

virgi26 gravatar image

updated 2015-10-12 15:45:57 +0300

as far as i can tell, you are allowed to execute shell scripts. And they are executed under nemo user. I;ve checked, nemo does have read permissions to /proc/cpuinfo and /proc/cpuinfo

PS you can use QProcess for that

edit flag offensive delete publish link more

Comments

Thank you for your answer :) That's encouraging, although I'd prefer to use a non-execute method if there's one. Can I use QFile to do the same, without having to hassle with executing another process?

I'm sorry about the half-noob questions, but my Jolla Phone hasn't arrived yet, but I'm excited to jump on the bandwagon, and looking for answers. By the time the device arrives, I'd like to be ready to start coding :)

Also, can anyone comment on the potential future revamping of the security system, ie. if there's a chance the access to the /proc, /sys and other kernel directories would get prohibited after a major update like Sailfish OS 3.0 or 4.0?

Fiery ( 2015-10-12 21:06:59 +0300 )edit

@Fiery: I think some security improvements/sandboxing/etc are planed but given how difficult all this is to do properly in practice I would not expect this to happen any time soon. So I would suggest not to care about this for now, other than maybe writing to Jolla and asking what their plans are in this regard, maybe with a spec of what your app needs to access so that they can take it in account once they get to the security stuff in some far future time.

MartinK ( 2015-10-12 21:26:54 +0300 )edit

@Fiery "Can I use QFile to do the same, without having to hassle with executing another process?"

I don't know about that, but why not get the SDK to code and try before your phone arrives? The "SailfishOS emulator" is, to my knowledge, just a virtual mashine running SailfishOS. :)

This is a bit off topic but as you seem to be new to this also make sure to follow the harbour rulesif you want your app in the Jolla store. If it's okay for you to use a more or less unrestricted 3rd party store register an account at openrepos.net and request a repo (this needed some time when I did it, so the earlier you do it the better).

Last I have a question for you: What is this app you want to port (link to google play store page or something like that) ? :)

V10lator ( 2015-10-13 09:32:39 +0300 )edit

Thank you both for your answers. Please keep 'em comin' :)

As for the emulator, well, quite frankly I hate all emulators. I get more headaches because of them than benefits. Truth be told, the apps I develop aren't really suited to be developed, used or validated in emulator.

As for the rules, I of course would like to develop an app that fully complies to those rules. I keep educating myself and doing my research as days go by, but I still have a lot to learn. Especially since I come from Windows, developed all my previous apps under Windows, and I've never dealt with QT or QML before.

As for the app in question... I didn't want to mention its name, because I don't want to promote it in any ways. It's a commercial product, so I'm not sure if I can talk about it here. So please feel free to cut away my post from here in case you deem it violates the rules of this platform. I'm not sure if I can mention other mobile platforms/OSes, so the next paragraph may be full of potential violations :))

So, the app in question is AIDA64. It was born 20 years ago, first as a DOS software, then (in 2000) moved to Windows, and this year we've decided to take the next big step and move it to mobile platforms. It was first ported (well, rewritten actually) to Android, then iOS and Windows Phone, and finally Tizen. Based on our experiences with Android and Tizen, the best and most suitable platform for our -- quite special kind of -- app is the ones that are based on the Linux kernel, _and_ in the same time do not prohibit access to the underlying Linux file system. In a nutshell, our app collects sysinfo, both hardware and software, and present them on an easy-to-read interface. And the Linux file system has got several very useful files that are essential to provide detailed sysinfo and measurements, especially about the hardware. That's why we moved to Tizen after finishing up the app porting to the 3 major mobile platforms: it is like an Android but using C instead of Java :)

Fiery ( 2015-10-13 09:57:35 +0300 )edit

I just installed the android version of AIDA64 onto my Jolla phone. It's a great little tool working almost perfectly (the only downside so far is that "Apps" lists android apps only, not the native SailfishOS ones). :)

Anyway, I see you charge 1,99 € to remove adds but paid apps as well as in-app purchases are forbidden at the harbour (Jolla store). See (and vote up) for example https://together.jolla.com/question/79388/in-app-purchases/ - Also I'm not sure if adds are allowed at all.

V10lator ( 2015-10-13 10:30:41 +0300 )edit
Login/Signup to Answer

Question tools

Follow
2 followers

Stats

Asked: 2015-10-12 15:37:51 +0300

Seen: 439 times

Last updated: Oct 12 '15