Full rework of report page.
This commit is contained in:
parent
e254fd573f
commit
e8d08d35e5
|
@ -5,7 +5,7 @@ android {
|
|||
buildToolsVersion "28.0.3"
|
||||
defaultConfig {
|
||||
applicationId "org.eu.exodus_privacy.exodusprivacy"
|
||||
minSdkVersion 16
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 28
|
||||
versionCode 7
|
||||
versionName "1.2.0"
|
||||
|
|
|
@ -0,0 +1,171 @@
|
|||
package org.eu.exodus_privacy.exodusprivacy;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.databinding.BaseObservable;
|
||||
import androidx.databinding.Bindable;
|
||||
|
||||
import org.eu.exodus_privacy.exodusprivacy.objects.Permission;
|
||||
import org.eu.exodus_privacy.exodusprivacy.objects.ReportDisplay;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
public class ReportViewModel extends BaseObservable {
|
||||
private ReportDisplay reportDisplay;
|
||||
|
||||
public void setReportDisplay(ReportDisplay report){
|
||||
this.reportDisplay = report;
|
||||
notifyChange();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getName() {
|
||||
return reportDisplay.displayName;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public Drawable getLogo() {
|
||||
return reportDisplay.logo;
|
||||
}
|
||||
|
||||
|
||||
public int getPermissionNumber() {
|
||||
return reportDisplay.permissions != null ? reportDisplay.permissions.size() : 0;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getPermissionNumberStr() {
|
||||
return String.valueOf(getPermissionNumber());
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public int getPermissionColor() {
|
||||
return getColor(getPermissionNumber());
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public boolean getPermissionVisibility() {
|
||||
return reportDisplay.permissions != null;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public boolean getHasPermissionDangerous() {
|
||||
for(Permission perm : reportDisplay.permissions) {
|
||||
if(perm.dangerous)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int getTrackerNumber() {
|
||||
return reportDisplay.trackers != null ? reportDisplay.trackers.size() : 0;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getTrackerNumberStr() {
|
||||
return String.valueOf(getTrackerNumber());
|
||||
}
|
||||
|
||||
|
||||
@Bindable
|
||||
public boolean getTrackerVisibility() {
|
||||
return reportDisplay.trackers != null;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public int getTrackerColor() {
|
||||
return getColor(getTrackerNumber());
|
||||
}
|
||||
|
||||
public String getCreator(Context context) {
|
||||
String creator = reportDisplay.creator != null ? reportDisplay.creator : "";
|
||||
if (reportDisplay.report != null && !reportDisplay.report.downloads.isEmpty()) {
|
||||
String download = reportDisplay.report.downloads;
|
||||
download = download.replace("downloads",context.getString(R.string.downloads));
|
||||
creator += " (" + download + ")";
|
||||
}
|
||||
return creator;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public boolean getCreatorVisibility() {
|
||||
return reportDisplay.creator != null;
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getInstalledVersion() {
|
||||
return reportDisplay.versionName != null ? reportDisplay.versionName : String.valueOf(reportDisplay.versionCode);
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public String getReportVersion() {
|
||||
if(reportDisplay.report != null) {
|
||||
if (reportDisplay.versionName != null && !reportDisplay.report.version.equals(reportDisplay.versionName)) {
|
||||
return reportDisplay.report.version;
|
||||
} else if (reportDisplay.versionName == null && reportDisplay.report.versionCode != reportDisplay.versionCode) {
|
||||
return String.valueOf(reportDisplay.report.versionCode);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public boolean getReportVersionVisibility() {
|
||||
return !getReportVersion().isEmpty();
|
||||
}
|
||||
|
||||
@Bindable
|
||||
public boolean getReportVisibility() {
|
||||
return reportDisplay.report != null;
|
||||
}
|
||||
|
||||
public String getReportDate(Context context) {
|
||||
String reportDate = "";
|
||||
if(reportDisplay.report == null)
|
||||
return reportDate;
|
||||
|
||||
System.out.println("crea "+reportDisplay.report.creationDate.getTimeInMillis()+" up"+reportDisplay.report.updateDate.getTimeInMillis());
|
||||
|
||||
DateFormat dateFormat = SimpleDateFormat.getDateInstance(DateFormat.LONG);
|
||||
reportDate = context.getString(R.string.created_date)+" "+dateFormat.format(reportDisplay.report.creationDate.getTime());
|
||||
if (reportDisplay.report.creationDate.getTime().compareTo(reportDisplay.report.updateDate.getTime())!=0)
|
||||
reportDate += " "+context.getString(R.string.and_updated)+" "+dateFormat.format(reportDisplay.report.updateDate.getTime())+".";
|
||||
return reportDate;
|
||||
}
|
||||
|
||||
public String getCodeSignatureInfo(Context context) {
|
||||
if(reportDisplay.trackers != null && reportDisplay.trackers.size() > 0)
|
||||
return context.getString(R.string.code_signature_found);
|
||||
else if(reportDisplay.trackers != null)
|
||||
return context.getString(R.string.code_signature_not_found);
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getCodePermissionInfo(Context context) {
|
||||
if(reportDisplay.permissions != null && reportDisplay.permissions.size() > 0)
|
||||
return context.getString(R.string.code_permission_found);
|
||||
else if(reportDisplay.permissions != null)
|
||||
return context.getString(R.string.code_permission_not_found);
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
private int getColor(int number) {
|
||||
if (number == 0)
|
||||
return R.drawable.square_green;
|
||||
else if(number < 5)
|
||||
return R.drawable.square_yellow;
|
||||
else
|
||||
return R.drawable.square_red;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -40,7 +40,7 @@ public class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAd
|
|||
@Override
|
||||
public int getItemCount() {
|
||||
if(permissionList == null || permissionList.size() == 0)
|
||||
return 1;
|
||||
return 0;
|
||||
else
|
||||
return permissionList.size();
|
||||
}
|
||||
|
@ -61,11 +61,21 @@ public class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAd
|
|||
|
||||
void setupData(Permission permission) {
|
||||
if(permission != null) {
|
||||
if(permission.name != null)
|
||||
permissionItemBinding.permissionName.setText(permission.name);
|
||||
if(permission.name != null) {
|
||||
permissionItemBinding.permissionShort.setText(permission.name);
|
||||
permissionItemBinding.permissionShort.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else
|
||||
permissionItemBinding.permissionName.setText(permission.fullName);
|
||||
permissionItemBinding.permissionShort.setVisibility(View.GONE);
|
||||
|
||||
permissionItemBinding.permissionName.setText(permission.fullName.substring(permission.fullName.lastIndexOf(".")+1));
|
||||
permissionItemBinding.permissionDescription.setText(permission.description);
|
||||
if(permission.icon != null)
|
||||
permissionItemBinding.icon.setImageDrawable(permission.icon);
|
||||
if(!permission.dangerous)
|
||||
permissionItemBinding.dangerous.setVisibility(View.GONE);
|
||||
else
|
||||
permissionItemBinding.dangerous.setVisibility(View.VISIBLE);
|
||||
manageExpanded(permission);
|
||||
permissionItemBinding.mainLayout.setOnClickListener((View.OnClickListener) v -> {
|
||||
if( permission.description != null && permission.description.trim().length() > 0) {
|
||||
|
@ -78,6 +88,9 @@ public class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAd
|
|||
else {
|
||||
permissionItemBinding.permissionName.setText(R.string.no_permissions);
|
||||
permissionItemBinding.arrow.setText(" ");
|
||||
permissionItemBinding.permissionShort.setVisibility(View.GONE);
|
||||
permissionItemBinding.dangerous.setVisibility(View.GONE);
|
||||
permissionItemBinding.permissionDescription.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -90,7 +103,7 @@ public class PermissionListAdapter extends RecyclerView.Adapter<PermissionListAd
|
|||
if( permission.description != null && permission.description.trim().length() > 0 )
|
||||
permissionItemBinding.arrow.setText("▶");
|
||||
else
|
||||
permissionItemBinding.arrow.setText("■");
|
||||
permissionItemBinding.arrow.setText("");
|
||||
permissionItemBinding.permissionDescription.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package org.eu.exodus_privacy.exodusprivacy.adapters;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
@ -12,11 +15,15 @@ import org.eu.exodus_privacy.exodusprivacy.R;
|
|||
import org.eu.exodus_privacy.exodusprivacy.databinding.TrackerItemBinding;
|
||||
import org.eu.exodus_privacy.exodusprivacy.objects.Tracker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class TrackerListAdapter extends RecyclerView.Adapter<TrackerListAdapter.TrackerListViewHolder>{
|
||||
|
||||
private Set<Tracker> trackersList;
|
||||
private List<Tracker> trackersList;
|
||||
private int layout;
|
||||
|
||||
public TrackerListAdapter(Set<Tracker> trackerList, int resource) {
|
||||
|
@ -36,7 +43,7 @@ public class TrackerListAdapter extends RecyclerView.Adapter<TrackerListAdapter.
|
|||
if(trackersList == null || trackersList.size() == 0)
|
||||
holder.setupData(null);
|
||||
else
|
||||
holder.setupData((Tracker) trackersList.toArray()[position]);
|
||||
holder.setupData(trackersList.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -47,8 +54,13 @@ public class TrackerListAdapter extends RecyclerView.Adapter<TrackerListAdapter.
|
|||
return trackersList.size();
|
||||
}
|
||||
|
||||
private Comparator<Tracker> alphaTrackerComparator = (track1, track2) -> track1.name.compareToIgnoreCase(track2.name);
|
||||
|
||||
public void setTrackers(Set<Tracker> trackers) {
|
||||
trackersList = trackers;
|
||||
if(trackers != null) {
|
||||
trackersList = new ArrayList<>(trackers);
|
||||
Collections.sort(trackersList, alphaTrackerComparator);
|
||||
}
|
||||
}
|
||||
|
||||
class TrackerListViewHolder extends RecyclerView.ViewHolder {
|
||||
|
@ -63,8 +75,14 @@ public class TrackerListAdapter extends RecyclerView.Adapter<TrackerListAdapter.
|
|||
void setupData(Tracker tracker) {
|
||||
if(viewDataBinding instanceof TrackerItemBinding) {
|
||||
TrackerItemBinding binding = (TrackerItemBinding) viewDataBinding;
|
||||
if(tracker != null)
|
||||
binding.trackerName.setText(tracker.name);
|
||||
if(tracker != null) {
|
||||
binding.trackerName.setText(tracker.name + " ➤");
|
||||
binding.getRoot().setOnClickListener(v -> {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://reports.exodus-privacy.eu.org/trackers/" + tracker.id + "/"));
|
||||
v.getContext().startActivity(intent);
|
||||
});
|
||||
}
|
||||
else
|
||||
binding.trackerName.setText(R.string.no_trackers);
|
||||
}
|
||||
|
|
|
@ -20,10 +20,12 @@
|
|||
package org.eu.exodus_privacy.exodusprivacy.fragments;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PermissionInfo;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.text.method.LinkMovementMethod;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -36,18 +38,11 @@ import androidx.fragment.app.Fragment;
|
|||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import org.eu.exodus_privacy.exodusprivacy.R;
|
||||
import org.eu.exodus_privacy.exodusprivacy.ReportViewModel;
|
||||
import org.eu.exodus_privacy.exodusprivacy.adapters.PermissionListAdapter;
|
||||
import org.eu.exodus_privacy.exodusprivacy.adapters.TrackerListAdapter;
|
||||
import org.eu.exodus_privacy.exodusprivacy.databinding.ReportBinding;
|
||||
import org.eu.exodus_privacy.exodusprivacy.manager.DatabaseManager;
|
||||
import org.eu.exodus_privacy.exodusprivacy.objects.Permission;
|
||||
import org.eu.exodus_privacy.exodusprivacy.objects.Report;
|
||||
import org.eu.exodus_privacy.exodusprivacy.objects.Tracker;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import org.eu.exodus_privacy.exodusprivacy.objects.ReportDisplay;
|
||||
public class ReportFragment extends Fragment {
|
||||
|
||||
private PackageManager packageManager;
|
||||
|
@ -86,136 +81,55 @@ public class ReportFragment extends Fragment {
|
|||
|
||||
public void updateComplete() {
|
||||
Context context = reportBinding.getRoot().getContext();
|
||||
String packageName = packageInfo.packageName;
|
||||
String versionName = packageInfo.versionName;
|
||||
long versionCode = packageInfo.versionCode;
|
||||
|
||||
//setup logo
|
||||
try {
|
||||
reportBinding.logo.setImageDrawable(packageManager.getApplicationIcon(packageName));
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
ReportDisplay reportDisplay = ReportDisplay.buildReportDisplay(context,packageManager,packageInfo);
|
||||
ReportViewModel viewModel = new ReportViewModel();
|
||||
viewModel.setReportDisplay(reportDisplay);
|
||||
reportBinding.setReportInfo(viewModel);
|
||||
|
||||
//setup name
|
||||
reportBinding.name.setText(packageManager.getApplicationLabel(packageInfo.applicationInfo));
|
||||
|
||||
//setup permissions number
|
||||
if (packageInfo.requestedPermissions != null) {
|
||||
reportBinding.permissionsNb.setText(String.valueOf(packageInfo.requestedPermissions.length));
|
||||
reportBinding.permissionsNb.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
reportBinding.permissionsNb.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if(packageInfo.requestedPermissions != null){
|
||||
if(packageInfo.requestedPermissions.length == 0)
|
||||
reportBinding.permissionsNb.setBackgroundResource(R.drawable.square_green);
|
||||
else if(packageInfo.requestedPermissions.length < 5)
|
||||
reportBinding.permissionsNb.setBackgroundResource(R.drawable.square_yellow);
|
||||
else
|
||||
reportBinding.permissionsNb.setBackgroundResource(R.drawable.square_red);
|
||||
}
|
||||
|
||||
//setup permissions list
|
||||
List<Permission> requestedPermissions = null;
|
||||
if (packageInfo.requestedPermissions != null && packageInfo.requestedPermissions.length > 0) {
|
||||
requestedPermissions = new ArrayList<>();
|
||||
for(int i = 0; i < packageInfo.requestedPermissions.length; i++) {
|
||||
Permission permission = new Permission();
|
||||
permission.fullName = packageInfo.requestedPermissions[i];
|
||||
try {
|
||||
PermissionInfo permissionInfo = packageManager.getPermissionInfo(permission.fullName,PackageManager.GET_META_DATA);
|
||||
if(permissionInfo.loadDescription(packageManager) != null)
|
||||
permission.description = permissionInfo.loadDescription(packageManager).toString();
|
||||
if(permissionInfo.loadLabel(packageManager) != null)
|
||||
permission.name = permissionInfo.loadLabel(packageManager).toString();
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
requestedPermissions.add(permission);
|
||||
}
|
||||
}
|
||||
|
||||
reportBinding.permissions.setLayoutManager(new LinearLayoutManager(context));
|
||||
PermissionListAdapter permissionAdapter = new PermissionListAdapter(requestedPermissions);
|
||||
PermissionListAdapter permissionAdapter = new PermissionListAdapter(reportDisplay.permissions);
|
||||
reportBinding.permissions.setNestedScrollingEnabled(false);
|
||||
reportBinding.permissions.setAdapter(permissionAdapter);
|
||||
|
||||
|
||||
reportBinding.analysed.setVisibility(View.GONE);
|
||||
reportBinding.trackerLayout.setVisibility(View.VISIBLE);
|
||||
|
||||
//get trackers
|
||||
Report report = null;
|
||||
if(versionName != null)
|
||||
report = DatabaseManager.getInstance(context).getReportFor(packageName,versionName);
|
||||
else
|
||||
report = DatabaseManager.getInstance(context).getReportFor(packageName,versionCode);
|
||||
Set<Tracker> trackers = null;
|
||||
if(report != null) {
|
||||
trackers = DatabaseManager.getInstance(context).getTrackers(report.trackers);
|
||||
} else {
|
||||
reportBinding.analysed.setVisibility(View.VISIBLE);
|
||||
reportBinding.trackerLayout.setVisibility(View.GONE);
|
||||
}
|
||||
//setup trackers report
|
||||
if(trackers != null) {
|
||||
reportBinding.trackersNb.setText(String.valueOf(trackers.size()));
|
||||
reportBinding.trackersNb.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
reportBinding.trackersNb.setVisibility(View.GONE);
|
||||
}
|
||||
if(trackers != null){
|
||||
if(trackers.size() == 0)
|
||||
reportBinding.trackersNb.setBackgroundResource(R.drawable.square_green);
|
||||
else if(trackers.size() < 5)
|
||||
reportBinding.trackersNb.setBackgroundResource(R.drawable.square_yellow);
|
||||
else
|
||||
reportBinding.trackersNb.setBackgroundResource(R.drawable.square_red);
|
||||
}
|
||||
|
||||
//setup trackers lists
|
||||
reportBinding.trackers.setLayoutManager(new LinearLayoutManager(context));
|
||||
TrackerListAdapter trackerAdapter = new TrackerListAdapter(trackers,R.layout.tracker_item);
|
||||
TrackerListAdapter trackerAdapter = new TrackerListAdapter(reportDisplay.trackers,R.layout.tracker_item);
|
||||
reportBinding.trackers.setNestedScrollingEnabled(false);
|
||||
reportBinding.trackers.setAdapter(trackerAdapter);
|
||||
|
||||
//setup creator
|
||||
if(report != null)
|
||||
reportBinding.creator.setText(DatabaseManager.getInstance(context).getCreator(report.appId));
|
||||
else
|
||||
reportBinding.creator.setVisibility(View.GONE);
|
||||
reportBinding.reportDate.setText(viewModel.getReportDate(context));
|
||||
reportBinding.creatorValue.setText(viewModel.getCreator(context));
|
||||
reportBinding.codeSignature.setText(viewModel.getCodeSignatureInfo(context));
|
||||
reportBinding.codePermission.setText(viewModel.getCodePermissionInfo(context));
|
||||
|
||||
//setup installed
|
||||
String installed_str = "";
|
||||
if(versionName != null)
|
||||
installed_str = context.getString(R.string.installed) +" "+ versionName;
|
||||
else
|
||||
installed_str = context.getString(R.string.installed) +" "+ String.valueOf(versionCode);
|
||||
reportBinding.installedVersion.setText(installed_str);
|
||||
reportBinding.trackerExplanation.setText(getText(R.string.tracker_infos));
|
||||
reportBinding.trackerExplanation.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
reportBinding.trackerExplanation.setClickable(true);
|
||||
|
||||
//setup reportversion
|
||||
reportBinding.reportVersion.setVisibility(View.VISIBLE);
|
||||
if(report != null) {
|
||||
String report_str = "";
|
||||
if (versionName != null && !report.version.equals(versionName)) {
|
||||
report_str = context.getString(R.string.report_version) + " " + report.version;
|
||||
} else if (versionName == null && report.versionCode != versionCode) {
|
||||
report_str = context.getString(R.string.report_version) + " " + report.versionCode;
|
||||
}
|
||||
if(!report_str.isEmpty())
|
||||
reportBinding.reportVersion.setText(report_str);
|
||||
else
|
||||
reportBinding.reportVersion.setVisibility(View.GONE);
|
||||
reportBinding.permissionExplanationDangerous.setText(getText(R.string.permission_infos_dangerous));
|
||||
reportBinding.permissionExplanationDangerous.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
reportBinding.permissionExplanationDangerous.setClickable(true);
|
||||
|
||||
reportBinding.permissionExplanation.setText(getText(R.string.permission_infos));
|
||||
reportBinding.permissionExplanation.setMovementMethod(LinkMovementMethod.getInstance());
|
||||
reportBinding.permissionExplanation.setClickable(true);
|
||||
|
||||
reportBinding.viewPlay.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://play.google.com/store/apps/details?id="+reportDisplay.packageName));
|
||||
startActivity(intent);
|
||||
});
|
||||
|
||||
if(reportDisplay.report != null) {
|
||||
reportBinding.reportUrl.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(Intent.ACTION_VIEW);
|
||||
intent.setData(Uri.parse("https://reports.exodus-privacy.eu.org/reports/" + reportDisplay.report.id + "/"));
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
else
|
||||
reportBinding.reportVersion.setVisibility(View.GONE);
|
||||
|
||||
//setup report url
|
||||
if(report != null)
|
||||
reportBinding.reportUrl.setText("https://reports.exodus-privacy.eu.org/reports/"+report.id+"/");
|
||||
}
|
||||
|
||||
public void setPackageManager(PackageManager packageManager) {
|
||||
|
|
|
@ -280,9 +280,11 @@ public class DatabaseManager extends SQLiteOpenHelper {
|
|||
long creation = cursor.getLong(col++);
|
||||
report.creationDate = Calendar.getInstance();
|
||||
report.creationDate.setTimeInMillis(creation);
|
||||
report.creationDate.set(Calendar.MILLISECOND,0);
|
||||
long update = cursor.getLong(col++);
|
||||
report.updateDate = Calendar.getInstance();
|
||||
report.updateDate.setTimeInMillis(update);
|
||||
report.updateDate.set(Calendar.MILLISECOND,0);
|
||||
report.downloads = cursor.getString(col++);
|
||||
report.version = cursor.getString(col++);
|
||||
report.versionCode = cursor.getLong(col++);
|
||||
|
|
|
@ -340,10 +340,12 @@ public class NetworkManager {
|
|||
report.updateDate = Calendar.getInstance();
|
||||
report.updateDate.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
report.updateDate.setTime(dateFormat.parse(object.getString("updated_at")));
|
||||
report.updateDate.set(Calendar.MILLISECOND,0);
|
||||
|
||||
report.creationDate = Calendar.getInstance();
|
||||
report.creationDate.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
report.creationDate.setTime(dateFormat.parse(object.getString("creation_date")));
|
||||
report.creationDate.set(Calendar.MILLISECOND,0);
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -1,8 +1,12 @@
|
|||
package org.eu.exodus_privacy.exodusprivacy.objects;
|
||||
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
public class Permission {
|
||||
public String name;
|
||||
public String fullName;
|
||||
public String description;
|
||||
public Drawable icon;
|
||||
public boolean dangerous;
|
||||
public boolean expanded = false;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
package org.eu.exodus_privacy.exodusprivacy.objects;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.PermissionGroupInfo;
|
||||
import android.content.pm.PermissionInfo;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
|
||||
import org.eu.exodus_privacy.exodusprivacy.manager.DatabaseManager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class ReportDisplay {
|
||||
public Report report;
|
||||
public String packageName;
|
||||
public String versionName;
|
||||
public String displayName;
|
||||
public String creator;
|
||||
public long versionCode;
|
||||
public Drawable logo;
|
||||
public List<Permission> permissions;
|
||||
public Set<Tracker> trackers;
|
||||
|
||||
|
||||
private ReportDisplay(){
|
||||
|
||||
}
|
||||
|
||||
public static ReportDisplay buildReportDisplay(Context context, PackageManager manager, PackageInfo info) {
|
||||
ReportDisplay reportDisplay = new ReportDisplay();
|
||||
reportDisplay.packageName = info.packageName;
|
||||
reportDisplay.versionName = info.versionName;
|
||||
reportDisplay.versionCode = info.versionCode;
|
||||
reportDisplay.displayName = manager.getApplicationLabel(info.applicationInfo).toString();
|
||||
|
||||
if(reportDisplay.versionName != null)
|
||||
reportDisplay.report = DatabaseManager.getInstance(context).getReportFor(reportDisplay.packageName,reportDisplay.versionName);
|
||||
else
|
||||
reportDisplay.report = DatabaseManager.getInstance(context).getReportFor(reportDisplay.packageName, reportDisplay.versionCode);
|
||||
|
||||
if(reportDisplay.report != null)
|
||||
reportDisplay.trackers = DatabaseManager.getInstance(context).getTrackers(reportDisplay.report.trackers);
|
||||
|
||||
if (reportDisplay.report != null)
|
||||
reportDisplay.creator = DatabaseManager.getInstance(context).getCreator(reportDisplay.report.appId);
|
||||
|
||||
List<Permission> requestedPermissions= new ArrayList<>();
|
||||
if (info.requestedPermissions != null) {
|
||||
for(int i = 0; i < info.requestedPermissions.length; i++) {
|
||||
Permission permission = new Permission();
|
||||
permission.fullName = info.requestedPermissions[i];
|
||||
try {
|
||||
PermissionInfo permissionInfo = manager.getPermissionInfo(permission.fullName,PackageManager.GET_META_DATA);
|
||||
if(permissionInfo.loadDescription(manager) != null)
|
||||
permission.description = permissionInfo.loadDescription(manager).toString();
|
||||
if(permissionInfo.loadLabel(manager) != null)
|
||||
permission.name = permissionInfo.loadLabel(manager).toString();
|
||||
permission.dangerous = permissionInfo.protectionLevel == PermissionInfo.PROTECTION_DANGEROUS;
|
||||
if(permission.fullName.equals(Manifest.permission.WRITE_SETTINGS) || permission.fullName.equals(Manifest.permission.SYSTEM_ALERT_WINDOW)) //Special permissions
|
||||
permission.dangerous = true;
|
||||
|
||||
if (permissionInfo.group != null) {
|
||||
PermissionGroupInfo permissionGroupInfo = manager.getPermissionGroupInfo(permissionInfo.group, PackageManager.GET_META_DATA);
|
||||
if(permissionGroupInfo.loadIcon(manager) != null)
|
||||
permission.icon = permissionGroupInfo.loadIcon(manager);
|
||||
}
|
||||
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
e.getLocalizedMessage();
|
||||
}
|
||||
requestedPermissions.add(permission);
|
||||
}
|
||||
}
|
||||
reportDisplay.permissions = requestedPermissions;
|
||||
|
||||
try {
|
||||
reportDisplay.logo = manager.getApplicationIcon(reportDisplay.packageName);
|
||||
} catch (PackageManager.NameNotFoundException e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return reportDisplay;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
<vector android:height="24dp" android:viewportHeight="16"
|
||||
android:viewportWidth="4" android:width="6dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#E61718" android:fillType="evenOdd"
|
||||
android:pathData="M0.18,1.5C0.18,0.6716 0.8516,0 1.68,0C2.5084,0 3.18,0.6716 3.18,1.5L3.18,8.39C3.18,9.2184 2.5084,9.89 1.68,9.89C0.8516,9.89 0.18,9.2184 0.18,8.39L0.18,1.5ZM1.72,15.01C0.7701,15.01 0,14.2399 0,13.29C0,12.3401 0.7701,11.57 1.72,11.57C2.6699,11.57 3.44,12.3401 3.44,13.29C3.44,14.2399 2.6699,15.01 1.72,15.01Z"
|
||||
android:strokeColor="#00000000" android:strokeWidth="1"/>
|
||||
</vector>
|
|
@ -8,9 +8,7 @@
|
|||
>
|
||||
<data/>
|
||||
<FrameLayout
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -1,19 +1,56 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<data/>
|
||||
<LinearLayout
|
||||
android:id="@+id/main_layout"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
>
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<ImageView
|
||||
android:id="@+id/icon"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentStart="true"
|
||||
/>
|
||||
<ImageView
|
||||
android:id="@+id/dangerous"
|
||||
android:src="@drawable/ic_danger"
|
||||
android:layout_width="4dp"
|
||||
android:layout_height="18dp"
|
||||
android:layout_toEndOf="@id/icon"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_alignParentTop="true"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/permission_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_toEndOf="@id/dangerous"
|
||||
android:layout_toStartOf="@id/arrow"
|
||||
android:layout_alignParentTop="true"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/permission_short"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_toEndOf="@id/dangerous"
|
||||
android:layout_toStartOf="@id/arrow"
|
||||
android:layout_below="@id/permission_name"
|
||||
android:textStyle="italic"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:text="▼"
|
||||
android:id="@+id/arrow"
|
||||
|
@ -21,20 +58,18 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentTop="true"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/permission_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
<TextView
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingStart="20dp"
|
||||
android:id="@+id/permission_description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="66dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textStyle="italic"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</layout>
|
|
@ -1,180 +1,429 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
<data/>
|
||||
<ScrollView
|
||||
<data>
|
||||
<import type="androidx.core.content.ContextCompat"/>
|
||||
<import type="android.view.View"/>
|
||||
<variable
|
||||
name="reportInfo"
|
||||
type="org.eu.exodus_privacy.exodusprivacy.ReportViewModel" />
|
||||
</data>
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/base_info"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="match_parent">
|
||||
<ImageView
|
||||
android:id="@+id/logo"
|
||||
android:padding="10dp"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
/>
|
||||
android:layout_marginTop="20dp"
|
||||
android:padding="10dp"
|
||||
android:src="@{reportInfo.logo}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:orientation="vertical"
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{reportInfo.name}"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/logo"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:textSize="30sp"
|
||||
android:textColor="@color/colorPurple"
|
||||
android:textStyle="bold"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/dummy"
|
||||
android:layout_marginTop="15dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/trackers_nb"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{reportInfo.trackerNumberStr}"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="15dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/dummy"
|
||||
android:background="@{ContextCompat.getDrawable(context,reportInfo.trackerColor)}"
|
||||
android:visibility="@{reportInfo.trackerVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:textColor="@color/textColorWhite"
|
||||
android:textStyle="bold"
|
||||
android:textAlignment="center"
|
||||
android:textSize="22sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/trackers_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/trackers"
|
||||
android:visibility="@{reportInfo.trackerVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintTop_toTopOf="@id/trackers_nb"
|
||||
app:layout_constraintStart_toEndOf="@id/trackers_nb"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textStyle="bold"
|
||||
android:textSize="22sp"
|
||||
android:textColor="@color/textColorDark"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/permissions_nb"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{reportInfo.permissionNumberStr}"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="15dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/trackers_nb"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@{ContextCompat.getDrawable(context,reportInfo.permissionColor)}"
|
||||
android:visibility="@{reportInfo.permissionVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:textColor="@color/textColorWhite"
|
||||
android:textStyle="bold"
|
||||
android:textAlignment="center"
|
||||
android:textSize="22sp"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/permissions_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/permissions"
|
||||
android:visibility="@{reportInfo.permissionVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="15dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/trackers_nb"
|
||||
app:layout_constraintStart_toEndOf="@id/permissions_nb"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textStyle="bold"
|
||||
android:textSize="22sp"
|
||||
android:textColor="@color/textColorDark"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/installed_version"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/installed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/permissions_nb"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/textColorDark"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/installed_version_value"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{reportInfo.installedVersion}"
|
||||
app:layout_constraintStart_toEndOf="@id/installed_version"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/permissions_nb"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/textColorDark"/>
|
||||
<TextView
|
||||
android:id="@+id/report_version"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/report_version"
|
||||
android:visibility="@{reportInfo.reportVersionVisibility ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/installed_version_value"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/textColorDark"/>
|
||||
<TextView
|
||||
android:id="@+id/report_version_value"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{reportInfo.reportVersion}"
|
||||
android:visibility="@{reportInfo.reportVersionVisibility ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintStart_toEndOf="@id/report_version"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/installed_version_value"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/textColorDark"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/creator"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/created_by"
|
||||
android:visibility="@{reportInfo.creatorVisibility ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/report_version_value"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/textColorDark"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/creator_value"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{reportInfo.creatorVisibility ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintStart_toEndOf="@id/creator"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/report_version_value"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/textColorDark"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/report_date"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{reportInfo.reportVisibility ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/creator_value"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/textColorDarkLight"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/report_url"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:text="test"
|
||||
android:layout_marginTop="10dp"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:autoLink="web"
|
||||
android:text="@string/view_on_exodus"
|
||||
android:visibility="@{reportInfo.reportVisibility ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textAlignment="textEnd"
|
||||
app:layout_constraintTop_toBottomOf="@id/report_date"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/colorPurple"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/creator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Creator"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small" />
|
||||
<TextView
|
||||
android:text="installed version"
|
||||
android:id="@+id/installed_version"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:text="Report version"
|
||||
android:id="@+id/report_version"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<TextView
|
||||
android:id="@+id/report_url"
|
||||
android:autoLink="web"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/analysed"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/base_info"
|
||||
android:text="@string/analysed"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
/>
|
||||
<LinearLayout
|
||||
android:layout_below="@id/analysed"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/tracker_layout"
|
||||
<TextView
|
||||
android:id="@+id/view_play"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="50"
|
||||
android:orientation="vertical">
|
||||
android:layout_height="wrap_content"
|
||||
android:autoLink="web"
|
||||
android:text="@string/view_on_google_play"
|
||||
android:textAlignment="textEnd"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/report_url"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/colorPurple"/>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/square_purple"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="3dp">
|
||||
<TextView
|
||||
android:id="@+id/trackers_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAlignment="center"
|
||||
android:text="@string/trackers_pct"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||
android:textColor="@android:color/white" />
|
||||
<TextView
|
||||
android:id="@+id/trackers_nb_list"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{reportInfo.trackerNumberStr}"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="30dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/analysed"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@{ContextCompat.getDrawable(context,reportInfo.trackerColor)}"
|
||||
android:visibility="@{reportInfo.trackerVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:textStyle="bold"
|
||||
android:textAlignment="center"
|
||||
android:textSize="22sp"
|
||||
android:textColor="@color/textColorWhite"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/trackers_nb"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/square_green"
|
||||
android:text="99"
|
||||
android:textAlignment="center"
|
||||
android:textSize="20sp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp" />
|
||||
<TextView
|
||||
android:id="@+id/trackers_title_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/trackers"
|
||||
android:visibility="@{reportInfo.trackerVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="30dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/analysed"
|
||||
app:layout_constraintStart_toEndOf="@id/trackers_nb_list"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textStyle="bold"
|
||||
android:textSize="22sp"
|
||||
android:textColor="@color/textColorDark"/>
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/code_signature"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{reportInfo.trackerVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/trackers_nb_list"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/trackers"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:orientation="vertical"
|
||||
android:layout_weight="50"
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/trackers"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/square_purple"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingTop="2dp"
|
||||
android:paddingBottom="3dp"
|
||||
>
|
||||
<TextView
|
||||
android:id="@+id/permissions_title"
|
||||
android:text="@string/permissions_pct"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Large"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
/>
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{reportInfo.trackerVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/code_signature"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/permissions_nb"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/square_green"
|
||||
android:text="99"
|
||||
android:textAlignment="center"
|
||||
android:textSize="20sp"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginStart="10dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tracker_explanation"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{reportInfo.trackerVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:text="@string/tracker_infos"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/trackers"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/permissions"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
</ScrollView>
|
||||
<TextView
|
||||
android:id="@+id/permissions_nb_list"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="0dp"
|
||||
android:text="@{reportInfo.permissionNumberStr}"
|
||||
android:visibility="@{reportInfo.permissionVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="30dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tracker_explanation"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
android:background="@{ContextCompat.getDrawable(context,reportInfo.permissionColor)}"
|
||||
android:textStyle="bold"
|
||||
android:textAlignment="center"
|
||||
android:textSize="22sp"
|
||||
android:textColor="@color/textColorWhite"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/permissions_title_list"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/permissions"
|
||||
android:visibility="@{reportInfo.permissionVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="30dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/tracker_explanation"
|
||||
app:layout_constraintStart_toEndOf="@id/permissions_nb_list"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:textStyle="bold"
|
||||
android:textSize="22sp"
|
||||
android:textColor="@color/textColorDark"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/code_permission"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{reportInfo.permissionVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintTop_toBottomOf="@id/permissions_nb_list"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/permissions"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:visibility="@{reportInfo.permissionVisibility ? View.VISIBLE : View.GONE}"
|
||||
app:layout_constraintBottom_toTopOf="@id/permission_explanation_dangerous"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/code_permission" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/permission_explanation_dangerous"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{reportInfo.hasPermissionDangerous ? View.VISIBLE : View.GONE}"
|
||||
android:text="@string/permission_infos_dangerous"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintBottom_toTopOf="@id/permission_explanation"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/permission_explanation"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{reportInfo.permissionVisibility ? View.VISIBLE : View.GONE}"
|
||||
android:text="@string/permission_infos"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/analysed"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/analysed"
|
||||
android:visibility="@{reportInfo.trackerVisibility ? View.GONE : View.VISIBLE}"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/view_play"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textAlignment="center"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</layout>
|
|
@ -3,25 +3,11 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
>
|
||||
<data/>
|
||||
<LinearLayout
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<TextView
|
||||
android:text="●"
|
||||
android:textColor="@android:color/black"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginRight="10dp"
|
||||
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tracker_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:id="@+id/tracker_name"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:textColor="@color/textColorDark"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</layout>
|
|
@ -10,8 +10,8 @@
|
|||
<string name="json_error">Erreur JSON</string>
|
||||
<string name="installed">Version installée : </string>
|
||||
<string name="report_version">Version testée : </string>
|
||||
<string name="no_trackers">Aucun pisteur testé n\'a été trouvé</string>
|
||||
<string name="no_permissions">Aucune autorisation n\'est demandée par cette application</string>
|
||||
<string name="no_trackers">L’application pourrait contenir un ou plusieurs pisteurs que nous n’avons pas encore identifiés.</string>
|
||||
<string name="no_permissions">Cette application ne demande aucun autorisation.</string>
|
||||
<string name="tested">Il n\'y a pas de rapport pour la version installée (%1$s), les informations affichées sont basées sur une autre version (%2$s)</string>
|
||||
<string name="analysed">Cette application n\'a pas encore été analysée par Exodus Privacy.</string>
|
||||
<string name="no_package_manager">Votre système semble ne pas donner accès aux applications installées.</string>
|
||||
|
@ -22,7 +22,25 @@
|
|||
<string name="parse_trackers">Traitement des pisteurs :</string>
|
||||
<string name="get_trackers_connection">Récupération des pisteurs : en attente de connexion au serveur</string>
|
||||
<string name="get_trackers">Récupération des pisteurs</string>
|
||||
<string name="no_settings">Cette app n\'a pas de paramêtre</string>
|
||||
<string name="logo">Logo de l\'application %1</string>
|
||||
<string name="created_by">Crée par</string>
|
||||
<string name="created_date">Ce rapport a été créé le</string>
|
||||
<string name="and_updated">et mis à jour le</string>
|
||||
<string name="view_on_exodus">Voir sur Exodus Privacy ➤</string>
|
||||
<string name="view_on_google_play">Voir sur Google Play ➤</string>
|
||||
<string name="downloads">téléchargements</string>
|
||||
<string name="code_signature_found">Nous avons trouvé la signature des pisteurs suivants dans cette application : </string>
|
||||
<string name="code_signature_not_found">Nous n’avons pas trouvé la signature de pisteurs que nous connaissons dans l’application. </string>
|
||||
<string name="code_permission_found">Nous avons trouvé les permissions suivantes dans cette application:</string>
|
||||
<string name="code_permission_not_found">Cette application ne demande aucune autorisation.</string>
|
||||
<string name="tracker_infos">Un pisteur est une partie du logiciel dédiée à la collecte de données sur vous et vos usages. <a href="https://reports.exodus-privacy.eu.org/fr/info/trackers/">En savoir plus…</a></string>
|
||||
<string name="permission_infos">Les permissions sont les actions que l\'application peut effectuer sur votre téléphone. <a href="https://reports.exodus-privacy.eu.org/fr/info/permissions/">En savoir plus…</a></string>
|
||||
<string name="permission_infos_dangerous">L\'icône <font color="red"><b>!</b></font> indique un niveau \'Dangereux\' ou \'Spécial\' d\'après les <a href="https://developer.android.com/guide/topics/permissions/overview">niveaux de protection de Google.</a></string>
|
||||
<string name="tracker_presence">Présent dans: %1 applications</string>
|
||||
<string name="tracker_web_page">Site web du pisteur➤</string>
|
||||
|
||||
<!-- Menu -->
|
||||
<string name="menu_action_filter">Filtrer</string>
|
||||
<string name="menu_action_settings">Paramètres de l\'application</string>
|
||||
</resources>
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="colorPrimary">#684971</color>
|
||||
<color name="colorPrimaryDark">#3d2b43</color>
|
||||
<color name="colorAccent">#684971</color>
|
||||
<color name="colorPrimary">#212529</color>
|
||||
<color name="colorPrimaryDark">#212529</color>
|
||||
<color name="colorAccent">#212529</color>
|
||||
<color name="colorGreen">#6fc384</color>
|
||||
<color name="colorRed">#e46772</color>
|
||||
<color name="colorYellow">#ffdb66</color>
|
||||
<color name="colorPurple">#684971</color>
|
||||
<color name="textColorDark">#343A40</color>
|
||||
<color name="textColorDarkLight">#6C757D</color>
|
||||
<color name="textColorWhite">#FFFFFF</color>
|
||||
</resources>
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
<string name="json_error">JSON Error</string>
|
||||
<string name="installed">Installed Version: </string>
|
||||
<string name="report_version">Tested Version: </string>
|
||||
<string name="no_trackers">No tested trackers were found</string>
|
||||
<string name="no_permissions">No permissions are requested by this application</string>
|
||||
<string name="no_trackers">The application could contain tracker(s) we do not know yet.</string>
|
||||
<string name="no_permissions">This application doesn\'t require any permissions.</string>
|
||||
<string name="tested">There\'s no report for the installed version (%1$s), the information displayed is based on another (%2$s) version</string>
|
||||
<string name="analysed">This app hasn\'t been analysed by Exodus Privacy yet.</string>
|
||||
<string name="no_package_manager">It appears that your system doesn\'t allow access to the list of installed apps.</string>
|
||||
|
@ -23,8 +23,23 @@
|
|||
<string name="get_trackers_connection">Getting trackers: Waiting for server connection</string>
|
||||
<string name="get_trackers">Getting trackers</string>
|
||||
<string name="no_settings">This app doesn\'t have settings</string>
|
||||
<string name="logo">%1 Application Logo</string>
|
||||
<string name="created_by">Created By</string>
|
||||
<string name="created_date">This report has been created the</string>
|
||||
<string name="and_updated">and updated the</string>
|
||||
<string name="view_on_exodus">See on Exodus Privacy ➤</string>
|
||||
<string name="view_on_google_play">See on Google Play ➤</string>
|
||||
<string name="downloads">downloads</string>
|
||||
<string name="code_signature_found">We have found code signature of the following trackers in the application:</string>
|
||||
<string name="code_signature_not_found">We have not found code signature of any tracker we know in the application.</string>
|
||||
<string name="code_permission_found">We have found the following permissions in the application:</string>
|
||||
<string name="code_permission_not_found">This application doesn\'t require any permissions.</string>
|
||||
<string name="tracker_infos">A tracker is a piece of software meant to collect data about you or your usages. <a href="https://reports.exodus-privacy.eu.org/en/info/trackers/">Learn more…</a></string>
|
||||
<string name="permission_infos">Permissions are actions the application can do on your phone. <a href="https://reports.exodus-privacy.eu.org/en/info/permissions/">Learn more…</a></string>
|
||||
<string name="permission_infos_dangerous">The icon <font color="red"><b>!</b></font> indicates a \'Dangerous\' or \'Special\' level according to <a href="https://developer.android.com/guide/topics/permissions/overview">Google\'s protection levels.</a></string>
|
||||
|
||||
<!-- Menu -->
|
||||
<string name="menu_action_filter">Filter</string>
|
||||
<string name="menu_action_settings">Application Settings</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -9,7 +9,7 @@ buildscript {
|
|||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.5.0'
|
||||
classpath 'com.android.tools.build:gradle:3.5.2'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
|
Loading…
Reference in New Issue