Browse Source

适配安卓32

lvjincheng 3 years ago
parent
commit
7a1ab7d543

+ 35 - 1
Assets/Plugins/Android/AndroidManifest.xml

@@ -2,7 +2,7 @@
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal">
   <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
   <application android:theme="@style/UnityThemeSelector" android:icon="@mipmap/app_icon" android:label="@string/app_name">
-    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name">
+    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:exported="true">
       <intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED" />
@@ -10,6 +10,40 @@
       </intent-filter>
       <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
     </activity>
+
+    <service
+        android:name="com.hpplay.sdk.source.process.LelinkSdkService"
+        android:exported="true"
+        tools:replace="android:exported"
+        android:process=":lelinkps" >
+        <intent-filter>
+            <action android:name="com.hpplay.sdk.source.LelinkSdkService.ACTION" />
+        </intent-filter>
+    </service>
+
+    <activity
+        android:name="com.hpplay.sdk.source.permission.PermissionBridgeActivity"
+        android:excludeFromRecents="true"
+        android:exported="false"
+        android:process=":lelinkps"
+        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
+
+    <service
+        android:name="com.hpplay.component.screencapture.ScreenCaptureService"
+        android:exported="false"
+        android:foregroundServiceType="mediaProjection"
+        android:process=":lelinkps" />
+
+    <receiver
+        android:name="com.hpplay.sdk.source.process.LelinkReceiver"
+        android:exported="true"
+        tools:replace="android:exported"
+        android:process=":lelinkps" >
+        <intent-filter>
+            <action android:name="com.hpplay.source.service.close" />
+        </intent-filter>
+    </receiver>
+
   </application>
   <uses-permission android:name="android.permission.BLUETOOTH" />
   <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

+ 0 - 45
Assets/Plugins/Android/AndroidManifest.xml.backup

@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.unity3d.player"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:installLocation="preferExternal">
-
-    <uses-sdk
-        android:minSdkVersion="16"
-        android:targetSdkVersion="28" />
-        
-    <supports-screens
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:largeScreens="true"
-        android:xlargeScreens="true"
-        android:anyDensity="true"/>
-
-    <application
-        android:theme="@style/UnityThemeSelector"
-        android:icon="@mipmap/app_icon"
-        android:label="@string/app_name">
-        <activity android:name="com.unity3d.player.UnityPlayerActivity"
-                  android:label="@string/app_name">
-            <intent-filter>
-                <action android:name="android.intent.action.MAIN" />
-                <action android:name="android.bluetooth.device.action.ACL_DISCONNECTED" />
-                <category android:name="android.intent.category.LAUNCHER" />
-            </intent-filter>
-            <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
-        </activity>
-    </application>
-    
-    <uses-permission android:name="android.permission.BLUETOOTH" />
-    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
-    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
-    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
-    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
-    <uses-permission-sdk-23 android:name="android.permission.BLUETOOTH" />
-    <uses-permission-sdk-23 android:name="android.permission.ACCESS_COARSE_LOCATION" />
-    
-    <uses-feature
-        android:name="android.hardware.bluetooth_le"
-        android:required="true" />
-</manifest>

+ 62 - 0
Assets/Plugins/Android/launcherTemplate.gradle

@@ -0,0 +1,62 @@
+// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
+
+apply plugin: 'com.android.application'
+
+dependencies {
+    implementation project(':unityLibrary')
+    }
+
+android {
+    // compileSdkVersion **APIVERSION**
+    compileSdkVersion 30
+    buildToolsVersion '**BUILDTOOLS**'
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+
+    defaultConfig {
+        minSdkVersion **MINSDKVERSION**
+        targetSdkVersion **TARGETSDKVERSION**
+        applicationId '**APPLICATIONID**'
+        ndk {
+            abiFilters **ABIFILTERS**
+        }
+        versionCode **VERSIONCODE**
+        versionName '**VERSIONNAME**'
+    }
+
+    aaptOptions {
+        noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
+        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
+    }**SIGN**
+
+    lintOptions {
+        abortOnError false
+    }
+
+    buildTypes {
+        debug {
+            minifyEnabled **MINIFY_DEBUG**
+            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
+            jniDebuggable true
+        }
+        release {
+            minifyEnabled **MINIFY_RELEASE**
+            proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG**
+        }
+    }**PACKAGING_OPTIONS****SPLITS**
+**BUILT_APK_LOCATION**
+    bundle {
+        language {
+            enableSplit = false
+        }
+        density {
+            enableSplit = false
+        }
+        abi {
+            enableSplit = true
+        }
+    }
+}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP**

+ 1 - 1
Assets/Plugins/Android/AndroidManifest.xml.backup.meta → Assets/Plugins/Android/launcherTemplate.gradle.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: f56e56d5f4236e94cbbf26dbfc6a9fae
+guid: b264ccaf026c0c44f901ca60a990abe1
 DefaultImporter:
   externalObjects: {}
   userData: 

+ 42 - 0
Assets/Plugins/Android/mainTemplate.gradle

@@ -0,0 +1,42 @@
+// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN
+
+apply plugin: 'com.android.library'
+**APPLY_PLUGINS**
+
+dependencies {
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
+**DEPS**}
+
+android {
+    // compileSdkVersion **APIVERSION**
+    compileSdkVersion 30
+    buildToolsVersion '**BUILDTOOLS**'
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+
+    defaultConfig {
+        minSdkVersion **MINSDKVERSION**
+        targetSdkVersion **TARGETSDKVERSION**
+        ndk {
+            abiFilters **ABIFILTERS**
+        }
+        versionCode **VERSIONCODE**
+        versionName '**VERSIONNAME**'
+        consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
+    }
+
+    lintOptions {
+        abortOnError false
+    }
+
+    aaptOptions {
+        noCompress = ['.ress', '.resource', '.obb'] + unityStreamingAssets.tokenize(', ')
+        ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~"
+    }**PACKAGING_OPTIONS**
+}**REPOSITORIES**
+**IL_CPP_BUILD_SETUP**
+**SOURCE_BUILD_SETUP**
+**EXTERNAL_SOURCES**

+ 7 - 0
Assets/Plugins/Android/mainTemplate.gradle.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: f914827e670667b46b001eb7b0155faf
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 3 - 3
ProjectSettings/ProjectSettings.asset

@@ -161,7 +161,7 @@ PlayerSettings:
   overrideDefaultApplicationIdentifier: 1
   AndroidBundleVersionCode: 1
   AndroidMinSdkVersion: 19
-  AndroidTargetSdkVersion: 29
+  AndroidTargetSdkVersion: 31
   AndroidPreferredInstallLocation: 1
   aotOptions: 
   stripEngineCode: 1
@@ -237,8 +237,8 @@ PlayerSettings:
   templateDefaultScene: Assets/Scenes/SampleScene.unity
   useCustomMainManifest: 1
   useCustomLauncherManifest: 0
-  useCustomMainGradleTemplate: 0
-  useCustomLauncherGradleManifest: 0
+  useCustomMainGradleTemplate: 1
+  useCustomLauncherGradleManifest: 1
   useCustomBaseGradleTemplate: 0
   useCustomGradlePropertiesTemplate: 0
   useCustomProguardFile: 0