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

Search This thread

Memethecat

Senior Member
Mar 26, 2013
176
80
Isle of Yew
I can also confirm that the TWRP version seems to make a difference.

I flashed freecyngn in TWRP 2.6.3.0 it executed instantly (to fast to decompile), but the freecyngn script installed itself in /system/.

After updating to TWRP 2.6.3.3 freecyngn took 8-10 seconds to install, still fast but more reassuring. Again freecyngn script showed up in /system.

I ran network log and it showed (uid 1000 - settings/settings storage/key chain/android system/input device) all connecting to 149.254.x.x this is T-Mobile.

Previously on TWRP 2.6.3.0, uid 1000 had connected to T-Mobile and 173.194.x.x (Google) at the same time.

I can only assume that the 173.194.x.x packets were Google Analytics, and they've now stopped.
;))
 

Liberr

Senior Member
Mar 2, 2014
67
16
Amsterdam
I love this script! :good: Does this mean CM doesn't communicate whatsoever with Google at any moment from any part of the OS? Or is there still a system thingy that phones home..?
 

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,292
Hi marvin.

I want to make the rom/settings.apk analytics free from out of the box.

Please guide me how.

Take a look at https://github.com/mar-v-in/NoAnalytics/

I love this script! :good: Does this mean CM doesn't communicate whatsoever with Google at any moment from any part of the OS? Or is there still a system thingy that phones home..?

There are still parts of the system that are open source and communicate with Google (eg. AGPS and captive portal check). This is just to remove proprietary parts in CyanogenMod.
 
  • Like
Reactions: Liberr and chraso

Liberr

Senior Member
Mar 2, 2014
67
16
Amsterdam
There are still parts of the system that are open source and communicate with Google (eg. AGPS and captive portal check). This is just to remove proprietary parts in CyanogenMod.

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 context. It is sort of my aim to get a Google free rom (hence I use your tool), and use the F-Droid repository only..
 

aguaz

Senior Member
Jan 16, 2014
136
31
You are a hero MaR-V-iN!
Currently there is no free ROM supporting my device, so I'm very thankful for your effort.

freecyngn... removes... Google Analytics..., CMAccount and Voice+
I'm on a late May cm-11 nightly. freecyngn took its time and according to the log noAnalytics was inserted fine:
Code:
Creating directory structure...
Extracting classes.dex from noAnalytics...
Archive:  /system/freecyngn/noAnalytics-dvk.jar
  inflating: classes.dex
Extracting classes.dex from Settings...
Archive:  /system/priv-app/Settings.apk
  inflating: classes.dex
Disassemble classes.dex from Settings...
Disassemble classes.dex from noAnalytics...
Remove old Google Analytics...
Insert noAnalytics...
Reassembling classes.dex...
Adding new classes.dex to Settings.apk...
updating: classes.dex (stored 0%)
Cleaning up apps...
Installing self-reflasher...

done

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

They both also still show up in Settings --> Apps --> All

?

---------- Post added at 12:27 AM ---------- Previous post was at 12:12 AM ----------

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?
 

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,292
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...
 

dvdram

Senior Member
Jun 30, 2014
211
59
Hello!

I flashed the script to my Galaxy S3, which is running CM, latest nightly, but the script doesn't seem to do anything: there are still too many Google processes afterwards. The only thing I want to keep is the Play Store. Has any one made the same experience? Or can anyone point me to an appropriate thread? After all, I am aware that this is not the right place to discuss this. Thanks in advance very much!
 

aguaz

Senior Member
Jan 16, 2014
136
31
For some reason freecyngn does not work when:

- data partition is empty (eg applying freecyngn directly after flashing CM after a full wipe including data)
- data partition is non existent

!?



CM 'sources' reveal actually 2 versions of Google Analytics. Also there is an Admob Ads SDK containing it
Code:
aguaz@linuxbox:cm-11$ find . -name *libGoogleAnalytics*.jar
./external/google/analytics_sdk/libGoogleAnalytics.jar
./external/google/analytics_sdk_v2/libGoogleAnalyticsV2.jar
./external/google/admob_ads_sdk/Add-ons/GoogleAnalyticsAndroid_2.0beta5/libGoogleAnalyticsV2.jar

Does your script take care of all of them?
Can Admob Ads somehow be removed from the ROM altogether?
 
  • Like
Reactions: Ultramanoid

sancho_panzer

Senior Member
Jul 11, 2014
721
828
For some reason freecyngn does not work when:

- data partition is empty (eg applying freecyngn directly after flashing CM after a full wipe including data)
- data partition is non existent
Yes, you must flash CM and make a reboot first before returning to recovery and flash freecyngn.

@MaR-V-iN v0.4.1 and v0.4 are the same file, LockClock isn't removed on v0.4.1, please correct the links.
You should also consider to change thread title to CM10/11.
 

bastei

Senior Member
Feb 18, 2008
91
108
Yes, you must flash CM and make a reboot first before returning to recovery and flash freecyngn.
As my /data partition is encrypted that's a problem for me. @MaR-V-iN do you know if the /system/addon.d/ scripts are executed after entering the encryption password and mounting /data ? Then this would not be a problem, I think.

I noticed a second problem: Using 4ext recovery I'm getting much Segmentation Faults. The problem appears to be are the global variables (export) in the shell script. Removing the "export"s, it is working. Is there a chance to make freecyngn 4ext-compatible?

Anyway: Tanks for this outstanding script! :good:
 

gueschmid

Senior Member
May 10, 2013
96
9
Only for my better understanding (using CM11 with freecyngn 0.40)

If locklock uses GCM but i have no GApps flashed, is there anything i msut be affraid of? Or do the feature only not work?
 

michelsberg

Senior Member
Jul 17, 2012
443
379
If locklock uses GCM but i have no GApps flashed, is there anything i msut be affraid of? Or do the feature only not work?
If I am not totally wrong the GCM client is included in Google Play Services.

If you ha(d/ve) it installed you could/can access the GCM status via *#*#426#*#* (426=GCM) in the dialer.
 

gueschmid

Senior Member
May 10, 2013
96
9
If I am not totally wrong the GCM client is included in Google Play Services.

If you ha(d/ve) it installed you could/can access the GCM status via *#*#426#*#* (426=GCM) in the dialer.

I use freecygcn, because do not want to have Google on my smartphone. But Sancho Panzer wrote that the where no differences betwenn 0.40 and 0.41. So the LockClock still have Probritary Google Code. My Question ist, what LockClock can do (phone home to Google) without having GCM installed.
 

sancho_panzer

Senior Member
Jul 11, 2014
721
828
I use freecygcn, because do not want to have Google on my smartphone. But Sancho Panzer wrote that the where no differences betwenn 0.40 and 0.41. So the LockClock still have Probritary Google Code. My Question ist, what LockClock can do (phone home to Google) without having GCM installed.

You should delete LockClock if you don´t care to lose weather. If you do it will be automatically replaced by system clock, even on lock screen. The advantages are no LockClock Wakelocks + no GPS/Network data = more battery and better privacy. ;)

My advise is you should delete it and if you want weather search F-Droid for something better, like DashClock Widget+BetterWeather.

Edit: I don't use it but I've heard good things about Chronus and it's the most similar to LockClock you can get:

http://xdaforums.com/showthread.php?t=2186734
 
Last edited:

mrrocketdog

Senior Member
Oct 27, 2013
5,061
2,358
My advise is you should delete it and if you want weather search F-Droid for something better, like DashClock Widget+BetterWeather.

Edit: I don't use it but I've heard good things about Chronus and it's the most similar to LockClock you can get:

http://xdaforums.com/showthread.php?t=2186734[/QUOTE]

just deleted lockclock.
thank you. thank you.
i'v read this forum, been using freecyngn for awhile, is there a "delete list" that i missed somewhere?
thanks again.
peace

err on the side of kindness
 

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.