4

I have a corrupted Settings app in CyanogenMod and have a possible idea to restore a backup of it (App and Data) in Titanium Backup. But it's currently set to not allow "unknown sources" so Titanium cannot actually restore the old Settings over the current (corrupted) one.

I have a Terminal app installed on the phone. Is there a command in Terminal to essentially 'tick' that "unknown sources" setting, since I can't open the Settings app itself? (It gives this.)

  • 2
    I'll comment here if this helps others (I see someone has starred it): I googled further and it appeared that the relevant file to modify in the file system is data/data/com.android.providers.settings/databases/settings.db and is an SQL file, and you can edit the SQL tables by using an sql editing app like Sqlite Editor. For instructions see: forum.xda-developers.com/showthread.php?t=2784173. I'm too busy doing other things to make this into an official answer, if someone does (and preferably tests themselves to confirm), I'll gladly upvote it and mark as accepted answer! :) – user31812 Jul 22 '14 at 9:05
3

As mentioned in the comments by OP, SQLite Editor is fit for the job. Following solutions tested on Stock Android 4.2.1 and 4.4.2.

Instructions for root users:

  1. Install and launch SQLite Editor from Play Store.
  2. Under APPS, tap Settings Storagesettings.dbglobal.
  3. Tap install_non_market_apps → click pencil icon (at the top) to edit it and change the Value to 1.
  4. The changes took effect immediately in my device. Otherwise, restart and Unknown Sources would be found enabled.

    (Source)

Instructions for non-root users:

  1. Install ADB in your PC, connect your device, and enter:

    adb shell settings put global install_non_market_apps 1
    

    Unknown Sources would now be enabled. (Source)

  2. Change the last command's value to 0 to disable the Unknown Sources.
3

For newer android software use:

adb shell settings put secure install_non_market_apps 1
1

If you can somehow obtain a zip style backup of the settings app you can try to manually push it from a computer through ABD (Android Debug Bridge) from your bootloader/recovery (If it is unlocked)

More info here. http://teamw.in/ADBSideload

0

For rooted users: to enable unknown sources use Terminal Emulator with these commands:

su
settings put global install_non_market_apps 1
  • This is an exact copy of another answer of this question, except you used the global flag. Does your device not run the command using the secure flag? – Aaron Gillion Mar 30 '16 at 22:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy