set up "Android App Links" handling aka "Digital Asset Links"
Add all the new URL path possibilities with the new website to the filter, and the possible, official host names. This makes it more likely that f-droid.org links go straight to F-Droid. * https://developers.google.com/digital-asset-links/v1/getting-started * https://developer.android.com/training/app-links/verify-site-associations.html fdroid-website#165
This commit is contained in:
parent
dcf4a5868b
commit
2b9c9b5655
@ -300,7 +300,7 @@
|
|||||||
<data android:scheme="fdroid.app" />
|
<data android:scheme="fdroid.app" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter android:autoVerify="true">
|
||||||
<action android:name="android.intent.action.VIEW" />
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
@ -310,20 +310,13 @@
|
|||||||
<data android:scheme="https" />
|
<data android:scheme="https" />
|
||||||
<data android:host="f-droid.org" />
|
<data android:host="f-droid.org" />
|
||||||
<data android:host="www.f-droid.org" />
|
<data android:host="www.f-droid.org" />
|
||||||
|
<data android:host="staging.f-droid.org" />
|
||||||
<data android:pathPrefix="/app/" />
|
<data android:pathPrefix="/app/" />
|
||||||
</intent-filter>
|
<data android:pathPrefix="/packages/" />
|
||||||
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="android.intent.action.VIEW" />
|
|
||||||
|
|
||||||
<category android:name="android.intent.category.DEFAULT" />
|
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
|
||||||
|
|
||||||
<data android:scheme="http" />
|
|
||||||
<data android:scheme="https" />
|
|
||||||
<data android:host="f-droid.org" />
|
|
||||||
<data android:host="www.f-droid.org" />
|
|
||||||
<data android:pathPrefix="/repository/browse" />
|
<data android:pathPrefix="/repository/browse" />
|
||||||
|
<!-- support localized URLs -->
|
||||||
|
<data android:pathPattern="/.*/packages/.*" />
|
||||||
|
<data android:pathPattern="/.*/packages/.*/" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
|
@ -16,11 +16,9 @@ import android.support.v7.widget.RecyclerView;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import com.ashokvarma.bottomnavigation.BadgeItem;
|
import com.ashokvarma.bottomnavigation.BadgeItem;
|
||||||
import com.ashokvarma.bottomnavigation.BottomNavigationBar;
|
import com.ashokvarma.bottomnavigation.BottomNavigationBar;
|
||||||
import com.ashokvarma.bottomnavigation.BottomNavigationItem;
|
import com.ashokvarma.bottomnavigation.BottomNavigationItem;
|
||||||
|
|
||||||
import org.fdroid.fdroid.AppDetails2;
|
import org.fdroid.fdroid.AppDetails2;
|
||||||
import org.fdroid.fdroid.AppUpdateStatusManager;
|
import org.fdroid.fdroid.AppUpdateStatusManager;
|
||||||
import org.fdroid.fdroid.AppUpdateStatusManager.AppUpdateStatus;
|
import org.fdroid.fdroid.AppUpdateStatusManager.AppUpdateStatus;
|
||||||
@ -226,18 +224,20 @@ public class MainActivity extends AppCompatActivity implements BottomNavigationB
|
|||||||
}
|
}
|
||||||
switch (host) {
|
switch (host) {
|
||||||
case "f-droid.org":
|
case "f-droid.org":
|
||||||
if (path.startsWith("/repository/browse")) {
|
case "www.f-droid.org":
|
||||||
|
case "staging.f-droid.org":
|
||||||
|
if (path.startsWith("/app/") || path.startsWith("/packages/")
|
||||||
|
|| path.matches("^/[a-z][a-z][a-zA-Z_-]*/packages/.*")) {
|
||||||
|
// http://f-droid.org/app/packageName
|
||||||
|
packageName = data.getLastPathSegment();
|
||||||
|
} else if (path.startsWith("/repository/browse")) {
|
||||||
// http://f-droid.org/repository/browse?fdfilter=search+query
|
// http://f-droid.org/repository/browse?fdfilter=search+query
|
||||||
query = UriCompat.getQueryParameter(data, "fdfilter");
|
query = UriCompat.getQueryParameter(data, "fdfilter");
|
||||||
|
|
||||||
// http://f-droid.org/repository/browse?fdid=packageName
|
// http://f-droid.org/repository/browse?fdid=packageName
|
||||||
packageName = UriCompat.getQueryParameter(data, "fdid");
|
packageName = UriCompat.getQueryParameter(data, "fdid");
|
||||||
} else if (path.startsWith("/app")) {
|
} else if ("/app".equals(data.getPath()) || "/packages".equals(data.getPath())) {
|
||||||
// http://f-droid.org/app/packageName
|
packageName = null;
|
||||||
packageName = data.getLastPathSegment();
|
|
||||||
if ("app".equals(packageName)) {
|
|
||||||
packageName = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "details":
|
case "details":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user