Skip to content
Snippets Groups Projects
Verified Commit 1c6be2fb authored by Torsten Grote's avatar Torsten Grote
Browse files

Include Commit ID in crash reports and feedback

parent e7a26c42
No related branches found
No related tags found
No related merge requests found
......@@ -62,6 +62,19 @@ dependencyVerification {
]
}
def getGitHash = { ->
def stdout = new ByteArrayOutputStream()
try {
exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (Exception ignored) {
return "No commit hash"
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
......@@ -70,6 +83,7 @@ android {
minSdkVersion 14
targetSdkVersion 22
resValue "string", "app_package", "org.briarproject.briar"
buildConfigField "String", "GitHash", "\"${getGitHash()}\""
}
buildTypes {
......
......@@ -17,6 +17,7 @@ import android.support.annotation.NonNull;
import org.acra.builder.ReportBuilder;
import org.acra.builder.ReportPrimer;
import org.briarproject.bramble.util.StringUtils;
import org.briarproject.briar.BuildConfig;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
......@@ -213,6 +214,9 @@ public class BriarReportPrimer implements ReportPrimer {
customData.put("Bluetooth address from settings",
scrubMacAddress(btSettingsAddr));
// Git commit ID
customData.put("Commit ID", BuildConfig.GitHash);
return Collections.unmodifiableMap(customData);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment