@capgo/cli 4.12.14 → 4.13.3

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.
Files changed (68) hide show
  1. package/dist/index.js +183 -92196
  2. package/package.json +20 -22
  3. package/.github/FUNDING.yml +0 -1
  4. package/.github/workflows/autofix.yml +0 -25
  5. package/.github/workflows/build.yml +0 -46
  6. package/.github/workflows/bump_version.yml +0 -56
  7. package/.github/workflows/check_posix_paths.yml +0 -229
  8. package/.github/workflows/test.yml +0 -30
  9. package/.prettierignore +0 -6
  10. package/.vscode/launch.json +0 -23
  11. package/.vscode/settings.json +0 -46
  12. package/.vscode/tasks.json +0 -42
  13. package/CHANGELOG.md +0 -3356
  14. package/build.mjs +0 -23
  15. package/bun.lockb +0 -0
  16. package/bunfig.toml +0 -2
  17. package/capacitor.config.ts +0 -33
  18. package/crypto_explained.png +0 -0
  19. package/eslint.config.js +0 -10
  20. package/renovate.json +0 -23
  21. package/src/api/app.ts +0 -55
  22. package/src/api/channels.ts +0 -163
  23. package/src/api/crypto.ts +0 -116
  24. package/src/api/devices_override.ts +0 -41
  25. package/src/api/update.ts +0 -13
  26. package/src/api/versions.ts +0 -100
  27. package/src/app/add.ts +0 -158
  28. package/src/app/debug.ts +0 -259
  29. package/src/app/delete.ts +0 -110
  30. package/src/app/info.ts +0 -89
  31. package/src/app/list.ts +0 -67
  32. package/src/app/set.ts +0 -96
  33. package/src/bundle/check.ts +0 -42
  34. package/src/bundle/cleanup.ts +0 -123
  35. package/src/bundle/compatibility.ts +0 -70
  36. package/src/bundle/decrypt.ts +0 -54
  37. package/src/bundle/delete.ts +0 -53
  38. package/src/bundle/encrypt.ts +0 -60
  39. package/src/bundle/list.ts +0 -43
  40. package/src/bundle/unlink.ts +0 -86
  41. package/src/bundle/upload.ts +0 -551
  42. package/src/bundle/zip.ts +0 -143
  43. package/src/channel/add.ts +0 -80
  44. package/src/channel/currentBundle.ts +0 -72
  45. package/src/channel/delete.ts +0 -57
  46. package/src/channel/list.ts +0 -49
  47. package/src/channel/set.ts +0 -177
  48. package/src/index.ts +0 -310
  49. package/src/init.ts +0 -495
  50. package/src/key.ts +0 -136
  51. package/src/login.ts +0 -70
  52. package/src/types/capacitor__cli.d.ts +0 -6
  53. package/src/types/supabase.types.ts +0 -2123
  54. package/src/user/account.ts +0 -11
  55. package/src/utils.ts +0 -1107
  56. package/test/VerifyZip.java +0 -83
  57. package/test/check-posix-paths.js +0 -21
  58. package/test/chunk_convert.ts +0 -28
  59. package/test/data.ts +0 -18769
  60. package/test/test_headers_rls.ts +0 -24
  61. package/test/test_semver.ts +0 -13
  62. package/test/test_upload/app.js +0 -3
  63. package/test/test_upload/assets/check-posix-paths.js +0 -21
  64. package/test/test_upload/index.html +0 -0
  65. package/test/test_zip_swift/Package.resolved +0 -24
  66. package/test/test_zip_swift/Package.swift +0 -29
  67. package/test/test_zip_swift/Sources/main.swift +0 -80
  68. package/tsconfig.json +0 -39
@@ -1,83 +0,0 @@
1
- import java.io.File;
2
- import java.io.FileInputStream;
3
- import java.io.IOException;
4
- import java.io.BufferedInputStream;
5
- import java.io.FileNotFoundException;
6
- import java.io.FileOutputStream;
7
- import java.util.zip.ZipEntry;
8
- import java.util.zip.ZipInputStream;
9
-
10
- public class VerifyZip {
11
- public static void main(String[] args) {
12
- if (args.length < 1) {
13
- System.out.println("Usage: java VerifyZip <zip-file>");
14
- System.exit(1);
15
- }
16
-
17
- String zipFilePath = args[0];
18
- File zipFile = new File(zipFilePath);
19
- File targetDirectory = new File("extracted");
20
-
21
- if (!zipFile.exists()) {
22
- System.out.println("File not found: " + zipFilePath);
23
- System.exit(1);
24
- }
25
-
26
- try (
27
- BufferedInputStream bis = new BufferedInputStream(new FileInputStream(zipFile));
28
- ZipInputStream zis = new ZipInputStream(bis)
29
- ) {
30
- int count;
31
- int bufferSize = 8192;
32
- byte[] buffer = new byte[bufferSize];
33
- long lengthTotal = zipFile.length();
34
- long lengthRead = bufferSize;
35
- int percent = 0;
36
-
37
- ZipEntry entry;
38
- while ((entry = zis.getNextEntry()) != null) {
39
- if (entry.getName().contains("\\")) {
40
- System.out.println("Windows path is not supported: " + entry.getName());
41
- System.exit(1);
42
- }
43
- File file = new File(targetDirectory, entry.getName());
44
- String canonicalPath = file.getCanonicalPath();
45
- String canonicalDir = targetDirectory.getCanonicalPath();
46
- File dir = entry.isDirectory() ? file : file.getParentFile();
47
-
48
- if (!canonicalPath.startsWith(canonicalDir)) {
49
- System.out.println("SecurityException, Failed to ensure directory is the start path: " +
50
- canonicalDir + " of " + canonicalPath);
51
- System.exit(1);
52
- }
53
-
54
- if (!dir.isDirectory() && !dir.mkdirs()) {
55
- System.out.println("Failed to ensure directory: " + dir.getAbsolutePath());
56
- System.exit(1);
57
- }
58
-
59
- if (entry.isDirectory()) {
60
- continue;
61
- }
62
-
63
- try (FileOutputStream outputStream = new FileOutputStream(file)) {
64
- while ((count = zis.read(buffer)) != -1) {
65
- outputStream.write(buffer, 0, count);
66
- }
67
- }
68
-
69
- int newPercent = (int) ((lengthRead / (float) lengthTotal) * 100);
70
- if (lengthTotal > 1 && newPercent != percent) {
71
- percent = newPercent;
72
- }
73
-
74
- lengthRead += entry.getCompressedSize();
75
- }
76
- System.out.println("ZIP file is valid: " + zipFilePath);
77
- } catch (IOException e) {
78
- System.out.println("Failed to process ZIP file: " + zipFilePath);
79
- e.printStackTrace();
80
- System.exit(1);
81
- }
82
- }
83
- }
@@ -1,21 +0,0 @@
1
- const AdmZip = require('adm-zip');
2
-
3
- const zip = new AdmZip('build.zip');
4
- const zipEntries = zip.getEntries(); // an array of ZipEntry records
5
-
6
- let errorFound = false;
7
-
8
- zipEntries.forEach((zipEntry) => {
9
- const entryName = zipEntry.entryName;
10
- if (entryName.includes('\\')) {
11
- console.error(`Non-POSIX path detected: ${entryName}`);
12
- errorFound = true;
13
- }
14
- });
15
-
16
- if (errorFound) {
17
- console.error('Non-POSIX paths detected in the zip file');
18
- process.exit(1);
19
- } else {
20
- console.log('All paths are POSIX compliant.');
21
- }
@@ -1,28 +0,0 @@
1
- import { lorem } from './data'
2
-
3
- const byteConvert = {
4
- 'base64': (s: string) => (3 * (s.length / 4)) - ((s.match(/=/g) || []).length),
5
- 'hex': (s: string) => s.length / 2,
6
- 'binary': (s: string) => s.length / 10,
7
- 'utf8': (s: string) => s.length,
8
- }
9
- const mbConvert = {
10
- 'base64': (l: number) => (3 * (l / 4)),
11
- 'hex': (l: number) => l / 2,
12
- 'binary': (l: number) => l / 10,
13
- 'utf8': (l: number) => l,
14
- }
15
- const oneMb = 1048576;
16
-
17
- const buff = Buffer.from(lorem)
18
- const b64 = buff.toString('base64')
19
- const hex = buff.toString('hex')
20
- const s = buff.toString('utf8')
21
-
22
- const chuckNumber = (l: number, divider: number) => l < divider ? l : Math.round(l / divider)
23
- const chuckSize = (l: number, divider: number) => Math.round(l / chuckNumber(l, divider))
24
-
25
- console.log('buff', buff.length, buff.byteLength, chuckNumber(buff.length, oneMb), chuckSize(buff.length, oneMb))
26
- console.log('b64', b64.length, byteConvert.base64(b64) / oneMb)
27
- console.log('hex', hex.length, byteConvert.hex(hex) / oneMb)
28
- console.log('string', s.length, byteConvert.utf8(s) / oneMb)