use r1.5 and no_analytics patch for osmand~ and activate for curiosity

This commit is contained in:
David Black 2013-08-04 17:07:21 +01:00
parent 9f935935c2
commit e6c418c680
2 changed files with 201 additions and 39 deletions

View file

@ -60,51 +60,60 @@ cp -r ../DataExtractionOSM/build/lib/ libs/
# Could try making https://github.com/osmandapp/OsmAnd-external-qtbase a srclib too
# Don't really understand what the other build.xmls do: they don't appear to put jars in classpath
# Jars haven't been verified
Build Version:1.4-MIPS,141,!r1.4,forcevercode=yes,\
rm=SherlockBar/build.xml,subdir=OsmAnd,encoding=utf-8,\
srclibs=tools@9b4c9da995;core@r1.1.4,prebuild=\
sed -i 's/debuggable="true"/debuggable="false"/g' AndroidManifest.xml && \
$$SDK$$/tools/android update project -p ../SherlockBar && \
sed -i 's/"\${aapt.ignore.assets}"/"\${aapt.ignore.assets}" \
libraryRFileRefid="project.library.bin.r.file.path"/g' build.xml && \
sed -i 's/app_version">[^<]*/app_version">1.4-MIPS/' \
res/values/no_translate.xml && sed -i '/keys/d' ant.properties,build=\
ANDROID_SDK=$$SDK$$ ANDROID_NDK=$$NDK$$ OSMAND_MIPS_ONLY=true ./ndk-build.sh && \
ant jar native-libs -f $$tools$$/OsmAndMapCreator/build.xml && \
ant build -f ../OsmAnd-java/build.xml,buildjni=no
Build Version:1.4-x86,142,!r1.4,forcevercode=yes,\
rm=SherlockBar/build.xml,subdir=OsmAnd,encoding=utf-8,\
srclibs=tools@9b4c9da995;core@r1.1.4,prebuild=\
sed -i 's/debuggable="true"/debuggable="false"/g' AndroidManifest.xml && \
$$SDK$$/tools/android update project -p ../SherlockBar && \
sed -i 's/"\${aapt.ignore.assets}"/"\${aapt.ignore.assets}" \
libraryRFileRefid="project.library.bin.r.file.path"/g' build.xml && \
sed -i 's/app_version">[^<]*/app_version">1.4-X86/' \
res/values/no_translate.xml && sed -i '/keys/d' ant.properties,build=\
ANDROID_SDK=$$SDK$$ ANDROID_NDK=$$NDK$$ OSMAND_X86_ONLY=true ./ndk-build.sh && \
ant jar native-libs -f $$tools$$/OsmAndMapCreator/build.xml && \
ant build -f ../OsmAnd-java/build.xml,buildjni=no
Build Version:1.4-ARM,143,!permission denied in build/srclib/core/android-configure.sh at r1.4,forcevercode=yes,\
rm=SherlockBar/build.xml,subdir=OsmAnd,encoding=utf-8,\
srclibs=tools@9b4c9da995;core@r1.1.4,prebuild=\
sed -i 's/debuggable="true"/debuggable="false"/g' AndroidManifest.xml && \
$$SDK$$/tools/android update project -p ../SherlockBar && \
sed -i 's/"\${aapt.ignore.assets}"/"\${aapt.ignore.assets}" \
libraryRFileRefid="project.library.bin.r.file.path"/g' build.xml && \
sed -i 's/app_version">[^<]*/app_version">1.4-ARM/' \
res/values/no_translate.xml && sed -i '/keys/d' ant.properties,build=\
ANDROID_SDK=$$SDK$$ ANDROID_NDK=$$NDK$$ OSMAND_ARM_ONLY=true ./ndk-build.sh && \
ant jar native-libs -f $$tools$$/OsmAndMapCreator/build.xml && \
ant build -f ../OsmAnd-java/build.xml,buildjni=no
Build Version:1.5-MIPS,143,!r1.5,subdir=OsmAnd,\
forcevercode=yes,\
rm=SherlockBar/build.xml,\
encoding=utf-8,\
srclibs=tools@bfee93a8d;core@r1.1.4;resources@836be71481,\
patch=remove_analytics_android_145.diff,\
prebuild=rm ../../core/OsmAnd-java/src/net/osmand/plus/download/DownloadTracker.java && \
sed -i 's/debuggable="true"/debuggable="false"/g' AndroidManifest.xml && \
$$SDK$$/tools/android update project -p ../SherlockBar && \
sed -i 's/app_version">[^<]*/app_version">1.5-MIPS/' \
res/values/no_translate.xml && sed -i '/keys/d' ant.properties,\
build=ANDROID_SDK=$$SDK$$ ANDROID_NDK=$$NDK$$ OSMAND_MIPS_ONLY=true ./ndk-build.sh && \
ant jar native-libs -f $$tools$$/OsmAndMapCreator/build.xml && \
ant build -f ../OsmAnd-java/build.xml,\
buildjni=no
# In next version: GA maybe, Qt, will need to source "resources" srclib
# and no android-configure.sh script in v1.5/core
Build Version:1.5-x86,144,!r1.5,subdir=OsmAnd,\
forcevercode=yes,\
rm=SherlockBar/build.xml,\
encoding=utf-8,\
srclibs=tools@bfee93a8d;core@r1.1.4;resources@836be71481,\
patch=remove_analytics_android_145.diff,\
prebuild=rm ../../core/OsmAnd-java/src/net/osmand/plus/download/DownloadTracker.java && \
sed -i 's/debuggable="true"/debuggable="false"/g' AndroidManifest.xml && \
$$SDK$$/tools/android update project -p ../SherlockBar && \
sed -i 's/app_version">[^<]*/app_version">1.5-X86/' \
res/values/no_translate.xml && sed -i '/keys/d' ant.properties,\
build=ANDROID_SDK=$$SDK$$ ANDROID_NDK=$$NDK$$ OSMAND_X86_ONLY=true ./ndk-build.sh && \
ant jar native-libs -f $$tools$$/OsmAndMapCreator/build.xml && \
ant build -f ../OsmAnd-java/build.xml,\
buildjni=no
Build Version:1.5-ARM,145,r1.5,subdir=OsmAnd,\
forcevercode=yes,\
rm=SherlockBar/build.xml,\
encoding=utf-8,\
srclibs=tools@bfee93a8d;core@r1.1.4;resources@836be71481,\
patch=remove_analytics_android_145.diff,\
prebuild=rm ../../core/OsmAnd-java/src/net/osmand/plus/download/DownloadTracker.java && \
sed -i 's/debuggable="true"/debuggable="false"/g' AndroidManifest.xml && \
$$SDK$$/tools/android update project -p ../SherlockBar && \
sed -i 's/app_version">[^<]*/app_version">1.5-ARM/' \
res/values/no_translate.xml && sed -i '/keys/d' ant.properties,\
build=ANDROID_SDK=$$SDK$$ ANDROID_NDK=$$NDK$$ OSMAND_ARM_ONLY=true ./ndk-build.sh && \
ant jar native-libs -f $$tools$$/OsmAndMapCreator/build.xml && \
ant build -f ../OsmAnd-java/build.xml,\
buildjni=no
# Qt in new_core branch
# see https://github.com/osmandapp/OsmAnd-manifest/blob/master/current_release.xml
Auto Update Mode:None
Update Check Mode:None
# New version in new branch
Current Version:1.5
# Version code system is unfathomable
Current Version Code:145

View file

@ -0,0 +1,153 @@
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
index 072fd1a..f4f7033 100644
--- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
+++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexesThread.java
@@ -234,7 +234,6 @@ public class DownloadIndexesThread {
if (entry.existingBackupFile != null) {
Algorithms.removeAllFiles(entry.existingBackupFile);
}
- trackEvent(entry);
publishProgress(entry);
}
}
@@ -293,17 +292,6 @@ public class DownloadIndexesThread {
return null;
}
- private void trackEvent(DownloadEntry entry) {
- String v = Version.getAppName(app);
- if (Version.isProductionVersion(app)) {
- v = Version.getFullVersion(app);
- } else {
- v += " test";
- }
- new DownloadTracker().trackEvent(app, v, Version.getAppName(app),
- entry.baseName, 1, app.getString(R.string.ga_api_key));
- }
-
@Override
public void showWarning(String warning) {
publishProgress(warning);
@@ -607,4 +595,4 @@ public class DownloadIndexesThread {
}
-}
\ No newline at end of file
+}
diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadTracker.java b/OsmAnd/src/net/osmand/plus/download/DownloadTracker.java
deleted file mode 100644
index e21529c..0000000
--- a/OsmAnd/src/net/osmand/plus/download/DownloadTracker.java
+++ /dev/null
@@ -1,110 +0,0 @@
-package net.osmand.plus.download;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.text.MessageFormat;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Random;
-
-import net.osmand.PlatformUtil;
-import net.osmand.plus.ClientContext;
-import net.osmand.plus.Version;
-
-import org.apache.commons.logging.Log;
-
-public class DownloadTracker {
- private static final Log log = PlatformUtil.getLog(DownloadTracker.class);
-
- private Map<String, String> getCustomVars(ClientContext ctx) {
- Map<String, String> map = new LinkedHashMap<String, String>();
- map.put("App", Version.getFullVersion(ctx));
- map.put("Device", ctx.getInternalAPI().getDeviceName());
- map.put("Brand", ctx.getInternalAPI().getBrandName());
- map.put("Model", ctx.getInternalAPI().getModelName());
- map.put("Package", ctx.getInternalAPI().getPackageName());
-
- map.put("Version name", ctx.getInternalAPI().getVersionName());
- map.put("Version code", ctx.getInternalAPI().getVersionCode()+"");
- return map;
- }
-
- private String randomNumber() {
- return (new Random(System.currentTimeMillis()).nextInt(100000000) + 100000000) + "";
- }
-
- final String beaconUrl = "http://www.google-analytics.com/__utm.gif";
- final String analyticsVersion = "4.3"; // Analytics version - AnalyticsVersion
-
- public void trackEvent(ClientContext a,
- String category, String action, String label, int value, String trackingAcount) {
- Map<String, String> parameters = new LinkedHashMap<String, String>();
- try {
- Map<String, String> customVariables = getCustomVars(a);
- parameters.put("AnalyticsVersion", analyticsVersion);
- parameters.put("utmn", randomNumber());
- parameters.put("utmhn", "http://app.osmand.net");
- parameters.put("utmni", "1");
- parameters.put("utmt", "event");
-
- StringBuilder customVars = new StringBuilder();
- Iterator<Entry<String, String>> customs = customVariables.entrySet().iterator();
- for (int i = 0; i < customVariables.size(); i++) {
- Entry<String, String> n = customs.next();
- if (i > 0) {
- customVars.append("*");
- }
- // "'" => "'0", ')' => "'1", '*' => "'2", '!' => "'3",
- customVars.append((i + 1) + "!").append((n.getKey() + n.getValue()));
- }
-
- parameters.put("utmcs", "UTF-8");
- parameters.put("utmul", "en");
- parameters.put("utmhid", (System.currentTimeMillis() / 1000) + "");
- parameters.put("utmac", trackingAcount);
- String domainHash = "app.osmand.net".hashCode() + "";
-
- String utma = domainHash + ".";
- File fl = a.getAppPath(".nomedia");
- if (fl.exists()) {
- utma += (fl.lastModified()) + ".";
- } else {
- utma += (randomNumber()) + ".";
- }
- utma += ((System.currentTimeMillis() / 1000) + ".");
- utma += ((System.currentTimeMillis() / 1000) + ".");
- utma += ((System.currentTimeMillis() / 1000) + ".");
- utma += "1";
- parameters.put("utmcc", "__utma=" + utma + ";");
- parameters.put("utme", MessageFormat.format("5({0}*{1}*{2})({3})", category, action, label == null ? "" : label, value)
- + customVars);
-
- StringBuilder urlString = new StringBuilder(beaconUrl + "?");
- Iterator<Entry<String, String>> it = parameters.entrySet().iterator();
- while (it.hasNext()) {
- Entry<String, String> e = it.next();
- urlString.append(e.getKey()).append("=").append(URLEncoder.encode(e.getValue(), "UTF-8"));
- if (it.hasNext()) {
- urlString.append("&");
- }
- }
-
- log.debug(urlString);
- URL url = new URL(urlString.toString());
- HttpURLConnection conn = (HttpURLConnection) url.openConnection();
- conn.setConnectTimeout(5000);
- conn.setDoInput(false);
- conn.setDoOutput(false);
- conn.connect();
- log.info("Response analytics is " + conn.getResponseCode() + " " + conn.getResponseMessage());
- } catch (IOException e) {
- log.error(e.getMessage(), e);
- }
- }
-
-}