Android GetSharedPreferences and WritePrivateProfString?

DA
David Avery
Focused e.business llc

Hey guys

I occasionally need to apply shared preferences to some android apps, and it would be great to do it via script.  I have some set (see link here) and tried to update them with a script command:

writeprivateprofstring <myAppName> BaseURI http://api.myAppDomain.com:8044/Api

Essentially I am trying to keep 100 people from having to go in and adjust settings as the API endpoint URL has changed.  This does not seem to touch those settings.  Has anyone done it?

6 years ago
Android
ANSWERS
MD
Matt Dermody Diamond Contributor
6 years ago
DA
David Avery
6 years ago

Hi Matt

I am the developer but this simple enterprise app doesn't support settings in that way.  I can add them into the build as defaults and deploy a new version with a config update, but I was hoping that they were exposed somehow.  I would imagine they are protected within Android to prevent a rogue app from say writing to another's config and forcing a visit to a virus site.

MD
Matt Dermody Diamond Contributor
6 years ago
RC
Raymond Chan Diamond Contributor
6 years ago

Hi David,

What is/are the brand(s) of your devices?  Are you using Android Enterprise or Android plus device agents?

How did you get the syntax of the command

  writeprivateprofstring <myAppName> BaseURI http://api.myAppDomain.com:8044/Api

Did you grant the required app permission(s) for your MobiControl device agent?  What are the version and build numbers of your device agent?

DA
David Avery
6 years ago

Thank you Raymond!  I believe though that mobicontrol does not have access to my settings which I guess is good, as I don't want other apps able to tamper with my apps private settings.

What is/are the brand(s) of your devices?  Are you using Android Enterprise or Android plus device agents?

How did you get the syntax of the command writeprivateprofstring <myAppName> BaseURI http://api.myAppDomain.com:8044/Api

>> DMA  I have used it for other things.  I was hopeful but incorrect that it can affect my installed app.

Did you grant the required app permission(s) for your MobiControl device agent?  >> DMA  Yes

What are the version and build numbers of your device agent? 14.0 build 1579.