├── .babelrc ├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .github └── workflows │ └── build.yaml ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── LICENSE.md ├── README.md ├── android ├── app │ ├── _BUCK │ ├── build.gradle │ ├── debug.keystore │ ├── proguard-rules.pro │ └── src │ │ ├── debug │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── nextcloudpasswords │ │ │ └── ReactNativeFlipper.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ └── fonts │ │ │ ├── Entypo.ttf │ │ │ ├── EvilIcons.ttf │ │ │ ├── Feather.ttf │ │ │ ├── FontAwesome.ttf │ │ │ ├── Foundation.ttf │ │ │ ├── Ionicons.ttf │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ ├── MaterialIcons.ttf │ │ │ ├── Octicons.ttf │ │ │ ├── Roboto.ttf │ │ │ ├── Roboto_medium.ttf │ │ │ ├── SimpleLineIcons.ttf │ │ │ ├── Zocial.ttf │ │ │ └── rubicon-icon-font.ttf │ │ ├── java │ │ └── com │ │ │ └── nextcloudpasswords │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ ├── nc_passwords_ic-playstore.png │ │ └── res │ │ ├── drawable │ │ └── nc_passwords_ic_foreground.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── nc_passwords_ic.xml │ │ └── nc_passwords_ic_round.xml │ │ ├── mipmap-hdpi │ │ ├── nc_passwords_ic.png │ │ └── nc_passwords_ic_round.png │ │ ├── mipmap-mdpi │ │ ├── nc_passwords_ic.png │ │ └── nc_passwords_ic_round.png │ │ ├── mipmap-xhdpi │ │ ├── nc_passwords_ic.png │ │ └── nc_passwords_ic_round.png │ │ ├── mipmap-xxhdpi │ │ ├── nc_passwords_ic.png │ │ └── nc_passwords_ic_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── nc_passwords_ic.png │ │ └── nc_passwords_ic_round.png │ │ ├── values │ │ ├── nc_passwords_ic_background.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── network_security_config.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── keystores │ ├── BUCK │ └── debug.keystore.properties └── settings.gradle ├── app.json ├── assets ├── add-view.jpg ├── favorites-view.jpg ├── generate-view.jpg ├── list-path-view.jpg ├── list-view.jpg ├── lock-view.jpg ├── login-view.jpg ├── logo.svg ├── pint-of-beer.png ├── settings-view.jpg └── site-view.jpg ├── index.js ├── ios ├── NextcloudPasswords-tvOS │ └── Info.plist ├── NextcloudPasswords-tvOSTests │ └── Info.plist ├── NextcloudPasswords.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ ├── NextcloudPasswords-tvOS.xcscheme │ │ └── NextcloudPasswords.xcscheme ├── NextcloudPasswords │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── LaunchScreen.xib │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ └── main.m ├── NextcloudPasswordsTests │ ├── Info.plist │ └── NextcloudPasswordsTests.m └── Podfile ├── package-lock.json ├── package.json ├── src ├── API │ ├── folders.js │ ├── index.js │ └── passwords.js ├── AddSite.js ├── App.js ├── Dashboard.js ├── Favorites.js ├── FooterMenu.js ├── GeneratePasswordModal.js ├── Lock.js ├── Login.js ├── Settings.js ├── SingleView.js ├── SiteList.js └── redux.js └── tools ├── .gitignore ├── build-fdroid.sh ├── com.nextcloudpasswords.yml ├── f-droid.Dockerfile ├── fix-packages.sh └── prepare-sign-for-ci.sh /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["module:metro-react-native-babel-preset"] 3 | } 4 | -------------------------------------------------------------------------------- /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | 'extends': ['standard', 'standard-react'], 3 | 'parser': 'babel-eslint', 4 | 'rules': { 5 | 'react/prop-types': 0, 6 | 'comma-dangle': 0, 7 | 'template-curly-spacing' : 'off', 8 | 'indent' : "off", 9 | 'react/jsx-closing-tag-location': 'off' 10 | }, 11 | 'globals': { 12 | '__DEV__': false 13 | } 14 | } -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; These should not be required directly 12 | ; require from fbjs/lib instead: require('fbjs/lib/warning') 13 | node_modules/warning/.* 14 | 15 | ; Flow doesn't support platforms 16 | .*/Libraries/Utilities/LoadingView.js 17 | 18 | [untyped] 19 | .*/node_modules/@react-native-community/cli/.*/.* 20 | 21 | [include] 22 | 23 | [libs] 24 | node_modules/react-native/interface.js 25 | node_modules/react-native/flow/ 26 | node_modules/react-native/flow-github/ 27 | 28 | [options] 29 | emoji=true 30 | 31 | esproposal.optional_chaining=enable 32 | esproposal.nullish_coalescing=enable 33 | 34 | module.file_ext=.js 35 | module.file_ext=.json 36 | module.file_ext=.ios.js 37 | 38 | munge_underscores=true 39 | 40 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 41 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 42 | 43 | suppress_type=$FlowIssue 44 | suppress_type=$FlowFixMe 45 | suppress_type=$FlowFixMeProps 46 | suppress_type=$FlowFixMeState 47 | 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ 50 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 51 | 52 | [lints] 53 | sketchy-null-number=warn 54 | sketchy-null-mixed=warn 55 | sketchy-number=warn 56 | untyped-type-import=warn 57 | nonstrict-import=warn 58 | deprecated-type=warn 59 | unsafe-getters-setters=warn 60 | unnecessary-invariant=warn 61 | signature-verification-failure=warn 62 | deprecated-utility=error 63 | 64 | [strict] 65 | deprecated-type 66 | nonstrict-import 67 | sketchy-null 68 | unclear-type 69 | unsafe-getters-setters 70 | untyped-import 71 | untyped-type-import 72 | 73 | [version] 74 | ^0.122.0 75 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | # specific for windows script files 3 | *.bat text eol=crlf 4 | -------------------------------------------------------------------------------- /.github/workflows/build.yaml: -------------------------------------------------------------------------------- 1 | name: Build commit 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | 9 | steps: 10 | - uses: actions/checkout@v2 11 | - name: Install npm dependencies 12 | run: npm ci 13 | - name: Set up JDK 1.8 14 | uses: actions/setup-java@v1 15 | with: 16 | java-version: 1.8 17 | - name: Cache Gradle packages 18 | uses: actions/cache@v2 19 | with: 20 | path: ~/.gradle/caches 21 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} 22 | restore-keys: ${{ runner.os }}-gradle 23 | - name: Prepare Signing Files 24 | env: 25 | SIGNING_KEY: ${{ secrets.SIGNING_KEY }} 26 | ALIAS: ${{ secrets.ALIAS }} 27 | KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} 28 | KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} 29 | run: | 30 | ./tools/prepare-sign-for-ci.sh 31 | - name: Build Release 32 | id: buildRelease 33 | run: | 34 | cd android \ 35 | && echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" >> local.properties \ 36 | && ./gradlew assembleRelease bundleRelease 37 | - name: Upload Artifacts 38 | id: uploadArtifact 39 | uses: actions/upload-artifact@v2 40 | with: 41 | name: release 42 | path: | 43 | android/app/build/outputs/bundle/release/app-release.aab 44 | android/app/build/outputs/apk/release/app-release.apk 45 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | }; -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## This project is no longer maintained 2 | 3 | ### Nextcloud Passwords Mobile App 4 | 5 | Nextcloud Passwords React-based app for Android and IOS. 6 | 7 | [Get it on F-Droid](https://f-droid.org/packages/com.nextcloudpasswords/) 10 | [Get it on Google Play](https://play.google.com/store/apps/details?id=com.nextcloudpasswords) 13 | 14 |
15 |
16 | Login View 17 | List View 18 | List View 19 | Add View 20 | Generate View 21 | Site View 22 | Generate View 23 | Generate View 24 |
25 | -------------------------------------------------------------------------------- /android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | lib_deps = [] 12 | 13 | for jarfile in glob(['libs/*.jar']): 14 | name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')] 15 | lib_deps.append(':' + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | 21 | for aarfile in glob(['libs/*.aar']): 22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')] 23 | lib_deps.append(':' + name) 24 | android_prebuilt_aar( 25 | name = name, 26 | aar = aarfile, 27 | ) 28 | 29 | android_library( 30 | name = "all-libs", 31 | exported_deps = lib_deps, 32 | ) 33 | 34 | android_library( 35 | name = "app-code", 36 | srcs = glob([ 37 | "src/main/java/**/*.java", 38 | ]), 39 | deps = [ 40 | ":all-libs", 41 | ":build_config", 42 | ":res", 43 | ], 44 | ) 45 | 46 | android_build_config( 47 | name = "build_config", 48 | package = "com.nextcloudpasswords", 49 | ) 50 | 51 | android_resource( 52 | name = "res", 53 | package = "com.nextcloudpasswords", 54 | res = "src/main/res", 55 | ) 56 | 57 | android_binary( 58 | name = "app", 59 | keystore = "//android/keystores:debug", 60 | manifest = "src/main/AndroidManifest.xml", 61 | package_type = "debug", 62 | deps = [ 63 | ":app-code", 64 | ], 65 | ) 66 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | 5 | /** 6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 7 | * and bundleReleaseJsAndAssets). 8 | * These basically call `react-native bundle` with the correct arguments during the Android build 9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 10 | * bundle directly from the development server. Below you can see all the possible configurations 11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 12 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 13 | * 14 | * project.ext.react = [ 15 | * // the name of the generated asset file containing your JS bundle 16 | * bundleAssetName: "index.android.bundle", 17 | * 18 | * // the entry file for bundle generation. If none specified and 19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 20 | * // default. Can be overridden with ENTRY_FILE environment variable. 21 | * entryFile: "index.android.js", 22 | * 23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 24 | * bundleCommand: "ram-bundle", 25 | * 26 | * // whether to bundle JS and assets in debug mode 27 | * bundleInDebug: false, 28 | * 29 | * // whether to bundle JS and assets in release mode 30 | * bundleInRelease: true, 31 | * 32 | * // whether to bundle JS and assets in another build variant (if configured). 33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 34 | * // The configuration property can be in the following formats 35 | * // 'bundleIn${productFlavor}${buildType}' 36 | * // 'bundleIn${buildType}' 37 | * // bundleInFreeDebug: true, 38 | * // bundleInPaidRelease: true, 39 | * // bundleInBeta: true, 40 | * 41 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 42 | * // for example: to disable dev mode in the staging build type (if configured) 43 | * devDisabledInStaging: true, 44 | * // The configuration property can be in the following formats 45 | * // 'devDisabledIn${productFlavor}${buildType}' 46 | * // 'devDisabledIn${buildType}' 47 | * 48 | * // the root of your project, i.e. where "package.json" lives 49 | * root: "../../", 50 | * 51 | * // where to put the JS bundle asset in debug mode 52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 53 | * 54 | * // where to put the JS bundle asset in release mode 55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in debug mode 59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 60 | * 61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 62 | * // require('./image.png')), in release mode 63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 64 | * 65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 69 | * // for example, you might want to remove it from here. 70 | * inputExcludes: ["android/**", "ios/**"], 71 | * 72 | * // override which node gets called and with what additional arguments 73 | * nodeExecutableAndArgs: ["node"], 74 | * 75 | * // supply additional arguments to the packager 76 | * extraPackagerArgs: [] 77 | * ] 78 | */ 79 | 80 | project.ext.react = [ 81 | enableHermes: false, // clean and rebuild if changing 82 | ] 83 | 84 | apply from: "../../node_modules/react-native/react.gradle" 85 | 86 | /** 87 | * Set this to true to create two separate APKs instead of one: 88 | * - An APK that only works on ARM devices 89 | * - An APK that only works on x86 devices 90 | * The advantage is the size of the APK is reduced by about 4MB. 91 | * Upload all the APKs to the Play Store and people will download 92 | * the correct one based on the CPU architecture of their device. 93 | */ 94 | def enableSeparateBuildPerCPUArchitecture = false 95 | 96 | /** 97 | * Run Proguard to shrink the Java bytecode in release builds. 98 | */ 99 | def enableProguardInReleaseBuilds = false 100 | 101 | /** 102 | * The preferred build flavor of JavaScriptCore. 103 | * 104 | * For example, to use the international variant, you can use: 105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 106 | * 107 | * The international variant includes ICU i18n library and necessary data 108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 109 | * give correct results when using with locales other than en-US. Note that 110 | * this variant is about 6MiB larger per architecture than default. 111 | */ 112 | def jscFlavor = 'org.webkit:android-jsc:+' 113 | /** 114 | * Whether to enable the Hermes VM. 115 | * 116 | * This should be set on project.ext.react and mirrored here. If it is not set 117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 118 | * and the benefits of using Hermes will therefore be sharply reduced. 119 | */ 120 | def enableHermes = project.ext.react.get("enableHermes", false); 121 | 122 | android { 123 | compileSdkVersion rootProject.ext.compileSdkVersion 124 | buildToolsVersion rootProject.ext.buildToolsVersion 125 | 126 | defaultConfig { 127 | applicationId "com.nextcloudpasswords" 128 | minSdkVersion rootProject.ext.minSdkVersion 129 | targetSdkVersion rootProject.ext.targetSdkVersion 130 | versionCode 16 131 | versionName "1.15" 132 | ndk { 133 | abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 134 | } 135 | } 136 | signingConfigs { 137 | release { 138 | if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) { 139 | storeFile file(MYAPP_RELEASE_STORE_FILE) 140 | storePassword MYAPP_RELEASE_STORE_PASSWORD 141 | keyAlias MYAPP_RELEASE_KEY_ALIAS 142 | keyPassword MYAPP_RELEASE_KEY_PASSWORD 143 | } 144 | } 145 | } 146 | splits { 147 | abi { 148 | reset() 149 | enable enableSeparateBuildPerCPUArchitecture 150 | universalApk false // If true, also generate a universal APK 151 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 152 | } 153 | } 154 | buildTypes { 155 | debug { 156 | manifestPlaceholders = [ 157 | excludeSystemAlertWindowPermission: "false" 158 | ] 159 | } 160 | release { 161 | manifestPlaceholders = [ 162 | excludeSystemAlertWindowPermission: "true" 163 | ] 164 | minifyEnabled enableProguardInReleaseBuilds 165 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 166 | signingConfig signingConfigs.release 167 | } 168 | } 169 | 170 | // applicationVariants are e.g. debug, release 171 | applicationVariants.all { variant -> 172 | variant.outputs.each { output -> 173 | // For each separate APK per architecture, set a unique version code as described here: 174 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits 175 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 176 | def abi = output.getFilter(OutputFile.ABI) 177 | if (abi != null) { // null for the universal-debug, universal-release variants 178 | output.versionCodeOverride = 179 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode 180 | } 181 | } 182 | } 183 | } 184 | 185 | dependencies { 186 | implementation fileTree(dir: "libs", include: ["*.jar"]) 187 | //noinspection GradleDynamicVersion 188 | implementation "com.facebook.react:react-native:+" // From node_modules 189 | 190 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 191 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 192 | exclude group:'com.facebook.fbjni' 193 | } 194 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 195 | exclude group:'com.facebook.flipper' 196 | exclude group:'com.squareup.okhttp3', module:'okhttp' 197 | } 198 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 199 | exclude group:'com.facebook.flipper' 200 | } 201 | 202 | // It crashed without the following... (?) 203 | // https://stackoverflow.com/a/57839094/5555865 204 | //implementation 'androidx.appcompat:appcompat:1.1.0-rc01' 205 | //implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02' 206 | 207 | if (enableHermes) { 208 | def hermesPath = "../../node_modules/hermes-engine/android/"; 209 | debugImplementation files(hermesPath + "hermes-debug.aar") 210 | releaseImplementation files(hermesPath + "hermes-release.aar") 211 | } else { 212 | implementation jscFlavor 213 | } 214 | } 215 | 216 | // Run this once to be able to run the application with BUCK 217 | // puts all compile dependencies into folder libs for BUCK to use 218 | task copyDownloadableDepsToLibs(type: Copy) { 219 | from configurations.compile 220 | into 'libs' 221 | } 222 | 223 | 224 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/debug.keystore -------------------------------------------------------------------------------- /android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # MeiZu Fingerprint 13 | 14 | -keep class com.fingerprints.service.** { *; } 15 | -dontwarn com.fingerprints.service.** 16 | 17 | # Samsung Fingerprint 18 | 19 | -keep class com.samsung.android.sdk.** { *; } 20 | -dontwarn com.samsung.android.sdk.** 21 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/debug/java/com/nextcloudpasswords/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.rndiffapp; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | public class ReactNativeFlipper { 28 | public static void initializeFlipper(Context context, final ReactInstanceManager reactInstanceManager) { 29 | if (FlipperUtils.shouldEnableFlipper(context)) { 30 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | 32 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 33 | client.addPlugin(new ReactFlipperPlugin()); 34 | client.addPlugin(new DatabasesFlipperPlugin(context)); 35 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 36 | client.addPlugin(CrashReporterPlugin.getInstance()); 37 | 38 | final NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 39 | NetworkingModule.setCustomClientBuilder( 40 | new NetworkingModule.CustomClientBuilder() { 41 | @Override 42 | public void apply(OkHttpClient.Builder builder) { 43 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 44 | } 45 | }); 46 | client.addPlugin(networkFlipperPlugin); 47 | client.start(); 48 | 49 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 50 | // Hence we run if after all native modules have been initialized 51 | final ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 52 | if (reactContext == null) { 53 | reactInstanceManager.addReactInstanceEventListener( 54 | new ReactInstanceManager.ReactInstanceEventListener() { 55 | @Override 56 | public void onReactContextInitialized(ReactContext reactContext) { 57 | reactInstanceManager.removeReactInstanceEventListener(this); 58 | reactContext.runOnNativeModulesQueueThread( 59 | new Runnable() { 60 | @Override 61 | public void run() { 62 | client.addPlugin(new FrescoFlipperPlugin()); 63 | } 64 | }); 65 | } 66 | }); 67 | } else { 68 | client.addPlugin(new FrescoFlipperPlugin()); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 9 | 12 | 15 | 16 | 24 | 26 | 28 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Roboto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/Roboto.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Roboto_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/Roboto_medium.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /android/app/src/main/assets/fonts/rubicon-icon-font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/assets/fonts/rubicon-icon-font.ttf -------------------------------------------------------------------------------- /android/app/src/main/java/com/nextcloudpasswords/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.nextcloudpasswords; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "NextcloudPasswords"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/nextcloudpasswords/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.nextcloudpasswords; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = 17 | new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | @SuppressWarnings("UnnecessaryLocalVariable") 26 | List packages = new PackageList(this).getPackages(); 27 | // Packages that cannot be autolinked yet can be added manually here, for example: 28 | // packages.add(new MyReactNativePackage()); 29 | return packages; 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | // available in RN 0.62+ 48 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); // Remove this line if you don't want Flipper enabled 49 | } 50 | 51 | /** 52 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 53 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 54 | * 55 | * @param context 56 | * @param reactInstanceManager 57 | */ 58 | private static void initializeFlipper( 59 | Context context, ReactInstanceManager reactInstanceManager) { 60 | if (BuildConfig.DEBUG) { 61 | try { 62 | /* 63 | We use reflection here to pick up the class that initializes Flipper, 64 | since Flipper library is not available in release mode 65 | */ 66 | Class aClass = Class.forName("com.nextcloudpasswords.ReactNativeFlipper"); 67 | aClass 68 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 69 | .invoke(null, context, reactInstanceManager); 70 | } catch (ClassNotFoundException e) { 71 | e.printStackTrace(); 72 | } catch (NoSuchMethodException e) { 73 | e.printStackTrace(); 74 | } catch (IllegalAccessException e) { 75 | e.printStackTrace(); 76 | } catch (InvocationTargetException e) { 77 | e.printStackTrace(); 78 | } 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /android/app/src/main/nc_passwords_ic-playstore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/nc_passwords_ic-playstore.png -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/nc_passwords_ic_foreground.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/nc_passwords_ic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-anydpi-v26/nc_passwords_ic_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/nc_passwords_ic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-hdpi/nc_passwords_ic.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/nc_passwords_ic_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-hdpi/nc_passwords_ic_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/nc_passwords_ic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-mdpi/nc_passwords_ic.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/nc_passwords_ic_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-mdpi/nc_passwords_ic_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/nc_passwords_ic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-xhdpi/nc_passwords_ic.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/nc_passwords_ic_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-xhdpi/nc_passwords_ic_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/nc_passwords_ic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-xxhdpi/nc_passwords_ic.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/nc_passwords_ic_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-xxhdpi/nc_passwords_ic_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/nc_passwords_ic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-xxxhdpi/nc_passwords_ic.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/nc_passwords_ic_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/app/src/main/res/mipmap-xxxhdpi/nc_passwords_ic_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/nc_passwords_ic_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #0082CF 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | NextcloudPasswords 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/xml/network_security_config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 127.0.0.1 11 | localhost 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "29.0.2" 6 | minSdkVersion = 16 7 | compileSdkVersion = 29 8 | targetSdkVersion = 29 9 | // supportLibVersion = 28 10 | // kotlin_version = '1.3.0' 11 | } 12 | repositories { 13 | google() 14 | jcenter() 15 | } 16 | dependencies { 17 | classpath('com.android.tools.build:gradle:4.0.1') 18 | 19 | // NOTE: Do not place your application dependencies here; they belong 20 | // in the individual module build.gradle files 21 | } 22 | } 23 | 24 | allprojects { 25 | repositories { 26 | mavenLocal() 27 | maven { 28 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 29 | url("$rootDir/../node_modules/react-native/android") 30 | } 31 | maven { 32 | // Android JSC is installed from npm 33 | url("$rootDir/../node_modules/jsc-android/dist") 34 | } 35 | 36 | google() 37 | jcenter() 38 | maven { url 'https://www.jitpack.io' } 39 | } 40 | } 41 | 42 | 43 | wrapper { 44 | gradleVersion = '4.4' 45 | distributionUrl = distributionUrl.replace("bin", "all") 46 | } 47 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.37.0 29 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=`expr $i + 1` 158 | done 159 | case $i in 160 | 0) set -- ;; 161 | 1) set -- "$args0" ;; 162 | 2) set -- "$args0" "$args1" ;; 163 | 3) set -- "$args0" "$args1" "$args2" ;; 164 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=`save "$@"` 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | exec "$JAVACMD" "$@" 184 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto init 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto init 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :init 68 | @rem Get command-line arguments, handling Windows variants 69 | 70 | if not "%OS%" == "Windows_NT" goto win9xME_args 71 | 72 | :win9xME_args 73 | @rem Slurp the command line arguments. 74 | set CMD_LINE_ARGS= 75 | set _SKIP=2 76 | 77 | :win9xME_args_slurp 78 | if "x%~1" == "x" goto execute 79 | 80 | set CMD_LINE_ARGS=%* 81 | 82 | :execute 83 | @rem Setup the command line 84 | 85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 86 | 87 | @rem Execute Gradle 88 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 89 | 90 | :end 91 | @rem End local scope for the variables with windows NT shell 92 | if "%ERRORLEVEL%"=="0" goto mainEnd 93 | 94 | :fail 95 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 96 | rem the _cmd.exe /c_ return code! 97 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 98 | exit /b 1 99 | 100 | :mainEnd 101 | if "%OS%"=="Windows_NT" endlocal 102 | 103 | :omega 104 | -------------------------------------------------------------------------------- /android/keystores/BUCK: -------------------------------------------------------------------------------- 1 | keystore( 2 | name = "debug", 3 | properties = "debug.keystore.properties", 4 | store = "debug.keystore", 5 | visibility = [ 6 | "PUBLIC", 7 | ], 8 | ) 9 | -------------------------------------------------------------------------------- /android/keystores/debug.keystore.properties: -------------------------------------------------------------------------------- 1 | key.store=debug.keystore 2 | key.alias=androiddebugkey 3 | key.store.password=android 4 | key.alias.password=android 5 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'NextcloudPasswords' 2 | 3 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 4 | include ':app' 5 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NextcloudPasswords", 3 | "displayName": "NextcloudPasswords" 4 | } -------------------------------------------------------------------------------- /assets/add-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/add-view.jpg -------------------------------------------------------------------------------- /assets/favorites-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/favorites-view.jpg -------------------------------------------------------------------------------- /assets/generate-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/generate-view.jpg -------------------------------------------------------------------------------- /assets/list-path-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/list-path-view.jpg -------------------------------------------------------------------------------- /assets/list-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/list-view.jpg -------------------------------------------------------------------------------- /assets/lock-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/lock-view.jpg -------------------------------------------------------------------------------- /assets/login-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/login-view.jpg -------------------------------------------------------------------------------- /assets/logo.svg: -------------------------------------------------------------------------------- 1 | 2 | image/svg+xml 3 | 4 | 5 | background 6 | 7 | 8 | 9 | Layer 1 10 | 11 | 12 | -------------------------------------------------------------------------------- /assets/pint-of-beer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/pint-of-beer.png -------------------------------------------------------------------------------- /assets/settings-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/settings-view.jpg -------------------------------------------------------------------------------- /assets/site-view.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/daper/nextcloud-passwords-app/b8ee7347333b921a1943eb2621085f66d5130252/assets/site-view.jpg -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** @format */ 2 | 3 | import { decode, encode } from 'base-64' 4 | 5 | import React, { Component } from 'react' 6 | import { AppRegistry, YellowBox } from 'react-native' 7 | import App from './src/App' 8 | import { name as appName } from './app.json' 9 | import { Provider } from 'react-redux' 10 | import { PersistGate } from 'redux-persist/integration/react' 11 | import configureStore from './src/redux' 12 | 13 | if (!global.btoa) { 14 | global.btoa = encode 15 | } 16 | 17 | if (!global.atob) { 18 | global.atob = decode 19 | } 20 | 21 | if (__DEV__) { 22 | console.disableYellowBox = true 23 | YellowBox.ignoreWarnings([ 24 | 'Remote debugger', 25 | 'unknown call: "relay:check"' 26 | ]) 27 | } 28 | 29 | export const { store, persistor } = configureStore() 30 | 31 | class Application extends Component { 32 | render () { 33 | return ( 34 | 35 | 36 | 37 | 38 | 39 | ) 40 | } 41 | } 42 | 43 | AppRegistry.registerComponent(appName, () => Application) 44 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSExceptionDomains 45 | 46 | localhost 47 | 48 | NSExceptionAllowsInsecureHTTPLoads 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords.xcodeproj/xcshareddata/xcschemes/NextcloudPasswords-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords.xcodeproj/xcshareddata/xcschemes/NextcloudPasswords.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 43 | 49 | 50 | 51 | 52 | 53 | 58 | 59 | 61 | 67 | 68 | 69 | 70 | 71 | 77 | 78 | 79 | 80 | 81 | 82 | 92 | 94 | 100 | 101 | 102 | 103 | 104 | 105 | 111 | 113 | 119 | 120 | 121 | 122 | 124 | 125 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | @interface AppDelegate : UIResponder 11 | 12 | @property (nonatomic, strong) UIWindow *window; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import "AppDelegate.h" 9 | 10 | #import 11 | #import 12 | 13 | @implementation AppDelegate 14 | 15 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 16 | { 17 | NSURL *jsCodeLocation; 18 | 19 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 20 | 21 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 22 | moduleName:@"NextcloudPasswords" 23 | initialProperties:nil 24 | launchOptions:launchOptions]; 25 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 26 | 27 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 28 | UIViewController *rootViewController = [UIViewController new]; 29 | rootViewController.view = rootView; 30 | self.window.rootViewController = rootViewController; 31 | [self.window makeKeyAndVisible]; 32 | return YES; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /ios/NextcloudPasswords/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | NextcloudPasswords 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSLocationWhenInUseUsageDescription 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UIViewControllerBasedStatusBarAppearance 42 | 43 | NSAppTransportSecurity 44 | 45 | NSAllowsArbitraryLoads 46 | 47 | NSExceptionDomains 48 | 49 | localhost 50 | 51 | NSExceptionAllowsInsecureHTTPLoads 52 | 53 | 54 | 55 | 56 | UIAppFonts 57 | 58 | Entypo.ttf 59 | EvilIcons.ttf 60 | Feather.ttf 61 | FontAwesome.ttf 62 | Foundation.ttf 63 | Ionicons.ttf 64 | MaterialCommunityIcons.ttf 65 | MaterialIcons.ttf 66 | Octicons.ttf 67 | Roboto_medium.ttf 68 | Roboto.ttf 69 | rubicon-icon-font.ttf 70 | SimpleLineIcons.ttf 71 | Zocial.ttf 72 | 73 | LSApplicationQueriesSchemes 74 | 75 | nc 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /ios/NextcloudPasswords/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ios/NextcloudPasswordsTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/NextcloudPasswordsTests/NextcloudPasswordsTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | #import 9 | #import 10 | 11 | #import 12 | #import 13 | 14 | #define TIMEOUT_SECONDS 600 15 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 16 | 17 | @interface NextcloudPasswordsTests : XCTestCase 18 | 19 | @end 20 | 21 | @implementation NextcloudPasswordsTests 22 | 23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 24 | { 25 | if (test(view)) { 26 | return YES; 27 | } 28 | for (UIView *subview in [view subviews]) { 29 | if ([self findSubviewInView:subview matching:test]) { 30 | return YES; 31 | } 32 | } 33 | return NO; 34 | } 35 | 36 | - (void)testRendersWelcomeScreen 37 | { 38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 40 | BOOL foundElement = NO; 41 | 42 | __block NSString *redboxError = nil; 43 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 44 | if (level >= RCTLogLevelError) { 45 | redboxError = message; 46 | } 47 | }); 48 | 49 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 50 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 51 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 52 | 53 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 54 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 55 | return YES; 56 | } 57 | return NO; 58 | }]; 59 | } 60 | 61 | RCTSetLogFunction(RCTDefaultLogFunction); 62 | 63 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 64 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 65 | } 66 | 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | target 'NextcloudPasswords' do 5 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 6 | # use_frameworks! 7 | 8 | pod 'React', :path => '../node_modules/react-native/' 9 | pod 'React-Core', :path => '../node_modules/react-native/React' 10 | pod 'React-DevSupport', :path => '../node_modules/react-native/React' 11 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' 12 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' 13 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' 14 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' 15 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' 16 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' 17 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' 18 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' 19 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' 20 | pod 'React-RCTWebSocket', :path => '../node_modules/react-native/Libraries/WebSocket' 21 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' 22 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' 23 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' 24 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' 25 | pod 'yoga', :path => '../node_modules/react-native/ReactCommon/yoga' 26 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' 27 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' 28 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 29 | 30 | # Pods for NextcloudPasswords 31 | pod 'SQLCipher' 32 | 33 | target 'NextcloudPasswords-tvOSTests' do 34 | inherit! :search_paths 35 | # Pods for testing 36 | 37 | end 38 | 39 | target 'NextcloudPasswordsTests' do 40 | inherit! :search_paths 41 | # Pods for testing 42 | end 43 | 44 | end -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NextcloudPasswords", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "react-native start", 7 | "test": "jest", 8 | "lint": "eslint .", 9 | "build-android": "cd android && ./gradlew assembleRelease", 10 | "flow": "flow", 11 | "run-android": "npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res && npx react-native run-android", 12 | "log-android": "npx react-native log-android", 13 | "cache-clean": "cd android && ./gradlew clean cleanBuildCache && cd .. && rm -rf node_modules/ && npm cache clean --force && npm install && npm start -- --reset-cache", 14 | "postinstall": "./tools/fix-packages.sh" 15 | }, 16 | "dependencies": { 17 | "@react-native-community/clipboard": "^1.2.3", 18 | "@react-native-community/picker": "^1.6.6", 19 | "@react-native-community/slider": "^3.0.3", 20 | "axios": "~0.19.2", 21 | "native-base": "^2.13.13", 22 | "prop-types": "^15.7.2", 23 | "react": "16.13.1", 24 | "react-native": "0.63.2", 25 | "react-native-fingerprint-scanner": "^6.0.0", 26 | "react-native-fs": "^2.16.0", 27 | "react-native-sensitive-info": "^5.5.8", 28 | "react-native-sqlcipher-2": "^1.0.2", 29 | "react-native-svg": "^12.1.0", 30 | "react-native-webview": "^10.3.3", 31 | "react-redux": "~7.2.1", 32 | "react-router-native": "~5.2.0", 33 | "redux": "~4.0.4", 34 | "redux-persist": "~6.0.0", 35 | "redux-persist-sensitive-storage": "~1.0.0" 36 | }, 37 | "devDependencies": { 38 | "babel-eslint": "^10.0.3", 39 | "babel-jest": "^25.5.1", 40 | "eslint": "^6.5.1", 41 | "eslint-config-standard": "^14.1.1", 42 | "eslint-config-standard-react": "^9.2.0", 43 | "eslint-plugin-import": "^2.22.0", 44 | "eslint-plugin-node": "^11.1.0", 45 | "eslint-plugin-promise": "^4.2.1", 46 | "eslint-plugin-react": "^7.20.5", 47 | "eslint-plugin-standard": "^4.0.1", 48 | "flow-bin": "^0.122.0", 49 | "jest": "^25.5.4", 50 | "metro-react-native-babel-preset": "^0.59.0", 51 | "react-test-renderer": "^16.13.1" 52 | }, 53 | "jest": { 54 | "preset": "react-native" 55 | }, 56 | "lint": "./node_modules/.bin/eslint *.js **/*.js" 57 | } 58 | -------------------------------------------------------------------------------- /src/API/folders.js: -------------------------------------------------------------------------------- 1 | const FOLDER_FIELDS = [ 2 | 'id', 3 | 'label', 4 | 'parent', 5 | 'created', 6 | 'updated', 7 | 'edited', 8 | 'revision', 9 | 'cseType', 10 | 'sseType', 11 | 'hidden', 12 | 'trashed', 13 | 'favorite', 14 | ] 15 | 16 | export const ROOT_FOLDER = '00000000-0000-0000-0000-000000000000' 17 | 18 | export class Folders { 19 | setDb (db) { 20 | this.db = db 21 | } 22 | 23 | setHttp (http) { 24 | this.http = http 25 | } 26 | 27 | _executeSql (query, data = []) { 28 | return new Promise((resolve, reject) => { 29 | this.db.transaction((txn) => { 30 | txn.executeSql(query, data, 31 | (txn, data) => resolve(data), 32 | (txn, err) => { 33 | if (__DEV__) console.log(err) 34 | reject(err) 35 | } 36 | ) 37 | }) 38 | }) 39 | } 40 | 41 | async createTable () { 42 | await this._executeSql(` 43 | create table if not exists folders( 44 | id string primary key not null, 45 | label string, 46 | parent string, 47 | created integer, 48 | updated integer, 49 | edited integer, 50 | revision string, 51 | cseType string, 52 | sseType string, 53 | hidden integer, 54 | trashed integer, 55 | favorite integer 56 | )`) 57 | await this._executeSql('create index if not exists folders_parent on folders(parent)') 58 | await this._executeSql('create index if not exists folders_hidden on folders(hidden)') 59 | await this._executeSql('create index if not exists folders_trashed on folders(trashed)') 60 | await this._executeSql('create index if not exists folders_favorite on folders(favorite)') 61 | } 62 | 63 | saveList (list) { 64 | return new Promise((resolve, reject) => { 65 | this.db.transaction((txn) => { 66 | Promise.all(list.map((obj) => this.objectToRow(obj)) 67 | .map(row => { 68 | return this.saveRow(txn, row) 69 | })) 70 | .then(resolve) 71 | .catch(reject) 72 | }) 73 | }) 74 | } 75 | 76 | saveRow (txn, row) { 77 | const questions = FOLDER_FIELDS.map((field) => '?').join(',') 78 | return this._executeSql(`insert or replace into folders values (${questions})`, row) 79 | } 80 | 81 | rowToObject (row) { 82 | const labels = [ 83 | 'id', 84 | 'label', 85 | 'parent', 86 | 'created', 87 | 'updated', 88 | 'edited', 89 | 'revision', 90 | 'cseType', 91 | 'sseType', 92 | 'hidden', 93 | 'trashed', 94 | 'favorite', 95 | ] 96 | const ret = {} 97 | labels.forEach((label, pos) => { ret[label] = row[pos] }) 98 | return ret 99 | } 100 | 101 | objectToRow (object) { 102 | return [ 103 | object.id, 104 | object.label, 105 | object.parent, 106 | object.created, 107 | object.updated, 108 | object.edited, 109 | object.revision, 110 | object.cseType, 111 | object.sseType, 112 | object.hidden, 113 | object.trashed, 114 | object.favorite, 115 | ] 116 | } 117 | 118 | async fetchAll () { 119 | try { 120 | let { data, status } = await this.http.post('/api/1.0/folder/list', { detailLevel: 'model+parent+folders+passwords' }) 121 | data = Object.keys(data).map((key) => data[key]) 122 | if (__DEV__) console.log(data[0]) 123 | 124 | await this.deleteAll() 125 | await this.saveList(data) 126 | 127 | return { status, data } 128 | } catch (error) { 129 | if (__DEV__) console.log(`error while getting folders ${error}`) 130 | return { 131 | error, 132 | status: (error.response || {}).status || undefined 133 | } 134 | } 135 | } 136 | 137 | async getAll (fields = FOLDER_FIELDS) { 138 | try { 139 | fields = fields.filter((field) => FOLDER_FIELDS.indexOf(field) !== -1).join(',') 140 | const { rows } = await this._executeSql(`select ${fields} from folders where hidden=0 and trashed=0`) 141 | return rows._array 142 | } catch (err) { 143 | if (__DEV__) console.log('error getting data', err) 144 | return [] 145 | } 146 | } 147 | 148 | async getItem (id) { 149 | try { 150 | const { rows } = await this._executeSql('select * from folders where id=?', [id]) 151 | return rows._array[0] 152 | } catch (err) { 153 | if (__DEV__) console.log('error getting data', err) 154 | return [] 155 | } 156 | } 157 | 158 | async getChildren (folderId, fields = FOLDER_FIELDS) { 159 | const { rows } = await this._executeSql(`select ${fields.join(',')} 160 | from folders where parent=? and hidden=0 and trashed=0`, [folderId]) 161 | return rows._array 162 | } 163 | 164 | async getFavoriteChildren (folderId, fields = FOLDER_FIELDS) { 165 | const { rows } = await this._executeSql(`select ${fields.join(',')} 166 | from folders where parent=? 167 | and hidden=0 and trashed=0 168 | and favorite=1`, [folderId]) 169 | return rows._array 170 | } 171 | 172 | async deleteAll () { 173 | return this._executeSql('delete from folders') 174 | } 175 | } 176 | 177 | export default new Folders() 178 | -------------------------------------------------------------------------------- /src/API/index.js: -------------------------------------------------------------------------------- 1 | import axios from 'axios' 2 | import { Platform } from 'react-native' 3 | import SQLite, { encodeName } from 'react-native-sqlcipher-2' 4 | import fs from 'react-native-fs' 5 | import Passwords from './passwords' 6 | import Folders from './folders' 7 | export { default as Passwords } from './passwords' 8 | export { 9 | default as Folders, 10 | ROOT_FOLDER, 11 | } from './folders' 12 | 13 | export const Colors = { 14 | bgColor: '#0082c9', 15 | grey: '#414142' 16 | } 17 | 18 | export class API { 19 | models = [Passwords, Folders] 20 | 21 | constructor () { 22 | this.credentials = null 23 | this.instance = null 24 | } 25 | 26 | init (settings) { 27 | this.credentials = settings 28 | const { user, password } = this.credentials 29 | 30 | let auth = {} 31 | if (user && password) { 32 | auth = { 33 | username: user, 34 | password: password 35 | } 36 | } 37 | 38 | this.instance = axios.create({ 39 | baseURL: `${this.credentials.server}/index.php/apps/passwords`, 40 | timeout: 2 * 60 * 1000, 41 | headers: { 'OCS-APIRequest': 'true' }, 42 | auth 43 | }) 44 | 45 | this.instance.interceptors.request.use(request => { 46 | if (__DEV__) console.log('Starting Request', request) 47 | return request 48 | }) 49 | 50 | this.instance.interceptors.response.use(response => { 51 | if (__DEV__) console.log('Response:', response) 52 | return response 53 | }) 54 | 55 | this.models.forEach((model) => model.setHttp(this.instance)) 56 | } 57 | 58 | async openDB (dbName, _debugSrc) { 59 | if (__DEV__) console.log(`Called openDB(${dbName}) from ${_debugSrc}`, this.db) 60 | 61 | if (this.credentials.password === '') { 62 | return new Error('Cannot open DB. Invalid master password') 63 | } else if (!this.db) { 64 | this.db = await new Promise((resolve, reject) => { 65 | const db = SQLite.openDatabase(encodeName(dbName, this.credentials.password), '1.0', '', 200, () => { 66 | resolve(db) 67 | }) 68 | }) 69 | 70 | if (__DEV__) { /* 71 | console.log(`Got DB(${dbName}):`, this.db) 72 | 73 | const rootDir = Platform.select({ 74 | ios: fs.MainBundlePath, 75 | android: fs.DocumentDirectoryPath, 76 | }) 77 | 78 | const dbPath = `${rootDir}/${dbName}` 79 | 80 | try { 81 | await fs.stat(dbPath) 82 | .then((statResult) => { 83 | console.log('DB File Stat', statResult) 84 | }) 85 | } catch (e) { 86 | console.log(`Looks like the fs call failed to ${dbPath}`) 87 | console.log(e) 88 | } 89 | */ } 90 | 91 | this.models.forEach((model) => model.setDb(this.db)) 92 | 93 | await Promise.all(this.models.map((model) => model.createTable())) 94 | } else { 95 | if (__DEV__) console.log('DB is opened: no-op') 96 | } 97 | } 98 | 99 | async dropDB (dbName) { 100 | this.db = null 101 | 102 | const rootDir = Platform.select({ 103 | ios: fs.MainBundlePath, 104 | android: fs.DocumentDirectoryPath, 105 | }) 106 | 107 | return fs.unlink(`${rootDir}/${dbName}`) 108 | .then(() => { 109 | if (__DEV__) console.log('FILE DELETED') 110 | }) 111 | .catch((err) => { 112 | if (__DEV__) console.log(err.message) 113 | }) 114 | } 115 | 116 | async validateServer () { 117 | // curl -u username:password -X GET 'https://cloud.example.com/ocs/v1.php/...' -H "OCS-APIRequest: true" 118 | try { 119 | const { data, status } = await axios.get('/ocs/v1.php/cloud/capabilities', { 120 | baseURL: `${this.credentials.server}`, 121 | timeout: 10 * 1000, 122 | headers: { 'OCS-APIRequest': 'true' }, 123 | auth: { 124 | username: this.credentials.user, 125 | password: this.credentials.password, 126 | } 127 | }) 128 | return { 129 | data, 130 | status, 131 | error: null, 132 | } 133 | } catch (err) { 134 | return { 135 | data: {}, 136 | status: (err.response || {}).status, 137 | error: err, 138 | } 139 | } 140 | } 141 | } 142 | 143 | export default new API() 144 | -------------------------------------------------------------------------------- /src/API/passwords.js: -------------------------------------------------------------------------------- 1 | const PASSWORD_FIELDS = [ 2 | 'id', 3 | 'label', 4 | 'username', 5 | // 'password', 6 | 'url', 7 | 'notes', 8 | 'customFields', 9 | 'status', 10 | 'statusCode', 11 | 'hash', 12 | 'folder', 13 | 'revision', 14 | 'share', 15 | 'cseType', 16 | 'sseType', 17 | 'hidden', 18 | 'trashed', 19 | 'favorite', 20 | 'editable', 21 | 'edited', 22 | 'created', 23 | 'updated', 24 | ] 25 | 26 | export class Passwords { 27 | setDb (db) { 28 | this.db = db 29 | } 30 | 31 | setHttp (http) { 32 | this.http = http 33 | } 34 | 35 | _executeSql (query, data = []) { 36 | return new Promise((resolve, reject) => { 37 | if (!this.db) { 38 | reject(new Error('DB not initialized')) 39 | } else { 40 | this.db.transaction((txn) => { 41 | txn.executeSql(query, data, 42 | (txn, data) => resolve(data), 43 | (txn, err) => { 44 | if (__DEV__) console.log(err) 45 | reject(err) 46 | } 47 | ) 48 | }) 49 | } 50 | }) 51 | } 52 | 53 | async createTable () { 54 | await this._executeSql(` 55 | create table if not exists passwords( 56 | id string primary key not null, 57 | label string, 58 | username blob, 59 | password blob, 60 | url string, 61 | notes string, 62 | customFields string, 63 | status integer, 64 | statusCode string, 65 | hash string, 66 | folder string, 67 | revision string, 68 | share string, 69 | cseType string, 70 | sseType string, 71 | hidden integer, 72 | trashed integer, 73 | favorite integer, 74 | editable integer, 75 | edited integer, 76 | created integer, 77 | updated integer 78 | )`) 79 | await this._executeSql('create index if not exists passwords_folder on passwords(folder)') 80 | await this._executeSql('create index if not exists passwords_favorite on passwords(favorite)') 81 | await this._executeSql('create index if not exists passwords_hidden on passwords(hidden)') 82 | await this._executeSql('create index if not exists passwords_trashed on passwords(trashed)') 83 | } 84 | 85 | saveList (list) { 86 | return new Promise((resolve, reject) => { 87 | this.db.transaction((txn) => { 88 | Promise.all(list.map((obj) => this.objectToRow(obj)) 89 | .map(row => { 90 | return this.saveRow(txn, row) 91 | })) 92 | .then(resolve) 93 | .catch(reject) 94 | }) 95 | }) 96 | } 97 | 98 | saveRow (txn, row) { 99 | const questions = [...PASSWORD_FIELDS, '?'].map((field) => '?').join(',') 100 | return this._executeSql(`insert or replace into passwords values (${questions})`, row) 101 | } 102 | 103 | rowToObject (row) { 104 | const labels = [ 105 | 'id', 106 | 'label', 107 | 'username', 108 | 'password', 109 | 'url', 110 | 'notes', 111 | 'customFields', 112 | 'status', 113 | 'statusCode', 114 | 'hash', 115 | 'folder', 116 | 'revision', 117 | 'share', 118 | 'cseType', 119 | 'sseType', 120 | 'hidden', 121 | 'trashed', 122 | 'favorite', 123 | 'editable', 124 | 'edited', 125 | 'created', 126 | 'updated', 127 | ] 128 | const ret = {} 129 | labels.forEach((label, pos) => { ret[label] = row[pos] }) 130 | return ret 131 | } 132 | 133 | objectToRow (object) { 134 | return [ 135 | object.id, 136 | object.label, 137 | object.username, 138 | object.password, 139 | object.url, 140 | object.notes, 141 | object.customFields, 142 | object.status, 143 | object.statusCode, 144 | object.hash, 145 | object.folder, 146 | object.revision, 147 | object.share, 148 | object.cseType, 149 | object.sseType, 150 | object.hidden, 151 | object.trashed, 152 | object.favorite, 153 | object.editable, 154 | object.edited, 155 | object.created, 156 | object.updated, 157 | ] 158 | } 159 | 160 | async fetchAll () { 161 | try { 162 | let { data, status } = await this.http.post('/api/1.0/password/list', { detailLevel: 'model+folder' }) 163 | data = Object.keys(data).map((key) => data[key]) 164 | if (__DEV__) console.log(data[0]) 165 | 166 | await this.deleteAll() 167 | await this.saveList(data) 168 | 169 | return { status, data } 170 | } catch (error) { 171 | if (__DEV__) console.log(`error while getting passwords ${error}`) 172 | return { 173 | error, 174 | status: (error.response || {}).status || undefined 175 | } 176 | } 177 | } 178 | 179 | async getAll (fields = []) { 180 | try { 181 | if (fields.length === 0) { 182 | fields = PASSWORD_FIELDS 183 | } 184 | 185 | fields = fields.filter((field) => PASSWORD_FIELDS.indexOf(field) !== -1).join(',') 186 | const { rows } = await this._executeSql(`select ${fields} from passwords where hidden=0 and trashed=0`) 187 | return rows._array 188 | } catch (err) { 189 | if (__DEV__) console.log('error getting data', err) 190 | return [] 191 | } 192 | } 193 | 194 | async deleteAll () { 195 | return this._executeSql('delete from passwords') 196 | } 197 | 198 | async fetchItem (id) { 199 | try { 200 | const { status, data } = await this.http.post('/api/1.0/password/show', { id }) 201 | if (status === 200) { 202 | return data 203 | } else { 204 | return new Error('Invalid API response while retrieving password') 205 | } 206 | } catch (err) { 207 | if (__DEV__) console.log(err) 208 | return new Error('Invalid API response while retrieving password') 209 | } 210 | } 211 | 212 | async getItem (id) { 213 | const { rows } = await this._executeSql('select * from passwords where id=?', [id]) 214 | return rows._array[0] 215 | } 216 | 217 | async updateItem (item) { 218 | try { 219 | const currentItem = await this.fetchItem(item.id) 220 | item = { ...currentItem, ...item } 221 | await this.http.patch('/api/1.0/password/update', '', { params: { ...item } }) 222 | 223 | let cols = Object.keys(item).filter((col) => [...PASSWORD_FIELDS, 'password'].indexOf(col) !== -1) 224 | const values = cols.map((key) => item[key]) 225 | cols = cols.map((col) => `${col}=?`).join(',') 226 | values.push(item.id) 227 | 228 | await this._executeSql(`update passwords set ${cols} where id=?`, values) 229 | } catch (err) { 230 | if (__DEV__) console.log('error while updating', err) 231 | } 232 | } 233 | 234 | async deleteItem (id) { 235 | try { 236 | await this.http.delete('/api/1.0/password/delete', { params: { id } }) 237 | await this._executeSql('delete from passwords where id=?', [id]) 238 | } catch (err) { 239 | if (__DEV__) console.log('error while deleting', err) 240 | } 241 | } 242 | 243 | async search (value, fieldsToSearch = [], fieldsToRetrieve = []) { 244 | if (fieldsToSearch.length === 0) fieldsToSearch = PASSWORD_FIELDS 245 | if (fieldsToRetrieve.length === 0) fieldsToRetrieve = PASSWORD_FIELDS 246 | 247 | fieldsToSearch = fieldsToSearch 248 | .filter((field) => PASSWORD_FIELDS.indexOf(field) !== -1) 249 | .map((field) => `${field} like ?`) 250 | const values = fieldsToSearch.map(() => `%${value}%`) 251 | fieldsToRetrieve = fieldsToRetrieve.filter((field) => PASSWORD_FIELDS.indexOf(field) !== -1).join(',') 252 | 253 | try { 254 | const { rows } = await this._executeSql(` 255 | select ${fieldsToRetrieve} 256 | from passwords 257 | where ${fieldsToSearch.join(' or ')} 258 | `, values) 259 | 260 | return rows._array 261 | } catch (err) { 262 | if (__DEV__) console.log('error searching data', err) 263 | return [] 264 | } 265 | } 266 | 267 | async getPassword (id) { 268 | const { rows } = await this._executeSql('select password from passwords where id=?', [id]) 269 | return rows._array[0].password 270 | } 271 | 272 | async generateDefaultPassword (settings = null) { 273 | try { 274 | if (settings === null) { 275 | const { data } = await this.http.get('/api/1.0/service/password') 276 | return data 277 | } else { 278 | const { data } = await this.http.post('/api/1.0/service/password', { ...settings }) 279 | return data 280 | } 281 | } catch (err) { 282 | return new Error('Error while asking for new password') 283 | } 284 | } 285 | 286 | async setFavorite (id, enable = null) { 287 | const passwordData = await this.fetchItem(id) 288 | if (enable === null) { 289 | passwordData.favorite = !passwordData.favorite 290 | } else { 291 | passwordData.favorite = enable 292 | } 293 | 294 | try { 295 | const { status } = await this.http.patch('/api/1.0/password/update', passwordData) 296 | 297 | if (status === 200) { 298 | await this.updateItem(passwordData) 299 | return passwordData 300 | } else { 301 | return new Error('Invalid API response') 302 | } 303 | } catch (err) { 304 | if (__DEV__) console.log(err) 305 | return err 306 | } 307 | } 308 | 309 | async create (item) { 310 | if (!item.password || !item.label) { 311 | return new Error('Invalid item to create') 312 | } 313 | 314 | try { 315 | const { status, data } = await this.http.post('/api/1.0/password/create', item) 316 | 317 | if (status === 201) { 318 | // Default fields // 319 | if (! ("hidden" in item)) item.hidden = 0 320 | if (! ("trashed" in item)) item.trashed = 0 321 | if (! ("favorite" in item)) item.favorite = 0 322 | if (! ("editable" in item)) item.editable = 1 323 | 324 | item.id = data.id 325 | let cols = Object.keys(item).filter((col) => [...PASSWORD_FIELDS, 'password'].indexOf(col) !== -1) 326 | const values = cols.map((key) => item[key]) 327 | const questions = values.map(() => '?').join(',') 328 | cols = cols.join(',') 329 | 330 | await this._executeSql(`insert into passwords(${cols}) values(${questions})`, values) 331 | return data 332 | } else { 333 | return new Error('Invalid API response') 334 | } 335 | } catch (err) { 336 | if (__DEV__) console.log(err) 337 | } 338 | } 339 | 340 | async getFromFolder (folderId, fields = []) { 341 | if (fields.length === 0) { 342 | fields = PASSWORD_FIELDS 343 | } 344 | 345 | fields = fields.filter((field) => PASSWORD_FIELDS.indexOf(field) !== -1).join(',') 346 | const { rows } = await this._executeSql(`select ${fields} from passwords where folder=? and hidden=0 and trashed=0`, [folderId]) 347 | return rows._array 348 | } 349 | 350 | async getAllFavorites (fields = []) { 351 | try { 352 | if (fields.length === 0) { 353 | fields = PASSWORD_FIELDS 354 | } 355 | 356 | fields = fields.filter((field) => PASSWORD_FIELDS.indexOf(field) !== -1).join(',') 357 | const { rows } = await this._executeSql(`select ${fields} from passwords where hidden=0 and trashed=0 and favorite=1`) 358 | return rows._array 359 | } catch (err) { 360 | if (__DEV__) console.log('error getting data', err) 361 | return [] 362 | } 363 | } 364 | 365 | async getFavoritesFromFolder (folderId, fields = PASSWORD_FIELDS) { 366 | fields = fields.filter((field) => PASSWORD_FIELDS.indexOf(field) !== -1).join(',') 367 | const { rows } = await this._executeSql(`select ${fields} from passwords where folder=? 368 | and hidden=0 and trashed=0 and favorite=1`, [folderId]) 369 | return rows._array 370 | } 371 | } 372 | 373 | export default new Passwords() 374 | -------------------------------------------------------------------------------- /src/AddSite.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import { 3 | StyleSheet, 4 | BackHandler, 5 | Dimensions, 6 | } from 'react-native' 7 | import { 8 | Container, 9 | Header, 10 | Left, 11 | Button, 12 | Icon, 13 | Body, 14 | Title, 15 | Footer, 16 | FooterTab, 17 | Text, 18 | Content, 19 | Form, 20 | Item, 21 | Label, 22 | Input, 23 | Textarea, 24 | CheckBox, 25 | View, 26 | Spinner, 27 | } from 'native-base' 28 | import { 29 | togglePasswordModal, 30 | setLoading, 31 | } from './redux' 32 | import { connect } from 'react-redux' 33 | import { Colors, Passwords } from './API' 34 | import GeneratePasswordModal from './GeneratePasswordModal' 35 | 36 | export class AddSite extends Component { 37 | constructor (props) { 38 | super(props) 39 | 40 | this.state = { 41 | item: { 42 | folder: this.props.currentFolder, 43 | customFields: '[]' 44 | }, 45 | showPassword: false, 46 | passwordIsError: false, 47 | labelIsError: false, 48 | } 49 | 50 | this.handleGoBack = this.handleGoBack.bind(this) 51 | this.updateHandler = this.updateHandler.bind(this) 52 | this.handleSubmit = this.handleSubmit.bind(this) 53 | } 54 | 55 | componentDidMount () { 56 | this.backHandler = BackHandler.addEventListener('hardwareBackPress', () => { 57 | this.handleGoBack() 58 | return true 59 | }) 60 | } 61 | 62 | componentWillUnmount () { 63 | this.backHandler.remove() 64 | } 65 | 66 | async handleGoBack () { 67 | this.props.history.push('/dashboard') 68 | } 69 | 70 | updateHandler (name, value) { 71 | const item = this.state.item 72 | item[name] = value 73 | this.setState({ item }) 74 | } 75 | 76 | validate () { 77 | let result = true 78 | if (this.state.item.password) { 79 | this.setState({ passwordIsError: false }) 80 | } else { 81 | this.setState({ passwordIsError: true }) 82 | result = false 83 | } 84 | 85 | if (this.state.item.label) { 86 | this.setState({ labelIsError: false }) 87 | } else { 88 | this.setState({ labelIsError: true }) 89 | result = false 90 | } 91 | 92 | return result 93 | } 94 | 95 | async handleSubmit () { 96 | if (this.validate()) { 97 | this.props.setLoading(true, 'Creating site...') 98 | const data = await Passwords.create(this.state.item) 99 | this.props.setLoading(false) 100 | 101 | if (!(data instanceof Error)) { 102 | this.props.history.push('/dashboard?refresh=true') 103 | } 104 | } 105 | } 106 | 107 | render () { 108 | return ( 109 | 110 | {!this.props.loading && 111 |

112 | 113 | 116 | 117 | 118 | Create Site 119 | 120 |
} 121 | 122 | {this.props.loading 123 | ? 124 | 125 | {this.props.statusText} 126 | 127 | :
128 | 129 | 130 | this.updateHandler('username', filter)} 133 | /> 134 | 135 | 136 | 137 | this.updateHandler('password', filter)} 141 | /> 142 | 149 | 155 | 156 | 157 | 158 | this.updateHandler('label', filter)} 161 | /> 162 | 163 | 164 | 165 | this.updateHandler('url', filter)} 168 | /> 169 | 170 | 171 | 172 |