Merge commit 'refs/merge-requests/66' of gitorious.org:f-droid/fdroidclient
Conflicts: test/src/org/fdroid/fdroid/ApkProviderTest.java
This commit is contained in:
commit
2c9d8ab7fc
@ -18,9 +18,6 @@
|
|||||||
|
|
||||||
package org.fdroid.fdroid;
|
package org.fdroid.fdroid;
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import org.fdroid.fdroid.data.App;
|
import org.fdroid.fdroid.data.App;
|
||||||
|
|
||||||
public class AppFilter {
|
public class AppFilter {
|
||||||
@ -32,7 +29,7 @@ public class AppFilter {
|
|||||||
boolean dontFilterRequiringRoot = Preferences.get().filterAppsRequiringRoot();
|
boolean dontFilterRequiringRoot = Preferences.get().filterAppsRequiringRoot();
|
||||||
|
|
||||||
if (app.requirements == null || dontFilterRequiringRoot) return false;
|
if (app.requirements == null || dontFilterRequiringRoot) return false;
|
||||||
|
|
||||||
for (String r : app.requirements) {
|
for (String r : app.requirements) {
|
||||||
if (r.equals("root"))
|
if (r.equals("root"))
|
||||||
return true;
|
return true;
|
||||||
|
@ -49,7 +49,6 @@ import com.nostra13.universalimageloader.utils.StorageUtils;
|
|||||||
|
|
||||||
import de.duenndns.ssl.MemorizingTrustManager;
|
import de.duenndns.ssl.MemorizingTrustManager;
|
||||||
|
|
||||||
import org.fdroid.fdroid.data.App;
|
|
||||||
import org.fdroid.fdroid.data.AppProvider;
|
import org.fdroid.fdroid.data.AppProvider;
|
||||||
import org.thoughtcrime.ssl.pinning.PinningTrustManager;
|
import org.thoughtcrime.ssl.pinning.PinningTrustManager;
|
||||||
import org.thoughtcrime.ssl.pinning.SystemKeyStore;
|
import org.thoughtcrime.ssl.pinning.SystemKeyStore;
|
||||||
@ -59,6 +58,7 @@ public class FDroidApp extends Application {
|
|||||||
private static enum Theme {
|
private static enum Theme {
|
||||||
dark, light
|
dark, light
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Theme curTheme = Theme.dark;
|
private static Theme curTheme = Theme.dark;
|
||||||
|
|
||||||
public void reloadTheme() {
|
public void reloadTheme() {
|
||||||
@ -66,6 +66,7 @@ public class FDroidApp extends Application {
|
|||||||
.getDefaultSharedPreferences(getBaseContext())
|
.getDefaultSharedPreferences(getBaseContext())
|
||||||
.getString(Preferences.PREF_THEME, "dark"));
|
.getString(Preferences.PREF_THEME, "dark"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void applyTheme(Activity activity) {
|
public void applyTheme(Activity activity) {
|
||||||
switch (curTheme) {
|
switch (curTheme) {
|
||||||
case dark:
|
case dark:
|
||||||
@ -124,7 +125,6 @@ public class FDroidApp extends Application {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apps = null;
|
|
||||||
invalidApps = new ArrayList<String>();
|
invalidApps = new ArrayList<String>();
|
||||||
ctx = getApplicationContext();
|
ctx = getApplicationContext();
|
||||||
UpdateService.schedule(ctx);
|
UpdateService.schedule(ctx);
|
||||||
@ -149,16 +149,16 @@ public class FDroidApp extends Application {
|
|||||||
try {
|
try {
|
||||||
SSLContext sc = SSLContext.getInstance("TLS");
|
SSLContext sc = SSLContext.getInstance("TLS");
|
||||||
X509TrustManager defaultTrustManager = null;
|
X509TrustManager defaultTrustManager = null;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* init a trust manager factory with a null keystore to access the system trust managers
|
* init a trust manager factory with a null keystore to access the system trust managers
|
||||||
*/
|
*/
|
||||||
TrustManagerFactory tmf =
|
TrustManagerFactory tmf =
|
||||||
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
|
||||||
KeyStore ks = null;
|
KeyStore ks = null;
|
||||||
tmf.init(ks);
|
tmf.init(ks);
|
||||||
TrustManager[] mgrs = tmf.getTrustManagers();
|
TrustManager[] mgrs = tmf.getTrustManagers();
|
||||||
|
|
||||||
if(mgrs.length > 0 && mgrs[0] instanceof X509TrustManager)
|
if(mgrs.length > 0 && mgrs[0] instanceof X509TrustManager)
|
||||||
defaultTrustManager = (X509TrustManager) mgrs[0];
|
defaultTrustManager = (X509TrustManager) mgrs[0];
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ public class FDroidApp extends Application {
|
|||||||
*/
|
*/
|
||||||
PinningTrustManager pinMgr = new PinningTrustManager(SystemKeyStore.getInstance(ctx),FDroidCertPins.getPinList(), 0);
|
PinningTrustManager pinMgr = new PinningTrustManager(SystemKeyStore.getInstance(ctx),FDroidCertPins.getPinList(), 0);
|
||||||
MemorizingTrustManager memMgr = new MemorizingTrustManager(ctx, pinMgr, defaultTrustManager);
|
MemorizingTrustManager memMgr = new MemorizingTrustManager(ctx, pinMgr, defaultTrustManager);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* initialize a SSLContext with the outermost trust manager, use this
|
* initialize a SSLContext with the outermost trust manager, use this
|
||||||
* context to set the default SSL socket factory for the HTTPSURLConnection
|
* context to set the default SSL socket factory for the HTTPSURLConnection
|
||||||
@ -187,12 +187,8 @@ public class FDroidApp extends Application {
|
|||||||
|
|
||||||
private Context ctx;
|
private Context ctx;
|
||||||
|
|
||||||
// Global list of all known applications.
|
|
||||||
private List<App> apps;
|
|
||||||
|
|
||||||
// Set when something has changed (database or installed apps) so we know
|
// Set when something has changed (database or installed apps) so we know
|
||||||
// we should invalidate the apps.
|
// we should invalidate the apps.
|
||||||
private volatile boolean appsAllInvalid = false;
|
|
||||||
private Semaphore appsInvalidLock = new Semaphore(1, false);
|
private Semaphore appsInvalidLock = new Semaphore(1, false);
|
||||||
private List<String> invalidApps;
|
private List<String> invalidApps;
|
||||||
|
|
||||||
@ -201,7 +197,6 @@ public class FDroidApp extends Application {
|
|||||||
public void invalidateAllApps() {
|
public void invalidateAllApps() {
|
||||||
try {
|
try {
|
||||||
appsInvalidLock.acquire();
|
appsInvalidLock.acquire();
|
||||||
appsAllInvalid = true;
|
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// Don't care
|
// Don't care
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -31,8 +31,8 @@ public class FDroidCertPins {
|
|||||||
* SPKI Pin: 638F93856E1F5EDFCBD40C46D4160CFF21B0713A
|
* SPKI Pin: 638F93856E1F5EDFCBD40C46D4160CFF21B0713A
|
||||||
*/
|
*/
|
||||||
"638F93856E1F5EDFCBD40C46D4160CFF21B0713A",
|
"638F93856E1F5EDFCBD40C46D4160CFF21B0713A",
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SubjectDN: CN=guardianproject.info, OU=Gandi Standard SSL, OU=Domain Control Validated
|
* SubjectDN: CN=guardianproject.info, OU=Gandi Standard SSL, OU=Domain Control Validated
|
||||||
* IssuerDN: CN=Gandi Standard SSL CA, O=GANDI SAS, C=FR
|
* IssuerDN: CN=Gandi Standard SSL CA, O=GANDI SAS, C=FR
|
||||||
* Fingerprint: 187C2573E924DFCBFF2A781A2F99D71C6E031828
|
* Fingerprint: 187C2573E924DFCBFF2A781A2F99D71C6E031828
|
||||||
|
@ -2,7 +2,6 @@ package org.fdroid.fdroid;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import android.app.LoaderManager;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
|
@ -152,8 +152,7 @@ public class PreferencesActivity extends PreferenceActivity implements
|
|||||||
|
|
||||||
super.onResume();
|
super.onResume();
|
||||||
getPreferenceScreen().getSharedPreferences()
|
getPreferenceScreen().getSharedPreferences()
|
||||||
.registerOnSharedPreferenceChangeListener(
|
.registerOnSharedPreferenceChangeListener(this);
|
||||||
(OnSharedPreferenceChangeListener)this);
|
|
||||||
|
|
||||||
for (String key : summariesToUpdate) {
|
for (String key : summariesToUpdate) {
|
||||||
updateSummary(key, false);
|
updateSummary(key, false);
|
||||||
|
@ -66,10 +66,12 @@ public interface ProgressListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static final Parcelable.Creator<Event> CREATOR = new Parcelable.Creator<Event>() {
|
public static final Parcelable.Creator<Event> CREATOR = new Parcelable.Creator<Event>() {
|
||||||
|
@Override
|
||||||
public Event createFromParcel(Parcel in) {
|
public Event createFromParcel(Parcel in) {
|
||||||
return new Event(in.readInt(), in.readInt(), in.readInt(), in.readBundle());
|
return new Event(in.readInt(), in.readInt(), in.readInt(), in.readBundle());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Event[] newArray(int size) {
|
public Event[] newArray(int size) {
|
||||||
return new Event[size];
|
return new Event[size];
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,6 @@ public class UpdateService extends IntentService implements ProgressListener {
|
|||||||
|
|
||||||
// Grab some preliminary information, then we can release the
|
// Grab some preliminary information, then we can release the
|
||||||
// database while we do all the downloading, etc...
|
// database while we do all the downloading, etc...
|
||||||
int updates = 0;
|
|
||||||
List<Repo> repos = RepoProvider.Helper.all(this);
|
List<Repo> repos = RepoProvider.Helper.all(this);
|
||||||
|
|
||||||
// Process each repo...
|
// Process each repo...
|
||||||
|
@ -26,7 +26,6 @@ import android.util.DisplayMetrics;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import com.nostra13.universalimageloader.utils.StorageUtils;
|
import com.nostra13.universalimageloader.utils.StorageUtils;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
@ -39,8 +38,6 @@ import java.text.SimpleDateFormat;
|
|||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import org.fdroid.fdroid.data.Repo;
|
|
||||||
|
|
||||||
public final class Utils {
|
public final class Utils {
|
||||||
|
|
||||||
public static final int BUFFER_SIZE = 4096;
|
public static final int BUFFER_SIZE = 4096;
|
||||||
|
@ -4,10 +4,6 @@ import android.annotation.TargetApi;
|
|||||||
import android.content.ClipData;
|
import android.content.ClipData;
|
||||||
import android.content.ClipboardManager;
|
import android.content.ClipboardManager;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.Switch;
|
|
||||||
import android.widget.ToggleButton;
|
|
||||||
import org.fdroid.fdroid.ManageRepo;
|
|
||||||
|
|
||||||
public abstract class ClipboardCompat extends Compatibility {
|
public abstract class ClipboardCompat extends Compatibility {
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ import java.util.Set;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.util.Log;
|
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
public class SupportedArchitectures extends Compatibility {
|
public class SupportedArchitectures extends Compatibility {
|
||||||
|
@ -2,7 +2,6 @@ package org.fdroid.fdroid.compat;
|
|||||||
|
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Build;
|
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.ToggleButton;
|
import android.widget.ToggleButton;
|
||||||
|
@ -66,6 +66,7 @@ class OldTabManagerImpl extends TabManager {
|
|||||||
* and giving it a FrameLayout as a child. This will make the tabs have
|
* and giving it a FrameLayout as a child. This will make the tabs have
|
||||||
* dummy empty contents and then hook them up to our ViewPager.
|
* dummy empty contents and then hook them up to our ViewPager.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void createTabs() {
|
public void createTabs() {
|
||||||
tabHost = new TabHost(parent, null);
|
tabHost = new TabHost(parent, null);
|
||||||
tabHost.setLayoutParams(new TabHost.LayoutParams(
|
tabHost.setLayoutParams(new TabHost.LayoutParams(
|
||||||
@ -128,12 +129,14 @@ class OldTabManagerImpl extends TabManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
public void selectTab(int index) {
|
public void selectTab(int index) {
|
||||||
tabHost.setCurrentTab(index);
|
tabHost.setCurrentTab(index);
|
||||||
if (index == INDEX_CAN_UPDATE)
|
if (index == INDEX_CAN_UPDATE)
|
||||||
removeNotification(1);
|
removeNotification(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void refreshTabLabel(int index) {
|
public void refreshTabLabel(int index) {
|
||||||
CharSequence text = getLabel(index);
|
CharSequence text = getLabel(index);
|
||||||
|
|
||||||
@ -166,6 +169,7 @@ class HoneycombTabManagerImpl extends TabManager {
|
|||||||
actionBar = parent.getActionBar();
|
actionBar = parent.getActionBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void createTabs() {
|
public void createTabs() {
|
||||||
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
|
||||||
for (int i = 0; i < pager.getAdapter().getCount(); i ++) {
|
for (int i = 0; i < pager.getAdapter().getCount(); i ++) {
|
||||||
@ -174,6 +178,7 @@ class HoneycombTabManagerImpl extends TabManager {
|
|||||||
actionBar.newTab()
|
actionBar.newTab()
|
||||||
.setText(label)
|
.setText(label)
|
||||||
.setTabListener(new ActionBar.TabListener() {
|
.setTabListener(new ActionBar.TabListener() {
|
||||||
|
@Override
|
||||||
public void onTabSelected(ActionBar.Tab tab,
|
public void onTabSelected(ActionBar.Tab tab,
|
||||||
FragmentTransaction ft) {
|
FragmentTransaction ft) {
|
||||||
int pos = tab.getPosition();
|
int pos = tab.getPosition();
|
||||||
@ -193,6 +198,7 @@ class HoneycombTabManagerImpl extends TabManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void selectTab(int index) {
|
public void selectTab(int index) {
|
||||||
actionBar.setSelectedNavigationItem(index);
|
actionBar.setSelectedNavigationItem(index);
|
||||||
Spinner actionBarSpinner = getActionBarSpinner();
|
Spinner actionBarSpinner = getActionBarSpinner();
|
||||||
@ -203,6 +209,7 @@ class HoneycombTabManagerImpl extends TabManager {
|
|||||||
removeNotification(1);
|
removeNotification(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void refreshTabLabel(int index) {
|
public void refreshTabLabel(int index) {
|
||||||
CharSequence text = getLabel(index);
|
CharSequence text = getLabel(index);
|
||||||
actionBar.getTabAt(index).setText(text);
|
actionBar.getTabAt(index).setText(text);
|
||||||
|
@ -216,6 +216,7 @@ public class ApkProvider extends FDroidProvider {
|
|||||||
return PROVIDER_NAME;
|
return PROVIDER_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected UriMatcher getMatcher() {
|
protected UriMatcher getMatcher() {
|
||||||
return matcher;
|
return matcher;
|
||||||
}
|
}
|
||||||
@ -284,6 +285,7 @@ public class ApkProvider extends FDroidProvider {
|
|||||||
this.orderBy = orderBy;
|
this.orderBy = orderBy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|
||||||
StringBuilder suffix = new StringBuilder();
|
StringBuilder suffix = new StringBuilder();
|
||||||
@ -403,7 +405,7 @@ public class ApkProvider extends FDroidProvider {
|
|||||||
public Uri insert(Uri uri, ContentValues values) {
|
public Uri insert(Uri uri, ContentValues values) {
|
||||||
removeRepoFields(values);
|
removeRepoFields(values);
|
||||||
validateFields(DataColumns.ALL, values);
|
validateFields(DataColumns.ALL, values);
|
||||||
long id = write().insertOrThrow(getTableName(), null, values);
|
write().insertOrThrow(getTableName(), null, values);
|
||||||
if (!isApplyingBatch()) {
|
if (!isApplyingBatch()) {
|
||||||
getContext().getContentResolver().notifyChange(uri, null);
|
getContext().getContentResolver().notifyChange(uri, null);
|
||||||
}
|
}
|
||||||
|
@ -266,6 +266,7 @@ public class AppProvider extends FDroidProvider {
|
|||||||
return AUTHORITY + "." + PROVIDER_NAME;
|
return AUTHORITY + "." + PROVIDER_NAME;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected UriMatcher getMatcher() {
|
protected UriMatcher getMatcher() {
|
||||||
return matcher;
|
return matcher;
|
||||||
}
|
}
|
||||||
@ -458,7 +459,7 @@ public class AppProvider extends FDroidProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Uri insert(Uri uri, ContentValues values) {
|
public Uri insert(Uri uri, ContentValues values) {
|
||||||
long id = write().insertOrThrow(getTableName(), null, values);
|
write().insertOrThrow(getTableName(), null, values);
|
||||||
if (!isApplyingBatch()) {
|
if (!isApplyingBatch()) {
|
||||||
getContext().getContentResolver().notifyChange(uri, null);
|
getContext().getContentResolver().notifyChange(uri, null);
|
||||||
}
|
}
|
||||||
|
@ -2,11 +2,9 @@ package org.fdroid.fdroid.data;
|
|||||||
|
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.database.sqlite.SQLiteDatabase;
|
import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.database.sqlite.SQLiteOpenHelper;
|
import android.database.sqlite.SQLiteOpenHelper;
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import org.fdroid.fdroid.*;
|
import org.fdroid.fdroid.*;
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ public class Repo extends ValueObject {
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
@ -234,6 +234,7 @@ public class RepoProvider extends FDroidProvider {
|
|||||||
return "RepoProvider";
|
return "RepoProvider";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected UriMatcher getMatcher() {
|
protected UriMatcher getMatcher() {
|
||||||
return matcher;
|
return matcher;
|
||||||
}
|
}
|
||||||
|
@ -202,6 +202,7 @@ public class NsdHelper {
|
|||||||
//in order for it to update the ListView without error
|
//in order for it to update the ListView without error
|
||||||
Handler refresh = new Handler(Looper.getMainLooper());
|
Handler refresh = new Handler(Looper.getMainLooper());
|
||||||
refresh.post(new Runnable() {
|
refresh.post(new Runnable() {
|
||||||
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
@ -248,7 +248,7 @@ abstract public class RepoUpdater {
|
|||||||
+ repo.version + " to " + handler.getVersion());
|
+ repo.version + " to " + handler.getVersion());
|
||||||
values.put(RepoProvider.DataColumns.VERSION, handler.getVersion());
|
values.put(RepoProvider.DataColumns.VERSION, handler.getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handler.getMaxAge() != -1 && handler.getMaxAge() != repo.maxage) {
|
if (handler.getMaxAge() != -1 && handler.getMaxAge() != repo.maxage) {
|
||||||
Log.d("FDroid",
|
Log.d("FDroid",
|
||||||
"Repo specified a new maximum age - updated");
|
"Repo specified a new maximum age - updated");
|
||||||
@ -268,6 +268,7 @@ abstract public class RepoUpdater {
|
|||||||
|
|
||||||
public static class UpdateException extends Exception {
|
public static class UpdateException extends Exception {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = -4492452418826132803L;
|
||||||
public final Repo repo;
|
public final Repo repo;
|
||||||
|
|
||||||
public UpdateException(Repo repo, String message) {
|
public UpdateException(Repo repo, String message) {
|
||||||
|
@ -84,6 +84,7 @@ public class SignedRepoUpdater extends RepoUpdater {
|
|||||||
return indexFile;
|
return indexFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String getIndexAddress() {
|
protected String getIndexAddress() {
|
||||||
return repo.address + "/index.jar?client_version=" + context.getString(R.string.version_name);
|
return repo.address + "/index.jar?client_version=" + context.getString(R.string.version_name);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import android.content.pm.PackageInfo;
|
|||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.support.v4.widget.CursorAdapter;
|
import android.support.v4.widget.CursorAdapter;
|
||||||
import android.util.Log;
|
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -45,6 +45,7 @@ public class RepoAdapter extends CursorAdapter {
|
|||||||
enabledListener = listener;
|
enabledListener = listener;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean hasStableIds() {
|
public boolean hasStableIds() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,23 +1,18 @@
|
|||||||
package org.fdroid.fdroid.views.fragments;
|
package org.fdroid.fdroid.views.fragments;
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.support.v4.app.ListFragment;
|
import android.support.v4.app.ListFragment;
|
||||||
import android.support.v4.app.LoaderManager;
|
import android.support.v4.app.LoaderManager;
|
||||||
import android.support.v4.content.CursorLoader;
|
import android.support.v4.content.CursorLoader;
|
||||||
import android.support.v4.content.Loader;
|
import android.support.v4.content.Loader;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ListView;
|
|
||||||
|
|
||||||
|
|
||||||
import com.nostra13.universalimageloader.core.ImageLoader;
|
import com.nostra13.universalimageloader.core.ImageLoader;
|
||||||
import com.nostra13.universalimageloader.core.listener.PauseOnScrollListener;
|
import com.nostra13.universalimageloader.core.listener.PauseOnScrollListener;
|
||||||
|
@ -37,6 +37,7 @@ public class AvailableAppsFragment extends AppListFragment implements
|
|||||||
return "Available";
|
return "Available";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected AppListAdapter getAppListAdapter() {
|
protected AppListAdapter getAppListAdapter() {
|
||||||
if (adapter == null) {
|
if (adapter == null) {
|
||||||
final AppListAdapter a = new AvailableAppListAdapter(getActivity(), null);
|
final AppListAdapter a = new AvailableAppListAdapter(getActivity(), null);
|
||||||
@ -53,7 +54,7 @@ public class AvailableAppsFragment extends AppListFragment implements
|
|||||||
|
|
||||||
private class CategoryObserver extends ContentObserver {
|
private class CategoryObserver extends ContentObserver {
|
||||||
|
|
||||||
private ArrayAdapter adapter;
|
private ArrayAdapter<String> adapter;
|
||||||
|
|
||||||
public CategoryObserver(ArrayAdapter<String> adapter) {
|
public CategoryObserver(ArrayAdapter<String> adapter) {
|
||||||
super(null);
|
super(null);
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
package org.fdroid.fdroid.views.fragments;
|
package org.fdroid.fdroid.views.fragments;
|
||||||
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v4.content.CursorLoader;
|
|
||||||
import android.support.v4.content.Loader;
|
|
||||||
import org.fdroid.fdroid.R;
|
import org.fdroid.fdroid.R;
|
||||||
import org.fdroid.fdroid.data.AppProvider;
|
import org.fdroid.fdroid.data.AppProvider;
|
||||||
import org.fdroid.fdroid.views.AppListAdapter;
|
import org.fdroid.fdroid.views.AppListAdapter;
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
package org.fdroid.fdroid.views.fragments;
|
package org.fdroid.fdroid.views.fragments;
|
||||||
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
|
||||||
import android.support.v4.content.CursorLoader;
|
|
||||||
import android.support.v4.content.Loader;
|
|
||||||
import org.fdroid.fdroid.R;
|
import org.fdroid.fdroid.R;
|
||||||
import org.fdroid.fdroid.data.AppProvider;
|
import org.fdroid.fdroid.data.AppProvider;
|
||||||
import org.fdroid.fdroid.views.AppListAdapter;
|
import org.fdroid.fdroid.views.AppListAdapter;
|
||||||
|
@ -62,6 +62,7 @@ public class RepoDetailsFragment extends Fragment {
|
|||||||
// best way to go about this...
|
// best way to go about this...
|
||||||
private Repo repo;
|
private Repo repo;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onAttach(Activity activity) {
|
public void onAttach(Activity activity) {
|
||||||
super.onAttach(activity);
|
super.onAttach(activity);
|
||||||
}
|
}
|
||||||
@ -80,6 +81,7 @@ public class RepoDetailsFragment extends Fragment {
|
|||||||
return RepoProvider.Helper.findById(getActivity(), getRepoId());
|
return RepoProvider.Helper.findById(getActivity(), getRepoId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
|
||||||
repo = loadRepoDetails();
|
repo = loadRepoDetails();
|
||||||
@ -346,11 +348,13 @@ public class RepoDetailsFragment extends Fragment {
|
|||||||
repoFingerprintView.setTextColor(repoFingerprintColor);
|
repoFingerprintView.setTextColor(repoFingerprintColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setHasOptionsMenu(true);
|
setHasOptionsMenu(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void onActivityCreated(Bundle savedInstanceState) {
|
public void onActivityCreated(Bundle savedInstanceState) {
|
||||||
super.onActivityCreated(savedInstanceState);
|
super.onActivityCreated(savedInstanceState);
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package org.fdroid.fdroid;
|
|||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
|
|
||||||
import org.fdroid.fdroid.data.Apk;
|
import org.fdroid.fdroid.data.Apk;
|
||||||
import org.fdroid.fdroid.data.ApkProvider;
|
import org.fdroid.fdroid.data.ApkProvider;
|
||||||
import org.fdroid.fdroid.data.RepoProvider;
|
import org.fdroid.fdroid.data.RepoProvider;
|
||||||
|
@ -2,9 +2,10 @@ package org.fdroid.fdroid;
|
|||||||
|
|
||||||
import android.content.ContentValues;
|
import android.content.ContentValues;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.net.Uri;
|
|
||||||
import mock.MockCategoryResources;
|
import mock.MockCategoryResources;
|
||||||
import mock.MockInstallablePackageManager;
|
import mock.MockInstallablePackageManager;
|
||||||
|
|
||||||
import org.fdroid.fdroid.data.ApkProvider;
|
import org.fdroid.fdroid.data.ApkProvider;
|
||||||
import org.fdroid.fdroid.data.App;
|
import org.fdroid.fdroid.data.App;
|
||||||
import org.fdroid.fdroid.data.AppProvider;
|
import org.fdroid.fdroid.data.AppProvider;
|
||||||
@ -24,6 +25,7 @@ public class AppProviderTest extends FDroidProviderTest<AppProvider> {
|
|||||||
getSwappableContext().setResources(new MockCategoryResources());
|
getSwappableContext().setResources(new MockCategoryResources());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected String[] getMinimalProjection() {
|
protected String[] getMinimalProjection() {
|
||||||
return new String[] {
|
return new String[] {
|
||||||
AppProvider.DataColumns.APP_ID,
|
AppProvider.DataColumns.APP_ID,
|
||||||
|
@ -2,7 +2,6 @@ package org.fdroid.fdroid;
|
|||||||
|
|
||||||
import android.content.*;
|
import android.content.*;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.test.mock.MockContentResolver;
|
|
||||||
import junit.framework.AssertionFailedError;
|
import junit.framework.AssertionFailedError;
|
||||||
import org.fdroid.fdroid.data.ApkProvider;
|
import org.fdroid.fdroid.data.ApkProvider;
|
||||||
import org.fdroid.fdroid.data.AppProvider;
|
import org.fdroid.fdroid.data.AppProvider;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user