We need compileSdk 28 and the required AGP and gradle versions, as well
as updating to compatible support library revisions.
minSdk and targetSdk needs to move to build.gradle from manifest.
buildToolsVersion isn't used anymore.
The autoVerify function seems to require that the app only declare domain
names in the IntentFilters that are set up with the "site association"
files. For F-Droid to support the verified app link, it would have to stop
matching play.google.com, amazon.com, etc. This autoVerify function also
triggers DNS lookups at the system level, which might not be forwarded over
Tor, in certain scenarios. So this just disables the whole feature.
https://developer.android.com/training/app-links/verify-site-associations
Liberapay was originally included using a numeric ID, since they had not yet
finalized the public URLs. Now it is a username. So this logic prefers
the username in Liberapay: field, and uses the old LiberapayID: as a
fallback. LiberapayID: will not override Liberapay: if it is already set.
This reuses the old database key since it is stored and processed as a
String anyway.
This was already done for list views because of the panic uninstall list
but we can easily apply the same logic to the tile view and app detail
view as well.
Otherwise when both are enabled the metadata from the archive gets
priority over repo which is not really what we want.
It also breaks a lot of icons, featuregraphics and screenshots.
Fixesfdroid/fdroidclient#1771Fixesfdroid/fdroidclient#1772Fixesfdroid/fdroidclient#1686
We also update the default repo priorities for existing installs if we
find the default repos in the original order.
The query is pretty annoying to write in java, here is the raw sql form.
UPDATE fdroid_repo
SET priority = ( SELECT SUM(priority)
FROM fdroid_repo
WHERE address IN ('https://f-droid.org/repo', 'https://f-droid.org/archive')
) - priority
WHERE address IN ('https://f-droid.org/repo', 'https://f-droid.org/archive') AND
'TRUE' IN (
SELECT
CASE
WHEN a.priority = b.priority-1 THEN 'TRUE'
ELSE 'FALSE'
END
FROM fdroid_repo as a
INNER JOIN fdroid_repo as b ON
a.address = "https://f-droid.org/repo" and b.address = "https://f-droid.org/archive"
)
This was blocking updates being scheduled when either data or wifi
updates were disabled. We only want to completely disable the update
service when both are disbaled though.
Ref: #1623
Fixes the following crash:
05-19 22:39:55.535 1037 24513 W WindowManager: Attempted to add application window with unknown token Token{2f841 null}. Aborting.
05-19 22:39:55.536 10844 10844 D AndroidRuntime: Shutting down VM
05-19 22:39:55.540 10844 10844 E AndroidRuntime: FATAL EXCEPTION: main
05-19 22:39:55.540 10844 10844 E AndroidRuntime: Process: org.fdroid.fdroid.debug, PID: 10844
05-19 22:39:55.540 10844 10844 E AndroidRuntime: android.view.WindowManager$BadTokenException: Unable to add window -- token android.os.BinderProxy@d8ae31 is not valid; is your activity running?
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.view.ViewRootImpl.setView(ViewRootImpl.java:891)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:372)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:128)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.app.Dialog.show(Dialog.java:454)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at org.fdroid.fdroid.views.AppDetailsActivity$7.onReceive(AppDetailsActivity.java:607)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.support.v4.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:311)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.support.v4.content.LocalBroadcastManager.access$000(LocalBroadcastManager.java:47)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.support.v4.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:120)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:108)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.os.Looper.loop(Looper.java:166)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7529)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
05-19 22:39:55.540 10844 10844 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
The !isFinishing check was already in the installReceiver part, but
somehow missing in uninstallReceiver. There's also a reference to this
here: http://blackriver.to/2012/08/android-annoying-exception-unable-to-add-window-is-your-activity-running/
I don't understand this crash, especially as the dialouge still gets
shown after adding this check (possibly the parent activity is finishing
and then immediately restarting?). But this sems to realibly fix it.
This was happening when I installed an app, used a new settings entry to
unregister privext as a device owner (by calling it via binder/aidl) and
then trying to uninstall the app I just installed again, whithout
closing f-droid inbetween.
Previously everything from a repo staying inside the db when removing it
without disabling it first, the problem manifests when the repo is
readded later (or a mirror), as it would get a new id but all apk
entries still point to the original repoid.
So we now first disable a repo (which just calls
RepoProvider.Helper.purgeApps) before deleting it from the db.
closesBubu/fdroidclassic#29