mirror of
https://github.com/YTVanced/VancedMicroG
synced 2024-11-24 12:15:12 +00:00
Fix mapbox native library loading if app targets armeabi non-v7a
This commit is contained in:
parent
8a0010a1d8
commit
dfb1e7fbb7
2 changed files with 5 additions and 4 deletions
|
@ -35,8 +35,7 @@ class MapFragmentImpl(private val activity: Activity) : IMapFragmentDelegate.Stu
|
|||
private var map: GoogleMapImpl? = null
|
||||
private var options: GoogleMapOptions? = null
|
||||
|
||||
override fun onInflate(activity: IObjectWrapper, options: GoogleMapOptions, savedInstanceState: Bundle) {
|
||||
Log.d(TAG, "onInflate: ${options.camera.target}")
|
||||
override fun onInflate(activity: IObjectWrapper, options: GoogleMapOptions, savedInstanceState: Bundle?) {
|
||||
this.options = options
|
||||
map?.options = options
|
||||
}
|
||||
|
@ -48,7 +47,6 @@ class MapFragmentImpl(private val activity: Activity) : IMapFragmentDelegate.Stu
|
|||
if (options == null) {
|
||||
options = GoogleMapOptions()
|
||||
}
|
||||
Log.d(TAG, "onCreate: ${options?.camera?.target}")
|
||||
map = GoogleMapImpl(activity, options ?: GoogleMapOptions())
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,10 @@ class MultiArchLoader(private val mapContext: Context, private val appContext: C
|
|||
override fun load(name: String) {
|
||||
try {
|
||||
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) {
|
||||
val path = "lib/$primaryCpuAbi/lib$name.so"
|
||||
val cacheFile = File("${appContext.cacheDir.absolutePath}/.gmscore/$path")
|
||||
|
|
Loading…
Reference in a new issue