mirror of
https://github.com/f-droid/fdroidclient.git
synced 2026-04-22 07:50:19 -04:00
While investigating #1086 which was about swap being busted, I discovered that we recently introduced a worse bug when working with multi sig stuff. The swap process, when installing an app (or even when listening for if a user started installing - before they even did anything), would ask for an apk from any repo. This is wrong, because we should only ask for the apks from the swap repo when presented with a swap dialog. By fixing this so that it asks for a specific apk, this may also fix the issue in #1086, because that was about us not asking for enough info from the database for each Apk which was returned. Now we just return all columns, because the performance overhead should be minimal, but it prevents this class of bugs, where we didn't fully populate our value object. However, I'm not confident that it is fixed, because I was unable to reproduce it due to the other crash fixed in this change. Relevant crash: ``` java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String org.fdroid.fdroid.data.Apk.getUrl()' on a null object reference at org.fdroid.fdroid.views.swap.SwapAppsView$AppListAdapter$ViewHolder.setApp(SwapAppsView.java:311) at org.fdroid.fdroid.views.swap.SwapAppsView$AppListAdapter.bindView(SwapAppsView.java:422) at org.fdroid.fdroid.views.swap.SwapAppsView$AppListAdapter.newView(SwapAppsView.java:414) at android.support.v4.widget.CursorAdapter.getView(CursorAdapter.java:269) at android.widget.AbsListView.obtainView(AbsListView.java:2349) at android.widget.ListView.makeAndAddView(ListView.java:1864) at android.widget.ListView.fillDown(ListView.java:698) ... ```