Merge branch 'three-randos' into 'master'

Three random low risk commits for 1.3

See merge request fdroid/fdroidclient!706
This commit is contained in:
Hans-Christoph Steiner 2018-07-12 10:15:41 +00:00
commit 02f10ea632
4 changed files with 19 additions and 25 deletions

View File

@ -4,29 +4,19 @@ import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.ServiceInfo;
import android.support.v4.app.NotificationManagerCompat; import android.support.v4.app.NotificationManagerCompat;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import org.fdroid.fdroid.AppUpdateStatusService;
import org.fdroid.fdroid.BuildConfig; import org.fdroid.fdroid.BuildConfig;
import org.fdroid.fdroid.CleanCacheService;
import org.fdroid.fdroid.R; import org.fdroid.fdroid.R;
import org.fdroid.fdroid.UpdateService;
import org.fdroid.fdroid.data.InstalledAppProviderService;
import org.fdroid.fdroid.installer.InstallHistoryService;
import org.fdroid.fdroid.installer.InstallManagerService;
import org.fdroid.fdroid.installer.InstallerService;
import org.fdroid.fdroid.localrepo.CacheSwapAppsService;
import org.fdroid.fdroid.localrepo.SwapService;
import org.fdroid.fdroid.net.DownloaderService;
import org.fdroid.fdroid.net.WifiStateChangeService;
import org.fdroid.fdroid.views.main.MainActivity; import org.fdroid.fdroid.views.main.MainActivity;
/** /**
* This class is encapsulating all methods related to hiding the app from the launcher * This class is encapsulating all methods related to hiding the app from the launcher
* and restoring it. * and restoring it.
* * <p>
* It can tell you whether the app is hidden, what the PIN to restore is * It can tell you whether the app is hidden, what the PIN to restore is
* and show confirmation dialogs before hiding. * and show confirmation dialogs before hiding.
*/ */
@ -107,17 +97,16 @@ public class HidingManager {
* Stops all running services, so nothing can pop up and reveal F-Droid's existence on the system * Stops all running services, so nothing can pop up and reveal F-Droid's existence on the system
*/ */
private static void stopServices(Context context) { private static void stopServices(Context context) {
context.stopService(new Intent(context, UpdateService.class)); try {
context.stopService(new Intent(context, DownloaderService.class)); PackageInfo packageInfo = context.getPackageManager().getPackageInfo(context.getPackageName(),
context.stopService(new Intent(context, InstallerService.class)); PackageManager.GET_SERVICES);
context.stopService(new Intent(context, CleanCacheService.class)); for (ServiceInfo serviceInfo : packageInfo.services) {
context.stopService(new Intent(context, WifiStateChangeService.class)); Intent intent = new Intent();
context.stopService(new Intent(context, SwapService.class)); intent.setComponent(new ComponentName(context, serviceInfo.name));
context.stopService(new Intent(context, InstallManagerService.class)); context.stopService(intent);
context.stopService(new Intent(context, InstallHistoryService.class)); }
context.stopService(new Intent(context, CacheSwapAppsService.class)); } catch (PackageManager.NameNotFoundException e) {
context.stopService(new Intent(context, InstalledAppProviderService.class)); e.printStackTrace();
context.stopService(new Intent(context, AppUpdateStatusService.class)); }
} }
} }

View File

@ -257,6 +257,8 @@ public class Apk extends ValueObject implements Comparable<Apk>, Parcelable {
+ "Schema.ApkTable.Cols.NAME set in order to calculate URL " + "Schema.ApkTable.Cols.NAME set in order to calculate URL "
+ "[package: " + packageName + "[package: " + packageName
+ ", versionCode: " + versionCode + ", versionCode: " + versionCode
+ ", apkName: " + apkName
+ ", repoAddress: " + repoAddress
+ ", repoId: " + repoId + "]"); + ", repoId: " + repoId + "]");
} }
} }

View File

@ -550,6 +550,8 @@ public class AppDetailsRecyclerViewAdapter
return itemView.getContext().getString(R.string.antidisabledalgorithmlist); return itemView.getContext().getString(R.string.antidisabledalgorithmlist);
case "KnownVuln": case "KnownVuln":
return itemView.getContext().getString(R.string.antiknownvulnlist); return itemView.getContext().getString(R.string.antiknownvulnlist);
case "NoSourceSince":
return itemView.getContext().getString(R.string.antinosourcesince);
default: default:
return af; return af;
} }

View File

@ -218,6 +218,7 @@ This often occurs with apps installed via Google Play or other sources, if they
<string name="antinonfreeassetslist">This app contains non-free assets</string> <string name="antinonfreeassetslist">This app contains non-free assets</string>
<string name="antidisabledalgorithmlist">This app has a weak security signature</string> <string name="antidisabledalgorithmlist">This app has a weak security signature</string>
<string name="antiknownvulnlist">This app contains a known security vulnerability</string> <string name="antiknownvulnlist">This app contains a known security vulnerability</string>
<string name="antinosourcesince">The source code is no longer available, no updates possible.</string>
<string name="display">Display</string> <string name="display">Display</string>