Commit Graph

46 Commits

Author SHA1 Message Date
Scott Kyle
fb223671a7 Add macOS support
Summary: This adds macOS compatibility to Flipper client along with some of the standard plugins.

Reviewed By: jknoxville

Differential Revision: D24644439

fbshipit-source-id: dc15636a6ac1bf684fa1c89735f51f0e97667b62
2020-11-06 13:22:54 -08:00
Pritesh Nandgaonkar
293de19c2b Add toggle in the settings for cert exchange medium
Summary:
This diff adds a toggle setting in wilde which will enable certificate exchange through www.
Right now it just sends the information about which medium to be used for cert exchange to Flipper JS and its client side. But its implementation is not done yet.

### Flow for Wilde

Whenever user changes the setting(or when user logs out) we set the state of exchange medium and accordingly set/reset authtoken. Note at no given point we remove already existing certificates.

### Context for OSS

With this diff we introduce another way to do certificate exchange. Before this diff, we did certificate exchange by accessing the file system of app. But it turns out it's not possible to do that in applications signed by enterprise certs. Thus with this diff one can write their FlipperKitCertificateProvider and fetch the certificate from WWW.

Reviewed By: jknoxville

Differential Revision: D22896320

fbshipit-source-id: 55aef7028a62e71ba9c02f9f79acaab41d09c0c6
2020-08-12 04:44:18 -07:00
Pritesh Nandgaonkar
972277b031 Fix warnings of FlipperKit in iOS
Summary:
This diff fixes the warnings raised from FlipperKit. Also this diff updates the deployement target of FlipperKit  to iOS 10. Even wilde assumes the min deployment OS version to be iOS 10. In layout plugin we use [UIAccessibiltyTraiTabBar](https://developer.apple.com/documentation/uikit/uiaccessibility/uiaccessibilitytraits/1648592-tabbar), which assumes iOS 10 and above.

Partially fixes https://github.com/facebook/flipper/issues/803

Still there are some warnings which are coming from the dependencies outside of Flipper.

Reviewed By: passy

Differential Revision: D19941558

fbshipit-source-id: 31809fedb9aa297bc318b5af72e29e8444f0142f
2020-02-18 12:47:21 -08:00
Pritesh Nandgaonkar
ca513cf370 Run CLANGFORMAT on FlipperKit folder
Summary:
This diff runs CLANGFORMAT lint on FlipperKit. I have added CLANGFORMAT as the lint engined for objc files in xplat/sonar. Right now the iOS folder is not formatted according to CLANGFORMAT.
Ran `arc lint -a --paths-cmd "find ./iOS/FlipperKit -type f" --verbose`

Reviewed By: passy

Differential Revision: D19942170

fbshipit-source-id: af677323af4edb761f61f8f7e289cab743aa31f2
2020-02-17 10:49:17 -08:00
Pritesh Nandgaonkar
35ed3ce1a4 Setup lint for iOS
Summary: uncrustify was not recommended to add in xplat thus I have added clangformat for xplat/sonar/iOS

Reviewed By: zertosh

Differential Revision: D19879977

fbshipit-source-id: 76f6dadf5d55a61a5342802cfde2821cbff38525
2020-02-14 21:17:11 -08:00
Janic Duplessis
44f5e35675 Implement react-native-flipper on iOS (#795)
Summary:
Implement the react-native-flipper native module on iOS. Uses very similar abstractions as on Android.

## Changelog

[react-native-flipper] Support iOS
Pull Request resolved: https://github.com/facebook/flipper/pull/795

Test Plan:
Tested using the RN TicTacToe example app

{F228406333}

Reviewed By: mweststrate

Differential Revision: D19853017

Pulled By: priteshrnandgaonkar

fbshipit-source-id: d93d35ff984b9ba75f812c4c8e3c82e4d550f0c0
2020-02-14 21:17:11 -08:00
Andres Suarez
0675dd924d Tidy up Flipper license headers [1/2]
Reviewed By: passy

Differential Revision: D17863711

fbshipit-source-id: 259dc77826fb803ff1b88c88529d7f679d3b74d8
2019-10-11 13:46:45 -07:00
Andres Suarez
c4c5d453c2 Fix license headers
Reviewed By: scottrice

Differential Revision: D17673481

fbshipit-source-id: 1794e0a6e92e6894b5634b24c6e7910847616261
2019-09-30 15:10:17 -07:00
Anatolii Shevchenko
e874e032c6 Remove ; from method implementation definition
Summary: Removing excessive semicolon ";" symbol from method implementation definition.

Reviewed By: adamjernst

Differential Revision: D16912006

fbshipit-source-id: 9c3e778a107e8fd0055f40a95ea9ca58d461e1c5
2019-08-21 15:49:04 -07:00
Pritesh Nandgaonkar
7848a2d45c Remove symlink and copy the actual files
Summary: Removes the symlink files and copies the actual files. The OSS build is broken as its not able to access those files.It used to work before as the ship it config used to sync thos files from fbobjc. But that approach is fragile as it broke our OSS build recently, because of this diff D16829348

Reviewed By: jknoxville

Differential Revision: D16891051

fbshipit-source-id: b5146129adc8628d336fbca5936539d2e1131ba2
2019-08-19 07:37:10 -07:00
Adam Ernst
2b050851a3 Split and fix FBCxxUtils
Summary: This target was bloating. Split it in two. Migrate to autotests.

Reviewed By: joshleibsly

Differential Revision: D16829348

fbshipit-source-id: 17f2a10371293ddb850c4556abeecee99a9d7bef
2019-08-15 09:53:48 -07:00
Spencer Baumgardner
d68dac2ce0 Convert nlohmann::json to NSDictionary
Summary: T46426056: Add utility to convert nlohmann::json to NSDictionary. Use same in instagram logging module.

Differential Revision: D16798341

fbshipit-source-id: 88923fcbcd1ffbed5a468cee4ba2f9482ba81a97
2019-08-14 17:29:00 -07:00
John Knox
f0be2c5b2e Remove unused import
Summary: This isn't necessary

Reviewed By: passy

Differential Revision: D16358413

fbshipit-source-id: b4bc0af3d671ed9be080eae24f69054cb2623ba4
2019-07-18 11:14:53 -07:00
Rain ⁣
aa649ff48f standardize C-like MIT copyright headers throughout fbsource
Summary:
`/*` is the standard throughout open source code. For example, Firefox uses single /*: https://hg.mozilla.org/mozilla-central/file/21d22b2f541258d3d1cf96c7ba5ad73e96e616b5/gfx/ipc/CompositorWidgetVsyncObserver.cpp#l3

In addition, Rust considers `/**` to be a doc comment (similar to Javadoc) and having such a comment at the beginning of the file causes `rustc` to barf.

Note that some JavaScript tooling requires `/**`. This is OK since JavaScript files were not covered by the linter in the first place, but it would be good to have that tooling fixed too.

Reviewed By: zertosh

Differential Revision: D15640366

fbshipit-source-id: b4ed4599071516364d6109720750d6a43304c089
2019-06-06 19:40:28 -07:00
Pascal Hartig
65c0dd1a86 Add missing swift/objc headers
Summary: Per title

Reviewed By: danielbuechele

Differential Revision: D15199200

fbshipit-source-id: a4251311d7fd2d22d39ba89ba0052514abbc3e2c
2019-05-03 09:13:17 -07:00
Pascal Hartig
bbee7a3357 Update iOS license headers (and more)
Summary: Add the affiliates bit that the linter is checking for.

Reviewed By: jknoxville

Differential Revision: D15164826

fbshipit-source-id: 500ffe89ec0c2fd3acfbc374408d16a337cecfa4
2019-05-02 03:28:07 -07:00
John Knox
ce7287f08b Re-enable physical iOS device support in mobile SDK
Summary: Only usable with a desktop app that supports physical iOS devices, which isn't released yet.

Reviewed By: passy

Differential Revision: D14132413

fbshipit-source-id: 376d1db06e46ae06346974f2acc95c3d2ff6825d
2019-02-19 10:33:25 -08:00
John Knox
9b6db1f482 Respond on exceptions thrown when on main thread
Summary: Changes FlipperPerformBlockOnMainThread to take a responder, and respond with an error if an exception is caught.

Reviewed By: passy

Differential Revision: D14066982

fbshipit-source-id: 70135bf58171684bcd013c66d9deec366aed36f5
2019-02-14 06:24:38 -08:00
John Knox
2335cfb312 Fix formatting in PortForwarding readme
Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/369

Differential Revision: D14031906

Pulled By: passy

fbshipit-source-id: 6da0ab7da30f7505b5265033f732a00cf9f397a4
2019-02-11 15:21:25 -08:00
John Knox
4a3de26a88 Add requestResponse handler for incoming calls
Summary:
Flipper exposes a call() api to plugins which lets them call their sdk component, and it returns a promise with the response.
Currently this is done by sending a fireAndForget request, noting the id of the request, and then receiving fireAndForget requests and matching up the ids to give the result back to the right plugin promise.

Instead, it will be simpler to use rsocket requestResponse, instead of fireAndForget, which is for this exact use case. This diff adds a requestResponse handler to the SDK, so that it can deal with such requests and respond accordingly, while preserving the current functionality if it receives a fireAndForget.

So this part is backwards compatible and should be safe to land in isolation.

A later diff will change the desktop app to use requestResponse, which may not be backwards compatible, so that will have to be deployed more carefully.

Reviewed By: passy

Differential Revision: D13974049

fbshipit-source-id: b371d94a86b1f186375161ed8f2242a462ce418f
2019-02-11 14:06:55 -08:00
Patrick Shyu
3c35d6d4cf rename FBMacros.h to FBDefines.h (unrevert)
Summary:
Another smaller diff was responsible for breaking the build... D14019510 would have been the fix, which is integrated into this diff anyway.

 ---
Renaming FBMacros.h to FBDefines.h for more standard naming (similar to say UIKit/UIKit.h or Foundation/Foundation.h).

```
Tools/fastmod/fastmod --accept-all '\bFBMacros.h' FBDefines.h ../xplat
```

drop-conflicts
bypass-lint
allow-large-files

Reviewed By: dinhviethoa

Differential Revision: D14019529

fbshipit-source-id: 940490a5ec72ccdeb819598f488dc22eae454a26
2019-02-10 09:36:40 -08:00
Hoa Dinh
5cc1bb74c3 Revert D14011897: rename FBMacros.h to FBDefines.h
Differential Revision:
D14011897

Original commit changeset: f1dd7e686eef

fbshipit-source-id: ccf548ec2f82c7a1e6c2a0df5d6fd8f9dc9e1538
2019-02-09 23:23:24 -08:00
Patrick Shyu
159061c284 rename FBMacros.h to FBDefines.h
Summary:
Renaming FBMacros.h to FBDefines.h for more standard naming (similar to say UIKit/UIKit.h or Foundation/Foundation.h).

```
Tools/fastmod/fastmod --accept-all '\bFBMacros.h' FBDefines.h ../xplat
```

drop-conflicts
bypass-lint
allow-large-files

Reviewed By: adamjernst

Differential Revision: D14011897

fbshipit-source-id: f1dd7e686eef2cdb109e85c2db4a0f2ac3d0ba42
2019-02-09 16:51:50 -08:00
John Knox
74d0ecac1b Add FLIPPER_PORTS env var to iOS SDK
Summary:
Part 2 of changing flipper to use customizable ports: iOS SDK.
Still to go: JS app.

env var should be of the format:

`FLIPPER_PORTS=1111,2222` for insecure port: 1111 and secure port: 2222.

Reviewed By: danielbuechele

Differential Revision: D13800988

fbshipit-source-id: 3560ba850389964f4b784551b803c45c6524e6f0
2019-01-24 06:49:33 -08:00
John Knox
73e921bafc Disable iOS portforwarder
Summary:
Disabling the port fordwarder.
On physical devices, when flipper isn't running and they don't have any certificates, they attempt to connect to the desktop.
They always connect to the portforwarder, even though it doesn't connect to flipper desktop.
After connecting to the portforwarder, they then try to generate the SSL certs. This is a CPU intensive operation and happens repeatedly in this condition when it really shouldn't be, causing high cpu usage.

Disabling for now. The fix will be to make sure that they only do that generation when they are fully connected.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13507353

fbshipit-source-id: a858a5da7352228b063150334ea443130763d888
2018-12-18 13:42:40 -08:00
John Knox
40f50d48e3 Add physical iOS support to internal build
Summary: Adds support for physical iOS devices, when the necessary dependencies are present. Unfortunately these aren't open sourced yet so the open source build won't get this feature yet.

Reviewed By: priteshrnandgaonkar

Differential Revision: D13001473

fbshipit-source-id: d8c2bcd53b7972bec676717c8af0112800b918d0
2018-12-03 11:34:53 -08:00
John Knox
8d93946739 Add FBPortForwarding source code
Summary:
See FBPortForwarding/README.md for an explanation of what this is.
It's required for the upcoming support for physical iOS devices.

To simplify development of the JS app, We're going to bundle the pre-built PortForwardingMacApp
inside the repo, and inside the electron app (static/PortForwardingMacApp.app).
Adding this source so users can build it from source if they choose to.

Reviewed By: danielbuechele

Differential Revision: D13276022

fbshipit-source-id: 99b18e0412cf443bb4a67eb4846cc780e0014de1
2018-12-03 11:34:53 -08:00
Pritesh Nandgaonkar
912d3c4bcb FlipperClient tests on iOS
Summary:
This diff adds few tests for flipper client on iOS side. This tests are similar to the ones which exists in xplat but this tests the iOS side of flipper client.

Following tests are added

- connect , disconnect block called on plugin
- background plugin activated before init method
- crash getting suppressed

Reviewed By: jknoxville

Differential Revision: D13167637

fbshipit-source-id: 6c21d5cf2f08e7e3c17ecacbf3badfbde80fb5d1
2018-11-26 07:56:13 -08:00
John Knox
c76b524907 iOS - Use bundleId for app ID
Summary:
The appId field gets embedded into the certificate request, so flipper knows which app to provide the cert to.
In iOS this field is never used, so far, because the destination path uniquely identifies the app so this is redundant.

For physical iPhones however, knowing the bundle id lets you deploy files into the container, so we can use this value.

Reviewed By: passy

Differential Revision: D13000296

fbshipit-source-id: 9f21850b908a03f1be87dc204e59d616150cc7ec
2018-11-12 04:23:58 -08:00
Pritesh Nandgaonkar
ff6b1790cb Adds Diagnostics screen in sample app
Summary: Adds Diagnostics screen in sample app

Reviewed By: danielbuechele

Differential Revision: D10509941

fbshipit-source-id: 9d0a8244dc93528cfdb06ae70d51c2a408f3e3be
2018-10-23 10:39:08 -07:00
Pritesh Nandgaonkar
5bbfa58909 Setup sdk for background plugin
Summary:
This diff sets up flipper for running plugins in background. This diff does the following

- Adds a function named `runInBackground` to the interface `FlipperPlugin` to make the plugins opt in to be run in background, default is false
- Changes the javascript side of the flipper to store the messages received by the plugins in background
- Process the stored messages when the plugin in background becomes active
- Currently I have just turned on network plugin to be in background mode.

- Remove the buffering from the network plugin, as it will run in background
- Write a batching layer to batch the messages and send to flipper.

Note: I haven't tested the wilde app yet, but the sample app works. I will remove the "[WIP]" from the title once I have tested it in wilde

Reviewed By: danielbuechele

Differential Revision: D10301403

fbshipit-source-id: 034eebf659a545d6b480a4ac1b73b0aa4b2f9797
2018-10-11 15:23:21 -07:00
Jérémie Marguerie
145b94b47d Do not crash if there is no disk, just return nil instance
Summary: This should not affect prod as flipper (also called sonar) should only be an internal debug product but i needed to fix it to start the app.

Reviewed By: jknoxville

Differential Revision: D10156590

fbshipit-source-id: 84a76e5cbe2f4bbe89627895efcfb7e6cdadae13
2018-10-04 14:14:09 -07:00
John Knox
3118814ddc Add iOS client hang test
Summary: Check that it never hangs or crashes during startup

Reviewed By: priteshrnandgaonkar

Differential Revision: D10034630

fbshipit-source-id: b69ce9e6f91a5499a084c4d7328e6934ec92ece4
2018-09-26 07:26:54 -07:00
Pritesh Nandgaonkar
706ef2a1c8 Rename FlipperCppWrapperPlugin
Summary: Renames FlipperCppWrapperPlugin

Reviewed By: passy

Differential Revision: D10028505

fbshipit-source-id: d4245a49e2c8cbc8d06ed17c93ee5cb28ce49838
2018-09-25 13:47:36 -07:00
Pritesh Nandgaonkar
e6aeb24fcc Rename SonarCppBridgingResponder
Summary: Renames SonarCppBridgingResponder

Reviewed By: passy

Differential Revision: D10028084

fbshipit-source-id: d45b50a659710fb6e535241780a335a124582a47
2018-09-25 13:47:35 -07:00
Pritesh Nandgaonkar
bf7eeada67 fbshipit-source-id: edd3baa666d4f6b2290612f523eb2c04cc41068c 2018-09-24 09:10:07 -07:00
John Knox
c1295b1bc9 Rename SonarState* to FlipperState*
Summary: Part of sonar to flipper rename

Reviewed By: passy

Differential Revision: D9919821

fbshipit-source-id: a44a2a04d5463750f884f8bf1328e02d56593e82
2018-09-24 06:03:51 -07:00
John Knox
1d2793f701 Rename SonarWebSocket
Summary:
Part of Sonar -> Flipper rename.
It's about time this is renamed from *Websocket as well, since it doesn't use websockets anymore.

Reviewed By: passy

Differential Revision: D9919695

fbshipit-source-id: 78a63bfb7d5de19c093b7fb775d1426b4fc58f77
2018-09-24 06:03:51 -07:00
John Knox
5350d3ce7a Rename C++ SonarPlugin class
Summary: Part of sonar -> flipper rename

Reviewed By: passy

Differential Revision: D9917615

fbshipit-source-id: e59f43bf003d30ae6be4d95bc4a21c92ab39f732
2018-09-24 06:03:50 -07:00
John Knox
9889df3f3c Rename SonarConnection to FlipperConnection
Summary: Part of Sonar -> Flipper rename

Reviewed By: passy

Differential Revision: D9907353

fbshipit-source-id: 01f7bb84da1c27fd68d608151f437a18b6eaaa4e
2018-09-20 17:06:54 -07:00
John Knox
3c656de7fa Rename SonarClient to FlipperClient
Summary: Part of the Sonar -> Flipper rename

Reviewed By: passy

Differential Revision: D9871902

fbshipit-source-id: 4b64953cb1a64235d47caaf0fabfb560bb85f7a2
2018-09-20 17:06:53 -07:00
John Knox
df8763e697 Move xplat/sonar/xplat/Sonar* to Flipper*
Summary:
Part of the Sonar -> Flipper rename
Intentionally left externally visible buck target as Sonar for now to minimize diff size.

Reviewed By: passy

Differential Revision: D9871684

fbshipit-source-id: 6926eb62c578a05cd895745c75ed7da3cfe965b5
2018-09-20 15:39:57 -07:00
Pritesh Nandgaonkar
04efc06f6a Rename xcodeproj file
Summary: Renames xcodeproj file

Reviewed By: passy

Differential Revision: D9947704

fbshipit-source-id: 057d849c1b20ced228f43e42938f4fbffd1c1794
2018-09-20 04:45:35 -07:00
Pritesh Nandgaonkar
6ac6ac61e3 Rename SonarCppBridgingConnection to FlipperCppBridgingConnection
Summary: Renames SonarCppBridgingConnection to FlipperCppBridgingConnection

Reviewed By: passy

Differential Revision: D9946932

fbshipit-source-id: 58437feba9164453f0bed54f9f57a6e578dceb73
2018-09-20 04:45:35 -07:00
Pritesh Nandgaonkar
79b2cf712d Rename SonarResponder to FlipperResponder
Summary: Rename SonarResponder to FlipperResponder

Reviewed By: passy

Differential Revision: D9939713

fbshipit-source-id: 6792ec6529907ee98a070af9e26064bb5fcc07ef
2018-09-19 16:43:42 -07:00
Pritesh Nandgaonkar
da851bd7e6 Change modulename to FlipperKit
Summary: Change modulename to FlipperKit

Reviewed By: passy

Differential Revision: D9940793

fbshipit-source-id: ea3c6633c481e29fc192cea7465fe3a93cf28f87
2018-09-19 08:29:43 -07:00