dartmole_plugin 0.2.0 copy "dartmole_plugin: ^0.2.0" to clipboard
dartmole_plugin: ^0.2.0 copied to clipboard

Routes a Flutter app's HTTP through Dartmole, so it can be inspected and mocked.

0.2.0 #

Easier to integrate. Everything in 0.1.0 keeps compiling and working.

  • createHttpClient() returns a client that follows Dartmole for as long as the app keeps it: each new request uses the pairing and intercept switch of that moment, and requests underway finish as they started. One adapter per Dio is now the whole integration, however many Dio instances an app creates, and whenever. The client checks Dartmole on each request rather than listening, so dropped clients leave nothing behind. What the app sets on it (timeouts, credentials, badCertificateCallback, ...) carries over; its own findProxy applies only while Dartmole is off. Migration: remove the Dartmole().addListener(...) that reassigns your adapter. It still works but is no longer needed.
  • Dartmole().rememberPairing() reconnects to the last machine at launch and stores every change, in a file in the app's private storage that is left out of backups. PairingStorage to store it elsewhere. Waits at most wait (two seconds) and never throws. The example's pairing_store.dart is gone.
  • Dartmole.onLog: where the plugin reports problems, debugPrint by default.
  • debugSetPairing and debugReset, so apps can test their own code against paired, switched-off and unpaired states without a network.
  • Dartmole().revision, bumped once per change. enable(), disable() and unpair() no longer notify listeners when they change nothing.
  • On iOS, the panel keeps trying to pair for up to 30 seconds while nothing answers, so pairing finishes once the tester allows local network access, instead of failing behind the prompt. PairingException.unreachable tells that case apart, and its message on iOS points to the Local Network setting.
  • Fixed: scanning a QR code could close the app's own screen as well as the scanner, leaving it blank, because the camera kept reporting the code while the scanner animated away. The scanner also releases its camera now.
  • The README covers Android's cleartext policy, which does not affect pairing, and says that NSLocalNetworkUsageDescription is recommended rather than required: iOS asks for local network access either way.

0.1.0 #

First release.

  • Dartmole().createHttpClient() routes Dart HTTP through a paired Dartmole, trusting its certificate authority alongside the system ones. Unpaired or switched off, it is an ordinary HttpClient.
  • Pairing by QR code or typed address, in the DartmoleSettings panel.
  • Pairing.toJson/fromJson and Dartmole().reconnect for remembering a pairing across launches, with the certificate authority pinned.
  • Also intercept native traffic links to Dartmole's setup page for device-wide interception. UserCertificateTrust.check() tells whether the build can use it; on Android this reads the build's network security config.
  • DartmoleSettings checks that interception works rather than only that it is on: a request down Dart's networking and one down the platform's, with what is missing when either does not reach Dartmole. In code: checkDartTraffic() and checkNativeTraffic(). The plugin now has iOS native code as well as Android.
0
likes
160
points
--
downloads

Documentation

API reference

Publisher

verified publisherskystoneapps.com

Weekly Downloads

Routes a Flutter app's HTTP through Dartmole, so it can be inspected and mocked.

Homepage

Topics

#http #network #debugging #proxy #mock

License

MIT (license)

Dependencies

flutter, mobile_scanner, url_launcher

More

Packages that depend on dartmole_plugin

Packages that implement dartmole_plugin