help me to check this script to use with android device

R
rathasatekun
Gosoft (Thailand) Co.,Ltd.

i found that sentintent may be can set datetime into device but below code now work, i not sure what wrong ,


sendintent -b "intent:#Intent;action=android.intent.action.TIME_SET;l.time=$(1739868510648+%s);component=com.android.settings/.receiver.TimeSetReceiver;end;"

9 months ago
Android Scripting
ANSWERS
RC
Raymond Chan Diamond Contributor
9 months ago

Based on my actual tests on many recent Android devices,  I don't think this intent will work in many cases due to tightening of various app permission model adopted in recent Android firmware versions.

Actually, it makes much more sense to apply advanced-configuration policy to sync device time regularly with MobiControl server or trusted NTP/SNTP server and feature-control profile policy to disallow device end-user to modify device time via Settings or other apps on the device.

R
rathasatekun
9 months ago

I try another with configuration device , time sync configuration , but dont work

RC
Raymond Chan Diamond Contributor
9 months ago

What are the brand/model of the device(s) used in your test?  Did you just try one?

Have you tried adding trusted NTP/SNTP server(s) located in Thailand in your time-synchronization advanced policy?  The resync interval can be set to 5 minutes or lower to enhance security.   This approach almost works always for most of the device brands/models of my customers in the last 10+ years.

R
rathasatekun
9 months ago

Brand Samsung SM-T636B

RC
Raymond Chan Diamond Contributor
9 months ago

What an amazingly short answer!

RC
Raymond Chan Diamond Contributor
9 months ago

The NTP/SNTP time-synchronization policy worked fine on every Samsung model with KNOX runtime libraries I dealt with in the last ten years.  

N
NSMOD@soti.net
7 months ago

Hi Rathasatekun, 

I hope the suggestions provided by Raymond have helped you answer your query. Please inform us if you require further assistance. 

Additionally, if any response has helped address your inquiry, we kindly request you to mark it as "is solution" so that others may also benefit from this information.

Thank you Raymond for your valuable suggestions.

Thank you for choosing SOTI.

 

Regards,

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net