From 385f6368f8876e21fd13e29a2b2149e5047bc0c0 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Tue, 17 Oct 2023 16:07:08 +0200 Subject: [PATCH] Add patch for Cordova/PhoneGap Advanced HTTP Plugin --- android-certificate-unpinning.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/android-certificate-unpinning.js b/android-certificate-unpinning.js index 776c24d..3f64ff2 100644 --- a/android-certificate-unpinning.js +++ b/android-certificate-unpinning.js @@ -297,6 +297,23 @@ const PINNING_FIXES = { } ], + // --- Cordova / PhoneGap Advanced HTTP Plugin (https://github.com/silkimen/cordova-plugin-advanced-http) + + // Modern version: + 'com.silkimen.cordovahttp.CordovaServerTrust': [ + { + methodName: '$init', + replacement: () => function () { + // Ignore any attempts to set trust to 'pinned'. Default settings will trust + // our cert because of the separate system-certificate injection step. + if (arguments[0] === 'pinned') { + arguments[0] = 'default'; + } + return this.$init(...arguments); + } + } + ], + // --- Apache Cordova WebViewClient 'org.apache.cordova.CordovaWebViewClient': [