Skip to content

Instantly share code, notes, and snippets.

@joaofl
Last active January 20, 2024 16:36
Show Gist options
  • Save joaofl/7671e7e96a760e9b368992d6694a33d9 to your computer and use it in GitHub Desktop.
Save joaofl/7671e7e96a760e9b368992d6694a33d9 to your computer and use it in GitHub Desktop.
Script I used to clean preinstalled shit out of my brand new Samsung A40 (while there is still no LineageOS for it)
#!/bin/sh
# ref: https://piunikaweb.com/2019/03/25/samsung-galaxy-s10-remove-bundled-bloatwares-without-root/
# install the following app to see the packages names:
# use the following command to generate the unistall command, for easy copy and paste:
# adb shell 'pm list packages' | sed -e 's/^/adb uninstall --user 0 /' | grep FILTER_HERE | sort
#things to install if removing keyboard
# F-Droid
# APK Analyser
# google keyboard
#facebook
adb uninstall --user 0 com.facebook.katana
adb uninstall --user 0 com.facebook.system
adb uninstall --user 0 com.facebook.appmanager
adb uninstall --user 0 com.facebook.services
#General system stuff
adb uninstall --user 0 com.dsi.ant.sample.acquirechannels
adb uninstall --user 0 com.dsi.ant.service.socket
adb uninstall --user 0 com.dsi.ant.server
adb uninstall --user 0 com.dsi.ant.plugins.antplus
adb uninstall --user 0 com.android.egg
adb uninstall --user 0 com.sec.android.easyonehand
adb uninstall --user 0 com.sec.android.widgetapp.samsungapps
#adb uninstall --user 0 com.sec.android.app.launcher
adb uninstall --user 0 com.samsung.android.mateagent
adb uninstall --user 0 com.sec.android.easyMover.Agent
adb uninstall --user 0 com.samsung.android.app.watchmanagerstub
adb uninstall --user 0 com.sec.android.daemonapp
adb uninstall --user 0 com.samsung.android.app.social
#SAMSUNG PASS / PAY
adb uninstall --user 0 com.samsung.android.samsungpassautofill
adb uninstall --user 0 com.samsung.android.authfw
adb uninstall --user 0 com.samsung.android.samsungpass
adb uninstall --user 0 com.samsung.android.spay
adb uninstall --user 0 com.samsung.android.spayfw
#Samsung bixby
adb uninstall --user 0 com.samsung.android.bixby.wakeup
adb uninstall --user 0 com.samsung.android.app.spage
adb uninstall --user 0 com.samsung.android.app.routines
adb uninstall --user 0 com.samsung.android.bixby.service
adb uninstall --user 0 com.samsung.android.visionintelligence
adb uninstall --user 0 com.samsung.android.bixby.agent
adb uninstall --user 0 com.samsung.android.bixby.agent.dummy
adb uninstall --user 0 com.samsung.android.bixbyvision.framework
adb uninstall --user 0 com.samsung.android.drivelink.stub
#Samsung email
adb uninstall --user 0 com.samsung.android.email.provider
adb uninstall --user 0 com.wsomacp
#Samsung game launcher
adb uninstall --user 0 com.samsung.android.game.gamehome
adb uninstall --user 0 com.enhance.gameservice
adb uninstall --user 0 com.samsung.android.game.gametools
adb uninstall --user 0 com.samsung.android.game.gos
adb uninstall --user 0 com.samsung.android.gametuner.thin
#Samsung browser
adb uninstall --user 0 com.sec.android.app.sbrowser
adb uninstall --user 0 com.samsung.android.app.sbrowseredge
#Samsung gear VR
adb uninstall --user 0 com.samsung.android.hmt.vrsvc
adb uninstall --user 0 com.samsung.android.app.vrsetupwizardstub
adb uninstall --user 0 com.samsung.android.hmt.vrshell
adb uninstall --user 0 com.google.vr.vrcore
#Edge
adb uninstall --user 0 com.samsung.android.service.peoplestripe
adb uninstall --user 0 com.samsung.android.app.ledbackcover
adb uninstall --user 0 com.sec.android.cover.ledcover
adb uninstall --user 0 com.sec.android.desktopmode.uiservice
adb uninstall --user 0 com.samsung.desktopsystemui
adb uninstall --user 0 com.sec.android.app.desktoplauncher
#More preinstalled shit
adb uninstall --user 0 com.microsoft.office.officehubrow
adb uninstall --user 0 com.microsoft.skydrive
adb uninstall --user 0 com.samsung.android.themestore
adb uninstall --user 0 com.linkedin.android
#Google stuff
adb uninstall --user 0 com.google.android.apps.tachyon
adb uninstall --user 0 com.google.android.apps.photos
adb uninstall --user 0 com.sec.android.app.samsungapps
adb uninstall --user 0 com.google.android.googlequicksearchbox
adb uninstall --user 0 com.sec.android.app.billing
adb uninstall --user 0 com.samsung.android.scloud
adb uninstall --user 0 com.samsung.android.mobileservice
adb uninstall --user 0 com.samsung.android.app.mirrorlink
adb uninstall --user 0 com.osp.app.signin
adb uninstall --user 0 com.samsung.android.easysetup
adb uninstall --user 0 com.samsung.android.beaconmanager
#only after installing gboard
adb uninstall --user 0 com.sec.android.inputmethod
adb uninstall --user 0 com.samsung.android.app.settings.bixby
adb uninstall --user 0 com.sec.location.nsflp2
#knox
adb uninstall --user 0 com.knox.vpn.proxyhandler
adb uninstall --user 0 com.samsung.android.knox.analytics.uploader
adb uninstall --user 0 com.samsung.android.knox.containeragent
adb uninstall --user 0 com.samsung.android.knox.containercore
adb uninstall --user 0 com.samsung.knox.keychain
adb uninstall --user 0 com.samsung.knox.securefolder
adb uninstall --user 0 com.sec.enterprise.knox.attestation
adb uninstall --user 0 com.sec.enterprise.knox.cloudmdm.smdms
@joaofl
Copy link
Author

joaofl commented Jan 9, 2020

Hi Joao
No, you don't need to root. Just run it using adb via USB.
I like the phone very much. Its a great piece of hardware. The only thing I really miss is having a custom ROM for it.. Otherwise, I'm pretty happy.
I've posted the link to this script on XDA forums. Probably you can get some help there.

@joaotavora
Copy link

Thanks @joaofl, I ended up doing that once I found the link.

It has worked nicely so far.

@thetup
Copy link

thetup commented Jan 15, 2020

@joaofl is there a way people can contribute to this to find more crap to add to the list? Also did you notice a difference in battery time?

@joaofl
Copy link
Author

joaofl commented Jan 15, 2020

@thetup
I believe you can make pull requests. If not, please suggest changes here on the comments.

I can't really tell if there was any increase in battery life, as I did the cleanup on the first hours after I got the phone. But it usually lasts 2,5 days..

I wish there was a lineage distribution for it, as it is a nice phone. Because there is none, we have to clean the mess by Samsung

@wolfgangschaefer
Copy link

@joaofl thank you for this list! I found a little typo:
package:com.microsoft.skydrive should be com.microsoft.skydrive

@joaofl
Copy link
Author

joaofl commented Feb 12, 2020

@W-sch
Well spotted. Correcting it now

@3nly
Copy link

3nly commented Feb 29, 2020

Will removing those Knox apps trigger Knox? Thank you for your work.

I'm also enjoying the A40 but the whole Knox thing is annoying, not that I ever used or need them since I've always used LineageOS with microg.

@joaofl
Copy link
Author

joaofl commented Feb 29, 2020

@3nly In my opinion, Knox is only one of the annoying bloatwares.
It's ok to remove them. In the end you are not removing from the image, but from the installation. If you restore you phone they will be there again.

Have you found anything about lineage for the a40?

@3nly
Copy link

3nly commented Mar 1, 2020

@joaofl I ended up removing the Knox apps without any issue, but I might actually use Secure Folder if no LineageOS becomes available.

Haven't found anything "official" yet, most roms for the A40 at the moment are just GSI. We'll have to wait I guess.

@4lex11s
Copy link

4lex11s commented Apr 17, 2020

Powershell version
adb shell 'pm list packages' | %{ $_ -replace "package:","adb uninstall --user 0 "} |Sort-Object

@nayessiva
Copy link

Hi ! Thanks a lot for this.
Have you tried to remove the Gapps either ? I've seen you removed "google stuff" but i guess it's not THE Gapps?
I can't wait for a Lineage distribution but it seems that it's not that simple with the chip...

@joaofl
Copy link
Author

joaofl commented Apr 21, 2020

@nayessiva
No, It does not remove Gapps. That would be a major step, which would break many core functionalities if there is no replacement.

I cant see any development on the lineage port to it, unfortunately. From discussions I had, it does not seem to be because of the chip, but mostly lack of interest from Samsung users.
Really wish it was different.

@joaofl
Copy link
Author

joaofl commented Apr 21, 2020

@4lex11s
Thanks for the addition. Will add it as a comment on the code

@nayessiva
Copy link

I cant see any development on the lineage port to it, unfortunately. From discussions I had, it does not seem to be because of the chip, but mostly lack of interest from Samsung users.

I guess it's probably because there is now so many different devices from samsung... hard to maintain it all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment