0
0
Fork 0
mirror of https://github.com/YTVanced/VancedMicroG synced 2024-11-28 06:03:00 +00:00

Fix mapbox native library loading if app targets armeabi non-v7a

This commit is contained in:
Marvin W 2019-07-04 23:53:04 +02:00
parent 8a0010a1d8
commit dfb1e7fbb7
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
2 changed files with 5 additions and 4 deletions

View file

@ -35,8 +35,7 @@ class MapFragmentImpl(private val activity: Activity) : IMapFragmentDelegate.Stu
private var map: GoogleMapImpl? = null private var map: GoogleMapImpl? = null
private var options: GoogleMapOptions? = null private var options: GoogleMapOptions? = null
override fun onInflate(activity: IObjectWrapper, options: GoogleMapOptions, savedInstanceState: Bundle) { override fun onInflate(activity: IObjectWrapper, options: GoogleMapOptions, savedInstanceState: Bundle?) {
Log.d(TAG, "onInflate: ${options.camera.target}")
this.options = options this.options = options
map?.options = options map?.options = options
} }
@ -48,7 +47,6 @@ class MapFragmentImpl(private val activity: Activity) : IMapFragmentDelegate.Stu
if (options == null) { if (options == null) {
options = GoogleMapOptions() options = GoogleMapOptions()
} }
Log.d(TAG, "onCreate: ${options?.camera?.target}")
map = GoogleMapImpl(activity, options ?: GoogleMapOptions()) map = GoogleMapImpl(activity, options ?: GoogleMapOptions())
} }

View file

@ -29,7 +29,10 @@ class MultiArchLoader(private val mapContext: Context, private val appContext: C
override fun load(name: String) { override fun load(name: String) {
try { try {
val otherAppInfo = mapContext.packageManager.getApplicationInfo(appContext.packageName, 0) val otherAppInfo = mapContext.packageManager.getApplicationInfo(appContext.packageName, 0)
val primaryCpuAbi = ApplicationInfo::class.java.getField("primaryCpuAbi").get(otherAppInfo) as String? var primaryCpuAbi = ApplicationInfo::class.java.getField("primaryCpuAbi").get(otherAppInfo) as String?
if (primaryCpuAbi == "armeabi") {
primaryCpuAbi = "armeabi-v7a"
}
if (primaryCpuAbi != null) { if (primaryCpuAbi != null) {
val path = "lib/$primaryCpuAbi/lib$name.so" val path = "lib/$primaryCpuAbi/lib$name.so"
val cacheFile = File("${appContext.cacheDir.absolutePath}/.gmscore/$path") val cacheFile = File("${appContext.cacheDir.absolutePath}/.gmscore/$path")