Commit Graph

41 Commits

Author SHA1 Message Date
Conor O'Donnell
d45bc14cce Keep strong reference to OnSharedPreferenceChangeListener (#131)
Summary:
A strong reference to the listener should be kept when calling `registerOnSharedPreferenceChangeListener`, otherwise the listener can get garbage-collected and stop working.

Mentioned in the Android SDK docs [here](https://developer.android.com/reference/android/content/SharedPreferences.html#registerOnSharedPreferenceChangeListener(android.content.SharedPreferences.OnSharedPreferenceChangeListener)):

> Caution: The preference manager does not currently store a strong reference to the listener. You must store a strong reference to the listener, or it will be susceptible to garbage collection. We recommend you keep a reference to the listener in the instance data of an object that will exist as long as you need the listener.
Closes https://github.com/facebook/Sonar/pull/131

Differential Revision: D8751484

Pulled By: xiphirx

fbshipit-source-id: e46715d637c89491770c266fc22c27db41beb042
2018-07-06 13:03:44 -07:00
Edoardo Tognoni
53753801b0 Open source the Sandbox plugin
Summary: This diff is mainly moving diffs around to open source the Sandbox plugin. I created the MD file writing some docs. The rest is just making our own FB implementation work

Reviewed By: danielbuechele

Differential Revision: D8731839

fbshipit-source-id: 27ac67223c6de9d1be406ab8c06b71b82d5407bc
2018-07-05 09:19:37 -07:00
Pascal Hartig
020a771125 Clean up Folly CMakeLists (#127)
Summary:
Remove left over from local testing.
Closes https://github.com/facebook/Sonar/pull/127

Reviewed By: danielbuechele

Differential Revision: D8723789

Pulled By: passy

fbshipit-source-id: f08203a441c35860dd5257a0ec147d1bf9c3da60
2018-07-04 11:33:36 -07:00
Pascal Hartig
3dcf7722bb Add support for x86_64 builds (#128)
Summary:
Add the required compiler flag for Folly when building x86_64.

I'll prepare a new release for this shortly.

Depends on #126
Closes https://github.com/facebook/Sonar/pull/128

Reviewed By: danielbuechele

Differential Revision: D8731955

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 9511811b0b51205989a5200ad9d0d8689ca684cb
2018-07-04 10:17:52 -07:00
Hilal Alsibai
e6fa377d75 Add extension support to InspectorSonarPlugin
Summary:
This mirrors the extension support added to the desktop plugin and allows people to dynamically
add extension commands

Reviewed By: danielbuechele

Differential Revision: D8691167

fbshipit-source-id: 60136b960f8bbdfa42b2077d1f5f7b391fc44443
2018-07-03 16:33:42 -07:00
Pascal Hartig
69711642c9 Build against vanilla OpenSSL 1.1.0h (#125)
Summary:
This uses OpenSSL 1.1.0h to build and link against. The `.so`s are
precompiled and hand-patched from [this
repository](https://github.com/passy/android-database-sqlcipher). The
patching was necessary to fix the `SONAME` and corresponding `NEEDED`
flags to *not* contain a `.1.1` version suffix as Gradle will refuse to
bundle those.

We basically only use the headers for the remaining part.

The precompiled version contains ABI support for `arm64-v8a`, `armeabi`,
`armeabi-v7a`, `x86` and most importantly `x86_64`. HOWEVER, `x86_64` is
still excluded for now because folly fails to compile due to a missing
compiler flag:

```
error: needs target feature pclmul
```

This should be easily fixable by ensuring that `-mpclmul` is added to
the CFLAGS if we're compiling for an `x86_64` target in the
`CMakeLists.txt` for Folly.

Closes #113.
Closes https://github.com/facebook/Sonar/pull/125

Reviewed By: priteshrnandgaonkar

Differential Revision: D8723636

Pulled By: passy

fbshipit-source-id: 41c61047d2793ebaef5793a3c937c4d628471d6a
2018-07-03 13:18:53 -07:00
Hilal Alsibai
c6eb0d6b1a Integrate shared preferences plugin in sample Android app
Summary: Adds the shared preferences plugin to the sample Android app

Reviewed By: sjkirby

Differential Revision: D8661572

fbshipit-source-id: 490a19938b9dd1c87f9200027d3395d719013d21
2018-07-02 11:05:14 -07:00
Hilal Alsibai
ceb16db812 Make the shared preferences plugin more flexible
Summary:
You don't necessarily need / have your shared preferences defined in a file that is your package
name. This adds the ability to pass in the name + mode you need to read the correct shared
preferences file.

Reviewed By: sjkirby

Differential Revision: D8661573

fbshipit-source-id: 49e57b0371228eca7fc4f06e8ba65ff8cc059b11
2018-07-02 11:05:14 -07:00
Pascal Hartig
0515ddb76e Setup fbjni sub-project for maven (#119)
Summary:
Set up our fbjni sub-project to be published to Maven Central.
This removes a bunch of abiFilters that we no longer make use of, too.
Closes https://github.com/facebook/Sonar/pull/119

Reviewed By: priteshrnandgaonkar

Differential Revision: D8694537

Pulled By: passy

fbshipit-source-id: de246fbda99c02856fbc7806b78df2114cb82acb
2018-07-02 01:19:35 -07:00
Pascal Hartig
167792e7d8 Remove NDK build from fbjni sub-project (#116)
Summary:
We're already building this as dependency via CMake of sonar itself and
bundle the resulting `.so` files in there.

This project only contains the java files so we can ship them as
separate JAR.

Importantly, this avoids having to use `pickFirst` as we bundle multiple
incompatible `.so` files in both AARs.
Closes https://github.com/facebook/Sonar/pull/116

Reviewed By: priteshrnandgaonkar

Differential Revision: D8691119

Pulled By: passy

fbshipit-source-id: 82303d6c2b5d7e12dcd8f49300090ce8e4570e47
2018-06-29 06:47:31 -07:00
Pascal Hartig
46df0b25a0 Set up Maven packaging and Bintray upload (#104)
Summary:
This make use of the the setup we have at Litho, which should make
it easier to keep them in sync.

It creates proper source jars, AARs (without bundling in unwanted
transitive deps) and POMs.
Closes https://github.com/facebook/Sonar/pull/104

Reviewed By: priteshrnandgaonkar

Differential Revision: D8638912

Pulled By: passy

fbshipit-source-id: ff4921c0683e9b6f859085b542ceae840a7e8291
2018-06-26 08:18:23 -07:00
Pritesh Nandgaonkar
110ff1c353 Package prebuilt libraries in android target (#105)
Summary:
package prebuilt libraries in `:android` rather than in sample app
Closes https://github.com/facebook/Sonar/pull/105

Reviewed By: passy

Differential Revision: D8639064

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 4da20b046e2e55f0f605f91bf8809a4efd6848d9
2018-06-26 07:32:46 -07:00
Pritesh Nandgaonkar
64a61a37d4 Fix Broken sample app (#103)
Summary:
With this fix the entire android setup builds with gradle . To try out the sample app, run `./gradlew :sample:installDebug`
Closes https://github.com/facebook/Sonar/pull/103

Reviewed By: danielbuechele

Differential Revision: D8618622

Pulled By: priteshrnandgaonkar

fbshipit-source-id: 62a038f95c37cbadf48636a58ca222c8162e256e
2018-06-25 11:33:44 -07:00
Pritesh Nandgaonkar
452dfd7ecc Remove armeabi arch from gradle
Summary: Currently while building thru gradle got the error that armeabi is not supported.The supported ABI's by ndk are x86, x86_64, armeabi-v71, arm64

Reviewed By: danielbuechele

Differential Revision: D8611628

fbshipit-source-id: 80d9449c35a69aab020412b523f5c21fe6661de8
2018-06-25 06:02:32 -07:00
Pritesh Nandgaonkar
edfdd64950 [WIP] gradle builds but app freezes, updated fbjni so file is the possible culprit 2018-06-21 16:27:18 +01:00
Pritesh Nandgaonkar
a49d31a12d Remove comments 2018-06-19 18:31:18 +01:00
Pritesh Nandgaonkar
3a6d7928be Case sensitive path 2018-06-19 18:28:36 +01:00
Pritesh Nandgaonkar
88a6cff373 Fix merge conflicts 2018-06-19 15:31:33 +01:00
Pritesh Nandgaonkar
7405cd268a Merge branch 'master' of https://github.com/facebook/Sonar into Fix-Android 2018-06-19 14:13:59 +01:00
Pritesh Nandgaonkar
ffa6e744c2 update 2018-06-19 14:08:12 +01:00
Pritesh Nandgaonkar
88ecb9b494 app builds but not with sonarfb 2018-06-18 18:45:37 +01:00
Pascal Hartig
16a3e2fa27 Rename isInternalComponent to canResolve
Summary:
I'm sure there's a better way to describe what this does in the Javadoc, but I
can't really come up with one.

Also inlined one method which made another call which is now redundant.

I'd also really like to make this call entirely unnecessary by moving the logic
to `resolve()` so that overriding it automatically implies `canResolve` but the
edge cases for commonProps and treeProps make this rather unpleasant.

Reviewed By: IanChilds

Differential Revision: D8476911

fbshipit-source-id: 33c6a20da03e50cd1c1d4994e64ef8b43b2c68bc
2018-06-18 07:32:26 -07:00
Pascal Hartig
e820beba83 Centralize sample dependencies (#77)
Summary:
The support libraries where out of sync between the projects, causing
the sample build to fail with

```
> Android dependency 'com.android.support:appcompat-v7' has different version for the compile (26.1.0) and runtime (27.1.1) classpath. You should manually set the same version via DependencyResolution
```

This makes sure that the sample submodule uses the top-level
dependencies and same versions.
Closes https://github.com/facebook/Sonar/pull/77

Reviewed By: emilsjolander

Differential Revision: D8447186

Pulled By: passy

fbshipit-source-id: e391501edd97fdbe6456b32cd7305d8be26e20db
2018-06-15 09:40:22 -07:00
Pritesh Nandgaonkar
4cbaeb3e32 Android target and sample builds 👏 2018-06-15 16:53:58 +01:00
Daniel Buchele
6f95ad512f fbshipit-source-id: b14273e883aba6de7b817801a1b04e54a29a6366 2018-06-15 02:23:48 -07:00
Pritesh Nandgaonkar
c179078acd Updated fbjni since its outdated 2018-06-14 22:23:11 +01:00
Pritesh Nandgaonkar
51c36cf2bd RSicket builds 2018-06-14 21:45:45 +01:00
Pritesh Nandgaonkar
ff7dc5cb37 Added Rsocket 2018-06-14 19:55:29 +01:00
Pritesh Nandgaonkar
e50122dc85 Folly builds 2018-06-14 17:59:24 +01:00
Pritesh Nandgaonkar
04784186df Update folly gradle 2018-06-14 13:53:39 +01:00
Pritesh Nandgaonkar
e35206fde7 Libevent referenced thru pre built libraries 2018-06-14 13:48:42 +01:00
Pritesh Nandgaonkar
d80b063fa0 changes in cmake of libevent 2018-06-13 21:41:37 +01:00
Pritesh Nandgaonkar
02161dc06b Add openssl as a dependency to Folly 2018-06-13 18:49:01 +01:00
Pritesh Nandgaonkar
c2b1f09c84 OpenSSL builds successfully 2018-06-13 16:37:15 +01:00
Pritesh Nandgaonkar
a887a87a8d Added OpenSSL 2018-06-13 11:36:51 +01:00
Pritesh Nandgaonkar
cac31016b6 Include .h file as well 2018-06-12 16:33:53 +01:00
Daniel Buchele
f7d487dd76 fbshipit-source-id: 2cd940396d650342920b28835f6e672febe6b55c 2018-06-12 03:39:09 -07:00
Pritesh Nandgaonkar
d64926bf40 commit changes 2018-06-12 10:24:50 +01:00
Pritesh Nandgaonkar
7f6954a1d1 update 2018-06-11 10:22:23 +01:00
Pritesh Nandgaonkar
3cc8dfcf5b fix few things 2018-06-07 16:37:23 -04:00
Daniel Büchele
fbbf8cf16b Initial commit 🎉
fbshipit-source-id: b6fc29740c6875d2e78953b8a7123890a67930f2
Co-authored-by: Sebastian McKenzie <sebmck@fb.com>
Co-authored-by: John Knox <jknox@fb.com>
Co-authored-by: Emil Sjölander <emilsj@fb.com>
Co-authored-by: Pritesh Nandgaonkar <prit91@fb.com>
2018-06-01 11:03:58 +01:00