Is there any way to change App source on Android? I migrated from Oneplus 3(Chinese android phone) to Galaxy Note 8 via Cloneit, since Samsung's stock migration tool didn't support Oneplus 3. 

However, apps migrated(or preferably, cloned) on my new phone are recognized as 'app installed from unknown source' instead of 'installed from Google Play'. 

It seems that Cloneit, the migration tool brought all apk files via connection and that's making all apps recognized as unknown source. 

*
So, I want to change their source property from unknown to installed from Google Play. 
*

My speculation is pretty pessimistic since it sounds like it's related to some security issues but I'm hoping some Superuser has an answer for this. 

Thanks.
The solution is as simple as a few (s)hell commands. Requires root and BusyBox.

Open a terminal or an adb shell and type

su
sed -i 's/installer="[A-Za-z0-9._-]*"/installer="com.android.vending"/g' /data/system/packages.xml


If the command prompt tells you sed: not found, install BusyBox correctly and prepend busybox before sed.



Be aware that this is a highly dangerous action. It is strongly recommended that you backup the file before attempting to modify it. Also in some cases the file permission may get messed up, fix it by

chmod 0660 /data/system/packages.list
chown 1000.1000 /data/system/packages.list