View Single Post
Old 02-08-2020, 02:47 PM   #17
Peripathetic
Enthusiast
Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.Peripathetic composes epic poetry in binary.
 
Posts: 38
Karma: 90402
Join Date: Feb 2019
Device: Tolino Shine 3
Removing System Crash Reporter (and Making Other Filesystem Changes)

Android devices usually come with a plethora of bundled applications nobody ever asked for that cannot be uninstalled, stuff that keeps running in the background, unnecessarily draining battery and perhaps also compromising privacy.

The Tolino is not a particularly bad offender in this aspect but there is at least one application, called System Crash Reporter, that seems to serve no benefit to the user, and it might not be a bad idea to get rid of it. These steps will also illustrate how to make any other changes to the filesystem.

Removing System Crash Reporter

All the persistent operating system files are stored on the /system partition. It is possible to modify these files while the operating system is running but even though we already have superuser access via ADB, the partition is mounted read-only, so we must remount it for reading and writing first:
  • Remount the system partition read-write:
    adb shell mount -o remount,rw /system
Alternatively, we can reboot to recovery mode but then we have to make sure the system partition is mounted:
  • Reboot to recovery mode:
    adb reboot recovery
  • Mount the system partition (likely to be mounted already, so an error is expected):
    mount /system
At this point, the application can be deleted. It's just a single file:
  • Delete the System Crash Reporter application package (APK):
    adb shell rm -f /system/app/systemcrashreporter.apk
Note that any leftover files on the /data partition are automatically removed by Android so we don't have to deal with that. Afterwards, if you deleted the application from a live system (not rebooting into recovery mode) and want to keep using the device without rebooting, it's a good idea to remount the /system partition read-only again (in any case, the partition will be mounted read-only again after a reboot).
  • Remount the system partition read-only:
    adb shell mount -o remount,ro /system
How to Know It Was There

How could you know that this particular APK was there if I haven't told you? There are couple of ways:
  1. List the filesystem contents:
    adb shell ls -laZ /system/app/
    -rw-r--r-- root root u:object_r:system_file:s0 systemcrashreporter.apk
    This is good as long as you know that applications are stored in /system/app (and /system/priv-app).
  2. List the filesystem contents recursively:
    adb shell ls -laRZ /system/
    Better if you have completely no idea what's where but it's lots of output so you can pipe it through a filter or save it to a file:
    adb shell ls -laRZ /system/ | more
    adb shell ls -laRZ /system/ > ls-system.txt
    Note: the -l and -Z flags list permissions, ownership and security contexts.
  3. Query all installed packages and their installation locations with Android Package Manager:
    adb shell pm list packages -f
    /system/app/systemcrashreporter.apk=de.inovex.android.system.c rashreporter
  4. Look into the update.zip file as all the files that exist on the /system partition come from there.
Files can be copied to (pushed) and from (pulled) device with adb push and adb pull. Available commands for adb shell include standard UNIX shell utilities and some Android-specific commands like the pm (Package Manager) and am (Activity Manager) mentioned before.

If you are modifying or copying new files, you should make sure they have the correct metadata set: use chown, chmod, and chcon to change ownership, permissions (mode) and security contexts respectively.

Applications can be installed with adb install.

More information about these and other commands is available in the Android documentation.

Some Other Points of Interest Around the Filesystem
  • /system/app/EPubProd.apk
    The main Tolino application (launcher, reader, browser), to be discussed later.
  • /system/fonts/*.{o,t}tf
    As the name suggests. The Bariol font files are here too but note that the font used to show the book list is the one inside the EpubProd.apk itself (more on that later).
  • /system/etc/fallback_fonts.xml
    /system/etc/system_fonts.xml
    If you are installing any custom font files, you might also want to change the font mappings here.
  • /system/media/preinstalled
    The stuff that gets copied to your user data on first use: the Tolino manual and maybe a complimentary book, depending on your language version, and also files for the point-of-sale (POS) demo, occupying nearly 50MB in total as you can find out with adb shell du -sm /system/media/preinstalled
    Most of it can likely be safely deleted if you need more space, for example to install own apps as system.
  • /system/media/bootanimation.zip
    The square dot moving from left to right when the Tolino is starting can be replaced with something else by modifying this file.
  • /system/usr/sleep/drawable-nodpi/suspend*.jpg
    Default images to display when the device is suspended but they're apparently not being used, overriden with what's inside the APK (or changed in the settings).
  • /system/build.prop
    Build properties. A way to identify the device and operating system version, also some low-level configuration can be changed here. Note that there's also the file /default.prop, which we edited earlier in the boot image: this, or anything else in the root directory (/) cannot be modified on a running system.
  • /data/misc/wifi/wpa_supplicant.conf
    You can configure Wi-Fi networks by editing this file, just remember to restore the correct permissions.
Peripathetic is offline   Reply With Quote