Merge pull request #13695 from nextcloud/removeFido

Remove fido since we do not need it with login flow v2
This commit is contained in:
Alper Öztürk 2024-10-08 10:27:49 +02:00 committed by GitHub
commit dd78d22178
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 2 additions and 72 deletions

View file

@ -313,9 +313,6 @@ dependencies {
implementation 'androidx.annotation:annotation:1.8.2'
implementation 'com.vanniktech:emoji-google:0.21.0'
implementation "com.github.nextcloud-deps.hwsecurity:hwsecurity-fido:$fidoVersion"
implementation "com.github.nextcloud-deps.hwsecurity:hwsecurity-fido2:$fidoVersion"
// document scanner not available on FDroid (generic) due to OpenCV binaries
gplayImplementation project(':appscan')
huaweiImplementation project(':appscan')

View file

@ -27,7 +27,6 @@ import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.RestrictionsManager;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Resources;
@ -64,7 +63,6 @@ import com.nextcloud.receiver.NetworkChangeListener;
import com.nextcloud.receiver.NetworkChangeReceiver;
import com.nextcloud.utils.extensions.ContextExtensionsKt;
import com.nmc.android.ui.LauncherActivity;
import com.owncloud.android.authentication.AuthenticatorActivity;
import com.owncloud.android.authentication.PassCodeManager;
import com.owncloud.android.datamodel.ArbitraryDataProvider;
import com.owncloud.android.datamodel.ArbitraryDataProviderImpl;
@ -121,8 +119,6 @@ import androidx.lifecycle.ProcessLifecycleOwner;
import dagger.android.AndroidInjector;
import dagger.android.DispatchingAndroidInjector;
import dagger.android.HasAndroidInjector;
import de.cotech.hw.SecurityKeyManager;
import de.cotech.hw.SecurityKeyManagerConfig;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import static com.owncloud.android.ui.activity.ContactsPreferenceActivity.PREFERENCE_CONTACTS_AUTOMATIC_BACKUP;
@ -317,8 +313,6 @@ public class MainApp extends Application implements HasAndroidInjector, NetworkC
insertConscrypt();
initSecurityKeyManager();
registerActivityLifecycleCallbacks(new ActivityInjector());
//update the app restart count when app is launched by the user
@ -476,35 +470,6 @@ public class MainApp extends Application implements HasAndroidInjector, NetworkC
});
}
@SuppressWarnings("unchecked")
private void initSecurityKeyManager() {
SecurityKeyManager securityKeyManager = SecurityKeyManager.getInstance();
final SecurityKeyManagerConfig.Builder configBuilder = new SecurityKeyManagerConfig.Builder()
.setEnableDebugLogging(BuildConfig.DEBUG);
try {
// exclude all activities except AuthenticatorActivity
final PackageManager pm = this.getPackageManager();
final PackageInfo info = pm.getPackageInfo(this.getPackageName(), PackageManager.GET_ACTIVITIES);
final ActivityInfo[] activities = info.activities;
for (ActivityInfo activityInfo : activities) {
try {
final Class<? extends Activity> aClass = (Class<? extends Activity>) Class.forName(activityInfo.name);
if (aClass != AuthenticatorActivity.class) {
configBuilder.addExcludedActivityClass(aClass);
}
} catch (ClassNotFoundException | ClassCastException e) {
Log_OC.e(TAG, "Couldn't disable activity for security key listener", e);
}
}
} catch (PackageManager.NameNotFoundException e) {
Log_OC.e(TAG, "Couldn't disable activities for security key listener", e);
}
securityKeyManager.init(this, configBuilder.build());
}
public static void initContactsBackup(UserAccountManager accountManager, BackgroundJobManager backgroundJobManager) {
ArbitraryDataProvider arbitraryDataProvider = new ArbitraryDataProviderImpl(appContext.get());
if (accountManager == null) {

View file

@ -146,10 +146,6 @@ import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LifecycleEventObserver;
import androidx.lifecycle.ProcessLifecycleOwner;
import de.cotech.hw.fido.WebViewFidoBridge;
import de.cotech.hw.fido.ui.FidoDialogOptions;
import de.cotech.hw.fido2.WebViewWebauthnBridge;
import de.cotech.hw.fido2.ui.WebauthnDialogOptions;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import okhttp3.FormBody;
import okhttp3.RequestBody;
@ -230,9 +226,6 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
private GetServerInfoOperation.ServerInfo mServerInfo = new GetServerInfoOperation.ServerInfo();
/// Authentication PRE-Fragment elements
private WebViewFidoBridge webViewFidoU2fBridge;
private WebViewWebauthnBridge webViewWebauthnBridge;
private String mAuthStatusText = EMPTY_STRING;
private int mAuthStatusIcon;
@ -521,19 +514,6 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
accountSetupWebviewBinding.loginWebview.getSettings().setSaveFormData(false);
accountSetupWebviewBinding.loginWebview.getSettings().setSavePassword(false);
FidoDialogOptions.Builder dialogOptionsBuilder = FidoDialogOptions.builder();
dialogOptionsBuilder.setShowSdkLogo(true);
dialogOptionsBuilder.setTheme(R.style.FidoDialog);
webViewFidoU2fBridge = WebViewFidoBridge.createInstanceForWebView(
this, accountSetupWebviewBinding.loginWebview, dialogOptionsBuilder);
WebauthnDialogOptions.Builder webauthnOptionsBuilder = WebauthnDialogOptions.builder();
webauthnOptionsBuilder.setShowSdkLogo(true);
webauthnOptionsBuilder.setAllowSkipPin(true);
webauthnOptionsBuilder.setTheme(R.style.FidoDialog);
webViewWebauthnBridge = WebViewWebauthnBridge.createInstanceForWebView(
this, accountSetupWebviewBinding.loginWebview, webauthnOptionsBuilder);
Map<String, String> headers = new HashMap<>();
headers.put(RemoteOperation.OCS_API_HEADER, RemoteOperation.OCS_API_HEADER_VALUE);
@ -572,16 +552,12 @@ public class AuthenticatorActivity extends AccountAuthenticatorActivity
accountSetupWebviewBinding.loginWebview.setWebViewClient(new NextcloudWebViewClient(getSupportFragmentManager()) {
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
webViewFidoU2fBridge.delegateShouldInterceptRequest(view, request);
webViewWebauthnBridge.delegateShouldInterceptRequest(view, request);
return super.shouldInterceptRequest(view, request);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
super.onPageStarted(view, url, favicon);
webViewFidoU2fBridge.delegateOnPageStarted(view, url, favicon);
webViewWebauthnBridge.delegateOnPageStarted(view, url, favicon);
}
@Override

View file

@ -75,7 +75,7 @@
android:layout_marginEnd="@dimen/standard_half_margin"
android:contentDescription="@null"
android:src="@drawable/online_status"
app:tint="@color/hwSecurityGreen" />
app:tint="@color/online" />
<LinearLayout
android:layout_width="match_parent"

View file

@ -56,6 +56,7 @@
<color name="process_dialog_background">#ffffff</color>
<color name="indicator_dot_selected">#ffffff</color>
<color name="drawer_shadow">#000000</color>
<color name="online">#2d7b41</color>
<color name="background_color_png">#FFFFFF</color>

View file

@ -62,7 +62,6 @@
<style name="ThemeOverlay.App.TextInputLayout" parent="ThemeOverlay.Material3.TextInputEditText.OutlinedBox">
<item name="colorPrimary">@color/text_color</item>
<item name="colorOnSurface">@color/text_color</item>
<item name="colorError">@color/hwSecurityRed</item>
<item name="editTextStyle">@style/Widget.Material3.TextInputEditText.OutlinedBox</item>
</style>
@ -335,7 +334,6 @@
<style name="ThemeOverlay.App.Login.TextInputLayout" parent="">
<item name="colorPrimary">@color/white</item>
<item name="colorOnSurface">@color/white</item>
<item name="colorError">@color/hwSecurityRed</item>
<item name="textAppearanceSubtitle1">@style/TextAppearance.Material3.BodyLarge</item>
<item name="textAppearanceCaption">@style/TextAppearance.Material3.BodySmall</item>
<item name="editTextStyle">@style/Widget.Material3.TextInputEditText.OutlinedBox</item>
@ -415,12 +413,6 @@
<item name="iconPadding">0dp</item>
</style>
<!-- Custom colors for the FIDO dialog -->
<style name="FidoDialog" parent="HwSecurity.Dialog">
<item name="hwSecurityButtonColor">@color/color_accent</item>
<item name="hwSecuritySurfaceColor">@color/primary</item>
</style>
<style name="Nextcloud.Material.TextButton" parent="Widget.Material3.Button.TextButton.Icon">
<item name="android:typeface">sans</item>
<item name="android:textStyle">bold</item>

View file

@ -19,7 +19,6 @@ buildscript {
daggerVersion = "2.52"
documentScannerVersion = "1.1.1"
espressoVersion = "3.6.1"
fidoVersion = "4.1.0-patch2"
jacoco_version = '0.8.12'
kotlin_version = '2.0.20'
markwonVersion = "4.6.2"