Skip to content

Commit 6719d0c

Browse files
alperozturk96tobiasKaminsky
authored andcommitted
Add registerFilesAppType
Signed-off-by: alperozturk <[email protected]>
1 parent 943dbc4 commit 6719d0c

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

app/src/main/java/it/niedermann/owncloud/notes/NotesApplication.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515

1616
import android.app.Application;
1717
import android.content.Context;
18+
import android.text.TextUtils;
1819
import android.util.Log;
1920
import android.webkit.WebView;
2021

2122
import androidx.appcompat.app.AppCompatDelegate;
2223

24+
import com.nextcloud.android.sso.FilesAppTypeRegistry;
25+
import com.nextcloud.android.sso.model.FilesAppType;
26+
2327
import it.niedermann.owncloud.notes.branding.BrandingUtil;
2428
import it.niedermann.owncloud.notes.preferences.DarkModeSetting;
2529

@@ -46,6 +50,18 @@ public void onCreate() {
4650
if (BuildConfig.DEBUG) {
4751
WebView.setWebContentsDebuggingEnabled(true);
4852
}
53+
registerFilesAppType();
54+
}
55+
56+
private void registerFilesAppType() {
57+
String packageId = getResources().getString(R.string.package_id);
58+
String accountType = getResources().getString(R.string.account_type);
59+
60+
if (TextUtils.isEmpty(packageId) || TextUtils.isEmpty(accountType)) {
61+
return;
62+
}
63+
64+
FilesAppTypeRegistry.getInstance().init(new FilesAppType(packageId, accountType, FilesAppType.Type.PROD));
4965
}
5066

5167
public static BrandingUtil brandingUtil() {

app/src/main/res/values/setup.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Nextcloud - Android Client
3+
~
4+
~ SPDX-FileCopyrightText: 2024 Alper Ozturk <[email protected]>
5+
~ SPDX-License-Identifier: AGPL-3.0-or-later
6+
-->
7+
8+
<resources>
9+
<string name="package_id" translatable="false"></string>
10+
<string name="account_type" translatable="false"></string>
11+
</resources>

0 commit comments

Comments
 (0)