forked from MeloNX/MeloNX
android - add button to open ryujinx app folder
This commit is contained in:
parent
289471ac1a
commit
545e9b1099
@ -1,4 +1,4 @@
|
||||
using LibRyujinx.Jni;
|
||||
using LibRyujinx.Jni;
|
||||
using LibRyujinx.Jni.Pointers;
|
||||
using LibRyujinx.Jni.Primitives;
|
||||
using LibRyujinx.Jni.References;
|
||||
@ -84,7 +84,7 @@ namespace LibRyujinx
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "Java_org_ryujinx_android_RyujinxNative_initialize")]
|
||||
public static JBoolean JniInitialize(JEnvRef jEnv, JObjectLocalRef jObj, JLong jpathId, JBoolean enableDebugLogs)
|
||||
public static JBoolean JniInitialize(JEnvRef jEnv, JObjectLocalRef jObj, JLong jpathId)
|
||||
{
|
||||
Logger.Trace?.Print(LogClass.Application, "Jni Function Call");
|
||||
PlatformInfo.IsBionic = true;
|
||||
@ -98,7 +98,7 @@ namespace LibRyujinx
|
||||
|
||||
var path = GetStoredString(jpathId);
|
||||
|
||||
var init = Initialize(path, enableDebugLogs);
|
||||
var init = Initialize(path);
|
||||
|
||||
_surfaceEvent?.Set();
|
||||
|
||||
@ -413,6 +413,13 @@ namespace LibRyujinx
|
||||
RunLoop();
|
||||
}
|
||||
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "Java_org_ryujinx_android_RyujinxNative_loggingSetEnabled")]
|
||||
public static void JniSetLoggingEnabledNative(JEnvRef jEnv, JObjectLocalRef jObj, JInt logLevel, JBoolean enabled)
|
||||
{
|
||||
Logger.SetEnable((LogLevel)(int)logLevel, enabled);
|
||||
}
|
||||
|
||||
[UnmanagedCallersOnly(EntryPoint = "Java_org_ryujinx_android_RyujinxNative_deviceGetGameInfoFromPath")]
|
||||
public static JObjectLocalRef JniGetGameInfo(JEnvRef jEnv, JObjectLocalRef jObj, JStringLocalRef path)
|
||||
{
|
||||
|
@ -1,4 +1,4 @@
|
||||
// State class for the library
|
||||
// State class for the library
|
||||
using Ryujinx.HLE.FileSystem;
|
||||
using Ryujinx.HLE.HOS.Services.Account.Acc;
|
||||
using Ryujinx.HLE.HOS;
|
||||
@ -56,7 +56,7 @@ namespace LibRyujinx
|
||||
return res;
|
||||
}
|
||||
|
||||
public static bool Initialize(string? basePath, bool enableDebugLogs = false)
|
||||
public static bool Initialize(string? basePath)
|
||||
{
|
||||
if (SwitchDevice != null)
|
||||
{
|
||||
@ -70,15 +70,6 @@ namespace LibRyujinx
|
||||
ConfigurationState.Initialize();
|
||||
LoggerModule.Initialize();
|
||||
|
||||
Logger.SetEnable(LogLevel.Debug, enableDebugLogs);
|
||||
Logger.SetEnable(LogLevel.Stub, false);
|
||||
Logger.SetEnable(LogLevel.Info, true);
|
||||
Logger.SetEnable(LogLevel.Warning, true);
|
||||
Logger.SetEnable(LogLevel.Error, true);
|
||||
Logger.SetEnable(LogLevel.Trace, false);
|
||||
Logger.SetEnable(LogLevel.Guest, true);
|
||||
Logger.SetEnable(LogLevel.AccessLog, false);
|
||||
|
||||
Logger.AddTarget(new AsyncLogTargetWrapper(
|
||||
new FileLogTarget(AppDataManager.BaseDirPath, "file"),
|
||||
1000,
|
||||
|
@ -51,7 +51,7 @@
|
||||
</provider>
|
||||
<provider
|
||||
android:name=".providers.DocumentProvider"
|
||||
android:authorities="org.ryujinx.android.provider"
|
||||
android:authorities="org.ryujinx.android.providers"
|
||||
android:exported="true"
|
||||
android:grantUriPermissions="true"
|
||||
android:permission="android.permission.MANAGE_DOCUMENTS">
|
||||
|
@ -1,16 +1,9 @@
|
||||
package org.ryujinx.android
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.PersistableBundle
|
||||
import androidx.activity.ComponentActivity
|
||||
|
||||
abstract class BaseActivity : ComponentActivity() {
|
||||
companion object{
|
||||
val crashHandler = CrashHandler()
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
|
||||
Thread.setDefaultUncaughtExceptionHandler(crashHandler)
|
||||
super.onCreate(savedInstanceState, persistentState)
|
||||
}
|
||||
}
|
||||
|
@ -80,6 +80,7 @@ class MainActivity : BaseActivity() {
|
||||
}
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
Thread.setDefaultUncaughtExceptionHandler(crashHandler)
|
||||
|
||||
if(
|
||||
!Environment.isExternalStorageManager()
|
||||
|
@ -7,6 +7,7 @@ import android.os.ParcelFileDescriptor
|
||||
import android.provider.DocumentsContract
|
||||
import android.provider.DocumentsProvider
|
||||
import android.webkit.MimeTypeMap
|
||||
import org.ryujinx.android.BuildConfig
|
||||
import org.ryujinx.android.R
|
||||
import org.ryujinx.android.RyujinxApplication
|
||||
import java.io.File
|
||||
@ -40,7 +41,7 @@ class DocumentProvider : DocumentsProvider() {
|
||||
DocumentsContract.Document.COLUMN_SIZE
|
||||
)
|
||||
|
||||
const val AUTHORITY : String = "org.ryujinx.android.providers"
|
||||
const val AUTHORITY : String = BuildConfig.APPLICATION_ID + ".providers"
|
||||
|
||||
const val ROOT_ID : String = "root"
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
package org.ryujinx.android.views
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Intent
|
||||
import android.provider.DocumentsContract
|
||||
import androidx.activity.compose.BackHandler
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.core.MutableTransitionState
|
||||
@ -56,6 +59,7 @@ import androidx.documentfile.provider.DocumentFile
|
||||
import com.anggrayudi.storage.file.extension
|
||||
import org.ryujinx.android.Helpers
|
||||
import org.ryujinx.android.MainActivity
|
||||
import org.ryujinx.android.providers.DocumentProvider
|
||||
import org.ryujinx.android.viewmodels.MainViewModel
|
||||
import org.ryujinx.android.viewmodels.SettingsViewModel
|
||||
import org.ryujinx.android.viewmodels.VulkanDriverViewModel
|
||||
@ -207,6 +211,37 @@ class SettingViews {
|
||||
Text(text = "Choose Folder")
|
||||
}
|
||||
}
|
||||
Button(onClick = {
|
||||
fun createIntent(action: String) : Intent{
|
||||
val intent = Intent(action)
|
||||
intent.addCategory(Intent.CATEGORY_DEFAULT)
|
||||
intent.data = DocumentsContract.buildRootUri(DocumentProvider.AUTHORITY, DocumentProvider.ROOT_ID)
|
||||
intent.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION or Intent.FLAG_GRANT_PREFIX_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION)
|
||||
return intent
|
||||
}
|
||||
try {
|
||||
mainViewModel.activity.startActivity(createIntent(Intent.ACTION_VIEW))
|
||||
return@Button
|
||||
}
|
||||
catch (_: ActivityNotFoundException){}
|
||||
try {
|
||||
mainViewModel.activity.startActivity(createIntent("android.provider.action.BROWSE"))
|
||||
return@Button
|
||||
}
|
||||
catch (_: ActivityNotFoundException){}
|
||||
try {
|
||||
mainViewModel.activity.startActivity(createIntent("com.google.android.documentsui"))
|
||||
return@Button
|
||||
}
|
||||
catch (_: ActivityNotFoundException){}
|
||||
try {
|
||||
mainViewModel.activity.startActivity(createIntent("com.android.documentsui"))
|
||||
return@Button
|
||||
}
|
||||
catch (_: ActivityNotFoundException){}
|
||||
}) {
|
||||
Text(text = "Open App Folder")
|
||||
}
|
||||
}
|
||||
}
|
||||
ExpandableView(onCardArrowClick = { }, title = "System") {
|
||||
|
@ -24,7 +24,7 @@ android.nonTransitiveRClass=true
|
||||
# Build configuration
|
||||
# It needs to be set to either "debug" or "release" and can also be overriden on a per build basis
|
||||
# by adding -Dorg.ryujinx.config=NAME to the command line.
|
||||
org.ryujinx.config=debug
|
||||
org.ryujinx.config=release
|
||||
# Controls stripping of symbols from libryujinx
|
||||
# Setting this property to auto causes symbols to be stripped for release builds,
|
||||
# but not for debug builds.
|
||||
@ -33,3 +33,4 @@ org.ryujinx.config=debug
|
||||
org.ryujinx.symbols.strip=auto
|
||||
# Output path of libryujinx.so
|
||||
org.ryujinx.publish.path=app/src/main/jniLibs/arm64-v8a
|
||||
org.ryujinx.llvm.toolchain.path=C\:\\Android\\android-sdk\\ndk\\25.1.8937393\\toolchains\\llvm\\prebuilt\\windows-x86_64\\bin
|
||||
|
Loading…
x
Reference in New Issue
Block a user