Retrieve Chrome OS system properties out of ARC environment

323 views
Skip to first unread message

Sergii Targonskyi

unread,
Jul 3, 2018, 11:07:43 AM7/3/18
to Chromium OS Development
Hi folks!
Is there a way to retrieve Chrome OS system properties (/etc/lsb-release etc.) from the Android application, which runs under ARC sandbox? 
For instance, there is a way Chromium does it. I assume it uses this data when it is prompted to display chrome://system. But my application runs in the absolutely separate environment. Generally, I use Android SDK and NDK to leverage any feature I would like to. Is there any API available for Android app on Chrome OS?

Disclaimer: I consciously mingle both Chrome and Chromium, since I suggest it works the same in this part.

Tanks!

Daniel Erat

unread,
Jul 3, 2018, 1:54:28 PM7/3/18
to targon...@gmail.com, Chromium OS dev
What's the overall goal? Are you trying to get all available information (e.g. for debugging), or is there a specific part of it that you want to use to control your app's behavior?

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev

Keith I Myers

unread,
Jul 3, 2018, 2:15:59 PM7/3/18
to targon...@gmail.com, Chromium OS dev
You could in theory use the build.prop file to get some information from within an Android Application from ChromeOS. There are a few "chromeos" specific items reported in the build.prop. You DO NOT need root access to see these. Some useful values are

[dalvik.vm.isa.x86_64.variant]: [sandybridge]
[ro.boot.chromeos_channel]: [dev]
[ro.bootimage.build.fingerprint]: [google/eve/eve_cheets:7.1.1/R69-10820.0.0/4861648:user/release-keys]
[ro.build.description]: [eve 7.1.1 R69-10820.0.0 4861648 release-keys]
[ro.build.display.id]: [R69-10820.0.0 release-keys]
[ro.build.fingerprint]: [google/eve/eve_cheets:7.1.1/R69-10820.0.0/4861648:user/release-keys]
[ro.build.flavor]: [cheets_x86_64-user]
[ro.build.product]: [cheets_x86_64]
[ro.preferred_languages]: [en-US,en]
[ro.product.board]: [eve]
[ro.product.brand]: [google]
[ro.product.cpu.abi]: [x86_64]
[ro.product.cpu.abilist]: [x86_64,x86,armeabi-v7a,armeabi]
[ro.product.cpu.abilist32]: [x86,armeabi-v7a,armeabi]
[ro.product.cpu.abilist64]: [x86_64]
[ro.product.device]: [eve_cheets]
[ro.product.first_api_level]: [25]
[ro.product.locale]: [en-US]
[ro.product.manufacturer]: [google]
[ro.product.model]: [Google Pixelbook]
[ro.product.name]: [eve]




You can also download an Android terminal emulator and run "getprop" to see a full list 



--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev
---
You received this message because you are subscribed to the Google Groups "Chromium OS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.


--
 
--
Keith I Myers
 


Sergii Targonskyi

unread,
Jul 4, 2018, 4:38:21 AM7/4/18
to Chromium OS Development

Dan, the overall goal is to retrieve system information about an endpoint for debugging purposes and general statistics. Keith, thank you for the piece of advice.

But nevertheless, do you have any ideas of a kind of API to get out of the Android sandbox?

Mike Frysinger

unread,
Jul 4, 2018, 6:37:47 AM7/4/18
to Sergii Targonskyi, chromium-os-dev
you cannot access random files in the rootfs by design
-mike

On Wed, Jul 4, 2018, 05:38 Sergii Targonskyi <targon...@gmail.com> wrote:

Dan, the overall goal is to retrieve system information about an endpoint for debugging purposes and general statistics. Keith, thank you for the piece of advice.

But nevertheless, do you have any ideas of a kind of API to get out of the Android sandbox?

--

Keith I Myers

unread,
Jul 4, 2018, 10:13:25 AM7/4/18
to Сергій Таргонський, Chromium OS dev
Getting out of the Android sandbox would imply that the sandbox is broken from a security prospective. I have done a fair bit of poking around both ARC+ and Crostini and can attest that they are both insanely secure and both limit access to the host machine. 

For ARC+ (Android) the only way I was able to get it to report back the device info was via the build.prop values - and of course the values are quite limited but enough for most.

For Crostini, it is a bit different as there are very few ways an application can tell that it is running on a Chromebook. Most programs will see a very stock Debian 9.4 install that could be on a desktop or in a virtual machine. This of course means that most things should "just work" but developers who want to gather some statistics to see how their application runs on a Chromebook may have issues. The only ways I have been able to find are
  • Check for /opt/google/cros-containers and /opt/google/garcon - These would only be there if running in a container on Chrome OS
  • See if any of the following packages are installed - 
    cros-adapta               cros-guest-tools          cros-sommelier-config     cros-ui-config
    cros-apt-config           cros-sftp                 cros-sudo-config          cros-unattended-upgrades
    cros-garcon               cros-sommelier            cros-systemd-overrides    cros-wayland


On Wed, Jul 4, 2018 at 4:38 AM Sergii Targonskyi <targon...@gmail.com> wrote:

Dan, the overall goal is to retrieve system information about an endpoint for debugging purposes and general statistics. Keith, thank you for the piece of advice.

But nevertheless, do you have any ideas of a kind of API to get out of the Android sandbox?

--
--
Chromium OS Developers mailing list: chromiu...@chromium.org
View archives, change email options, or unsubscribe:
https://groups.google.com/a/chromium.org/group/chromium-os-dev
---
You received this message because you are subscribed to the Google Groups "Chromium OS Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-os-d...@chromium.org.

Ihor Dvoretskyi

unread,
Jul 4, 2018, 11:13:38 AM7/4/18
to Keith I Myers, targon...@gmail.com, chromiu...@chromium.org
> Getting out of the Android sandbox would imply that the sandbox is broken from a security prospective.

+1

Sergii Targonskyi

unread,
Jul 5, 2018, 5:41:22 AM7/5/18
to Chromium OS Development
Good discussion! Thanks everybody.

Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages