Themes / Apps / Mods [MOD/magisk/root] Magisk module to disable app Ads/Analytics/Firebase/Crashlytics - Google Pixel 6 Pro

Attached is a (simple) Magisk module which allows you to disable:
- app measurement
- app analytics
- app firebase tracking
- app crashlytics
In short, each APK (system app or user app) may have background services to do all sorts of tracking and ad handling. Module allows you to disable (or enable) those services.
You must obviously be rooted and have a working Magisk.
How to install:
Code:
a) download attached zip file
b) push the zip file to your /sdcard folder (use: adb push dss.zip /sdcard)
c) open Magisk
d) in the panel at the bottom, tap the "modules" icon
e) at the top, select "install downloaded module"
f) navigate to your /sdcard folder
g) select dss.zip
h) tap the reboot button
After installation:
The script must be run manually using the command line. First, open a shell using adb:
Code:
> adb shell
$ su
#
The script has the following syntax:
Code:
dss {disable|enable} {user|system} <package-name>
You must provide 2 or 3 arguments to the script:
a) first argument is "disable" or "enable" (by default Analytics/Firebase/etc services are enabled)
b) second argument is "user" or "system" (use "user" for any app wich you installed using an APK or installed from play store; use "system" for apps which come as part of the official Google image, e.g. contacts/dialer/messaging)
c) the third argument is optional and - if present - contains the name of a specific package (e.g. com.banking.mybankapp)
Examples:
1) disable analytics/firebase/etc for ALL user apps
Code:
# dss disable user
2) enable analytics/firebase/etc for ALL system apps (this is the default)
Code:
# dss enable system
3) disable analytics/firebase/etc for Feedly
Code:
# dss disable user com.devhd.feedly
The script will show you output of the services which get disabled, for example for the Feedly case:
Code:
Component {com.devhd.feedly/com.facebook.internal.FacebookInitProvider} new state: disabled
Component {com.devhd.feedly/com.google.android.gms.analytics.AnalyticsJobService} new state: disabled
Component {com.devhd.feedly/com.google.android.gms.analytics.AnalyticsReceiver} new state: disabled
Component {com.devhd.feedly/com.google.android.gms.analytics.AnalyticsService} new state: disabled
Occasionally it can happen that after disabling Analytics/Firebase/etc, the app no longer works. Then just "enable" again. Apps should - in principle - be resilient but some are not coded properly. Alternatively, you can try to figure out exactly which of the services causes the crash and (manuall) re-enable that service (but you will need to look into the source code a bit). When you run this on Feedly for example, you will find that it crashes afterwards (reason is that the script disabled com.devhd.feedly/com.facebook.internal.FacebookInitProvider). You can re-enable that service individually using:
Code:
pm enable com.devhd.feedly/com.facebook.internal.FacebookInitProvider
or just do:
Code:
# dss enable user com.devhd.feedly
(that will re-enable all the services previously disabled)
You can also disable stuff for system apps, e.g. com.android.contacts (Contacts), com.android.vending (Play store app), etc ...
However, one BIG WARNING. If you disable this for system apps, make sure to re-run the script with the 'enable system' argument BEFORE running a Play-systemupdate otherwise that may bootloop. So, to be on the safe side, if you have used the script to disable services in system APKs, then run:
Code:
# dss enable system
before doing the Play-systemupdate.
I you want to check the source code (simple sh script), just unzip the dss.zip in a new directory and check out the file system/bin/dss. It's not complicated ...
This will save you (a tiny litte bit) of battery, but more importantly, a lot of nasty "tracking" (which you don't need).
Changes are persistent across reboots.
github: https://github.com/foobar66/dss

Notes:
When I run this for the user apps on my phone, I have ~189 background services that get disabled.
If you want to know more about firebase, look here: https://firebase.google.com/
And here is some detail about app analytics: https://developers.google.com/analytics/devguides/collection/android/v4
If you want to know the name of your APKs/packages, do:
Code:
# pm list packages -f

Looks like a brillant tool, I'll test it, thanks a lot for this very user-friendly and efficient tool!

Yes brilliant tool thanks for this!

I'll third, I run this on my device at the moment on user apps. Great tool and does what it says it will do. Thank you for this!

Great tool.
Thanks for the effort and sharing.

Great share

wow, thanks OP
I did disable analytics/firebase/etc for ALL user apps and scrolling facebook on Chrome no longer jittery.

Flashed and disabled analytics on ProtonAOSP. Thank you for the tool.

This would be great on the Pixel 5

207 user packages got disabled.
Do I have to also run "dss enable system" after the initial "dss disable user"?
Will I have to re-run this after an app updates?
Will I have to re-run this after a monthly android update?

Really useful tool, mate! Will be trying on my device once I get Magisk to work.

Utini said:
207 user packages got disabled.
Do I have to also run "dss enable system" after the initial "dss disable user"?
Will I have to re-run this after an app updates?
Will I have to re-run this after a monthly android update?
Click to expand...
Click to collapse
Also:
You should implement that the module saves the output of the disabled packages.
That way you can easily (and safer) restore those packages e.g. when uninstalling the module?
Same goes for all your other modules:
They tinker with the system but how can I safely restore the original form and uninstall the module?

Utini said:
Also:
You should implement that the module saves the output of the disabled packages.
That way you can easily (and safer) restore those packages e.g. when uninstalling the module?
Same goes for all your other modules:
They tinker with the system but how can I safely restore the original form and uninstall the module?
Click to expand...
Click to collapse
Well, as this is commandline based its basically all there in OP
BTW saving the output is easy, just expand the commandline by "> filename.log" (without the "")
And the safe way back before uninstalling is just dss enable user / dss enable system

s3axel said:
Well, as this is commandline based its basically all there in OP
BTW saving the output is easy, just expand the commandline by "> filename.log" (without the "")
And the safe way back before uninstalling is just dss enable user / dss enable system
Click to expand...
Click to collapse
What I was trying to say is that the module should use the output for when restoring / enabling.
If you have looked at the source code of the module, then you will see that it basically works by creating an array of queried packages to disable/enable. I could imagine that due to what ever fault / later update / package changes / ... the "enable query" might look different than the "disable query" that was run months before. Meaning that there is a chance that not everything that got disabled will get enabled again.

Looks amazing so far, not just for Pixel 6 but good for other phones too

Utini said:
207 user packages got disabled.
Do I have to also run "dss enable system" after the initial "dss disable user"?
Will I have to re-run this after an app updates?
Will I have to re-run this after a monthly android update?
Click to expand...
Click to collapse
1. No, your own choice if you want to disable the services for system packages
2. No
3. No

Utini said:
What I was trying to say is that the module should use the output for when restoring / enabling.
If you have looked at the source code of the module, then you will see that it basically works by creating an array of queried packages to disable/enable. I could imagine that due to what ever fault / later update / package changes / ... the "enable query" might look different than the "disable query" that was run months before. Meaning that there is a chance that not everything that got disabled will get enabled again.
Click to expand...
Click to collapse
Indeed ... that would be a very good improvement ... I´ll have a look at implementing that.
Thanks for the suggestion.

MrRob0t said:
This would be great on the Pixel 5
Click to expand...
Click to collapse
Will work on any phone.

foobar66 said:
Indeed ... that would be a very good improvement ... I´ll have a look at implementing that.
Thanks for the suggestion.
Click to expand...
Click to collapse
It would also be useful for re-running the module after installing some new apps.
E.g. re-running dss disable user will try to disable all user apps even if 90% of them was disabled previously already.
If there was a "file" or "log" to compare what was disabled already, then it could only care about what is now newly installed

Related

[REF] [NOOB] [TIPS] Dictionary/Guide For Noobss

Dictionary for n00b - What is.../What does ...mean?​
Start read from 1st to last one and don't jump from one to another. If you will read all, it bring complex knowladge, if not you can be confused
Read summary to make sure, that you know everything if you think that some part(s) is not necessary to read for you!
If you post link here, please link to 1st post! Than everybody can know, what he/she can find here
Atin001 helps with some updates/corrections in Dictionary - take a minute to thanks him also.
Did you miss something here? Send me PM what you want to have here!
Basics of Unix-like system (ROOT)
su, root, rooting, superuser app - what is it, why we need it
sh, bash, user/root shell - what is bash, sh; what is user shell; what is root shell; how I can recognise it each other
Bussybox - what BusyBox is, basic list of commands from BusyBox
(in progress) Kernel - what is going on? Do I need it?
Android platform and it's specifics
adb shell - what is it, for what it is
Android SDK - what is it, tool which provides, where to download
Tools for work with Android adb shell - Terminal Emulator, ADB shell from Android SDK and how to use it
Custom recovery
What custom recovery is - what custom recovery is
Tools which custom recovery provides - list of tools with description which custom recovery bringing
ADB as root user
USB-MS Toggle
Backup/Restore
Flash ZIP from sdcard
Wipe menu
Partition sdcard + etx2, ext3, ext4 filesystem description
Mounts
Others
Is it save to install? - possible problems, why should I try it?, backup/restore of original recovery
How this whole thing works - Drellisdee's installation steps description/elaboration
Custom ROMs (generally)
What custom ROM is?
Is save install custom ROM? - potencional problems
What I need for install?
What can custom ROM brings - kernel, update, performance, customization, theme, ....
what is ...
deodexed, zipaglined, png-optimized
JIT, HW:acceleration, VM.Heap Size, stagefright
apps2sd + dalvik2sd
custom kernel (recompiled, ...)
Android versions (collecting informations)
List of versions of Android for Optimus One (official&unofficial) - what we can install into our device
What version can be rooted and how? - version list, how to root, which version can be rooted, which can't
Sources (collecting)
http://en.wikipedia.org/wiki/Android_version_history
Tools which you must have
Android SDK Tools (adb shell)
Terminal emulator
KDZ Updater tool
...
So I'm on way, where I can start doing advanced stuff?
Follow Noejn's sign-post You can find here main point for start.
If you now know basic "words of android world" you can take a look on really great tutorial how to root, install recovery and so on.
Have you some questions? Make sure that you look on Mihir287's FAQ
Credits:
The_ERROR,Wikipedia
[Tips]How to increase battery life and performance
There are a few things you can do that will help your battery life and performance
Performance
Do some graphical tweaks
1. Install Spare parts
2. Set Window animations > Fast
3. Set Transition animations > Fast
4. Set Wifi sleep policy > Never While Plugged
Click to expand...
Click to collapse
Adjust Android memory management
1. Install Autokiller
2. Menu > Presets
3. Most people have best results with 'Moderate' but you could also try 'Optimum'
4. Menu > Settings > tick 'Apply settings on boot'
Click to expand...
Click to collapse
Battery
Wipe your battery stats
1. Allow the phone to discharge completely
2. Boot into Bootloader (hold Volume Down and press Power button) >Go to Recovery, plug the phone in if you don't have enough charge to get into recovery
3. Select Wipe > Wipe battery stats
4. Go back and Reboot
5. Leave the phone to do a complete charge (preferably over night)
Click to expand...
Click to collapse
Adjust your radio settings
1. Go to Settings > About phone > System updates > Update PRL (it's normal that the phone process will force close at this point and the radio will reboot)
2. Go to your dialer
3. Dial *#*#INFO#*#*
4. Click 'Phone information'
5. Scroll down to the first dropdown selection and set according to your preference below...
· WCDMA preferred (default) - This will automatically switch you between G/E/3G/H depending on the best signal available by constantly monitoring all signals. This uses the most battery.
· WCDMA Only - If you only want to use 3G/H (3G) and do not want to use G/E (2G) select this.
· GSM auto (PRL) - This is the preferred option as it will allow you to use G/E/3G/H but uses the PRL list on your phone (provided by your carrier in the PRL update) rather than constantly monitoring all frequencies thus saving your battery. This may not work with all carriers if you have difficulty getting mobile data in some areas you will have to use one of the other options.
· GSM only - If you only use G/E (2G) select this (it's the same as selecting '2G only' through the settings menu). This option uses the least battery.
Upon making your selection the radio will reboot and the setting is saved, so just back out back to the dialer and you are done.
Click to expand...
Click to collapse
(edit your /system/build.prop with a file manager with root access)
Code:
wifi.supplicant_scan_interval=180
pm.sleep_mode=
ro.ril.disable.power.collapse=0
(needs ROM with init.d access and busybox, open empty file, insert header #!/system/bin/sh and put these there, save in /system/etc/init.d and name it something like 77tweaks)
Code:
echo "500" > /proc/sys/vm/dirty_expire_centisecs
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
Some Suggestions
Keep a Black wallpaper or a dark theme
Restart the phone once a day
Switch off GPS, bluetooth, WIFI
Uninstall unused apps
Change Refresh Intervals
Change your charging pattern
Reduce Playing videos
Stop staring at your phone....
don't sync accounts which you don't really use: twitter & LinkedIn contacts, active exchange calendar and tasks etc.
Use throttling software such as SetCPU to lower the devices power requirements when it is idle.
Remove any weather widget from home screens (or atleast reduce the frequency of update)
Don't use any Taskiller
oh...
good...
2nd floor right ...
Turn off Bluetooth, WIFI, automatic brightness and so on ...
Use the sim card does not support WCDMA you choose only GSM...
Spare Parts and Autokiller are Google Play apps, right?
Can any one assist of guide me to get a CRT effect lock screen on my rooted HTC one V.
Kindly avoid suggesting custom roms, need this option for stock firm ware.
This thread has been added to the sticky roll up here
Thank you.

Xiaomi Mi Band data extraction, analytics and Google Fit sync tools

Current Version: Extraction Tool v5.92, Analytics Tool v5.60, iOS Extraction Tool v0.2, Fit Sync Tool v0.2 (Updated 6/20/2015)
Here is a tool I wrote for Xiaomi Mi band which provides following functionality:
1. Exports data from Xiaomi Mi band on both rooted and non-rooted Android phones and jailbroken (and possibly non-jailbroken) iPhones under Windows and Linux, generating file in CSV format which can be reviewed in Excel.
Bonoboo maintains a script to perform extraction directly on your smartphone (see link in post 3).
2. Extracts detailed (per minute) walking and running information from Mi Band database (thanks to the input provided by mritsch and Osid).
3. Produces files that can be uploaded to fitnesssyncer.com/ to syncronize data with various fitness services: FitBit/HealthVault/RunKeeper/JawBone and soon Google Fit! See 3rd post for details on data mapping for fitnesssyncer.
4. Provides multiple analytics reports to review extracted data. These reports can be shared on cloud drives to be accessed from anywhere (see post 3 for details)
5. Supports localized UI (currently supported languages are English, Russian, French, Spanish and Italian)
6. Support for synchronization data with Google Fit Service - see post #2 for details
How to use:
Preparation steps:
1. If you plan to use multiple packages, unpack them all to same directory.
1a. If you want to extract data from smartphone, download miband_extract package. To extract data from iOS devices, see to "To extract data from iOS devices" step.
1b. If you want to display local charts of your extracted data on your computer, download miband_analytics package.
1c. If you want to synchronize your extracted data with Google Fit, download miband_fit package.
2. Make sure you have USB drivers for your device properly installed and that your device is accessible by ADB when you connect it through USB
3. If you use it on windows, extract package has all binaries included, for Linux/OSX see comments below.
Checking configuration settings:
1. Review SDPath parameter value in run.bat/run.sh. The program will copy files from Mi app location to folder specified in SDPath before pulling them to desktop. In most cases default value (/sdcard) shoud work fine, however if your phone does not have this directory, find the path where your Internal/External SD is mounted and put that path string into SDPath value. Second most common value might be /storage/sdcard0
2. Review config.js and make any changes to your liking (set Goals for sleep hours and daily steps, force override UI language to specific value)
3. If you do not want main report being open every time you run extract, change OpenHTML=Y in run.bat/run.sh to OpenHTML=N
4. If your device is not rooted or have any issues with first (root) method that application uses and prefer to skip straight to the second (backup) method, set ForceBackupMode value to Y in run.bat.
5. If you want to generate Raw data extract in addition to summary data, set ExtractRaw parameter to Y, update Height parameter to your height in centimeters and update Weight parameter to your weight in kilograms. Please note that data extracted from raw blobs may be slightly different from total numbers in summary data.
If you are planning to use ADB over Wifi:
0. I would not be able to provide much support for ADB over Wifi - so many things could go wrong. Check you firewall settings, check TCPIP ports on both ends, but you are basically on your own.
1. If you are planning to use ADB over WiFi, edit run.sh and set up IPAddr value to IP address of your phone, if you use USB cable, leave IPAddr value blank. If you using non-default port, you may need to change TCPPort value.
2.You may also think of a great idea of running syncronization automatically and unattended using ADB over Wifi - at least I liked that idea initially. I gave that idea more thought and as of now I strongly recommend not to do it - having ADB running over Wifi is a security risk, if you have to use it over Wifi, enable it manually, run the sync and disable ADB over Wifi right away.
For Linux/OSX users:
1. You would need to to manually install android-sdk for (adb binary), sqlite3 version 3.8.3 or higher and openssl with zlib support (version 1.0.2 or higher with zlib support is recommended) to uncompress zlib data. Please note that versions of sqlite3 and openssl that are preinstalled on your machine might be too old to be used with this package, so you might need to obtain newer versions. For example, I was told that OSX has sqlite3 version 3.7.13 preinstalled and it is incompatible with some of functions used in script, so you would need version 3.8.3 at least. If you cannot get openssl with zlib support, you can use similar functionality from python instead - you will need to comment out a line with openssl zlib in run.sh and uncomment next line instead which invokes python script.
2. You'll need to grant execute permissions to run.sh by using chmod +x run.sh and you will need to execute run.sh instead of run.bat in steps listed below. You'll also need to make configuration changes in run.sh instead of run.bat
3. Check that your sqlite3 is properly configured for your time zone. Run following command and see if it returns correct timestamp:
bin\sqlite3 dbfile "select datetime('now','localtime');"
Running application:
1. Connect phone through USB and make sure USB debugging setting is enabled on your phone. Unlock phone screen.
2. Execute run.bat - if your phone is rooted, the data would be pulled automatically. If your phone is not rooted you would see backup screen and you need to press "Back up my data" button in the bottom left corner.
3. Data from your mi band will be saved to extract.csv file and extract.js. After extraction is complete, if OpenHTML is set to Y, mi_data.html will be opened automatically to show charts for your Mi usage.
4. HTML reports are using Google Charts framework and Google TOS does not allow storing their scripts offline along with the application, therefore you will need to have working internet access for reports to work. Your data is not being sent to Google, the internet connection is only used to download latest version of Google Charts javascripts.
Troubleshooting connectivity issues:
1. If you phone is rooted:
Review that your phone has /sdcard directory and it is writable. After you run extract, check if you have origin_db file in that directory. If you do not, ADB may have issues writing files to that directory. Check configuration settings section, item 1
2. If your phone is not rooted or if you use ForceBackupMode=Y:
Check if you get full backup screen, which looks like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If you do not get this screen, then Android backup functionality on your device is broken. If your phone is rooted, consider setting ForceBackupMode=N and using rooted method; if your phone is not rooted, try to run Helium Backup https://play.google.com/store/apps/details?id=com.koushikdutta.backup and see if it can backup MI app to sdcard.
To extract data from iOS devices:
Thanks to joshmosh for detailed instructions.
This is reported to work on jailbroken iPhone, but may work on regular iPhones as well - if you try it on non-jailbroken iPhone please let me know if it worked for you.
1. Get a copy of itools. Google it to find a download location (cnet might have it)
2. Plug in your iPhone to your PC
3. Open itools and click on Applications in top row
4. On the left you will find name of your iPhone and below "Applications". Click on Applications
5. Locate your application Mi Fit and click it. On the right you will find a button labelled "browse". Click it.
6. A window will open. Doubleclick on "Documents" then click on user.sqlite, then on "Export" above.
7. A window will open asking you where to export this file. Export it to a db subdirectory of miband extractor main directory and click OK. You should have a file db\user.sqlite now.
8. Once file is extracted to db\ directory, run runIOS.bat from main miband extractor directory. It should generate extract.js, extract.csv and minmaxtime.csv files and will open local charts in your browser if you have analytics package installed.
Screenshots:
Report descriptions:
mi_data.html:
This report shows overview of the data being extracted. It consists of 3 elements:
a. The chart on the left shows sleep data over time. Total bar height represents overall sleep time and colored segments represent light and deep sleep parts of it.
b. The chart on the right shows daily activity metrics over time. It shows total distance, number of steps and calories burned.
c. The chart on the bottom shows all data inside text table. You can sort the data by any column by clicking on the title of that column. If you select any specific row in the table, same day will be hightlighted in two other charts.
Both graphic charts also show target goals in green line, so you could see how well your results are matching target values. You can dynamically change target values by pressing + and - buttons. The table below has arrows next to Total Sleep and Total Steps columns which would be green for days when goal was met and red for days when goal was not achieved.
mi_data_byDoW.html:
This report allows you to see the scatter of your activities grouped by the day of the week.
This would be a good chart to see if you are performing better on any specific day of the week.
There are 4 charts on that report:
a. The left chart shows various metrics in scatter chart. You can select a specific metric from the dropdown located above the chart. You can also see a daily goal trendline in green and an approximation line in black. If the approximation line is not flat and you have statistics over many weeks, this might mean that your performance is consistently different depending on the day of the week.
b. The right chart shows line chart data for the metric selected in the left chart. It has time zoom controls at the top to only show the data over last day, last 5 days, 1 week, 1 month, 3 months, 6 months and 1 year. You can also select time interval manually by dragging time sliders at the bottom of the chart.
c. The chart at the bottom is a calendar view for your activity-related metrics. It shows a calendar and each days recorded activity is colored based on whether the value for that activity is above or below the goal. The days that have metric value below daily goal will be colored red, the days with metric value above the goal will be colored blue. The higher the deviation from the goal, the more intense color would be. In other words, the days where results are significantly above the goal would be colored in saturated blue and the days where results are significantly below the goal would be colored in saturated red.
This chart could help searching for more complicated patterns in your performance, patterns that are not just days of the week.
You can also change goal values dynamically by using + and - buttons at the top and see green trendline moving on the left chart and days changing colors on the bottom chart.
d. The last chart shows a timeline of your sleep on a daily level. This chart will only be visible if you select "Sleep Timeline" metric from the dropbox. This chart shows the time you went to sleep and the time you woke up. It shows this information for each day the history data is available and weekends are colored in a different color. This chart could help you to see how consistent your sleep/wake hours across different days and also if you have same sleeping patterns on weekends.
Google Fit Syncronization:
Limitations:
1. Daily summary statistics is synced, so charts by Week and Month will show correct data; chart by day will show correct totals, but not correct hourly breakdown.
Prerequisites:
1. You need to have at least version 5.71 of miband_extract package.
2. You will need to have Internet access and your browser should be configured to enable pop-ups at least from a specific domain below.
3. You need to open following URL: Get Fit Token and allow it to access your Google Fit data. Latest version of Chrome worked for me, while IE 11 had issues with popups.
Installation:
1. Download latest version of meband_fit package and unpack it to the directory where you have miband_extract v5.71 or above.
2. If you upgrade from previous version of fit sync package, you will need to clean up old data populated by old version. To do so run following command:
fit clean
Running Sync:
1. Synchronize your data from smartphone to desktop.
2. Obtain a new OATH key for syncing data with Fit - open Get Fit Token and copy resulting string to your clipboard.
3. Run fit.bat and when asked for new token paste the string from previous step and press enter. If fit.bat did not ask you for token and failed with Authentication error, just run it again.
Troubleshooting:
1. The process is logging into fit\*.log files. If you have errors, review these logs first.
2. The token from step 2 is valid for 1 hour - you will need to refresh the token after that. After 1 hour subsequent fit syncs will start failing until you obtain a new token.
3. Current token is cached in GKey environment variable. Once batch determines that old token is expired, it would clean the variable and will ask you for a new key on a subsequent run.
Related links:
Latest version of Bonoboo port for smartphone extraction.
Known Issues:
1. Vertical axis is not always in sync for two charts in mi_data_byDoW.html
2. Timeline axis is only shown at the bottom of timeline
Version History:
Code:
[B]v5.92 06/20/2015[/B]
Added support for Mi Scale - extracting weight history into weight.csv
[B]v5.90 03/14/2015[/B]
Walking and Running statistics with minute granularity are now extracted from Raw data thanks to the input provided by mritsch and Osid.
[B]v5.80 03/07/2015[/B]
Google Fit sync package 0.3:
Fixed error in 1324438.json file which prevented Fit Sync for some users.
Added FitTools.bat which allows pulling various information from Google Fit account.
[B]v5.80 03/01/2015[/B]
Extraction package:
Added experimental support for raw data extraction. To enable raw data extraction, set ExtractRaw=Y in run.bat
Analytics package:
German localization added to analytics package (thanks to joshmosh)
default app_locale.js file is added to analytics package to support data extracted from iOS devices.
Data Extraction Tool v0.1 for iOS is added along with instructions on how to manually extract Mi Band data from iPhone
[B]v5.71 02/16/2015[/B]
Extraction package:
Extra fields added to extract.csv to support for Google Fit sync v0.2.
extract.json is not created anymore, this data is now calculated on the fly from extract.csv
Google Fit sync package 0.2:
Added sync for activity durations (walk duration, run duration, sleep duration)
Added sync for distance walked. Since distance metric is considered location, Token application will request new permission:
https://www.googleapis.com/auth/fitness.location.write
Fixed activity timestamps - Google Fit expects time to be in UTC time zone.
[B]v5.70 02/16/2015[/B]
Extraction package:
Initial support for Google Fit sync.
Google Fit package 0.1:
Initial release
[B]v5.50 02/05/2015[/B]
Extraction package:
Added new columns to CSV file for better FitnessSyncer compatibility.
Added support for time correction. See db\offset.sql for sample entries.
Updated run.sh from [URL="http://forum.xda-developers.com/member.php?u=6091617"]jlaunay[/URL] to support new run.bat parameters and localization.
Analytics package:
Changed mi_data_byDoW.html to use AnnotationChart for right graph - support for time interval zooming.
Added new metric to mi_data_byDoW.html called "SleepTimeline" to show Sleep Timeline chart.
Various small fixes.
[B]v5.35 02/03/2015[/B]
Extraction package:
Fixed logging issue - adb would sometimes lock the log files and subsequent extraction invocations would fail completely on locked log files.
Added support for ADB over Wifi - see instructions in the first post.
Analytics package:
Fixed sorting order on main table
Second fix for incorrect sleep/wake hours calculation
Updated colors across all reports to be consistent
Converted total/deep/light sleep from minutes to hours and minutes in the main table. Show percentages of deep/light sleep compared to total sleep.
Add fall asleep and wake up times as selecrable metrics to mi_data_byDoW.html
mi_data_byDoW.html absorbed all functionality from mi_data_Sleep.html - the sleep calendar functionality and sleep timeline is available when you select Total Sleep metric. You will need to scroll down to see sleep timeline chart.
[B]v5.3 02/02/2015[/B]
Extraction package:
Add new column with number of walk time + run time in seconds (as per request)
Added new parameter ForceBackupMode to skip attempt at rooted extraction and go straight for backup mode
[B]v5.2 02/1/2015[/B]
Splitted program into data extract package and analytics packages. Data extract should be pretty stable now and reports could be updated independently.
Spanish translation (thanks to Viriatox)
[B]v5.1 01/31/2015 [/B]
Fix for incorrect sleep/wake hours calculation
[B]v5.0 01/31/2015[/B]
Localization setting is pulled from Mi database - no need to set it manually anymore (in most cases)
Two completely new reports - Sleep Report and Statistics by day of the week.
Fixes to unix shell script encoding.
[B]v4.0 01/29/2015[/B]
Month number calculation fixed.
Removed extra rows with zeroes that we incorrectly extracted
Localization moved to separate file, all other components are unified for all languages
Scripts for rooted and non-rooted phones combined into one.
Daily goals and data grouping added on main report.
Unix shell script for data extraction (thanks to jlaunay)
French translation (thanks to jlaunay)
[B]v3.0 01/26/2015[/B]
New script to support data extraction for non-rooted phones
Reverse sort order in table part of report, so newest dates are on top.
Week number and day of the week added to report.
[B]v2.0 01/25/2015 [/B]
All needed Windows binaries included in the package.
Batch file to automatically run all binaries to extract the data.
First report showing overall statistics.
[B]v1 01/24/2015[/B]
Initial release.
Syncronizing with fitnesssyncer.com
FitnessSyncer FAQ: https://www.fitnesssyncer.com/frequently-asked-questions
How to set up import and export.
1. Open account at fitnesssyncer.com/
2. On Dashboard, go to Sources and Destinations and select Add New Source
3. Select Type: Activity, source Amazon S3 (CSB), Dropbox (CSV) or OneDrive (CSV) depending on where your files are stored. Enter path and file name in Path field. Select highlighted columns mappings:
Activity:
Include Date (US) - Column 18
Include Activity - Column 19
Include Distance in Meters - Column 8
Include Duration in Seconds - Column 17
Include Calories Burned - Column 10
Include Total Steps - Column 9
4. Click on Save and authenticate into your cloud storage account.
5. Back on Sources and Destinations account, click on Sync Now link next to your newly added connection to confirm that it loads without errors. Click on Dashboard button and confirm that you see some data in charts there.
6. Go back to Sources and Destinations and select Add New Source again
7. This time, select Type: Sleep, same Source entry, same Path value and set up highlighted column mappings:
Sleep:
Include Date (US) - Column 18
Include Bed Time Hour - Column 20
Include Bed Time minute - Column 21
Include Awake Hour - Column 22
Include Awake Minute - Column 23
Include Sleeping Minutes - Column 2
8. Click Save, go to Sources and Destinations and click Sync Now on Sleep source now to see that it imports without issues.
9. Click on Stream option and see that you have both Daily Activity and Sleep data loaded.
10. Go back to Sources and Destinations and select Add New Destination Task
11. Select SyncType Activity and select Destination from the dropdown list
12. Repeat same steps for Sleep syncronization
Accessing your charts directly from Dropbox:
If you have a Public folder on your dropbox, you can copy all the .js and .html files there and get the shared url by selecting one of htmk files and selecting "Copy public link..." button. It would give you a URL that you can use from anywhere. You need to have Dropbox Pro account or free account created before October 4, 2012 for Public folder functionality to work on your dropbox.
Accessing your charts directly from Google Drive:
1. It is recommended that you create new folder in your Drive for this purpose.
2. Select the folder and Choose Share... option
3. On Share with others page dialog, click on Advanced button in bottom right corner.
4. On Sharing Settings dialog, click on Change... link at the top line of Who has access list.
5. On Link sharing dialog, select On - Public on the web option and click Save button.
6. Copy the URL that is shown on Sharing Settings page and click Done to close it
7. The URL that you copied will look something like the sample below. Copy just the alphanumeric sequence that is located between ?id= and &usp=sharing
Code:
https://drive.google.com/folderview?id=[B][COLOR="Red"]123-abcdcdefghijklmnopqrstUV[/COLOR][/B]&usp=sharing
8. Put www.googledrive.com/host/ before this string and /mi_data.html (or any other report) after it, you should get something like www.googledrive.com/host/123-abcdcdefghijklmnopqrstUV/mi_data.html - this should be your sharing link
Here is Google support page on sharing files/directories: https://support.google.com/drive/answer/2881970?hl=en
Using Helium backup instead of Android backup:
Helium produces .ab files that are ALMOST correct tar file, however besides extra characters on file header level they also have some differences in header entries for each file. I've looked through different methods and utilities and the best option so far is to use Helium_ab2tar.zip package (credit goes to xaos.cz for writing it and to johnny1176 for discovering it). It used to be available on xaos.ic.cz/Helium_ab2tar.zip, but that site is down now. You can still google for Helium_ab2tar.zip to find other locations that have copy of this file.
Plans for future versions:
Code:
0. Get more sleep :)
1. Titles for each chart
2. Implement dashboard comparing current week with previous statistical data. (For same days of week)
3. Use timeline component for right chart in data_byDow.htm
4. Show percentage of good days based on selected goals. Show min/max values for each metric.
5. Modify scatter chart to allow using any other series for X axis (Search/display correlations between sleep time and total number of steps).
6. Make a help page showing all the charts and how to use them.
7. Add ratio of deep/light sleep as part of selectable charts.
8. Merge all reports into single multi-tab document.
9. Parse detailed daily binary data - this is going to be a big one.
How to translate application to your language:
To add support for a new language:
For HTML pages
1. Open locale.js in editor supporting UTF-8 encoding.
2. Create a new section starting with
if (lang == "ru_RU") { }
and replace ru_RU with a locale string for your language.
3. Copy all strings from english version to inside { } brackets and translate the text.
4. Save file in UTF-8 encoding.
5. Add reference to your new language in comments section of config.js
For unix shell script:
For all subsequent entries, replace XX with 2-character locale name of your language
1. Create new po file using following command:
bash --dump-po-strings run.sh > po/XX.po
2. Edit newly generated file and translate msgstr entries using msgid entries as references
3. Save the file and generate new directory for the compiled langage file (.mo) using following command:
mkdir -p i18n/XX/LC_MESSAGES/
4. Compile .po file to .mo file by running following command:
msgfmt -o i18n/XX/LC_MESSAGES/mibandextract.mo po/XX.po
If you do not want to use the i18n folder and want the langage file to be system wide, you just have to comment (adding a #) the line "export TEXTDOMAINDIR=./i18n/" in the script.
Then you will have to move your po file to /usr/share/locale/XX/LC_MESSAGES/ (where XX is your langage).
Changelog:
v5.2 released on 2/1/2015.
v5.3 released on 2/2/2015.
v5.32 released on 2/3/2015
v5.7 released on 2/16/2015
v5.71 + fit v0.2 released on 2/21/2015
v5.8 + fit v0.3 released on 3/7/2015
v5.9 released on 3/14/2015
v5.92 released on 6/20/2015
Reserved
Hi.
Working perfect. Nexus 5 non-rooted.
Thank you very much for your work :good:
Grretings from Spain.
Hi,
It does not work for me at all ... All the time the same thing.
C:\Users\plmaciejewk\Desktop\miband_extract_v53>run
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Press "Backup My Data" button on device...
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
bin\tail: mi.ab: No such file or directory
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Could Not Find C:\Users\plmaciejewk\Desktop\miband_extract_v53\mi.ab
Could Not Find C:\Users\plmaciejewk\Desktop\miband_extract_v53\mi.tar
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Extraction failed
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Can I do anything with this?
I face the same issue as @macia10. I have rooted Nexus 5.
Dell112 said:
I face the same issue as @macia10. I have rooted Nexus 5.
Click to expand...
Click to collapse
I found a temp workaround. Edit rub.bat and remove all >> log from end of the lined. This causes the issue.
macia10 said:
Hi,
It does not work for me at all ... All the time the same thing.
C:\Users\plmaciejewk\Desktop\miband_extract_v53>run
The process cannot access the file because it is being used by another process.
The process cannot access the file because it is being used by another process.
Can I do anything with this?
Click to expand...
Click to collapse
This might be caused by adb process still running in memory and locking log file. I've modified script not to redirect output from adb commands into log file and also added few commands to kill previous adb service once extraction is complete. Could you please download v5.33 and see if it works?
xmxm said:
This might be caused by adb process still running in memory and locking log file. I've modified script not to redirect output from adb commands into log file and also added few commands to kill previous adb service once extraction is complete. Could you please download v5.33 and see if it works?
Click to expand...
Click to collapse
works perfectly
Thanx!!
Thanks, very useful!!
FYI, I needed to make some modifications to make it work in my case:
- In 'run.sh', I had to modify the SDPath variable to the correct path (in my version of Cyanogenmod):
SDPath=/storage/sdcard0
- run.sh log indicated a "permission denied" error. It was caused because adb did not have root privileges in my android. To correct it:
In Android: Settings > Administrative access > Select "Applications and ADB"
- sqlite3 in OSX is an old version, so run.sh complains with:
Error: unknown command or invalid arguments: "once". Enter ".help" for help
Error: unknown command or invalid arguments: "print". Enter ".help" for help
To solve it, install a new version of sqlite3. For example using brew:
> brew install sqlite3
and replace sqlite3 in run.sh for the brew version: /usr/local/Cellar/sqlite/3.8.6/bin/sqlite3
- Files from: miband_analytics need to be in the same folder than miband_extract
With these modifications it is working properly in my mac.
Keep up the good work!
Hi.
I'm extracting data with Bonoboo Mi Band Export Stats, which exports to sd card the files:
app_locale.js; config.js; extract.js; locale.js; Mi_Band_Table.csv; Mi_Band_Table.html and Mi_Band_Graphs.html.
In order to used that exported data with your analytics tools, which files should i move to your folder which contains multiple files like mi_data_byDoW.html and mi_data.html ?
Thanks
herpez said:
Hi.
I'm extracting data with Bonoboo Mi Band Export Stats, which exports to sd card the files:
app_locale.js; config.js; extract.js; locale.js; Mi_Band_Table.csv; Mi_Band_Table.html and Mi_Band_Graphs.html.
In order to used that exported data with your analytics tools, which files should i move to your folder which contains multiple files like mi_data_byDoW.html and mi_data.html ?
Thanks
Click to expand...
Click to collapse
You'll just need at app_locale.js and extract.js. The folder with analytic tools already has config.js and locale.js and CSV file is not required for analytic tools, you only need it if you want to see your data in Excel.
SynerG said:
Thanks, very useful!!
FYI, I needed to make some modifications to make it work in my case:
- In 'run.sh', I had to modify the SDPath variable to the correct path (in my version of Cyanogenmod):
SDPath=/storage/sdcard0
- run.sh log indicated a "permission denied" error. It was caused because adb did not have root privileges in my android. To correct it:
In Android: Settings > Administrative access > Select "Applications and ADB"
- sqlite3 in OSX is an old version, so run.sh complains with:
Error: unknown command or invalid arguments: "once". Enter ".help" for help
Error: unknown command or invalid arguments: "print". Enter ".help" for help
To solve it, install a new version of sqlite3. For example using brew:
> brew install sqlite3
and replace sqlite3 in run.sh for the brew version: /usr/local/Cellar/sqlite/3.8.6/bin/sqlite3
- Files from: miband_analytics need to be in the same folder than miband_extract
With these modifications it is working properly in my mac.
Keep up the good work!
Click to expand...
Click to collapse
Thank you for your feedback.
Regarding SDPath, I'll put a a more clear explanation that SDPath may need to be changed depending on device.
For ADB privileges, the way you had to enable it might be specific to your Android version (I've granted permissions in a different way on my phone), but generally speaking the application should work through Backup logic even when adb has no root permissions.
For sqlite3 issue, could you please tell me which version of sqlite3 OSX has by default, so can add a note in instructions about version compatibility?
Regarding same folder location, I think there is already a mention about the need to have both packages exptracted to the same folder.
xmxm said:
Thank you for your feedback.
For ADB privileges, the way you had to enable it might be specific to your Android version (I've granted permissions in a different way on my phone), but generally speaking the application should work through Backup logic even when adb has no root permissions.
Click to expand...
Click to collapse
I got a message in my Android asking for permission to do the backup, but at the same time I saw the "permission denied" message in the console. Maybe I got both because the script tries to get data from two different mechanisms. Even if I clicked yes to do the backup, the script was not able to get the data until adb was granted permissions.
For sqlite3 issue, could you please tell me which version of sqlite3 OSX has by default, so can add a note in instructions about version compatibility?
Click to expand...
Click to collapse
My Mac with OSX 10.9 (Mavericks) had installed sqlite3 version 3.7.13. I think that the required commands were added in 3.7.15, but I could be wrong. Brew has installed 3.8.6 and is working properly.
SynerG said:
I got a message in my Android asking for permission to do the backup, but at the same time I saw the "permission denied" message in the console. Maybe I got both because the script tries to get data from two different mechanisms. Even if I clicked yes to do the backup, the script was not able to get the data until adb was granted permissions.
Click to expand...
Click to collapse
Windows version supports ForceBackupMode=Y setting to skip root-specific method and go straight for backup method, but I guess that run.sh is outdated by now - I'll need to find a way to copy newest logic changes to unix script. I still think hope that giving ADB root is not mandatory for extract to work.
My Mac with OSX 10.9 (Mavericks) had installed sqlite3 version 3.7.13. I think that the required commands were added in 3.7.15, but I could be wrong. Brew has installed 3.8.6 and is working properly.
Click to expand...
Click to collapse
Thank you for this information - I'll put version numbers in the header.
xmxm said:
Windows version supports ForceBackupMode=Y setting to skip root-specific method and go straight for backup method, but I guess that run.sh is outdated by now - I'll need to find a way to copy newest logic changes to unix script.
Click to expand...
Click to collapse
You will find attached a zip with a new version of run.sh.
run.sh now support ForceBackupMode and internalization.
Thats why I add 2 folders (po and i18n).
If you want to add support for a new langage, let's say spanish for example, you will first have to create a new po file
Code:
bash --dump-po-strings run.sh > po/es.po
Then edit the file newly created with any text editor and translate the "msgid" with the "msgstr"
Once done, you have to create a new directory for the compiled langage file (.mo)
Code:
mkdir mkdir -p i18n/es/LC_MESSAGES/
Then compile the file with
Code:
msgfmt -o i18n/es/LC_MESSAGES/mibandextract.mo po/es.po
For another langage replace "es" with the one you want.
If you do not want to use the i18n folder and want the langage file to be system wide, you just have to comment (adding a #) the line "export TEXTDOMAINDIR=./i18n/" in the script.
Then you will have to move your po file to /usr/share/locale/XX/LC_MESSAGES/ (where XX is your langage).
Version updated to 5.5 with better support for FitnessSyncer and some chart updates
Good Work
xmxm said:
Version updated to 5.5 with better support for FitnessSyncer and some chart updates
Click to expand...
Click to collapse
Thanks for your work!!!

[share] bloatware - uninstaller [no root] [adb]

(Found this tool in a youtube description box)
Basically this tool is used to uninstall any bloatware through adb, doesn't requires root access, doesn't block OTAs
Requirements: 1) This Tool - https://goo.gl/6qtRKR 2) ADB : https://forum.xda-developers.com/showthread.php?t=2588979 3) USB DEBUGGING ENABLED 4) ES FILE EXPLORER (optional)
Just after setting up with usb debugging (tapping build number 7 times, going to developer options, enabling usb debugging), connect your phone to pc ensuring that adb setup is installed on your pc. Run the tool, enter the package name (of that apk) (using es file explorer)
Credits: Respected DEVELOPER(S) :good:
Tool doesn't need ADB separately as it is bundled with it.
For those who are suspicious about exe, download the BAT file(command script) from attachment. Place it in ADB folder and run it to get same functionality as the tool.
If we're removing bloat from /system, doesn't that mean we're messing with the ability to flash OTAs as the OTA checks for /system integrity and if it has been modified or not, doesn't it?
Please do correct me if I'm wrong
psychopac said:
If we're removing bloat from /system, doesn't that mean we're messing with the ability to flash OTAs as the OTA checks for /system integrity and if it has been modified or not, doesn't it?
Please do correct me if I'm wrong
Click to expand...
Click to collapse
You are disabling apps. It doesn't affect OTA unless you make the system crash....
Arugakeerthi said:
You are disabling apps. It doesn't affect OTA unless you make the system crash....
Click to expand...
Click to collapse
Disabling or removing because we can also disable apps from the Settings as well but if this is something different, please let me know
psychopac said:
Disabling or removing because we can also disable apps from the Settings as well but if this is something different, please let me know
Click to expand...
Click to collapse
You can disable any app. Even System UI

Extreme Debloat Guide! (root needed) *205 apps debloated*

Hello!
As im quite a big fan of keeping stuff clean and simple, i always try to debloat my devices heavily.
My Tab being no exlusion! As i tried to create a custom rom and didnt succeed i searched for other ways..
You might all know the "Package disabler Pro" app, which i used for quite some time but it only disables
apps and services.. But then i found quite a nice solution!
This nice magisk module! :highfive:
So here is how to use:
1. Install magisk
2. Launch magisk and search for "debloater" and install the module
3. Reboot
4. Open a terminal app of your choice (im using Termux) and type "su" to get root access
5. Type "debloat"
6. Now its up to you, either you
a) debloat yourself and type in "1" to debloat apps and "2" for priv-apps
b) take my exported debloat list (attached), and put it in /cache with a root explorer of your choice, and repeat step 4&5.
Then there is a new command for importing the config file, type i.
7. Reboot :angel:
8. (optional) Get SD Maid, go to settings and select the 3rd option (something like corpse finder) and tick all the categories.
Then run the first 2 free tasks in overview. There are a lot of leftover files that the system doesnt need anymore after the
corresponding apks have been removed, so the system will be must cleaner afterwards. :fingers-crossed:
With this method the apps get "uninstalled" magisk, which means only the apks will be hidden from the system.
One big advantage of this is, that one can always simply reenable all of the debloated apps, just untick the magisk module in
the magisk manager.
If you only want to get specific apks back, start terminal, su, debloat and type in 4 to reinstall uninstalled apps.
Feel free to ask me which apks you need for what kind of app. Im by no means a pro but ill try my best to help.
My debloat list *'should* be safe, didnt have any crashes or not working features after deleting. Just note that samsung account related
features such as samsung cloud or the keyboard wont work anymore since im rather a fan of google apps.
If you have anything to add or improve, just tell me and ill integrate it in the OP. :highfive:
Hi! Thanks for your work. For some reason the text file u provided is autodetected but then I receive invalid file message. Any idea why?
Thanks for posting this... I will give it a try when I'm rooted
Having some issue importing the file attached...
Code:
=========================================
Import Config ===========================
=========================================
Import from a txt file exported from this module
Be careful importing from unknown sources!
=========================================
/cache/import-debloat.txt detected! Leave blank and enter to use it.
Enter the directory of the import file
Example: /sdcard/import-debloat.txt
>
Importing from /cache/import-debloat.txt...
Invalid file
Done
Return to menu? < y | n >:
Do you happen to have a newer config? The current one posted no longer functions (is invalid format).
Samsung Galaxy J8 Debloat 226 Packages - NO ROOT (Android 9 Samsung)
github.com /minhthienmap/j8y18lte_stable_packages
Remove Space
I contribute more bloatware for android 9 in galaxy j8
But it similar to galaxy s10
Do you guys by any chance know which app is related to the "Secure startup" feature (which encrypts your device) so I don't disable it by accident?

How To Guide How to root and pass SafetyNet on XQ-BT52 62.0.A.3.163

How to root and pass SafetyNet on Sony Xperia 10 III (XQ-BT52)​Tested on firmware 62.0.A.3.163.
Disclaimer:
This guide assumes you're familiar with the concepts of rooting, Magisk, SafetyNet, fastboot, adb and so on. I will explain why things are done but if I explained everything it would become too long.
This guide is limited to getting root and apps working on the stock Sony ROM. It doesn't cover installing other ROMs.
You can mess up your phone if you don't know what you're doing. This is not a beginner's guide.
Before you do anything else, do these preparations:
Make sure your device is updated to the latest firmware. Getting updates after you unlock the bootloader will be more complicated.
Use XperiFirm to grab a copy of your current firmware (after you've updated it). It can run on Linux too, either via Mono or in a virtual machine. It's basically just a downloader, it doesn't need any fancy hardware access.
Screenshot everything under Settings > System.
Open the dialer and enter *#*#7378423#*#*. Screenshot everything in the service submenus.
Unlock developer options (tap Settings > About > Build number 7 times) then find it under Settings > System > Advanced. Activate USB debugging. Activate OEM unlocking.
Install the Android SDK Platform Tools. On Linux they're most likely in a package provided by your distro.
Copy the screenshots to your PC because the phone will be reset at some point.
Boot into fastboot by turning the phone off, then connect it to PC via USB, and press POWER and VOLUME UP together. The phone led will turn blue. On PC run fastboot devices and make sure it lists your phone and has the serial number you got from the service menu.
Unlocking the bootloader:
This is the point of no return as far as warranty is concerned!
This will factory reset the phone! Make sure you got everything you needed off it.
Obtain the unlock code (you will need the IMEI of the 1st SIM slot).
Boot into fastboot, check again that fastboot devices lists the phone.
Issue the unlock command using the code you got earlier: fastboot oem unlock 0x<unlock code here>
Reboot the phone (you can say fastboot reboot). It will say "can't check for corruption" and "erasing" a couple of times but will eventually boot up to the factory setup.
Enabling Magisk & root:
Download the latest Magisk apk to the phone and install it. Right now that means v24+.
Open boot_X-FLASH-ALL-8A63.sin from the original firmware with any archive manager (it's a tar.xz), 7zip will work fine.
Extract boot.000, rename it to boot.img and put it on the phone.
Open the Magisk app, next to "Magisk" tap "install", choose "Select and patch a file", pick the "boot.img" file.
Download the patched img to PC (will be next to boot.img called something like magisk_patched-24100_MKPRJ.img).
Boot into fastboot, check again that fastboot devices lists the phone.
Flash the patched boot image: fastboot flash boot magisk_patched-24100_MKPRJ.img
Must say OKAY. Can then reboot the phone (you can say fastboot reboot).
Open the Magisk app again, it should say "installed" now next to "Magisk". Also the Superuser and Modules buttons should now be enabled.
Go into Magisk settings and activate "Hide the Magisk app". This is NOT MagiskHide, it does not hide Magisk from other apps, it hides the Magisk Manager app from other apps. More on this later.
Go into Magisk settings and activate Zygisk. This is a built-in replacement for Riru going forward.
Reboot!
Install a root checker app and verify that you get a prompt from Magisk to give root and that the checker says it got root.
Important changes about Magisk:
Riru is now obsolete. It has been replaced by a feature built-into Magisk called Zygisk (which is essentially Riru running in Zygote). It is strongly recommended to go into Magisk settings and activate Zygisk (even if you don't use Riru modules). Do not install Riru anymore. All modules that needed Riru should have Zygisk versions by now unless they're abandoned.
Magisk no longer maintains a module repository, To find and install modules install Fox's Magisk Module Manager. It's a dedicated module management app that supports the old Magisk repo as well as new ones. Inside Magisk you can still enable/disable/remove/install manually and can also update if the module has an update URL, so you can do without Fox if you get your modules directly from their XDA or GitHub pages.
MagiskHide has been replaced by a new feature called Deny list (it's in Magisk settings). It's much more powerful because the apps & processes added to the deny list will be completely excluded from anything based on Magisk so it's impossible for them to detect leaks anymore. On the downside, excluded apps can't be affected by any Magisk or LSPosed modules (LSPosed will grey out such apps and say "it's on the deny list".) This feature should be used sparingly (see below) because Magisk still does a good job of evading detection.
Passing SafetyNet:
Install YASNAC to check your SafetyNet status. At this point you're probably not passing either Basic or CTS check.
Go into Magisk settings. Enable "Enforce deny list". Enter "Configure deny list", find Google Services, check it, expand it, and select only the process ending in .gms and the one ending in .gms.unstable.
Reboot. Check YASNAC. At this point you should be passing Basic check but probably not CTS.
Install Universal SafetyNet Fix (aka USNF) by kdrag0n in Magisk. (Some GIS ROMs already include what this module does, so if you install a GIS ROM you may not need it.) This module hijacks the CTS verification and drops an error which causes the Google service to fall back to Basic verification, which we already fixed in the previous step.
Reboot. Check YASNAC. At this point you should be passing both Basic and CTS. That's it!
You may need to clear storage & cache for Google Play & Services. Go to Settings > Apps & notifications > See all apps, select "All apps", find them in the list, clear storage/cache and reboot. After that try searching for a restricted app such as Netflix on the Play store, if it shows up in results you're all good.
Remember to also add to deny list other apps that try to detect if you're using root, like banking apps.
Other SafetyNet related fixes:
People using non-stock GIS ROMs will probably need module MagiskHide Props Config by Didgeridoohan. This will install a props command line util that you can use (as root) to force Basic attestation, apply extra Magisk hiding techniques, spoof device fingerprint, change the way fingerprinting is checked, or even impersonate another device altogether. Install, reboot, enter adb shell, type su to go root (will need to grant root to shell on the phone when prompted), then run props and follow the options.
People running extra-stubborn banking apps (or other apps that try to detect root extra-hard) that don't work even when added to the Magisk deny list can try module Shamiko by LSPosed. This module adds extra hiding techniques for the apps on the deny list. Please note that Shamiko will disable the Magisk "enforce deny list" option but that's ok, that's an extra feature, the deny list is in effect even without it.
Working apps and modules​Please note that this list is limited to stuff that I personally use. I can't and won't install other stuff to test it.
Root apps:
AFWall(+): Works, but configure it to use its own internal busybox and iptables. Applying rules fails occasionally and you need to retry.
Call Recorder by skvalex: Recording works out of the box, no fiddling required with either headset of mic recording.
JuiceSSH, Termux etc. and other terminal apps: No issues getting root with su.
Busybox: you can install zgfg's module which exposes Magisk's internal Busybox to the rest of the system (bonus: will be updated with Magisk); or you can install osm0sys's module which contains a standalone separate Busybox. As of now both of them provide Busybox 1.34.
MyBackup Pro: Works fine. Used it to transfer 15k+ SMS messages from Android 8.
Solid Explorer: Can access root partitions without issues.
Tasker: No issues.
Titanium Backup: Works but will hang when restoring APKs whose target API doesn't support the ROM's Android version (ie. APKs you can't install directly either).
OAndBackupX: Modern alternative to Titanium, works perfectly.
XPERI+: Version 6 works well and allows you to remap the assistant button and has another couple of features. Version 7 crashes.
Magisk modules:
AFWall Boot AntiLeak
Backup
Builtin BusyBox
Magisk Bootloop Protector
MagiskHide Props Config
Shamiko
SQLite for ARM aarch64 devices
Systemless Hosts (comes with Magisk, enable it in settings)
Universal SafetyNet Fix
Zygisk LSPosed
LSPosed modules:
App Settings Reborn: Works well. May require a couple of reboots before the targeted apps start showing the modifications.
Disable Flag Secure: com.varuns2002 is working, sort of. Please read the module's page. Apps got wise to rooted devices ignoring FLAG_SECURE so now they use hardware DRM or detect screenshots and show you something else (Netflix). So it works only in older versions of apps, or apps that haven't bothered to detect screenshots.
GravityBox [R]: Everything I tried works perfectly.
Physical Button Master Control: The module works as intended, the companion config app has some issues, hopefully they'll be solved soon.
XPrivacyLua: Works perfectly. No issues with SafetyNet.
Not working:
...
Other tested and working Root Apps:
AdAway
Fox's Magisk Module Manager
Franco Kernel Manager
Termux
Not testet yet:
Call Recorder
FolderSync
Total Commander
Vanced Manager
WireGuard
Other tested and working Magisk modules:
1Controller - 1 Module to support all Controllers
Call Recorder - SKVALEX
F-Droid Privileged Extension
Move Certificates (version by Androidacy)
Other tested and working LSPosed modules:
BubbleUPnP AudioCast

Categories

Resources