LightBlog

samedi 19 août 2017

How to Remove Points of Interest and Advertisements in Waze

Waze, for those of you who haven’t heard of it, is a community driven traffic and navigation app. It is available for both Android and iOS, and is also now out for Android Auto. It uses real-time data from other users to notify users of traffic, better routes to take, and also provides “points of interest” to the user. These points of interest pop up in balloon form and are basically advertisements for places (and often along side them are actual full-screen advertisements). These advertisements can potentially be dangerous in some cases, distracting a driver and requiring the user to cancel them if they wish to still see the road on the application. As can be seen below, the advertisement fills up the top of the screen and a popup advertises the existence of a nearby McDonalds.

Point of Interest/Advertisements in the app

However, thanks to XDA-Member skanadian, these points of interest/advertisements can be disabled with the use of Magisk or an init.d script. If your ROM supports init.d and you wish to follow this guide by making a /system modification, you can simply follow the steps, but instead place the “99waze” file within /system/etc/init.d/. The following steps are taken from here. This should work for future updates unless the developers of Waze specifically target this script.

The following tutorial requires root access on your device because you will be making a script that modifies files located in the /data directory, specifically in the app’s data folder. That means your device’s bootloader is probably unlocked and you have a superuser binary installed through either SuperSU or Magisk.


Remove Points of Interest and Advertisements in Waze

Step 1

As mentioned previously, you will need Magisk on your device. You will need an application such as MiXplorer too, so please install that or any other root enabled file manager.

MiXplorer (Free, XDA Labs) →

Step 2

Navigate to:

/magisk/.core/post-fs-data.d/

in your file manager, then create a file named 99waze. Note when you navigate to /magisk, tap the menu button in the top right and tap “Show hidden” if using MiXplorer.

Step 3

Please chmod 755 this file (ie. change the file’s permissions, something you can do by opening the file’s properties in MiXplorer). This looks like the following.

Step 4

Add the following lines to the file.

99waze

#!/system/bin/sh
sleep 30

sed -i -e 's|.*ExternalPOI.My Coupons Enabled:.*|ExternalPOI.My Coupons Enabled: no|g' /data/data/com.waze/preferences
sed -i -e 's|.*ExternalPOI.Feature Enabled:.*|ExternalPOI.Feature Enabled: no|g' /data/data/com.waze/preferences
sed -i -e 's|.*ExternalPOI.Max POIs Display:.*|ExternalPOI.Max POIs Display: 0|g' /data/data/com.waze/preferences
sed -i -e 's|.*ExternalPOI.Popup Enabled:.*|ExternalPOI.Popup Enabled: no|g' /data/data/com.waze/preferences
sed -i -e 's|.*ExternalPOI.Max POIs Display Small Screen:.*|ExternalPOI.Max POIs Display Small Screen: 0|g' /data/data/com.waze/preferences

chown root:root /data/data/http://ift.tt/2x0fLg0
chmod 555 /data/data/http://ift.tt/2x0fLg0
find /data/data/http://ift.tt/2x0fLg0 -name "*x28*" | xargs rm -rf

chown root:root /data/data/com.waze
chown root:root /data/data/com.waze/preferences
chmod 755 /data/data/com.waze
chmod 644 /data/data/com.waze/preferences

Step 5

Reboot your phone and see if advertisements are now disabled and no points of interest show up! All advertisements and points of interest should be entirely disabled.


Explanation

Firstly, “99waze” is a systemless init.d script. Init.d is a system folder which contains scripts to be run at boot, and the first two numbers in front of the file name denote priority. A file name “01file” would run before “99file” for example. This script is left until last so as not to interfere with anything else, and not have its modifications undone afterward.

Not only is the priority made until last, but the script starts with “sleep 30” which means to wait 30 seconds before doing anything. Next, the script calls “sed”, the Linux text stream editor. It lets you edit text files line by line via commands. Sed is used to replace many parameters in the preferences file. All of these are used for advertisements or points of interests and disable them.

Next, we make the point of interest files only editable by the root (in this case SuperUser) account. These files are located in the /skins/default folder mentioned above. We then remove all files that contain the string “x28” as all point of interest files contain this string. When we delete them the app cannot recreate them as the SuperUser account owns this folder, thus you can no longer receive point of interest files even if the preference changes become undone.

Following this, the script then claims root ownership over the preferences file so this too cannot be edited. This again prevents our changes being undone and is to help prevent any future app updates from undoing our changes.

And that’s it! Waze is an incredibly useful app but it’s a shame that distracting advertisements such as those were added. They can cause problems for drivers and it’s great that a user has found a way around them. Hopefully changes are made to make the advertisements less intrusive. While in my opinion advertisements can be beneficial, such intrusive advertisements in an app while a user is driving a car are unacceptable, and I hope the developers may take a hint.



from xda-developers http://ift.tt/2vNhWF9
via IFTTT

Aucun commentaire:

Enregistrer un commentaire