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

Search This thread

ewilly88

Member
Jan 5, 2011
17
7
For me script failed at his end because the zip command isn't reconized (zip program is missing in my ROM). Is it possible to include it in the falshable zip ?
 
Last edited:

Itcouldbeyou

Member
May 14, 2010
29
21
Nice Work!
Would it be possible to convert this to an auto-patcher script? That way I could auto-build the mod together with openpdroid and also get a deinstallation script.
Still nice to have the onboard flash as well.
 
Last edited:

sioxz

Senior Member
Sep 8, 2012
152
25
28
lidköping
this might be a stupd question but does this work on the PACman rom i am only asking because it's so diffrent from the orginal CM but it still uses the CM as base so answere if you feel like it
 

Lazy79

Senior Member
Dec 13, 2008
1,187
245
44
Munich
politics2day.eu
this might be a stupd question but does this work on the PACman rom i am only asking because it's so diffrent from the orginal CM but it still uses the CM as base so answere if you feel like it

I doubt it will work on PAC.. At least make a backup before trying but I even wouldn't try it because I'm sure the settings source is too different for the script.
 

Ricky Divjakovski

Recognized Developer / Inactive RC
Feb 4, 2013
5,287
7,685
28
Sydney
im not sure why you just didnt make this a script for pc's, it would be much quicker just to unzip a rom and decompile/disassemble any files required and it would be alot quicker!
great job! interesting!
 

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,293
this might be a stupd question but does this work on the PACman rom i am only asking because it's so diffrent from the orginal CM but it still uses the CM as base so answere if you feel like it

I doubt it will work on PAC.. At least make a backup before trying but I even wouldn't try it because I'm sure the settings source is too different for the script.

If PAC uses cmstats (i'm not sure about this), then they maybe also use the google analytics stuff. If so, the patch will most likely work. It's generic and does not require a specific settings app.


Would it be possible to convert this to an auto-patcher script? That way I could auto-build the mod together with openpdroid and also get a deinstallation script.
Still nice to have the onboard flash as well.

im not sure why you just didnt make this a script for pc's, it would be much quicker just to unzip a rom and decompile/disassemble any files required and it would be alot quicker!

A pc script would be nice, yes. I think i'll take a look at the auto-patcher.
There were two reasons for me to do this on device: some people don't have regular pc access and i don't wanted to mess around with windows :)
 

Ricky Divjakovski

Recognized Developer / Inactive RC
Feb 4, 2013
5,287
7,685
28
Sydney
If PAC uses cmstats (i'm not sure about this), then they maybe also use the google analytics stuff. If so, the patch will most likely work. It's generic and does not require a specific settings app.






A pc script would be nice, yes. I think i'll take a look at the auto-patcher.
There were two reasons for me to do this on device: some people don't have regular pc access and i don't wanted to mess around with windows :)

Well im pretty handy with scripts, let me know if you need a hand!
 
  • Like
Reactions: julkidi and IRKONIK

IRKONIK

Senior Member
Feb 5, 2013
377
119
Pyongyang
Nice to hear!

No problem there, AutoPatcher works as well under Linux.:D

"[...]AutoPatcher works better under Linux [...]" Fixed that for you ;)

I use the auto patcher nearly daily, since Temasek updates his unofficial cm11 so often (which is awesome!).
It's a cool project!
I would love to see freecyngn with the auto-patcher. It's so comfortable! :good:

Cheers!

I really like where this project is going, since I really disliked the steps CM did (especially what they tried with focal!).

Thank you! :highfive:
 
  • Like
Reactions: Ricky Divjakovski

melkhatt

Senior Member
Apr 18, 2007
153
14
I'm using a LegacyXperia Kitkat build.

In first build , the script works well.

But in the last update, the script seems not working

- The "voice+.apk" is renamed "VoicePlus.apk"

-Before when patching the system it tooks +/- 10 seconds. Now +/- 1 sec. So i think it's not workin' anymore

logfile:
Code:
Creating directory structure...
Extracting classes.dex from files...
Archive:  /cache/recovery/freecyngn/noAnalytics-dvk.jar
  inflating: classes.dex
Archive:  /system/priv-app/Settings.apk
  inflating: classes.dex
Disassemble classes.dex...
 
Last edited:

MaR-V-iN

Senior Member
Apr 23, 2011
496
2,293

fermasia

Senior Member
Mar 25, 2013
1,094
1,948
Buenos Aires
Thanks for your report.
I switched from cm to omnirom, so i do not need this script any longer. However I'm willing to keep maintaining it (as long as nobody else does).

Could you try the latest pre-release: https://github.com/mar-v-in/freecyngn/releases/download/v0.3.1/freecyngn-flashable.zip
If it worked, please also try if, after reflashing the rom, the changes are still active.

Hey man, congrats for your work. Just one question: does this mean Omni builds don't include Google Analytics?

Sent from my GT-I9300 using XDA Premium 4 mobile app
 

peleeks

Member
Sep 30, 2012
14
2
Thank you for your hard work and for supporting this patch.

I've upgraded to CM11 M2 version for Nexus 5:
- v0.3.1 pre-release did nothing.
- v0.2 release (current stable) printed line about patching Settings app, did not display any errors. However it took less than second to patch it, I'm not sure it worked.

How to verify, that patch has worked? There are no log in /system/freecygn.
 

aejazhaq

Senior Member
May 25, 2013
67
7
Hey thanks for the script...i flashed it but was wondering, how do i know if it works. I mean any way to be sure or see whats changed. I tried deleting the netstats to get a clean reset. I thought the Android OS would stop after this but it does not. any idea what that might be from?

PS: im also still getting google services usage too. I would love to know whats stopped.
 

wkwkwk

Senior Member
Jun 28, 2008
359
76
If the script ran only for a second or so, it didn't work.

I had a look and after setting LD_LIBRARY and all the other stuff, all commands fail with segmentation fault.
Looks to be a bug in TWRP 2.6.3.0 (possibly earlier?), with the latest TWRP 2.6.3.3 it works just fine, upgrade and try again.

Not sure about CWM as I don't use it but if you run an older TWRP and it fails, try to upgrade to the latest one available.
 

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.