mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 20:59:54 +01:00
Merge branch '697-include-commit-id-in-crash-reports-and-feedback' into 'master'
Include Commit ID in crash reports and feedback Closes #697 See merge request !461
This commit is contained in:
@@ -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 {
|
android {
|
||||||
compileSdkVersion 23
|
compileSdkVersion 23
|
||||||
buildToolsVersion "23.0.3"
|
buildToolsVersion "23.0.3"
|
||||||
@@ -70,6 +83,7 @@ android {
|
|||||||
minSdkVersion 14
|
minSdkVersion 14
|
||||||
targetSdkVersion 22
|
targetSdkVersion 22
|
||||||
resValue "string", "app_package", "org.briarproject.briar"
|
resValue "string", "app_package", "org.briarproject.briar"
|
||||||
|
buildConfigField "String", "GitHash", "\"${getGitHash()}\""
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTypes {
|
buildTypes {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import android.support.annotation.NonNull;
|
|||||||
import org.acra.builder.ReportBuilder;
|
import org.acra.builder.ReportBuilder;
|
||||||
import org.acra.builder.ReportPrimer;
|
import org.acra.builder.ReportPrimer;
|
||||||
import org.briarproject.bramble.util.StringUtils;
|
import org.briarproject.bramble.util.StringUtils;
|
||||||
|
import org.briarproject.briar.BuildConfig;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -213,6 +214,9 @@ public class BriarReportPrimer implements ReportPrimer {
|
|||||||
customData.put("Bluetooth address from settings",
|
customData.put("Bluetooth address from settings",
|
||||||
scrubMacAddress(btSettingsAddr));
|
scrubMacAddress(btSettingsAddr));
|
||||||
|
|
||||||
|
// Git commit ID
|
||||||
|
customData.put("Commit ID", BuildConfig.GitHash);
|
||||||
|
|
||||||
return Collections.unmodifiableMap(customData);
|
return Collections.unmodifiableMap(customData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user