WIP: [frontend, android] Move update_checker to frontend_common and add Android support #2687

Draft
inix wants to merge 4 commits from inix/eden:update-checker-android into master
4 changed files with 21 additions and 2 deletions
Showing only changes of commit 67c3197ee5 - Show all commits

View file

@ -215,6 +215,11 @@ object NativeLibrary {
*/ */
external fun getUpdateUrl(version: String): String external fun getUpdateUrl(version: String): String
/**
* Returns whether the update checker is enabled through CMAKE options.
*/
external fun isUpdateCheckerEnabled(): Boolean
enum class CoreError { enum class CoreError {
ErrorSystemFiles, ErrorSystemFiles,
ErrorSavestate, ErrorSavestate,

View file

@ -64,7 +64,9 @@ class YuzuApplication : Application() {
Log.logDeviceInfo() Log.logDeviceInfo()
// Initialize CA certificates for HTTPS // Initialize CA certificates for HTTPS
initializeCACertificates() if (NativeLibrary.isUpdateCheckerEnabled()) {
initializeCACertificates()
}
createNotificationChannels() createNotificationChannels()
} }

View file

@ -196,7 +196,8 @@ class MainActivity : AppCompatActivity(), ThemeProvider {
val firstTimeSetup = PreferenceManager.getDefaultSharedPreferences(applicationContext) val firstTimeSetup = PreferenceManager.getDefaultSharedPreferences(applicationContext)
.getBoolean(Settings.PREF_FIRST_APP_LAUNCH, true) .getBoolean(Settings.PREF_FIRST_APP_LAUNCH, true)
if (!firstTimeSetup) {
if (!firstTimeSetup && NativeLibrary.isUpdateCheckerEnabled()) {
checkForUpdates() checkForUpdates()
} }
setInsets() setInsets()

View file

@ -1064,6 +1064,17 @@ JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_updatePowerState(
g_has_battery.store(hasBattery, std::memory_order_relaxed); g_has_battery.store(hasBattery, std::memory_order_relaxed);
} }
// return #ifdef ENABLE_UPDATE_CHECKER
JNIEXPORT jboolean JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_isUpdateCheckerEnabled(
JNIEnv* env,
jobject obj) {
#ifdef ENABLE_UPDATE_CHECKER
return JNI_TRUE;
#else
return JNI_FALSE;
#endif
}
#ifdef ENABLE_UPDATE_CHECKER #ifdef ENABLE_UPDATE_CHECKER
JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_setCACertificatePath( JNIEXPORT void JNICALL Java_org_yuzu_yuzu_1emu_NativeLibrary_setCACertificatePath(
JNIEnv* env, JNIEnv* env,