Revert "Gradle"
4
.gitignore
vendored
@ -115,10 +115,6 @@ wiiu/wut/elf2rpl/elf2rpl
|
|||||||
/pkg/android/phoenix/bin/
|
/pkg/android/phoenix/bin/
|
||||||
/pkg/android/phoenix/gen/
|
/pkg/android/phoenix/gen/
|
||||||
/pkg/android/phoenix/local.properties
|
/pkg/android/phoenix/local.properties
|
||||||
/pkg/android/phoenix/gradle.properties
|
|
||||||
/pkg/android/phoenix/.gradle
|
|
||||||
/pkg/android/phoenix/.externalNativeBuild
|
|
||||||
/pkg/android/phoenix/build
|
|
||||||
|
|
||||||
# Cloned by libretro-fetch.sh
|
# Cloned by libretro-fetch.sh
|
||||||
/media/assets/
|
/media/assets/
|
||||||
|
2
deps/dr/dr_flac.h
vendored
@ -667,7 +667,7 @@ const char* drflac_next_vorbis_comment(drflac_vorbis_comment_iterator* pIter, dr
|
|||||||
#define DRFLAC_NO_CPUID
|
#define DRFLAC_NO_CPUID
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#if (defined(__GNUC__) || defined(__clang__)) && !defined(__ANDROID__)
|
#if defined(__GNUC__) || defined(__clang__)
|
||||||
static void drflac__cpuid(int info[4], int fid)
|
static void drflac__cpuid(int info[4], int fid)
|
||||||
{
|
{
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
|
135
pkg/android/phoenix-gradle/.gitignore
vendored
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
|
||||||
|
# Created by https://www.gitignore.io/api/androidstudio
|
||||||
|
# Edit at https://www.gitignore.io/?templates=androidstudio
|
||||||
|
|
||||||
|
### AndroidStudio ###
|
||||||
|
# Covers files to be ignored for android development using Android Studio.
|
||||||
|
|
||||||
|
# Built application files
|
||||||
|
*.apk
|
||||||
|
*.ap_
|
||||||
|
|
||||||
|
# Files for the ART/Dalvik VM
|
||||||
|
*.dex
|
||||||
|
|
||||||
|
# Java class files
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Generated files
|
||||||
|
bin/
|
||||||
|
gen/
|
||||||
|
out/
|
||||||
|
|
||||||
|
# Gradle files
|
||||||
|
.gradle
|
||||||
|
.gradle/
|
||||||
|
build/
|
||||||
|
|
||||||
|
# Signing files
|
||||||
|
.signing/
|
||||||
|
|
||||||
|
# Local configuration file (sdk path, etc)
|
||||||
|
local.properties
|
||||||
|
|
||||||
|
# Proguard folder generated by Eclipse
|
||||||
|
proguard/
|
||||||
|
|
||||||
|
# Log Files
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Android Studio
|
||||||
|
/*/build/
|
||||||
|
/*/local.properties
|
||||||
|
/*/out
|
||||||
|
/*/*/build
|
||||||
|
/*/*/production
|
||||||
|
captures/
|
||||||
|
.navigation/
|
||||||
|
*.ipr
|
||||||
|
*~
|
||||||
|
*.swp
|
||||||
|
|
||||||
|
# Android Patch
|
||||||
|
gen-external-apklibs
|
||||||
|
|
||||||
|
# External native build folder generated in Android Studio 2.2 and later
|
||||||
|
.externalNativeBuild
|
||||||
|
|
||||||
|
# NDK
|
||||||
|
obj/
|
||||||
|
|
||||||
|
# IntelliJ IDEA
|
||||||
|
*.iml
|
||||||
|
*.iws
|
||||||
|
/out/
|
||||||
|
|
||||||
|
# User-specific configurations
|
||||||
|
.idea/caches/
|
||||||
|
.idea/libraries/
|
||||||
|
.idea/shelf/
|
||||||
|
.idea/workspace.xml
|
||||||
|
.idea/tasks.xml
|
||||||
|
.idea/.name
|
||||||
|
.idea/compiler.xml
|
||||||
|
.idea/copyright/profiles_settings.xml
|
||||||
|
.idea/encodings.xml
|
||||||
|
.idea/misc.xml
|
||||||
|
.idea/modules.xml
|
||||||
|
.idea/scopes/scope_settings.xml
|
||||||
|
.idea/dictionaries
|
||||||
|
.idea/vcs.xml
|
||||||
|
.idea/jsLibraryMappings.xml
|
||||||
|
.idea/datasources.xml
|
||||||
|
.idea/dataSources.ids
|
||||||
|
.idea/sqlDataSources.xml
|
||||||
|
.idea/dynamic.xml
|
||||||
|
.idea/uiDesigner.xml
|
||||||
|
.idea/assetWizardSettings.xml
|
||||||
|
|
||||||
|
# OS-specific files
|
||||||
|
.DS_Store
|
||||||
|
.DS_Store?
|
||||||
|
._*
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
||||||
|
ehthumbs.db
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Legacy Eclipse project files
|
||||||
|
.classpath
|
||||||
|
.project
|
||||||
|
.cproject
|
||||||
|
.settings/
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.war
|
||||||
|
*.ear
|
||||||
|
|
||||||
|
# virtual machine crash logs (Reference: http://www.java.com/en/download/help/error_hotspot.xml)
|
||||||
|
hs_err_pid*
|
||||||
|
|
||||||
|
## Plugin-specific files:
|
||||||
|
|
||||||
|
# mpeltonen/sbt-idea plugin
|
||||||
|
.idea_modules/
|
||||||
|
|
||||||
|
# JIRA plugin
|
||||||
|
atlassian-ide-plugin.xml
|
||||||
|
|
||||||
|
# Mongo Explorer plugin
|
||||||
|
.idea/mongoSettings.xml
|
||||||
|
|
||||||
|
# Crashlytics plugin (for Android Studio and IntelliJ)
|
||||||
|
com_crashlytics_export_strings.xml
|
||||||
|
crashlytics.properties
|
||||||
|
crashlytics-build.properties
|
||||||
|
fabric.properties
|
||||||
|
|
||||||
|
### AndroidStudio Patch ###
|
||||||
|
|
||||||
|
!/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# End of https://www.gitignore.io/api/androidstudio
|
68
pkg/android/phoenix-gradle/app/build.gradle
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 28
|
||||||
|
buildToolsVersion "28.0.3"
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "com.retroarch"
|
||||||
|
minSdkVersion 16
|
||||||
|
targetSdkVersion 28
|
||||||
|
|
||||||
|
ndk {
|
||||||
|
moduleName "retroarch-activity"
|
||||||
|
}
|
||||||
|
|
||||||
|
externalNativeBuild {
|
||||||
|
ndkBuild {
|
||||||
|
arguments "-j${Runtime.runtime.availableProcessors()}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flavorDimensions "abi"
|
||||||
|
productFlavors {
|
||||||
|
ra32 {
|
||||||
|
dimension "abi"
|
||||||
|
ndk {
|
||||||
|
abiFilters 'armeabi-v7a', 'x86'
|
||||||
|
}
|
||||||
|
resValue "string", "app_name", "RetroArch"
|
||||||
|
}
|
||||||
|
ra64 {
|
||||||
|
dimension "abi"
|
||||||
|
ndk {
|
||||||
|
abiFilters 'arm64-v8a', 'x86_64'
|
||||||
|
}
|
||||||
|
applicationIdSuffix '.aarch64'
|
||||||
|
resValue "string", "app_name", "RetroArch (AArch64)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
externalNativeBuild {
|
||||||
|
ndkBuild {
|
||||||
|
path file('../../phoenix/jni/Android.mk')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
ra32 {
|
||||||
|
java.srcDirs = ['../../phoenix/src']
|
||||||
|
res.srcDirs = ['../../phoenix/res', '../../phoenix/libs/googleplay/res']
|
||||||
|
}
|
||||||
|
ra64 {
|
||||||
|
java.srcDirs = ['../../phoenix/src']
|
||||||
|
res.srcDirs = ['../../phoenix64/res', '../../phoenix64/libs/googleplay/res']
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation files('../../phoenix/libs/googleplay/libs/google-play-services.jar')
|
||||||
|
}
|
43
pkg/android/phoenix-gradle/app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<!-- <!DOCTYPE manifest [ <!ENTITY % versionDTD SYSTEM "../../../version.dtd"> %versionDTD; ]> !-->
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
package="com.retroarch"
|
||||||
|
android:versionCode="77"
|
||||||
|
android:versionName="1.7.7"
|
||||||
|
android:installLocation="internalOnly">
|
||||||
|
<uses-feature android:glEsVersion="0x00020000" />
|
||||||
|
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
|
||||||
|
<uses-feature android:name="android.software.leanback" android:required="false" />
|
||||||
|
<uses-feature android:name="android.hardware.gamepad" android:required="false"/>
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@drawable/ic_launcher"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:hasCode="true"
|
||||||
|
android:isGame="true"
|
||||||
|
android:banner="@drawable/banner"
|
||||||
|
tools:ignore="GoogleAppIndexingWarning">
|
||||||
|
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
|
||||||
|
<activity android:name="com.retroarch.browser.mainmenu.MainMenuActivity" android:exported="true" android:launchMode="singleInstance">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
|
||||||
|
<category android:name="tv.ouya.intent.category.GAME" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name="com.retroarch.browser.retroactivity.RetroActivityFuture" android:exported="true" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:launchMode="singleInstance">
|
||||||
|
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />
|
||||||
|
<meta-data android:name="android.app.func_name" android:value="ANativeActivity_onCreate" />
|
||||||
|
</activity>
|
||||||
|
<activity android:name="com.retroarch.browser.retroactivity.RetroActivityPast" android:exported="true" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:launchMode="singleInstance">
|
||||||
|
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />
|
||||||
|
<meta-data android:name="android.app.func_name" android:value="ANativeActivity_onCreate" />
|
||||||
|
</activity>
|
||||||
|
<activity android:name="com.retroarch.browser.debug.CoreSideloadActivity" android:exported="true"/>
|
||||||
|
</application>
|
||||||
|
</manifest>
|
17
pkg/android/phoenix-gradle/build.gradle
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
0
pkg/android/phoenix/gradlew → pkg/android/phoenix-gradle/gradlew
vendored
Executable file → Normal file
@ -1,84 +1,84 @@
|
|||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%" == "" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables with windows NT shell
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
set APP_BASE_NAME=%~n0
|
set APP_BASE_NAME=%~n0
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
set DEFAULT_JVM_OPTS=
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
@rem Find java.exe
|
@rem Find java.exe
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
set JAVA_EXE=java.exe
|
set JAVA_EXE=java.exe
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
echo.
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:findJavaFromJavaHome
|
:findJavaFromJavaHome
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
echo.
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
echo.
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation.
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
:init
|
:init
|
||||||
@rem Get command-line arguments, handling Windows variants
|
@rem Get command-line arguments, handling Windows variants
|
||||||
|
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
|
||||||
:win9xME_args
|
:win9xME_args
|
||||||
@rem Slurp the command line arguments.
|
@rem Slurp the command line arguments.
|
||||||
set CMD_LINE_ARGS=
|
set CMD_LINE_ARGS=
|
||||||
set _SKIP=2
|
set _SKIP=2
|
||||||
|
|
||||||
:win9xME_args_slurp
|
:win9xME_args_slurp
|
||||||
if "x%~1" == "x" goto execute
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
set CMD_LINE_ARGS=%*
|
||||||
|
|
||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
:fail
|
:fail
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
rem the _cmd.exe /c_ return code!
|
rem the _cmd.exe /c_ return code!
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
exit /b 1
|
exit /b 1
|
||||||
|
|
||||||
:mainEnd
|
:mainEnd
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
:omega
|
:omega
|
1
pkg/android/phoenix-gradle/settings.gradle
Normal file
@ -0,0 +1 @@
|
|||||||
|
include ':app'
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
5
pkg/android/phoenix-legacy/.gitignore
vendored
@ -1,5 +0,0 @@
|
|||||||
/gen
|
|
||||||
/bin
|
|
||||||
/libs/*/*.so
|
|
||||||
/obj
|
|
||||||
/jni/modules/*.so
|
|
@ -1,182 +0,0 @@
|
|||||||
package com.retroarch.browser.debug;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.provider.Settings;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import com.retroarch.browser.mainmenu.MainMenuActivity;
|
|
||||||
import com.retroarch.browser.preferences.util.UserPreferences;
|
|
||||||
import com.retroarch.browser.retroactivity.RetroActivityPast;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This activity allows developers to sideload and run a core
|
|
||||||
* from their PC through adb
|
|
||||||
*
|
|
||||||
* Usage : see Phoenix Gradle Build README.md
|
|
||||||
*/
|
|
||||||
public class CoreSideloadActivity extends Activity
|
|
||||||
{
|
|
||||||
private static final String EXTRA_CORE = "LIBRETRO";
|
|
||||||
private static final String EXTRA_CONTENT = "ROM";
|
|
||||||
|
|
||||||
private TextView textView;
|
|
||||||
private CoreSideloadWorkerTask workerThread;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
// The most simple layout is no layout at all
|
|
||||||
textView = new TextView(this);
|
|
||||||
setContentView(textView);
|
|
||||||
|
|
||||||
// Check that we have at least the core extra
|
|
||||||
if (!getIntent().hasExtra(EXTRA_CORE))
|
|
||||||
{
|
|
||||||
textView.setText("Missing extra \"LIBRETRO\"");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start our worker thread
|
|
||||||
workerThread = new CoreSideloadWorkerTask(this, textView, getIntent().getStringExtra(EXTRA_CORE), getIntent().getStringExtra(EXTRA_CONTENT));
|
|
||||||
workerThread.execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onDestroy() {
|
|
||||||
if (workerThread != null)
|
|
||||||
{
|
|
||||||
workerThread.cancel(true);
|
|
||||||
workerThread = null;
|
|
||||||
}
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class CoreSideloadWorkerTask extends AsyncTask<Void, Integer, String>
|
|
||||||
{
|
|
||||||
private TextView progressTextView;
|
|
||||||
private String core;
|
|
||||||
private String content;
|
|
||||||
private Activity ctx;
|
|
||||||
private File destination;
|
|
||||||
|
|
||||||
public CoreSideloadWorkerTask(Activity ctx, TextView progressTextView, String corePath, String contentPath)
|
|
||||||
{
|
|
||||||
this.progressTextView = progressTextView;
|
|
||||||
this.core = corePath;
|
|
||||||
this.ctx = ctx;
|
|
||||||
this.content = contentPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPreExecute() {
|
|
||||||
super.onPreExecute();
|
|
||||||
progressTextView.setText("Sideloading...");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String doInBackground(Void... voids) {
|
|
||||||
File coreFile = new File(core);
|
|
||||||
File corePath = new File(UserPreferences.getPreferences(ctx).getString("libretro_path", ctx.getApplicationInfo().dataDir + "/cores/"));
|
|
||||||
|
|
||||||
// Check that both files exist
|
|
||||||
if (!coreFile.exists())
|
|
||||||
return "Input file doesn't exist (" + core + ")";
|
|
||||||
|
|
||||||
if (!corePath.exists())
|
|
||||||
return "Destination directory doesn't exist (" + corePath.getAbsolutePath() + ")";
|
|
||||||
|
|
||||||
destination = new File(corePath, coreFile.getName());
|
|
||||||
|
|
||||||
// Copy it
|
|
||||||
Log.d("sideload", "Copying " + coreFile.getAbsolutePath() + " to " + destination.getAbsolutePath());
|
|
||||||
long copied = 0;
|
|
||||||
long max = coreFile.length();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
InputStream is = new FileInputStream(coreFile);
|
|
||||||
OutputStream os = new FileOutputStream(destination);
|
|
||||||
|
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
int length;
|
|
||||||
|
|
||||||
while ((length = is.read(buf)) > 0)
|
|
||||||
{
|
|
||||||
os.write(buf, 0, length);
|
|
||||||
|
|
||||||
copied += length;
|
|
||||||
publishProgress((int)(copied / max * 100));
|
|
||||||
}
|
|
||||||
|
|
||||||
is.close();
|
|
||||||
os.close();
|
|
||||||
}
|
|
||||||
catch (IOException ex)
|
|
||||||
{
|
|
||||||
ex.printStackTrace();
|
|
||||||
return ex.getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onProgressUpdate(Integer... values) {
|
|
||||||
super.onProgressUpdate(values);
|
|
||||||
|
|
||||||
if (values.length > 0)
|
|
||||||
progressTextView.setText("Sideloading: " + values[0] + "%");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onPostExecute(String s) {
|
|
||||||
super.onPostExecute(s);
|
|
||||||
|
|
||||||
// Everything went as expected
|
|
||||||
if (s == null)
|
|
||||||
{
|
|
||||||
progressTextView.setText("Done!");
|
|
||||||
|
|
||||||
// Run RA with our newly sideloaded core (and content)
|
|
||||||
Intent retro = new Intent(ctx, RetroActivityPast.class);
|
|
||||||
|
|
||||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx);
|
|
||||||
|
|
||||||
retro.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
||||||
|
|
||||||
Log.d("sideload", "Running RetroArch with core " + destination.getAbsolutePath());
|
|
||||||
|
|
||||||
MainMenuActivity.startRetroActivity(
|
|
||||||
retro,
|
|
||||||
content,
|
|
||||||
destination.getAbsolutePath(),
|
|
||||||
UserPreferences.getDefaultConfigPath(ctx),
|
|
||||||
Settings.Secure.getString(ctx.getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD),
|
|
||||||
ctx.getApplicationInfo().dataDir,
|
|
||||||
ctx.getApplicationInfo().sourceDir);
|
|
||||||
|
|
||||||
ctx.startActivity(retro);
|
|
||||||
ctx.finish();
|
|
||||||
}
|
|
||||||
// An error occured
|
|
||||||
else
|
|
||||||
{
|
|
||||||
progressTextView.setText("Error: " + s);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,191 +0,0 @@
|
|||||||
package com.retroarch.browser.mainmenu;
|
|
||||||
|
|
||||||
import com.retroarch.browser.preferences.util.UserPreferences;
|
|
||||||
import com.retroarch.browser.retroactivity.RetroActivityPast;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.pm.ApplicationInfo;
|
|
||||||
import android.media.AudioManager;
|
|
||||||
import android.os.Build;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.os.Environment;
|
|
||||||
import android.preference.PreferenceActivity;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
import android.provider.Settings;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.Manifest;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.app.AlertDialog;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* {@link PreferenceActivity} subclass that provides all of the
|
|
||||||
* functionality of the main menu screen.
|
|
||||||
*/
|
|
||||||
public final class MainMenuActivity extends PreferenceActivity
|
|
||||||
{
|
|
||||||
final private int REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS = 124;
|
|
||||||
public static String PACKAGE_NAME;
|
|
||||||
boolean checkPermissions = false;
|
|
||||||
|
|
||||||
public void showMessageOKCancel(String message, DialogInterface.OnClickListener onClickListener)
|
|
||||||
{
|
|
||||||
new AlertDialog.Builder(this).setMessage(message)
|
|
||||||
.setPositiveButton("OK", onClickListener).setCancelable(false)
|
|
||||||
.setNegativeButton("Cancel", null).create().show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean addPermission(List<String> permissionsList, String permission)
|
|
||||||
{
|
|
||||||
if (checkSelfPermission(permission) != PackageManager.PERMISSION_GRANTED)
|
|
||||||
{
|
|
||||||
permissionsList.add(permission);
|
|
||||||
|
|
||||||
// Check for Rationale Option
|
|
||||||
if (!shouldShowRequestPermissionRationale(permission))
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void checkRuntimePermissions()
|
|
||||||
{
|
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 23)
|
|
||||||
{
|
|
||||||
// Android 6.0+ needs runtime permission checks
|
|
||||||
List<String> permissionsNeeded = new ArrayList<String>();
|
|
||||||
final List<String> permissionsList = new ArrayList<String>();
|
|
||||||
|
|
||||||
if (!addPermission(permissionsList, Manifest.permission.READ_EXTERNAL_STORAGE))
|
|
||||||
permissionsNeeded.add("Read External Storage");
|
|
||||||
if (!addPermission(permissionsList, Manifest.permission.WRITE_EXTERNAL_STORAGE))
|
|
||||||
permissionsNeeded.add("Write External Storage");
|
|
||||||
|
|
||||||
if (permissionsList.size() > 0)
|
|
||||||
{
|
|
||||||
checkPermissions = true;
|
|
||||||
|
|
||||||
if (permissionsNeeded.size() > 0)
|
|
||||||
{
|
|
||||||
// Need Rationale
|
|
||||||
Log.i("MainMenuActivity", "Need to request external storage permissions.");
|
|
||||||
|
|
||||||
String message = "You need to grant access to " + permissionsNeeded.get(0);
|
|
||||||
|
|
||||||
for (int i = 1; i < permissionsNeeded.size(); i++)
|
|
||||||
message = message + ", " + permissionsNeeded.get(i);
|
|
||||||
|
|
||||||
showMessageOKCancel(message,
|
|
||||||
new DialogInterface.OnClickListener()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void onClick(DialogInterface dialog, int which)
|
|
||||||
{
|
|
||||||
if (which == AlertDialog.BUTTON_POSITIVE)
|
|
||||||
{
|
|
||||||
requestPermissions(permissionsList.toArray(new String[permissionsList.size()]),
|
|
||||||
REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);
|
|
||||||
|
|
||||||
Log.i("MainMenuActivity", "User accepted request for external storage permissions.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
requestPermissions(permissionsList.toArray(new String[permissionsList.size()]),
|
|
||||||
REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS);
|
|
||||||
|
|
||||||
Log.i("MainMenuActivity", "Requested external storage permissions.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!checkPermissions)
|
|
||||||
{
|
|
||||||
finalStartup();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void finalStartup()
|
|
||||||
{
|
|
||||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
|
|
||||||
Intent retro = new Intent(this, RetroActivityPast.class);
|
|
||||||
|
|
||||||
retro.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
||||||
|
|
||||||
startRetroActivity(
|
|
||||||
retro,
|
|
||||||
null,
|
|
||||||
prefs.getString("libretro_path", getApplicationInfo().dataDir + "/cores/"),
|
|
||||||
UserPreferences.getDefaultConfigPath(this),
|
|
||||||
Settings.Secure.getString(getContentResolver(), Settings.Secure.DEFAULT_INPUT_METHOD),
|
|
||||||
getApplicationInfo().dataDir,
|
|
||||||
getApplicationInfo().sourceDir);
|
|
||||||
startActivity(retro);
|
|
||||||
finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)
|
|
||||||
{
|
|
||||||
switch (requestCode)
|
|
||||||
{
|
|
||||||
case REQUEST_CODE_ASK_MULTIPLE_PERMISSIONS:
|
|
||||||
for (int i = 0; i < permissions.length; i++)
|
|
||||||
{
|
|
||||||
if(grantResults[i] == PackageManager.PERMISSION_GRANTED)
|
|
||||||
{
|
|
||||||
Log.i("MainMenuActivity", "Permission: " + permissions[i] + " was granted.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Log.i("MainMenuActivity", "Permission: " + permissions[i] + " was not granted.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
finalStartup();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void startRetroActivity(Intent retro, String contentPath, String corePath,
|
|
||||||
String configFilePath, String imePath, String dataDirPath, String dataSourcePath)
|
|
||||||
{
|
|
||||||
if (contentPath != null) {
|
|
||||||
retro.putExtra("ROM", contentPath);
|
|
||||||
}
|
|
||||||
retro.putExtra("LIBRETRO", corePath);
|
|
||||||
retro.putExtra("CONFIGFILE", configFilePath);
|
|
||||||
retro.putExtra("IME", imePath);
|
|
||||||
retro.putExtra("DATADIR", dataDirPath);
|
|
||||||
retro.putExtra("APK", dataSourcePath);
|
|
||||||
retro.putExtra("SDCARD", Environment.getExternalStorageDirectory().getAbsolutePath());
|
|
||||||
String external = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Android/data/" + PACKAGE_NAME + "/files";
|
|
||||||
retro.putExtra("EXTERNAL", external);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState)
|
|
||||||
{
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
|
|
||||||
PACKAGE_NAME = getPackageName();
|
|
||||||
|
|
||||||
// Bind audio stream to hardware controls.
|
|
||||||
setVolumeControlStream(AudioManager.STREAM_MUSIC);
|
|
||||||
|
|
||||||
UserPreferences.updateConfigFile(this);
|
|
||||||
|
|
||||||
checkRuntimePermissions();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,315 +0,0 @@
|
|||||||
package com.retroarch.browser.retroactivity;
|
|
||||||
|
|
||||||
import com.google.android.gms.common.ConnectionResult;
|
|
||||||
import com.google.android.gms.common.GooglePlayServicesClient.ConnectionCallbacks;
|
|
||||||
import com.google.android.gms.common.GooglePlayServicesClient.OnConnectionFailedListener;
|
|
||||||
import com.google.android.gms.location.LocationClient;
|
|
||||||
import com.google.android.gms.location.LocationListener;
|
|
||||||
import com.google.android.gms.location.LocationRequest;
|
|
||||||
import com.retroarch.browser.preferences.util.UserPreferences;
|
|
||||||
|
|
||||||
import android.app.NativeActivity;
|
|
||||||
import android.content.IntentSender;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.location.Location;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class that implements location-based functionality for
|
|
||||||
* the {@link RetroActivityFuture} activity.
|
|
||||||
*/
|
|
||||||
public class RetroActivityLocation extends NativeActivity
|
|
||||||
implements ConnectionCallbacks, OnConnectionFailedListener, LocationListener
|
|
||||||
{
|
|
||||||
/* LOCATION VARIABLES */
|
|
||||||
private static int CONNECTION_FAILURE_RESOLUTION_REQUEST = 0;
|
|
||||||
private LocationClient mLocationClient = null;
|
|
||||||
private Location mCurrentLocation;
|
|
||||||
|
|
||||||
// Define an object that holds accuracy and frequency parameters
|
|
||||||
LocationRequest mLocationRequest = null;
|
|
||||||
boolean mUpdatesRequested = false;
|
|
||||||
boolean locationChanged = false;
|
|
||||||
boolean location_service_running = false;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by Location Services when the request to connect the
|
|
||||||
* client finishes successfully. At this point, you can
|
|
||||||
* request the current location or start periodic updates
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onConnected(Bundle dataBundle)
|
|
||||||
{
|
|
||||||
if (mLocationClient == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Display the connection status
|
|
||||||
Toast.makeText(this, "Connected", Toast.LENGTH_SHORT).show();
|
|
||||||
location_service_running = true;
|
|
||||||
|
|
||||||
// If already requested, start periodic updates
|
|
||||||
if (mUpdatesRequested)
|
|
||||||
{
|
|
||||||
mLocationClient.requestLocationUpdates(mLocationRequest, this, null);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Get last known location
|
|
||||||
mCurrentLocation = mLocationClient.getLastLocation();
|
|
||||||
locationChanged = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by Location Services if the connection to the
|
|
||||||
* location client drops because of an error.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onDisconnected()
|
|
||||||
{
|
|
||||||
if (mLocationClient == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Display the connection status
|
|
||||||
Toast.makeText(this, "Disconnected. Please re-connect.", Toast.LENGTH_SHORT).show();
|
|
||||||
|
|
||||||
// If the client is connected
|
|
||||||
if (mLocationClient.isConnected())
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Remove location updates for a listener.
|
|
||||||
* The current Activity is the listener, so
|
|
||||||
* the argument is "this".
|
|
||||||
*/
|
|
||||||
mLocationClient.removeLocationUpdates(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
location_service_running = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called by Location Services if the attempt to
|
|
||||||
* Location Services fails.
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onConnectionFailed(ConnectionResult connectionResult)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Google Play services can resolve some errors it detects.
|
|
||||||
* If the error has a resolution, try sending an Intent to
|
|
||||||
* start a Google Play services activity that can resolve
|
|
||||||
* error.
|
|
||||||
*/
|
|
||||||
if (connectionResult.hasResolution())
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// Start an Activity that tries to resolve the error
|
|
||||||
connectionResult.startResolutionForResult(this, CONNECTION_FAILURE_RESOLUTION_REQUEST);
|
|
||||||
}
|
|
||||||
catch (IntentSender.SendIntentException e)
|
|
||||||
{
|
|
||||||
// Thrown if Google Play services cancelled the original PendingIntent
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* If no resolution is available, display a dialog to the
|
|
||||||
* user with the error.
|
|
||||||
*/
|
|
||||||
Log.e("Connection failed", "error code: " + connectionResult.getErrorCode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the update interval at which location-based updates
|
|
||||||
* should occur
|
|
||||||
*/
|
|
||||||
public void onLocationSetInterval(int update_interval_in_ms, int distance_interval)
|
|
||||||
{
|
|
||||||
// Use high accuracy
|
|
||||||
if (mLocationRequest == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
|
||||||
|
|
||||||
if (update_interval_in_ms == 0)
|
|
||||||
mLocationRequest.setInterval(5 * 1000); // 5 seconds
|
|
||||||
else
|
|
||||||
mLocationRequest.setInterval(update_interval_in_ms);
|
|
||||||
|
|
||||||
// Set the fastest update interval to 1 second
|
|
||||||
mLocationRequest.setFastestInterval(1000);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initializing methods for location based functionality.
|
|
||||||
*/
|
|
||||||
public void onLocationInit()
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Create a new location client, using the enclosing class to
|
|
||||||
* handle callbacks.
|
|
||||||
*/
|
|
||||||
if (mLocationClient == null)
|
|
||||||
mLocationClient = new LocationClient(this, this, this);
|
|
||||||
|
|
||||||
// Start with updates turned off
|
|
||||||
mUpdatesRequested = false;
|
|
||||||
|
|
||||||
// Create the LocationRequest object
|
|
||||||
if (mLocationRequest == null)
|
|
||||||
mLocationRequest = LocationRequest.create();
|
|
||||||
|
|
||||||
onLocationSetInterval(0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Executed upon starting the {@link LocationClient}.
|
|
||||||
*/
|
|
||||||
public void onLocationStart()
|
|
||||||
{
|
|
||||||
if (mLocationClient == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
mUpdatesRequested = true;
|
|
||||||
|
|
||||||
// Connect the client.
|
|
||||||
mLocationClient.connect();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Free up location services resources.
|
|
||||||
*/
|
|
||||||
public void onLocationFree()
|
|
||||||
{
|
|
||||||
/* TODO/FIXME */
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Executed upon stopping the location client.
|
|
||||||
* Does nothing if called when the client is not started.
|
|
||||||
*/
|
|
||||||
public void onLocationStop()
|
|
||||||
{
|
|
||||||
// Disconnecting the client invalidates it.
|
|
||||||
if (mLocationClient != null && mUpdatesRequested)
|
|
||||||
mLocationClient.disconnect();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the latitude at the current location in degrees.
|
|
||||||
*
|
|
||||||
* @return the latitude at the current location.
|
|
||||||
*/
|
|
||||||
public double onLocationGetLatitude()
|
|
||||||
{
|
|
||||||
return mCurrentLocation.getLatitude();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the longitude at the current location in degrees.
|
|
||||||
*
|
|
||||||
* @return the longitude at the current location.
|
|
||||||
*/
|
|
||||||
public double onLocationGetLongitude()
|
|
||||||
{
|
|
||||||
return mCurrentLocation.getLongitude();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the horizontal accuracy of the current location
|
|
||||||
* in meters. (NOTE: There seems to be no vertical accuracy
|
|
||||||
* for a given location with the Android location API)
|
|
||||||
*
|
|
||||||
* @return the horizontal accuracy of the current position.
|
|
||||||
*/
|
|
||||||
public double onLocationGetHorizontalAccuracy()
|
|
||||||
{
|
|
||||||
return mCurrentLocation.getAccuracy();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tells us whether the location listener callback has
|
|
||||||
* updated the current location since the last time
|
|
||||||
* we polled.
|
|
||||||
*
|
|
||||||
* @return true if location has changed, false if location has not changed.
|
|
||||||
*/
|
|
||||||
public boolean onLocationHasChanged()
|
|
||||||
{
|
|
||||||
boolean hasChanged = locationChanged;
|
|
||||||
|
|
||||||
// Reset flag
|
|
||||||
if (hasChanged)
|
|
||||||
locationChanged = false;
|
|
||||||
|
|
||||||
return hasChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Define the callback method that receives location updates
|
|
||||||
@Override
|
|
||||||
public void onLocationChanged(Location location)
|
|
||||||
{
|
|
||||||
if (!location_service_running)
|
|
||||||
return;
|
|
||||||
|
|
||||||
locationChanged = true;
|
|
||||||
mCurrentLocation = location;
|
|
||||||
|
|
||||||
// Report to the UI that the location was updated
|
|
||||||
String msg = "Updated Location: " + location.getLatitude() + ", " + location.getLongitude();
|
|
||||||
Log.i("RetroArch GPS", msg);
|
|
||||||
//Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onPause()
|
|
||||||
{
|
|
||||||
// Save the current setting for updates
|
|
||||||
SharedPreferences prefs = UserPreferences.getPreferences(this);
|
|
||||||
SharedPreferences.Editor edit = prefs.edit();
|
|
||||||
edit.putBoolean("LOCATION_UPDATES_ON", mUpdatesRequested);
|
|
||||||
edit.apply();
|
|
||||||
|
|
||||||
super.onPause();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume()
|
|
||||||
{
|
|
||||||
SharedPreferences prefs = UserPreferences.getPreferences(this);
|
|
||||||
SharedPreferences.Editor edit = prefs.edit();
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Get any previous setting for location updates
|
|
||||||
* Gets "false" if an error occurs
|
|
||||||
*/
|
|
||||||
if (prefs.contains("LOCATION_UPDATES_ON"))
|
|
||||||
{
|
|
||||||
mUpdatesRequested = prefs.getBoolean("LOCATION_UPDATES_ON", false);
|
|
||||||
if (mUpdatesRequested)
|
|
||||||
location_service_running = true;
|
|
||||||
}
|
|
||||||
else // Otherwise, turn off location updates
|
|
||||||
{
|
|
||||||
edit.putBoolean("LOCATION_UPDATES_ON", false);
|
|
||||||
edit.apply();
|
|
||||||
location_service_running = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
super.onResume();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStop()
|
|
||||||
{
|
|
||||||
onLocationStop();
|
|
||||||
super.onStop();
|
|
||||||
}
|
|
||||||
}
|
|
8
pkg/android/phoenix/.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
.gradle
|
/gen
|
||||||
.externalNativeBuild
|
/bin
|
||||||
build
|
/libs/*/*.so
|
||||||
|
/obj
|
||||||
|
/jni/modules/*.so
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<!-- <!DOCTYPE manifest [ <!ENTITY % versionDTD SYSTEM "../../../version.dtd"> %versionDTD; ]> !-->
|
<!-- <!DOCTYPE manifest [ <!ENTITY % versionDTD SYSTEM "../../../version.dtd"> %versionDTD; ]> !-->
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
|
||||||
package="com.retroarch"
|
package="com.retroarch"
|
||||||
android:versionCode="1556806339"
|
android:versionCode="1556806339"
|
||||||
android:versionName="1.7.7"
|
android:versionName="1.7.7"
|
||||||
@ -9,15 +8,13 @@
|
|||||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
|
<uses-feature android:name="android.hardware.touchscreen" android:required="false"/>
|
||||||
<uses-feature android:name="android.software.leanback" android:required="false" />
|
<uses-feature android:name="android.software.leanback" android:required="false" />
|
||||||
<uses-feature android:name="android.hardware.gamepad" android:required="false"/>
|
<uses-feature android:name="android.hardware.gamepad" android:required="false"/>
|
||||||
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="16"
|
android:minSdkVersion="9"
|
||||||
android:targetSdkVersion="28" />
|
android:targetSdkVersion="26" />
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.VIBRATE" />
|
<uses-permission android:name="android.permission.VIBRATE" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@ -25,8 +22,7 @@
|
|||||||
android:label="RetroArch"
|
android:label="RetroArch"
|
||||||
android:hasCode="true"
|
android:hasCode="true"
|
||||||
android:isGame="true"
|
android:isGame="true"
|
||||||
android:banner="@drawable/banner"
|
android:banner="@drawable/banner">
|
||||||
tools:ignore="UnusedAttribute">
|
|
||||||
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
|
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
|
||||||
<activity android:name="com.retroarch.browser.mainmenu.MainMenuActivity" android:exported="true" android:launchMode="singleInstance">
|
<activity android:name="com.retroarch.browser.mainmenu.MainMenuActivity" android:exported="true" android:launchMode="singleInstance">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
@ -40,6 +36,10 @@
|
|||||||
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />
|
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />
|
||||||
<meta-data android:name="android.app.func_name" android:value="ANativeActivity_onCreate" />
|
<meta-data android:name="android.app.func_name" android:value="ANativeActivity_onCreate" />
|
||||||
</activity>
|
</activity>
|
||||||
|
<activity android:name="com.retroarch.browser.retroactivity.RetroActivityPast" android:exported="true" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:launchMode="singleInstance">
|
||||||
|
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />
|
||||||
|
<meta-data android:name="android.app.func_name" android:value="ANativeActivity_onCreate" />
|
||||||
|
</activity>
|
||||||
<activity android:name="com.retroarch.browser.debug.CoreSideloadActivity" android:exported="true"/>
|
<activity android:name="com.retroarch.browser.debug.CoreSideloadActivity" android:exported="true"/>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
@ -1,99 +0,0 @@
|
|||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
jcenter()
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
classpath "com.android.tools.build:gradle:3.4.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
google()
|
|
||||||
jcenter()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: 'com.android.application'
|
|
||||||
|
|
||||||
android {
|
|
||||||
compileSdkVersion 28
|
|
||||||
buildToolsVersion "28.0.3"
|
|
||||||
|
|
||||||
flavorDimensions "variant"
|
|
||||||
|
|
||||||
defaultConfig {
|
|
||||||
externalNativeBuild {
|
|
||||||
ndkBuild {
|
|
||||||
arguments "-j${Runtime.runtime.availableProcessors()}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
productFlavors {
|
|
||||||
normal {
|
|
||||||
dimension "variant"
|
|
||||||
}
|
|
||||||
aarch64 {
|
|
||||||
applicationIdSuffix '.aarch64'
|
|
||||||
resValue "string", "app_name", "RetroArch (AArch64)"
|
|
||||||
|
|
||||||
dimension "variant"
|
|
||||||
ndk {
|
|
||||||
abiFilters 'arm64-v8a', 'x86_64'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ra32 {
|
|
||||||
applicationIdSuffix '.ra32'
|
|
||||||
resValue "string", "app_name", "RetroArch (32-bit)"
|
|
||||||
|
|
||||||
dimension "variant"
|
|
||||||
ndk {
|
|
||||||
abiFilters 'armeabi-v7a', 'x86'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets {
|
|
||||||
main {
|
|
||||||
manifest.srcFile 'AndroidManifest.xml'
|
|
||||||
assets.srcDirs = ['assets']
|
|
||||||
java.srcDirs = ['src', '../phoenix-common/src']
|
|
||||||
jniLibs.srcDir '../phoenix-common/libs'
|
|
||||||
jni.srcDirs = []
|
|
||||||
res.srcDirs = ['../phoenix-common/res']
|
|
||||||
}
|
|
||||||
aarch64 {
|
|
||||||
res.srcDirs = ['res64']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
externalNativeBuild {
|
|
||||||
ndkBuild {
|
|
||||||
path '../phoenix-common/jni/Android.mk'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
signingConfigs {
|
|
||||||
if (project.hasProperty("RELEASE_STORE_FILE")) {
|
|
||||||
release {
|
|
||||||
storeFile file(RELEASE_STORE_FILE)
|
|
||||||
storePassword RELEASE_STORE_PASSWORD
|
|
||||||
keyAlias RELEASE_KEY_ALIAS
|
|
||||||
keyPassword RELEASE_KEY_PASSWORD
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
buildTypes {
|
|
||||||
release {
|
|
||||||
signingConfig signingConfigs.release
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation 'com.google.android.gms:play-services-location:16.0.0'
|
|
||||||
}
|
|
@ -100,7 +100,7 @@ LOCAL_CPPFLAGS := -fexceptions -fpermissive -std=gnu++11 -fno-rtti -Wno-reorder
|
|||||||
# Let ndk-build set the optimization flags but remove -O3 like in cf3c3
|
# Let ndk-build set the optimization flags but remove -O3 like in cf3c3
|
||||||
LOCAL_CFLAGS := $(subst -O3,-O2,$(LOCAL_CFLAGS))
|
LOCAL_CFLAGS := $(subst -O3,-O2,$(LOCAL_CFLAGS))
|
||||||
|
|
||||||
LOCAL_LDLIBS := -landroid -lEGL $(GLES_LIB) $(LOGGER_LDLIBS) -ldl
|
LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -landroid -lEGL $(GLES_LIB) $(LOGGER_LDLIBS) -ldl
|
||||||
LOCAL_C_INCLUDES := \
|
LOCAL_C_INCLUDES := \
|
||||||
$(LOCAL_PATH)/$(RARCH_DIR)/libretro-common/include/ \
|
$(LOCAL_PATH)/$(RARCH_DIR)/libretro-common/include/ \
|
||||||
$(LOCAL_PATH)/$(RARCH_DIR)/deps \
|
$(LOCAL_PATH)/$(RARCH_DIR)/deps \
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 841 B After Width: | Height: | Size: 841 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 751 B After Width: | Height: | Size: 751 B |
Before Width: | Height: | Size: 581 B After Width: | Height: | Size: 581 B |
Before Width: | Height: | Size: 996 B After Width: | Height: | Size: 996 B |
Before Width: | Height: | Size: 789 B After Width: | Height: | Size: 789 B |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |