Android

Removing gapps from Cyanogenmod 11

I have installed gapps to have access to Google Maps, but when I decided I don’t need them anymore, surprise – there’s no easy way to uninstall.

Most online forums recommend a clean reinstall of cyanogenmod (which might be correct), but since I did not want to go again through the whole backup / restore procedure – I decided to manually remove them.

This process seemed straightforward – just remove what the .zip contained. If you decide to follow my steps below, make sure you understand the risks, you might make the phone unbootable, loose data, etc. My gapps were gapps-kk-20140105-signed.zip file.

1. List the contents of the zip:

zipinfo -1 gapps-kk-20140105-signed.zip > output.txt

The output looks like the one below:

META-INF/com/google/android/update-binary
META-INF/com/google/android/updater-script
install-optional.sh
optional/face/addon.d/71-gapps-faceunlock.sh
optional/face/app/FaceLock.apk
optional/face/lib/libfacelock_jni.so
optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.7/left_eye-y0-yi45-p0-pi45-r0-ri20.lg_32.bin
optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.7/nose_base-y0-yi45-p0-pi45-r0-ri20.lg_32.bin
optional/face/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.7/right_eye-y0-yi45-p0-pi45-r0-ri20.lg_32-2.bin
optional/face/vendor/pittpatt/models/detection/yaw_roll_face_detectors.6/head-y0-yi45-p0-pi45-r0-ri30.4a-v24.bin
optional/face/vendor/pittpatt/models/detection/yaw_roll_face_detectors.6/head-y0-yi45-p0-pi45-rn30-ri30.5-v24.bin
optional/face/vendor/pittpatt/models/detection/yaw_roll_face_detectors.6/head-y0-yi45-p0-pi45-rp30-ri30.5-v24.bin
optional/face/vendor/pittpatt/models/recognition/face.face.y0-y0-22-b-N.bin
system/addon.d/70-gapps.sh
system/app/GenieWidget.apk
system/app/Gmail2.apk
system/app/GoogleCalendarSyncAdapter.apk
system/app/GoogleContactsSyncAdapter.apk
system/app/GoogleEars.apk
system/app/GoogleTTS.apk
system/app/Hangouts.apk
system/app/MediaUploader.apk
system/etc/g.prop
system/etc/permissions/com.google.android.maps.xml
system/etc/permissions/com.google.android.media.effects.xml
system/etc/permissions/com.google.widevine.software.drm.xml
system/etc/permissions/features.xml
system/etc/preferred-apps/google.xml
system/framework/com.google.android.maps.jar
system/framework/com.google.android.media.effects.jar
system/framework/com.google.widevine.software.drm.jar
system/lib/libAppDataSearch.so
system/lib/libRSSupport.so
system/lib/libWVphoneAPI.so
system/lib/libfilterpack_facedetect.so
system/lib/libfrsdk.so
system/lib/libgames_rtmp_jni.so
system/lib/libgoogle_recognizer_jni_l.so
system/lib/libjni_unbundled_latinimegoogle.so
system/lib/libpatts_engine_jni_api.so
system/lib/libplus_jni_v8.so
system/lib/librs.antblur.so
system/lib/librs.antblur_constant.so
system/lib/librs.antblur_drama.so
system/lib/librs.drama.so
system/lib/librs.film_base.so
system/lib/librs.fixedframe.so
system/lib/librs.grey.so
system/lib/librs.image_wrapper.so
system/lib/librs.retrolux.so
system/lib/librsjni.so
system/lib/libspeexwrapper.so
system/lib/libvcdecoder_jni.so
system/lib/libvideochat_jni.so
system/lib/libwebp_android.so
system/priv-app/ConfigUpdater.apk
system/priv-app/GmsCore.apk
system/priv-app/GoogleBackupTransport.apk
system/priv-app/GoogleFeedback.apk
system/priv-app/GoogleLoginService.apk
system/priv-app/GoogleOneTimeInitializer.apk
system/priv-app/GooglePartnerSetup.apk
system/priv-app/GoogleServicesFramework.apk
system/priv-app/Phonesky.apk
system/priv-app/SetupWizard.apk
system/priv-app/Velvet.apk
system/priv-app/talkback.apk
system/usr/srec/en-US/c_fst
system/usr/srec/en-US/clg
system/usr/srec/en-US/commands.abnf
system/usr/srec/en-US/compile_grammar.config
system/usr/srec/en-US/contacts.abnf
system/usr/srec/en-US/dict
system/usr/srec/en-US/dictation.config
system/usr/srec/en-US/dnn
system/usr/srec/en-US/endpointer_dictation.config
system/usr/srec/en-US/endpointer_voicesearch.config
system/usr/srec/en-US/ep_acoustic_model
system/usr/srec/en-US/g2p_fst
system/usr/srec/en-US/grammar.config
system/usr/srec/en-US/hclg_shotword
system/usr/srec/en-US/hmm_symbols
system/usr/srec/en-US/hmmlist
system/usr/srec/en-US/hotword.config
system/usr/srec/en-US/hotword_classifier
system/usr/srec/en-US/hotword_normalizer
system/usr/srec/en-US/hotword_prompt.txt
system/usr/srec/en-US/hotword_word_symbols
system/usr/srec/en-US/metadata
system/usr/srec/en-US/norm_fst
system/usr/srec/en-US/normalizer
system/usr/srec/en-US/offensive_word_normalizer
system/usr/srec/en-US/phone_state_map
system/usr/srec/en-US/phonelist
system/usr/srec/en-US/rescoring_lm
system/usr/srec/en-US/wordlist
META-INF/MANIFEST.MF
META-INF/CERT.SF
META-INF/CERT.RSA
META-INF/com/android/otacert

There are many files within the system folder, the META-INF folder which I ignored, and the optional/face folder contents for which I had to find the place where its contents were copied.

First, I manually removed the META-INF lines from the output file, as well as the optional/face ones and then copy/pasted “rm -rf /” in front of each system folder lines:

rm -rf /system/addon.d/70-gapps.sh
rm -rf /system/app/GenieWidget.apk
rm -rf /system/app/Gmail2.apk
rm -rf /system/app/GoogleCalendarSyncAdapter.apk
rm -rf /system/app/GoogleContactsSyncAdapter.apk
rm -rf /system/app/GoogleEars.apk
rm -rf /system/app/GoogleTTS.apk
rm -rf /system/app/Hangouts.apk
rm -rf /system/app/MediaUploader.apk
rm -rf /system/etc/g.prop
rm -rf /system/etc/permissions/com.google.android.maps.xml
rm -rf /system/etc/permissions/com.google.android.media.effects.xml
rm -rf /system/etc/permissions/com.google.widevine.software.drm.xml
rm -rf /system/etc/permissions/features.xml
rm -rf /system/etc/preferred-apps/google.xml
rm -rf /system/framework/com.google.android.maps.jar
rm -rf /system/framework/com.google.android.media.effects.jar
rm -rf /system/framework/com.google.widevine.software.drm.jar
rm -rf /system/lib/libAppDataSearch.so
rm -rf /system/lib/libRSSupport.so
rm -rf /system/lib/libWVphoneAPI.so
rm -rf /system/lib/libfilterpack_facedetect.so
rm -rf /system/lib/libfrsdk.so
rm -rf /system/lib/libgames_rtmp_jni.so
rm -rf /system/lib/libgoogle_recognizer_jni_l.so
rm -rf /system/lib/libjni_unbundled_latinimegoogle.so
rm -rf /system/lib/libpatts_engine_jni_api.so
rm -rf /system/lib/libplus_jni_v8.so
rm -rf /system/lib/librs.antblur.so
rm -rf /system/lib/librs.antblur_constant.so
rm -rf /system/lib/librs.antblur_drama.so
rm -rf /system/lib/librs.drama.so
rm -rf /system/lib/librs.film_base.so
rm -rf /system/lib/librs.fixedframe.so
rm -rf /system/lib/librs.grey.so
rm -rf /system/lib/librs.image_wrapper.so
rm -rf /system/lib/librs.retrolux.so
rm -rf /system/lib/librsjni.so
rm -rf /system/lib/libspeexwrapper.so
rm -rf /system/lib/libvcdecoder_jni.so
rm -rf /system/lib/libvideochat_jni.so
rm -rf /system/lib/libwebp_android.so
rm -rf /system/priv-app/ConfigUpdater.apk
rm -rf /system/priv-app/GmsCore.apk
rm -rf /system/priv-app/GoogleBackupTransport.apk
rm -rf /system/priv-app/GoogleFeedback.apk
rm -rf /system/priv-app/GoogleLoginService.apk
rm -rf /system/priv-app/GoogleOneTimeInitializer.apk
rm -rf /system/priv-app/GooglePartnerSetup.apk
rm -rf /system/priv-app/GoogleServicesFramework.apk
rm -rf /system/priv-app/Phonesky.apk
rm -rf /system/priv-app/SetupWizard.apk
rm -rf /system/priv-app/Velvet.apk
rm -rf /system/priv-app/talkback.apk
rm -rf /system/usr/srec/en-US/c_fst
rm -rf /system/usr/srec/en-US/clg
rm -rf /system/usr/srec/en-US/commands.abnf
rm -rf /system/usr/srec/en-US/compile_grammar.config
rm -rf /system/usr/srec/en-US/contacts.abnf
rm -rf /system/usr/srec/en-US/dict
rm -rf /system/usr/srec/en-US/dictation.config
rm -rf /system/usr/srec/en-US/dnn
rm -rf /system/usr/srec/en-US/endpointer_dictation.config
rm -rf /system/usr/srec/en-US/endpointer_voicesearch.config
rm -rf /system/usr/srec/en-US/ep_acoustic_model
rm -rf /system/usr/srec/en-US/g2p_fst
rm -rf /system/usr/srec/en-US/grammar.config
rm -rf /system/usr/srec/en-US/hclg_shotword
rm -rf /system/usr/srec/en-US/hmm_symbols
rm -rf /system/usr/srec/en-US/hmmlist
rm -rf /system/usr/srec/en-US/hotword.config
rm -rf /system/usr/srec/en-US/hotword_classifier
rm -rf /system/usr/srec/en-US/hotword_normalizer
rm -rf /system/usr/srec/en-US/hotword_prompt.txt
rm -rf /system/usr/srec/en-US/hotword_word_symbols
rm -rf /system/usr/srec/en-US/metadata
rm -rf /system/usr/srec/en-US/norm_fst
rm -rf /system/usr/srec/en-US/normalizer
rm -rf /system/usr/srec/en-US/offensive_word_normalizer
rm -rf /system/usr/srec/en-US/phone_state_map
rm -rf /system/usr/srec/en-US/phonelist
rm -rf /system/usr/srec/en-US/rescoring_lm
rm -rf /system/usr/srec/en-US/wordlist

Step 2.

Since the instructions above remove all the .apks and dependencies, the /system partition has to be mounted readonly. I used command line for this and there are specific examples for each phone out there.

However, it is not enough to execute the script above, since, upon reboot, the files (or at least some of them) will be back! After the script is ran, the phone had to be rebooted in recovery mode and Dalvik and Cache to be wiped (not system or data, just the caches).

Step 3.

I wanted to also remove the optional/face folder, and using the find command, it is clear that the contents of the optional/face folder ended up within the /system folder on the phone.

So another small batch:

rm -rf /system/app/FaceLock.apk
rm -rf /system/lib/libfacelock_jni.so
rm -rf /system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.7/left_eye-y0-yi45-p0-pi45-r0-ri20.lg_32.bin
rm -rf /system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.7/nose_base-y0-yi45-p0-pi45-r0-ri20.lg_32.bin
rm -rf /system/vendor/pittpatt/models/detection/multi_pose_face_landmark_detectors.7/right_eye-y0-yi45-p0-pi45-r0-ri20.lg_32-2.
rm -rf /system/vendor/pittpatt/models/detection/yaw_roll_face_detectors.6/head-y0-yi45-p0-pi45-r0-ri30.4a-v24.bin
rm -rf /system/vendor/pittpatt/models/detection/yaw_roll_face_detectors.6/head-y0-yi45-p0-pi45-rn30-ri30.5-v24.bin
rm -rf /system/vendor/pittpatt/models/detection/yaw_roll_face_detectors.6/head-y0-yi45-p0-pi45-rp30-ri30.5-v24.bin
rm -rf /system/vendor/pittpatt/models/recognition/face.face.y0-y0-22-b-N.bin

cleaned those too.

Another reboot and Dalvik / Cache clean and the phone was almost brand new 🙂

4 Comments

  1. Chris

    Why not just go to the Apps Manager (Settings -> Apps) and Disable these apps?
    This wouldn’t work in an unrooted phone, but in a rooted phone these apps remain disabled after a reboot.
    It sure works for me, and the plus is that if a disabled app seems to be necessary after all, all you need to do is to re-enable the app.

  2. Mourad

    do not remove this package:
    /system/priv-app/SetupWizard.apk

  3. Chris

    Do I need root to remove gapps?

  4. You do NOT need root in order to disable system apps! Enable developer mode in settings, enable adb debugging, set up adb on your computer, and then you’ll be able to do:

    pm disable-user –user 0 com.google.android.gsf

    … and so on for all gapps packages (the exact package list will depend on your Android version

Leave a Reply