Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: 'realm-android'
apply plugin: 'de.mannodermaus.android-junit5'


android {

namespace 'com.infomaniak.drive'
Expand Down Expand Up @@ -40,9 +41,6 @@ android {
buildConfigField 'String', 'SHOP_URL', '"https://shop.infomaniak.com/order/"'
buildConfigField 'String', 'SUPPORT_URL', '"https://support.infomaniak.com/"'

resValue 'string', 'CLOUD_STORAGE_AUTHORITY', 'com.infomaniak.drive.documents'
resValue 'string', 'FILE_AUTHORITY', 'com.infomaniak.drive.files'

resValue 'string', 'EXPOSED_UPLOAD_DIR', 'upload_media'
resValue 'string', 'EXPOSED_OFFLINE_DIR', 'offline_storage'
resValue 'string', 'EXPOSED_PUBLIC_SHARE_DIR', 'public_share'
Expand All @@ -59,10 +57,34 @@ android {

kotlinOptions { jvmTarget = javaVersion }

def debugKeystoreFile = rootProject.file("debug.keystore")
signingConfigs {
debug {
storeFile = debugKeystoreFile
keyAlias = "androiddebugkey"
keyPassword = "android"
storePassword = "android"
}
}


buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

resValue 'string', 'CLOUD_STORAGE_AUTHORITY', 'com.infomaniak.drive.documents'
resValue 'string', 'FILE_AUTHORITY', 'com.infomaniak.drive.files'
resValue 'string', 'applicationId', 'com.infomaniak.drive'
}
debug {
applicationIdSuffix = ".debug"
versionNameSuffix = "-DEBUG"
signingConfig = signingConfigs.debug

resValue 'string', 'CLOUD_STORAGE_AUTHORITY', 'com.infomaniak.drive.debug.documents'
resValue 'string', 'FILE_AUTHORITY', 'com.infomaniak.drive.debug.files'
resValue 'string', 'applicationId', 'com.infomaniak.drive.debug'
}
}

Expand Down
39 changes: 38 additions & 1 deletion app/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"project_info": {
"project_number": "355767057795",
"project_id": "kdrive-e4dbe",
"storage_bucket": "kdrive-e4dbe.appspot.com"
"storage_bucket": "kdrive-e4dbe.firebasestorage.app"
},
"client": [
{
Expand Down Expand Up @@ -41,6 +41,43 @@
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:355767057795:android:66ba0f22e278c31d8f0ab6",
"android_client_info": {
"package_name": "com.infomaniak.drive.debug"
}
},
"oauth_client": [
{
"client_id": "355767057795-h6pmg5hq87bnjbtlrds8lvbua0o6o44n.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDedMW4ViDkJUTsv4oLHRgY8LFb6GCPa8s"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "355767057795-h6pmg5hq87bnjbtlrds8lvbua0o6o44n.apps.googleusercontent.com",
"client_type": 3
},
{
"client_id": "355767057795-ul4amh9a72n15opilo4ujulgch94c88f.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "com.infomaniak.drive",
"app_store_id": "1482778676"
}
}
]
}
}
}
],
"configuration_version": "1"
Expand Down
77 changes: 77 additions & 0 deletions app/src/debug/res/xml-v25/shortcuts.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Infomaniak kDrive - Android
~ Copyright (C) 2023-2024 Infomaniak Network SA
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU General Public License for more details.
~
~ You should have received a copy of the GNU General Public License
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android">
<shortcut
android:icon="@mipmap/ic_shortcut_upload"
android:shortcutId="upload"
android:shortcutLongLabel="@string/buttonUpload"
android:shortcutShortLabel="@string/shortcutUploadShortDescription">
<intent
android:action="android.intent.action.ATTACH_DATA"
android:targetClass="com.infomaniak.drive.ui.LaunchActivity"
android:targetPackage="com.infomaniak.drive.debug">
<extra
android:name="shortcuts_tag"
android:value="upload" />
</intent>
</shortcut>

<shortcut
android:icon="@mipmap/ic_shortcut_scan"
android:shortcutId="scan"
android:shortcutLongLabel="@string/buttonDocumentScanning"
android:shortcutShortLabel="@string/shortcutScanShortDescription">
<intent
android:action="android.intent.action.ATTACH_DATA"
android:targetClass="com.infomaniak.drive.ui.LaunchActivity"
android:targetPackage="com.infomaniak.drive.debug">
<extra
android:name="shortcuts_tag"
android:value="scan" />
</intent>
</shortcut>

<shortcut
android:icon="@mipmap/ic_shortcut_search"
android:shortcutId="search"
android:shortcutShortLabel="@string/searchTitle">
<intent
android:action="android.intent.action.ATTACH_DATA"
android:targetClass="com.infomaniak.drive.ui.LaunchActivity"
android:targetPackage="com.infomaniak.drive.debug">
<extra
android:name="shortcuts_tag"
android:value="search" />
</intent>
</shortcut>

<shortcut
android:icon="@mipmap/ic_shortcut_feedback"
android:shortcutId="feedback"
android:shortcutLongLabel="@string/supportTitle"
android:shortcutShortLabel="@string/shortcutFeedbackShortDescription">
<intent
android:action="android.intent.action.ATTACH_DATA"
android:targetClass="com.infomaniak.drive.ui.LaunchActivity"
android:targetPackage="com.infomaniak.drive.debug">
<extra
android:name="shortcuts_tag"
android:value="feedback" />
</intent>
</shortcut>
</shortcuts>
4 changes: 3 additions & 1 deletion app/src/main/java/com/infomaniak/drive/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ class MainApplication : Application(), ImageLoaderFactory, DefaultLifecycleObser

InfomaniakCore.apply {
init(
appId = BuildConfig.APPLICATION_ID,
appId = BuildConfig.APPLICATION_ID.removeSuffix(
suffix = ".debug" // Because the backend only accepts the release package name for now.
),
appVersionCode = BuildConfig.VERSION_CODE,
appVersionName = BuildConfig.VERSION_NAME,
clientId = BuildConfig.CLIENT_ID,
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/java/com/infomaniak/drive/utils/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@ fun <T> ApiResponse<ArrayList<T>>.isLastPage() = (data?.size ?: 0) < itemsPerPag

fun Context.getInfomaniakLogin() = InfomaniakLogin(
context = this,
appUID = BuildConfig.APPLICATION_ID,
appUID = BuildConfig.APPLICATION_ID.removeSuffix(
suffix = ".debug" // Because the backend only accepts the release package name for now.
),
clientID = BuildConfig.CLIENT_ID,
accessType = null,
)
Expand Down
Binary file added debug.keystore
Binary file not shown.
Loading