141
Caches Explained

  1. Tiwi1990
    Ice Cream Sandwich Sep 6, 2018


    #41
  2. anupritaisno1
    KitKat Sep 19, 2018

    anupritaisno1 , Sep 19, 2018 :
    M8 listen

    A script file is NOT put in /cache. The main reason is that the bootloader needs to pass the location of the ROM zip to the recovery partition as an argument while booting it and the bootloader doesn't have a driver to natively open an ext4/f2fs formatted filesystem. The functionality you're describing is actually handled by a kernel module called uncrypt and the misc partition handles this, not the cache partition

    What you have said isn't entirely wrong however. Custom ROMs merely tell the bootloader to boot TWRP without going through misc and put an openrecoveryscript in /cache. However as of nougat most ROMs abandoned the practice and now use the misc partition just the way AOSP does

    The cache partition cannot store anything and is useless when booted into android. Selinux blocks all apps from writing, reading, opening or even doing anything in cache at all. The main reason is that the cache partition cannot be encrypted so anything going into that partition is serious information disclosure

    The cache partition has just one purpose and it has nothing to do with android. The recovery puts crash logs into this partition if the recovery crashes. During a system update, raw data is copied from your system, vendor or any other partition to cache, the raw data is then patched and then the patched blocks are mirrored back to the respective partition. That's what cache does
     

    #42
  3. elanglois
    Lollipop Sep 19, 2018

    elanglois , Sep 19, 2018 :
    First, I'm not your m8.

    Second, openrecovery scripts ARE placed into the /cache partition since I've done this myself. Misc is used to tell the bootloader to boot recovery rather than the android system, but the script to automate the flash process goes on cache. All other partitions are suspect to being overwritten by recovery.

    Encryption has nothing to do with any of this. It's not part of the issue at all. I am not talking about system OTA upgrades since that has nothing to do with any caches or cache partitions.

    Cache partition is sometimes used during incremental OTA upgrades in the way you mention, but only if not using A/B system partitions, and its still pretty rare since there is rarely any reason to copy blocks around. The encryption layer is done in RAM and the incremental OTA replaces full blocks so there is nothing to "patch".
     

    #43
  4. MetalSir
    Honeycomb Sep 30, 2018


    #44
    elanglois and BeingIncog like this.
  5. WarGod1842
    Honeycomb Oct 7, 2018


    #45
    elanglois likes this.
  6. Z1538983495762
    Cupcake Oct 8, 2018


    #46
  7. elanglois
    Lollipop Oct 8, 2018


    #47
  8. elanglois
    Lollipop Oct 8, 2018

    elanglois , Oct 8, 2018 :
    see above
     

    #48
  9. Z1538983495762
    Cupcake Oct 8, 2018


    #49
  10. elanglois
    Lollipop Oct 8, 2018

    elanglois , Oct 8, 2018 :
    What junk data? Look. Don't believe the BS from so-called "cache-cleaners". Half of them are useless, the other half have trojans.

    If you have images, downloads, or old OTA files, erase them.
     

    #50
  11. theionopo
    Donut Oct 25, 2018

    theionopo , Oct 25, 2018 :
    So detailed, very well written and so very helpful. Trying to keep this in my 'cache' memory for a ready reference. ;)
     

    #51
    elanglois likes this.
  12. J1542122447286
    Eclair Dec 1, 2018

  13. Georgeoneplus7pro
    Ice Cream Sandwich Aug 18, 2019

    Georgeoneplus7pro , Aug 18, 2019 :
    Your article is excellent. I also found out a few things from here. But in my case with 1+7Pro, with 12GB RAM and high performance internal memory, I do not perceive the system slowing down if I delete the cache from the recovery mode, if the behavior of the device I do not like.
     
    Last edited: Aug 18, 2019

    #53
  14. elanglois
    Lollipop Aug 18, 2019

    elanglois , Aug 18, 2019 :
    It doesn't matter what you perceive.

    Fact: Your device will be less efficient and will need to run at higher clock speeds to maintain similar performance.

    Fact: Your device will be rebuilding the cache, further causing slower performance, lower battery life, and a hotter running device

    Fact: Clearing the cache does NOT solve a single problem. Go back and read it again.
     

    #54