Native code loader for Android
Clone or download
nesterov-n and facebook-github-bot Add support for app bundle (#26)
Summary:
PR is related to #19

**Problem**
SoLoader cannot load `.so`libraries when an application is installed through [App Bundle](https://developer.android.com/platform/technology/app-bundle/) with config:
```
bundle {
    abi {
        enableSplit = true
    }
}
```

The reason is that app bundle installation consists of multiple apks. For instance:
- `base.apk`
- `split_config.arm64_v8a.apk`
- `split_config.xxxhdpi.apk`

`SoLoader` class creates `ApkSoSource` pointing only to  `base.apk`. But `*.so` files exist only in `split_config.arm64_v8a.apk`

**Solution**
Create separate `ApkSoSource` for each apk in the application folder. I couldn't figure out how to filter out apk without lib folder.

**Testing**
I haven't tried this with dynamic feature modules yet. So I can't say that it fully fixes #19. But at least it fixes facebook/fresco#2253
Any help with dynamic modules testing would be much appreciated.

**P.S.**
Due to some reasons, I can't wait for the new release of SoLoader lib, so I have published a temporary patched version to bintray in [my account](https://bintray.com/nnesterov/maven/patched-soloader)
with different grouipId `com.avito.android:patched-soloader:0.1.0`
If you are against publishing your lib in a different account, please let me know. I'll remove my version immediately.
Pull Request resolved: #26

Reviewed By: oprisnik

Differential Revision: D13669370

Pulled By: passy

fbshipit-source-id: dd605bf54662a38cb1fd04461e1e962f76da7d51
Latest commit c7980fc Jan 23, 2019

README.md

SoLoader Build Status

SoLoader is a native code loader for Android. It takes care of unpacking your native libraries and recursively loads dependencies on platforms that don't support that out of the box.

Requirements

SoLoader can be included in any Android application.

Including SoLoader in your apps

You can use prebuilt aars or fetch SoLoader from Maven repository by adding the following to your build.gradle file:

compile 'com.facebook.soloader:soloader:0.1.0+'

Building from source

To build SoLoader from source you'll need Buck. Once you have Buck installed execute following commands from the project root directory:

  buck fetch //...
  buck build :soloader

The build command generates buck-out/gen/soloader.aar file.

Join our community

Please use our issues page to let us know of any problems. See the CONTRIBUTING file for how to help out.

License

SoLoader is Apache-2.0-licensed.