Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit dfb1e7fb authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

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

parent 8a0010a1
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -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())
    }

+4 −1
Original line number Diff line number Diff line
@@ -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")