yashsingh1/xdaforums huggingface dataset:
[General Questions and Answers] Lusty Rugnuts:
Firewall rules are stored on my computer in c:\test\bluwall\

My update.bat script to update the firewall rules (bluwall_basic.sh, bluwall_google.sh, bluwall_lockdown.sh), the resolv.conf file (where the default DNS servers are set), and the hosts file is below. You'll note I make the phone do a graceful reboot, rather than just doing a crash reboot via 'adb reboot recovery'. This is important... you should never use 'abd reboot' or 'adb reboot recovery'... trust me, it can corrupt files.

@cls
@CHOICE /C YN /M "Reboot the phone to Recovery Mode?"
@IF %ERRORLEVEL% EQU 1 goto dorebootrec
@IF %ERRORLEVEL% EQU 2 goto docontinue
:dorebootrec
@ECHO REBOOTING... please wait...
@ECHO Sending shutdown intent...
@adb shell am broadcast android.intent.action.ACTION_SHUTDOWN
@timeout /T 5 /NOBREAK
@ECHO Sending graceful reboot command...
@adb shell su -c 'svc power reboot recovery'
:docontinue
@cls
@ECHO In TWRP, mount the system partition, then
@pause
@cls
@ECHO Updating DNS servers in resolv.conf
@adb push c:\test\bluwall\resolv.conf /system/etc/resolv.conf
@timeout /T 5 /NOBREAK
@cls
@ECHO Updating HOSTS file
@adb push c:\test\bluwall\hosts /system/etc/hosts
@timeout /T 5 /NOBREAK
@adb push c:\test\bluwall\hosts /data/adb/modules/hosts/system/etc/hosts
@timeout /T 5 /NOBREAK
@cls
@ECHO Updating bluwall_basic.sh
@adb push c:\test\bluwall\bluwall_basic.sh /data/local/bluwall_basic.sh
@timeout /T 5 /NOBREAK
@cls
@ECHO Updating bluwall_google.sh
@adb push c:\test\bluwall\bluwall_google.sh /data/local/bluwall_google.sh
@timeout /T 5 /NOBREAK
@cls
@ECHO Updating bluwall_lockdown.sh
@adb push c:\test\bluwall\bluwall_lockdown.sh /data/local/bluwall_lockdown.sh
@timeout /T 5 /NOBREAK
@cls
@CHOICE /C YN /M "System files update complete. Reboot the phone?"
@IF %ERRORLEVEL% EQU 1 goto dorebootsys
@IF %ERRORLEVEL% EQU 2 goto doend
:dorebootsys
@ECHO Rebooting the phone in 10 seconds...
@timeout /T 10 /NOBREAK
@adb reboot
:doend
@cls
@ECHO Killing ADB
@timeout /T 3 /NOBREAK
@taskkill.exe /IM adb.exe /F
@cls
[General Questions and Answers] Lusty Rugnuts:
This post was about my firewall rules for blocking ads, but I discovered that iptables isn't really built to do that. So I'm using the HOSTS file to do ad blocking.
[General Questions and Answers] Lusty Rugnuts:
This post was about the problems I was having with AFWall+ not properly flushing iptables upon a change of profile in AFWall+. The issue has been resolved. See here.
[General Questions and Answers] Lusty Rugnuts:
If you want Airplane Mode to only control your cellular connections, and leave your WiFi and Bluetooth connections alone, enter the following commands in an Administrator-privilege command prompt on your computer, with your phone booted normally and connected to the computer via USB, in 'Transfer files' USB mode:

adb shell

su

settings put global airplane_mode_radios cell,nfc

settings put global airplane_mode_toggleable_radios wifi,bluetooth

exit

exit

Then reboot.

The first 'settings' command tells the phone to only turn cell (cellular) and nfc (near field communication) radios off when Airplane Mode is enabled.

The second 'settings' command tells the phone that in order to enable cell and nfc, Airplane Mode must be disabled, whereas wifi and bluetooth can be enabled independent of Airplane Mode.
[General Questions and Answers] Lusty Rugnuts:
Protip:

If you've got Magisk Manager installed, and you've installed the 'Magisk Manager for Recovery Mode' module so you can disable Magisk modules from TWRP recovery mode if they're causing problems, the directions here will only get you a 'mm: not found' error in TWRP Terminal.

But if you type "/data/media/0/mm" (without the quotes) in TWRP Terminal, it'll work.
[General Questions and Answers] Lusty Rugnuts:
If you want to disable all logging and kernel trace recording:

First, boot into TWRP Recovery Mode and delete:

MTK Logger

package:/system/vendor/app/MTKLogger/MTKLogger.apk=com.mediatek.mtklogger

Comment out (put a # in front of) every line in the following files:

/system/etc/init/dumpstate.rc

/system/etc/init/logd.rc

/system/etc/init/atrace.rc (except write /sys/kernel/debug/tracing/tracing_on 0)

/system/etc/init/bootstat.rc

My phone now starts up even faster, CPU utilization when the phone is idle is ridiculously low, and even when playing podcasts, battery drain is low.

With the Battery Saver tweak in the thread above (which automatically turns on Battery Saver at 99% battery) and the 3C CPU Manager tweak (which lowers your CPU speed to 299 MHz automatically when you turn the screen off), this thing sips the battery lightly.

Start 3C CPU Manager

Press hamburger icon at top-left

Select 'Settings'

Select 'Boot Settings'

Select 'Boot profile'

Turn the "Screen off" slider on

Select the three vertical dots on the right to edit the Screen Off profile

Slide the 'Max' slider all the way to the left

{Optional}: Scroll down and set some of the CPU cores to 'Offline'... I've set 6 of the cores to be forced offline when the screen is off.

Press the 'OK' button

Press the 'OK' button again

Exit Settings via the back button
[General Questions and Answers] Lusty Rugnuts:
I think I've finally rid the phone of all Blu functionality... the final step was to remove the Blu Privacy setting in Settings (which, ironically, reduced your privacy by allowing Blu to monitor your usage of the phone).

Open MyAndroidTools, go to Activity, go to Settings.

Find and disable:

BluOOBEActivity

BluOOBEKeepActivity

BluOOBEPrivacyActivity

BluOOBEWifiSetupActivity

Settings$BluOOBEPrivacyActivityForSettingsActivity

Only do this after you've removed all Blu apps, disabled all Blu settings, etc. The Blu settings are baked-in to the Settings app, so they can't be removed completely unless the app is decompiled and edited, but at least we can get rid of all visible traces of Blu apps in Settings.

Further, if you want the SystemUI Tuner to always show up in your settings:

Open MyAndroidTools, go to Activity, go to SystemUI

Find and enable:

TunerActivity
[General Questions and Answers] Lusty Rugnuts:
Well, I'm not sure which setting I changed that did it, but I'm now running without any Google components started. After I kill the Google components in MyAndroidTools, they don't start up automatically anymore! And the phone feels really fast now. CPU utilization dips as low as 2% when the phone is idle, and averages about 7% on a single core at 299 MHz.

I can start the Google components back up manually, and when I kill them in MyAndroidTools, they stay killed. Before, the Google Persistent service would always restart all the Google components.

{UPDATE}

The Google components restart as soon as I start an app which requires any Google interaction such as Firebase or Google Analytics. Ah, well... at least I can shut down the Google components when I'm not using the phone and I want to save battery.

{/UPDATE}

{UPDATE2}

I've been experimenting with using MyAndroidTools to disable any Google component usage by third-party apps. My podcast app now has ads and Google functionality completely disabled, and it continues to work just fine.

My launcher has all Google functionality completely disabled, and it continues to work just fine (although for some reason I've now got 2 Greenify icons, and I can't figure out how to get rid of one of them... they both start Greenify. One of them says 'Greenify', the other says 'Greenify TM').

Google itself has nearly all functionality disabled except for authorization to sign into Google Play Store... no location tracking, no aGPS, no NFC, no constant connections to Google's servers, no syncing, no ads (I don't even have the 'Ads' setting in Settings > Google anymore... I'm not sure if its because I've so disabled Ads functionality that it no longer displays or because Google got tired of me spamming their ad server with "F***_Y**_GOOGLE".

{/UPDATE2}

{UPDATE3}

I've gotten rid of Greenify and Nova Launcher. I replaced Greenify with the Device Idle Constants settings in the thread above, and I replaced Nova Launcher with OpenLauncher.

I did this because both Greenify and Nova Launcher used crashlytics / Firebase / tracking... and despite what the Greenify developer says, he is using the Google adid_key which constitutes a GUID (Globally Unique ID) which Google uses to track users, while tricking them into believing they can reset their Advertising ID, but in reality, all they're doing is changing the content of the 'fake_adid_key', which otherwise does nothing else.

OpenLauncher has no such tracking. I've checked all its files, and there's not even any permissions for it to connect to the internet.

The phone is even smoother now, CPU utilization is lower, and I can use the phone for everything I need with the CPU pinned to 299 MHz maximum (all cores enabled when the screen is on, 6 cores disabled when the screen is off), even with the podcast app playing podcasts, without any podcast stuttering and with only a barely noticeable lag in response.

{/UPDATE3}
[General Questions and Answers] Lusty Rugnuts:
In the interest of stripping out all unnecessary software on the phone, I've removed Media Provider.

package:/system/priv-app/MediaProvider/MediaProvider.apk=com.android.providers.media

I first disabled the media scanner receiver:

c:\ADB>adb shell

L0150WW:/ $ su

L0150WW:/ # pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

... and tested to be sure everything ran OK. It did.

I then went into Settings > Apps > Media Storage > Storage and cleared the cache, then disabled Media Provider entirely:

c:\ADB>adb shell

L0150WW:/ $ su

L0150WW:/ # pm disable com.android.providers.media

... and tested to be sure everything ran OK. It did.

I then booted into TWRP Recovery Mode and pulled the package to my computer:

adb pull /system/priv-app/MediaProvider c:\test\backup

... and removed the package from the phone by deleting the /system/priv-app/MediaProvider directory.

I then tested to be sure everything ran OK. It did. Bootup is a bit faster.

{UPDATE}

This removes any alarm sounds in your clock app, notification sounds in your SMS app, and ringtones in your phone app. The phone then uses the default sounds for those apps.

Mheh... I reinstalled it, and just disabled the MediaScannerReceiver. At least with that configuration I'll still have my custom-set sounds, but MediaScanner won't scan the entire phone at each boot.

On earlier versions of Android, if you put a .nomedia file into a directory, MediaScanner wouldn't scan that directory. But on newer versions of Android, MediaScanner scans all directories whether a .nomedia file is present or not, and just doesn't enter any media files it finds into its database for those directories which have a .nomedia file in them. That's a bit wasteful, which is probably why MediaScanner consumes so much power on boot for newer devices.

Since this is a system app, it isn't necessary to actually reinstall the .apk file... just adb push it back where it had resided in /system/priv-app/, and reboot.

You might have to "prime the pump" to get it working again:

c:\ADB>adb shell

L0150WW:/ $ su

L0150WW:/ # pm enable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

Then reboot, let it do its scan once, then disable MediaScannerReciever:

c:\ADB>adb shell

L0150WW:/ $ su

L0150WW:/ # pm disable com.android.providers.media/com.android.providers.media.MediaScannerReceiver

{/UPDATE}
[General Questions and Answers] Lusty Rugnuts:
Pro-tip: If you've got Magisk Manager installed and Magisk Hide enabled, you won't be able to make any changes made to your /system/build.prop file stick.

Disable Magisk Hide, reboot the phone normally once, then edit and save your /system/build.prop.

Reboot and ensure the changes to build.prop stuck, then re-enable Magisk Hide and reboot normally once more.

If that doesn't work, set Magisk to "Core-only" mode, boot into TWRP Recovery Mode, then adb push the build.prop to /system/build.prop. Upon reboot, the changes should stick.
[General Questions and Answers] Lusty Rugnuts:
Heh... here's the (very short) list of running apps... the phone is plugged into USB, playing podcasts and the CPU cores are all allowed to range between 299 MHz and 1.3 GHz. This is the default condition when the phone is sitting at my desk, plugged into USB.

Contrast that to my previous cpuinfo dump, and you'll see that I've really shortened the list:

adb shell dumpsys cpuinfo
Load: 8.77 / 8.41 / 8.57
CPU usage from 9835ms to 4817ms ago (2019-06-07 15:38:20.765 to 2019-06-07 15:38:25.782):
131% 9748/com.bambuna.podcastaddict: 116% user + 14% kernel / faults: 488 minor
10% 323/media.codec: 4.9% user + 5.3% kernel
4.3% 330/audioserver: 2.3% user + 1.9% kernel
3.5% 1187/com.android.systemui: 2.9% user + 0.5% kernel / faults: 225 minor
3.3% 297/surfaceflinger: 1.7% user + 1.5% kernel
3.3% 929/system_server: 2.9% user + 0.3% kernel / faults: 97 minor
0.9% 148/teei_switch_thr: 0% user + 0.9% kernel
0.5% 12652/kworker/u17:2: 0% user + 0.5% kernel
0.3% 114/hps_main: 0% user + 0.3% kernel
0.3% 308/aal: 0% user + 0.3% kernel
0.1% 7/rcu_preempt: 0% user + 0.1% kernel
0% 72/cfinteractive: 0% user + 0% kernel
0.1% 127/present_fence_w: 0% user + 0.1% kernel
0% 128/frame_update_wo: 0% user + 0% kernel
0.1% 130/display_idle_de: 0% user + 0.1% kernel
0.1% 271/magiskd: 0% user + 0.1% kernel
0.1% 283/utgate_tlog: 0% user + 0.1% kernel
0% 11145/kworker/u16:4: 0% user + 0% kernel
0% 12678/kworker/u16:1: 0% user + 0% kernel
54% TOTAL: 45% user + 8.9% kernel

Here's the phone, plugged into USB with the podcast app closed and the screen off. Six of the CPU cores are forced offline all the time, and the other two cores are pinned to 299 MHz maximum (3C CPU Manager is set up to do this automatically when the screen is off). This is the default condition when the phone isn't otherwise being used, such as when it's sitting overnight, although it's also the condition used for most of the day, sans the USB connection. Yes, my podcast app runs just fine on only 2 cores pinned to 299 MHz maximum. It'll drain the battery at about 3% / hour when listening to podcasts, and if no podcasts are playing, it drains at less than 10 mV of battery voltage per hour.

adb shell dumpsys cpuinfo
Load: 5.06 / 5.01 / 5.28
CPU usage from 162782ms to 138863ms ago (2019-06-07 16:37:58.644 to 2019-06-07 16:38:22.563):
0.5% 929/system_server: 0.1% user + 0.3% kernel / faults: 12 minor
0% 1187/com.android.systemui: 0% user + 0% kernel / faults: 8 minor
0% 114/hps_main: 0% user + 0% kernel
0% 187/mtk charger_hv_: 0% user + 0% kernel
0% 297/surfaceflinger: 0% user + 0% kernel
0% 322/vtservice: 0% user + 0% kernel
0.8% TOTAL: 0.2% user + 0.5% kernel + 0% iowait
[General Questions and Answers] Lusty Rugnuts:
To change your default IPv6 DNS servers (in this case, from Google's DNS servers to Quad9's DNS servers):

If you've got Magisk Hide enabled, disable it, reboot normally once, then boot into TWRP Recovery Mode.

adb pull /system/vendor/etc/wide-dhcpv6/dhcp6s.conf j:\test

change the first DNS server to: 2620:fe::fe

change the second DNS server to: 2620:fe::9

adb push j:\test\dhcp6s.conf /system/vendor/etc/wide-dhcpv6/dhcp6s.conf

Reboot the phone normally, re-enable Magisk Hide, then reboot the phone once more.

{ASIDE}

You might have noticed that the path to ADB has changed on my computer... I installed a dedicated 2 TB external hard drive to house everything phone-related. This'll let me keep every Nandroid backup ever made, without cluttering up my internal hard drive and bogging down the computer.

The main problem I was having was my computer's antivirus' on-access scanner trying to scan the large Nandroid backup files... it'd flog the internal hard drive and slow down the computer, and there's no easy way to stop it scanning those directories. So I installed an external drive and excluded the entire drive from on-access antivirus scanning.

The drive is still scanned monthly on a schedule, just not on-access.

{/ASIDE}
[General Questions and Answers] Lusty Rugnuts:
I had a MTP USB driver issue on my computer, which was preventing the phone from being recognized in Windows Explorer. Every time I rebooted the phone, Windows would try to reinstall the MTP USB driver, and would fail. Here's how to fix that.

Uninstall the failed MTP USB driver in Windows' Device Manager. Be sure to check the box which deletes the driver.

In Device Manager, click Action > Add Legacy Hardware. Click Next at the intro screen.

Click "Install the hardware that I manually select from a list". Click Next.

Click Android Phone. Click Next.

Click "Have Disk". Click 'Browse" and browse to c:\windows\inf\wpdmtp.inf. Click "Open", then "OK".

Select MediaTek, and Android ADB Interface. Click "Next", then "Next" again to start the installation.

It might glitch because Windows will try to automatically install the MTP USB driver as you're installing the driver from wpdmtp.inf. If so, delete the MTP USB driver in Device Manager that failed to start, and the one you installed will start, whereupon you'll see your phone in Windows Explorer when you put the phone into "File transfer" USB mode.
[General Questions and Answers] Lusty Rugnuts:
Well, as a test I disabled the following:

Google Account Manager

Google Play Services

Google Play Store

Google Services Framework

My memory usage went down to only 523 MB; all Google components are killed even after reboot; in Settings > Security > Device Administrators all the Google device administrators (GMail, Find My Device, etc.) are gone; even the Settings > Google menu item is gone; com.google.android.gms.persistent can't even run... this is a completely Google-free phone, except for the actual phone app (only because I can't find a phone app which properly hooks into the OS and works correctly) and WebView (only because WebView has to remain for other apps to function since I don't have Chrome).

Everything still works... I get a notification upon reboot to enable Google Play Services, but once you swipe it away it stays gone. Next time I reboot, I'll set it to disable that notification.

If I need to update any apps, I'll default to G-Droid, and if I absolutely need to, I'll re-enable the Google components and check Google Play Store.

But at least there's no more of Google collecting data all the time, which is why the phone runs just fine with the CPU cores pinned to 299 MHz maximum, with no noticeable lag.

I'll run like this for a few months to be sure everything works like it should, then I'll go to work deleting Google from the phone... I'll have to do more work to find a phone app and a different WebView, though.
[General Questions and Answers] Lusty Rugnuts:
Me wonders when Zelendel will apologize to all BLOX3 users for essentially calling them stupid, the butt of jokes, preschoolers, poor, etc.

Is this type of behavior by "Senior Members" condoned on XDA Developers?

Trust me, Zelendel, you don't want to tangle with me... I'm a Usenet troll from decades back, and I've literally driven people to the madhouse. But hey, if you're up for getting mangled, I'm game.

The BLOX3 is an awesome little phone when configured properly, and Zelendel is, to put it succinctly, wrong.

How ironic that just 15 days after Zelendel's tantrum that the BLOX3 was rooted, and many tweaks followed, eh?

We, the BLOX3 community, expect an apology, Zelendel.
[General Questions and Answers] Lusty Rugnuts:
Having gotten rid of Nova Launcher (because it's using Google's corporate spyware mechanism), I no longer have access to all the 'widgets' that it provides access to... that long list of activities and intents that you can launch.

There's a way to do the same via ADB:

For this demonstration, I'll be using the Engineer Mode app. You can do the same for any app.

1) List all packages:

adb shell pm list packages -f

Find the package you want information about from the list above. In this case, it's:

package:/system/vendor/app/EngineerMode/EngineerMode.apk=com.mediatek.engineermode

2) List the activities of an app:

adb shell dumpsys package com.mediatek.engineermode

This will list the following:

Activity Resolver Table:

Non-Data Actions:

android.intent.action.MAIN:

d18c3c5 com.mediatek.engineermode/.EngineerMode filter d269f60

Action: "android.intent.action.MAIN"

AutoVerify=false

3) Run the available intent:

adb shell am start -n com.mediatek.engineermode/.EngineerMode

This starts up the Engineer Mode app.

{ As a related aside... I recently had to do this because my GPS stopped working... turns out the phone just needed to be rebooted. If you're running GPS, you can't use Settings > Developer Options > Background process limit > No background processes. You have to allow at least enough background processes so the GPS daemon stays running. }

I've gone through each of my apps and listed their activities and intents. I put them in the list I keep of installed packages, right below each listed package, so I have a handy list of them all in one place.

So for instance, for the Engineer Mode app, it'd be:

MTK Engineering Mode
package:/system/vendor/app/EngineerMode/EngineerMode.apk=com.mediatek.engineermode
[INDENT]adb shell am start -n com.mediatek.engineermode/.EngineerMode[/INDENT]
[INDENT]adb shell am start -n com.mediatek.engineermode/.EngineerModeReceiver[/INDENT]
[INDENT]adb shell am start -n com.mediatek.engineermode/.hardwareparam.HardwareParamReceiver[/INDENT]
[INDENT]adb shell am start -n com.mediatek.engineermode/.wifi.WifiStateReceiver[/INDENT]
[INDENT]adb shell am start -n com.mediatek.engineermode/.c2klogger.C2KLogReceiver[/INDENT]
[INDENT]adb shell am start -n com.mediatek.engineermode/.desenseat.ATCSenderReceiver[/INDENT]
[INDENT]adb shell am start -n com.mediatek.engineermode/.mbim.UsbStateReceiver[/INDENT]
[INDENT]adb shell am start -n com.mediatek.engineermode/.nsiot.UsbStateReceiverNsiot[/INDENT]
[INDENT]adb shell am start -n com.mediatek.engineermode/.boot.EmBootupReceiver[/INDENT]
[General Questions and Answers] Lusty Rugnuts:
Just an update. The phone continues running superbly, no problems whatsoever except the battery is starting to get a bit "puffy". I plan on rectifying that by smearing a thin layer of silicone sealant on a small area of the battery, letting the silicone sealant set, then puncturing the silicone sealant and the mylar wrapper on the battery (while carefully avoiding touching anything inside that mylar wrapper, so as not to short out the battery) with the smallest sewing needle I can find. This will create a small hole through the silicone sealant which will naturally attempt to stay closed (that's why I'll use a sewing needle, not a hollow needle... so no silicone material is removed), but any pressure inside the battery will 'burp' out the gases. Thus, I've just created a 'relief valve' of sorts to relieve built up gas in the battery, without allowing outside air to get into the battery.

I've found a way to programmatically set the Background Process Limit (usually found at: Settings > Developer Options > Background process limit):

adb shell su -c "service call activity 51 i32 0"

The "0" denotes "No background processes". You can set it to however many background processes you want or need.

This is now included in my "GoogleOut.bat" file, which:

1) Forces the phone into Deep Doze mode

2) Disables Accelerometer, Light and Proximity sensors to save power

3) Kills Google components

4) Kills background (cached) processes.

5) Sets background (cached) process limit to 0

I run GoogleOut.bat each time I reboot the phone, which is generally once every few months (after I've done a full backup and run the cleaning app).