react-native-mosquito-transport 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/CODE_OF_CONDUCT.md +133 -0
  2. package/CONTRIBUTING.md +114 -0
  3. package/LICENSE +21 -0
  4. package/README.md +1 -0
  5. package/android/build.gradle +77 -0
  6. package/android/gradle.properties +5 -0
  7. package/android/src/main/AndroidManifest.xml +4 -0
  8. package/android/src/main/java/com/mosquitodb/MosquitodbModule.java +32 -0
  9. package/android/src/main/java/com/mosquitodb/MosquitodbPackage.java +28 -0
  10. package/example/.bundle/config +2 -0
  11. package/example/.node-version +1 -0
  12. package/example/.watchmanconfig +1 -0
  13. package/example/Gemfile +6 -0
  14. package/example/android/app/build.gradle +170 -0
  15. package/example/android/app/debug.keystore +0 -0
  16. package/example/android/app/proguard-rules.pro +10 -0
  17. package/example/android/app/src/debug/AndroidManifest.xml +13 -0
  18. package/example/android/app/src/debug/java/com/mosquitodbexample/ReactNativeFlipper.java +75 -0
  19. package/example/android/app/src/main/AndroidManifest.xml +25 -0
  20. package/example/android/app/src/main/java/com/mosquitodbexample/MainActivity.java +35 -0
  21. package/example/android/app/src/main/java/com/mosquitodbexample/MainApplication.java +62 -0
  22. package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
  23. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  24. package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  25. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  26. package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  27. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  28. package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  29. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  30. package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  31. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  32. package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  33. package/example/android/app/src/main/res/values/strings.xml +3 -0
  34. package/example/android/app/src/main/res/values/styles.xml +9 -0
  35. package/example/android/app/src/release/java/com/mosquitodbexample/ReactNativeFlipper.java +20 -0
  36. package/example/android/build.gradle +21 -0
  37. package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  38. package/example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
  39. package/example/android/gradle.properties +44 -0
  40. package/example/android/gradlew +234 -0
  41. package/example/android/gradlew.bat +89 -0
  42. package/example/android/settings.gradle +4 -0
  43. package/example/app.json +4 -0
  44. package/example/babel.config.js +17 -0
  45. package/example/index.js +5 -0
  46. package/example/ios/.xcode.env +11 -0
  47. package/example/ios/File.swift +6 -0
  48. package/example/ios/MosquitodbExample/AppDelegate.h +6 -0
  49. package/example/ios/MosquitodbExample/AppDelegate.mm +36 -0
  50. package/example/ios/MosquitodbExample/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  51. package/example/ios/MosquitodbExample/Images.xcassets/Contents.json +6 -0
  52. package/example/ios/MosquitodbExample/Info.plist +55 -0
  53. package/example/ios/MosquitodbExample/LaunchScreen.storyboard +47 -0
  54. package/example/ios/MosquitodbExample/main.m +10 -0
  55. package/example/ios/MosquitodbExample-Bridging-Header.h +3 -0
  56. package/example/ios/MosquitodbExample.xcodeproj/project.pbxproj +702 -0
  57. package/example/ios/MosquitodbExample.xcodeproj/xcshareddata/xcschemes/MosquitodbExample.xcscheme +88 -0
  58. package/example/ios/MosquitodbExampleTests/Info.plist +24 -0
  59. package/example/ios/MosquitodbExampleTests/MosquitodbExampleTests.m +66 -0
  60. package/example/ios/Podfile +60 -0
  61. package/example/metro.config.js +40 -0
  62. package/example/package.json +22 -0
  63. package/example/react-native.config.js +10 -0
  64. package/example/src/App.tsx +31 -0
  65. package/ios/Mosquitodb-Bridging-Header.h +2 -0
  66. package/ios/Mosquitodb.m +22 -0
  67. package/ios/Mosquitodb.swift +305 -0
  68. package/ios/Mosquitodb.xcodeproj/project.pbxproj +283 -0
  69. package/package.json +45 -0
  70. package/react-native-mosquitodb.podspec +35 -0
  71. package/src/helpers/EngineApi.js +34 -0
  72. package/src/helpers/listeners.js +7 -0
  73. package/src/helpers/peripherals.js +195 -0
  74. package/src/helpers/utils.js +113 -0
  75. package/src/helpers/values.js +72 -0
  76. package/src/helpers/variables.js +34 -0
  77. package/src/index.d.ts +373 -0
  78. package/src/index.js +369 -0
  79. package/src/products/auth/accessor.js +151 -0
  80. package/src/products/auth/index.js +279 -0
  81. package/src/products/database/accessor.js +316 -0
  82. package/src/products/database/index.js +603 -0
  83. package/src/products/database/types.js +22 -0
  84. package/src/products/database/validator.js +282 -0
  85. package/src/products/http_callable/index.js +230 -0
  86. package/src/products/storage/index.js +217 -0
@@ -0,0 +1,133 @@
1
+
2
+ # Contributor Covenant Code of Conduct
3
+
4
+ ## Our Pledge
5
+
6
+ We as members, contributors, and leaders pledge to make participation in our
7
+ community a harassment-free experience for everyone, regardless of age, body
8
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
9
+ identity and expression, level of experience, education, socio-economic status,
10
+ nationality, personal appearance, race, caste, color, religion, or sexual
11
+ identity and orientation.
12
+
13
+ We pledge to act and interact in ways that contribute to an open, welcoming,
14
+ diverse, inclusive, and healthy community.
15
+
16
+ ## Our Standards
17
+
18
+ Examples of behavior that contributes to a positive environment for our
19
+ community include:
20
+
21
+ * Demonstrating empathy and kindness toward other people
22
+ * Being respectful of differing opinions, viewpoints, and experiences
23
+ * Giving and gracefully accepting constructive feedback
24
+ * Accepting responsibility and apologizing to those affected by our mistakes,
25
+ and learning from the experience
26
+ * Focusing on what is best not just for us as individuals, but for the overall
27
+ community
28
+
29
+ Examples of unacceptable behavior include:
30
+
31
+ * The use of sexualized language or imagery, and sexual attention or advances of
32
+ any kind
33
+ * Trolling, insulting or derogatory comments, and personal or political attacks
34
+ * Public or private harassment
35
+ * Publishing others' private information, such as a physical or email address,
36
+ without their explicit permission
37
+ * Other conduct which could reasonably be considered inappropriate in a
38
+ professional setting
39
+
40
+ ## Enforcement Responsibilities
41
+
42
+ Community leaders are responsible for clarifying and enforcing our standards of
43
+ acceptable behavior and will take appropriate and fair corrective action in
44
+ response to any behavior that they deem inappropriate, threatening, offensive,
45
+ or harmful.
46
+
47
+ Community leaders have the right and responsibility to remove, edit, or reject
48
+ comments, commits, code, wiki edits, issues, and other contributions that are
49
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
50
+ decisions when appropriate.
51
+
52
+ ## Scope
53
+
54
+ This Code of Conduct applies within all community spaces, and also applies when
55
+ an individual is officially representing the community in public spaces.
56
+ Examples of representing our community include using an official e-mail address,
57
+ posting via an official social media account, or acting as an appointed
58
+ representative at an online or offline event.
59
+
60
+ ## Enforcement
61
+
62
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
63
+ reported to the community leaders responsible for enforcement at
64
+ [INSERT CONTACT METHOD].
65
+ All complaints will be reviewed and investigated promptly and fairly.
66
+
67
+ All community leaders are obligated to respect the privacy and security of the
68
+ reporter of any incident.
69
+
70
+ ## Enforcement Guidelines
71
+
72
+ Community leaders will follow these Community Impact Guidelines in determining
73
+ the consequences for any action they deem in violation of this Code of Conduct:
74
+
75
+ ### 1. Correction
76
+
77
+ **Community Impact**: Use of inappropriate language or other behavior deemed
78
+ unprofessional or unwelcome in the community.
79
+
80
+ **Consequence**: A private, written warning from community leaders, providing
81
+ clarity around the nature of the violation and an explanation of why the
82
+ behavior was inappropriate. A public apology may be requested.
83
+
84
+ ### 2. Warning
85
+
86
+ **Community Impact**: A violation through a single incident or series of
87
+ actions.
88
+
89
+ **Consequence**: A warning with consequences for continued behavior. No
90
+ interaction with the people involved, including unsolicited interaction with
91
+ those enforcing the Code of Conduct, for a specified period of time. This
92
+ includes avoiding interactions in community spaces as well as external channels
93
+ like social media. Violating these terms may lead to a temporary or permanent
94
+ ban.
95
+
96
+ ### 3. Temporary Ban
97
+
98
+ **Community Impact**: A serious violation of community standards, including
99
+ sustained inappropriate behavior.
100
+
101
+ **Consequence**: A temporary ban from any sort of interaction or public
102
+ communication with the community for a specified period of time. No public or
103
+ private interaction with the people involved, including unsolicited interaction
104
+ with those enforcing the Code of Conduct, is allowed during this period.
105
+ Violating these terms may lead to a permanent ban.
106
+
107
+ ### 4. Permanent Ban
108
+
109
+ **Community Impact**: Demonstrating a pattern of violation of community
110
+ standards, including sustained inappropriate behavior, harassment of an
111
+ individual, or aggression toward or disparagement of classes of individuals.
112
+
113
+ **Consequence**: A permanent ban from any sort of public interaction within the
114
+ community.
115
+
116
+ ## Attribution
117
+
118
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
119
+ version 2.1, available at
120
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
121
+
122
+ Community Impact Guidelines were inspired by
123
+ [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
124
+
125
+ For answers to common questions about this code of conduct, see the FAQ at
126
+ [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
127
+ [https://www.contributor-covenant.org/translations][translations].
128
+
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
131
+ [Mozilla CoC]: https://github.com/mozilla/diversity
132
+ [FAQ]: https://www.contributor-covenant.org/faq
133
+ [translations]: https://www.contributor-covenant.org/translations
@@ -0,0 +1,114 @@
1
+ # Contributing
2
+
3
+ Contributions are always welcome, no matter how large or small!
4
+
5
+ We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project. Before contributing, please read the [code of conduct](./CODE_OF_CONDUCT.md).
6
+
7
+ ## Development workflow
8
+
9
+ To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:
10
+
11
+ ```sh
12
+ yarn
13
+ ```
14
+
15
+ > While it's possible to use [`npm`](https://github.com/npm/cli), the tooling is built around [`yarn`](https://classic.yarnpkg.com/), so you'll have an easier time if you use `yarn` for development.
16
+
17
+ While developing, you can run the [example app](/example/) to test your changes. Any changes you make in your library's JavaScript code will be reflected in the example app without a rebuild. If you change any native code, then you'll need to rebuild the example app.
18
+
19
+ To start the packager:
20
+
21
+ ```sh
22
+ yarn example start
23
+ ```
24
+
25
+ To run the example app on Android:
26
+
27
+ ```sh
28
+ yarn example android
29
+ ```
30
+
31
+ To run the example app on iOS:
32
+
33
+ ```sh
34
+ yarn example ios
35
+ ```
36
+
37
+ Make sure your code passes TypeScript and ESLint. Run the following to verify:
38
+
39
+ ```sh
40
+ yarn typecheck
41
+ yarn lint
42
+ ```
43
+
44
+ To fix formatting errors, run the following:
45
+
46
+ ```sh
47
+ yarn lint --fix
48
+ ```
49
+
50
+ Remember to add tests for your change if possible. Run the unit tests by:
51
+
52
+ ```sh
53
+ yarn test
54
+ ```
55
+
56
+ To edit the Objective-C or Swift files, open `example/ios/MosquitodbExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-mosquitodb`.
57
+
58
+ To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-mosquitodb` under `Android`.
59
+
60
+
61
+ ### Commit message convention
62
+
63
+ We follow the [conventional commits specification](https://www.conventionalcommits.org/en) for our commit messages:
64
+
65
+ - `fix`: bug fixes, e.g. fix crash due to deprecated method.
66
+ - `feat`: new features, e.g. add new method to the module.
67
+ - `refactor`: code refactor, e.g. migrate from class components to hooks.
68
+ - `docs`: changes into documentation, e.g. add usage example for the module..
69
+ - `test`: adding or updating tests, e.g. add integration tests using detox.
70
+ - `chore`: tooling changes, e.g. change CI config.
71
+
72
+ Our pre-commit hooks verify that your commit message matches this format when committing.
73
+
74
+ ### Linting and tests
75
+
76
+ [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/)
77
+
78
+ We use [TypeScript](https://www.typescriptlang.org/) for type checking, [ESLint](https://eslint.org/) with [Prettier](https://prettier.io/) for linting and formatting the code, and [Jest](https://jestjs.io/) for testing.
79
+
80
+ Our pre-commit hooks verify that the linter and tests pass when committing.
81
+
82
+ ### Publishing to npm
83
+
84
+ We use [release-it](https://github.com/release-it/release-it) to make it easier to publish new versions. It handles common tasks like bumping version based on semver, creating tags and releases etc.
85
+
86
+ To publish new versions, run the following:
87
+
88
+ ```sh
89
+ yarn release
90
+ ```
91
+
92
+ ### Scripts
93
+
94
+ The `package.json` file contains various scripts for common tasks:
95
+
96
+ - `yarn bootstrap`: setup project by installing all dependencies and pods.
97
+ - `yarn typecheck`: type-check files with TypeScript.
98
+ - `yarn lint`: lint files with ESLint.
99
+ - `yarn test`: run unit tests with Jest.
100
+ - `yarn example start`: start the Metro server for the example app.
101
+ - `yarn example android`: run the example app on Android.
102
+ - `yarn example ios`: run the example app on iOS.
103
+
104
+ ### Sending a pull request
105
+
106
+ > **Working on your first pull request?** You can learn how from this _free_ series: [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github).
107
+
108
+ When you're sending a pull request:
109
+
110
+ - Prefer small pull requests focused on one change.
111
+ - Verify that linters and tests are passing.
112
+ - Review the documentation to make sure it looks good.
113
+ - Follow the pull request template when opening a pull request.
114
+ - For pull requests that change the API or implementation, discuss with maintainers first by opening an issue.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 BrainbehindX
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # react-native-mosquito-transport
@@ -0,0 +1,77 @@
1
+ buildscript {
2
+ repositories {
3
+ google()
4
+ mavenCentral()
5
+ }
6
+
7
+ dependencies {
8
+ classpath "com.android.tools.build:gradle:7.2.1"
9
+ }
10
+ }
11
+
12
+ def isNewArchitectureEnabled() {
13
+ return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
14
+ }
15
+
16
+ apply plugin: "com.android.library"
17
+
18
+
19
+ def appProject = rootProject.allprojects.find { it.plugins.hasPlugin('com.android.application') }
20
+
21
+ if (isNewArchitectureEnabled()) {
22
+ apply plugin: "com.facebook.react"
23
+ }
24
+
25
+ def getExtOrDefault(name) {
26
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties["Mosquitodb_" + name]
27
+ }
28
+
29
+ def getExtOrIntegerDefault(name) {
30
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties["Mosquitodb_" + name]).toInteger()
31
+ }
32
+
33
+ android {
34
+ compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
35
+
36
+ defaultConfig {
37
+ minSdkVersion getExtOrIntegerDefault("minSdkVersion")
38
+ targetSdkVersion getExtOrIntegerDefault("targetSdkVersion")
39
+ buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
40
+ }
41
+ buildTypes {
42
+ release {
43
+ minifyEnabled false
44
+ }
45
+ }
46
+
47
+ lintOptions {
48
+ disable "GradleCompatible"
49
+ }
50
+
51
+ compileOptions {
52
+ sourceCompatibility JavaVersion.VERSION_1_8
53
+ targetCompatibility JavaVersion.VERSION_1_8
54
+ }
55
+
56
+ }
57
+
58
+ repositories {
59
+ mavenCentral()
60
+ google()
61
+ }
62
+
63
+
64
+ dependencies {
65
+ // For < 0.71, this will be from the local maven repo
66
+ // For > 0.71, this will be replaced by `com.facebook.react:react-android:$version` by react gradle plugin
67
+ //noinspection GradleDynamicVersion
68
+ implementation "com.facebook.react:react-native:+"
69
+ }
70
+
71
+ if (isNewArchitectureEnabled()) {
72
+ react {
73
+ jsRootDir = file("../src/")
74
+ libraryName = "Mosquitodb"
75
+ codegenJavaPackageName = "com.mosquitodb"
76
+ }
77
+ }
@@ -0,0 +1,5 @@
1
+ Mosquitodb_kotlinVersion=1.7.0
2
+ Mosquitodb_minSdkVersion=21
3
+ Mosquitodb_targetSdkVersion=31
4
+ Mosquitodb_compileSdkVersion=31
5
+ Mosquitodb_ndkversion=21.4.7075529
@@ -0,0 +1,4 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+ package="com.mosquitodb">
3
+
4
+ </manifest>
@@ -0,0 +1,32 @@
1
+ package com.mosquitodb;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.facebook.react.bridge.Promise;
6
+ import com.facebook.react.bridge.ReactApplicationContext;
7
+ import com.facebook.react.bridge.ReactContextBaseJavaModule;
8
+ import com.facebook.react.bridge.ReactMethod;
9
+ import com.facebook.react.module.annotations.ReactModule;
10
+
11
+ @ReactModule(name = MosquitodbModule.NAME)
12
+ public class MosquitodbModule extends ReactContextBaseJavaModule {
13
+ public static final String NAME = "Mosquitodb";
14
+
15
+ public MosquitodbModule(ReactApplicationContext reactContext) {
16
+ super(reactContext);
17
+ }
18
+
19
+ @Override
20
+ @NonNull
21
+ public String getName() {
22
+ return NAME;
23
+ }
24
+
25
+
26
+ // Example method
27
+ // See https://reactnative.dev/docs/native-modules-android
28
+ @ReactMethod
29
+ public void multiply(double a, double b, Promise promise) {
30
+ promise.resolve(a * b);
31
+ }
32
+ }
@@ -0,0 +1,28 @@
1
+ package com.mosquitodb;
2
+
3
+ import androidx.annotation.NonNull;
4
+
5
+ import com.facebook.react.ReactPackage;
6
+ import com.facebook.react.bridge.NativeModule;
7
+ import com.facebook.react.bridge.ReactApplicationContext;
8
+ import com.facebook.react.uimanager.ViewManager;
9
+
10
+ import java.util.ArrayList;
11
+ import java.util.Collections;
12
+ import java.util.List;
13
+
14
+ public class MosquitodbPackage implements ReactPackage {
15
+ @NonNull
16
+ @Override
17
+ public List<NativeModule> createNativeModules(@NonNull ReactApplicationContext reactContext) {
18
+ List<NativeModule> modules = new ArrayList<>();
19
+ modules.add(new MosquitodbModule(reactContext));
20
+ return modules;
21
+ }
22
+
23
+ @NonNull
24
+ @Override
25
+ public List<ViewManager> createViewManagers(@NonNull ReactApplicationContext reactContext) {
26
+ return Collections.emptyList();
27
+ }
28
+ }
@@ -0,0 +1,2 @@
1
+ BUNDLE_PATH: "vendor/bundle"
2
+ BUNDLE_FORCE_RUBY_PLATFORM: 1
@@ -0,0 +1 @@
1
+ 18
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,6 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
+ ruby '>= 2.6.10'
5
+
6
+ gem 'cocoapods', '>= 1.11.3'
@@ -0,0 +1,170 @@
1
+ apply plugin: "com.android.application"
2
+ apply plugin: "com.facebook.react"
3
+
4
+ import com.android.build.OutputFile
5
+
6
+ /**
7
+ * This is the configuration block to customize your React Native Android app.
8
+ * By default you don't need to apply any configuration, just uncomment the lines you need.
9
+ */
10
+ react {
11
+ /* Folders */
12
+ // The root of your project, i.e. where "package.json" lives. Default is '..'
13
+ // root = file("../")
14
+ // The folder where the react-native NPM package is. Default is ../node_modules/react-native
15
+ // reactNativeDir = file("../node_modules/react-native")
16
+ // The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
17
+ // codegenDir = file("../node_modules/react-native-codegen")
18
+ // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
19
+ // cliFile = file("../node_modules/react-native/cli.js")
20
+
21
+ /* Variants */
22
+ // The list of variants to that are debuggable. For those we're going to
23
+ // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
24
+ // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
25
+ // debuggableVariants = ["liteDebug", "prodDebug"]
26
+
27
+ /* Bundling */
28
+ // A list containing the node command and its flags. Default is just 'node'.
29
+ // nodeExecutableAndArgs = ["node"]
30
+ //
31
+ // The command to run when bundling. By default is 'bundle'
32
+ // bundleCommand = "ram-bundle"
33
+ //
34
+ // The path to the CLI configuration file. Default is empty.
35
+ // bundleConfig = file(../rn-cli.config.js)
36
+ //
37
+ // The name of the generated asset file containing your JS bundle
38
+ // bundleAssetName = "MyApplication.android.bundle"
39
+ //
40
+ // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
41
+ // entryFile = file("../js/MyApplication.android.js")
42
+ //
43
+ // A list of extra flags to pass to the 'bundle' commands.
44
+ // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
45
+ // extraPackagerArgs = []
46
+
47
+ /* Hermes Commands */
48
+ // The hermes compiler command to run. By default it is 'hermesc'
49
+ // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
50
+ //
51
+ // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
52
+ // hermesFlags = ["-O", "-output-source-map"]
53
+ }
54
+
55
+ /**
56
+ * Set this to true to create four separate APKs instead of one,
57
+ * one for each native architecture. This is useful if you don't
58
+ * use App Bundles (https://developer.android.com/guide/app-bundle/)
59
+ * and want to have separate APKs to upload to the Play Store.
60
+ */
61
+ def enableSeparateBuildPerCPUArchitecture = false
62
+
63
+ /**
64
+ * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
65
+ */
66
+ def enableProguardInReleaseBuilds = false
67
+
68
+ /**
69
+ * The preferred build flavor of JavaScriptCore (JSC)
70
+ *
71
+ * For example, to use the international variant, you can use:
72
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
73
+ *
74
+ * The international variant includes ICU i18n library and necessary data
75
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
76
+ * give correct results when using with locales other than en-US. Note that
77
+ * this variant is about 6MiB larger per architecture than default.
78
+ */
79
+ def jscFlavor = 'org.webkit:android-jsc:+'
80
+
81
+ /**
82
+ * Private function to get the list of Native Architectures you want to build.
83
+ * This reads the value from reactNativeArchitectures in your gradle.properties
84
+ * file and works together with the --active-arch-only flag of react-native run-android.
85
+ */
86
+ def reactNativeArchitectures() {
87
+ def value = project.getProperties().get("reactNativeArchitectures")
88
+ return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
89
+ }
90
+
91
+ android {
92
+ ndkVersion rootProject.ext.ndkVersion
93
+
94
+ compileSdkVersion rootProject.ext.compileSdkVersion
95
+
96
+ namespace "com.mosquitodbexample"
97
+ defaultConfig {
98
+ applicationId "com.mosquitodbexample"
99
+ minSdkVersion rootProject.ext.minSdkVersion
100
+ targetSdkVersion rootProject.ext.targetSdkVersion
101
+ versionCode 1
102
+ versionName "1.0"
103
+ }
104
+
105
+ splits {
106
+ abi {
107
+ reset()
108
+ enable enableSeparateBuildPerCPUArchitecture
109
+ universalApk false // If true, also generate a universal APK
110
+ include (*reactNativeArchitectures())
111
+ }
112
+ }
113
+ signingConfigs {
114
+ debug {
115
+ storeFile file('debug.keystore')
116
+ storePassword 'android'
117
+ keyAlias 'androiddebugkey'
118
+ keyPassword 'android'
119
+ }
120
+ }
121
+ buildTypes {
122
+ debug {
123
+ signingConfig signingConfigs.debug
124
+ }
125
+ release {
126
+ // Caution! In production, you need to generate your own keystore file.
127
+ // see https://reactnative.dev/docs/signed-apk-android.
128
+ signingConfig signingConfigs.debug
129
+ minifyEnabled enableProguardInReleaseBuilds
130
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
131
+ }
132
+ }
133
+
134
+ // applicationVariants are e.g. debug, release
135
+ applicationVariants.all { variant ->
136
+ variant.outputs.each { output ->
137
+ // For each separate APK per architecture, set a unique version code as described here:
138
+ // https://developer.android.com/studio/build/configure-apk-splits.html
139
+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
140
+ def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
141
+ def abi = output.getFilter(OutputFile.ABI)
142
+ if (abi != null) { // null for the universal-debug, universal-release variants
143
+ output.versionCodeOverride =
144
+ defaultConfig.versionCode * 1000 + versionCodes.get(abi)
145
+ }
146
+
147
+ }
148
+ }
149
+ }
150
+
151
+ dependencies {
152
+ // The version of react-native is set by the React Native Gradle Plugin
153
+ implementation("com.facebook.react:react-android")
154
+
155
+ implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
156
+
157
+ debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
158
+ debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
159
+ exclude group:'com.squareup.okhttp3', module:'okhttp'
160
+ }
161
+
162
+ debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
163
+ if (hermesEnabled.toBoolean()) {
164
+ implementation("com.facebook.react:hermes-android")
165
+ } else {
166
+ implementation jscFlavor
167
+ }
168
+ }
169
+
170
+ apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
@@ -0,0 +1,10 @@
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:
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android"
3
+ xmlns:tools="http://schemas.android.com/tools">
4
+
5
+ <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6
+
7
+ <application
8
+ android:usesCleartextTraffic="true"
9
+ tools:targetApi="28"
10
+ tools:ignore="GoogleAppIndexingWarning">
11
+ <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12
+ </application>
13
+ </manifest>