[Q&A] [MOD/APK] CLEANSER for CM12 v1.9 [multi-devices]

Q

QA Bot

Guest
Q&A for [MOD/APK] CLEANSER for CM12 v1.9 [multi-devices]

Some developers prefer that questions remain separate from their main development thread to help keep things organized. Placing your question within this thread will increase its chances of being answered by a member of the community or by the developer.

Before posting, please use the forum search and read through the discussion thread for [MOD/APK] CLEANSER for CM12 v1.9 [multi-devices]. If you can't find an answer, post it here, being sure to give as much information as possible (firmware version, steps to reproduce, logcat if available) so that you can get help.

Thanks for understanding and for helping to keep XDA neat and tidy! :)
 

hinxnz

Senior Member
Jul 21, 2009
2,821
2,410
193
Play movies & TV APP
Yeah I was thinking of adding gapps removal, I only using pico gapps which is very minimal.
Do you have full gapps? Could you enter code below in terminal for me and post outcome.
The code just creates a list of your system apps.
Code:
ls /system/app /system/priv-app
 

DomagojX

Member
Feb 29, 2012
41
4
38
Zagreb
I have micro gapps

here you go
Code:
acct
cache
charger
config
d
data
default.prop
dev
devlog
etc
file_contexts
firmware_q6
firmware_radio
fstab.pyramid
init
init.cm.rc
init.environ.rc
init.pyramid.rc
init.pyramid.usb.rc
init.rc
init.superuser.rc
init.trace.rc
init.usb.rc
init.zygote32.rc
mnt
proc
property_contexts
root
sbin
sdcard
seapp_contexts
selinux_version
sepolicy
service_contexts
storage
sys
system
tombstones
ueventd.pyramid.rc
ueventd.rc
usbdisk
vendor
BasicDreams
Bluetooth
Browser
CMFileManager
CMWallpapers
Calculator
Calendar
Camera2
CaptivePortalLogin
CertInstaller
ConfigUpdater
DeskClock
Development
DeviceSettings
DocumentsUI
DownloadProviderUi
Eleven
Email
Exchange2
FaceLock
Galaxy4
Gallery2
Gmail2
GoogleCalendarSyncAdapter
GoogleContactsSyncAdapter
GoogleTTS
HTMLViewer
HoloSpiralWallpaper
InCallUI
KeyChain
LatinIME
LiveWallpapers
LiveWallpapersPicker
LockClock
Maps
NoiseField
OpenWnn
PacProcessor
PackageInstaller
PhaseBeam
PhotoPhase
PhotoTable
PicoTts
PrintSpooler
Provision
SoundRecorder
Stk
Terminal
UserDictionaryProvider
Videos
VisualizationWallpapers
WAPPushManager
webview
AudioFX
BackupRestoreConfirmation
CMAccount
CMUpdater
CalendarProvider
CellBroadcastReceiver
Contacts
ContactsProvider
CyanogenSetupWizard
DefaultContainerService
Dialer
DownloadProvider
ExternalStorageProvider
FusedLocation
GmsCore
GoogleBackupTransport
GoogleFeedback
GoogleLoginService
GoogleOneTimeInitializer
GooglePartnerSetup
GoogleServicesFramework
InputDevices
MediaProvider
Mms
MmsService
OneTimeInitializer
Phonesky
ProxyHandler
Settings
SettingsProvider
SetupWizard
SharedStorageBackup
Shell
SystemUI
TeleService
Telecom
TelephonyProvider
ThemeChooser
ThemesProvider
Trebuchet
Velvet
VoiceDialer
VpnDialogs
WallpaperCropper
com.hinxnz.cleanser.apk
talkback
[email protected]:/ $
 

m4rcu5.net

Member
May 15, 2015
7
1
0
Persistent scripts

Hi,

How does the persistent app removal work? I ran the installer and it beautifully removed all the bloat from the ROM.
But on upgrades it seems that the bloat is added again and not automagically removed. Do i have to do something to make it run the cleanup scripts again?
I am using TWRP v2.8.6.0

-m4rcu5
 

hinxnz

Senior Member
Jul 21, 2009
2,821
2,410
193
Hi,

How does the persistent app removal work? I ran the installer and it beautifully removed all the bloat from the ROM.
But on upgrades it seems that the bloat is added again and not automagically removed. Do i have to do something to make it run the cleanup scripts again?
I am using TWRP v2.8.6.0

-m4rcu5
With an addon.d and init.d script.
Did you upgrade ROM from CM12 to CM12.1 because in the backup script in the ROM.zip, it removes all addon.d scripts, I don't know why but I guess to avoid incompatibility issues.
Or on all ROM upgrades? Did you enable survival mode in the installer?
 

m4rcu5.net

Member
May 15, 2015
7
1
0
With an addon.d and init.d script.
Did you upgrade ROM from CM12 to CM12.1 because in the backup script in the ROM.zip, it removes all addon.d scripts, I don't know why but I guess to avoid incompatibility issues.
Or on all ROM upgrades? Did you enable survival mode in the installer?
I just did an CM12.1 snapshot update (clicked download in the updater, said yes to install, and then manually selected the zip to install in TWRP) but all the bloat re-appeared. I did have the cleanser zip installed.
So to de-bloat I did the following:
Rebooted into TWRP, installed the cleaner.zip, selected app-removal, ticket the "install persistent script", selected a whole bunch of apps (including the launcher), next, next, reboot. Installer exited with code 0.

Is there any way to recognize the cleaner init.d script when it should run?
 

hinxnz

Senior Member
Jul 21, 2009
2,821
2,410
193
I just did an CM12.1 snapshot update (clicked download in the updater, said yes to install, and then manually selected the zip to install in TWRP) but all the bloat re-appeared. I did have the cleanser zip installed.
So to de-bloat I did the following:
Rebooted into TWRP, installed the cleaner.zip, selected app-removal, ticket the "install persistent script", selected a whole bunch of apps (including the launcher), next, next, reboot. Installer exited with code 0.

Is there any way to recognize the cleaner init.d script when it should run?
If the installer exited without finishing then it wouldn't work. Try turning off phone, removing battery for 5 secs if you can or how ever you reset device if you can't remove battery and try again, I can't think of a reason why it shouldn't work now. Try wiping cache then reboot recovery. You could upload recovery log if still getting the error.
 

m4rcu5.net

Member
May 15, 2015
7
1
0
If the installer exited without finishing then it wouldn't work. Try turning off phone, removing battery for 5 secs if you can or how ever you reset device if you can't remove battery and try again, I can't think of a reason why it shouldn't work now. Try wiping cache then reboot recovery. You could upload recovery log if still getting the error.
I just ran another test.
  1. Wiped cache and dalvik.
  2. Installed cleanser.zip, set up survival scripts, installer exited successfully.
  3. Installed the latest snapshot.
  4. Rebooted the phone into OS.
  5. Android started upgrading the apps.

At this point the cleanser did nothing, the homescreen appeared and asked me if i would like to use trebuchet (one of the things I removed). Another reboot after that also triggered nothing.

The only way to get sanity restored is to launch recovery, run the cleanser.zip again and remove the apps.

What can I send to help find out why the cleaners did not run at step 4?
 

hinxnz

Senior Member
Jul 21, 2009
2,821
2,410
193
I just ran another test.
  1. Wiped cache and dalvik.
  2. Installed cleanser.zip, set up survival scripts, installer exited successfully.
  3. Installed the latest snapshot.
  4. Rebooted the phone into OS.
  5. Android started upgrading the apps.

At this point the cleanser did nothing, the homescreen appeared and asked me if i would like to use trebuchet (one of the things I removed). Another reboot after that also triggered nothing.

The only way to get sanity restored is to launch recovery, run the cleanser.zip again and remove the apps.

What can I send to help find out why the cleaners did not run at step 4?
It's because you installed rom straight after flashing mod and mod couldn't configure the scripts upon reboot.

Edit: PM sent with test version.
 
Last edited:

m4rcu5.net

Member
May 15, 2015
7
1
0
It's because you installed rom straight after flashing mod and mod couldn't configure the scripts upon reboot.
Another couple of tries later i still cannot get it to work :(

- On a working ROM, install cleanser via recovery.
- App Removal, tick Survival mode, tick a bunch of apps (including trebuchet en file manager), Remove now, It finishes without problems, reboot.
- Now I have a nice and clean ROM.

Next CM update;
- Download the update, hit update. System boots recovery, installs CM update and boots.
- You see android updating the Apps and dropping to lockscreen.
But after unlocking, all the cruft is still there.

It seems as if the init script is either not deployed, removed on update or fails.
 

hinxnz

Senior Member
Jul 21, 2009
2,821
2,410
193
Another couple of tries later i still cannot get it to work :(

- On a working ROM, install cleanser via recovery.
- App Removal, tick Survival mode, tick a bunch of apps (including trebuchet en file manager), Remove now, It finishes without problems, reboot.
- Now I have a nice and clean ROM.

Next CM update;
- Download the update, hit update. System boots recovery, installs CM update and boots.
- You see android updating the Apps and dropping to lockscreen.
But after unlocking, all the cruft is still there.

It seems as if the init script is either not deployed, removed on update or fails.
Can you post outcome of this code in terminal:
Code:
ls /system/etc/init.d /system/addon.d
 

m4rcu5.net

Member
May 15, 2015
7
1
0
Can you post outcome of this code in terminal:
Code:
ls /system/etc/init.d /system/addon.d
Yes, sure:

Code:
~$ ls /system/etc/init.d /system/addon.d
00
00aae
00aaf
00aag
00aao
00aar
00aat
00aav
00aax
00aaz
00banner
90userinit
30-gapps.sh
31-faceunlock.sh
50-cm.sh
55-cleanser.sh
blacklist

~$ cat /system/addon.d/55-cleanser.sh
#!/sbin/sh
#
# /system/addon.d/55-cleanser.sh
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
etc/init.d/00
etc/init.d/00a
EOF
}

case "$1" in
  backup)
    list_files | while read FILE DUMMY; do
      backup_file $S/$FILE
    done
  ;;
  restore)
    list_files | while read FILE REPLACEMENT; do
      R=""
      [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
      [ -f "$C/$S/$FILE" ] && restore_file $S/$FILE $R
    done
  ;;
  pre-backup)
    # Stub
  ;;
  post-backup)
    # Stub
  ;;
  pre-restore)
    # Stub
  ;;
  post-restore)
    # Stub
  ;;
esac
~$
 
  • Like
Reactions: hinxnz

hinxnz

Senior Member
Jul 21, 2009
2,821
2,410
193
Yes, sure:

Code:
~$ ls /system/etc/init.d /system/addon.d
00
00aae
00aaf
00aag
00aao
00aar
00aat
00aav
00aax
00aaz
00banner
90userinit
30-gapps.sh
31-faceunlock.sh
50-cm.sh
55-cleanser.sh
blacklist

~$ cat /system/addon.d/55-cleanser.sh
#!/sbin/sh
#
# /system/addon.d/55-cleanser.sh
#

. /tmp/backuptool.functions

list_files() {
cat <<EOF
etc/init.d/00
etc/init.d/00a
EOF
}

case "$1" in
  backup)
    list_files | while read FILE DUMMY; do
      backup_file $S/$FILE
    done
  ;;
  restore)
    list_files | while read FILE REPLACEMENT; do
      R=""
      [ -n "$REPLACEMENT" ] && R="$S/$REPLACEMENT"
      [ -f "$C/$S/$FILE" ] && restore_file $S/$FILE $R
    done
  ;;
  pre-backup)
    # Stub
  ;;
  post-backup)
    # Stub
  ;;
  pre-restore)
    # Stub
  ;;
  post-restore)
    # Stub
  ;;
esac
~$
Yeah init.d scripts aren't applied, it probably a mount issue.
I'd say system is read only. I'll fix it when I have some time and maybe drop you a test version first.