improved Apk.toString() for easier debugging

This commit is contained in:
Hans-Christoph Steiner 2016-10-06 19:45:16 +02:00
parent 470145e611
commit 65c4087b05
2 changed files with 3 additions and 3 deletions

View File

@ -270,7 +270,7 @@ public class Apk extends ValueObject implements Comparable<Apk>, Parcelable {
@Override @Override
public String toString() { public String toString() {
return packageName + " (version " + versionCode + ")"; return toContentValues().toString();
} }
public ContentValues toContentValues() { public ContentValues toContentValues() {

View File

@ -41,12 +41,12 @@ public class InstallerFactory {
*/ */
public static Installer create(Context context, Apk apk) { public static Installer create(Context context, Apk apk) {
if (apk == null || TextUtils.isEmpty(apk.packageName)) { if (apk == null || TextUtils.isEmpty(apk.packageName)) {
throw new IllegalArgumentException("packageName must not be empty!"); throw new IllegalArgumentException("Apk.packageName must not be empty: " + apk);
} }
Installer installer; Installer installer;
if (apk.packageName.equals(PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME)) { if (apk.packageName.equals(PrivilegedInstaller.PRIVILEGED_EXTENSION_PACKAGE_NAME)) {
// special case for "F-Droid Privileged Extension" // special case for installing "Privileged Extension" with root
installer = new ExtensionInstaller(context, apk); installer = new ExtensionInstaller(context, apk);
} else if (PrivilegedInstaller.isDefault(context)) { } else if (PrivilegedInstaller.isDefault(context)) {
Utils.debugLog(TAG, "privileged extension correctly installed -> PrivilegedInstaller"); Utils.debugLog(TAG, "privileged extension correctly installed -> PrivilegedInstaller");