How to modify application settings in a custom Android ROM?

Epono picture Epono · Jun 30, 2014 · Viewed 10.1k times · Source

here's my problem :

I've already done some research with Google, Stack Overflow and XDA Developers forums but I didn't even find a related question.

I'm trying to customize this CyanogenMod ROM so the "Unknown sources" checkbox (in Settings > Applications) is checked by default after the installation of the ROM using ClockWorkMod, but I can't seem to find where to do it.

I searched into the following APK files using apktool :

  • /system/framework/framework-res.apk
  • /system/app/Settings.apk
  • /system/app/SettingsProvider.apk
  • /system/app/ApplicationsProvider.apk
  • /system/app/PackageInstaller.apk
  • /system/app/CertInstaller.apk

but I didn't find anything.

Any ideas ?

Answer

Epono picture Epono · Jul 1, 2014

Ok, turns out I didn't search hard enough.

For those who are interested, the file to edit is located into SettingsProvider.apk.
You have to decompile it (with apktool) and edit the file SettingsProvider/res/values/bools.xml, replacing this line :

<bool name="def_install_non_market_apps">false</bool>

by this one :

<bool name="def_install_non_market_apps">true</bool>

And then, recompile, etc.

Hope this helps.

Source : xda-developers forum