Java Code Examples for com.facebook.soloader.SoLoader

The following are top voted examples for showing how to use com.facebook.soloader.SoLoader. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: RNLearn_Project1   File: BaseJavaModuleTest.java   View source code 6 votes vote down vote up
@Before
public void setup() {
  ModuleHolder moduleHolder = new ModuleHolder("MethodsModule",
    false,
    false,
    false,
    false,
    new Provider<MethodsModule>() {
      MethodsModule mModule;
      @Override
      public MethodsModule get() {
        mModule = new MethodsModule();
        return mModule;
      }
    });
  mWrapper = new JavaModuleWrapper(null, MethodsModule.class, moduleHolder);
  mMethods = mWrapper.getMethodDescriptors();
  PowerMockito.mockStatic(SoLoader.class);
  mArguments = PowerMockito.mock(ReadableNativeArray.class);
}
 
Example 2
Project: fresco   File: StaticWebpNativeLoader.java   View source code 6 votes vote down vote up
public static synchronized void ensure() {
  if (!sInitialized) {
    // On Android 4.1.2 the loading of the static-webp native library can fail because
    // of the dependency with fb_jpegturbo. In this case we have to explicitely load that
    // library
    if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.JELLY_BEAN) {
      try {
        SoLoader.loadLibrary("fb_jpegturbo");
      } catch (UnsatisfiedLinkError error) {
        // Head in the sand
      }
    }
    SoLoader.loadLibrary("static-webp");
    sInitialized = true;
  }
}
 
Example 3
Project: redux-observable   File: App.java   View source code 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    initTimber();
    SoLoader.init(this, false);
    Stetho.initialize(
            Stetho.newInitializerBuilder(this)
                    .enableWebKitInspector(new LithoWebKitInspector(this))
                    .build());
    Fresco.initialize(this);

    appComponent = makeAppComponent();
}
 
Example 4
Project: Patrons   File: ConcealIntPreferenceTest.java   View source code 5 votes vote down vote up
@Before public void setUp() throws Exception {
  SoLoader.init(InstrumentationRegistry.getContext(), false);


  final SharedPreferences prefs =
      PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
  final Crypto crypto = AndroidConceal
      .get()
      .createDefaultCrypto(new SharedPrefsBackedKeyChain(
          InstrumentationRegistry.getContext(),
          CryptoConfig.KEY_256
      ));

  factory = new ConcealPreferenceFactory(crypto, prefs);
}
 
Example 5
Project: Patrons   File: ConcealFloatPreferenceTest.java   View source code 5 votes vote down vote up
@Before public void setUp() throws Exception {
  SoLoader.init(InstrumentationRegistry.getContext(), false);

  prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
  crypto = AndroidConceal
      .get()
      .createDefaultCrypto(new SharedPrefsBackedKeyChain(
          InstrumentationRegistry.getContext(),
          CryptoConfig.KEY_256
      ));
}
 
Example 6
Project: Patrons   File: ConcealStringPreferenceTest.java   View source code 5 votes vote down vote up
@Before public void setUp() throws Exception {
  SoLoader.init(InstrumentationRegistry.getContext(), false);

  prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
  crypto = AndroidConceal
      .get()
      .createDefaultCrypto(new SharedPrefsBackedKeyChain(
          InstrumentationRegistry.getContext(),
          CryptoConfig.KEY_256
      ));
}
 
Example 7
Project: Patrons   File: ConcealBooleanPreferenceTest.java   View source code 5 votes vote down vote up
@Before public void setUp() throws Exception {
  SoLoader.init(InstrumentationRegistry.getContext(), false);

  prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
  crypto = AndroidConceal
      .get()
      .createDefaultCrypto(new SharedPrefsBackedKeyChain(
          InstrumentationRegistry.getContext(),
          CryptoConfig.KEY_256
      ));
}
 
Example 8
Project: Patrons   File: ConcealLongPreferenceTest.java   View source code 5 votes vote down vote up
@Before public void setUp() throws Exception {
  SoLoader.init(InstrumentationRegistry.getContext(), false);

  prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
  crypto = AndroidConceal
      .get()
      .createDefaultCrypto(new SharedPrefsBackedKeyChain(
          InstrumentationRegistry.getContext(),
          CryptoConfig.KEY_256
      ));
}
 
Example 9
Project: Patrons   File: ConcealStringSetPreferenceTest.java   View source code 5 votes vote down vote up
@Before public void setUp() throws Exception {
  SoLoader.init(InstrumentationRegistry.getContext(), false);

  prefs = PreferenceManager.getDefaultSharedPreferences(InstrumentationRegistry.getContext());
  crypto = AndroidConceal
      .get()
      .createDefaultCrypto(new SharedPrefsBackedKeyChain(
          InstrumentationRegistry.getContext(),
          CryptoConfig.KEY_256
      ));
}
 
Example 10
Project: react-native-growingio   File: MainApplication.java   View source code 5 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
  GrowingIO.startWithConfiguration(this, new Configuration()
          .useID()
          .trackAllFragments()
          .setChannel("应用商店"));

}
 
Example 11
Project: react-native-scan-doc   File: MainApplication.java   View source code 5 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
  registerActivityLifecycleCallbacks(new LifecycleCallbacks(){
    @Override
    public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
      scanDocPackage.onActivityCreated(activity);
    }
  });
}
 
Example 12
Project: RNLearn_Project1   File: MainApplication.java   View source code 5 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
    if (!BuildConfig.DEBUG) {
        CrashReport.initCrashReport(getApplicationContext(), "900019562", false);
    }
}
 
Example 13
Project: RNLearn_Project1   File: ReactInstanceManager.java   View source code 5 votes vote down vote up
private static void initializeSoLoaderIfNecessary(Context applicationContext) {
  // Call SoLoader.initialize here, this is required for apps that does not use exopackage and
  // does not use SoLoader for loading other native code except from the one used by React Native
  // This way we don't need to require others to have additional initialization code and to
  // subclass android.app.Application.

  // Method SoLoader.init is idempotent, so if you wish to use native exopackage, just call
  // SoLoader.init with appropriate args before initializing ReactInstanceManager
  SoLoader.init(applicationContext, /* native exopackage */ false);
}
 
Example 14
Project: RNLearn_Project1   File: ReactTestAppShell.java   View source code 5 votes vote down vote up
@Override
protected void onBaseContextAttached() {
  // This is a terrible hack.  Don't copy it.
  // It's unfortunate that Instagram does the same thing.
  // We need to do this here because internal apps use SoLoader,
  // and Open Source Buck uses ExopackageSoLoader.
  // If you feel the need to copy this, we should refactor it
  // into an FB-specific subclass of ExopackageApplication.
  SoLoader.init(this, (ReactBuildConfig.EXOPACKAGE_FLAGS & 2) != 0);
}
 
Example 15
Project: RNLearn_Project1   File: ReactInstanceManager.java   View source code 5 votes vote down vote up
private static void initializeSoLoaderIfNecessary(Context applicationContext) {
  // Call SoLoader.initialize here, this is required for apps that does not use exopackage and
  // does not use SoLoader for loading other native code except from the one used by React Native
  // This way we don't need to require others to have additional initialization code and to
  // subclass android.app.Application.

  // Method SoLoader.init is idempotent, so if you wish to use native exopackage, just call
  // SoLoader.init with appropriate args before initializing ReactInstanceManager
  SoLoader.init(applicationContext, /* native exopackage */ false);
}
 
Example 16
Project: RNLearn_Project1   File: ReactTestAppShell.java   View source code 5 votes vote down vote up
@Override
protected void onBaseContextAttached() {
  // This is a terrible hack.  Don't copy it.
  // It's unfortunate that Instagram does the same thing.
  // We need to do this here because internal apps use SoLoader,
  // and Open Source Buck uses ExopackageSoLoader.
  // If you feel the need to copy this, we should refactor it
  // into an FB-specific subclass of ExopackageApplication.
  SoLoader.init(this, (ReactBuildConfig.EXOPACKAGE_FLAGS & 2) != 0);
}
 
Example 17
Project: ReactNativeSignatureExample   File: ReactInstanceManagerImpl.java   View source code 5 votes vote down vote up
private static void initializeSoLoaderIfNecessary(Context applicationContext) {
  // Call SoLoader.initialize here, this is required for apps that does not use exopackage and
  // does not use SoLoader for loading other native code except from the one used by React Native
  // This way we don't need to require others to have additional initialization code and to
  // subclass android.app.Application.

  // Method SoLoader.init is idempotent, so if you wish to use native exopackage, just call
  // SoLoader.init with appropriate args before initializing ReactInstanceManagerImpl
  SoLoader.init(applicationContext, /* native exopackage */ false);
}
 
Example 18
Project: native-navigation   File: MainApplication.java   View source code 5 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);

  ReactNavigationCoordinator coordinator = ReactNavigationCoordinator.sharedInstance;
  coordinator.injectReactInstanceManager(mReactNativeHost.getReactInstanceManager());
  coordinator.start(this);
}
 
Example 19
Project: react-native-ibeacon-android   File: ReactInstanceManagerImpl.java   View source code 5 votes vote down vote up
private static void initializeSoLoaderIfNecessary(Context applicationContext) {
  // Call SoLoader.initialize here, this is required for apps that does not use exopackage and
  // does not use SoLoader for loading other native code except from the one used by React Native
  // This way we don't need to require others to have additional initialization code and to
  // subclass android.app.Application.

  // Method SoLoader.init is idempotent, so if you wish to use native exopackage, just call
  // SoLoader.init with appropriate args before initializing ReactInstanceManagerImpl
  SoLoader.init(applicationContext, /* native exopackage */ false);
}
 
Example 20
Project: react-native-box-loaders   File: ReactInstanceManagerImpl.java   View source code 5 votes vote down vote up
private static void initializeSoLoaderIfNecessary(Context applicationContext) {
  // Call SoLoader.initialize here, this is required for apps that does not use exopackage and
  // does not use SoLoader for loading other native code except from the one used by React Native
  // This way we don't need to require others to have additional initialization code and to
  // subclass android.app.Application.

  // Method SoLoader.init is idempotent, so if you wish to use native exopackage, just call
  // SoLoader.init with appropriate args before initializing ReactInstanceManagerImpl
  SoLoader.init(applicationContext, /* native exopackage */ false);
}
 
Example 21
Project: Ironman   File: XReactInstanceManagerImpl.java   View source code 5 votes vote down vote up
private static void initializeSoLoaderIfNecessary(Context applicationContext) {
  // Call SoLoader.initialize here, this is required for apps that does not use exopackage and
  // does not use SoLoader for loading other native code except from the one used by React Native
  // This way we don't need to require others to have additional initialization code and to
  // subclass android.app.Application.

  // Method SoLoader.init is idempotent, so if you wish to use native exopackage, just call
  // SoLoader.init with appropriate args before initializing XReactInstanceManagerImpl
  SoLoader.init(applicationContext, /* native exopackage */ false);
}
 
Example 22
Project: Ironman   File: ReactTestAppShell.java   View source code 5 votes vote down vote up
@Override
protected void onBaseContextAttached() {
  // This is a terrible hack.  Don't copy it.
  // It's unfortunate that Instagram does the same thing.
  // We need to do this here because internal apps use SoLoader,
  // and Open Source Buck uses ExopackageSoLoader.
  // If you feel the need to copy this, we should refactor it
  // into an FB-specific subclass of ExopackageApplication.
  SoLoader.init(this, (ReactBuildConfig.EXOPACKAGE_FLAGS & 2) != 0);
}
 
Example 23
Project: fresco   File: Fresco.java   View source code 5 votes vote down vote up
/** Initializes Fresco with the specified config. */
public static void initialize(
    Context context,
    @Nullable ImagePipelineConfig imagePipelineConfig,
    @Nullable DraweeConfig draweeConfig) {
  if (sIsInitialized) {
    FLog.w(
        TAG,
        "Fresco has already been initialized! `Fresco.initialize(...)` should only be called " +
          "1 single time to avoid memory leaks!");
  } else {
    sIsInitialized = true;
  }
  try {
    SoLoader.init(context, 0);
  } catch (IOException e) {
    throw new RuntimeException("Could not initialize SoLoader", e);
  }
  // we should always use the application context to avoid memory leaks
  context = context.getApplicationContext();
  if (imagePipelineConfig == null) {
    ImagePipelineFactory.initialize(context);
  } else {
    ImagePipelineFactory.initialize(imagePipelineConfig);
  }
  initializeDrawee(context, draweeConfig);
}
 
Example 24
Project: FingerPrint-Authentication-With-React-Native-Android   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
}
 
Example 25
Project: react-native-nearby   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 26
Project: react-native-camera-android-simple   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 27
Project: react-native-twitterkit   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
    registerActivityLifecycleCallbacks(this);
}
 
Example 28
Project: ReduxSimple   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 29
Project: react-native-collapsing-toolbar   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 30
Project: react-native-system-setting   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 31
Project: react-native-message-compose   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 32
Project: react-native-andorid-shadow   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 33
Project: yyox   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 34
Project: react-native-gl-model-view   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 35
Project: react-native-gl-model-view   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 36
Project: ReactNativeAndroidAudioConverter   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 37
Project: react-native-recyclerview-list   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 38
Project: react-native-ethereum   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 39
Project: react-native-android-wear-demo   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}
 
Example 40
Project: react-native-settings   File: MainApplication.java   View source code 4 votes vote down vote up
@Override
public void onCreate() {
  super.onCreate();
  SoLoader.init(this, /* native exopackage */ false);
}