Browse Source

💥

monorepo
Guillaume Vincent 1 year ago
parent
commit
150216e863
No known key found for this signature in database GPG Key ID: 2F5D4A32E293E1D0
100 changed files with 3255 additions and 2387 deletions
  1. +7
    -2
      .gitignore
  2. +894
    -0
      .yarn/releases/yarn-4.3.1.cjs
  3. +1
    -7
      .yarnrc.yml
  4. +5
    -6
      package.json
  5. +32
    -0
      packages/lesspass-api/package.json
  6. +167
    -0
      packages/lesspass-api/src/index.test.ts
  7. +64
    -0
      packages/lesspass-api/src/index.ts
  8. +1
    -0
      packages/lesspass-api/src/mocks/handlers.ts
  9. +3
    -0
      packages/lesspass-api/src/mocks/node.ts
  10. +6
    -0
      packages/lesspass-api/src/setup.ts
  11. +11
    -0
      packages/lesspass-api/tsconfig.json
  12. +9
    -0
      packages/lesspass-api/tsup.config.ts
  13. +7
    -0
      packages/lesspass-api/vite.config.ts
  14. +0
    -4
      packages/lesspass-crypto/jest.config.js
  15. +12
    -16
      packages/lesspass-crypto/package.json
  16. +1
    -0
      packages/lesspass-crypto/src/index.test.ts
  17. +5
    -5
      packages/lesspass-crypto/tsconfig.json
  18. +9
    -0
      packages/lesspass-crypto/tsup.config.ts
  19. +0
    -4
      packages/lesspass-entropy/jest.config.js
  20. +19
    -31
      packages/lesspass-entropy/package.json
  21. +7
    -6
      packages/lesspass-entropy/src/index.test.ts
  22. +4
    -2
      packages/lesspass-entropy/src/index.ts
  23. +1
    -1
      packages/lesspass-entropy/src/pbkdf2.browser.ts
  24. +100
    -121
      packages/lesspass-entropy/src/pbkdf2.test.ts
  25. +4
    -4
      packages/lesspass-entropy/src/pbkdf2.ts
  26. +0
    -11
      packages/lesspass-entropy/src/stringEncoding.test.ts
  27. +0
    -23
      packages/lesspass-entropy/src/stringEncoding.ts
  28. +7
    -7
      packages/lesspass-entropy/tsconfig.json
  29. +21
    -0
      packages/lesspass-entropy/tsup.config.ts
  30. +0
    -4
      packages/lesspass-fingerprint/jest.config.js
  31. +20
    -31
      packages/lesspass-fingerprint/package.json
  32. +1
    -1
      packages/lesspass-fingerprint/src/fingerprint.ts
  33. +1
    -1
      packages/lesspass-fingerprint/src/hmac.browser.ts
  34. +3
    -4
      packages/lesspass-fingerprint/src/hmac.ts
  35. +38
    -39
      packages/lesspass-fingerprint/src/index.test.ts
  36. +2
    -2
      packages/lesspass-fingerprint/src/index.ts
  37. +7
    -6
      packages/lesspass-fingerprint/tsconfig.json
  38. +21
    -0
      packages/lesspass-fingerprint/tsup.config.ts
  39. +0
    -6
      packages/lesspass-mobile/.buckconfig
  40. +2
    -13
      packages/lesspass-mobile/.eslintrc.js
  41. +10
    -8
      packages/lesspass-mobile/.gitignore
  42. +0
    -1
      packages/lesspass-mobile/.node-version
  43. +7
    -0
      packages/lesspass-mobile/.prettierrc.js
  44. +0
    -1
      packages/lesspass-mobile/.ruby-version
  45. +1
    -1
      packages/lesspass-mobile/.watchmanconfig
  46. +2
    -2
      packages/lesspass-mobile/App.tsx
  47. +5
    -2
      packages/lesspass-mobile/Gemfile
  48. +3
    -0
      packages/lesspass-mobile/__tests__/App.test.tsx
  49. +0
    -55
      packages/lesspass-mobile/android/app/_BUCK
  50. +70
    -255
      packages/lesspass-mobile/android/app/build.gradle
  51. +0
    -19
      packages/lesspass-mobile/android/app/build_defs.bzl
  52. +1
    -5
      packages/lesspass-mobile/android/app/src/debug/AndroidManifest.xml
  53. +0
    -73
      packages/lesspass-mobile/android/app/src/debug/java/com/lesspass/ReactNativeFlipper.java
  54. +2
    -5
      packages/lesspass-mobile/android/app/src/main/AndroidManifest.xml
  55. +1
    -1
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/Crypto.java
  56. +1
    -1
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/LessPassClipboardModule.java
  57. +1
    -1
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/LessPassModule.java
  58. +1
    -1
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/LessPassPackage.java
  59. +22
    -0
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/MainActivity.kt
  60. +44
    -0
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/MainApplication.kt
  61. +0
    -55
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/MainActivity.java
  62. +0
    -92
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/MainApplication.java
  63. +0
    -116
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/newarchitecture/MainApplicationReactNativeHost.java
  64. +0
    -36
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/newarchitecture/components/MainComponentsRegistry.java
  65. +0
    -48
      packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java
  66. +0
    -7
      packages/lesspass-mobile/android/app/src/main/jni/CMakeLists.txt
  67. +0
    -32
      packages/lesspass-mobile/android/app/src/main/jni/MainApplicationModuleProvider.cpp
  68. +0
    -16
      packages/lesspass-mobile/android/app/src/main/jni/MainApplicationModuleProvider.h
  69. +0
    -45
      packages/lesspass-mobile/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp
  70. +0
    -38
      packages/lesspass-mobile/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h
  71. +0
    -65
      packages/lesspass-mobile/android/app/src/main/jni/MainComponentsRegistry.cpp
  72. +0
    -32
      packages/lesspass-mobile/android/app/src/main/jni/MainComponentsRegistry.h
  73. +0
    -11
      packages/lesspass-mobile/android/app/src/main/jni/OnLoad.cpp
  74. +3
    -2
      packages/lesspass-mobile/android/app/src/main/res/drawable/rn_edit_text_material.xml
  75. +0
    -31
      packages/lesspass-mobile/android/app/src/test/java/com/lesspass/CryptoTest.java
  76. +9
    -38
      packages/lesspass-mobile/android/build.gradle
  77. +4
    -3
      packages/lesspass-mobile/android/gradle.properties
  78. BIN
      packages/lesspass-mobile/android/gradle/wrapper/gradle-wrapper.jar
  79. +3
    -1
      packages/lesspass-mobile/android/gradle/wrapper/gradle-wrapper.properties
  80. +29
    -14
      packages/lesspass-mobile/android/gradlew
  81. +20
    -17
      packages/lesspass-mobile/android/gradlew.bat
  82. +0
    -22
      packages/lesspass-mobile/android/privacy-policy.md
  83. +2
    -9
      packages/lesspass-mobile/android/settings.gradle
  84. +1
    -1
      packages/lesspass-mobile/app.json
  85. +1
    -6
      packages/lesspass-mobile/babel.config.js
  86. +0
    -2
      packages/lesspass-mobile/ios/LessPass-Bridging-Header.h
  87. +113
    -127
      packages/lesspass-mobile/ios/LessPass.xcodeproj/project.pbxproj
  88. +7
    -0
      packages/lesspass-mobile/ios/LessPass.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  89. +2
    -2
      packages/lesspass-mobile/ios/LessPass.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  90. +1
    -1
      packages/lesspass-mobile/ios/LessPass.xcodeproj/xcshareddata/xcschemes/LessPass.xcscheme
  91. +2
    -4
      packages/lesspass-mobile/ios/LessPass/AppDelegate.h
  92. +8
    -110
      packages/lesspass-mobile/ios/LessPass/AppDelegate.mm
  93. +9
    -12
      packages/lesspass-mobile/ios/LessPass/Info.plist
  94. +38
    -0
      packages/lesspass-mobile/ios/LessPass/PrivacyInfo.xcprivacy
  95. +8
    -0
      packages/lesspass-mobile/ios/LessPassModule.h
  96. +79
    -12
      packages/lesspass-mobile/ios/LessPassModule.m
  97. +0
    -131
      packages/lesspass-mobile/ios/LessPassModule.swift
  98. +2
    -2
      packages/lesspass-mobile/ios/LessPassTests/Info.plist
  99. +18
    -21
      packages/lesspass-mobile/ios/Podfile
  100. +1233
    -438
      packages/lesspass-mobile/ios/Podfile.lock

+ 7
- 2
.gitignore View File

@@ -6,5 +6,10 @@ node_modules
package-lock.json
default.nix
.envrc
.yarn
.pnp.*
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

+ 894
- 0
.yarn/releases/yarn-4.3.1.cjs
File diff suppressed because it is too large
View File


+ 1
- 7
.yarnrc.yml View File

@@ -1,9 +1,3 @@
nodeLinker: node-modules

plugins:
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

yarnPath: .yarn/releases/yarn-3.5.0.cjs
yarnPath: .yarn/releases/yarn-4.3.1.cjs

+ 5
- 6
package.json View File

@@ -1,6 +1,5 @@
{
"name": "lesspass-root",
"description": "Stateless Password Manager",
"name": "lesspass-monorepo",
"repository": "git@github.com:lesspass/lesspass.git",
"author": "Guillaume Vincent <guillaume@oslab.fr>",
"license": "GPL-3.0",
@@ -11,9 +10,9 @@
]
},
"scripts": {
"build": "yarn workspaces foreach -v --topological-dev run build",
"clean": "yarn workspaces foreach -v run clean && rm -rf node_modules && rm -rf .yarn",
"test": "yarn workspaces foreach -v run test"
"build": "yarn workspaces foreach --verbose --all --topological-dev run build",
"clean": "yarn workspaces foreach --verbose --all run clean && rm -rf node_modules",
"test": "yarn workspaces foreach --verbose --all run test"
},
"packageManager": "yarn@3.5.0"
"packageManager": "yarn@4.3.1"
}

+ 32
- 0
packages/lesspass-api/package.json View File

@@ -0,0 +1,32 @@
{
"name": "lesspass-api",
"version": "0.1.0",
"description": "LessPass API functions",
"license": "GPL-3.0",
"author": "Guillaume Vincent <guillaume@oslab.fr>",
"type": "module",
"types": "./dist/index.d.ts",
"exports": "./dist/index.js",
"files": [
"dist"
],
"engines": {
"node": ">=20"
},
"scripts": {
"clean": "rm -rf node_modules && rm -f tsconfig.tsbuildinfo && rm -rf dist",
"build": "tsup",
"test": "vitest run",
"test:watch": "vitest watch"
},
"dependencies": {
"axios": "^1.7.2",
"lesspass": "workspace:^"
},
"devDependencies": {
"msw": "^2.3.2",
"tsup": "^8.2.2",
"typescript": "^5.5.3",
"vitest": "^2.0.4"
}
}

+ 167
- 0
packages/lesspass-api/src/index.test.ts View File

@@ -0,0 +1,167 @@
import { http, HttpResponse } from "msw";
import { expect, test } from "vitest";
import { server } from "./mocks/node";
import {
signIn,
refreshTokens,
getPasswords,
updatePassword,
deletePassword,
defaultBaseUrl,
setBaseUrl,
} from ".";

test("signIn", async () => {
const expectedTokens = {
refresh:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
access:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.lLgLXPO4CrjE68Q8_I9KdADR_E3mEsE-5B8aDwj0UX4",
};
const email = "test@lesspass.com";
const password = "password";
server.use(
http.post(
"https://api.lesspass.com/auth/jwt/create/",
async ({ request }) => {
const payload = await request.json();
expect(payload).toEqual({ email, password });
return HttpResponse.json(expectedTokens);
},
),
);
const tokens = await signIn(email, password);
expect(tokens).toEqual(expectedTokens);
});

test("refreshTokens", async () => {
const expectedTokens = {
refresh:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.56Hg2Q94o6JPPVY_N3pIxqups6R_YY40U1o35O1BNRE",
access:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.lLgLXPO4CrjE68Q8_I9KdADR_E3mEsE-5B8aDwj0UX4",
};
const refreshToken =
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c";

server.use(
http.post(
"https://api.lesspass.com/auth/jwt/refresh/",
async ({ request }) => {
const payload = await request.json();
expect(payload).toEqual({ refreshToken });
return HttpResponse.json(expectedTokens);
},
),
);
const tokens = await refreshTokens(refreshToken);
expect(tokens).toEqual(expectedTokens);
});

test("getPasswords", async () => {
const expectedPasswords = {
count: 1,
next: null,
previous: null,
results: [
{
id: "3b9e3079-38d2-4208-8b44-53c5fb788088",
login: "contact@example.org",
site: "example.org",
lowercase: true,
uppercase: true,
symbols: true,
digits: false,
counter: 1,
length: 16,
created: "2017-07-30T18:09:04.901953Z",
modified: "2023-02-28T14:02:19.719490Z",
},
],
};

server.use(
http.get("https://api.lesspass.com/passwords/", () => {
return HttpResponse.json(expectedPasswords);
}),
);
const passwords = await getPasswords();
expect(passwords).toEqual(expectedPasswords);
});

test("updatePassword", async () => {
const password = {
id: "3b9e3079-38d2-4208-8b44-53c5fb788088",
login: "contact@example.org",
site: "example.org",
lowercase: true,
uppercase: true,
symbols: true,
digits: false,
counter: 1,
length: 16,
created: "2017-07-30T18:09:04.901953Z",
modified: "2023-02-28T14:02:19.719490Z",
};

server.use(
http.put(
"https://api.lesspass.com/passwords/3b9e3079-38d2-4208-8b44-53c5fb788088/",
async ({ request }) => {
const payload = await request.json();
expect(payload).toEqual(password);
return HttpResponse.json(password);
},
),
);
const updatedPassword = await updatePassword(password);
expect(updatedPassword).toEqual(password);
});

test("deletePassword", async () => {
const password = {
id: "3b9e3079-38d2-4208-8b44-53c5fb788088",
login: "contact@example.org",
site: "example.org",
lowercase: true,
uppercase: true,
symbols: true,
digits: false,
counter: 1,
length: 16,
created: "2017-07-30T18:09:04.901953Z",
modified: "2023-02-28T14:02:19.719490Z",
};

server.use(
http.delete(
"https://api.lesspass.com/passwords/3b9e3079-38d2-4208-8b44-53c5fb788088/",
() => {
return new HttpResponse(null, { status: 204 });
},
),
);
await deletePassword(password);
});

test("defaultBaseUrl", () => {
expect(defaultBaseUrl).toBe("https://api.lesspass.com");
});

test("setBaseUrl", async () => {
const expectedTokens = {
refresh:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
access:
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.lLgLXPO4CrjE68Q8_I9KdADR_E3mEsE-5B8aDwj0UX4",
};
server.use(
http.post("https://api.example.org/auth/jwt/create/", () => {
return HttpResponse.json(expectedTokens);
}),
);

setBaseUrl("https://api.example.org");
const tokens = await signIn("test@lesspass.com", "password");
expect(tokens).toEqual(expectedTokens);
});

+ 64
- 0
packages/lesspass-api/src/index.ts View File

@@ -0,0 +1,64 @@
import axios from "axios";
import { PasswordProfile } from "lesspass";

export const defaultBaseUrl = "https://api.lesspass.com";

axios.defaults.baseURL = defaultBaseUrl;

export function setBaseUrl(baseUrl: string) {
axios.defaults.baseURL = baseUrl;
}

export type AccessToken = string;
export type RefreshToken = string;

export type AuthSuccessResponsePayload = {
access: AccessToken;
refresh: RefreshToken;
};

export function signIn(
email: string,
password: string,
): Promise<AuthSuccessResponsePayload> {
return axios
.post("/auth/jwt/create/", { email, password })
.then((response) => response.data);
}

export function refreshTokens(
refreshToken: RefreshToken,
): Promise<AuthSuccessResponsePayload> {
return axios
.post("/auth/jwt/refresh/", { refreshToken })
.then((response) => response.data);
}

interface PasswordProfileApi extends PasswordProfile {
id: string;
created: string;
modified: string;
}

export type GetPasswordResponsePayload = {
count: number;
next: string | null;
previous: string | null;
results: PasswordProfileApi[];
};

export function getPasswords(): Promise<GetPasswordResponsePayload> {
return axios.get("/passwords/").then((response) => response.data);
}

export function updatePassword(
password: PasswordProfileApi,
): Promise<PasswordProfileApi> {
return axios
.put(`/passwords/${password.id}/`, password)
.then((response) => response.data);
}

export function deletePassword(password: PasswordProfileApi): Promise<void> {
return axios.delete(`/passwords/${password.id}/`).then(() => void 0);
}

+ 1
- 0
packages/lesspass-api/src/mocks/handlers.ts View File

@@ -0,0 +1 @@
export const handlers = [];

+ 3
- 0
packages/lesspass-api/src/mocks/node.ts View File

@@ -0,0 +1,3 @@
import { setupServer } from "msw/node";
import { handlers } from "./handlers";
export const server = setupServer(...handlers);

+ 6
- 0
packages/lesspass-api/src/setup.ts View File

@@ -0,0 +1,6 @@
import { beforeAll, afterEach, afterAll } from "vitest";
import { server } from "./mocks/node";

beforeAll(() => server.listen({ onUnhandledRequest: "error" }));
afterEach(() => server.resetHandlers());
afterAll(() => server.close());

+ 11
- 0
packages/lesspass-api/tsconfig.json View File

@@ -0,0 +1,11 @@
{
"compilerOptions": {
"module": "ES6",
"moduleResolution": "Node",
"outDir": "dist",
"strict": true,
"target": "ES6"
},
"include": ["src"],
"exclude": ["src/**/*.test.ts*"]
}

+ 9
- 0
packages/lesspass-api/tsup.config.ts View File

@@ -0,0 +1,9 @@
import { defineConfig } from "tsup";

export default defineConfig({
name: "node",
entry: ["./src/index.ts"],
format: ["esm"],
clean: true,
dts: true
});

+ 7
- 0
packages/lesspass-api/vite.config.ts View File

@@ -0,0 +1,7 @@
import { defineConfig } from "vitest/config";

export default defineConfig({
test: {
setupFiles: ['./src/setup.ts'],
},
});

+ 0
- 4
packages/lesspass-crypto/jest.config.js View File

@@ -1,4 +0,0 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};

+ 12
- 16
packages/lesspass-crypto/package.json View File

@@ -4,28 +4,24 @@
"description": "LessPass cryptographic functions",
"license": "GPL-3.0",
"author": "Guillaume Vincent <guillaume@oslab.fr>",
"type": "module",
"types": "./dist/index.d.ts",
"exports": "./dist/index.js",
"files": [
"dist",
"src"
"dist"
],
"exports": {
"development": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"engines": {
"node": ">=14"
"node": ">=20"
},
"scripts": {
"test": "jest",
"build": "yarn clean && tsc",
"clean": "rm -rf dist tsconfig.tsbuildinfo"
"clean": "rm -rf node_modules && rm -rf dist",
"build": "tsup",
"test": "vitest run",
"test:watch": "vitest watch"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.2",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5"
"tsup": "^8.2.2",
"typescript": "^5.5.3",
"vitest": "^2.0.4"
}
}

+ 1
- 0
packages/lesspass-crypto/src/index.test.ts View File

@@ -1,3 +1,4 @@
import { expect, test } from "vitest";
import { stringToArrayBuffer, arrayBufferToHex, getAlgorithm } from ".";

test("stringToArrayBuffer", () => {


+ 5
- 5
packages/lesspass-crypto/tsconfig.json View File

@@ -1,11 +1,11 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist",
"rootDir": "src",
"composite": true,
"lib": ["ES6", "ES2017.String"]
"module": "ES6",
"outDir": "dist",
"strict": true,
"target": "ES6"
},
"include": ["src"],
"exclude": ["src/**/*.test.ts"]
"exclude": ["src/**/*.test.ts*"]
}

+ 9
- 0
packages/lesspass-crypto/tsup.config.ts View File

@@ -0,0 +1,9 @@
import { defineConfig } from "tsup";

export default defineConfig({
name: "node",
entry: ["./src/index.ts"],
format: ["esm"],
clean: true,
dts: true
});

+ 0
- 4
packages/lesspass-entropy/jest.config.js View File

@@ -1,4 +0,0 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};

+ 19
- 31
packages/lesspass-entropy/package.json View File

@@ -4,46 +4,34 @@
"description": "LessPass module used to generate entropy for password generation",
"license": "GPL-3.0",
"author": "Guillaume Vincent <guillaume@oslab.fr>",
"files": [
"dist",
"src"
],
"type": "module",
"types": "./dist/index.d.ts",
"exports": {
".": {
"development": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./src/pbkdf2.js": {
"node": {
"development": "./src/pbkdf2.js",
"types": "./dist/pbkdf2.d.ts",
"default": "./dist/pbkdf2.js"
},
"browser": {
"development": "./src/pbkdf2.browser.ts",
"types": "./dist/pbkdf2.browser.d.ts",
"default": "./dist/pbkdf2.browser.js"
}
}
"node": "./dist/index.js",
"browser": "./dist/index.browser.js",
"default": "./dist/index.browser.js"
},
"browser": {
"./src/pbkdf2.ts": "./src/pbkdf2.browser.ts"
},
"files": [
"dist"
],
"engines": {
"node": ">=14"
"node": ">=20"
},
"scripts": {
"test": "jest",
"build": "yarn clean && tsc",
"clean": "rm -rf dist tsconfig.tsbuildinfo"
"clean": "rm -rf node_modules && rm -f tsconfig.tsbuildinfo && rm -rf dist",
"build": "tsup",
"test": "vitest run",
"test:watch": "vitest watch"
},
"dependencies": {
"lesspass-crypto": "workspace:*"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.2",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"jest": "^29.5.0",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5"
"tsup": "^8.2.2",
"typescript": "^5.5.3",
"vitest": "^2.0.4"
}
}

+ 7
- 6
packages/lesspass-entropy/src/index.test.ts View File

@@ -1,7 +1,8 @@
import { expect, describe, test } from "vitest";
import { calcEntropy, isSupported } from ".";

describe("entropy", () => {
it("calc entropy without crypto use default options and crypto", () => {
test("calc entropy without crypto use default options and crypto", () => {
const profile = {
site: "example.org",
login: "contact@example.org",
@@ -14,7 +15,7 @@ describe("entropy", () => {
).toBe(entropy);
});
});
it("calc entropy pbkdf2 with default params (100000 iterations, 32 bytes length, sha256 digest)", () => {
test("calc entropy pbkdf2 with default params (100000 iterations, 32 bytes length, sha256 digest)", () => {
const profile = {
site: "example.org",
login: "contact@example.org",
@@ -32,7 +33,7 @@ describe("entropy", () => {
).toBe(entropy);
});
});
it("calc entropy pbkdf2 with unicode char", () => {
test("calc entropy pbkdf2 with unicode char", () => {
const profile = {
site: "example.org",
login: "❤",
@@ -50,7 +51,7 @@ describe("entropy", () => {
).toBe(entropy);
});
});
it("calc entropy with different options (8192 iterations, 16 bytes length, sha512 digest)", () => {
test("calc entropy with different options (8192 iterations, 16 bytes length, sha512 digest)", () => {
const profile = {
site: "example.org",
login: "contact@example.org",
@@ -67,7 +68,7 @@ describe("entropy", () => {
expect("fff211c16a4e776b3574c6a5c91fd252").toBe(entropy);
});
});
it("calc entropy are different if counter are different", () => {
test("calc entropy are different if counter are different", () => {
const profile = {
site: "example.org",
login: "contact@example.org",
@@ -89,7 +90,7 @@ describe("entropy", () => {
});

describe("isSupported", () => {
it("isSupported", () =>
test("isSupported", () =>
isSupported().then((supported) => {
expect(supported).toBe(true);
}));


+ 4
- 2
packages/lesspass-entropy/src/index.ts View File

@@ -1,15 +1,17 @@
import pbkdf2 from "./pbkdf2";
import { pbkdf2 } from "./pbkdf2";

export interface SiteLoginCounter {
interface SiteLoginCounter {
site: string;
login: string;
counter: number;
}

interface Crypto {
iterations?: number;
keylen?: number;
digest?: string;
}

export function calcEntropy(
siteLoginAndCounter: SiteLoginCounter & { [k: string]: unknown },
masterPassword: string,


+ 1
- 1
packages/lesspass-entropy/src/pbkdf2.browser.ts View File

@@ -4,7 +4,7 @@ import {
getAlgorithm,
} from "lesspass-crypto";

export default function pbkdf2(
export function pbkdf2(
password: string,
salt: string,
iterations: number,


+ 100
- 121
packages/lesspass-entropy/src/pbkdf2.test.ts View File

@@ -1,124 +1,103 @@
import pbkdf2 from "./pbkdf2";
import { expect, test } from "vitest";
import { pbkdf2 } from "./pbkdf2";

describe("pbkdf2", () => {
it("secret, salt, 2 iterations, 32 keylen, sha256 hash", () =>
pbkdf2("secret", "salt", 2, 32, "sha256").then((key) => {
test("secret, salt, 2 iterations, 32 keylen, sha256 hash", () =>
pbkdf2("secret", "salt", 2, 32, "sha256").then((key) => {
expect(
"f92f45f9df4c2aeabae1ed3c16f7b64660c1f8e377fa9b4699b23c2c3a29f569"
).toBe(key);
}));
test("use pbkdf2 with 8192 iterations and sha256", () =>
pbkdf2("password", "test@example.org", 8192, 32, "sha256").then((key) => {
expect(
"d8af5f918db6b65b1db3d3984e5a400e39e1dbb19462220e4431de283809f472"
).toBe(key);
}));
test("customize number of iterations", () =>
pbkdf2("password", "test@example.org", 4096, 32, "sha256").then((key) => {
expect(
"0a91208545e3aa4935d3a22984ca097a7669259a04d261ac16361bdc1a2e960f"
).toBe(key);
}));
test("customize key length", () =>
pbkdf2("password", "test@example.org", 8192, 16, "sha256").then((key) => {
expect("d8af5f918db6b65b1db3d3984e5a400e").toBe(key);
}));
test("customize iterations and key length", () =>
pbkdf2("password", "test@example.org", 4096, 16, "sha256").then((key) => {
expect("0a91208545e3aa4935d3a22984ca097a").toBe(key);
}));
test("utf8 parameter", () =>
pbkdf2("♥ LessPass ♥", "test@example.org", 8192, 32, "sha256").then((key) => {
expect(
"997fe81d3d0db236e039c75efdb487f17a902fdf94f9dacaa9884329c85d9651"
).toBe(key);
}));
test("auto generated test 0", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then((key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}));
test("auto generated test 1", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then((key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}));
test("auto generated test 2", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then((key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}));
test("auto generated test 3", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then((key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}));
test("auto generated test 4", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then((key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}));
test("auto generated test 5", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then((key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}));
test("auto generated test 6", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then((key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}));
test("auto generated test 7", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then((key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}));
test("auto generated test 8", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then((key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}));
test("auto generated test 9", () =>
pbkdf2("password", "lesspass", 8192, 32, "sha256").then((key) => {
expect(
"7d05ee25597dcc3ac16d082aa910e7707f75be620ed8db5bef7245e2a8579116"
).toBe(key);
}));
test("auto generated test 10", () =>
pbkdf2("password2", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"f92f45f9df4c2aeabae1ed3c16f7b64660c1f8e377fa9b4699b23c2c3a29f569"
"ce853092fc54fe88c281e38df97bd5826d64e6bee315dc94939cbba8930df0e4"
).toBe(key);
}));
it("use pbkdf2 with 8192 iterations and sha256", () =>
pbkdf2("password", "test@example.org", 8192, 32, "sha256").then((key) => {
expect(
"d8af5f918db6b65b1db3d3984e5a400e39e1dbb19462220e4431de283809f472"
).toBe(key);
}));
it("customize number of iterations", () =>
pbkdf2("password", "test@example.org", 4096, 32, "sha256").then((key) => {
expect(
"0a91208545e3aa4935d3a22984ca097a7669259a04d261ac16361bdc1a2e960f"
).toBe(key);
}));
it("customize key length", () =>
pbkdf2("password", "test@example.org", 8192, 16, "sha256").then((key) => {
expect("d8af5f918db6b65b1db3d3984e5a400e").toBe(key);
}));
it("customize iterations and key length", () =>
pbkdf2("password", "test@example.org", 4096, 16, "sha256").then((key) => {
expect("0a91208545e3aa4935d3a22984ca097a").toBe(key);
}));
it("utf8 parameter", () =>
pbkdf2("♥ LessPass ♥", "test@example.org", 8192, 32, "sha256").then(
(key) => {
expect(
"997fe81d3d0db236e039c75efdb487f17a902fdf94f9dacaa9884329c85d9651"
).toBe(key);
}
));
it("auto generated test 0", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}
));
it("auto generated test 1", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}
));
it("auto generated test 2", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}
));
it("auto generated test 3", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}
));
it("auto generated test 4", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}
));
it("auto generated test 5", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}
));
it("auto generated test 6", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}
));
it("auto generated test 7", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}
));
it("auto generated test 8", () =>
pbkdf2("password", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"63d850713d0b2f7f2c4396fe93f4ac0c6bc7485f9e7473c4b8c4a33ec12199c0"
).toBe(key);
}
));
it("auto generated test 9", () =>
pbkdf2("password", "lesspass", 8192, 32, "sha256").then((key) => {
expect(
"7d05ee25597dcc3ac16d082aa910e7707f75be620ed8db5bef7245e2a8579116"
).toBe(key);
}));
it("auto generated test 10", () =>
pbkdf2("password2", "contact@lesspass.com", 8192, 32, "sha256").then(
(key) => {
expect(
"ce853092fc54fe88c281e38df97bd5826d64e6bee315dc94939cbba8930df0e4"
).toBe(key);
}
));
});
}
));

+ 4
- 4
packages/lesspass-entropy/src/pbkdf2.ts View File

@@ -1,14 +1,14 @@
import crypto from "crypto";
import { pbkdf2 as cryptoPbkdf2 } from "crypto";

export default function pbkdf2(
export function pbkdf2(
password: string,
salt: string,
iterations: number,
keylen: number,
digest: string
):Promise<string> {
): Promise<string> {
return new Promise((resolve, reject) => {
crypto.pbkdf2(password, salt, iterations, keylen, digest, (error, key) => {
cryptoPbkdf2(password, salt, iterations, keylen, digest, (error, key) => {
if (error) {
reject(error);
} else {


+ 0
- 11
packages/lesspass-entropy/src/stringEncoding.test.ts View File

@@ -1,11 +0,0 @@
import { stringToArrayBuffer, arrayBufferToHex } from "./stringEncoding";

describe("stringEncoding", () => {
it("stringToArrayBuffer", () => {
expect(stringToArrayBuffer("ȧ")[0]).toBe(200);
expect(stringToArrayBuffer("ȧ")[1]).toBe(167);
});
it("arrayBufferToHex", () => {
expect(arrayBufferToHex(new Uint8Array([200, 167]))).toBe("c8a7");
});
});

+ 0
- 23
packages/lesspass-entropy/src/stringEncoding.ts View File

@@ -1,23 +0,0 @@
export function stringToArrayBuffer(string: string) {
const base64String = unescape(encodeURIComponent(string));
const charList = base64String.split("");
const arrayBuffer: number[] = [];
for (let i = 0; i < charList.length; i += 1) {
arrayBuffer.push(charList[i].charCodeAt(0));
}
return new Uint8Array(arrayBuffer);
}

export function arrayBufferToHex(arrayBuffer: Iterable<number>) {
const byteArray = new Uint8Array(arrayBuffer);
let str = "";
for (let i = 0; i < byteArray.byteLength; i += 1) {
str += byteArray[i].toString(16).padStart(2, "0");
}
return str;
}

export default {
stringToArrayBuffer,
arrayBufferToHex,
};

+ 7
- 7
packages/lesspass-entropy/tsconfig.json View File

@@ -1,15 +1,15 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"module": "ES6",
"moduleResolution": "node",
"outDir": "dist",
"rootDir": "src",
"composite": true,
"lib": ["ES6", "ES2017.String", "DOM"],
"paths": {
"lesspass-crypto": ["../lesspass-crypto/src/index.ts"]
}
"lesspass-crypto": ["../lesspass-crypto"]
},
"strict": true,
"target": "ES6"
},
"include": ["src"],
"exclude": ["src/**/*.test.ts"],
"exclude": ["src/**/*.test.ts*"],
"references": [{ "path": "../lesspass-crypto" }]
}

+ 21
- 0
packages/lesspass-entropy/tsup.config.ts View File

@@ -0,0 +1,21 @@
import { defineConfig } from "tsup";

export default defineConfig([
{
name: "browser",
entry: { "index.browser": "./src/index.ts" },
format: ["esm"],
platform: "browser",
clean: true,
dts: true,
splitting: false
},
{
name: "node",
entry: ["./src/index.ts"],
format: ["esm"],
clean: true,
dts: true,
splitting: false
},
]);

+ 0
- 4
packages/lesspass-fingerprint/jest.config.js View File

@@ -1,4 +0,0 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};

+ 20
- 31
packages/lesspass-fingerprint/package.json View File

@@ -4,46 +4,35 @@
"description": "LessPass node module used to get fingerprint for 256 bytes string",
"author": "Guillaume Vincent <guillaume@oslab.fr>",
"license": "GPL-3.0",
"files": [
"dist",
"src"
],
"type": "module",
"types": "./dist/index.d.ts",
"exports": {
".": {
"development": "./src/index.ts",
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./src/hmac.ts": {
"node": {
"development": "./src/hmac.ts",
"types": "./dist/hmac.d.ts",
"default": "./dist/hmac.js"
},
"browser": {
"development": "./src/hmac.browser.ts",
"types": "./dist/hmac.browser.d.ts",
"default": "./dist/hmac.browser.js"
}
}
"node": "./dist/index.js",
"browser": "./dist/index.browser.js",
"default": "./dist/index.browser.js"
},
"browser": {
"./src/hmac.ts": "./src/hmac.browser.ts"
},
"files": [
"dist"
],
"engines": {
"node": ">=14"
"node": ">=20"
},
"scripts": {
"test": "jest",
"build": "yarn clean && tsc",
"clean": "rm -rf dist tsconfig.tsbuildinfo"
"clean": "rm -rf node_modules && rm -f tsconfig.tsbuildinfo && rm -rf dist",
"build": "tsup",
"test": "vitest run",
"test:watch": "vitest watch"
},
"dependencies": {
"lesspass-crypto": "workspace:*"
},
"devDependencies": {
"@tsconfig/recommended": "^1.0.2",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"jest": "^29.5.0",
"ts-jest": "^29.0.5",
"typescript": "^4.9.5"
"@types/node": "^20.14.11",
"tsup": "^8.2.2",
"typescript": "^5.5.3",
"vitest": "^2.0.4"
}
}

+ 1
- 1
packages/lesspass-fingerprint/src/fingerprint.ts View File

@@ -72,7 +72,7 @@ export function getIcon(hash: string) {
return icons[index];
}

export default function generateFingerprint(hmacSHA256: string) {
export function createFingerprint(hmacSHA256: string) {
const fingerprint = [];
const hash1 = hmacSHA256.substring(0, 6);
fingerprint.push({


+ 1
- 1
packages/lesspass-fingerprint/src/hmac.browser.ts View File

@@ -4,7 +4,7 @@ import {
getAlgorithm,
} from "lesspass-crypto";

export default function hmac(algorithm: string, key: string, data?: string) {
export function hmac(algorithm: string, key: string, data?: string) {
return window.crypto.subtle
.importKey(
"raw",


+ 3
- 4
packages/lesspass-fingerprint/src/hmac.ts View File

@@ -1,14 +1,13 @@
import crypto, { BinaryLike } from "crypto";
import { createHmac, BinaryLike } from "crypto";

export default function hmac(
export function hmac(
algorithm: string,
key: BinaryLike,
data?: BinaryLike
): Promise<string> {
return new Promise((resolve) => {
resolve(
crypto
.createHmac(algorithm, key)
createHmac(algorithm, key)
.update(data || "")
.digest("hex")
);


+ 38
- 39
packages/lesspass-fingerprint/src/index.test.ts View File

@@ -1,44 +1,43 @@
import { expect, test } from "vitest";
import { createFingerprint, createHmac } from ".";

describe("api", () => {
it("createHmac", () =>
createHmac("sha256", "password").then((fingerprint) => {
expect(
"e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e"
).toBe(fingerprint);
}));
it("createHmac and update", () =>
createHmac("sha256", "password", "salt").then((fingerprint) => {
expect(
"fc328232993ff34ca56631e4a101d60393cad12171997ee0b562bf7852b2fed0"
).toBe(fingerprint);
}));
it("fingerprint is length of 3", () => {
test("createHmac", () =>
createHmac("sha256", "password").then((fingerprint) => {
expect(
createFingerprint(
"e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e"
).length
).toBe(3);
});
it("fingerprint is length of 3", () => {
const expectedFingerprint = [
{
color: "#FFB5DA",
icon: "fa-flask",
},
{
color: "#009191",
icon: "fa-archive",
},
{
color: "#B5DAFE",
icon: "fa-beer",
},
];
"e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e"
).toBe(fingerprint);
}));
test("createHmac and update", () =>
createHmac("sha256", "password", "salt").then((fingerprint) => {
expect(
createFingerprint(
"e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e"
)
).toEqual(expectedFingerprint);
});
"fc328232993ff34ca56631e4a101d60393cad12171997ee0b562bf7852b2fed0"
).toBe(fingerprint);
}));
test("fingerprint is length of 3", () => {
expect(
createFingerprint(
"e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e"
).length
).toBe(3);
});
test("fingerprint is length of 3", () => {
const expectedFingerprint = [
{
color: "#FFB5DA",
icon: "fa-flask",
},
{
color: "#009191",
icon: "fa-archive",
},
{
color: "#B5DAFE",
icon: "fa-beer",
},
];
expect(
createFingerprint(
"e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e"
)
).toEqual(expectedFingerprint);
});

+ 2
- 2
packages/lesspass-fingerprint/src/index.ts View File

@@ -1,5 +1,5 @@
import createFingerprint from "./fingerprint";
import createHmac from "./hmac";
import { createFingerprint } from "./fingerprint";
import { hmac as createHmac } from "./hmac";

export { createFingerprint, createHmac };



+ 7
- 6
packages/lesspass-fingerprint/tsconfig.json View File

@@ -1,14 +1,15 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"lib": ["DOM", "ES2015"],
"module": "ES6",
"outDir": "dist",
"rootDir": "src",
"composite": true,
"paths": {
"lesspass-crypto": ["../lesspass-crypto/src/index.ts"]
}
"lesspass-crypto": ["../lesspass-crypto"]
},
"strict": true,
"target": "ES6"
},
"include": ["src"],
"exclude": ["src/**/*.test.ts"],
"exclude": ["src/**/*.test.ts*"],
"references": [{ "path": "../lesspass-crypto" }]
}

+ 21
- 0
packages/lesspass-fingerprint/tsup.config.ts View File

@@ -0,0 +1,21 @@
import { defineConfig } from "tsup";

export default defineConfig([
{
name: "browser",
entry: { "index.browser": "./src/index.ts" },
format: ["esm"],
platform: "browser",
clean: true,
dts: true,
splitting: false
},
{
name: "node",
entry: ["./src/index.ts"],
format: ["esm"],
clean: true,
dts: true,
splitting: false
},
]);

+ 0
- 6
packages/lesspass-mobile/.buckconfig View File

@@ -1,6 +0,0 @@

[android]
target = Google Inc.:Google APIs:23

[maven_repositories]
central = https://repo1.maven.org/maven2

+ 2
- 13
packages/lesspass-mobile/.eslintrc.js View File

@@ -1,16 +1,5 @@
module.exports = {
root: true,
extends: '@react-native-community',
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-shadow': ['error'],
'no-shadow': 'off',
'no-undef': 'off',
},
},
],
extends: '@react-native',
requireConfigFile: false,
};

+ 10
- 8
packages/lesspass-mobile/.gitignore View File

@@ -20,7 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local
**/.xcode.env.local

# Android/IntelliJ
#
@@ -31,6 +31,8 @@ local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore

# node.js
#
@@ -38,12 +40,6 @@ node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
@@ -60,5 +56,11 @@ buck-out/
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
**/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# testing
/coverage

+ 0
- 1
packages/lesspass-mobile/.node-version View File

@@ -1 +0,0 @@
16

+ 7
- 0
packages/lesspass-mobile/.prettierrc.js View File

@@ -0,0 +1,7 @@
module.exports = {
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
};

+ 0
- 1
packages/lesspass-mobile/.ruby-version View File

@@ -1 +0,0 @@
2.7.5

+ 1
- 1
packages/lesspass-mobile/.watchmanconfig View File

@@ -1 +1 @@
{}
{}

+ 2
- 2
packages/lesspass-mobile/App.tsx View File

@@ -2,7 +2,7 @@ import "react-native-gesture-handler";
import React from "react";
import { Provider } from "react-redux";
import { Provider as PaperProvider } from "react-native-paper";
import { PersistGate } from "redux-persist/lib/integration/react";
import { PersistGate } from "redux-persist/integration/react";
import { persistor, store } from "./src/store";
import { getTheme } from "./src/ui/Theme";
import AppContainer from "./src/AppContainer";
@@ -13,7 +13,7 @@ export default function App() {
const theme = getTheme(colorScheme);
return (
<Provider store={store}>
<PersistGate persistor={persistor}>
<PersistGate persistor={persistor} loading={null}>
<PaperProvider theme={theme}>
<AppContainer />
</PaperProvider>


+ 5
- 2
packages/lesspass-mobile/Gemfile View File

@@ -1,6 +1,9 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.5'
ruby ">= 2.6.10"

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

packages/lesspass-mobile/__tests__/App-test.tsx → packages/lesspass-mobile/__tests__/App.test.tsx View File

@@ -6,6 +6,9 @@ import 'react-native';
import React from 'react';
import App from '../App';

// Note: import explicitly to use the types shipped with jest.
import {it} from '@jest/globals';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';


+ 0
- 55
packages/lesspass-mobile/android/app/_BUCK View File

@@ -1,55 +0,0 @@
# To learn about Buck see [Docs](https://buckbuild.com/).
# To run your application with Buck:
# - install Buck
# - `npm start` - to start the packager
# - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

create_aar_targets(glob(["libs/*.aar"]))

create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
exported_deps = lib_deps,
)

android_library(
name = "app-code",
srcs = glob([
"src/main/java/**/*.java",
]),
deps = [
":all-libs",
":build_config",
":res",
],
)

android_build_config(
name = "build_config",
package = "com.lesspass.android",
)

android_resource(
name = "res",
package = "com.lesspass.android",
res = "src/main/res",
)

android_binary(
name = "app",
keystore = "//android/keystores:debug",
manifest = "src/main/AndroidManifest.xml",
package_type = "debug",
deps = [
":app-code",
],
)

+ 70
- 255
packages/lesspass-mobile/android/app/build.gradle View File

@@ -1,222 +1,104 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"

import com.android.build.OutputFile
import org.apache.tools.ant.taskdefs.condition.Os

/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation. If none specified and
* // "index.android.js" exists, it will be used. Otherwise "index.js" is
* // default. Can be overridden with ENTRY_FILE environment variable.
* entryFile: "index.android.js",
*
* // https://reactnative.dev/docs/performance#enable-the-ram-format
* bundleCommand: "ram-bundle",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/

project.ext.vectoricons = [
iconFontsDir: "../../../../node_modules/react-native-vector-icons/Fonts",
iconFontNames: [
"MaterialCommunityIcons.ttf",
"FontAwesome.ttf",
]
]

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

project.ext.react = [
enableHermes: true, // clean and rebuild if changing
]

apply from: "../../node_modules/react-native/react.gradle"

apply from: "../../../../node_modules/react-native-vector-icons/fonts.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
* This is the configuration block to customize your React Native Android app.
* By default you don't need to apply any configuration, just uncomment the lines you need.
*/
def enableSeparateBuildPerCPUArchitecture = true
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
reactNativeDir = file("../../../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
codegenDir = file("../../../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
cliFile = file("../../../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
// debuggableVariants = ["liteDebug", "prodDebug"]

/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
//
// The command to run when bundling. By default is 'bundle'
// bundleCommand = "ram-bundle"
//
// The path to the CLI configuration file. Default is empty.
// bundleConfig = file(../rn-cli.config.js)
//
// The name of the generated asset file containing your JS bundle
// bundleAssetName = "MyApplication.android.bundle"
//
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
// entryFile = file("../js/MyApplication.android.js")
//
// A list of extra flags to pass to the 'bundle' commands.
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
// extraPackagerArgs = []

/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
hermesCommand = "../../node_modules/react-native/sdks/hermesc/osx-bin/hermesc"

//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
}

/**
* Run Proguard to shrink the Java bytecode in release builds.
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
*/
def enableProguardInReleaseBuilds = false

/**
* The preferred build flavor of JavaScriptCore.
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'

/**
* Whether to enable the Hermes VM.
*
* This should be set on project.ext.react and that value will be read here. If it is not set
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
* and the benefits of using Hermes will therefore be sharply reduced.
*/
def enableHermes = project.ext.react.get("enableHermes", false);

/**
* Architectures to build native code for.
*/
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

android {
ndkVersion rootProject.ext.ndkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

namespace "com.lesspass"
defaultConfig {
applicationId "com.lesspass.android"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 9007007
versionName "9.7.7"
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()

if (isNewArchitectureEnabled()) {
// We configure the CMake build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
cmake {
arguments "-DPROJECT_BUILD_DIR=$buildDir",
"-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
"-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
"-DNODE_MODULES_DIR=$rootDir/../node_modules",
"-DANDROID_STL=c++_shared"
}
}
if (!enableSeparateBuildPerCPUArchitecture) {
ndk {
abiFilters (*reactNativeArchitectures())
}
}
}
}

if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
cmake {
path "$projectDir/src/main/jni/CMakeLists.txt"
}
}
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
afterEvaluate {
// If you wish to add a custom TurboModule or component locally,
// you should uncomment this line.
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)

// Due to a bug inside AGP, we have to explicitly set a dependency
// between configureCMakeDebug* tasks and the preBuild tasks.
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
configureCMakeDebug.dependsOn(preDebugBuild)
reactNativeArchitectures().each { architecture ->
tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
dependsOn("preDebugBuild")
}
tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
dependsOn("preReleaseBuild")
}
}
}
versionCode 900700800
versionName "9.7.8"
}

splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include (*reactNativeArchitectures())
enable true
universalApk true
include "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
signingConfigs {
@@ -240,92 +122,25 @@ android {
signingConfig signingConfigs.debug
}
release {
// Caution! In production, you need to generate your own keystore file.
// see https://reactnative.dev/docs/signed-apk-android.
signingConfig signingConfigs.release
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
signingConfig signingConfigs.release
manifestPlaceholders = [excludeSystemAlertWindowPermission: "true"]
}
}

// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 100 + versionCodes.get(abi)
}
}
}
}

dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])

//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules

implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}

debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}

// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")
implementation "com.madgag.spongycastle:core:1.58.0.0"

if (enableHermes) {
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
testImplementation "junit:junit:4.12"
}

if (isNewArchitectureEnabled()) {
// If new architecture is enabled, we let you build RN from source
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
// This will be applied to all the imported transtitive dependency.
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("com.facebook.react:react-native"))
.using(project(":ReactAndroid"))
.because("On New Architecture we're building React Native from source")
substitute(module("com.facebook.react:hermes-engine"))
.using(project(":ReactAndroid:hermes-engine"))
.because("On New Architecture we're building Hermes from source")
}
}
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.implementation
into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

def isNewArchitectureEnabled() {
// To opt-in for the New Architecture, you can either:
// - Set `newArchEnabled` to true inside the `gradle.properties` file
// - Invoke gradle with `-newArchEnabled=true`
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}
apply from: file("../../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

+ 0
- 19
packages/lesspass-mobile/android/app/build_defs.bzl View File

@@ -1,19 +0,0 @@
"""Helper definitions to glob .aar and .jar targets"""

def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)

def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)

+ 1
- 5
packages/lesspass-mobile/android/app/src/debug/AndroidManifest.xml View File

@@ -2,12 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
tools:ignore="GoogleAppIndexingWarning"/>
</manifest>

+ 0
- 73
packages/lesspass-mobile/android/app/src/debug/java/com/lesspass/ReactNativeFlipper.java View File

@@ -1,73 +0,0 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
* directory of this source tree.
*/
package com.lesspass.android;

import android.content.Context;
import com.facebook.flipper.android.AndroidFlipperClient;
import com.facebook.flipper.android.utils.FlipperUtils;
import com.facebook.flipper.core.FlipperClient;
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceEventListener;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
import okhttp3.OkHttpClient;

public class ReactNativeFlipper {
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
if (FlipperUtils.shouldEnableFlipper(context)) {
final FlipperClient client = AndroidFlipperClient.getInstance(context);

client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
client.addPlugin(new ReactFlipperPlugin());
client.addPlugin(new DatabasesFlipperPlugin(context));
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
client.addPlugin(CrashReporterPlugin.getInstance());

NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
}
});
client.addPlugin(networkFlipperPlugin);
client.start();

// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
// Hence we run if after all native modules have been initialized
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
reactContext.runOnNativeModulesQueueThread(
new Runnable() {
@Override
public void run() {
client.addPlugin(new FrescoFlipperPlugin());
}
});
}
});
} else {
client.addPlugin(new FrescoFlipperPlugin());
}
}
}
}

+ 2
- 5
packages/lesspass-mobile/android/app/src/main/AndroidManifest.xml View File

@@ -1,10 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.lesspass.android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.USE_FINGERPRINT" />

<application
android:name=".MainApplication"


packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/Crypto.java → packages/lesspass-mobile/android/app/src/main/java/com/lesspass/Crypto.java View File

@@ -1,4 +1,4 @@
package com.lesspass.android;
package com.lesspass;

import java.math.BigInteger;


packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/LessPassClipboardModule.java → packages/lesspass-mobile/android/app/src/main/java/com/lesspass/LessPassClipboardModule.java View File

@@ -1,4 +1,4 @@
package com.lesspass.android;
package com.lesspass;

import android.content.ClipDescription;
import android.content.ClipboardManager;

packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/LessPassModule.java → packages/lesspass-mobile/android/app/src/main/java/com/lesspass/LessPassModule.java View File

@@ -1,4 +1,4 @@
package com.lesspass.android;
package com.lesspass;

import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;

packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/LessPassPackage.java → packages/lesspass-mobile/android/app/src/main/java/com/lesspass/LessPassPackage.java View File

@@ -1,4 +1,4 @@
package com.lesspass.android;
package com.lesspass;

import com.facebook.react.ReactPackage;
import com.facebook.react.bridge.NativeModule;

+ 22
- 0
packages/lesspass-mobile/android/app/src/main/java/com/lesspass/MainActivity.kt View File

@@ -0,0 +1,22 @@
package com.lesspass

import com.facebook.react.ReactActivity
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

class MainActivity : ReactActivity() {

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "LessPass"

/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}

+ 44
- 0
packages/lesspass-mobile/android/app/src/main/java/com/lesspass/MainApplication.kt View File

@@ -0,0 +1,44 @@
package com.lesspass

import android.app.Application
import com.facebook.react.PackageList
import com.facebook.react.ReactApplication
import com.facebook.react.ReactHost
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.flipper.ReactNativeFlipper
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {

override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
add(LessPassPackage())
}

override fun getJSMainModuleName(): String = "index"

override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG

override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
}

override val reactHost: ReactHost
get() = getDefaultReactHost(applicationContext, reactNativeHost)

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
}
}
}

+ 0
- 55
packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/MainActivity.java View File

@@ -1,55 +0,0 @@
package com.lesspass.android;

import android.os.Bundle;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.ReactRootView;

public class MainActivity extends ReactActivity {

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "LessPass";
}

/**
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
* (Paper).
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new MainActivityDelegate(this, getMainComponentName());
}

public static class MainActivityDelegate extends ReactActivityDelegate {
public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
super(activity, mainComponentName);
}

@Override
protected ReactRootView createRootView() {
ReactRootView reactRootView = new ReactRootView(getContext());
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
return reactRootView;
}

@Override
protected boolean isConcurrentRootEnabled() {
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}
}

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
}

+ 0
- 92
packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/MainApplication.java View File

@@ -1,92 +0,0 @@
package com.lesspass.android;

import android.app.Application;
import android.content.Context;
import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.config.ReactFeatureFlags;
import com.facebook.soloader.SoLoader;
import com.lesspass.android.newarchitecture.MainApplicationReactNativeHost;
import java.lang.reflect.InvocationTargetException;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost =
new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

@Override
protected List<ReactPackage> getPackages() {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
packages.add(new LessPassPackage());
return packages;
}

@Override
protected String getJSMainModuleName() {
return "index";
}
};

private final ReactNativeHost mNewArchitectureNativeHost =
new MainApplicationReactNativeHost(this);

@Override
public ReactNativeHost getReactNativeHost() {
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
return mNewArchitectureNativeHost;
} else {
return mReactNativeHost;
}
}

@Override
public void onCreate() {
super.onCreate();
// If you opted-in for the New Architecture, we enable the TurboModule system
ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
SoLoader.init(this, /* native exopackage */ false);
initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
}

/**
* Loads Flipper in React Native templates. Call this in the onCreate method with something like
* initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
*
* @param context
* @param reactInstanceManager
*/
private static void initializeFlipper(
Context context, ReactInstanceManager reactInstanceManager) {
if (BuildConfig.DEBUG) {
try {
/*
We use reflection here to pick up the class that initializes Flipper,
since Flipper library is not available in release mode
*/
Class<?> aClass = Class.forName("com.lesspass.ReactNativeFlipper");
aClass
.getMethod("initializeFlipper", Context.class, ReactInstanceManager.class)
.invoke(null, context, reactInstanceManager);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}

+ 0
- 116
packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/newarchitecture/MainApplicationReactNativeHost.java View File

@@ -1,116 +0,0 @@
package com.lesspass.android.newarchitecture;

import android.app.Application;
import androidx.annotation.NonNull;
import com.facebook.react.PackageList;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
import com.facebook.react.bridge.JSIModulePackage;
import com.facebook.react.bridge.JSIModuleProvider;
import com.facebook.react.bridge.JSIModuleSpec;
import com.facebook.react.bridge.JSIModuleType;
import com.facebook.react.bridge.JavaScriptContextHolder;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.react.fabric.CoreComponentsRegistry;
import com.facebook.react.fabric.FabricJSIModuleProvider;
import com.facebook.react.fabric.ReactNativeConfig;
import com.facebook.react.uimanager.ViewManagerRegistry;
import com.lesspass.android.BuildConfig;
import com.lesspass.android.newarchitecture.components.MainComponentsRegistry;
import com.lesspass.android.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate;
import java.util.ArrayList;
import java.util.List;

/**
* A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both
* TurboModule delegates and the Fabric Renderer.
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
public class MainApplicationReactNativeHost extends ReactNativeHost {
public MainApplicationReactNativeHost(Application application) {
super(application);
}

@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

@Override
protected List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
// TurboModules must also be loaded here providing a valid TurboReactPackage implementation:
// packages.add(new TurboReactPackage() { ... });
// If you have custom Fabric Components, their ViewManagers should also be loaded here
// inside a ReactPackage.
return packages;
}

@Override
protected String getJSMainModuleName() {
return "index";
}

@NonNull
@Override
protected ReactPackageTurboModuleManagerDelegate.Builder
getReactPackageTurboModuleManagerDelegateBuilder() {
// Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary
// for the new architecture and to use TurboModules correctly.
return new MainApplicationTurboModuleManagerDelegate.Builder();
}

@Override
protected JSIModulePackage getJSIModulePackage() {
return new JSIModulePackage() {
@Override
public List<JSIModuleSpec> getJSIModules(
final ReactApplicationContext reactApplicationContext,
final JavaScriptContextHolder jsContext) {
final List<JSIModuleSpec> specs = new ArrayList<>();

// Here we provide a new JSIModuleSpec that will be responsible of providing the
// custom Fabric Components.
specs.add(
new JSIModuleSpec() {
@Override
public JSIModuleType getJSIModuleType() {
return JSIModuleType.UIManager;
}

@Override
public JSIModuleProvider<UIManager> getJSIModuleProvider() {
final ComponentFactory componentFactory = new ComponentFactory();
CoreComponentsRegistry.register(componentFactory);

// Here we register a Components Registry.
// The one that is generated with the template contains no components
// and just provides you the one from React Native core.
MainComponentsRegistry.register(componentFactory);

final ReactInstanceManager reactInstanceManager = getReactInstanceManager();

ViewManagerRegistry viewManagerRegistry =
new ViewManagerRegistry(
reactInstanceManager.getOrCreateViewManagers(reactApplicationContext));

return new FabricJSIModuleProvider(
reactApplicationContext,
componentFactory,
ReactNativeConfig.DEFAULT_CONFIG,
viewManagerRegistry);
}
});
return specs;
}
};
}
}

+ 0
- 36
packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/newarchitecture/components/MainComponentsRegistry.java View File

@@ -1,36 +0,0 @@
package com.lesspass.android.newarchitecture.components;

import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.soloader.SoLoader;

/**
* Class responsible to load the custom Fabric Components. This class has native methods and needs a
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
* folder for you).
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
@DoNotStrip
public class MainComponentsRegistry {
static {
SoLoader.loadLibrary("fabricjni");
}

@DoNotStrip private final HybridData mHybridData;

@DoNotStrip
private native HybridData initHybrid(ComponentFactory componentFactory);

@DoNotStrip
private MainComponentsRegistry(ComponentFactory componentFactory) {
mHybridData = initHybrid(componentFactory);
}

@DoNotStrip
public static MainComponentsRegistry register(ComponentFactory componentFactory) {
return new MainComponentsRegistry(componentFactory);
}
}

+ 0
- 48
packages/lesspass-mobile/android/app/src/main/java/com/lesspass/android/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java View File

@@ -1,48 +0,0 @@
package com.lesspass.android.newarchitecture.modules;

import com.facebook.jni.HybridData;
import com.facebook.react.ReactPackage;
import com.facebook.react.ReactPackageTurboModuleManagerDelegate;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.soloader.SoLoader;
import java.util.List;

/**
* Class responsible to load the TurboModules. This class has native methods and needs a
* corresponding C++ implementation/header file to work correctly (already placed inside the jni/
* folder for you).
*
* <p>Please note that this class is used ONLY if you opt-in for the New Architecture (see the
* `newArchEnabled` property). Is ignored otherwise.
*/
public class MainApplicationTurboModuleManagerDelegate
extends ReactPackageTurboModuleManagerDelegate {

private static volatile boolean sIsSoLibraryLoaded;

protected MainApplicationTurboModuleManagerDelegate(
ReactApplicationContext reactApplicationContext, List<ReactPackage> packages) {
super(reactApplicationContext, packages);
}

protected native HybridData initHybrid();

native boolean canCreateTurboModule(String moduleName);

public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder {
protected MainApplicationTurboModuleManagerDelegate build(
ReactApplicationContext context, List<ReactPackage> packages) {
return new MainApplicationTurboModuleManagerDelegate(context, packages);
}
}

@Override
protected synchronized void maybeLoadOtherSoLibraries() {
if (!sIsSoLibraryLoaded) {
// If you change the name of your application .so file in the Android.mk file,
// make sure you update the name here as well.
SoLoader.loadLibrary("lesspass_appmodules");
sIsSoLibraryLoaded = true;
}
}
}

+ 0
- 7
packages/lesspass-mobile/android/app/src/main/jni/CMakeLists.txt View File

@@ -1,7 +0,0 @@
cmake_minimum_required(VERSION 3.13)

# Define the library name here.
project(lesspass_appmodules)

# This file includes all the necessary to let you build your application with the New Architecture.
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)

+ 0
- 32
packages/lesspass-mobile/android/app/src/main/jni/MainApplicationModuleProvider.cpp View File

@@ -1,32 +0,0 @@
#include "MainApplicationModuleProvider.h"

#include <rncli.h>
#include <rncore.h>

namespace facebook {
namespace react {

std::shared_ptr<TurboModule> MainApplicationModuleProvider(
const std::string &moduleName,
const JavaTurboModule::InitParams &params) {
// Here you can provide your own module provider for TurboModules coming from
// either your application or from external libraries. The approach to follow
// is similar to the following (for a library called `samplelibrary`:
//
// auto module = samplelibrary_ModuleProvider(moduleName, params);
// if (module != nullptr) {
// return module;
// }
// return rncore_ModuleProvider(moduleName, params);

// Module providers autolinked by RN CLI
auto rncli_module = rncli_ModuleProvider(moduleName, params);
if (rncli_module != nullptr) {
return rncli_module;
}

return rncore_ModuleProvider(moduleName, params);
}

} // namespace react
} // namespace facebook

+ 0
- 16
packages/lesspass-mobile/android/app/src/main/jni/MainApplicationModuleProvider.h View File

@@ -1,16 +0,0 @@
#pragma once

#include <memory>
#include <string>

#include <ReactCommon/JavaTurboModule.h>

namespace facebook {
namespace react {

std::shared_ptr<TurboModule> MainApplicationModuleProvider(
const std::string &moduleName,
const JavaTurboModule::InitParams &params);

} // namespace react
} // namespace facebook

+ 0
- 45
packages/lesspass-mobile/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp View File

@@ -1,45 +0,0 @@
#include "MainApplicationTurboModuleManagerDelegate.h"
#include "MainApplicationModuleProvider.h"

namespace facebook {
namespace react {

jni::local_ref<MainApplicationTurboModuleManagerDelegate::jhybriddata>
MainApplicationTurboModuleManagerDelegate::initHybrid(
jni::alias_ref<jhybridobject>) {
return makeCxxInstance();
}

void MainApplicationTurboModuleManagerDelegate::registerNatives() {
registerHybrid({
makeNativeMethod(
"initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid),
makeNativeMethod(
"canCreateTurboModule",
MainApplicationTurboModuleManagerDelegate::canCreateTurboModule),
});
}

std::shared_ptr<TurboModule>
MainApplicationTurboModuleManagerDelegate::getTurboModule(
const std::string &name,
const std::shared_ptr<CallInvoker> &jsInvoker) {
// Not implemented yet: provide pure-C++ NativeModules here.
return nullptr;
}

std::shared_ptr<TurboModule>
MainApplicationTurboModuleManagerDelegate::getTurboModule(
const std::string &name,
const JavaTurboModule::InitParams &params) {
return MainApplicationModuleProvider(name, params);
}

bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
const std::string &name) {
return getTurboModule(name, nullptr) != nullptr ||
getTurboModule(name, {.moduleName = name}) != nullptr;
}

} // namespace react
} // namespace facebook

+ 0
- 38
packages/lesspass-mobile/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h View File

@@ -1,38 +0,0 @@
#include <memory>
#include <string>

#include <ReactCommon/TurboModuleManagerDelegate.h>
#include <fbjni/fbjni.h>

namespace facebook {
namespace react {

class MainApplicationTurboModuleManagerDelegate
: public jni::HybridClass<
MainApplicationTurboModuleManagerDelegate,
TurboModuleManagerDelegate> {
public:
// Adapt it to the package you used for your Java class.
static constexpr auto kJavaDescriptor =
"Lcom/lesspass/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;";

static jni::local_ref<jhybriddata> initHybrid(jni::alias_ref<jhybridobject>);

static void registerNatives();

std::shared_ptr<TurboModule> getTurboModule(
const std::string &name,
const std::shared_ptr<CallInvoker> &jsInvoker) override;
std::shared_ptr<TurboModule> getTurboModule(
const std::string &name,
const JavaTurboModule::InitParams &params) override;

/**
* Test-only method. Allows user to verify whether a TurboModule can be
* created by instances of this class.
*/
bool canCreateTurboModule(const std::string &name);
};

} // namespace react
} // namespace facebook

+ 0
- 65
packages/lesspass-mobile/android/app/src/main/jni/MainComponentsRegistry.cpp View File

@@ -1,65 +0,0 @@
#include "MainComponentsRegistry.h"

#include <CoreComponentsRegistry.h>
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/components/rncore/ComponentDescriptors.h>
#include <rncli.h>

namespace facebook {
namespace react {

MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {}

std::shared_ptr<ComponentDescriptorProviderRegistry const>
MainComponentsRegistry::sharedProviderRegistry() {
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();

// Autolinked providers registered by RN CLI
rncli_registerProviders(providerRegistry);

// Custom Fabric Components go here. You can register custom
// components coming from your App or from 3rd party libraries here.
//
// providerRegistry->add(concreteComponentDescriptorProvider<
// AocViewerComponentDescriptor>());
return providerRegistry;
}

jni::local_ref<MainComponentsRegistry::jhybriddata>
MainComponentsRegistry::initHybrid(
jni::alias_ref<jclass>,
ComponentFactory *delegate) {
auto instance = makeCxxInstance(delegate);

auto buildRegistryFunction =
[](EventDispatcher::Weak const &eventDispatcher,
ContextContainer::Shared const &contextContainer)
-> ComponentDescriptorRegistry::Shared {
auto registry = MainComponentsRegistry::sharedProviderRegistry()
->createComponentDescriptorRegistry(
{eventDispatcher, contextContainer});

auto mutableRegistry =
std::const_pointer_cast<ComponentDescriptorRegistry>(registry);

mutableRegistry->setFallbackComponentDescriptor(
std::make_shared<UnimplementedNativeViewComponentDescriptor>(
ComponentDescriptorParameters{
eventDispatcher, contextContainer, nullptr}));

return registry;
};

delegate->buildRegistryFunction = buildRegistryFunction;
return instance;
}

void MainComponentsRegistry::registerNatives() {
registerHybrid({
makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid),
});
}

} // namespace react
} // namespace facebook

+ 0
- 32
packages/lesspass-mobile/android/app/src/main/jni/MainComponentsRegistry.h View File

@@ -1,32 +0,0 @@
#pragma once

#include <ComponentFactory.h>
#include <fbjni/fbjni.h>
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>

namespace facebook {
namespace react {

class MainComponentsRegistry
: public facebook::jni::HybridClass<MainComponentsRegistry> {
public:
// Adapt it to the package you used for your Java class.
constexpr static auto kJavaDescriptor =
"Lcom/lesspass/newarchitecture/components/MainComponentsRegistry;";

static void registerNatives();

MainComponentsRegistry(ComponentFactory *delegate);

private:
static std::shared_ptr<ComponentDescriptorProviderRegistry const>
sharedProviderRegistry();

static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jclass>,
ComponentFactory *delegate);
};

} // namespace react
} // namespace facebook

+ 0
- 11
packages/lesspass-mobile/android/app/src/main/jni/OnLoad.cpp View File

@@ -1,11 +0,0 @@
#include <fbjni/fbjni.h>
#include "MainApplicationTurboModuleManagerDelegate.h"
#include "MainComponentsRegistry.h"

JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
return facebook::jni::initialize(vm, [] {
facebook::react::MainApplicationTurboModuleManagerDelegate::
registerNatives();
facebook::react::MainComponentsRegistry::registerNatives();
});
}

+ 3
- 2
packages/lesspass-mobile/android/app/src/main/res/drawable/rn_edit_text_material.xml View File

@@ -17,10 +17,11 @@
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
android:insetTop="@dimen/abc_edit_text_inset_top_material"
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
>

<selector>
<!--
<!--
This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'


+ 0
- 31
packages/lesspass-mobile/android/app/src/test/java/com/lesspass/CryptoTest.java View File

@@ -1,31 +0,0 @@
import static org.junit.Assert.*;
import org.junit.Test;

import java.util.Map;
import java.util.HashMap;

import com.lesspass.android.Crypto;

public class CryptoTest {
@Test
public void testPbkdf2() {
String password = "password";
String salt = "example.orgcontact@example.org1";
String result = new Crypto().pbkdf2(password, salt, 100000, 32);
assertEquals("dc33d431bce2b01182c613382483ccdb0e2f66482cbba5e9d07dab34acc7eb1e", result);
}

@Test
public void testPbkdf2WithUnicodeChar() {
String password = "I ❤ LessPass";
String salt = "example.org❤1";
String result = new Crypto().pbkdf2(password, salt, 100000, 32);
assertEquals("4e66cab40690c01af55efd595f5963cc953d7e10273c01827881ebf8990c627f", result);
}

@Test
public void testHMAC() {
String result = new Crypto().hmac("password");
assertEquals("e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e", result);
}
}

+ 9
- 38
packages/lesspass-mobile/android/build.gradle View File

@@ -1,51 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext {
buildToolsVersion = "31.0.0"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
targetSdkVersion = 34

if (System.properties['os.arch'] == "aarch64") {
// For M1 Users we need to use the NDK 24 which added support for aarch64
ndkVersion = "24.0.8215888"
} else {
// Otherwise we default to the side-by-side NDK version from AGP.
ndkVersion = "21.4.7075529"
}
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
}
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.2.1")
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}

allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
maven { url 'https://www.jitpack.io' }
}
}
apply plugin: "com.facebook.react.rootproject"

+ 4
- 3
packages/lesspass-mobile/android/gradle.properties View File

@@ -24,9 +24,6 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.125.0

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
@@ -38,3 +35,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true

BIN
packages/lesspass-mobile/android/gradle/wrapper/gradle-wrapper.jar View File


+ 3
- 1
packages/lesspass-mobile/android/gradle/wrapper/gradle-wrapper.properties View File

@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

+ 29
- 14
packages/lesspass-mobile/android/gradlew View File

@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
@@ -205,6 +214,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
@@ -231,4 +246,4 @@ eval "set -- $(
tr '\n' ' '
)" '"$@"'

exec "$JAVACMD" "$@"
exec "$JAVACMD" "$@"

+ 20
- 17
packages/lesspass-mobile/android/gradlew.bat View File

@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@@ -40,13 +41,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

@@ -56,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

@@ -75,15 +76,17 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
:omega

+ 0
- 22
packages/lesspass-mobile/android/privacy-policy.md View File

@@ -1,22 +0,0 @@
# Privacy Policy

Guillaume Vincent built the LessPass app as a Free app. This SERVICE is provided by Guillaume Vincent at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used only to connect to the Service. I will not use or share your information with anyone.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at LessPass unless otherwise defined in this Privacy Policy.
## Information Collection and Use
For a better experience, while using our Service, I may require you to create an account on https://www.lesspass.com. The account creation required an email and a password. The information that I request will be retained by us and used as described in this privacy policy.
The account creation is not mandatory to use our Service.

The app does not use third party services.

## Security
I value your trust in providing us with your Personal Information, thus we are striving to use commercially acceptable means of protecting it. But remember that no method of transmission over the Internet, or method of electronic storage is 100% secure and reliable, and I cannot guarantee its absolute security.

## Changes to This Privacy Policy
I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. These changes are effective immediately after they are posted on this page.

## Contact Us
If you have any questions or suggestions about my Privacy Policy, do not hesitate to contact me at contact@lesspass.com



+ 2
- 9
packages/lesspass-mobile/android/settings.gradle View File

@@ -1,11 +1,4 @@
rootProject.name = 'LessPass'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
apply from: file("../../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/react-native-gradle-plugin')

if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}
includeBuild('../../../node_modules/@react-native/gradle-plugin')

+ 1
- 1
packages/lesspass-mobile/app.json View File

@@ -1,4 +1,4 @@
{
"name": "LessPass",
"displayName": "LessPass"
}
}

+ 1
- 6
packages/lesspass-mobile/babel.config.js View File

@@ -1,8 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
env: {
production: {
plugins: ['react-native-paper/babel'],
},
},
presets: ['module:@react-native/babel-preset'],
};

+ 0
- 2
packages/lesspass-mobile/ios/LessPass-Bridging-Header.h View File

@@ -1,2 +0,0 @@
#import "React/RCTBridgeModule.h"
#import <CommonCrypto/CommonCrypto.h>

+ 113
- 127
packages/lesspass-mobile/ios/LessPass.xcodeproj/project.pbxproj View File

@@ -8,17 +8,16 @@

/* Begin PBXBuildFile section */
00E356F31AD99517003FC87E /* LessPassTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* LessPassTests.m */; };
0C80B921A6F3F58F76C31292 /* libPods-LessPass.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-LessPass.a */; };
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
7699B88040F8A987B510C191 /* libPods-LessPass-LessPassTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-LessPass-LessPassTests.a */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
F0198E9428FDD15300D6FFF4 /* LessPassClipboardModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F0198E9328FDD15300D6FFF4 /* LessPassClipboardModule.m */; };
F0198E9528FDD15300D6FFF4 /* LessPassClipboardModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F0198E9328FDD15300D6FFF4 /* LessPassClipboardModule.m */; };
F0614DEC28F4B29F00A63AC5 /* Hack.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F0614DEB28F4B29F00A63AC5 /* Hack.ttf */; };
F0614DEF28F4B49C00A63AC5 /* LessPassModule.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0614DEE28F4B49C00A63AC5 /* LessPassModule.swift */; };
F0614DF128F4B58B00A63AC5 /* LessPassModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F0614DF028F4B58B00A63AC5 /* LessPassModule.m */; };
7FF04F0E1A4AD57BBAD6BE4B /* libPods-LessPass-LessPassTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FFAFE2A49028E36BDBF0BC95 /* libPods-LessPass-LessPassTests.a */; };
C5D3DC2C43B1DF6E5BA2EB77 /* libPods-LessPass.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FB944D190D15D77F9C1CBA4A /* libPods-LessPass.a */; };
F01630942B90D51C003D8E89 /* LessPassClipboardModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F01630932B90D51C003D8E89 /* LessPassClipboardModule.m */; };
F01630952B90D51C003D8E89 /* LessPassClipboardModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F01630932B90D51C003D8E89 /* LessPassClipboardModule.m */; };
F04538A52B90CAD700A806A5 /* LessPassModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F04538A42B90CAD700A806A5 /* LessPassModule.m */; };
F04538A62B90CAD700A806A5 /* LessPassModule.m in Sources */ = {isa = PBXBuildFile; fileRef = F04538A42B90CAD700A806A5 /* LessPassModule.m */; };
F079B8BA2B90994C0055CF28 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
@@ -41,22 +40,21 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = LessPass/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = LessPass/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = LessPass/main.m; sourceTree = "<group>"; };
19F6CBCC0A4E27FBF8BF4A61 /* libPods-LessPass-LessPassTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LessPass-LessPassTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
3B4392A12AC88292D35C810B /* Pods-LessPass.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LessPass.debug.xcconfig"; path = "Target Support Files/Pods-LessPass/Pods-LessPass.debug.xcconfig"; sourceTree = "<group>"; };
5709B34CF0A7D63546082F79 /* Pods-LessPass.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LessPass.release.xcconfig"; path = "Target Support Files/Pods-LessPass/Pods-LessPass.release.xcconfig"; sourceTree = "<group>"; };
5B7EB9410499542E8C5724F5 /* Pods-LessPass-LessPassTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LessPass-LessPassTests.debug.xcconfig"; path = "Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests.debug.xcconfig"; sourceTree = "<group>"; };
5DCACB8F33CDC322A6C60F78 /* libPods-LessPass.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LessPass.a"; sourceTree = BUILT_PRODUCTS_DIR; };
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = PrivacyInfo.xcprivacy; path = LessPass/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
28EE093BB660E6424ED52201 /* Pods-LessPass-LessPassTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LessPass-LessPassTests.release.xcconfig"; path = "Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests.release.xcconfig"; sourceTree = "<group>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = LessPass/LaunchScreen.storyboard; sourceTree = "<group>"; };
89C6BE57DB24E9ADA2F236DE /* Pods-LessPass-LessPassTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LessPass-LessPassTests.release.xcconfig"; path = "Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests.release.xcconfig"; sourceTree = "<group>"; };
858B72737D416973494E29BE /* Pods-LessPass.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LessPass.release.xcconfig"; path = "Target Support Files/Pods-LessPass/Pods-LessPass.release.xcconfig"; sourceTree = "<group>"; };
BEEE71CEF32EE79A060E2BF7 /* Pods-LessPass.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LessPass.debug.xcconfig"; path = "Target Support Files/Pods-LessPass/Pods-LessPass.debug.xcconfig"; sourceTree = "<group>"; };
D84E02D4399C123830261ADC /* Pods-LessPass-LessPassTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LessPass-LessPassTests.debug.xcconfig"; path = "Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests.debug.xcconfig"; sourceTree = "<group>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
F0198E9228FDD07E00D6FFF4 /* LessPassClipboardModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LessPassClipboardModule.h; sourceTree = "<group>"; };
F0198E9328FDD15300D6FFF4 /* LessPassClipboardModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LessPassClipboardModule.m; sourceTree = "<group>"; };
F0614DE728F4B26B00A63AC5 /* FontAwesome.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = FontAwesome.ttf; path = "../node_modules/react-native-vector-icons/Fonts/FontAwesome.ttf"; sourceTree = "<group>"; };
F0614DE928F4B27800A63AC5 /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = MaterialCommunityIcons.ttf; path = "../node_modules/react-native-vector-icons/Fonts/MaterialCommunityIcons.ttf"; sourceTree = "<group>"; };
F0614DEB28F4B29F00A63AC5 /* Hack.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = Hack.ttf; path = ../assets/fonts/Hack.ttf; sourceTree = "<group>"; };
F0614DED28F4B49C00A63AC5 /* LessPass-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "LessPass-Bridging-Header.h"; sourceTree = "<group>"; };
F0614DEE28F4B49C00A63AC5 /* LessPassModule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LessPassModule.swift; sourceTree = "<group>"; };
F0614DF028F4B58B00A63AC5 /* LessPassModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LessPassModule.m; sourceTree = "<group>"; };
F01630922B90D508003D8E89 /* LessPassClipboardModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LessPassClipboardModule.h; sourceTree = "<group>"; };
F01630932B90D51C003D8E89 /* LessPassClipboardModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LessPassClipboardModule.m; sourceTree = "<group>"; };
F04538A32B90CABE00A806A5 /* LessPassModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LessPassModule.h; sourceTree = "<group>"; };
F04538A42B90CAD700A806A5 /* LessPassModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LessPassModule.m; sourceTree = "<group>"; };
F079B89A2B908E0C0055CF28 /* MaterialCommunityIcons.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = MaterialCommunityIcons.ttf; sourceTree = "<group>"; };
F079B8A02B908E0C0055CF28 /* FontAwesome.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = FontAwesome.ttf; sourceTree = "<group>"; };
FB944D190D15D77F9C1CBA4A /* libPods-LessPass.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LessPass.a"; sourceTree = BUILT_PRODUCTS_DIR; };
FFAFE2A49028E36BDBF0BC95 /* libPods-LessPass-LessPassTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-LessPass-LessPassTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
@@ -64,7 +62,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
7699B88040F8A987B510C191 /* libPods-LessPass-LessPassTests.a in Frameworks */,
7FF04F0E1A4AD57BBAD6BE4B /* libPods-LessPass-LessPassTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -72,7 +70,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
0C80B921A6F3F58F76C31292 /* libPods-LessPass.a in Frameworks */,
C5D3DC2C43B1DF6E5BA2EB77 /* libPods-LessPass.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -99,18 +97,14 @@
13B07FAE1A68108700A75B9A /* LessPass */ = {
isa = PBXGroup;
children = (
F0614DE628F4B1EA00A63AC5 /* Fonts */,
F079B8932B908E0C0055CF28 /* Fonts */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */,
13B07FB01A68108700A75B9A /* AppDelegate.mm */,
13B07FB51A68108700A75B9A /* Images.xcassets */,
13B07FB61A68108700A75B9A /* Info.plist */,
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */,
13B07FB71A68108700A75B9A /* main.m */,
F0614DEE28F4B49C00A63AC5 /* LessPassModule.swift */,
F0614DF028F4B58B00A63AC5 /* LessPassModule.m */,
F0614DED28F4B49C00A63AC5 /* LessPass-Bridging-Header.h */,
F0198E9228FDD07E00D6FFF4 /* LessPassClipboardModule.h */,
F0198E9328FDD15300D6FFF4 /* LessPassClipboardModule.m */,
13B07FB81A68108700A75B9A /* PrivacyInfo.xcprivacy */,
);
name = LessPass;
sourceTree = "<group>";
@@ -119,8 +113,8 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
5DCACB8F33CDC322A6C60F78 /* libPods-LessPass.a */,
19F6CBCC0A4E27FBF8BF4A61 /* libPods-LessPass-LessPassTests.a */,
FB944D190D15D77F9C1CBA4A /* libPods-LessPass.a */,
FFAFE2A49028E36BDBF0BC95 /* libPods-LessPass-LessPassTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
@@ -135,6 +129,10 @@
83CBB9F61A601CBA00E9B192 = {
isa = PBXGroup;
children = (
F01630932B90D51C003D8E89 /* LessPassClipboardModule.m */,
F01630922B90D508003D8E89 /* LessPassClipboardModule.h */,
F04538A32B90CABE00A806A5 /* LessPassModule.h */,
F04538A42B90CAD700A806A5 /* LessPassModule.m */,
13B07FAE1A68108700A75B9A /* LessPass */,
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* LessPassTests */,
@@ -159,22 +157,22 @@
BBD78D7AC51CEA395F1C20DB /* Pods */ = {
isa = PBXGroup;
children = (
3B4392A12AC88292D35C810B /* Pods-LessPass.debug.xcconfig */,
5709B34CF0A7D63546082F79 /* Pods-LessPass.release.xcconfig */,
5B7EB9410499542E8C5724F5 /* Pods-LessPass-LessPassTests.debug.xcconfig */,
89C6BE57DB24E9ADA2F236DE /* Pods-LessPass-LessPassTests.release.xcconfig */,
BEEE71CEF32EE79A060E2BF7 /* Pods-LessPass.debug.xcconfig */,
858B72737D416973494E29BE /* Pods-LessPass.release.xcconfig */,
D84E02D4399C123830261ADC /* Pods-LessPass-LessPassTests.debug.xcconfig */,
28EE093BB660E6424ED52201 /* Pods-LessPass-LessPassTests.release.xcconfig */,
);
path = Pods;
sourceTree = "<group>";
};
F0614DE628F4B1EA00A63AC5 /* Fonts */ = {
F079B8932B908E0C0055CF28 /* Fonts */ = {
isa = PBXGroup;
children = (
F0614DEB28F4B29F00A63AC5 /* Hack.ttf */,
F0614DE928F4B27800A63AC5 /* MaterialCommunityIcons.ttf */,
F0614DE728F4B26B00A63AC5 /* FontAwesome.ttf */,
F079B89A2B908E0C0055CF28 /* MaterialCommunityIcons.ttf */,
F079B8A02B908E0C0055CF28 /* FontAwesome.ttf */,
);
name = Fonts;
path = "../../../node_modules/react-native-vector-icons/Fonts";
sourceTree = "<group>";
};
/* End PBXGroup section */
@@ -184,12 +182,12 @@
isa = PBXNativeTarget;
buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "LessPassTests" */;
buildPhases = (
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */,
E931A67A7100D1DF9A0D6309 /* [CP] Check Pods Manifest.lock */,
00E356EA1AD99517003FC87E /* Sources */,
00E356EB1AD99517003FC87E /* Frameworks */,
00E356EC1AD99517003FC87E /* Resources */,
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */,
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */,
14D9B7503F7C2387CDBFFDAA /* [CP] Embed Pods Frameworks */,
5B7AA16F41D0425470863AC3 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -205,14 +203,13 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "LessPass" */;
buildPhases = (
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */,
FD10A7F022414F080027D42C /* Start Packager */,
2E173AB198D2C2448B791788 /* [CP] Check Pods Manifest.lock */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */,
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */,
C0D16A1C953ECB0FAFF1A2AC /* [CP] Embed Pods Frameworks */,
2A2DFD6153349987FF022375 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
@@ -236,7 +233,7 @@
TestTargetID = 13B07F861A680F5B00A75B9A;
};
13B07F861A680F5B00A75B9A = {
LastSwiftMigration = 1320;
LastSwiftMigration = 1120;
};
};
};
@@ -271,8 +268,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */,
F0614DEC28F4B29F00A63AC5 /* Hack.ttf in Resources */,
F079B8BA2B90994C0055CF28 /* LaunchScreen.storyboard in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -294,48 +290,43 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"$REACT_NATIVE_PATH/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
};
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
14D9B7503F7C2387CDBFFDAA /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-frameworks-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-frameworks-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-frameworks.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = {
2A2DFD6153349987FF022375 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-resources-${CONFIGURATION}-input-files.xcfilelist",
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-LessPass-LessPassTests-checkManifestLockResult.txt",
"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-resources.sh\"\n";
showEnvVarsInLog = 0;
};
C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = {
2E173AB198D2C2448B791788 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -357,58 +348,41 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
C59DA0FBD6956966B86A3779 /* [CP] Embed Pods Frameworks */ = {
5B7AA16F41D0425470863AC3 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-resources-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-resources-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-resources.sh\"\n";
showEnvVarsInLog = 0;
};
F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = {
C0D16A1C953ECB0FAFF1A2AC /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-resources-${CONFIGURATION}-input-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-resources-${CONFIGURATION}-output-files.xcfilelist",
"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LessPass-LessPassTests/Pods-LessPass-LessPassTests-resources.sh\"\n";
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-LessPass/Pods-LessPass-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FD10A7F022414F080027D42C /* Start Packager */ = {
E931A67A7100D1DF9A0D6309 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -416,15 +390,18 @@
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "Start Packager";
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-LessPass-LessPassTests-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
@@ -434,8 +411,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F0198E9528FDD15300D6FFF4 /* LessPassClipboardModule.m in Sources */,
00E356F31AD99517003FC87E /* LessPassTests.m in Sources */,
F04538A62B90CAD700A806A5 /* LessPassModule.m in Sources */,
F01630952B90D51C003D8E89 /* LessPassClipboardModule.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -443,11 +421,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
F01630942B90D51C003D8E89 /* LessPassClipboardModule.m in Sources */,
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */,
F0614DEF28F4B49C00A63AC5 /* LessPassModule.swift in Sources */,
13B07FC11A68108700A75B9A /* main.m in Sources */,
F0614DF128F4B58B00A63AC5 /* LessPassModule.m in Sources */,
F0198E9428FDD15300D6FFF4 /* LessPassClipboardModule.m in Sources */,
F04538A52B90CAD700A806A5 /* LessPassModule.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -464,16 +441,15 @@
/* Begin XCBuildConfiguration section */
00E356F61AD99517003FC87E /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-LessPass-LessPassTests.debug.xcconfig */;
baseConfigurationReference = D84E02D4399C123830261ADC /* Pods-LessPass-LessPassTests.debug.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
INFOPLIST_FILE = LessPassTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -484,7 +460,7 @@
"-lc++",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = com.lesspass.ios;
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LessPass.app/LessPass";
};
@@ -492,13 +468,12 @@
};
00E356F71AD99517003FC87E /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-LessPass-LessPassTests.release.xcconfig */;
baseConfigurationReference = 28EE093BB660E6424ED52201 /* Pods-LessPass-LessPassTests.release.xcconfig */;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = LessPassTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -509,7 +484,7 @@
"-lc++",
"$(inherited)",
);
PRODUCT_BUNDLE_IDENTIFIER = com.lesspass.ios;
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/LessPass.app/LessPass";
};
@@ -517,57 +492,58 @@
};
13B07F941A680F5B00A75B9A /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-LessPass.debug.xcconfig */;
baseConfigurationReference = BEEE71CEF32EE79A060E2BF7 /* Pods-LessPass.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 5Y4MF2AT83;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = LessPass/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 9.7.7;
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = com.lesspass.ios;
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = LessPass;
SWIFT_OBJC_BRIDGING_HEADER = "LessPass-Bridging-Header.h";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
};
name = Debug;
};
13B07F951A680F5B00A75B9A /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-LessPass.release.xcconfig */;
baseConfigurationReference = 858B72737D416973494E29BE /* Pods-LessPass.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 5Y4MF2AT83;
INFOPLIST_FILE = LessPass/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 9.7.7;
MARKETING_VERSION = 1.0;
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
PRODUCT_BUNDLE_IDENTIFIER = com.lesspass.ios;
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = LessPass;
SWIFT_OBJC_BRIDGING_HEADER = "LessPass-Bridging-Header.h";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
@@ -579,7 +555,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
@@ -607,7 +583,7 @@
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
@@ -623,7 +599,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
@@ -635,14 +611,19 @@
);
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
};
name = Debug;
};
@@ -651,7 +632,7 @@
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "c++17";
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
@@ -679,7 +660,7 @@
COPY_PHASE_STRIP = YES;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = i386;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -688,7 +669,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
@@ -699,14 +680,19 @@
"\"$(inherited)\"",
);
MTL_ENABLE_DEBUG_INFO = NO;
OTHER_CFLAGS = "$(inherited)";
OTHER_CPLUSPLUSFLAGS = (
"$(OTHER_CFLAGS)",
"-DFOLLY_NO_CONFIG",
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
"-DFOLLY_CFG_NO_COROUTINES=1",
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
OTHER_LDFLAGS = "$(inherited) ";
REACT_NATIVE_PATH = "${PODS_ROOT}/../../../../node_modules/react-native";
SDKROOT = iphoneos;
USE_HERMES = true;
VALIDATE_PRODUCT = YES;
};
name = Release;


+ 7
- 0
packages/lesspass-mobile/ios/LessPass.xcodeproj/project.xcworkspace/contents.xcworkspacedata View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

packages/lesspass-mobile/ios/LessPass.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings → packages/lesspass-mobile/ios/LessPass.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist View File

@@ -2,7 +2,7 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

+ 1
- 1
packages/lesspass-mobile/ios/LessPass.xcodeproj/xcshareddata/xcschemes/LessPass.xcscheme View File

@@ -41,7 +41,7 @@
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Release"
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"


+ 2
- 4
packages/lesspass-mobile/ios/LessPass/AppDelegate.h View File

@@ -1,8 +1,6 @@
#import <React/RCTBridgeDelegate.h>
#import <RCTAppDelegate.h>
#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>

@property (nonatomic, strong) UIWindow *window;
@interface AppDelegate : RCTAppDelegate

@end

+ 8
- 110
packages/lesspass-mobile/ios/LessPass/AppDelegate.mm View File

@@ -1,88 +1,25 @@
#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

#import <React/RCTAppSetupUtils.h>

#if RCT_NEW_ARCH_ENABLED
#import <React/CoreModulesPlugins.h>
#import <React/RCTCxxBridgeDelegate.h>
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#import <React/RCTSurfacePresenter.h>
#import <React/RCTSurfacePresenterBridgeAdapter.h>
#import <ReactCommon/RCTTurboModuleManager.h>

#import <react/config/ReactNativeConfig.h>

static NSString *const kRNConcurrentRoot = @"concurrentRoot";

@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
RCTTurboModuleManager *_turboModuleManager;
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig;
facebook::react::ContextContainer::Shared _contextContainer;
}
@end
#endif

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
RCTAppSetupPrepareApp(application);

RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];

#if RCT_NEW_ARCH_ENABLED
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
_bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer];
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif
self.moduleName = @"LessPass";
// You can add your custom initial props in the dictionary below.
// They will be passed down to the ViewController used by React Native.
self.initialProps = @{};

NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"LessPass", initProps);

if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
} else {
rootView.backgroundColor = [UIColor whiteColor];
}

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
UIViewController *rootViewController = [UIViewController new];
rootViewController.view = rootView;
self.window.rootViewController = rootViewController;
[self.window makeKeyAndVisible];
return YES;
}

/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
///
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
// Switch this bool to turn on and off the concurrent root
return true;
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

- (NSDictionary *)prepareInitialProps
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
NSMutableDictionary *initProps = [NSMutableDictionary new];

#ifdef RCT_NEW_ARCH_ENABLED
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
#endif

return initProps;
return [self bundleURL];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
- (NSURL *)bundleURL
{
#if DEBUG
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
@@ -91,43 +28,4 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
#endif
}

#if RCT_NEW_ARCH_ENABLED

#pragma mark - RCTCxxBridgeDelegate

- (std::unique_ptr<facebook::react::JSExecutorFactory>)jsExecutorFactoryForBridge:(RCTBridge *)bridge
{
_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge
delegate:self
jsInvoker:bridge.jsCallInvoker];
return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager);
}

#pragma mark RCTTurboModuleManagerDelegate

- (Class)getModuleClassFromName:(const char *)name
{
return RCTCoreModulesClassProvider(name);
}

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
jsInvoker:(std::shared_ptr<facebook::react::CallInvoker>)jsInvoker
{
return nullptr;
}

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
initParams:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return nullptr;
}

- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
{
return RCTAppSetupDefaultModuleFromClass(moduleClass);
}

#endif

@end

+ 9
- 12
packages/lesspass-mobile/ios/LessPass/Info.plist View File

@@ -23,16 +23,17 @@
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true />
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict />
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
<key>NSAllowsArbitraryLoads</key>
<false/>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>NSFaceIDUsageDescription</key>
<string>Enabling Face ID allows you quick and secure your master password.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string />
<string></string>
<key>UIAppFonts</key>
<array>
<string>FontAwesome.ttf</string>
@@ -43,10 +44,8 @@
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
<string>arm64</string>
</array>
<key>UIRequiresFullScreen</key>
<true />
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
@@ -54,8 +53,6 @@
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false />
<key>ITSAppUsesNonExemptEncryption</key>
<false />
<false/>
</dict>
</plist>

+ 38
- 0
packages/lesspass-mobile/ios/LessPass/PrivacyInfo.xcprivacy View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
</array>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryFileTimestamp</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>C617.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategoryUserDefaults</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
</array>
</dict>
<dict>
<key>NSPrivacyAccessedAPIType</key>
<string>NSPrivacyAccessedAPICategorySystemBootTime</string>
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>35F9.1</string>
</array>
</dict>
</array>
<key>NSPrivacyTracking</key>
<false/>
</dict>
</plist>

+ 8
- 0
packages/lesspass-mobile/ios/LessPassModule.h View File

@@ -0,0 +1,8 @@
#ifndef LessPassModule_h
#define LessPassModule_h

#import <React/RCTBridgeModule.h>
@interface LessPassModule : NSObject <RCTBridgeModule>
@end

#endif

+ 79
- 12
packages/lesspass-mobile/ios/LessPassModule.m View File

@@ -1,16 +1,83 @@
#import "React/RCTBridgeModule.h"
#import "LessPassModule.h"
#import <CommonCrypto/CommonHMAC.h>
#import <CommonCrypto/CommonCrypto.h>

@interface RCT_EXTERN_REMAP_MODULE(LessPass, LessPassModule, NSObject)
@implementation LessPassModule

RCT_EXTERN_METHOD(createFingerprint:(NSString *) masterPassword
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
RCT_EXPORT_MODULE(LessPass);

RCT_EXTERN_METHOD(calcEntropy:(NSString *) site
withLogin: (NSString *) login
withMasterPassword: (NSString *) masterPassword
withCounter: (NSString *) counter
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
RCT_EXPORT_METHOD(createFingerprint:(NSString *)key
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
NSString *data = @"";
const char *cKey = [key cStringUsingEncoding:NSUTF8StringEncoding];
const char *cData = [data cStringUsingEncoding:NSUTF8StringEncoding];
unsigned char cHMAC[CC_SHA256_DIGEST_LENGTH];
CCHmac(kCCHmacAlgSHA256, cKey, strlen(cKey), cData, strlen(cData), cHMAC);
NSMutableString *hash = [NSMutableString stringWithCapacity:CC_SHA256_DIGEST_LENGTH * 2];
for (NSUInteger i = 0; i < CC_SHA256_DIGEST_LENGTH; i++) {
[hash appendFormat:@"%02x", cHMAC[i]];
}
resolve(hash);
}

@end
RCT_EXPORT_METHOD(calcEntropy:(NSString *)site
withLogin:(NSString *)login
withMasterPassword:(NSString *)masterPassword
withCounter:(NSString *)counter
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject)
{
NSString *salt = [NSString stringWithFormat:@"%@%@%@", site, login, counter];
NSData *keyData = [self pbkdf2WithPassword:masterPassword salt:salt keyByteCount:32 rounds:100000];
if (keyData) {
NSString *hexKey = [self hexStringFromData:keyData];
resolve(hexKey);
} else {
reject(@"calcEntropy_error", @"Error computing entropy", nil);
}
}

- (NSData *)pbkdf2WithPassword:(NSString *)password
salt:(NSString *)salt
keyByteCount:(NSUInteger)keyByteCount
rounds:(NSUInteger)rounds {
NSData *saltData = [salt dataUsingEncoding:NSUTF8StringEncoding];
NSMutableData *derivedKeyData = [NSMutableData dataWithLength:keyByteCount];
int result = CCKeyDerivationPBKDF(kCCPBKDF2,
[password UTF8String],
[password lengthOfBytesUsingEncoding:NSUTF8StringEncoding],
[saltData bytes],
[saltData length],
kCCPRFHmacAlgSHA256,
(uint)rounds,
[derivedKeyData mutableBytes],
[derivedKeyData length]);
if (result != kCCSuccess) {
return nil;
}
return derivedKeyData;
}

- (NSString *)hexStringFromData:(NSData *)data {
const unsigned char *dataBuffer = (const unsigned char *)[data bytes];
if (!dataBuffer) {
return [NSString string];
}
NSUInteger dataLength = [data length];
NSMutableString *hexString = [NSMutableString stringWithCapacity:(dataLength * 2)];
for (int i = 0; i < dataLength; ++i) {
[hexString appendString:[NSString stringWithFormat:@"%02lx", (unsigned long)dataBuffer[i]]];
}
return [NSString stringWithString:hexString];
}

@end

+ 0
- 131
packages/lesspass-mobile/ios/LessPassModule.swift View File

@@ -1,131 +0,0 @@
import Foundation

enum HMACAlgorithm {
case MD5, SHA1, SHA224, SHA256, SHA384, SHA512

func toCCHmacAlgorithm() -> CCHmacAlgorithm {
var result: Int = 0
switch self {
case .MD5:
result = kCCHmacAlgMD5
case .SHA1:
result = kCCHmacAlgSHA1
case .SHA224:
result = kCCHmacAlgSHA224
case .SHA256:
result = kCCHmacAlgSHA256
case .SHA384:
result = kCCHmacAlgSHA384
case .SHA512:
result = kCCHmacAlgSHA512
}
return CCHmacAlgorithm(result)
}

func digestLength() -> Int {
var result: CInt = 0
switch self {
case .MD5:
result = CC_MD5_DIGEST_LENGTH
case .SHA1:
result = CC_SHA1_DIGEST_LENGTH
case .SHA224:
result = CC_SHA224_DIGEST_LENGTH
case .SHA256:
result = CC_SHA256_DIGEST_LENGTH
case .SHA384:
result = CC_SHA384_DIGEST_LENGTH
case .SHA512:
result = CC_SHA512_DIGEST_LENGTH
}
return Int(result)
}
}

extension String {
func hmac(algorithm: HMACAlgorithm, key: String) -> String {
let cKey = key.cString(using: String.Encoding.utf8)
let cData = self.cString(using: String.Encoding.utf8)
var result = [CUnsignedChar](repeating: 0, count: Int(algorithm.digestLength()))
CCHmac(algorithm.toCCHmacAlgorithm(), cKey!, Int(strlen(cKey!)), cData!, Int(strlen(cData!)), &result)
let hmacData:NSData = NSData(bytes: result, length: (Int(algorithm.digestLength())))
var bytes = [UInt8](repeating:0, count: hmacData.length)
hmacData.getBytes(&bytes, length: hmacData.length)
var hexString = ""
for byte in bytes {
hexString += String(format:"%02hhx", UInt8(byte))
}
return hexString
}
}

extension Data {
struct HexEncodingOptions: OptionSet {
let rawValue: Int
static let upperCase = HexEncodingOptions(rawValue: 1 << 0)
}

func hexEncodedString(options: HexEncodingOptions = []) -> String {
let hexDigits = Array((options.contains(.upperCase) ? "0123456789ABCDEF" : "0123456789abcdef").utf16)
var chars: [unichar] = []
chars.reserveCapacity(2 * count)
for byte in self {
chars.append(hexDigits[Int(byte / 16)])
chars.append(hexDigits[Int(byte % 16)])
}
return String(utf16CodeUnits: chars, count: chars.count)
}
}

func pbkdf2(hash: CCPBKDFAlgorithm, password: String, salt: String, keyByteCount: Int, rounds: Int) -> String? {

guard let passwordData = password.data(using: .utf8), let saltData = salt.data(using: .utf8) else { return nil }

var derivedKeyData = Data(repeating: 0, count: keyByteCount)
let derivedCount = derivedKeyData.count
let derivationStatus: Int32 = derivedKeyData.withUnsafeMutableBytes { derivedKeyBytes in
let keyBuffer: UnsafeMutablePointer<UInt8> =
derivedKeyBytes.baseAddress!.assumingMemoryBound(to: UInt8.self)
return saltData.withUnsafeBytes { saltBytes -> Int32 in
let saltBuffer: UnsafePointer<UInt8> = saltBytes.baseAddress!.assumingMemoryBound(to: UInt8.self)
return CCKeyDerivationPBKDF(
CCPBKDFAlgorithm(kCCPBKDF2),
password,
passwordData.count,
saltBuffer,
saltData.count,
hash,
UInt32(rounds),
keyBuffer,
derivedCount)
}
}
return derivationStatus == kCCSuccess ? derivedKeyData.hexEncodedString() : nil
}

@objc(LessPassModule)
class LessPassModule: NSObject {
@objc(createFingerprint:resolver:rejecter:)
func createFingerprint(_ masterPassword: String,
resolver resolve: RCTPromiseResolveBlock,
rejecter reject:RCTPromiseRejectBlock) -> Void {
resolve("".hmac(algorithm: HMACAlgorithm.SHA256, key: masterPassword))
}

@objc(calcEntropy:withLogin:withMasterPassword:withCounter:resolver:rejecter:)
func calcEntropy(_ site: String,
withLogin login: String,
withMasterPassword masterPassword: String,
withCounter counter: String,
resolver resolve: RCTPromiseResolveBlock,
rejecter reject:RCTPromiseRejectBlock) -> Void {
let salt = site + login + counter
let r = pbkdf2(hash: CCPBKDFAlgorithm(kCCPRFHmacAlgSHA256), password: masterPassword, salt: salt, keyByteCount: 32, rounds: 100000)
resolve(r)
}

@objc
static func requiresMainQueueSetup() -> Bool {
return false
}
}

+ 2
- 2
packages/lesspass-mobile/ios/LessPassTests/Info.plist View File

@@ -15,10 +15,10 @@
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<string>1</string>
</dict>
</plist>

+ 18
- 21
packages/lesspass-mobile/ios/Podfile View File

@@ -1,27 +1,24 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
# Resolve react_native_pods.rb with node to allow for hoisting
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
platform :ios, min_ios_version_supported
prepare_react_native_project!

linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end

target 'LessPass' do
config = use_native_modules!

# Flags change depending on the env values.
flags = get_default_flags()

use_react_native!(
:path => config[:reactNativePath],
# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,
:fabric_enabled => flags[:fabric_enabled],
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
:flipper_configuration => FlipperConfiguration.enabled,
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
@@ -32,12 +29,12 @@ target 'LessPass' do
end

post_install do |installer|
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
react_native_post_install(
installer,
# Set `mac_catalyst_enabled` to `true` in order to apply patches
# necessary for Mac Catalyst builds
:mac_catalyst_enabled => false
config[:reactNativePath],
:mac_catalyst_enabled => false,
# :ccache_enabled => true
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end

+ 1233
- 438
packages/lesspass-mobile/ios/Podfile.lock
File diff suppressed because it is too large
View File


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save