4

Is it possible to toggle the Unknown Source setting with Tasker? I couldn't find such a setting. I also tried the Secure Settings Plugin there is also no action for this.

What I want to achieve is to set this setting on when I start the Amazon AppStore and switch it off when I close it again.

Samsung Galaxy Note, Android 4.1.2 Jelly Bean

3 Answers 3

2

This can't be done in a totally automated fashion, as indicated by the accepted answer to this StackOverflow question. Basically, it's against the Android security model to allow Unknown Sources to be changed programmatically.

0

I think AutoShortcut can do the trick:

AutoShortcut is a plugin for Tasker or Locale that allows you to run any of your installed apps' shortcuts.

1
  • Wouldn't you need a shortcut to toggle Unknown Sources for that to work? I'm not aware of any such thing. Commented Apr 24, 2013 at 12:43
0

The device seems rooted because Secure Settings is mentioned. I have v1.3.6 installed and it does allow toggling "Unknown sources".

All you have to do in Tasker is:

  1. Create App context profile and choose Amazon Appstore or your favorite app.
  2. To enable Unknown sources when Appstore is launched:

    • Create a task with action as Plugin → Secure Settings:

      • Under Configuration, go to System+ Actions →Unknown Sources → On, and save it.
    • Alternatively, if Secure Settings still doesn't have such option then create an action as Code → Run Shell, and type:

      • Command: settings put global install_non_market_apps 1
      • Check Use Root

      Explanation:

      • settings would update settings.db database file (part of com.android.providers.settings).
      • global is the table which holds the key (install_non_market_apps) responsible for toggling Unknown Sources.
  3. To disable Unknown sources when Appstore is closed:

    More or less, once the Appstore is closed you'll come back to home screen (default Launcher). In that case:

    1. Create App context profile and choose your default launcher.
    2. Create a task with action as Plugin → Secure Settings:

      • Under Configuration, go to System+ Actions →Unknown Sources → Off, and save it.

      Or, alternatively, create an action as Code → Run Shell, and type:

      • Command: settings put global install_non_market_apps 0
      • Check Use Root

Your objective is now completed! Launch your Appstore and Unknown sources would get enabled. Come back to Launcher and Unknown sources would get disabled.

1
  • Ahh, forgot to mention that my solution is tested on Android 4.2.1 JB.
    – Firelord
    Commented Jul 1, 2015 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .