Skip to content
Merged
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ app.*.map.json
/android/app/build/
/android/build/
keystore_base64.txt
graphify-out*
*.txt*

20 changes: 0 additions & 20 deletions README_ES.md

This file was deleted.

2 changes: 1 addition & 1 deletion android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
versionCode = flutter.versionCode
versionName = flutter.versionName
androidResources {
localeFilters.addAll(listOf("en", "es"))
localeFilters.addAll(listOf("en"))
}
}

Expand Down
41 changes: 0 additions & 41 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,37 +96,6 @@
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
</intent-filter>

<!-- Registro como gestor de archivos del sistema -->
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.APP_FILES" />
</intent-filter>

<!-- Modo Seleccionador (Picker) -->
<intent-filter>
<action android:name="android.intent.action.GET_CONTENT" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.OPENABLE" />
<data android:mimeType="*/*" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PICK" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
<data android:mimeType="image/*" />
<data android:mimeType="video/*" />
<data android:mimeType="audio/*" />
</intent-filter>

<!-- Explorar almacenamiento -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="content" />
<data android:mimeType="vnd.android.document/root" />
</intent-filter>
</activity>

<activity-alias
Expand Down Expand Up @@ -217,16 +186,6 @@
</intent-filter>
</provider>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

<service
android:name=".FtpForegroundService"
android:enabled="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class FtpForegroundService : Service() {
}

val notification = builder
.setContentTitle(getString(R.string.ftp_server_title))
.setContentText(getString(R.string.ftp_server_running, ip, port))
.setContentTitle("NFile FTP Server")
.setContentText("Running at ftp://$ip:$port")
.setSmallIcon(iconResId)
.setContentIntent(pendingIntent)
.setOngoing(true)
Expand All @@ -67,8 +67,8 @@ class FtpForegroundService : Service() {

private fun createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val name = getString(R.string.ftp_server_channel_name)
val descriptionText = getString(R.string.ftp_server_channel_desc)
val name = "FTP Server"
val descriptionText = "Displays status of the background FTP Server"
val importance = NotificationManager.IMPORTANCE_LOW
val channel = NotificationChannel(CHANNEL_ID, name, importance).apply {
description = descriptionText
Expand Down
43 changes: 4 additions & 39 deletions android/app/src/main/kotlin/com/rubex/nfile/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class MainActivity : AudioServiceFragmentActivity() {
private var pendingPermissionResult: MethodChannel.Result? = null
private var safPermissionResult: MethodChannel.Result? = null
private val SAF_REQUEST_CODE = 10002
private var isPickerMode = false

private val ACTION_CANCEL_OPERATION = "com.rubex.nfile.ACTION_CANCEL_OPERATION"
private var notificationsChannel: MethodChannel? = null
Expand All @@ -67,7 +66,6 @@ class MainActivity : AudioServiceFragmentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
isPickerMode = intent?.action == Intent.ACTION_GET_CONTENT || intent?.action == Intent.ACTION_PICK
try {
Shizuku.addBinderReceivedListenerSticky {
// Binder ready
Expand Down Expand Up @@ -142,39 +140,6 @@ class MainActivity : AudioServiceFragmentActivity() {

override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
super.configureFlutterEngine(flutterEngine)

MethodChannel(flutterEngine.dartExecutor.binaryMessenger, "com.rubex.nfile/picker").setMethodCallHandler { call, result ->
when (call.method) {
"isPickerMode" -> result.success(isPickerMode)
"finishWithResult" -> {
val filePath = call.argument<String>("path")
if (filePath != null) {
try {
val file = File(filePath)
val uri = androidx.core.content.FileProvider.getUriForFile(
this@MainActivity,
"${applicationContext.packageName}.fileprovider",
file
)
val resultIntent = Intent().apply {
data = uri
flags = Intent.FLAG_GRANT_READ_URI_PERMISSION
}
setResult(android.app.Activity.RESULT_OK, resultIntent)
finish()
result.success(true)
} catch (e: Exception) {
e.printStackTrace()
result.success(false)
}
} else {
result.success(false)
}
}
else -> result.notImplemented()
}
}

MethodChannel(flutterEngine.dartExecutor.binaryMessenger, CHANNEL).setMethodCallHandler { call, result ->
when (call.method) {
"checkStatus" -> {
Expand Down Expand Up @@ -745,11 +710,11 @@ class MainActivity : AudioServiceFragmentActivity() {
notificationsChannel?.setMethodCallHandler { call, result ->
val notificationManager = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
val channelId = "nfile_archive_channel"
val channelName = getString(R.string.archive_channel_name)
val channelName = "NFile Archive Operations"

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val channel = NotificationChannel(channelId, channelName, NotificationManager.IMPORTANCE_LOW).apply {
description = getString(R.string.archive_channel_desc)
description = "Shows progress of file compression and extraction"
}
notificationManager.createNotificationChannel(channel)
}
Expand Down Expand Up @@ -797,8 +762,8 @@ class MainActivity : AudioServiceFragmentActivity() {
.setContentIntent(openPendingIntent)

if (progress < max) {
builder.addAction(android.R.drawable.ic_menu_view, "Abrir", openPendingIntent)
builder.addAction(android.R.drawable.ic_menu_close_clear_cancel, "Cancelar", cancelPendingIntent)
builder.addAction(android.R.drawable.ic_menu_view, "Open", openPendingIntent)
builder.addAction(android.R.drawable.ic_menu_close_clear_cancel, "Cancel", cancelPendingIntent)
}

if (indeterminate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ class NFileDocumentsProvider : DocumentsProvider() {
row.add(DocumentsContract.Root.COLUMN_DOCUMENT_ID, getDocIdForFile(File("/storage/emulated/0")))
row.add(DocumentsContract.Root.COLUMN_MIME_TYPES, "*/*")
row.add(DocumentsContract.Root.COLUMN_FLAGS, flags)
row.add(DocumentsContract.Root.COLUMN_TITLE, context?.getString(R.string.storage_provider_title) ?: "NFile Storage")
row.add(DocumentsContract.Root.COLUMN_SUMMARY, context?.getString(R.string.storage_provider_desc) ?: "Internal storage via NFile")
row.add(DocumentsContract.Root.COLUMN_ICON, R.mipmap.ic_launcher)
row.add(DocumentsContract.Root.COLUMN_TITLE, "NFile Storage")
row.add(DocumentsContract.Root.COLUMN_SUMMARY, "Internal storage via NFile")
row.add(DocumentsContract.Root.COLUMN_ICON, android.R.drawable.sym_def_app_icon)

try {
val stat = android.os.StatFs("/storage/emulated/0")
Expand Down Expand Up @@ -112,15 +112,6 @@ class NFileDocumentsProvider : DocumentsProvider() {
return getDocIdForFile(file)
}

override fun renameDocument(documentId: String?, displayName: String?): String {
val file = getFileForDocId(documentId ?: "")
val newFile = File(file.parentFile, displayName ?: file.name)
if (!file.renameTo(newFile)) {
throw FileNotFoundException("Failed to rename document: $documentId")
}
return getDocIdForFile(newFile)
}

override fun deleteDocument(documentId: String?) {
val file = getFileForDocId(documentId ?: "")
if (!file.deleteRecursively()) {
Expand Down Expand Up @@ -162,8 +153,7 @@ class NFileDocumentsProvider : DocumentsProvider() {

private fun includeFile(result: MatrixCursor, docId: String?, file: File) {
val flags = DocumentsContract.Document.FLAG_SUPPORTS_DELETE or
DocumentsContract.Document.FLAG_SUPPORTS_WRITE or
DocumentsContract.Document.FLAG_SUPPORTS_RENAME
DocumentsContract.Document.FLAG_SUPPORTS_WRITE

val mimeType = getMimeType(file)
val finalFlags = if (mimeType == DocumentsContract.Document.MIME_TYPE_DIR) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ class WebSharingForegroundService : Service() {
Notification.Builder(this)
}

val title = if (isInternet) getString(R.string.web_share_internet) else getString(R.string.web_share_local)
val title = if (isInternet) "NFile Internet Web Share" else "NFile Local Web Share"

val notification = builder
.setContentTitle(title)
.setContentText(getString(R.string.web_share_running, url))
.setContentText("Running at $url")
.setSmallIcon(iconResId)
.setContentIntent(pendingIntent)
.setOngoing(true)
Expand All @@ -69,8 +69,8 @@ class WebSharingForegroundService : Service() {

private fun createNotificationChannel() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val name = getString(R.string.web_share_channel_name)
val descriptionText = getString(R.string.web_share_channel_desc)
val name = "Web Sharing Server"
val descriptionText = "Displays status of the background Web Sharing Server"
val importance = NotificationManager.IMPORTANCE_LOW
val channel = NotificationChannel(CHANNEL_ID, name, importance).apply {
description = descriptionText
Expand Down
19 changes: 0 additions & 19 deletions android/app/src/main/res/values-es/strings.xml

This file was deleted.

19 changes: 0 additions & 19 deletions android/app/src/main/res/values/strings.xml

This file was deleted.

8 changes: 0 additions & 8 deletions android/app/src/main/res/xml/file_paths.xml

This file was deleted.

2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip
Loading
Loading