Finish v1.47.16(529)
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
All checks were successful
WMS - Android (New)/pipeline/head This commit looks good
This commit is contained in:
commit
2f6f9b54c2
@ -11,8 +11,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 528
|
||||
def appVersionName = '1.47.15'
|
||||
def appVersionCode = 529
|
||||
def appVersionName = '1.47.16'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -280,15 +280,27 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
List<MailAttachmentDTO> attachmentDTOList = new ArrayList<>();
|
||||
|
||||
if (fileToShare != null) {
|
||||
var htmlContent = createAppLogAttachment(fileToShare);
|
||||
try {
|
||||
var htmlContent = createAppLogAttachment(fileToShare);
|
||||
|
||||
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
|
||||
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
||||
byte[] buffer = htmlContent.getBytes();//specify the size to allow.
|
||||
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
||||
|
||||
var logAttachment = new MailAttachmentDTO()
|
||||
.setFileName("wms_log.html")
|
||||
.setFileb64Content(base64);
|
||||
attachmentDTOList.add(logAttachment);
|
||||
var logAttachment = new MailAttachmentDTO()
|
||||
.setFileName("wms_log.html")
|
||||
.setFileb64Content(base64);
|
||||
attachmentDTOList.add(logAttachment);
|
||||
} catch (Exception ex) {
|
||||
String rawLogFile = getRawLogAttachment(fileToShare);
|
||||
|
||||
byte[] buffer = rawLogFile.getBytes();//specify the size to allow.
|
||||
String base64 = Base64.encodeToString(buffer, Base64.NO_WRAP);
|
||||
|
||||
var logAttachment = new MailAttachmentDTO()
|
||||
.setFileName("raw_log.txt")
|
||||
.setFileb64Content(base64);
|
||||
attachmentDTOList.add(logAttachment);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -461,4 +473,24 @@ public class MainSettingsFragment extends PreferenceFragmentCompat implements IT
|
||||
|
||||
return htmlContent.toString();
|
||||
}
|
||||
|
||||
private String getRawLogAttachment(File logFile) {
|
||||
//Read text from file
|
||||
StringBuilder text = new StringBuilder();
|
||||
|
||||
try {
|
||||
BufferedReader br = new BufferedReader(new FileReader(logFile));
|
||||
String line;
|
||||
|
||||
while ((line = br.readLine()) != null) {
|
||||
text.append(line);
|
||||
text.append('\n');
|
||||
}
|
||||
br.close();
|
||||
} catch (IOException e) {
|
||||
//You'll need to add proper error handling here
|
||||
}
|
||||
|
||||
return text.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user