@cap-kit/ssl-pinning 8.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapKitSSLPinning.podspec +17 -0
- package/LICENSE +21 -0
- package/Package.swift +25 -0
- package/README.md +750 -0
- package/android/build.gradle +103 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/io/capkit/sslpinning/SSLPinningConfig.kt +22 -0
- package/android/src/main/java/io/capkit/sslpinning/SSLPinningImpl.kt +188 -0
- package/android/src/main/java/io/capkit/sslpinning/SSLPinningPlugin.kt +82 -0
- package/android/src/main/java/io/capkit/sslpinning/utils/SSLPinningLogger.kt +85 -0
- package/android/src/main/java/io/capkit/sslpinning/utils/SSLPinningUtils.kt +44 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/dist/cli/fingerprint.js +163 -0
- package/dist/cli/fingerprint.js.map +1 -0
- package/dist/docs.json +430 -0
- package/dist/esm/cli/fingerprint.d.ts +1 -0
- package/dist/esm/cli/fingerprint.js +161 -0
- package/dist/esm/cli/fingerprint.js.map +1 -0
- package/dist/esm/definitions.d.ts +285 -0
- package/dist/esm/definitions.js +18 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +58 -0
- package/dist/esm/web.js +54 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +95 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +98 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/SSLPinningPlugin/SSLPinningConfig.swift +79 -0
- package/ios/Sources/SSLPinningPlugin/SSLPinningDelegate.swift +81 -0
- package/ios/Sources/SSLPinningPlugin/SSLPinningImpl.swift +111 -0
- package/ios/Sources/SSLPinningPlugin/SSLPinningPlugin.swift +116 -0
- package/ios/Sources/SSLPinningPlugin/Utils/SSLPinningLogger.swift +57 -0
- package/ios/Sources/SSLPinningPlugin/Utils/SSLPinningUtils.swift +47 -0
- package/ios/Sources/SSLPinningPlugin/Version.swift +16 -0
- package/ios/Tests/SSLPinningPluginTests/SSLPinningPluginTests.swift +5 -0
- package/package.json +117 -0
- package/scripts/chmod.js +34 -0
- package/scripts/sync-version.js +49 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
// 1. Setup __dirname equivalent for ES Modules
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
// 2. Load the plugin's package.json
|
|
10
|
+
const pkgPath = path.join(__dirname, '../package.json');
|
|
11
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
12
|
+
|
|
13
|
+
// 3. Automatically find the iOS source directory
|
|
14
|
+
// Capacitor standard structure: ios/Sources/<PluginName>
|
|
15
|
+
const sourcesDir = path.join(__dirname, '../ios/Sources');
|
|
16
|
+
const pluginFolderName = fs.readdirSync(sourcesDir).find((f) => fs.statSync(path.join(sourcesDir, f)).isDirectory());
|
|
17
|
+
|
|
18
|
+
if (!pluginFolderName) {
|
|
19
|
+
console.error('❌ [CapKit] Could not find a source directory in ios/Sources');
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const versionFilePath = path.join(sourcesDir, pluginFolderName, 'Version.swift');
|
|
24
|
+
|
|
25
|
+
const content = `// This file is automatically generated. Do not modify manually.
|
|
26
|
+
import Foundation
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
Container for the plugin's version information.
|
|
30
|
+
This enum provides a centralized, single source of truth for the native
|
|
31
|
+
version string, synchronized directly from the project's 'package.json'.
|
|
32
|
+
It ensures parity across JavaScript, Android, and iOS platforms.
|
|
33
|
+
*/
|
|
34
|
+
public enum PluginVersion {
|
|
35
|
+
/**
|
|
36
|
+
The semantic version string of the plugin.
|
|
37
|
+
Value synchronized from package.json: "${pkg.version}"
|
|
38
|
+
*/
|
|
39
|
+
public static let number = "${pkg.version}"
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
try {
|
|
44
|
+
fs.writeFileSync(versionFilePath, content);
|
|
45
|
+
console.log(`✅ [CapKit] Version.swift updated to v${pkg.version} in ${pluginFolderName}`);
|
|
46
|
+
} catch (err) {
|
|
47
|
+
console.error('❌ [CapKit] Error generating Version.swift:', err);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|