Commit Graph

490 Commits

Author SHA1 Message Date
Alexander Oprisnik
6960196d8e Don't report an error when Fresco is not initialized yet and Flipper queries data
Summary:
We shouldn't report an error when Flipper is querying data before Fresco is initialized.
This will be especially useful when we move to lazy Fresco initialization later this year.

Reviewed By: passy

Differential Revision: D33978177

fbshipit-source-id: dfb6cb1b73737adbb557ecb141b043d088b5a574
2022-02-03 08:48:32 -08:00
Harold Martin
cdb72db5a9 Fix LeakCanary plugin UI, Upgrade LC dependency and make it compile only (#3367)
Summary:
**Currently, the Leak Canary plugins is broken, see this screenshot (unable to expand):**
<img width="1359" alt="Screen Shot 2022-01-29 at 2 06 33 PM" src="https://user-images.githubusercontent.com/745166/151679662-9d8e8eb6-c19c-4008-9821-1c2c1af92351.png">

**This fix repairs and improves the UI:**
<img width="1350" alt="Screen Shot 2022-01-29 at 2 06 03 PM" src="https://user-images.githubusercontent.com/745166/151679677-7965604c-dd04-4ee5-bc8e-d53a82da1bd7.png">

## Changelog

- Fixes UI to enable showing leak trace
- Upgrades LackCanary dependency from 2.6 to 2.8.1
- Makes Kotlin and LC `compileOnly` dependencies in order to prevent conflict for the users
- Updates documentation

Pull Request resolved: https://github.com/facebook/flipper/pull/3367

Test Plan:
See demo at https://github.com/hbmartin/leakcanary/tree/flipper-demo/leakcanary-android-sample

**Static Docs Preview: flipper**
|[Full Site](https://our.intern.facebook.com/intern/staticdocs/eph/D33915179/V3/flipper/)|

|**Modified Pages**|

Reviewed By: passy

Differential Revision: D33915179

Pulled By: cekkaewnumchai

fbshipit-source-id: 9698dba23ab475c8cd84e4c222dfc41712b05a1e
2022-02-03 01:37:28 -08:00
dependabot[bot]
e0f96057c3 Bump appcompat from 1.4.0 to 1.4.1 (#3303)
Summary:
Bumps appcompat from 1.4.0 to 1.4.1.

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=androidx.appcompat:appcompat&package-manager=gradle&previous-version=1.4.0&new-version=1.4.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/3303

Reviewed By: lawrencelomax

Differential Revision: D33620944

Pulled By: passy

fbshipit-source-id: 6479b38aaa04d9791fa1a42937274c26a3831d7b
2022-01-17 10:43:33 -08:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
Lorenzo Blasa
2d89c2f3eb Close resource as we cannot inline (#3125)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/3125

Better stream creation and disposal.

A report was generated with the following error:
StrictMode policy violation: android.os.strictmode.LeakedClosableViolation: A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks.

Changelog: Close input stream after use which was causing strict mode policy violation crashes and possibly leaking resources.

Reviewed By: passy

Differential Revision: D32830690

fbshipit-source-id: de3ffaf1b600590c4060a381fae66e73e08745cb
2021-12-03 12:58:44 -08:00
Lorenzo Blasa
6a4a867f74 Enable WebSockets for Android
Summary: This change effectively prioritises WebSocket over RSocket connections for Android.

Reviewed By: passy

Differential Revision: D32490095

fbshipit-source-id: 836438970f0668521ca6e7fab6c106e77f951652
2021-12-02 02:28:50 -08:00
Lorenzo Blasa
60de2bc147 Addresses a few issues raised during tests
Summary:
This change addresses a warning and provides a safer way of resolving the connection promise.

Also, fixes an issue whereas the websocket connection was not being reestablished as the listener is not notified when we manually disconnect.

Reviewed By: passy

Differential Revision: D32591859

fbshipit-source-id: 78ce4eac5414a924217867f2f47b04829da3b705
2021-11-29 03:50:08 -08:00
Pascal Hartig
8ccae8a7ac Upgrade Android build infra (#3095)
Summary:
This includes a bunch of different things which I wanted to do separately, but it's all a massive Jenga Tower and you cannot remove a single piece.

- Litho upgrade
- Gradle plugin upgrade
- Remove storage permission as it apparently doesn't do anything above Android 10
- Upgraded build target to Android 12 because the new support lib/Kotlin stdlib required this which then caused the issue below to pop up
- Added "export=true" everywhere as this is now a blocking issue if you don't have it
- Upgraded to the LeakCanary2 plugin as version one no longer builds with an Android 12 target for the export reason
- Make CI run on JRE 11 because that's required by the new Gradle plugin
- Update internal CI to no longer define the SDK twice and use Java 11

Pull Request resolved: https://github.com/facebook/flipper/pull/3095

Test Plan: Built Android Sample and Tutorial app, connected to Flipper.

Reviewed By: lblasa

Differential Revision: D32644410

Pulled By: passy

fbshipit-source-id: 8978f158d9c642b3bbd9dbbd7321eb20098a7a53
2021-11-25 12:21:59 -08:00
Michel Weststrate
9d74728dfe Harden reflection
Summary:
Changelog: Fix theme reflection logging lot of errors if the APIs aren't accessible, see #1736

Harden theme reflection based on the comments in https://github.com/facebook/flipper/issues/1736

Reviewed By: jknoxville

Differential Revision: D32202434

fbshipit-source-id: 99178df56c91715f9eff1e4764ebc55b29ecb6f3
2021-11-10 04:34:43 -08:00
Michel Weststrate
750f26eaa3 Fix potential NPE in Layout Inspector
Summary: Fixed NPE linked by task. From the code, that stuff should never be null, unless there is some threading / concurrency issue, which there apparently is. In that case, failing with a warning is imho a bit more elegant than raising exceptions from a debugging tool

Reviewed By: lblasa

Differential Revision: D32278044

fbshipit-source-id: 710fcdcfe458f33bbb806d9f2f1b9352252eedec
2021-11-09 06:53:00 -08:00
Lorenzo Blasa
a935ab8a6c Android Web Socket (#2978)
Summary:
Pull Request resolved: https://github.com/facebook/flipper/pull/2978

Flipper Android WebSocket provider and socket implementation

Reviewed By: ldelgadoj

Differential Revision: D31683510

fbshipit-source-id: d553a7fdee9451da742e9ea3e6e5b6a2c9417579
2021-11-08 09:22:48 -08:00
Chaiwat Ekkaewnumchai
d5e4b0c360 Clear Activity after Being Destroyed
Summary:
[Reported in the support request](https://fb.workplace.com/groups/flippersupport/posts/1237466586733997/), Activity object is held by ObjectTracker even though the Activity is destroyed. This, in this case, caused strict mode in Portal app to forcibly terminate.

This diff tried to remove activities from the reference holder.

Reviewed By: passy

Differential Revision: D31828290

fbshipit-source-id: aad7e8d7ba14069f8dd7c654a3604d482d85e110
2021-10-26 03:39:41 -07:00
Artem Kholodnyi
72b652fb87 Fix the observer effect in Images Flipper plugin (encoded cache)
Reviewed By: oprisnik

Differential Revision: D31897870

fbshipit-source-id: bdd70d1679029931339ee589c98114f51646cb68
2021-10-25 10:11:48 -07:00
Artem Kholodnyi
11e7bbf9cf Fix the observer effect in Images Flipper plugin
Reviewed By: oprisnik, wizh

Differential Revision: D31379424

fbshipit-source-id: 96040dd0d37442d80a660814bd356571d075aa2c
2021-10-12 09:15:53 -07:00
kodak
b43dde8a6a Display AccessibilityNodeInfoCompat.isScreenReaderFocusable() property (fixes #1756) (#2925)
Summary:
Add screenreader-focusable property to AccessibilityUtil#getAccessibilityNodeInfoData

The accessibility hierarchy displays various AccessibilityNodeInfo properties. However, it was missing the screenreader-focusable property.

## Changelog
Display screenreader-focusable property in the accessibility hierarchy.

Pull Request resolved: https://github.com/facebook/flipper/pull/2925

Test Plan: Test suite passes and code lints.

Reviewed By: mweststrate

Differential Revision: D31312381

Pulled By: passy

fbshipit-source-id: c5044cef6aabe5bd2d2ce5e315f5aafd6990a137
2021-10-01 08:58:23 -07:00
Pascal Hartig
da9511a5bf Fix CI build for Android (#2836)
Summary:
I've been really sweating about this one. It looks like Google now removed NDK 21 as it's too old. However, we've been struggling with the upgrade because OpenSSL was built against an old version of the NDK/glibc/LLVM/some other stuff.

I've now managed to create an OpenSSL distribution for 1.1.1k (we had 1.1.0h before) that seems to build with this after some small modifications.

This seems to do the trick, but I wouldn't be shocked if we found some more incompatibilities further down the line.

Pull Request resolved: https://github.com/facebook/flipper/pull/2836

Test Plan:
- Locally: `./gradlew :tutorial:installDebug`. Builds, starts up. Cool.
- Public GitHub CI: Happy.
- Circle CI: Only triggers post-land. We'll see. But the setup is simple, so hopefully it should work there, too.
- Internal CI: Waiting for signal.

Reviewed By: fabiomassimo

Differential Revision: D30839209

Pulled By: passy

fbshipit-source-id: efe599f28cc0edfdf2149f905c3483555239edc0
2021-09-09 08:46:59 -07:00
Omer Strulovich
1db39b8171 Enable and apply Ktfmt to xplat/simplesql, xplat/sonar, and xplat/spectrum
Summary: As title.

Reviewed By: zertosh

Differential Revision: D30425160

fbshipit-source-id: c72d270d7cd3f30990aac55e33e8f72d60ed5fe2
2021-08-19 07:29:30 -07:00
Pascal Hartig
fc73e0d4ec Revert "Improve protobuf support (#2513)" (#2665)
Summary:
This reverts commit efd75ea435.

Sorry hbmartin! We're running into Kotlin compatibility problems. Your latest library release isn't compatible with Kotlin 1.3 and we can't upgrade just yet because Litho hasn't been able to release in a while. :(

Pull Request resolved: https://github.com/facebook/flipper/pull/2665

Test Plan: _eyes

Differential Revision: D30189360

Pulled By: passy

fbshipit-source-id: c1edbbc496742938579f4e2032a78debe08fcc26
2021-08-09 04:15:49 -07:00
Harold Martin
efd75ea435 Improve protobuf support (#2513)
Summary:
* Update protobuf library to support map types
* Improved usage messaging in UI
* Always attempt to decode requests with a protobuf definition
## Changelog
Improved protobuf support

Pull Request resolved: https://github.com/facebook/flipper/pull/2513

Reviewed By: mweststrate

Differential Revision: D30162379

Pulled By: passy

fbshipit-source-id: 201fb06045822641be5840b121da180a201be974
2021-08-09 02:42:35 -07:00
dependabot[bot]
dcb4b2fb96 Bump appcompat from 1.3.0 to 1.3.1 (#2626)
Summary:
Bumps appcompat from 1.3.0 to 1.3.1.

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=androidx.appcompat:appcompat&package-manager=gradle&previous-version=1.3.0&new-version=1.3.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/2626

Reviewed By: timur-valiev

Differential Revision: D29932510

Pulled By: passy

fbshipit-source-id: c947dadad9649b3f0f1dd9c6e3be8714b25f1ca6
2021-07-27 08:45:47 -07:00
Omar Busto Santos
98f56a30ed Removed bolts-applinks dependency not in use (#2580)
Summary:
As explained in this [Issue](https://github.com/facebook/flipper/issues/1919) when running checks to see if Jetifier is needed to compile any given app using Flipper, it complain due to the dependency on `com.parse.bolts:bolts-applinks:1.4.0`.

```
Scanning com.parse.bolts:bolts-applinks:1.4.0
 Absoulute path: /....../bolts-applinks-1.4.0.jar
 Graphs to this dependency:
 +---com.facebook.flipper:flipper:0.74.0
     +---com.parse.bolts:bolts-applinks:1.4.0

> Task :canISayByeByeJetifier FAILED
```

Bolts has already fixed the AndroidX migration in version `1.5.0` but it has never been published ([Issue](https://github.com/BoltsFramework/Bolts-Android/issues/157))

After checking the code i realized flipper is only using `bolts-tasks` in `FrescoFlipperPlugin` ([code](7bd4f80c25/android/plugins/fresco/src/main/java/com/facebook/flipper/plugins/fresco/FrescoFlipperPlugin.java (L14))).

`bolts-applinks` depends on `bolts-tasks` but **not the other way around**, so we can safely remove this dependency.

## Changelog

- Removed dependency on bolts-applinks not in use

Pull Request resolved: https://github.com/facebook/flipper/pull/2580

Test Plan:
### Tests
- [ ] Run unit tests `./gradlew :android:test` and make sure they pass

### Smoke test `fresco-plugin`
- [ ] Make sure `android/sample` compiles and runs
- In the Flipper desktop app enable `Images` plugin
- In the Android sample app tap on `Load Fresco Image`
- [ ] Verify in desktop app that the image shows correctly and the plugin works

Reviewed By: muraziz

Differential Revision: D29849669

Pulled By: jknoxville

fbshipit-source-id: 0cec730de3b94272985fec4a432ca244822f336f
2021-07-23 05:26:58 -07:00
Nicola Corti
1e6863f39d Bump core-ktx to 1.5.0 and appcompat to 1.3.0 in android/tutorial
Summary:
This diff bumps core-ktx from 1.3.0 to 1.5.0 and appcompat from 1.1.0 to 1.3.0 inside `android/tutorial`
core-ktx 1.5.0 is the last version built with Kotlin 1.4.x and is the latest we can safely upgrade to.

To update to core-ktx 1.6.0 we would need to bump KGP on the overall project to 1.4.x or 1.5.x to fix the build
failures.

Reviewed By: passy

Differential Revision: D29762647

fbshipit-source-id: 7ad23b3cbebe14b36dedaa7f8aedf11eece8429d
2021-07-19 07:43:14 -07:00
Pascal Hartig
d676f8f0a6 Bump AndroidX/Kotlin setup
Summary:
Just a few tweaks to bring AndroidX up-to-date. Required
some fixes to the Kotlin Tutorial as it was throwing
errors about JRE incompatibilities.

Reviewed By: fabiomassimo

Differential Revision: D29761484

fbshipit-source-id: 10cb76115fe7542a60b6e5d14be9c0434e85171c
2021-07-19 03:54:06 -07:00
Michel Weststrate
07199323d1 Remove Newsfeed Story Inspector and native plugin mechanism
Summary: Changelog: The 'nativeplugins' on Android are no longer supported

Reviewed By: jknoxville

Differential Revision: D29163281

fbshipit-source-id: fb4032f240fc306608fe57479f3124d4e7a3400f
2021-06-21 05:39:26 -07:00
Harold Martin
62967314c1 Update Protobuf support (#2381)
Summary:
**Update protobuf library with new support for `enum` and `oneof` types**

## Changelog

- Update plugin code for library API changes and other cleanup
- Add instructions to readme

Pull Request resolved: https://github.com/facebook/flipper/pull/2381

Test Plan: see demo app at https://github.com/hbmartin/protobuf_java_to_protobufjs

Reviewed By: priteshrnandgaonkar

Differential Revision: D28831035

Pulled By: passy

fbshipit-source-id: 46e196293330b615394606bd3486ea47ad6a0630
2021-06-02 12:04:24 -07:00
Pascal Hartig
d1dfc395d1 Revert D28795384: Bump protobuf_java_to_protobufjs from 0.0.1 to 0.1.0
Differential Revision:
D28795384 (09951d505e)

Original commit changeset: 56e791ff245c

fbshipit-source-id: 05c98ff21a789fbd363e707869d5ef7e7b6d6b12
2021-06-01 09:24:57 -07:00
dependabot[bot]
09951d505e Bump protobuf_java_to_protobufjs from 0.0.1 to 0.1.0 (#2391)
Summary:
Bumps [protobuf_java_to_protobufjs](https://github.com/hbmartin/protobuf_java_to_protobufjs) from 0.0.1 to 0.1.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/hbmartin/protobuf_java_to_protobufjs/releases">protobuf_java_to_protobufjs's releases</a>.</em></p>
<blockquote>
<h2>v0.1.0</h2>
<ul>
<li>Added support for <code>oneof</code></li>
<li>Added support for enums</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/hbmartin/protobuf_java_to_protobufjs/commits/v0.1.0">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=com.github.hbmartin:protobuf_java_to_protobufjs&package-manager=gradle&previous-version=0.0.1&new-version=0.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/2391

Reviewed By: nikoant

Differential Revision: D28795384

Pulled By: passy

fbshipit-source-id: 56e791ff245cdc096e9ef11eb2b436e42e611659
2021-06-01 09:08:44 -07:00
Andrey Petrov
69ed3b0210 Add databases under /files to the list of databases visible by default in Flipper Database Plugin
Summary: Traverse recursively the /files directory and show all databases with .db extension in Flipper. Traversal depth is limited to 5 by default for performance reasons.

Reviewed By: mweststrate

Differential Revision: D28451609

fbshipit-source-id: de27c855fee220e0b79061c9b2df1eba6f5ef2af
2021-05-17 10:47:34 -07:00
Pascal Hartig
6279cc68b1 Upgrade to Gradle 7 (#2279)
Summary:
Depends on https://github.com/facebook/flipper/issues/2277. Fixes https://github.com/facebook/flipper/issues/2221.

The maven plugin is no longer exposed and implied by https://developer.android.com/studio/build/maven-publish-plugin.

Pull Request resolved: https://github.com/facebook/flipper/pull/2279

Test Plan: ./gradlew uploadArchives -PdryRun=true

Reviewed By: priteshrnandgaonkar

Differential Revision: D28473692

Pulled By: passy

fbshipit-source-id: 3d95122fecebfeac8bfa5173c5c633eee3f13311
2021-05-17 07:29:49 -07:00
Harold Martin
4d262c0da4 Add protobuf support to network inspector (#2080)
Summary:
Protobuf based APIs are becoming more common (i.e. gRPC) but are difficult to inspect. Unlike plain text data formats (JSON), Protobuf calls transmit binary data requiring the format to be known ahead of time, making ad-hoc inspection impossible. This PR allows for those format definitions (messages in protobuf terminology) to be transmitted from the client to the network inspector plugin. These definitions are then imported into ProtobufJS which enables the binary data transmitted to be inspected as easily as JSON data.

See Retrofit PR in https://github.com/facebook/flipper/pull/2084

## Changelog

* Add ProtobufJS library to network plugin
* New `ProtobufFormatter` UI in `RequestDetails`
* `ProtobufDefinitionsRepository` to cache and load protobuf defintions
* `addProtobufDefinitions` call in the Android network plugin

Pull Request resolved: https://github.com/facebook/flipper/pull/2080

Test Plan: ![screenshot](https://user-images.githubusercontent.com/745166/111652068-001a5e80-87c4-11eb-8c94-e19b46dd074c.png)

Reviewed By: mweststrate

Differential Revision: D27507451

Pulled By: passy

fbshipit-source-id: 586d891b74f2b17d28fe7a2a99074da755851f38
2021-04-20 05:10:39 -07:00
Harold Martin
b0cbf39a1a Export protobuf definitions from Retrofit (#2084)
Summary:
https://github.com/facebook/flipper/pull/2080 enables storing protobuf definitions and displaying payloads in the network inspector plugin. However, describing those definitions in ProtobufJS format can be time consuming and error prone. This PR enables sending definitions from an entire Retrofit service with a single line.

## Changelog
* Adds a retrofit2-protobuf plugin

Pull Request resolved: https://github.com/facebook/flipper/pull/2084

Test Plan:
Used as a single line per service, ie:
`SendProtobufToFlipperFromRetrofit(baseUrl, PersonService::class.java)`

For more details see demo app in https://github.com/hbmartin/protobuf_java_to_protobufjs

Reviewed By: mweststrate

Differential Revision: D27507872

Pulled By: passy

fbshipit-source-id: 859d7636c9512de0abde0aa1dcb2e023851369cf
2021-04-07 13:31:23 -07:00
bruce3x
c946309f6a Ignore null key in shared preferences (#2146)
Summary:
SharedPreferences plugin will crash when null key fields in shared preference on Android. Null keys should be ignored.

Fixes https://github.com/facebook/flipper/issues/2078

## Changelog

- Ignore null keys in shared preferences.

Pull Request resolved: https://github.com/facebook/flipper/pull/2146

Reviewed By: mweststrate

Differential Revision: D27522356

Pulled By: passy

fbshipit-source-id: b946cd9ba2a3131b3ffab65e8949fda20a3630fc
2021-04-07 05:14:56 -07:00
Hilal Alsibai
949545a2a7 Don't skip the first theme data retrieval
Summary: Was early returning on the first attempt to load theme data, this was left over from when the the theme feature was temporarily disabled.

Reviewed By: passy

Differential Revision: D27284040

fbshipit-source-id: bb641fbe4cd9c0ea6012e89dbda67e5dd10d59bd
2021-03-24 04:33:03 -07:00
generatedunixname89002005287564
bfad9c6214 Clean up xplat/sonar/android/src/main/java/com/facebook/flipper/plugins/inspector/InspectorFlipperPlugin.java
Reviewed By: passy

Differential Revision: D26908296

fbshipit-source-id: f8e0cd4cd1d57b6b43991f4a169f36d104a3a372
2021-03-09 13:41:54 -08:00
Pascal Hartig
ac68cc7026 More aggressively cache native builds (#2025)
Summary:
Got really annoyed with Boost *always* downloading the tar ball on every
build. We had some methods annotated to only run whenever our cache
is out of date and for others we relied on a catch-all at the end which
actually didn't do anything.

If anyone knows Gradle better, please give it a shot.

Pull Request resolved: https://github.com/facebook/flipper/pull/2025

Test Plan:
Changed the URL to something that doesn't exist and it still didn't
re-fetch. Haha, got you!

Reviewed By: mweststrate

Differential Revision: D26843903

Pulled By: passy

fbshipit-source-id: 8c8cf60440d6bf6d7a93eebb7871858b1e6c6509
2021-03-05 09:13:00 -08:00
Pascal Hartig
6af041454a Upgrade to FBJNI 0.2 (#1999)
Summary:
This should fix https://github.com/facebook/flipper/issues/1968

Pull Request resolved: https://github.com/facebook/flipper/pull/1999

Test Plan:
Built our sample app; built the sample app provided in the repo as part
of the issue; locally released the Flipper artifacts and built the RN
app against it.

Reviewed By: fabiomassimo

Differential Revision: D26817589

Pulled By: passy

fbshipit-source-id: c6db5f947c08e4236442b08306791e45b4d15ec3
2021-03-04 08:45:09 -08:00
Pascal Hartig
3d3724ac8b Fix copyright headers
Summary: OSS violation: P242776146

Reviewed By: jknoxville

Differential Revision: D26756475

fbshipit-source-id: bc36fe083101af89f80da293ebafa8a02fd4a052
2021-03-02 12:15:00 -08:00
Pascal Hartig
847f4d0151 Delete redundant gradle code (once more)
Reviewed By: fabiomassimo

Differential Revision: D26751726

fbshipit-source-id: 03b8601cdb0910f2ec7508d9bb1c09bcd6bcd301
2021-03-02 08:46:13 -08:00
Harold Martin
4d8be35d1a Add plugin for LeakCanary 2 (#1959)
Summary:
Add plugin for LeakCanary 2 as requested various times: https://github.com/facebook/flipper/issues/1379 https://github.com/facebook/flipper/issues/832  https://github.com/square/leakcanary/issues/1777

## Changelog

* Adds a leakcanary2 plugin for Android
* Adds support for leakcanary2 to existing desktop plugin

Pull Request resolved: https://github.com/facebook/flipper/pull/1959

Test Plan:
* Docs updated to show new implementation
* Should old leakcanary plugin in sample be replaced?

Reviewed By: mweststrate

Differential Revision: D26691637

Pulled By: passy

fbshipit-source-id: 5e236fa6cc124f0720a6b21b5ee7c117ccf96fbf
2021-03-01 09:11:37 -08:00
Pascal Hartig
3d2a0e3eb2 Enable prefab for fbjni integration (#1941)
Summary:
I'm in the progress of releasing a prefab-enabled FBJNI release. This dramatically reduces the hackery around integrating with separately released native libraries.

This will fail until the release is actually out.

Pull Request resolved: https://github.com/facebook/flipper/pull/1941

Test Plan:
`./gradlew :sample:installDebug` works as before.
Once the release is out, we need to check if this creates any problems with RN but because we advice to exclude the dependency, I expect it not to cause any trouble.

Reviewed By: mweststrate

Differential Revision: D26545104

Pulled By: passy

fbshipit-source-id: 1e21fa1816f28e2fcb52da68863fabc8bc625136
2021-02-24 06:20:12 -08:00
Pascal Hartig
3f16da4db0 Upgrade gradle plugin (#1936)
Summary:
Upgraded to the latest Android Studio and this popped up.

Pull Request resolved: https://github.com/facebook/flipper/pull/1936

Test Plan:
Built the sample app.

Repro'd the previous build failure. Weirdly enough, this only occurred on Linux, not on my Mac. Now it's passing.

Reviewed By: mweststrate

Differential Revision: D26483694

Pulled By: passy

fbshipit-source-id: 9c27eb6d28a0f390154899d67469a504d68c2ad4
2021-02-19 03:29:50 -08:00
Pascal Hartig
b25de27b8a Move bolts dependencies to Fresco plugin (#1937)
Summary:
Fixes https://github.com/facebook/flipper/issues/1919

Somehow the diff author put the dependencies in the root `build.gradle`, which is unnecessary as this is only used by Fresco.

Pull Request resolved: https://github.com/facebook/flipper/pull/1937

Test Plan:
Built the sample app, checked that the Fresco stuff continues to work.
![Screenshot_1613565381](https://user-images.githubusercontent.com/9906/108205459-0366ef80-711d-11eb-8b3b-f804f02622af.png)

Reviewed By: mweststrate

Differential Revision: D26483701

Pulled By: passy

fbshipit-source-id: 88f056ed0897f2c00844e02721eb45d5b85c6908
2021-02-18 09:31:04 -08:00
Pascal Hartig
87d7bcf274 Remove JCenter specifics (#1914)
Summary:
This removes Bintray/JCenter specific code and replaces it with a new plugin recommended by [Chris Banes](https://chris.banes.dev/publishing-to-maven-central/).

Pull Request resolved: https://github.com/facebook/flipper/pull/1914

Test Plan:
Manually uploaded as snapshot and full release, but with this setup still requires all sorts of manual setup, including GPG. Next PR will include automation for this.

CI here should also verify that I didn't split this diff up incorrectly.

Reviewed By: jknoxville

Differential Revision: D26367350

Pulled By: passy

fbshipit-source-id: faa6b488d6c95bc643d2f9328362e29fb4b05ded
2021-02-10 07:16:32 -08:00
Joshua Selbo
340a29c1d5 Add inspector descriptor for ImageView
Summary:
- Made `EnumMapping` support generic value type -  `ImageView.ScaleType` is a Java enum; the scaleType api uses this instead of int types.
- Introduce descriptor for `ImageView` and allow getting/setting scaleType.

Reviewed By: mweststrate

Differential Revision: D26092725

fbshipit-source-id: ea3a4ee036b2b808f14277387d360318b7d25824
2021-02-01 10:21:26 -08:00
Ian Childs
c85942b6b1 Move sonar robolectric tests to use binary resources
Summary: Legacy resources are deprecated, this is what we should be using

Reviewed By: jselbo

Differential Revision: D25903962

fbshipit-source-id: ffa91a3aee8956591b7daab523bda2e59fec9932
2021-01-13 14:32:56 -08:00
Andres Suarez
731e39445f Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25861849

fbshipit-source-id: 840dc1061e557717c7f9ffcccbc09c24b96b78e0
2021-01-10 10:07:30 -08:00
bizzguy
f806ee41d7 Network plugin - fix issue with responses with empty body (#1776)
Summary:
The Network Plugin does not properly handle network requests that return an empty body (because of the body actually being empty or because the network call returns something like a 404 status).

Also, the creation of mocks using the "Copy Highlighted" command when the original response returns an empty body is not handled properly.

## Fix

The Android plugin now returns a response when the body length is 0.

The client plugin creates a body containing an empty string instead of null when the body is empty.

## Changelog

Fix problem in Network Plugin when original call or mock has an empty body in the response.

Pull Request resolved: https://github.com/facebook/flipper/pull/1776

Test Plan:
The following screen output for the Network Plugin shows that the call is now being handled correctly.  The fields for "status", "size" and "duration" are now populated.

Also, the mock calls are properly defined and shown in yellow.

![image](https://user-images.githubusercontent.com/337874/102738969-5edd5280-4311-11eb-9b46-33a57a50e334.png)

Reviewed By: mweststrate

Differential Revision: D25804212

Pulled By: passy

fbshipit-source-id: b31cc87619c604b4df76e05bca5c86554a1cabff
2021-01-07 04:15:18 -08:00
Amir Katz
eb475e7550 creating a flag to explicitly load flipper
Summary: This change will allow loading flipper not only internal build but also in builds that explicitly turn on LOAD_FLIPPER_EXPLICIT in build config

Reviewed By: timur-valiev

Differential Revision: D25369245

fbshipit-source-id: 9f8e5c7033aa4ded6ce7bc8cc5b5c252ba65692b
2020-12-15 03:21:08 -08:00
Pascal Hartig
484a555428 Fix tutorial Android app build (#1676)
Summary:
This was not updated with the recent Litho editor changes.

Pull Request resolved: https://github.com/facebook/flipper/pull/1676

Test Plan:
`./gradlew :tutorial:installDebug`

<img width="1381" alt="Screenshot 2020-11-13 at 16 31 16" src="https://user-images.githubusercontent.com/9906/99096159-e1197f00-25cd-11eb-9a80-9697fc7e4e3b.png">

Reviewed By: mweststrate

Differential Revision: D24981566

Pulled By: passy

fbshipit-source-id: 8315fe67f80c36b570c0c8fa110f810ad31bd9f2
2020-11-16 11:00:20 -08:00
Paco Estevez Garcia
e9dc645423 Add Android support for Timeline detail view
Summary:
This diff adds the Java classes that serialize to the data expected by the new timeline widget. See D23865369 for the JS counterpart.

Currently the Flipper plugin uses `toString` to get the wire values. I'm not feeling like using a json library or dealing with JSONObject's nonsense, so these are rolled manually for now.

Reviewed By: astreet

Differential Revision: D24254377

fbshipit-source-id: b2fc00400c40b47ac29c9b83c0b66621c3677974
2020-10-19 06:01:14 -07:00