I have created a script for modifying the chromium browser's behavior when it starts. If the browser is freshly installed and if anyone opens it for the first time, the user will get a welcome note and sign-in form, which I want to suppress.

According to my findings, the solution is to replace the /data/data/org.chromium.chrome/shared_prefs/org.chromium.chrome_preferences.xml file with a version that is generated after skipping the welcome note and sign-in form. The script changes the folder's permission successfully, replaces the file, and again changes back the folder's permission.

But when I open the browser after reboot or without rebooting, that file is overwritten again and I still get the welcome note and sign-in form in both cases. But if I manually replace that file through the Android device monitor and reboots the device, it works.

The browser I am using is Chromium v73.0.3674.0 for android.

And here is the script

su -c "chmod 777 /data/data/org.chromium.chrome"
su -c "chmod 777 /data/data/org.chromium.chrome/shared_prefs"
su -c "rm -r /data/data/org.chromium.chrome/shared_prefs/*.*"
su -c "cp /mnt/internal_sd/MokiMDM/org.chromium.chrome_preferences.xml /data/data/org.chromium.chrome/shared_prefs/"
su -c "chmod 660 /data/data/org.chromium.chrome/shared_prefs/org.chromium.chrome_preferences.xml"
su -c "chown root:root /data/data/org.chromium.chrome/shared_prefs/org.chromium.chrome_preferences.xml"
su -c "chmod 771 /data/data/org.chromium.chrome/shared_prefs"
su -c "chown root:root /data/data/org.chromium.chrome/shared_prefs"
su -c "chmod 751 /data/data/org.chromium.chrome"
su -c "chown root:root /data/data/org.chromium.chrome"

Your Answer

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

Browse other questions tagged or ask your own question.