Monitor system file changes (root) ? - Android Q&A, Help & Troubleshooting

Checked posts / searched for an existing answer... didn't see anything (please move this post if it is in the wrong section)
So I have a app, when I open it asks me what Google ID to uses (preferred ID) but after selecting a Google ID I can not change to a different ID
- If I clear the App Cache the selected ID persists
- If I clear the App Data the selected ID clears and the app returns to the select ID option
- I keyword searched for the App name on my device (Nexus 5x)with Root Explorer (12 different file locations, with subfolders and a bunch of empty folders)
Clearing App Data is a working interim solution, the downside is that every time I clear the App Data the app "downloads assets" (40mb+ ~40 times per day - 1.6Gb!)
What I am hoping to find is a app / script / terminal / log solution that will tell me what file is being modified when I select the Google ID, so I can delete that file re-open the app and change Google Logon
(I contacted the app developer, they said they may be able to fix the problem on the next patch eta 12-24 months)
So I have tried these apps:
https://play.google.com/store/apps/details?id=file.observer
https://play.google.com/store/apps/details?id=scd.lcex
https://play.google.com/store/apps/details?id=eu.thedarken.sdm
But I didn't see system changes (root level) or I didn't know what to look for in LogCat
Any help or suggestions are appreciate!
- I do not have a computer with me (ADB) will be about 7 days before I can try that
- I have been experimenting with deleting files / folders and testing to see if I get lucky (probably not the best method)
- I am not a developer

My current process (as of today) - I clear the app data, then restore the app data with TB (just restoring doesn't clear the sign in status)
As long as my TB backup is "always" in the signed out state, then the "app assets" restore with no issues (and I don't have to keep downloading them)
I am looking for a way to get these (2) operations into a single script / file / shortcut, but it is working for now
I did try the terminal with cp -a (copy the assets - app had a error on library permissions when the files were restored) chmod, chown, and find (try and locate the file) but had minimal success

Related

Clockworkmod restore on multiple phones and Android ID

It seems that clockworkmod backup / restore provides an excellent way to create a master configuration (with many programs installed and a lot of detailed settings, but nothing special or protected) which can then be restored on many phones - EXCEPT for a few problems related to Android ID!!!
In more details - it seems that the Android ID and a few other settings derived from that are also cloned and (for the moment) there is no simple way to fix things - as far as I could find all seems (???) to be confined to a database file located in:
/data/data/com.android.providers.settings/databases/settings.db
where in the sqlite3 table called 'secure' there are 3 entries of interest:
_id 51 name android_id value XXXXxxxxxxxxxxxx
_id 57 name wifi_p2p_ssid value Android_XXXX
_id 200 name wifi_p2p_device_name value Android_XXXX
I did try to "adb pull" the file, edit it on PC with SQLite Expert Personal and then "adb push" the file back and then restart the phone but it seems something is not working as expected - the Wi-Fi Direct name does not always seem to change and even more strange I can see some very weird things taking place with other settings (for instance related to lock screen and other stuff) apparently changing "by themselves" when the phone goes to sleep :crying:
Any idea or suggestion on how that can be achieved?
Does the Android ID has any "internal CRC" in the 64-bit value encoded there?
For the moment my tests have been done using a CrisKelo ROM and siyah kernel but I don't think that is essential to the story.

[Q] Media Storage issue

This is very frustrating... expert help needed. I have a Samsung Fascinate running AOKP JB 4.2.1 under a clean install (...formatted my system, data, datadata, cache & dalvik prior).
On phone startup, "media storage" seems to scan all internal audio files. The audio list exists... but after a while, the list just disappears and I no longer can choose my ringtones, music, etc. from any application depending on "media storage". I found out the list of media files are in the "internal.db" database under /data/data/com.android.providers.media/databases. So I cleared the "media storage" data, restarted the phone, n observed the folder contents...
On startup, "internal.db" shows up @ ~100 kb and doesn't change in file size. What does change in size is the accompanying wal-file, "internal.db-wal". According to sqlite.org, the wal-file will maintain the audio list and commit it to the database "internal.db" after so many records. Yet, at some point this wal-file drops from ~700 kb of records to 0 kb... no idea why. This is when i can't access my music.
For a long time, this wasn't an issue. I believe the records from the wal-file were already successfully committed to the database. Then I must've cleared the data (for some reason), thereby having "media storage" rebuild the database from scratch... and ultimately revealing an issue with the wal-file. I've even uninstalled the "media storage" package "mediaprovider.apk" from /system/app via TitaniumBackup. Rebooted. Then reinstalled the apk to /system/app. Rebooted. Same issue happens! All else is working perfectly.
I'm no sqlite expert, but is there some way i can force the wal-file to commit? Any other advice? Yes, I googled all i could think of. And i'd like to avoid reinstalling my ROM. Your help is greatly appreciated.
[EDIT]
Found a workaround...
1 - Delete the contents of the folder /data/data/com.android.providers.media/databases.
2 - Reboot and wait ~5 min after startup to let the media store reindex all ur media. DO NOT configure any app's ringtones/sounds just yet.
3 - In terminal, enter the following commands. You should see "x | y | z" after the checkpoint command... where x is 0 (database is ok), y is the number of modified pages, and z is the number of pages successfully committed to the database. y and z should be equal and much greater than 0. If the result is not as described, the database is probably screwed up and u were too late. Go back to step 1 and repeat.
$ su
# cd /data/data/com.android.providers.media/databases
# sqlite3 internal.db
> pragma wal_checkpoint(FULL);
> .exit
# exit
$ exit
4 - Trust the workaround and start configuring ur ringtones/sounds now... or reboot again and ensure the media store database stays fixed. I recommend the latter.
5 - 3 sir!
[/EDIT]

[HOWTO] Sync Activities with ANY service and even get VO2max for ANY watch

Requirements:
AmazeBackup: https://forum.xda-developers.com/smartwatch/amazfit/utility-amazebackup-backup-tool-pace-t3801165
FitnessSyncer.com account;
DropBox / GoogleDrive / OneDrive account (it will be used by FitnessSyncer to automatically sync new data when it is extracted from watch);
Runalyze.com account: it will get data from FitnessSyncer and calculate VO2max (run activities only), it's optional;
Know how to read and install/configure simple software on computer.
It works with ANY watch (Pace/Stratos/Verge), ANY firmware (unlocked or not) and ANY computer (macOS/Linux/Windows).
Download and install AmazeBackup, connect watch to computer and run option #12 (export data), it should create a folder named "export" inside its main folder;
Install and login to DropBox/GDrive/OneDrive, configure it to sync data from the "export" folder above (here you have to know how to do it by yourself, it varies from software to software, computer to computer, user your brain and tutorials from help pages and the internet);
Login to FitnessSyncer, open your account page and add a new *Source* (image 03);
Add your online service (DropBox/GoogleDrive/OneDrive) as "Maps", set "File Type" as GPX, grant permission and point to the folder in your online storage service that will sync the "export/gpx" folder (image 04 - standard Advanced Options settings should work, but you may want to change them if you find any problems with multiple data sources later);
OPTIONAL: Do the same for the TCX folder if you also want to sync non-GPS data, obviously setting "File Type" as TCX and pointing to "export/tcx" in your online storage;
In order to get VO2max calculation, you must sync to Runalyze, then go to Account page and add a new *Destination*, then fill the data and grant permissions accordingly (image 05);
OPTIONAL: If you want to sync data with other services like Endomondo or whatever you use, go back to you Account page and add new Destination, then fill the required fields in "Synchronize with Service" (image 06).
Both FitnessSyncer and Runalyze have an extensive help, read them before asking questions. I like the way Runalyze shows data, but if you just want to concentrate all your activities in one place, FitnessSyncer may be enough, it even has a phone app for both Android and iOS.
That's it, every now and then, after new activities, connect the watch to computer and run AmazeBackup option #12 again, new data should be uploaded to your online service and synced automatically via FitnessSyncer and your preferred online storage service.
All services and AmazeBackup are free, please donate to keep then running and their developers happy.
https://ko-fi.com/lfomartins
Or use XDA's donate link under my username. Thanks!

adb shell in recovery: 'pm list packages' fails from console

I wasn't paying attention to what I was doing after updating some apps, and froze some some application that is necessary, now my CATS60 will not boot. The app likely just uses the disable or hide command, but I am not sure what I misclicked, so I need to get a list or currently disabled apps or reenable all apps. I entered TWRP recovery, mounted all partitions, and connected through ADB shell.
This is what I get when I try to find out what's enabled/disabled:
Code:
# pm list packages
CANNOT LINK EXECUTABLE: library "libqc-opt.so" not found
page record for 0x7fb1658010 was not found (block_size=64)
adbd is running as root, and the file does exist:
Code:
~ # find / -name 'libqc-opt.so'
/system/vendor/lib/libqc-opt.so
/system/vendor/lib64/libqc-opt.so
I am using TWRP as recovery, and recovering system, data, and boot from backup does not fix this.
Does anyone know either
How can I make pm command work from recovery?
Where is the list of disabled apps stored, so I can manually edit it?
Thank you.
I found the list as used by the app (com.ramdroid.appquarantine), and it appears I blocked Google Calendar. However I have not found any way to "unfreeze" the app through recovery, this is simply a tracking file the app uses, not the actual enable/disable for Google Calendar.
Setting PATH and LD_LIBRARY_PATH environment variables does not help. Running it from inside the folder containing libqc-opt.so causes it to fail on a different external link.
Copying it to a second file called pm2, opening in vi and adding exports gets me as far as:
Code:
CANNOT LINK EXECUTABLE: cannot locate symbol "__android_log_close" referenced by "/system/lib64/libandroid_runtime.so"
Is it possible to chroot inside adb, and what do I need to mount first in order to do so? I don't know enough about Android to know which parts of the system I actually need.

What are MIUIOP?

If anyone knows descriptions to miuiop please share, I'm curious what they do.
What App Ops does is allow a user to revoke an individual permission for an app. When the app then starts and tries to make an Android system call to access something that the user has now forbidden then Android will return an error and won’t grant access to that data or functionality.
As you can see there are several numbers starting with 100xx. These are the app IDs (UID = user IDs) the system is dealing with. Every app has a corresponding UID which is needed for file permission rights. Example: If only a certain app (UID 10666) has the permission to open a certain folder, the folder will be restricted to u0_a666 (=user 0, that's you, + app UID 10666)
Usually the first UID slots 10001, 10002, ... are system apps since they get started first upon an initial boot of your device. I assume that MIUIOP belongs to the MIUI optimization, but not sure about that. But you can figure it out with the help of the UIDs:
Apk Analyzer - Apps on Google Play
Detailed reports of the applications on your device. 📱
play.google.com
Selecting an app shows you its UID. Unfortunately it doesn't show you the UID in the app's list directly.
So the uid number could be different across different miui versions… unlike standard appops which are the same regardless of device?
Posting a list of the apps just because:
10008 com.miui.core.internal.editor.services
10017 - com.miui.systemui.overlay.devices.android
10020 - com.android.theme.font.notoserifsource (Noto Serif / Source Sans Pro)
10026 - com.android.internal.systemui.onehanded.gestural (One Handed Mode)
10033 - com.android.overlay.gmstelephony
10036 - com.android.systemui.gesture.line.overlay
10037 - com.miui.systemui.carriers.overlay
The app UIDs are assigned ongoing by your system on first boot (for system apps) or after installation (for user apps). Example: The first app you install on your device gets the UID 10201 then the second one gets 10202 and so on. It doesn't depend on your MIUI version or sth like this.

Categories

Resources