[TOOL/SCRIPT] freecyngn - Removing proprietary userspace parts from CM10/11/12/12.1

Search This thread

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,293
Introduction
Though CyanogenMod always claimed to be open-source, there were only few versions that had an open userspace (Some drivers and firmware have always been proprietary, but it's not CMs fault).

The first CM version I ever installed on a device was CM7 and it contains koush's proprietary ROM Manager app. CyanogenMod 9 seemed to have no proprietary parts, but since CM10 they included Google Analytics Client library (libGoogleAnalyticsV2.jar) within cmstats in the settings app (so it's not even possible to disable it). In CyanogenMod 10.1 CMAccount was included. It relies heavily on Google's Cloud Messaging service and includes the proprietary Google Play Services Client library (google-play-services.jar).

There are some people here at xda (including myself) that installed CyanogenMod because it does not ship GAPPS and is a fully (except vendor files) open-source and free rom. Since i noticed it's not, i started building CM without these closed-source stuff, but it's a pity to do so. That's when the idea of freecyngn started.

What is freecyngn
freecyngn is a tool you can run from recovery, that removes some known proprietary things (or apps relying on proprietary extensions) from CyanogenMod. At the moment this is Google Analytics (from CMStats in CM10/11), CMAccount, LockClock, SetupWizard, Voice+, VoiceDialer and WhisperPush.

Installation Instructions
  1. Copy or download the zip file to the sdcard of your android device
  2. Boot your device into recovery.
  3. If not already done, install CyanogenMod as usual from recovery - DO NOT REBOOT
  4. Install freecyngn as if it was a rom, but DO NOT WIPE /system before

CyanogenMod 12/12.1
The version for CyanogenMod 12 should not be used on nightlies before July 9, 2015!

Changelog
v1.0: First release for CM12

Downloads
Latest release (v1.0): https://github.com/mar-v-in/freecyngn/releases/download/v1.0/freecyngn-flashable-cm12.zip
All releases: https://github.com/mar-v-in/freecyngn/releases
Source: https://github.com/mar-v-in/freecyngn

CyanogenMod 10/11

Changelog
v0.5: Latest fixes, better logs
v0.4.1: Remove LockClock (uses Google Play Services)
v0.4: Adapt to latest changes, remove VoiceDialer as well
v0.3.1: addon.d based auto repatching
v0.3: fixed logging
v0.2: Now creating logfile: /system/freecyngn/log

Downloads
Latest release (v0.5): https://github.com/mar-v-in/freecyngn/releases/download/v0.5/freecyngn-flashable-cm1011.zip
All releases: https://github.com/mar-v-in/freecyngn/releases
Source: https://github.com/mar-v-in/freecyngn

How it works (technical stuff)
freecyngn disassembles (using [bak]smali) the CyanogenMod settings app and removes the proprietary Google Analytics component. It then replaces it with NoAnalytics, so that existing bindings from cmstats do not break and reassembles the settings app.


FAQ
Q: My recovery hangs while flashing?
Q: Why is this script so slow?
A: freecyngn need plenty of time and is sometimes even slower than flashing the rom itself. This is bcause most recoverys underclock the cpu, which is no problem for just copying files from zip to partition or format a partition, but it is a problem for disassembling and reassembling, which are cpu intensive tasks.
Q: Do I need to apply the patch after every update?
A: Since v0.3.1 this is no longer needed. Patching is done automatically.
Q: What's about other custom ROMs?
A: AOKP is patchable with freecyngn as well. Paranoid contains Google Analytics in the proprietary ParanoidSettings app instead of the system settings and thus does not work with this patch. OmniROM does not contain Google Analytics. Note that some slimmed-down CM/AOKP-custom-builds will not work with freecyngn. If you use such, check the log file /system/freecyngn/log after flashing.

XDA:DevDB Information
freecyngn, Tool/Utility for the Android General

Contributors
MaR-V-iN
Source Code: https://github.com/mar-v-in/freecyngn


Version Information
Status: Stable
Current Stable Version: v1.0
Stable Release Date: 2014-08-07

Created 2013-12-01
Last Updated 2016-07-02
 
Last edited:

SketchyStunts

Senior Member
Sep 1, 2011
2,432
792
GA.
Flashed on cm10.2 on evo3d. Only took about 3seconds for me. Thanks

Sent from my Evo 3D CDMA using XDA Premium 4 mobile app
 

jbonetwo

Senior Member
Aug 1, 2012
171
46
Introduction

What is freecyngn
freecyngn is a tool you can run from recovery, that removes some known proprietary things (or apps relying on proprietary extensions) from CyanogenMod. At the moment this is Google Analytics (from CMStats), CMAccount and Voice+.

I always remove CMAccount and Voice+ as they are system apps but isn't removing CMStats the same as disabling About Phone>CyanogenMod Statistics>Enable Reporting?
 

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,293
Its work in android 4.4 kitkat Ah?

I tried it on the CM11 build for mako, so I highly assume it's working on all CM11 based roms.

just grep cpuinfo_max_freq and use that number for scaling_max_freq

I'm aware of this method, but I don't think it's a good idea in general, because on some overclocked kernels cpuinfo_max_freq could be really unstable.

I always remove CMAccount and Voice+ as they are system apps but isn't removing CMStats the same as disabling About Phone>CyanogenMod Statistics>Enable Reporting?

It's not removing CMStats completely but only the Google Analytics part. Sending stats to stats.cyanogenmod.org will still work.
Moreover, you can't really say if Google Analytics is disabled. Due to it being proprietary code, it could do nearly anything and the class initializer code is called, even if CMStats is disabled. (I assume they're not doing this, but you can;t know and they always could add this in a future version)

I.mean by removing the google support what will we get
And how is this useful

First: This does not remove Google Support in general. You could still install GAPPS afterwards, but it would be kind of senseless.
Second: Some people think, that Google is not this "don't be evil" company they're proposing to be. And some people like the idea of privacy and not getting totally tracked by Google, so they do not install GAPPS. If this is not the case for you, then this is just not targeting you. I'm not going to try to convince anyone that privacy is a good thing ;)
 

sharingan

Senior Member
May 30, 2013
2,296
643
I tried it on the CM11 build for mako, so I highly assume it's working on all CM11 based roms.



I'm aware of this method, but I don't think it's a good idea in general, because on some overclocked kernels cpuinfo_max_freq could be really unstable.



It's not removing CMStats completely but only the Google Analytics part. Sending stats to stats.cyanogenmod.org will still work.
Moreover, you can't really say if Google Analytics is disabled. Due to it being proprietary code, it could do nearly anything and the class initializer code is called, even if CMStats is disabled. (I assume they're not doing this, but you can;t know and they always could add this in a future version)



First: This does not remove Google Support in general. You could still install GAPPS afterwards, but it would be kind of senseless.
Second: Some people think, that Google is not this "don't be evil" company they're proposing to be. And some people like the idea of privacy and not getting totally tracked by Google, so they do not install GAPPS. If this is not the case for you, then this is just not targeting you. I'm not going to try to convince anyone that privacy is a good thing ;)

ok ok
now i am gonna flash it
 

jbonetwo

Senior Member
Aug 1, 2012
171
46
It's not removing CMStats completely but only the Google Analytics part. Sending stats to stats.cyanogenmod.org will still work.
Moreover, you can't really say if Google Analytics is disabled. Due to it being proprietary code, it could do nearly anything and the class initializer code is called, even if CMStats is disabled. (I assume they're not doing this, but you can;t know and they always could add this in a future version)

Thank you for the info. I would not have thought to look at the Settings app for undesirable activities.

Found the following activities for Settings in Sys Tuner:
UsageStats
Settings$AnonymousStatsActivity
DeviceInfo$StatsReportReceiver
cmstats.ReportingService

Will be flashing your zip for a 'cleaner' solution than sys tuner in the near future.

And yes google is evil :). Their handling of adblock and similar apps shows they're motivated by money and I wouldn't give a corp like that free reign over my device. But that's just me...
 

jo15765

Senior Member
Jun 21, 2012
231
19
So if we run this app, can we still use gapps or is that considered one of the tracking apps that will be removed?
 

dev0lver

Senior Member
Apr 20, 2013
667
270
Čakovec
flashed it on my 4xHD, will see how it will behave
i had really quick install of the zip file, like i would install kernel
that is normal or ?

because in op you say that install will take some time
 

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,293
Ran this script on my rooted stock KitKat ROM @ Nexus 4 & 7, so far no abnormal activity observed on my devices...

Do you know if this will work on all cm based roms or only actual cyanogen?

This is only for CM-based roms that contain CMStats. The Script does nothing useful on Nexus stock or not-CM-based ROMs, these do not include Google Analytics in the Settings app (yes that's right: CM+GAPPS does more Google tracking than Google's stock)

The new v0.2 release creates a log file in /system/freecyngn so you can make sure everything worked great.
 
Last edited:
  • Like
Reactions: pr0di9y

pr0di9y

Member
Sep 28, 2006
16
2
Puchong, Selangor Darul Ehsan
This is only for CM-based roms that contain CMStats. The Script does nothing useful on Nexus stock or not-CM-based ROMs, these do not include Google Analytics in the Settings app (yes that's right: CM+GAPPS does more Google tracking than Google's stock)

The new v0.2 release creates a log file in /system/freecyngn so you can make sure everything worked great.

Does this explain why they have these stats on hand?

developer.android.com/about/dashboards/index.html
 

Top Liked Posts

  • There are no posts matching your filters.
  • 105
    Introduction
    Though CyanogenMod always claimed to be open-source, there were only few versions that had an open userspace (Some drivers and firmware have always been proprietary, but it's not CMs fault).

    The first CM version I ever installed on a device was CM7 and it contains koush's proprietary ROM Manager app. CyanogenMod 9 seemed to have no proprietary parts, but since CM10 they included Google Analytics Client library (libGoogleAnalyticsV2.jar) within cmstats in the settings app (so it's not even possible to disable it). In CyanogenMod 10.1 CMAccount was included. It relies heavily on Google's Cloud Messaging service and includes the proprietary Google Play Services Client library (google-play-services.jar).

    There are some people here at xda (including myself) that installed CyanogenMod because it does not ship GAPPS and is a fully (except vendor files) open-source and free rom. Since i noticed it's not, i started building CM without these closed-source stuff, but it's a pity to do so. That's when the idea of freecyngn started.

    What is freecyngn
    freecyngn is a tool you can run from recovery, that removes some known proprietary things (or apps relying on proprietary extensions) from CyanogenMod. At the moment this is Google Analytics (from CMStats in CM10/11), CMAccount, LockClock, SetupWizard, Voice+, VoiceDialer and WhisperPush.

    Installation Instructions
    1. Copy or download the zip file to the sdcard of your android device
    2. Boot your device into recovery.
    3. If not already done, install CyanogenMod as usual from recovery - DO NOT REBOOT
    4. Install freecyngn as if it was a rom, but DO NOT WIPE /system before

    CyanogenMod 12/12.1
    The version for CyanogenMod 12 should not be used on nightlies before July 9, 2015!

    Changelog
    v1.0: First release for CM12

    Downloads
    Latest release (v1.0): https://github.com/mar-v-in/freecyngn/releases/download/v1.0/freecyngn-flashable-cm12.zip
    All releases: https://github.com/mar-v-in/freecyngn/releases
    Source: https://github.com/mar-v-in/freecyngn

    CyanogenMod 10/11

    Changelog
    v0.5: Latest fixes, better logs
    v0.4.1: Remove LockClock (uses Google Play Services)
    v0.4: Adapt to latest changes, remove VoiceDialer as well
    v0.3.1: addon.d based auto repatching
    v0.3: fixed logging
    v0.2: Now creating logfile: /system/freecyngn/log

    Downloads
    Latest release (v0.5): https://github.com/mar-v-in/freecyngn/releases/download/v0.5/freecyngn-flashable-cm1011.zip
    All releases: https://github.com/mar-v-in/freecyngn/releases
    Source: https://github.com/mar-v-in/freecyngn

    How it works (technical stuff)
    freecyngn disassembles (using [bak]smali) the CyanogenMod settings app and removes the proprietary Google Analytics component. It then replaces it with NoAnalytics, so that existing bindings from cmstats do not break and reassembles the settings app.


    FAQ
    Q: My recovery hangs while flashing?
    Q: Why is this script so slow?
    A: freecyngn need plenty of time and is sometimes even slower than flashing the rom itself. This is bcause most recoverys underclock the cpu, which is no problem for just copying files from zip to partition or format a partition, but it is a problem for disassembling and reassembling, which are cpu intensive tasks.
    Q: Do I need to apply the patch after every update?
    A: Since v0.3.1 this is no longer needed. Patching is done automatically.
    Q: What's about other custom ROMs?
    A: AOKP is patchable with freecyngn as well. Paranoid contains Google Analytics in the proprietary ParanoidSettings app instead of the system settings and thus does not work with this patch. OmniROM does not contain Google Analytics. Note that some slimmed-down CM/AOKP-custom-builds will not work with freecyngn. If you use such, check the log file /system/freecyngn/log after flashing.

    XDA:DevDB Information
    freecyngn, Tool/Utility for the Android General

    Contributors
    MaR-V-iN
    Source Code: https://github.com/mar-v-in/freecyngn


    Version Information
    Status: Stable
    Current Stable Version: v1.0
    Stable Release Date: 2014-08-07

    Created 2013-12-01
    Last Updated 2016-07-02
    12
    Its work in android 4.4 kitkat Ah?

    I tried it on the CM11 build for mako, so I highly assume it's working on all CM11 based roms.

    just grep cpuinfo_max_freq and use that number for scaling_max_freq

    I'm aware of this method, but I don't think it's a good idea in general, because on some overclocked kernels cpuinfo_max_freq could be really unstable.

    I always remove CMAccount and Voice+ as they are system apps but isn't removing CMStats the same as disabling About Phone>CyanogenMod Statistics>Enable Reporting?

    It's not removing CMStats completely but only the Google Analytics part. Sending stats to stats.cyanogenmod.org will still work.
    Moreover, you can't really say if Google Analytics is disabled. Due to it being proprietary code, it could do nearly anything and the class initializer code is called, even if CMStats is disabled. (I assume they're not doing this, but you can;t know and they always could add this in a future version)

    I.mean by removing the google support what will we get
    And how is this useful

    First: This does not remove Google Support in general. You could still install GAPPS afterwards, but it would be kind of senseless.
    Second: Some people think, that Google is not this "don't be evil" company they're proposing to be. And some people like the idea of privacy and not getting totally tracked by Google, so they do not install GAPPS. If this is not the case for you, then this is just not targeting you. I'm not going to try to convince anyone that privacy is a good thing ;)
    10
    lockclock can be run without google component, I don't think it's fair to remove it, as Google stuff is not required.

    I guess this is a misunderstanding of what freecyngn is about. It is not intended to remove things that do not work without GAPPS, but it removes proprietary parts. CMAccount is not breaking (but just unusable) without GAPPS and Google Analytics tracking does not require GAPPS at all to function. However both use proprietary libraries to do their work.
    LockClock includes the proprietary play services client library (see here) and as such is proprietary. As it's not easily patchable (as being done with the settings app to remove google analytics), the only way to remove the proprietary parts is to remove LockClock completely.

    @MaR-V-iN any plans to update this to Lollipop?

    I didn't look a lot into CM12 yet, as some of the relevant proprietary parts (cmstats) are not (yet) merged. I'll wait for the first official cm 12 nightly before starting to port freecyngn.
    7
    Thanks, I didn't know that. I understand your are more concerned with proprietary software then removing everything Google. Sorry if I digress but do you think AGPS and Captive Portal Check are things to worry about if one would prefer a ROM that doesn't let Google know too much (if anything) about user behaviour or data?

    In fact, there is not much to fear about both AGPS and captive portal detection, as both use minimal requests without identifying tokens, which makes it impossible for google to distinguish users. However it should be possible to disable most of them:
    To disable captive portal check for wifis, run
    Code:
    adb shell settings put global captive_portal_detection_enabled 0
    with your phone connected to your pc. There is no easy way to disable mobile provisioning check, but you can change the test server, eg:
    Code:
    adb shell settings put global captive_portal_server localhost
    To disable SUPL (which is the AGPS system used within android) you can change SUPL_HOST in /system/etc/gps.conf accordingly.

    However the log does not mention anything related to CMAccount and Voice+. I'm not familar with those apps, but this is what adb says after applying freecyngn:
    Code:
    aguaz@linuxbox:~$ adb shell pm list packages | egrep "account|voice"
    package:com.android.voicedialer
    package:com.cyanogenmod.account

    Thanks for pointing this out, recent changes on CMAccount caused freecyngn to not remove it. This affects all users: Please update freecyngn to v0.4 by flashing it over your current ROM (no wipe/etc required)

    Voice+ is not VoiceDialer: Voice+ is a service to sync Google Voice SMS with Android native SMS, VoiceDialer is a small app using a registered speech-to-text service for some nice commands. VoiceDialer is completely free, but as there is no such service beside Google's one, I decided to add it to the list of removed files.

    CM btw has just updated their terms: http://www.cyanogenmod.org/blog/privacy-policy-and-terms-of-use-update
    Are there any changes affecting the ROM?

    I can't say if this in any or all ways affects the ROM, as this terms apply to their site, services and products. However it seems like things are getting even worse, at least from what the pointed out in their blog post...
    7
    I believe as of now, at least in the nightlies I'm using for all my devices, Google Analytics is gone from Settings in CM 12.1, can anyone else confirm ?

    That's true for CyanogenMod nightlies later than July 9.

    I released v1.0 of freecyngn, which only removes the APKs containing proprietary code or rely on it so you can use it with latest CM12.