Can system apps be enabled/disabled directly from the filesystem? System apps can be disabled by using pm disable [appname] and re-enabled in the same fashion. But is there a way to accomplish the same thing by editing some file(s?) somewhere? 


Context: My Android-x86 virtual machine is on boot-loop caused by disabling the Google App. That's the main reason I'm asking this question.
Whether an app is enabled or disabled is stored in a single file /data/system/users/0/package-restrictions.xml.


I took the following steps to re-enable the Google App and solve my bootloop problem:




Boot the Android-x86 virtual machine in debug mode (i.e. append DEBUG=2 to the GRUB entry)
mount the filesystem:

su

cd /dev    # these are necessary to "refresh" the environment
cd ..      # otherwise the following commands wouldn't work

mkdir temp
mount /dev/block/sda1 temp

Edit the package-restrictions.xml file with vi:

vi /temp/android-6.0-rc1/data/system/users/0/package-restrictions.xml



Find the entry containing &lt;pkg name="com.google.android.googlequicksearchbox" enabled="3" enabledCaller="com.android.settings"&gt;
Move the cursor to the end of that line (Line 13 in my case) and press a to begin editing (see Basic vi commands)
Remove the enabled and enabledCaller attributes. The resulting line should be &lt;pkg name="com.google.android.googlequicksearchbox"&gt;
Press Esc and type :wq and press Enter to save and exit vi

Type exit and hit Enter (twice) to boot to Android normally.