mirror of
https://github.com/astromaddie/lambda1-vr.git
synced 2026-10-17 18:00:12 +02:00
Updated Android API level to 32
improved permission handling request new crowbar pointer sprite
This commit is contained in:
1 parent
482bd03fd1
commit
d6d9ee4d08
9 files changed
+54
-51
No files matched your search
+4
-1
@@ -24,6 +24,8 @@ $RECYCLE.BIN/
|
||||
#model files
|
||||
*.mdl
|
||||
|
||||
*.wav
|
||||
|
||||
#files created by build
|
||||
*.apk
|
||||
*.ap_
|
||||
@@ -36,8 +38,8 @@ Projects/Android/.externalNativeBuild/*
|
||||
Projects/Android/.gradle/*
|
||||
Projects/Android/.idea/codeStyles/Project.xml
|
||||
Projects/.idea/*
|
||||
assets/models
|
||||
.gradle/*
|
||||
assets/*
|
||||
*.json
|
||||
*.bin
|
||||
*.ser
|
||||
@@ -65,3 +67,4 @@ Projects/Android/jni/SupportLibs/liboggvorbis/libs/x86/libvorbis.so
|
||||
build/intermediates/lint-cache/maven.google/com/android/support/group-index.xml
|
||||
build/intermediates/lint-cache/maven.google/master-index.xml
|
||||
build/intermediates/lint-cache/sdk-registry.xml/sdk-registry.xml
|
||||
assets/AoMDC/models/gmgeneral_display.aomdc
|
||||
@@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.drbeef.lambda1vr"
|
||||
android:versionCode="35"
|
||||
android:versionName="1.7.0" android:installLocation="auto" >
|
||||
android:versionName="1.7.0"
|
||||
android:installLocation="auto" >
|
||||
|
||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||
<uses-feature android:glEsVersion="0x00030002" android:required="true"/>
|
||||
@@ -14,15 +16,14 @@
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
|
||||
tools:ignore="AllFilesAccessPolicy,ScopedStorage" />
|
||||
|
||||
|
||||
<application android:allowBackup="false"
|
||||
android:icon="@drawable/ic_lambda1vr"
|
||||
android:label="@string/lambda1vr"
|
||||
android:extractNativeLibs="true"
|
||||
android:requestLegacyExternalStorage="true" >
|
||||
android:extractNativeLibs="true" >
|
||||
|
||||
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
|
||||
|
||||
@@ -34,17 +35,23 @@
|
||||
<!-- Enabling CPU and GPU level trading: -1 = -1 level to gpu, +1 level to cpu -->
|
||||
<!-- CPU needs all the power it can get!! -->
|
||||
<meta-data android:name="com.oculus.trade_cpu_for_gpu_amount" android:value="-1" />
|
||||
<meta-data android:name="com.oculus.vr.focusaware" android:value="true" />
|
||||
|
||||
<!-- PICO XR -->
|
||||
<meta-data android:name="pvr.app.type" android:value="vr" />
|
||||
|
||||
<activity
|
||||
android:exported="true"
|
||||
android:name="com.drbeef.lambda1vr.GLES3JNIActivity"
|
||||
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="landscape"
|
||||
android:excludeFromRecents="false"
|
||||
android:configChanges="screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode">
|
||||
|
||||
<!-- Tell NativeActivity the name of the .so -->
|
||||
<meta-data android:name="android.app.lib_name" android:value="lambda1vr" />
|
||||
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
|
||||
@@ -5,13 +5,16 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.1.3'
|
||||
classpath 'com.android.tools.build:gradle:8.2.1'
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
|
||||
namespace = "com.drbeef.lambda1vr"
|
||||
|
||||
// This is the name of the generated apk file, which will have
|
||||
// -debug.apk or -release.apk appended to it.
|
||||
// The filename doesn't effect the Android installation process.
|
||||
@@ -30,13 +33,13 @@ android {
|
||||
}
|
||||
ndkBuild {
|
||||
def numProcs = Runtime.runtime.availableProcessors()
|
||||
arguments "V=0", "-j$numProcs", "-C$project.buildDir.parent", "APP_PLATFORM=android-29", "NDK_TOOLCHAIN_VERSION=clang", "APP_STL=c++_static"
|
||||
arguments "V=0", "-j$numProcs", "-C$project.buildDir.parent", "APP_PLATFORM=android-32", "NDK_TOOLCHAIN_VERSION=clang", "APP_STL=c++_static"
|
||||
abiFilters 'arm64-v8a'
|
||||
}
|
||||
}
|
||||
|
||||
minSdkVersion 29
|
||||
targetSdkVersion 29
|
||||
minSdkVersion 32
|
||||
targetSdkVersion 32
|
||||
}
|
||||
|
||||
externalNativeBuild {
|
||||
@@ -124,15 +127,16 @@ android {
|
||||
sourceCompatibility = '1.8'
|
||||
targetCompatibility = '1.8'
|
||||
}
|
||||
compileSdkVersion = 29
|
||||
compileSdkVersion = 32
|
||||
buildToolsVersion = '29.0.3'
|
||||
ndkVersion '21.1.6352462'
|
||||
|
||||
ndkVersion '25.1.8937393'
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "com.android.support:support-compat:26.1.0"
|
||||
implementation "com.android.support:support-core-utils:26.1.0"
|
||||
//implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
implementation "com.android.support:support-compat:28.0.0"
|
||||
implementation "com.android.support:support-core-utils:28.0.0"
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
|
||||
}
|
||||
|
||||
repositories {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#Sat Sep 03 13:58:17 BST 2022
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
@@ -0,0 +1,6 @@
|
||||
"Enable Cheats" "sv_cheats 1"
|
||||
"God Mode" "god"
|
||||
"Give Crowbar" "give weapon_crowbar"
|
||||
"Give Suit" "give item_suit"
|
||||
"Give All Weapons" "impulse 101"
|
||||
"No Clip" "noclip"
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
Binary file not shown.
@@ -16,12 +16,16 @@ import java.util.Locale;
|
||||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.AssetManager;
|
||||
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.Settings;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.util.Log;
|
||||
@@ -58,10 +62,8 @@ import static android.system.Os.setenv;
|
||||
|
||||
private static final String TAG = "Lambda1VR";
|
||||
|
||||
private boolean permissionsGranted = false;
|
||||
private static final int REQUEST_MANAGE_ALL_FILES = 2296;
|
||||
|
||||
private static final int READ_EXTERNAL_STORAGE_PERMISSION_ID = 1;
|
||||
private static final int WRITE_EXTERNAL_STORAGE_PERMISSION_ID = 2;
|
||||
|
||||
String commandLineParams;
|
||||
|
||||
@@ -88,47 +90,28 @@ import static android.system.Os.setenv;
|
||||
|
||||
/** Initializes the Activity only if the permission has been granted. */
|
||||
private void checkPermissionsAndInitialize() {
|
||||
// Boilerplate for checking runtime permissions in Android.
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED){
|
||||
ActivityCompat.requestPermissions(
|
||||
GLES3JNIActivity.this,
|
||||
new String[] {Manifest.permission.WRITE_EXTERNAL_STORAGE},
|
||||
WRITE_EXTERNAL_STORAGE_PERMISSION_ID);
|
||||
} else if (ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE)
|
||||
!= PackageManager.PERMISSION_GRANTED){
|
||||
ActivityCompat.requestPermissions(
|
||||
GLES3JNIActivity.this,
|
||||
new String[] {Manifest.permission.READ_EXTERNAL_STORAGE},
|
||||
READ_EXTERNAL_STORAGE_PERMISSION_ID);
|
||||
if (!Environment.isExternalStorageManager()) {
|
||||
//request for the permission
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
startActivityForResult(intent, REQUEST_MANAGE_ALL_FILES);
|
||||
|
||||
finishAffinity(); // Cleanly exit
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
permissionsGranted = true;
|
||||
}
|
||||
|
||||
if (permissionsGranted) {
|
||||
// Permissions have already been granted.
|
||||
create();
|
||||
}
|
||||
}
|
||||
|
||||
/** Handles the user accepting the permission. */
|
||||
@Override
|
||||
public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] results) {
|
||||
if (requestCode == READ_EXTERNAL_STORAGE_PERMISSION_ID) {
|
||||
if (results.length > 0 && results[0] != PackageManager.PERMISSION_GRANTED) {
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (requestCode == WRITE_EXTERNAL_STORAGE_PERMISSION_ID) {
|
||||
if (results.length > 0 && results[0] != PackageManager.PERMISSION_GRANTED) {
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
checkPermissionsAndInitialize();
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
finishAffinity(); // Cleanly exit
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void create()
|
||||
|
||||
Reference in new issue
Block a user