Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › Set system time on Android

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #23886

    Jon-Paul

    Hi. Is it possible to set system time on Android using Qt / Felgo?

    The Android comand is “date -s “yyyymmdd.hhmmss” which can be called with QProcess but the permissions won’t be there. IThe Android docs state that the SET_TIME privilege is not for use by third party applications (which explains why requesting that always fails).

    I’ve seen solutions where pkexec is used to elevate permissions but that would require us to install a new app and that might not be possible (although certainly looks like the best possible solution at the moment).

    Does anyone have any suggestions on the best way to do this if it is possible?

    #23890

    Filippo

    Hi, thanks for reaching out. I don’t think there’s a way around the permission Android is enforcing. You either need a system signature or a rooted device.

     

    The “easiest” solution, as you wrote, is to call your command with “su” with QProcess on a rooted device.

    #23892

    Jon-Paul

    Thanks.

    Rooting the device won’t be possible. How can we go about getting a system signature? My Android experience is very limited I’m afraid.

    I assume running the QProcess with ‘su’ needs the device to be rooted otherwise it won’t work?

    #23893

    Filippo

    You’re welcome. Yes, calling “su” without root permissions will not work. The system signature is only available to manifacturers so that their applications can have superpowers not allowed to standard applications.

     

    I’m sorry I couldn’t be of more help, but Android kinda ties our hands on this.

    #23897

    Jon-Paul

    Thanks. That’s annoying but kind of makes sense.

    This isn’t for an app store, by the way, but for a manufactured device. We would be able to go down the system signature route whatever that entails. I assume we’d need to get in touch with Google and pass some sort of verification process? Do you have any details on that process? Of course, I’m looking into it right now but advice is always useful.

    #23903

    Filippo

    I’m not really knowledgeable on the process but I think the key is handled by the manufacturer and not google themselves.

     

    Sadly, I’ve only worked on it once a few years back, but we had direct contact with the manufacturer, so it was pretty straightforward.

     

    I’m sorry I couldn’t be more helpful, but I hope this gets you on the right track.

Viewing 6 posts - 1 through 6 (of 6 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded