{"action":"created","issue":{"url":"https://api.github.com/repos/ACRA/acra/issues/283","labels_url":"https://api.github.com/repos/ACRA/acra/issues/283/labels{/name}","comments_url":"https://api.github.com/repos/ACRA/acra/issues/283/comments","events_url":"https://api.github.com/repos/ACRA/acra/issues/283/events","html_url":"https://github.com/ACRA/acra/issues/283","id":87769528,"number":283,"title":"Compress data in email to send full logs","user":{"login":"eytans","id":12862752,"avatar_url":"https://avatars.githubusercontent.com/u/12862752?v=3","gravatar_id":"","url":"https://api.github.com/users/eytans","html_url":"https://github.com/eytans","followers_url":"https://api.github.com/users/eytans/followers","following_url":"https://api.github.com/users/eytans/following{/other_user}","gists_url":"https://api.github.com/users/eytans/gists{/gist_id}","starred_url":"https://api.github.com/users/eytans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eytans/subscriptions","organizations_url":"https://api.github.com/users/eytans/orgs","repos_url":"https://api.github.com/users/eytans/repos","events_url":"https://api.github.com/users/eytans/events{/privacy}","received_events_url":"https://api.github.com/users/eytans/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-06-12T15:52:39Z","updated_at":"2015-06-12T23:36:45Z","closed_at":null,"body":"as sending data in email is limited i went on and made my own sender because i wanted more logs.\r\nafter trying  to zip logs into a file and attach to mail i found out it may be very problamatic as not all mail apps attach files properly. in the end i decided to compress and show it as base64 string so ill be able to put it in the end of the mail and inflate it at backend.\r\n\r\nhere is what i do (and after it how to inflate using python):\r\n\r\n    @Override\r\n    public void send(Context context, CrashReportData errorContent) throws ReportSenderException {\r\n\r\n        final String subject = \"Crash Report\";\r\n        String body = \"You can add extra data here\";\r\n\r\n        ReportField[] fields = ACRA.getConfig().customReportContent();\r\n        if(fields.length == 0) {\r\n            fields = ACRAConstants.DEFAULT_MAIL_REPORT_FIELDS;\r\n        }\r\n\r\n        StringBuilder builder = new StringBuilder();\r\n        for (ReportField field : fields) {\r\n            builder.append(field.toString()).append(\"=\");\r\n            builder.append(errorContent.get(field));\r\n            builder.append('\\n');\r\n        }\r\n\r\n        // if old report exists delete it.\r\n        // create zip with all the data\r\n        boolean zipSuccess = false;\r\n        try {\r\n            ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n            OutputStream zip = new DeflaterOutputStream(baos);\r\n            zip.write(builder.toString().getBytes());\r\n            zip.close();\r\n            body += \"\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\";\r\n            body += \"Report Start\\n\";\r\n            body += Base64.encodeToString(baos.toByteArray(), Base64.DEFAULT);\r\n            body += \"Report End\\n\";\r\n            zipSuccess = true;\r\n        } catch (FileNotFoundException e) {\r\n            body += \"\\n\";\r\n            body += builder.toString();\r\n        } catch (IOException e) {\r\n            body += \"\\n\";\r\n            body += builder.toString();\r\n        }\r\n        Log.d(\"MailReport\", \"adding stuff to mail\");\r\n        final Intent emailIntent = new Intent(android.content.Intent.ACTION_SENDTO);\r\n        emailIntent.setData(Uri.fromParts(\"mailto\", ACRA.getConfig().mailTo(), null));\r\n        emailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\r\n        emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);\r\n        emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, body);\r\n        context.startActivity(emailIntent);\r\n        Log.d(\"MailReport\", \"finished\");\r\n    }\r\n\r\npython:\r\nimport zlib\r\nimport base64\r\nbytes = base64.b64decode(base64Data)\r\ntext = zlib.decompress(bytes).decode('utf-8')\r\nfixedText = text.replace('\\uae08', \" \") #as it seems he had a problem with this charecter"},"comment":{"url":"https://api.github.com/repos/ACRA/acra/issues/comments/111641476","html_url":"https://github.com/ACRA/acra/issues/283#issuecomment-111641476","issue_url":"https://api.github.com/repos/ACRA/acra/issues/283","id":111641476,"user":{"login":"eytans","id":12862752,"avatar_url":"https://avatars.githubusercontent.com/u/12862752?v=3","gravatar_id":"","url":"https://api.github.com/users/eytans","html_url":"https://github.com/eytans","followers_url":"https://api.github.com/users/eytans/followers","following_url":"https://api.github.com/users/eytans/following{/other_user}","gists_url":"https://api.github.com/users/eytans/gists{/gist_id}","starred_url":"https://api.github.com/users/eytans/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eytans/subscriptions","organizations_url":"https://api.github.com/users/eytans/orgs","repos_url":"https://api.github.com/users/eytans/repos","events_url":"https://api.github.com/users/eytans/events{/privacy}","received_events_url":"https://api.github.com/users/eytans/received_events","type":"User","site_admin":false},"created_at":"2015-06-12T23:36:45Z","updated_at":"2015-06-12T23:36:45Z","body":"Actually i just wanted to offer this as an enhancement and didn't find how to mark it as one. I posted this code to make it easier although its pretty simple. I thought maybe a mode you will want to add a mode/configuration in the default mail sender."}}