Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
21 changes: 21 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,21 @@ android {
baselineProfile {
dexLayoutOptimization = true
}

packaging {
resources {
// Ignorar archivos duplicados META-INF que causan conflictos
excludes += listOf(
"META-INF/versions/9/OSGI-INF/MANIFEST.MF",
"META-INF/DEPENDENCIES",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/NOTICE",
"META-INF/NOTICE.txt",
"META-INF/*.kotlin_module"
)
}
}
}

dependencies {
Expand Down Expand Up @@ -106,4 +121,10 @@ dependencies {
implementation(libs.gson)
implementation(libs.storage)
implementation(libs.zip4j)

//SMB Support
implementation(libs.smbj)
implementation(libs.dcerpc) {
exclude(group = "com.google.code.findbugs", module = "jsr305")
}
}
11 changes: 11 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,16 @@
-keep class org.joni.** { *; }
-keep class android.content.** { *; }
-keep class com.android.apksig.** { *; }
# SMB SUPPORT
-keep class com.hierynomus.** { *; }
-keep class com.rapid7.** { *; }
-keep class sun.security.** { *; }
-dontwarn sun.security.**
-keep class java.rmi.** { *; }
-dontwarn java.rmi.**
-keep class javax.el.** { *; }
-dontwarn javax.el.**
-keep class org.ietf.jgss.** { *; }
-dontwarn org.ietf.jgss.**

-keepnames interface * { *; }
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import com.raival.compose.file.explorer.screen.main.tab.files.holder.LocalFileHo
import com.raival.compose.file.explorer.screen.main.tab.files.ui.FilesTabContentView
import com.raival.compose.file.explorer.screen.main.tab.home.HomeTab
import com.raival.compose.file.explorer.screen.main.tab.home.ui.HomeTabContentView
import com.raival.compose.file.explorer.screen.main.ui.AddSMBDriveDialog
import com.raival.compose.file.explorer.screen.main.ui.AppInfoDialog
import com.raival.compose.file.explorer.screen.main.ui.JumpToPathDialog
import com.raival.compose.file.explorer.screen.main.ui.SaveTextEditorFilesDialog
Expand Down Expand Up @@ -127,6 +128,12 @@ class MainActivity : BaseActivity() {
onDismiss = { mainActivityManager.toggleJumpToPathDialog(false) }
)

AddSMBDriveDialog(
show = mainActivityState.showAddSMBDriveDialog,
onDismiss = { mainActivityManager.toggleAddSMBDriveDialog(false) }
)


AppInfoDialog(
show = mainActivityState.showAppInfoDialog,
hasNewUpdate = mainActivityState.hasNewUpdate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import com.raival.compose.file.explorer.screen.main.tab.Tab
import com.raival.compose.file.explorer.screen.main.tab.apps.AppsTab
import com.raival.compose.file.explorer.screen.main.tab.files.FilesTab
import com.raival.compose.file.explorer.screen.main.tab.files.holder.LocalFileHolder
import com.raival.compose.file.explorer.screen.main.tab.files.holder.SMBFileHolder
import com.raival.compose.file.explorer.screen.main.tab.files.provider.StorageProvider
import com.raival.compose.file.explorer.screen.main.tab.home.HomeTab
import kotlinx.coroutines.CoroutineScope
Expand Down Expand Up @@ -223,12 +224,36 @@ class MainActivityManager {
openFile(file, context)
}


fun addSmbDrive(
host: String,
username: String,
password: String,
anonymous: Boolean,
domain: String,
context: Context
): Boolean {
return try {
openSMBFile(SMBFileHolder(host, username, password, anonymous, domain, ""), context)
} catch (e: Exception) {
false
}
}

private fun openFile(file: LocalFileHolder, context: Context) {
if (file.exists()) {
addTabAndSelect(FilesTab(file, context))
}
}

private fun openSMBFile(file: SMBFileHolder, context: Context) : Boolean {
return if (file.exists()) {
addTabAndSelect(FilesTab(file, context))
true
}else
false
}

fun resumeActiveTab() {
getActiveTab()?.onTabResumed()
}
Expand Down Expand Up @@ -513,6 +538,14 @@ class MainActivityManager {
}
}

fun toggleAddSMBDriveDialog(show: Boolean) {
_state.update {
it.copy(
showAddSMBDriveDialog = show
)
}
}

fun toggleAppInfoDialog(show: Boolean) {
_state.update {
it.copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ data class MainActivityState(
val subtitle: String = emptyString,
val showAppInfoDialog: Boolean = false,
val showJumpToPathDialog: Boolean = false,
val showAddSMBDriveDialog: Boolean = false,
val showSaveEditorFilesDialog: Boolean = false,
val showStartupTabsDialog: Boolean = false,
val isSavingFiles: Boolean = false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import com.raival.compose.file.explorer.screen.main.MainActivity
import com.raival.compose.file.explorer.screen.main.tab.Tab
import com.raival.compose.file.explorer.screen.main.tab.files.holder.ContentHolder
import com.raival.compose.file.explorer.screen.main.tab.files.holder.LocalFileHolder
import com.raival.compose.file.explorer.screen.main.tab.files.holder.SMBFileHolder
import com.raival.compose.file.explorer.screen.main.tab.files.holder.VirtualFileHolder
import com.raival.compose.file.explorer.screen.main.tab.files.holder.ZipFileHolder
import com.raival.compose.file.explorer.screen.main.tab.files.misc.FileListCategory
Expand Down Expand Up @@ -774,4 +775,9 @@ class FilesTab(
targetFile = file
_dialogsState.update { it.copy(showImportPrefsDialog = file != null) }
}

fun toggleImportPrefsDialogSMB(file: SMBFileHolder?) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the state of this PR (opening files is not implemented yet), this must be removed, otherwise it might cause problems.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed on 8583863

targetFile = file
_dialogsState.update { it.copy(showImportPrefsDialog = file != null) }
}
}
Loading