parent
32296910df
commit
8fb43b29b2
@ -73,12 +73,12 @@ public final class Languages {
|
||||
return singleton;
|
||||
}
|
||||
|
||||
@TargetApi(17)
|
||||
/**
|
||||
* Handles setting the language if it is different than the current language,
|
||||
* or different than the current system-wide locale. The preference is cleared
|
||||
* if the language matches the system-wide locale or "System Default" is chosen.
|
||||
*/
|
||||
@TargetApi(17)
|
||||
public static void setLanguage(final ContextWrapper contextWrapper) {
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
Utils.debugLog(TAG, "Languages.setLanguage() ignored on >= android-24");
|
||||
|
@ -10,9 +10,6 @@ import org.acra.collections.ImmutableSet;
|
||||
import org.acra.collector.CrashReportData;
|
||||
import org.acra.config.ACRAConfiguration;
|
||||
import org.acra.sender.ReportSender;
|
||||
import org.acra.sender.ReportSenderException;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class CrashReportSender implements ReportSender {
|
||||
|
||||
@ -24,7 +21,7 @@ public class CrashReportSender implements ReportSender {
|
||||
|
||||
public void send(@NonNull Context context, @NonNull CrashReportData errorContent) {
|
||||
Intent emailIntent = new Intent("android.intent.action.SENDTO");
|
||||
emailIntent.setData(Uri.fromParts("mailto", this.config.mailTo(), (String) null));
|
||||
emailIntent.setData(Uri.fromParts("mailto", this.config.mailTo(), null));
|
||||
emailIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
String[] subjectBody = this.buildSubjectBody(context, errorContent);
|
||||
emailIntent.putExtra("android.intent.extra.SUBJECT", subjectBody[0]);
|
||||
@ -33,17 +30,14 @@ public class CrashReportSender implements ReportSender {
|
||||
}
|
||||
|
||||
private String[] buildSubjectBody(Context context, CrashReportData errorContent) {
|
||||
ImmutableSet fields = this.config.getReportFields();
|
||||
ImmutableSet<ReportField> fields = this.config.getReportFields();
|
||||
if (fields.isEmpty()) {
|
||||
return new String[]{"No ACRA Report Fields found."};
|
||||
}
|
||||
|
||||
String subject = context.getPackageName() + " Crash Report";
|
||||
StringBuilder builder = new StringBuilder();
|
||||
Iterator var4 = fields.iterator();
|
||||
|
||||
while (var4.hasNext()) {
|
||||
ReportField field = (ReportField) var4.next();
|
||||
for (ReportField field : fields) {
|
||||
builder.append(field.toString()).append('=');
|
||||
builder.append(errorContent.get(field));
|
||||
builder.append('\n');
|
||||
|
@ -462,12 +462,14 @@ public class Apk extends ValueObject implements Comparable<Apk>, Parcelable {
|
||||
}
|
||||
|
||||
@JsonProperty("uses-permission")
|
||||
private void setUsesPermission(Object[][] permissions) { // NOPMD
|
||||
@SuppressWarnings("unused")
|
||||
private void setUsesPermission(Object[][] permissions) {
|
||||
setRequestedPermissions(permissions, 0);
|
||||
}
|
||||
|
||||
@JsonProperty("uses-permission-sdk-23")
|
||||
private void setUsesPermissionSdk23(Object[][] permissions) { // NOPMD
|
||||
@SuppressWarnings("unused")
|
||||
private void setUsesPermissionSdk23(Object[][] permissions) {
|
||||
setRequestedPermissions(permissions, 23);
|
||||
}
|
||||
|
||||
|
@ -42,16 +42,16 @@ public class SanitizedFile extends File {
|
||||
* the path to an installed .apk on disk. In such situations, we can't meaningfully
|
||||
* sanitize it, but will still need to pass to a function which only allows SanitizedFile's
|
||||
* as arguments (because they interact with, e.g. shells).
|
||||
*
|
||||
* <p>
|
||||
* To illustrate, imagine perfectly valid file path: "/tmp/../secret/file.txt",
|
||||
* one cannot distinguish between:
|
||||
*
|
||||
* "/tmp/" (known safe directory) + "../secret/file.txt" (suspicious looking file name)
|
||||
*
|
||||
* and
|
||||
*
|
||||
* "/tmp/../secret/" (known safe directory) + "file.txt" (known safe file name)
|
||||
*
|
||||
* <p>
|
||||
* "/tmp/" (known safe directory) + "../secret/file.txt" (suspicious looking file name)
|
||||
* <p>
|
||||
* and
|
||||
* <p>
|
||||
* "/tmp/../secret/" (known safe directory) + "file.txt" (known safe file name)
|
||||
* <p>
|
||||
* I guess the best this method offers us is the ability to uniquely trace the different
|
||||
* ways in which files are created and handled. It should make it easier to find and
|
||||
* prevent suspect usages of methods which only expect SanitizedFile's, but are given
|
||||
@ -62,7 +62,7 @@ public class SanitizedFile extends File {
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link org.fdroid.fdroid.data.SanitizedFile#knownSanitized(String)}
|
||||
* @see org.fdroid.fdroid.data.SanitizedFile#knownSanitized(String)
|
||||
*/
|
||||
public static SanitizedFile knownSanitized(File file) {
|
||||
return new SanitizedFile(file);
|
||||
|
Loading…
x
Reference in New Issue
Block a user