From aa877fd85a0013058b22c5fdade22678988b5edb Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 29 Jul 2014 15:43:00 -0400 Subject: [PATCH 1/7] Category Spinner should always look like a dropdown menu On Android 4.x, the category menu is showing up as pure black, and looks very much like an app list item. I've personally witnessed many new users struggle to find an app because the category is on "What's New" by default and the app they are looking for is not new. Some even had troubles remembering about the category menu after I told them. This small change makes the category dropdown look the same on all Android versions, and makes it a lot more apparent on newer Android releases. This is a temporary usability fix until we can do something much better than the category dropdown menu. --- .../fdroid/views/fragments/AvailableAppsFragment.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/org/fdroid/fdroid/views/fragments/AvailableAppsFragment.java b/src/org/fdroid/fdroid/views/fragments/AvailableAppsFragment.java index 29c3a2295..6d43781b5 100644 --- a/src/org/fdroid/fdroid/views/fragments/AvailableAppsFragment.java +++ b/src/org/fdroid/fdroid/views/fragments/AvailableAppsFragment.java @@ -7,13 +7,19 @@ import android.content.res.Resources; import android.database.ContentObserver; import android.database.Cursor; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.support.v4.app.LoaderManager; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.*; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.LinearLayout; +import android.widget.ListView; +import android.widget.Spinner; + import org.fdroid.fdroid.Preferences; import org.fdroid.fdroid.R; import org.fdroid.fdroid.compat.ArrayAdapterCompat; @@ -101,6 +107,9 @@ public class AvailableAppsFragment extends AppListFragment implements // Giving it an ID lets the default save/restore state // functionality do its stuff. categorySpinner.setId(R.id.categorySpinner); + // with holo, the menu gets lost since it looks the same as an app list item + if (Build.VERSION.SDK_INT >= 14) + categorySpinner.setBackgroundDrawable(getResources().getDrawable(android.R.drawable.btn_dropdown)); ArrayAdapter adapter = new ArrayAdapter( getActivity(), android.R.layout.simple_spinner_item, translatedCategories); From 78558ca86eb63b94ac78d6c940b840ac4330cb21 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 29 Jul 2014 16:09:01 -0400 Subject: [PATCH 2/7] make method for inserting default repo name/description Instead of copy-pasting a block of code, use a method! :-D. This will be useful when adding more default repos... (coming soon!). --- src/org/fdroid/fdroid/data/DBHelper.java | 25 ++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/org/fdroid/fdroid/data/DBHelper.java b/src/org/fdroid/fdroid/data/DBHelper.java index f0e8ab00d..6e2227dde 100644 --- a/src/org/fdroid/fdroid/data/DBHelper.java +++ b/src/org/fdroid/fdroid/data/DBHelper.java @@ -292,6 +292,17 @@ public class DBHelper extends SQLiteOpenHelper { } } + private void insertNameAndDescription(SQLiteDatabase db, + int addressResId, int nameResId, int descriptionResId) { + ContentValues values = new ContentValues(); + values.clear(); + values.put("name", context.getString(nameResId)); + values.put("description", context.getString(descriptionResId)); + db.update(TABLE_REPO, values, "address = ?", new String[] { + context.getString(addressResId) + }); + } + /** * Add a name and description to the repo table, and updates the two * default repos with values from strings.xml. @@ -304,16 +315,10 @@ public class DBHelper extends SQLiteOpenHelper { db.execSQL("alter table " + TABLE_REPO + " add column name text"); if (!descriptionExists) db.execSQL("alter table " + TABLE_REPO + " add column description text"); - ContentValues values = new ContentValues(); - values.put("name", context.getString(R.string.default_repo_name1)); - values.put("description", context.getString(R.string.default_repo_description1)); - db.update(TABLE_REPO, values, "address = ?", new String[]{ - context.getString(R.string.default_repo_address1)}); - values.clear(); - values.put("name", context.getString(R.string.default_repo_name2)); - values.put("description", context.getString(R.string.default_repo_description2)); - db.update(TABLE_REPO, values, "address = ?", new String[] { - context.getString(R.string.default_repo_address2) }); + insertNameAndDescription(db, R.string.default_repo_address1, + R.string.default_repo_name1, R.string.default_repo_description1); + insertNameAndDescription(db, R.string.default_repo_address2, + R.string.default_repo_name2, R.string.default_repo_description2); } } From 14824daa215a182c359db5f3ff132c8b2b033d7c Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 29 Jul 2014 16:12:25 -0400 Subject: [PATCH 3/7] include Guardian Project official repo, disabled by default This pre-configures the official Guardian Project repo to make it very easy for people to use that repo without having to verify keys. fixes #63 https://gitlab.com/fdroid/fdroidclient/issues/63 fixes #2604 https://dev.guardianproject.info/issues/2604 --- res/values/default_repo.xml | 23 +++++++++++++++++++++- src/org/fdroid/fdroid/data/DBHelper.java | 25 ++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/res/values/default_repo.xml b/res/values/default_repo.xml index 638c93903..a7f32dbaf 100644 --- a/res/values/default_repo.xml +++ b/res/values/default_repo.xml @@ -15,4 +15,25 @@ https://f-droid.org/archive The archive repository of the F-Droid client. This contains older versions of applications from the main repository. 3082035e30820246a00302010202044c49cd00300d06092a864886f70d01010505003071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b73301e170d3130303732333137313032345a170d3337313230383137313032345a3071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b7330820122300d06092a864886f70d01010105000382010f003082010a028201010096d075e47c014e7822c89fd67f795d23203e2a8843f53ba4e6b1bf5f2fd0e225938267cfcae7fbf4fe596346afbaf4070fdb91f66fbcdf2348a3d92430502824f80517b156fab00809bdc8e631bfa9afd42d9045ab5fd6d28d9e140afc1300917b19b7c6c4df4a494cf1f7cb4a63c80d734265d735af9e4f09455f427aa65a53563f87b336ca2c19d244fcbba617ba0b19e56ed34afe0b253ab91e2fdb1271f1b9e3c3232027ed8862a112f0706e234cf236914b939bcf959821ecb2a6c18057e070de3428046d94b175e1d89bd795e535499a091f5bc65a79d539a8d43891ec504058acb28c08393b5718b57600a211e803f4a634e5c57f25b9b8c4422c6fd90203010001300d06092a864886f70d0101050500038201010008e4ef699e9807677ff56753da73efb2390d5ae2c17e4db691d5df7a7b60fc071ae509c5414be7d5da74df2811e83d3668c4a0b1abc84b9fa7d96b4cdf30bba68517ad2a93e233b042972ac0553a4801c9ebe07bf57ebe9a3b3d6d663965260e50f3b8f46db0531761e60340a2bddc3426098397fda54044a17e5244549f9869b460ca5e6e216b6f6a2db0580b480ca2afe6ec6b46eedacfa4aa45038809ece0c5978653d6c85f678e7f5a2156d1bedd8117751e64a4b0dcd140f3040b021821a8d93aed8d01ba36db6c82372211fed714d9a32607038cdfd565bd529ffc637212aaa2c224ef22b603eccefb5bf1e085c191d4b24fe742b17ab3f55d4e6f05ef - + + + Guardian Project + + 0 + 10 + + https://guardianproject.info/fdroid/repo + The official app repository of The Guardian Project. Applications in this repository are official binaries build by the original application developers and signed by the same key as the APKs that are released in the Google Play store. + 308205d8308203c0020900a397b4da7ecda034300d06092a864886f70d01010505003081ad310b30090603550406130255533111300f06035504080c084e657720596f726b3111300f06035504070c084e657720596f726b31143012060355040b0c0b4644726f6964205265706f31193017060355040a0c10477561726469616e2050726f6a656374311d301b06035504030c14677561726469616e70726f6a6563742e696e666f3128302606092a864886f70d0109011619726f6f7440677561726469616e70726f6a6563742e696e666f301e170d3134303632363139333931385a170d3431313131303139333931385a3081ad310b30090603550406130255533111300f06035504080c084e657720596f726b3111300f06035504070c084e657720596f726b31143012060355040b0c0b4644726f6964205265706f31193017060355040a0c10477561726469616e2050726f6a656374311d301b06035504030c14677561726469616e70726f6a6563742e696e666f3128302606092a864886f70d0109011619726f6f7440677561726469616e70726f6a6563742e696e666f30820222300d06092a864886f70d01010105000382020f003082020a0282020100b3cd79121b9b883843be3c4482e320809106b0a23755f1dd3c7f46f7d315d7bb2e943486d61fc7c811b9294dcc6b5baac4340f8db2b0d5e14749e7f35e1fc211fdbc1071b38b4753db201c314811bef885bd8921ad86facd6cc3b8f74d30a0b6e2e6e576f906e9581ef23d9c03e926e06d1f033f28bd1e21cfa6a0e3ff5c9d8246cf108d82b488b9fdd55d7de7ebb6a7f64b19e0d6b2ab1380a6f9d42361770d1956701a7f80e2de568acd0bb4527324b1e0973e89595d91c8cc102d9248525ae092e2c9b69f7414f724195b81427f28b1d3d09a51acfe354387915fd9521e8c890c125fc41a12bf34d2a1b304067ab7251e0e9ef41833ce109e76963b0b256395b16b886bca21b831f1408f836146019e7908829e716e72b81006610a2af08301de5d067c9e114a1e5759db8a6be6a3cc2806bcfe6fafd41b5bc9ddddb3dc33d6f605b1ca7d8a9e0ecdd6390d38906649e68a90a717bea80fa220170eea0c86fc78a7e10dac7b74b8e62045a3ecca54e035281fdc9fe5920a855fde3c0be522e3aef0c087524f13d973dff3768158b01a5800a060c06b451ec98d627dd052eda804d0556f60dbc490d94e6e9dea62ffcafb5beffbd9fc38fb2f0d7050004fe56b4dda0a27bc47554e1e0a7d764e17622e71f83a475db286bc7862deee1327e2028955d978272ea76bf0b88e70a18621aba59ff0c5993ef5f0e5d6b6b98e68b70203010001300d06092a864886f70d0101050500038202010079c79c8ef408a20d243d8bd8249fb9a48350dc19663b5e0fce67a8dbcb7de296c5ae7bbf72e98a2020fb78f2db29b54b0e24b181aa1c1d333cc0303685d6120b03216a913f96b96eb838f9bff125306ae3120af838c9fc07ebb5100125436bd24ec6d994d0bff5d065221871f8410daf536766757239bf594e61c5432c9817281b985263bada8381292e543a49814061ae11c92a316e7dc100327b59e3da90302c5ada68c6a50201bda1fcce800b53f381059665dbabeeb0b50eb22b2d7d2d9b0aa7488ca70e67ac6c518adb8e78454a466501e89d81a45bf1ebc350896f2c3ae4b6679ecfbf9d32960d4f5b493125c7876ef36158562371193f600bc511000a67bdb7c664d018f99d9e589868d103d7e0994f166b2ba18ff7e67d8c4da749e44dfae1d930ae5397083a51675c409049dfb626a96246c0015ca696e94ebb767a20147834bf78b07fece3f0872b057c1c519ff882501995237d8206b0b3832f78753ebd8dcbd1d3d9f5ba733538113af6b407d960ec4353c50eb38ab29888238da843cd404ed8f4952f59e4bbc0035fc77a54846a9d419179c46af1b4a3b7fc98e4d312aaa29b9b7d79e739703dc0fa41c7280d5587709277ffa11c3620f5fba985b82c238ba19b17ebd027af9424be0941719919f620dd3bb3c3f11638363708aa11f858e153cf3a69bce69978b90e4a273836100aa1e617ba455cd00426847f + + + Guardian Project Archive + + 0 + 20 + + https://guardianproject.info/fdroid/archive + The official repository of The Guardian Project apps for use with FDroid client. This contains older versions of applications from the main repository. + 308205d8308203c0020900a397b4da7ecda034300d06092a864886f70d01010505003081ad310b30090603550406130255533111300f06035504080c084e657720596f726b3111300f06035504070c084e657720596f726b31143012060355040b0c0b4644726f6964205265706f31193017060355040a0c10477561726469616e2050726f6a656374311d301b06035504030c14677561726469616e70726f6a6563742e696e666f3128302606092a864886f70d0109011619726f6f7440677561726469616e70726f6a6563742e696e666f301e170d3134303632363139333931385a170d3431313131303139333931385a3081ad310b30090603550406130255533111300f06035504080c084e657720596f726b3111300f06035504070c084e657720596f726b31143012060355040b0c0b4644726f6964205265706f31193017060355040a0c10477561726469616e2050726f6a656374311d301b06035504030c14677561726469616e70726f6a6563742e696e666f3128302606092a864886f70d0109011619726f6f7440677561726469616e70726f6a6563742e696e666f30820222300d06092a864886f70d01010105000382020f003082020a0282020100b3cd79121b9b883843be3c4482e320809106b0a23755f1dd3c7f46f7d315d7bb2e943486d61fc7c811b9294dcc6b5baac4340f8db2b0d5e14749e7f35e1fc211fdbc1071b38b4753db201c314811bef885bd8921ad86facd6cc3b8f74d30a0b6e2e6e576f906e9581ef23d9c03e926e06d1f033f28bd1e21cfa6a0e3ff5c9d8246cf108d82b488b9fdd55d7de7ebb6a7f64b19e0d6b2ab1380a6f9d42361770d1956701a7f80e2de568acd0bb4527324b1e0973e89595d91c8cc102d9248525ae092e2c9b69f7414f724195b81427f28b1d3d09a51acfe354387915fd9521e8c890c125fc41a12bf34d2a1b304067ab7251e0e9ef41833ce109e76963b0b256395b16b886bca21b831f1408f836146019e7908829e716e72b81006610a2af08301de5d067c9e114a1e5759db8a6be6a3cc2806bcfe6fafd41b5bc9ddddb3dc33d6f605b1ca7d8a9e0ecdd6390d38906649e68a90a717bea80fa220170eea0c86fc78a7e10dac7b74b8e62045a3ecca54e035281fdc9fe5920a855fde3c0be522e3aef0c087524f13d973dff3768158b01a5800a060c06b451ec98d627dd052eda804d0556f60dbc490d94e6e9dea62ffcafb5beffbd9fc38fb2f0d7050004fe56b4dda0a27bc47554e1e0a7d764e17622e71f83a475db286bc7862deee1327e2028955d978272ea76bf0b88e70a18621aba59ff0c5993ef5f0e5d6b6b98e68b70203010001300d06092a864886f70d0101050500038202010079c79c8ef408a20d243d8bd8249fb9a48350dc19663b5e0fce67a8dbcb7de296c5ae7bbf72e98a2020fb78f2db29b54b0e24b181aa1c1d333cc0303685d6120b03216a913f96b96eb838f9bff125306ae3120af838c9fc07ebb5100125436bd24ec6d994d0bff5d065221871f8410daf536766757239bf594e61c5432c9817281b985263bada8381292e543a49814061ae11c92a316e7dc100327b59e3da90302c5ada68c6a50201bda1fcce800b53f381059665dbabeeb0b50eb22b2d7d2d9b0aa7488ca70e67ac6c518adb8e78454a466501e89d81a45bf1ebc350896f2c3ae4b6679ecfbf9d32960d4f5b493125c7876ef36158562371193f600bc511000a67bdb7c664d018f99d9e589868d103d7e0994f166b2ba18ff7e67d8c4da749e44dfae1d930ae5397083a51675c409049dfb626a96246c0015ca696e94ebb767a20147834bf78b07fece3f0872b057c1c519ff882501995237d8206b0b3832f78753ebd8dcbd1d3d9f5ba733538113af6b407d960ec4353c50eb38ab29888238da843cd404ed8f4952f59e4bbc0035fc77a54846a9d419179c46af1b4a3b7fc98e4d312aaa29b9b7d79e739703dc0fa41c7280d5587709277ffa11c3620f5fba985b82c238ba19b17ebd027af9424be0941719919f620dd3bb3c3f11638363708aa11f858e153cf3a69bce69978b90e4a273836100aa1e617ba455cd00426847f + + \ No newline at end of file diff --git a/src/org/fdroid/fdroid/data/DBHelper.java b/src/org/fdroid/fdroid/data/DBHelper.java index 6e2227dde..8cb679aec 100644 --- a/src/org/fdroid/fdroid/data/DBHelper.java +++ b/src/org/fdroid/fdroid/data/DBHelper.java @@ -6,6 +6,7 @@ import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.util.Log; + import org.fdroid.fdroid.R; import org.fdroid.fdroid.Utils; @@ -209,6 +210,26 @@ public class DBHelper extends SQLiteOpenHelper { context.getResources().getInteger(R.integer.default_repo_inuse2), context.getResources().getInteger(R.integer.default_repo_priority2) ); + + insertRepo( + db, + context.getString(R.string.guardianproject_repo_name), + context.getString(R.string.guardianproject_repo_address), + context.getString(R.string.guardianproject_repo_description), + context.getString(R.string.guardianproject_repo_pubkey), + context.getResources().getInteger(R.integer.guardianproject_repo_inuse), + context.getResources().getInteger(R.integer.guardianproject_repo_priority) + ); + + insertRepo( + db, + context.getString(R.string.guardianproject_archive_name), + context.getString(R.string.guardianproject_archive_address), + context.getString(R.string.guardianproject_archive_description), + context.getString(R.string.guardianproject_archive_pubkey), + context.getResources().getInteger(R.integer.guardianproject_archive_inuse), + context.getResources().getInteger(R.integer.guardianproject_archive_priority) + ); } private void insertRepo( @@ -319,6 +340,10 @@ public class DBHelper extends SQLiteOpenHelper { R.string.default_repo_name1, R.string.default_repo_description1); insertNameAndDescription(db, R.string.default_repo_address2, R.string.default_repo_name2, R.string.default_repo_description2); + insertNameAndDescription(db, R.string.guardianproject_repo_address, + R.string.guardianproject_repo_name, R.string.guardianproject_repo_description); + insertNameAndDescription(db, R.string.guardianproject_archive_address, + R.string.guardianproject_archive_name, R.string.guardianproject_archive_description); } } From be3f7900e8ea7bcde4b590576e81327e3f557d47 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 29 Jul 2014 16:16:20 -0400 Subject: [PATCH 4/7] rename default repo variables for clarity default_repo_count is not used at all, and the numbering scheme is just a vestige of that. This switches all the variables to have clear names of what they are representing. --- res/values/default_repo.xml | 31 +++++++++++++---------- src/org/fdroid/fdroid/data/DBHelper.java | 32 ++++++++++++------------ test/src/mock/MockFDroidResources.java | 8 +++--- 3 files changed, 38 insertions(+), 33 deletions(-) diff --git a/res/values/default_repo.xml b/res/values/default_repo.xml index a7f32dbaf..83656c933 100644 --- a/res/values/default_repo.xml +++ b/res/values/default_repo.xml @@ -1,20 +1,25 @@ - 2 - F-Droid - 1 - 10 - https://f-droid.org/repo - The official FDroid repository. Applications in this repository are mostly built directory from the source code. Some are official binaries built by the original application developers - these will be replaced by source-built versions over time. - 3082035e30820246a00302010202044c49cd00300d06092a864886f70d01010505003071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b73301e170d3130303732333137313032345a170d3337313230383137313032345a3071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b7330820122300d06092a864886f70d01010105000382010f003082010a028201010096d075e47c014e7822c89fd67f795d23203e2a8843f53ba4e6b1bf5f2fd0e225938267cfcae7fbf4fe596346afbaf4070fdb91f66fbcdf2348a3d92430502824f80517b156fab00809bdc8e631bfa9afd42d9045ab5fd6d28d9e140afc1300917b19b7c6c4df4a494cf1f7cb4a63c80d734265d735af9e4f09455f427aa65a53563f87b336ca2c19d244fcbba617ba0b19e56ed34afe0b253ab91e2fdb1271f1b9e3c3232027ed8862a112f0706e234cf236914b939bcf959821ecb2a6c18057e070de3428046d94b175e1d89bd795e535499a091f5bc65a79d539a8d43891ec504058acb28c08393b5718b57600a211e803f4a634e5c57f25b9b8c4422c6fd90203010001300d06092a864886f70d0101050500038201010008e4ef699e9807677ff56753da73efb2390d5ae2c17e4db691d5df7a7b60fc071ae509c5414be7d5da74df2811e83d3668c4a0b1abc84b9fa7d96b4cdf30bba68517ad2a93e233b042972ac0553a4801c9ebe07bf57ebe9a3b3d6d663965260e50f3b8f46db0531761e60340a2bddc3426098397fda54044a17e5244549f9869b460ca5e6e216b6f6a2db0580b480ca2afe6ec6b46eedacfa4aa45038809ece0c5978653d6c85f678e7f5a2156d1bedd8117751e64a4b0dcd140f3040b021821a8d93aed8d01ba36db6c82372211fed714d9a32607038cdfd565bd529ffc637212aaa2c224ef22b603eccefb5bf1e085c191d4b24fe742b17ab3f55d4e6f05ef + + F-Droid - F-Droid Archive - 0 - 20 - https://f-droid.org/archive - The archive repository of the F-Droid client. This contains older versions of applications from the main repository. - 3082035e30820246a00302010202044c49cd00300d06092a864886f70d01010505003071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b73301e170d3130303732333137313032345a170d3337313230383137313032345a3071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b7330820122300d06092a864886f70d01010105000382010f003082010a028201010096d075e47c014e7822c89fd67f795d23203e2a8843f53ba4e6b1bf5f2fd0e225938267cfcae7fbf4fe596346afbaf4070fdb91f66fbcdf2348a3d92430502824f80517b156fab00809bdc8e631bfa9afd42d9045ab5fd6d28d9e140afc1300917b19b7c6c4df4a494cf1f7cb4a63c80d734265d735af9e4f09455f427aa65a53563f87b336ca2c19d244fcbba617ba0b19e56ed34afe0b253ab91e2fdb1271f1b9e3c3232027ed8862a112f0706e234cf236914b939bcf959821ecb2a6c18057e070de3428046d94b175e1d89bd795e535499a091f5bc65a79d539a8d43891ec504058acb28c08393b5718b57600a211e803f4a634e5c57f25b9b8c4422c6fd90203010001300d06092a864886f70d0101050500038201010008e4ef699e9807677ff56753da73efb2390d5ae2c17e4db691d5df7a7b60fc071ae509c5414be7d5da74df2811e83d3668c4a0b1abc84b9fa7d96b4cdf30bba68517ad2a93e233b042972ac0553a4801c9ebe07bf57ebe9a3b3d6d663965260e50f3b8f46db0531761e60340a2bddc3426098397fda54044a17e5244549f9869b460ca5e6e216b6f6a2db0580b480ca2afe6ec6b46eedacfa4aa45038809ece0c5978653d6c85f678e7f5a2156d1bedd8117751e64a4b0dcd140f3040b021821a8d93aed8d01ba36db6c82372211fed714d9a32607038cdfd565bd529ffc637212aaa2c224ef22b603eccefb5bf1e085c191d4b24fe742b17ab3f55d4e6f05ef + 1 + 10 + + https://f-droid.org/repo + The official FDroid repository. Applications in this repository are mostly built directory from the source code. Some are official binaries built by the original application developers - these will be replaced by source-built versions over time. + 3082035e30820246a00302010202044c49cd00300d06092a864886f70d01010505003071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b73301e170d3130303732333137313032345a170d3337313230383137313032345a3071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b7330820122300d06092a864886f70d01010105000382010f003082010a028201010096d075e47c014e7822c89fd67f795d23203e2a8843f53ba4e6b1bf5f2fd0e225938267cfcae7fbf4fe596346afbaf4070fdb91f66fbcdf2348a3d92430502824f80517b156fab00809bdc8e631bfa9afd42d9045ab5fd6d28d9e140afc1300917b19b7c6c4df4a494cf1f7cb4a63c80d734265d735af9e4f09455f427aa65a53563f87b336ca2c19d244fcbba617ba0b19e56ed34afe0b253ab91e2fdb1271f1b9e3c3232027ed8862a112f0706e234cf236914b939bcf959821ecb2a6c18057e070de3428046d94b175e1d89bd795e535499a091f5bc65a79d539a8d43891ec504058acb28c08393b5718b57600a211e803f4a634e5c57f25b9b8c4422c6fd90203010001300d06092a864886f70d0101050500038201010008e4ef699e9807677ff56753da73efb2390d5ae2c17e4db691d5df7a7b60fc071ae509c5414be7d5da74df2811e83d3668c4a0b1abc84b9fa7d96b4cdf30bba68517ad2a93e233b042972ac0553a4801c9ebe07bf57ebe9a3b3d6d663965260e50f3b8f46db0531761e60340a2bddc3426098397fda54044a17e5244549f9869b460ca5e6e216b6f6a2db0580b480ca2afe6ec6b46eedacfa4aa45038809ece0c5978653d6c85f678e7f5a2156d1bedd8117751e64a4b0dcd140f3040b021821a8d93aed8d01ba36db6c82372211fed714d9a32607038cdfd565bd529ffc637212aaa2c224ef22b603eccefb5bf1e085c191d4b24fe742b17ab3f55d4e6f05ef + + + F-Droid Archive + + 0 + 20 + + https://f-droid.org/archive + The archive repository of the F-Droid client. This contains older versions of applications from the main repository. + 3082035e30820246a00302010202044c49cd00300d06092a864886f70d01010505003071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b73301e170d3130303732333137313032345a170d3337313230383137313032345a3071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b7330820122300d06092a864886f70d01010105000382010f003082010a028201010096d075e47c014e7822c89fd67f795d23203e2a8843f53ba4e6b1bf5f2fd0e225938267cfcae7fbf4fe596346afbaf4070fdb91f66fbcdf2348a3d92430502824f80517b156fab00809bdc8e631bfa9afd42d9045ab5fd6d28d9e140afc1300917b19b7c6c4df4a494cf1f7cb4a63c80d734265d735af9e4f09455f427aa65a53563f87b336ca2c19d244fcbba617ba0b19e56ed34afe0b253ab91e2fdb1271f1b9e3c3232027ed8862a112f0706e234cf236914b939bcf959821ecb2a6c18057e070de3428046d94b175e1d89bd795e535499a091f5bc65a79d539a8d43891ec504058acb28c08393b5718b57600a211e803f4a634e5c57f25b9b8c4422c6fd90203010001300d06092a864886f70d0101050500038201010008e4ef699e9807677ff56753da73efb2390d5ae2c17e4db691d5df7a7b60fc071ae509c5414be7d5da74df2811e83d3668c4a0b1abc84b9fa7d96b4cdf30bba68517ad2a93e233b042972ac0553a4801c9ebe07bf57ebe9a3b3d6d663965260e50f3b8f46db0531761e60340a2bddc3426098397fda54044a17e5244549f9869b460ca5e6e216b6f6a2db0580b480ca2afe6ec6b46eedacfa4aa45038809ece0c5978653d6c85f678e7f5a2156d1bedd8117751e64a4b0dcd140f3040b021821a8d93aed8d01ba36db6c82372211fed714d9a32607038cdfd565bd529ffc637212aaa2c224ef22b603eccefb5bf1e085c191d4b24fe742b17ab3f55d4e6f05ef Guardian Project diff --git a/src/org/fdroid/fdroid/data/DBHelper.java b/src/org/fdroid/fdroid/data/DBHelper.java index 8cb679aec..a162f736d 100644 --- a/src/org/fdroid/fdroid/data/DBHelper.java +++ b/src/org/fdroid/fdroid/data/DBHelper.java @@ -193,22 +193,22 @@ public class DBHelper extends SQLiteOpenHelper { insertRepo( db, - context.getString(R.string.default_repo_name1), - context.getString(R.string.default_repo_address1), - context.getString(R.string.default_repo_description1), - context.getString(R.string.default_repo_pubkey1), - context.getResources().getInteger(R.integer.default_repo_inuse1), - context.getResources().getInteger(R.integer.default_repo_priority1) + context.getString(R.string.fdroid_repo_name), + context.getString(R.string.fdroid_repo_address), + context.getString(R.string.fdroid_repo_description), + context.getString(R.string.fdroid_repo_pubkey), + context.getResources().getInteger(R.integer.fdroid_repo_inuse), + context.getResources().getInteger(R.integer.fdroid_repo_priority) ); insertRepo( db, - context.getString(R.string.default_repo_name2), - context.getString(R.string.default_repo_address2), - context.getString(R.string.default_repo_description2), - context.getString(R.string.default_repo_pubkey2), - context.getResources().getInteger(R.integer.default_repo_inuse2), - context.getResources().getInteger(R.integer.default_repo_priority2) + context.getString(R.string.fdroid_archive_name), + context.getString(R.string.fdroid_archive_address), + context.getString(R.string.fdroid_archive_description), + context.getString(R.string.fdroid_archive_pubkey), + context.getResources().getInteger(R.integer.fdroid_archive_inuse), + context.getResources().getInteger(R.integer.fdroid_archive_priority) ); insertRepo( @@ -336,10 +336,10 @@ public class DBHelper extends SQLiteOpenHelper { db.execSQL("alter table " + TABLE_REPO + " add column name text"); if (!descriptionExists) db.execSQL("alter table " + TABLE_REPO + " add column description text"); - insertNameAndDescription(db, R.string.default_repo_address1, - R.string.default_repo_name1, R.string.default_repo_description1); - insertNameAndDescription(db, R.string.default_repo_address2, - R.string.default_repo_name2, R.string.default_repo_description2); + insertNameAndDescription(db, R.string.fdroid_repo_address, + R.string.fdroid_repo_name, R.string.fdroid_repo_description); + insertNameAndDescription(db, R.string.fdroid_archive_address, + R.string.fdroid_archive_name, R.string.fdroid_archive_description); insertNameAndDescription(db, R.string.guardianproject_repo_address, R.string.guardianproject_repo_name, R.string.guardianproject_repo_description); insertNameAndDescription(db, R.string.guardianproject_archive_address, diff --git a/test/src/mock/MockFDroidResources.java b/test/src/mock/MockFDroidResources.java index c2b716d2f..96b6a01d9 100644 --- a/test/src/mock/MockFDroidResources.java +++ b/test/src/mock/MockFDroidResources.java @@ -20,13 +20,13 @@ public class MockFDroidResources extends MockResources { @Override public int getInteger(int id) { - if (id == R.integer.default_repo_inuse1) { + if (id == R.integer.fdroid_repo_inuse) { return 1; - } else if (id == R.integer.default_repo_inuse2) { + } else if (id == R.integer.fdroid_archive_inuse) { return 0; - } else if (id == R.integer.default_repo_priority1) { + } else if (id == R.integer.fdroid_repo_priority) { return 10; - } else if (id == R.integer.default_repo_priority2) { + } else if (id == R.integer.fdroid_archive_priority) { return 20; } else { return 0; From bc5cf590c78cdad3008b8c4db91e6edd831d0f4e Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 29 Jul 2014 17:49:02 -0400 Subject: [PATCH 5/7] fix Compact Layout post appcompat This restores the Compact Layout being smaller than the normal layout, and properly centers the icon in both. This stuff could use some refactoring to work better with all the appcompat styles. fixes #61 https://gitlab.com/fdroid/fdroidclient/issues/61 --- res/layout/applistitem.xml | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/res/layout/applistitem.xml b/res/layout/applistitem.xml index d37feaa7d..8297c1d82 100644 --- a/res/layout/applistitem.xml +++ b/res/layout/applistitem.xml @@ -1,10 +1,10 @@ + android:padding="10dp" + android:baselineAligned="false" > @@ -13,20 +13,17 @@ android:contentDescription="@string/app_icon" android:layout_width="48dip" android:layout_height="48dip" - android:layout_marginLeft="?attr/listPreferredItemPaddingLeft" - android:layout_marginStart="?android:attr/listPreferredItemPaddingStart" - android:layout_marginTop="6dip" - android:scaleType="fitCenter" - /> + android:layout_gravity="center_vertical" + android:scaleType="fitCenter" /> @@ -35,8 +32,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:baselineAligned="false" - android:layout_marginBottom="3dp" - > + android:layout_marginBottom="3dp" > + android:textAlignment="viewStart" /> Date: Tue, 29 Jul 2014 23:19:54 -0400 Subject: [PATCH 6/7] LocalRepoManager: fix null check when copying APKs findbugs found this problem and reported it like this: Nullcheck of org.fdroid.fdroid.data.App.installedApk at line 191 of value previously dereferenced in org.fdroid.fdroid.localrepo.LocalRepoManager.copyApksToRepo(List) A value is checked here to see whether it is null, but this value can't be null because it was previously dereferenced and if it were null a null pointer exception would have occurred at the earlier dereference. Essentially, this code and the previous dereference disagree as to whether this value is allowed to be null. Either the check is redundant or the previous dereference is erroneous. --- .../fdroid/localrepo/LocalRepoManager.java | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/src/org/fdroid/fdroid/localrepo/LocalRepoManager.java b/src/org/fdroid/fdroid/localrepo/LocalRepoManager.java index 5060b388b..f0ff3fe42 100644 --- a/src/org/fdroid/fdroid/localrepo/LocalRepoManager.java +++ b/src/org/fdroid/fdroid/localrepo/LocalRepoManager.java @@ -4,12 +4,15 @@ package org.fdroid.fdroid.localrepo; import android.annotation.TargetApi; import android.content.Context; import android.content.SharedPreferences; -import android.content.pm.*; +import android.content.pm.ApplicationInfo; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.AssetManager; -import android.graphics.*; +import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.graphics.Bitmap.Config; +import android.graphics.Canvas; import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.Drawable; import android.preference.PreferenceManager; @@ -17,15 +20,32 @@ import android.text.TextUtils; import android.util.Log; import android.widget.Toast; -import org.fdroid.fdroid.*; +import org.fdroid.fdroid.Hasher; +import org.fdroid.fdroid.Preferences; +import org.fdroid.fdroid.R; +import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.data.App; import org.w3c.dom.Document; import org.w3c.dom.Element; -import java.io.*; +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; import java.security.cert.CertificateEncodingException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; import java.util.Map.Entry; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; @@ -187,11 +207,13 @@ public class LocalRepoManager { for (String packageName : appsToCopy) { App app = apps.get(packageName); - File outFile = new File(repoDir, app.installedApk.apkName); - if (app.installedApk == null - || !Utils.symlinkOrCopyFile(app.installedApk.installedFile, outFile)) { - throw new IllegalStateException("Unable to copy APK"); + if (app.installedApk != null) { + File outFile = new File(repoDir, app.installedApk.apkName); + if (Utils.symlinkOrCopyFile(app.installedApk.installedFile, outFile)) + continue; } + // if we got here, something went wrong + throw new IllegalStateException("Unable to copy APK"); } } @@ -246,7 +268,7 @@ public class LocalRepoManager { /** * Extracts the icon from an APK and writes it to the repo as a PNG - * + * * @return path to the PNG file */ public void copyIconToRepo(Drawable drawable, String packageName, int versionCode) { From 4f7f87be0a0487aad19c78a2a44faa1c2f008361 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 29 Jul 2014 23:27:32 -0400 Subject: [PATCH 7/7] assign static var FDroidApp.selectedApps only after HashSet is built This should help is there is ever multithreaded access to this variable. This is an unlikely scenario, but the fix is easy. findbugs reported this issue like this: Incorrect lazy initialization and update of static field org.fdroid.fdroid. FDroidApp.selectedApps in org.fdroid.fdroid.views.fragments. SelectLocalAppsFragment.onActivityCreated(Bundle) This method contains an unsynchronized lazy initialization of a static field. After the field is set, the object stored into that location is further updated or accessed. The setting of the field is visible to other threads as soon as it is set. If the futher accesses in the method that set the field serve to initialize the object, then you have a very serious multithreading bug, unless something else prevents any other thread from accessing the stored object until it is fully initialized. --- .../fdroid/fdroid/views/fragments/SelectLocalAppsFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/fdroid/fdroid/views/fragments/SelectLocalAppsFragment.java b/src/org/fdroid/fdroid/views/fragments/SelectLocalAppsFragment.java index 01d037a55..eb944ec94 100644 --- a/src/org/fdroid/fdroid/views/fragments/SelectLocalAppsFragment.java +++ b/src/org/fdroid/fdroid/views/fragments/SelectLocalAppsFragment.java @@ -112,13 +112,14 @@ public class SelectLocalAppsFragment extends ListFragment // build list of existing apps from what is on the file system if (FDroidApp.selectedApps == null) { - FDroidApp.selectedApps = new HashSet(); + HashSet selectedApps = new HashSet(); for (String filename : LocalRepoManager.get(selectLocalAppsActivity).repoDir.list()) { if (filename.matches(".*\\.apk")) { String packageName = filename.substring(0, filename.indexOf("_")); FDroidApp.selectedApps.add(packageName); } } + FDroidApp.selectedApps = selectedApps; } }