From: Ciaran Gultnieks Date: Tue, 9 Oct 2012 19:21:43 +0000 (+0100) Subject: Anal-tics X-Git-Tag: 0.1~719 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=34af60428b5539a814298280244f7c7ac33d3042;p=fdroidserver.git Anal-tics --- diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 4e336885..f9cc81f6 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -1402,6 +1402,38 @@ def prepare_source(vcs, app, build, build_dir, extlib_dir, sdk_path, ndk_path, j if p.returncode != 0: raise BuildException("Error running pre-build command", out, err) + if build.get('anal-tics', 'no') == 'yes': + fp = os.path.join(root_dir, 'src', 'com', 'google', 'android', 'apps', 'analytics') + os.makedirs(fp) + with open(os.path.join(fp, 'GoogleAnalyticsTracker.java'), 'w') as f: + f.write(""" + package com.google.android.apps.analytics; + public class GoogleAnalyticsTracker { + private static GoogleAnalyticsTracker instance; + private GoogleAnalyticsTracker() { + } + public static GoogleAnalyticsTracker getInstance() { + if(instance == null) + instance = new GoogleAnalyticsTracker(); + return instance; + } + public void start(String i,int think ,Object not) { + } + public void dispatch() { + } + public void stop() { + } + public void setProductVersion(String uh, String hu) { + } + public void trackEvent(String that,String just,String aint,int happening) { + } + public void trackPageView(String nope) { + } + public void setCustomVar(int mind,String your,String own,int business) { + } + } + """) + # Special case init functions for funambol... if build.get('initfun', 'no') == "yes":