From d530a1cf56d6cbd927f3d74feaa5a659e5e92225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Wed, 26 Aug 2015 15:44:41 +0200 Subject: [PATCH] Restructure installer packages --- F-Droid/AndroidManifest.xml | 6 +-- .../res/layout-v11/app_permission_item.xml | 2 +- F-Droid/res/layout/app_permission_item.xml | 2 +- .../res/layout/app_permission_item_money.xml | 2 +- F-Droid/res/layout/permissions_list.xml | 4 +- .../content/pm/IPackageDeleteObserver.java | 49 ------------------- .../content/pm/IPackageInstallObserver.java | 49 ------------------- F-Droid/src/org/fdroid/fdroid/FDroid.java | 5 +- ...rSdk14.java => DefaultSdk14Installer.java} | 4 +- .../fdroid/fdroid/installer/Installer.java | 4 +- ...nstaller.java => PrivilegedInstaller.java} | 19 ++++--- .../install/InstallPrivileged.java} | 14 +++--- .../InstallPrivilegedBootReceiver.java} | 8 +-- .../InstallPrivilegedDialogActivity.java} | 45 ++++++++--------- .../views}/AppDiff.java | 8 +-- .../views}/AppSecurityPermissions.java | 2 +- .../views}/CaffeinatedScrollView.java | 2 +- .../views}/InstallConfirmActivity.java | 2 +- .../views}/TabsAdapter.java | 2 +- .../views/fragments/PreferencesFragment.java | 10 ++-- 20 files changed, 72 insertions(+), 167 deletions(-) delete mode 100644 F-Droid/src/android/content/pm/IPackageDeleteObserver.java delete mode 100644 F-Droid/src/android/content/pm/IPackageInstallObserver.java rename F-Droid/src/org/fdroid/fdroid/installer/{DefaultInstallerSdk14.java => DefaultSdk14Installer.java} (97%) rename F-Droid/src/org/fdroid/fdroid/installer/{SystemInstaller.java => PrivilegedInstaller.java} (97%) rename F-Droid/src/org/fdroid/fdroid/{installer/InstallIntoSystem.java => privileged/install/InstallPrivileged.java} (94%) rename F-Droid/src/org/fdroid/fdroid/{installer/InstallIntoSystemBootReceiver.java => privileged/install/InstallPrivilegedBootReceiver.java} (86%) rename F-Droid/src/org/fdroid/fdroid/{installer/InstallIntoSystemDialogActivity.java => privileged/install/InstallPrivilegedDialogActivity.java} (91%) rename F-Droid/src/org/fdroid/fdroid/{installer => privileged/views}/AppDiff.java (94%) rename F-Droid/src/org/fdroid/fdroid/{installer => privileged/views}/AppSecurityPermissions.java (99%) rename F-Droid/src/org/fdroid/fdroid/{installer => privileged/views}/CaffeinatedScrollView.java (98%) rename F-Droid/src/org/fdroid/fdroid/{installer => privileged/views}/InstallConfirmActivity.java (99%) rename F-Droid/src/org/fdroid/fdroid/{installer => privileged/views}/TabsAdapter.java (99%) diff --git a/F-Droid/AndroidManifest.xml b/F-Droid/AndroidManifest.xml index 779fba7e1..60a124616 100644 --- a/F-Droid/AndroidManifest.xml +++ b/F-Droid/AndroidManifest.xml @@ -302,7 +302,7 @@ android:value=".SearchResults" /> + android:name=".privileged.install.InstallPrivilegedBootReceiver" > diff --git a/F-Droid/res/layout-v11/app_permission_item.xml b/F-Droid/res/layout-v11/app_permission_item.xml index b5aab370d..0cb5e3405 100644 --- a/F-Droid/res/layout-v11/app_permission_item.xml +++ b/F-Droid/res/layout-v11/app_permission_item.xml @@ -18,7 +18,7 @@ Defines the layout of a single permission item. --> - - - - @@ -50,4 +50,4 @@ This is the structure for the list of all permissions. android:text="@string/devicePerms" /> - + diff --git a/F-Droid/src/android/content/pm/IPackageDeleteObserver.java b/F-Droid/src/android/content/pm/IPackageDeleteObserver.java deleted file mode 100644 index 0c4c6857c..000000000 --- a/F-Droid/src/android/content/pm/IPackageDeleteObserver.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2013 Dominik Schürmann - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -package android.content.pm; - -/** - * Just a non-working implementation of this Stub to satisfy compiler! - */ -public interface IPackageDeleteObserver extends android.os.IInterface { - - abstract class Stub extends android.os.Binder implements - android.content.pm.IPackageDeleteObserver { - public Stub() { - throw new RuntimeException("Stub!"); - } - - public static android.content.pm.IPackageDeleteObserver asInterface(android.os.IBinder obj) { - throw new RuntimeException("Stub!"); - } - - public android.os.IBinder asBinder() { - throw new RuntimeException("Stub!"); - } - - public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, - int flags) throws android.os.RemoteException { - throw new RuntimeException("Stub!"); - } - } - - void packageDeleted(java.lang.String packageName, int returnCode) - throws android.os.RemoteException; -} diff --git a/F-Droid/src/android/content/pm/IPackageInstallObserver.java b/F-Droid/src/android/content/pm/IPackageInstallObserver.java deleted file mode 100644 index 689198afd..000000000 --- a/F-Droid/src/android/content/pm/IPackageInstallObserver.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2013 Dominik Schürmann - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 3 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - */ - -package android.content.pm; - -/** - * Just a non-working implementation of this Stub to satisfy compiler! - */ -public interface IPackageInstallObserver extends android.os.IInterface { - - abstract class Stub extends android.os.Binder implements - android.content.pm.IPackageInstallObserver { - public Stub() { - throw new RuntimeException("Stub!"); - } - - public static android.content.pm.IPackageInstallObserver asInterface(android.os.IBinder obj) { - throw new RuntimeException("Stub!"); - } - - public android.os.IBinder asBinder() { - throw new RuntimeException("Stub!"); - } - - public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, - int flags) throws android.os.RemoteException { - throw new RuntimeException("Stub!"); - } - } - - void packageInstalled(java.lang.String packageName, int returnCode) - throws android.os.RemoteException; -} \ No newline at end of file diff --git a/F-Droid/src/org/fdroid/fdroid/FDroid.java b/F-Droid/src/org/fdroid/fdroid/FDroid.java index 80346c758..36a502734 100644 --- a/F-Droid/src/org/fdroid/fdroid/FDroid.java +++ b/F-Droid/src/org/fdroid/fdroid/FDroid.java @@ -34,7 +34,6 @@ import android.support.v4.view.ViewPager; import android.support.v7.app.ActionBarActivity; import android.support.v7.app.AlertDialog; import android.text.TextUtils; -import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; @@ -45,7 +44,7 @@ import android.widget.Toast; import org.fdroid.fdroid.compat.TabManager; import org.fdroid.fdroid.data.AppProvider; import org.fdroid.fdroid.data.NewRepoConfig; -import org.fdroid.fdroid.installer.InstallIntoSystemDialogActivity; +import org.fdroid.fdroid.privileged.install.InstallPrivilegedDialogActivity; import org.fdroid.fdroid.views.AppListFragmentPagerAdapter; import org.fdroid.fdroid.views.ManageReposActivity; import org.fdroid.fdroid.views.swap.SwapWorkflowActivity; @@ -99,7 +98,7 @@ public class FDroid extends ActionBarActivity { Uri uri = AppProvider.getContentUri(); getContentResolver().registerContentObserver(uri, true, new AppObserver()); - InstallIntoSystemDialogActivity.firstTime(this); + InstallPrivilegedDialogActivity.firstTime(this); } @Override diff --git a/F-Droid/src/org/fdroid/fdroid/installer/DefaultInstallerSdk14.java b/F-Droid/src/org/fdroid/fdroid/installer/DefaultSdk14Installer.java similarity index 97% rename from F-Droid/src/org/fdroid/fdroid/installer/DefaultInstallerSdk14.java rename to F-Droid/src/org/fdroid/fdroid/installer/DefaultSdk14Installer.java index 3373e65ef..ba64aaedb 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/DefaultInstallerSdk14.java +++ b/F-Droid/src/org/fdroid/fdroid/installer/DefaultSdk14Installer.java @@ -39,10 +39,10 @@ import java.util.List; * unattended installations. */ @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) -public class DefaultInstallerSdk14 extends Installer { +public class DefaultSdk14Installer extends Installer { private final Activity mActivity; - public DefaultInstallerSdk14(Activity activity, PackageManager pm, InstallerCallback callback) + public DefaultSdk14Installer(Activity activity, PackageManager pm, InstallerCallback callback) throws AndroidNotCompatibleException { super(activity, pm, callback); this.mActivity = activity; diff --git a/F-Droid/src/org/fdroid/fdroid/installer/Installer.java b/F-Droid/src/org/fdroid/fdroid/installer/Installer.java index de9c8ff6f..7eb69a6d5 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/Installer.java +++ b/F-Droid/src/org/fdroid/fdroid/installer/Installer.java @@ -113,7 +113,7 @@ abstract public class Installer { Utils.DebugLog(TAG, "system permissions -> SystemInstaller"); try { - return new SystemInstaller(activity, pm, callback); + return new PrivilegedInstaller(activity, pm, callback); } catch (AndroidNotCompatibleException e) { Log.e(TAG, "Android not compatible with SystemInstaller!", e); } @@ -128,7 +128,7 @@ abstract public class Installer { try { Utils.DebugLog(TAG, "try default installer for Android >= 4"); - return new DefaultInstallerSdk14(activity, pm, callback); + return new DefaultSdk14Installer(activity, pm, callback); } catch (AndroidNotCompatibleException e) { Log.e(TAG, "Android not compatible with DefaultInstallerSdk14!", e); } diff --git a/F-Droid/src/org/fdroid/fdroid/installer/SystemInstaller.java b/F-Droid/src/org/fdroid/fdroid/installer/PrivilegedInstaller.java similarity index 97% rename from F-Droid/src/org/fdroid/fdroid/installer/SystemInstaller.java rename to F-Droid/src/org/fdroid/fdroid/installer/PrivilegedInstaller.java index da779c52a..9e1fc047e 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/SystemInstaller.java +++ b/F-Droid/src/org/fdroid/fdroid/installer/PrivilegedInstaller.java @@ -34,6 +34,9 @@ import android.util.Log; import org.fdroid.fdroid.R; import org.fdroid.fdroid.Utils; +import org.fdroid.fdroid.privileged.views.AppDiff; +import org.fdroid.fdroid.privileged.views.AppSecurityPermissions; +import org.fdroid.fdroid.privileged.views.InstallConfirmActivity; import java.io.File; import java.lang.reflect.Method; @@ -63,20 +66,20 @@ import java.util.List; * https://android.googlesource.com/platform * /frameworks/base/+/ccbf84f44c9e6a5ed3c08673614826bb237afc54 */ -public class SystemInstaller extends Installer { +public class PrivilegedInstaller extends Installer { - private static final String TAG = "SystemInstaller"; + private static final String TAG = "PrivilegedInstaller"; private Activity mActivity; - private final PackageInstallObserver mInstallObserver; - private final PackageDeleteObserver mDeleteObserver; - private Method mInstallMethod; - private Method mDeleteMethod; +// private final PackageInstallObserver mInstallObserver; +// private final PackageDeleteObserver mDeleteObserver; +// private Method mInstallMethod; +// private Method mDeleteMethod; public static final int REQUEST_CONFIRM_PERMS = 0; - public SystemInstaller(Activity activity, PackageManager pm, - InstallerCallback callback) throws AndroidNotCompatibleException { + public PrivilegedInstaller(Activity activity, PackageManager pm, + InstallerCallback callback) throws AndroidNotCompatibleException { super(activity, pm, callback); this.mActivity = activity; diff --git a/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystem.java b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivileged.java similarity index 94% rename from F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystem.java rename to F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivileged.java index e7fd19643..0b7d13bd3 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystem.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivileged.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.fdroid.fdroid.installer; +package org.fdroid.fdroid.privileged.install; import android.content.Context; import android.os.Build; @@ -35,15 +35,15 @@ import eu.chainfire.libsuperuser.Shell; * http://omerjerk.in/2014/08/how-to-install-an-app-to-system-partition/ * https://github.com/omerjerk/RemoteDroid/blob/master/app/src/main/java/in/omerjerk/remotedroid/app/MainActivity.java */ -abstract class InstallIntoSystem { +abstract class InstallPrivileged { protected final Context context; - public InstallIntoSystem(final Context context) { + public InstallPrivileged(final Context context) { this.context = context; } - public static InstallIntoSystem create(final Context context) { + public static InstallPrivileged create(final Context context) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { return new LollipopImpl(context); } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { @@ -112,7 +112,7 @@ abstract class InstallIntoSystem { return commands; } - private static class PreKitKatImpl extends InstallIntoSystem { + private static class PreKitKatImpl extends InstallPrivileged { public PreKitKatImpl(Context context) { super(context); @@ -125,7 +125,7 @@ abstract class InstallIntoSystem { } - private static class KitKatToLollipopImpl extends InstallIntoSystem { + private static class KitKatToLollipopImpl extends InstallPrivileged { public KitKatToLollipopImpl(Context context) { super(context); @@ -146,7 +146,7 @@ abstract class InstallIntoSystem { * History of PackageManagerService in Lollipop: * https://github.com/android/platform_frameworks_base/commits/lollipop-release/services/core/java/com/android/server/pm/PackageManagerService.java */ - private static class LollipopImpl extends InstallIntoSystem { + private static class LollipopImpl extends InstallPrivileged { public LollipopImpl(Context context) { super(context); diff --git a/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemBootReceiver.java b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedBootReceiver.java similarity index 86% rename from F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemBootReceiver.java rename to F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedBootReceiver.java index 42f7e57cc..7f8598243 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemBootReceiver.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedBootReceiver.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.fdroid.fdroid.installer; +package org.fdroid.fdroid.privileged.install; import android.content.BroadcastReceiver; import android.content.Context; @@ -25,7 +25,7 @@ import android.content.Intent; import org.fdroid.fdroid.Preferences; -public class InstallIntoSystemBootReceiver extends BroadcastReceiver { +public class InstallPrivilegedBootReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { @@ -33,8 +33,8 @@ public class InstallIntoSystemBootReceiver extends BroadcastReceiver { if (Preferences.get().isPostSystemInstall()) { Preferences.get().setPostSystemInstall(false); - Intent postInstall = new Intent(context.getApplicationContext(), InstallIntoSystemDialogActivity.class); - postInstall.setAction(InstallIntoSystemDialogActivity.ACTION_POST_INSTALL); + Intent postInstall = new Intent(context.getApplicationContext(), InstallPrivilegedDialogActivity.class); + postInstall.setAction(InstallPrivilegedDialogActivity.ACTION_POST_INSTALL); postInstall.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(postInstall); } diff --git a/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemDialogActivity.java b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedDialogActivity.java similarity index 91% rename from F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemDialogActivity.java rename to F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedDialogActivity.java index 8fe2b102c..c5680e5be 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/InstallIntoSystemDialogActivity.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/install/InstallPrivilegedDialogActivity.java @@ -17,7 +17,7 @@ * MA 02110-1301, USA. */ -package org.fdroid.fdroid.installer; +package org.fdroid.fdroid.privileged.install; import android.app.Activity; import android.app.Notification; @@ -40,13 +40,14 @@ import org.fdroid.fdroid.FDroid; import org.fdroid.fdroid.FDroidApp; import org.fdroid.fdroid.Preferences; import org.fdroid.fdroid.R; +import org.fdroid.fdroid.installer.Installer; import eu.chainfire.libsuperuser.Shell; /** * Note: This activity has no view on its own, it displays consecutive dialogs. */ -public class InstallIntoSystemDialogActivity extends FragmentActivity { +public class InstallPrivilegedDialogActivity extends FragmentActivity { private static final String TAG = "InstallIntoSystem"; @@ -112,8 +113,8 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { if (false && probablyRoot) { // looks like we have root, at least su has a version number and is present - Intent installIntent = new Intent(context, InstallIntoSystemDialogActivity.class); - installIntent.setAction(InstallIntoSystemDialogActivity.ACTION_FIRST_TIME); + Intent installIntent = new Intent(context, InstallPrivilegedDialogActivity.class); + installIntent.setAction(InstallPrivilegedDialogActivity.ACTION_FIRST_TIME); installIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); PendingIntent resultPendingIntent = @@ -157,7 +158,7 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay ContextThemeWrapper theme = new ContextThemeWrapper(this, FDroidApp.getCurThemeResId()); - String message = getString(R.string.system_install_first_time_message) + "

" + InstallIntoSystem.create(getApplicationContext()).getWarningInfo(); + String message = getString(R.string.system_install_first_time_message) + "

" + InstallPrivileged.create(getApplicationContext()).getWarningInfo(); AlertDialog.Builder builder = new AlertDialog.Builder(theme) .setMessage(Html.fromHtml(message)) @@ -170,8 +171,8 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { - InstallIntoSystemDialogActivity.this.setResult(Activity.RESULT_CANCELED); - InstallIntoSystemDialogActivity.this.finish(); + InstallPrivilegedDialogActivity.this.setResult(Activity.RESULT_CANCELED); + InstallPrivilegedDialogActivity.this.finish(); } }); builder.create().show(); @@ -188,7 +189,7 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { super.onPreExecute(); // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay - ContextThemeWrapper theme = new ContextThemeWrapper(InstallIntoSystemDialogActivity.this, + ContextThemeWrapper theme = new ContextThemeWrapper(InstallPrivilegedDialogActivity.this, FDroidApp.getCurThemeResId()); mProgressDialog = new ProgressDialog(theme); @@ -224,7 +225,7 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { if (!ACTION_FIRST_TIME.equals(action)) { // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay - ContextThemeWrapper theme = new ContextThemeWrapper(InstallIntoSystemDialogActivity.this, + ContextThemeWrapper theme = new ContextThemeWrapper(InstallPrivilegedDialogActivity.this, FDroidApp.getCurThemeResId()); AlertDialog.Builder alertBuilder = new AlertDialog.Builder(theme) @@ -233,8 +234,8 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { .setNeutralButton(android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - InstallIntoSystemDialogActivity.this.setResult(Activity.RESULT_CANCELED); - InstallIntoSystemDialogActivity.this.finish(); + InstallPrivilegedDialogActivity.this.setResult(Activity.RESULT_CANCELED); + InstallPrivilegedDialogActivity.this.finish(); } }); alertBuilder.create().show(); @@ -254,7 +255,7 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { super.onPreExecute(); // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay - ContextThemeWrapper theme = new ContextThemeWrapper(InstallIntoSystemDialogActivity.this, + ContextThemeWrapper theme = new ContextThemeWrapper(InstallPrivilegedDialogActivity.this, FDroidApp.getCurThemeResId()); mProgressDialog = new ProgressDialog(theme); @@ -266,7 +267,7 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { @Override protected Void doInBackground(Void... voids) { - InstallIntoSystem.create(getApplicationContext()).runInstall(); + InstallPrivileged.create(getApplicationContext()).runInstall(); return null; } }; @@ -289,9 +290,9 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { - InstallIntoSystemDialogActivity.this.setResult(success ? Activity.RESULT_OK : Activity.RESULT_CANCELED); - InstallIntoSystemDialogActivity.this.finish(); - startActivity(new Intent(InstallIntoSystemDialogActivity.this, FDroid.class)); + InstallPrivilegedDialogActivity.this.setResult(success ? Activity.RESULT_OK : Activity.RESULT_CANCELED); + InstallPrivilegedDialogActivity.this.finish(); + startActivity(new Intent(InstallPrivilegedDialogActivity.this, FDroid.class)); } }) .setCancelable(false); @@ -317,8 +318,8 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - InstallIntoSystemDialogActivity.this.setResult(Activity.RESULT_CANCELED); - InstallIntoSystemDialogActivity.this.finish(); + InstallPrivilegedDialogActivity.this.setResult(Activity.RESULT_CANCELED); + InstallPrivilegedDialogActivity.this.finish(); } }); builder.create().show(); @@ -329,8 +330,8 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { .setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - InstallIntoSystemDialogActivity.this.setResult(Activity.RESULT_CANCELED); - InstallIntoSystemDialogActivity.this.finish(); + InstallPrivilegedDialogActivity.this.setResult(Activity.RESULT_CANCELED); + InstallPrivilegedDialogActivity.this.finish(); } }); builder.create().show(); @@ -345,7 +346,7 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { super.onPreExecute(); // hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay - ContextThemeWrapper theme = new ContextThemeWrapper(InstallIntoSystemDialogActivity.this, + ContextThemeWrapper theme = new ContextThemeWrapper(InstallPrivilegedDialogActivity.this, FDroidApp.getCurThemeResId()); mProgressDialog = new ProgressDialog(theme); @@ -357,7 +358,7 @@ public class InstallIntoSystemDialogActivity extends FragmentActivity { @Override protected Void doInBackground(Void... voids) { - InstallIntoSystem.create(getApplicationContext()).runUninstall(); + InstallPrivileged.create(getApplicationContext()).runUninstall(); return null; } diff --git a/F-Droid/src/org/fdroid/fdroid/installer/AppDiff.java b/F-Droid/src/org/fdroid/fdroid/privileged/views/AppDiff.java similarity index 94% rename from F-Droid/src/org/fdroid/fdroid/installer/AppDiff.java rename to F-Droid/src/org/fdroid/fdroid/privileged/views/AppDiff.java index 2391cb096..95b94cc28 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/AppDiff.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/views/AppDiff.java @@ -16,7 +16,7 @@ ** limitations under the License. */ -package org.fdroid.fdroid.installer; +package org.fdroid.fdroid.privileged.views; import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; @@ -25,10 +25,10 @@ import android.net.Uri; public class AppDiff { - final PackageManager mPm; - final PackageInfo mPkgInfo; + public final PackageManager mPm; + public final PackageInfo mPkgInfo; - ApplicationInfo mInstalledAppInfo = null; + public ApplicationInfo mInstalledAppInfo = null; public AppDiff(PackageManager mPm, Uri mPackageURI) { this.mPm = mPm; diff --git a/F-Droid/src/org/fdroid/fdroid/installer/AppSecurityPermissions.java b/F-Droid/src/org/fdroid/fdroid/privileged/views/AppSecurityPermissions.java similarity index 99% rename from F-Droid/src/org/fdroid/fdroid/installer/AppSecurityPermissions.java rename to F-Droid/src/org/fdroid/fdroid/privileged/views/AppSecurityPermissions.java index e65ef76cf..c6754b71c 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/AppSecurityPermissions.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/views/AppSecurityPermissions.java @@ -15,7 +15,7 @@ ** See the License for the specific language governing permissions and ** limitations under the License. */ -package org.fdroid.fdroid.installer; +package org.fdroid.fdroid.privileged.views; import android.annotation.TargetApi; import android.content.Context; diff --git a/F-Droid/src/org/fdroid/fdroid/installer/CaffeinatedScrollView.java b/F-Droid/src/org/fdroid/fdroid/privileged/views/CaffeinatedScrollView.java similarity index 98% rename from F-Droid/src/org/fdroid/fdroid/installer/CaffeinatedScrollView.java rename to F-Droid/src/org/fdroid/fdroid/privileged/views/CaffeinatedScrollView.java index 37b96b419..f43dbc053 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/CaffeinatedScrollView.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/views/CaffeinatedScrollView.java @@ -15,7 +15,7 @@ ** limitations under the License. */ -package org.fdroid.fdroid.installer; +package org.fdroid.fdroid.privileged.views; import android.content.Context; import android.graphics.Canvas; diff --git a/F-Droid/src/org/fdroid/fdroid/installer/InstallConfirmActivity.java b/F-Droid/src/org/fdroid/fdroid/privileged/views/InstallConfirmActivity.java similarity index 99% rename from F-Droid/src/org/fdroid/fdroid/installer/InstallConfirmActivity.java rename to F-Droid/src/org/fdroid/fdroid/privileged/views/InstallConfirmActivity.java index aeaf16e8b..dae78e90f 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/InstallConfirmActivity.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/views/InstallConfirmActivity.java @@ -16,7 +16,7 @@ ** limitations under the License. */ -package org.fdroid.fdroid.installer; +package org.fdroid.fdroid.privileged.views; import android.app.Activity; import android.content.Context; diff --git a/F-Droid/src/org/fdroid/fdroid/installer/TabsAdapter.java b/F-Droid/src/org/fdroid/fdroid/privileged/views/TabsAdapter.java similarity index 99% rename from F-Droid/src/org/fdroid/fdroid/installer/TabsAdapter.java rename to F-Droid/src/org/fdroid/fdroid/privileged/views/TabsAdapter.java index eef50eb1b..02372fd84 100644 --- a/F-Droid/src/org/fdroid/fdroid/installer/TabsAdapter.java +++ b/F-Droid/src/org/fdroid/fdroid/privileged/views/TabsAdapter.java @@ -14,7 +14,7 @@ ** See the License for the specific language governing permissions and ** limitations under the License. */ -package org.fdroid.fdroid.installer; +package org.fdroid.fdroid.privileged.views; import android.app.Activity; import android.content.Context; diff --git a/F-Droid/src/org/fdroid/fdroid/views/fragments/PreferencesFragment.java b/F-Droid/src/org/fdroid/fdroid/views/fragments/PreferencesFragment.java index 4b111c0d4..40804dd88 100644 --- a/F-Droid/src/org/fdroid/fdroid/views/fragments/PreferencesFragment.java +++ b/F-Droid/src/org/fdroid/fdroid/views/fragments/PreferencesFragment.java @@ -19,7 +19,7 @@ import org.fdroid.fdroid.Preferences; import org.fdroid.fdroid.PreferencesActivity; import org.fdroid.fdroid.R; import org.fdroid.fdroid.Utils; -import org.fdroid.fdroid.installer.InstallIntoSystemDialogActivity; +import org.fdroid.fdroid.privileged.install.InstallPrivilegedDialogActivity; import org.fdroid.fdroid.installer.Installer; import java.util.Locale; @@ -221,8 +221,8 @@ public class PreferencesFragment extends PreferenceFragment alertBuilder.setPositiveButton(R.string.system_permission_install_via_root, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - Intent installIntent = new Intent(getActivity(), InstallIntoSystemDialogActivity.class); - installIntent.setAction(InstallIntoSystemDialogActivity.ACTION_INSTALL); + Intent installIntent = new Intent(getActivity(), InstallPrivilegedDialogActivity.class); + installIntent.setAction(InstallPrivilegedDialogActivity.ACTION_INSTALL); startActivity(installIntent); } }); @@ -249,8 +249,8 @@ public class PreferencesFragment extends PreferenceFragment @Override public boolean onPreferenceClick(Preference preference) { - Intent uninstallIntent = new Intent(getActivity(), InstallIntoSystemDialogActivity.class); - uninstallIntent.setAction(InstallIntoSystemDialogActivity.ACTION_UNINSTALL); + Intent uninstallIntent = new Intent(getActivity(), InstallPrivilegedDialogActivity.class); + uninstallIntent.setAction(InstallPrivilegedDialogActivity.ACTION_UNINSTALL); startActivity(uninstallIntent); return true;