Permalink
Browse files

removing date from stack so hash can work

  • Loading branch information...
1 parent fd1aefa commit f081e82090029ca13f4b0040020c59a69e8d91c9 Jon Vlachoyiannis committed Mar 17, 2011
Binary file not shown.
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="hello">Please crush!</string>
+ <string name="hello">Crush the app, reopen it and check your dashboard.</string>
<string name="app_name">Sfalma Example</string>
</resources>
@@ -88,4 +88,13 @@ public static String MD5 (String data) throws Exception {
return new BigInteger(1, m.digest()).toString(16);
}
+ // FIXME: This need some optimizing
+ public static String removeFirstLine(String in) {
+ String out = "";
+ int endOfFirstLine = in.indexOf("\n");
+ if (endOfFirstLine != -1 && endOfFirstLine+1 < in.length() ) {
+ out = in.substring(endOfFirstLine + 1);
+ }
+ return out;
+ }
}
@@ -490,7 +490,7 @@ private static void submitStackTraces(ArrayList<String[]> list, final Context co
List <NameValuePair> nvps = new ArrayList <NameValuePair>();
nvps.add(new BasicNameValuePair("data", Sfalma.createJSON(G.APP_PACKAGE, version, phoneModel, androidVersion, stacktrace, isWifiOn(context), isMobileNetworkOn(context), isGPSOn(context))));
- nvps.add(new BasicNameValuePair("hash", Sfalma.MD5(stacktrace)));
+ nvps.add(new BasicNameValuePair("hash", Sfalma.MD5(Sfalma.removeFirstLine(stacktrace))));
httpPost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));
// We don't care about the response, so we just hope it

0 comments on commit f081e82

Please sign in to comment.