Merge pull request #12820 from nextcloud/bugfix/deep-link

Handle Missing DeepLinks
This commit is contained in:
Andy Scherzinger 2024-08-19 09:17:30 +02:00 committed by GitHub
commit 6d399d9988
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 79 additions and 7 deletions

View File

@ -104,6 +104,7 @@ android {
}
defaultConfig {
applicationId "com.nextcloud.client"
minSdkVersion 24
targetSdkVersion 34
compileSdk 34

View File

@ -148,26 +148,93 @@
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/users_and_groups_searchable" />
<intent-filter android:autoVerify="true">
<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:host="*" />
<data android:pathPattern="/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
<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:host="*" />
<data android:pathPattern="/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
<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:host="*" />
<data android:pathPattern="/..*/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
<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:host="*" />
<data android:pathPattern="/..*/..*/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="*" />
<data android:pathPattern="/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="*" />
<data android:pathPattern="/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="*" />
<data android:pathPattern="/..*/..*/f/..*" />
</intent-filter>
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
<data android:host="*" />
<data android:pathPattern="/..*/..*/..*/f/..*" />
<!-- path pattern to handle deep link -->
<data android:pathPattern="/app/..*" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="@xml/users_and_groups_searchable" />
</activity>
<activity
android:name=".ui.activity.ManageAccountsActivity"

View File

@ -35,6 +35,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Looper;
import android.os.Parcelable;
import android.provider.Settings;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuInflater;
@ -521,7 +522,8 @@ public class FileDisplayActivity extends FileActivity
} else if (RESTART.equals(intent.getAction())) {
finish();
startActivity(intent);
} else // Verify the action and get the query
} else {
// Verify the action and get the query
if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
setIntent(intent);
@ -563,7 +565,10 @@ public class FileDisplayActivity extends FileActivity
setLeftFragment(new GroupfolderListFragment());
getSupportFragmentManager().executePendingTransactions();
} else {
handleOpenFileViaIntent(intent);
}
}
}
private void onOpenFileIntent(Intent intent) {
@ -2345,7 +2350,6 @@ public class FileDisplayActivity extends FileActivity
@Override
protected void onRestart() {
super.onRestart();
checkForNewDevVersionNecessary(getApplicationContext());
}