@oguzhnatly/react-native-image-manipulator 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +1 -0
- package/Example/.babelrc +3 -0
- package/Example/.buckconfig +6 -0
- package/Example/.flowconfig +70 -0
- package/Example/.gitattributes +1 -0
- package/Example/.watchmanconfig +1 -0
- package/Example/App.js +49 -0
- package/Example/android/app/BUCK +65 -0
- package/Example/android/app/build.gradle +150 -0
- package/Example/android/app/proguard-rules.pro +17 -0
- package/Example/android/app/src/main/AndroidManifest.xml +26 -0
- package/Example/android/app/src/main/java/com/example/MainActivity.java +15 -0
- package/Example/android/app/src/main/java/com/example/MainApplication.java +45 -0
- package/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/Example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/Example/android/app/src/main/res/values/strings.xml +3 -0
- package/Example/android/app/src/main/res/values/styles.xml +8 -0
- package/Example/android/build.gradle +39 -0
- package/Example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/Example/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/Example/android/gradle.properties +18 -0
- package/Example/android/gradlew +172 -0
- package/Example/android/gradlew.bat +84 -0
- package/Example/android/keystores/BUCK +8 -0
- package/Example/android/keystores/debug.keystore.properties +4 -0
- package/Example/android/settings.gradle +3 -0
- package/Example/app.json +4 -0
- package/Example/index.js +7 -0
- package/Example/ios/Example/AppDelegate.h +14 -0
- package/Example/ios/Example/AppDelegate.m +35 -0
- package/Example/ios/Example/Base.lproj/LaunchScreen.xib +42 -0
- package/Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json +38 -0
- package/Example/ios/Example/Images.xcassets/Contents.json +6 -0
- package/Example/ios/Example/Info.plist +60 -0
- package/Example/ios/Example/main.m +16 -0
- package/Example/ios/Example-tvOS/Info.plist +54 -0
- package/Example/ios/Example-tvOSTests/Info.plist +24 -0
- package/Example/ios/Example.xcodeproj/project.pbxproj +1494 -0
- package/Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example-tvOS.xcscheme +129 -0
- package/Example/ios/Example.xcodeproj/xcshareddata/xcschemes/Example.xcscheme +129 -0
- package/Example/ios/ExampleTests/ExampleTests.m +68 -0
- package/Example/ios/ExampleTests/Info.plist +24 -0
- package/Example/package.json +17 -0
- package/Example/yarn.lock +4046 -0
- package/LICENSE +21 -0
- package/README.md +127 -0
- package/android/build.gradle +36 -0
- package/android/src/main/AndroidManifest.xml +5 -0
- package/android/src/main/java/com/reactnativeimagemanipulator/RNImageManipulatorModule.java +208 -0
- package/android/src/main/java/com/reactnativeimagemanipulator/RNImageManipulatorPackage.java +29 -0
- package/index.js +5 -0
- package/ios/ImageUtils.h +9 -0
- package/ios/ImageUtils.m +14 -0
- package/ios/RNImageManipulator.h +11 -0
- package/ios/RNImageManipulator.m +200 -0
- package/ios/RNImageManipulator.xcodeproj/project.pbxproj +265 -0
- package/ios/RNImageManipulator.xcworkspace/contents.xcworkspacedata +9 -0
- package/package.json +9 -0
- package/react-native-image-manipulator.podspec +19 -0
package/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*.pbxproj -text
|
package/Example/.babelrc
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
[ignore]
|
|
2
|
+
; We fork some components by platform
|
|
3
|
+
.*/*[.]android.js
|
|
4
|
+
|
|
5
|
+
; Ignore "BUCK" generated dirs
|
|
6
|
+
<PROJECT_ROOT>/\.buckd/
|
|
7
|
+
|
|
8
|
+
; Ignore unexpected extra "@providesModule"
|
|
9
|
+
.*/node_modules/.*/node_modules/fbjs/.*
|
|
10
|
+
|
|
11
|
+
; Ignore duplicate module providers
|
|
12
|
+
; For RN Apps installed via npm, "Libraries" folder is inside
|
|
13
|
+
; "node_modules/react-native" but in the source repo it is in the root
|
|
14
|
+
.*/Libraries/react-native/React.js
|
|
15
|
+
|
|
16
|
+
; Ignore polyfills
|
|
17
|
+
.*/Libraries/polyfills/.*
|
|
18
|
+
|
|
19
|
+
; Ignore metro
|
|
20
|
+
.*/node_modules/metro/.*
|
|
21
|
+
|
|
22
|
+
[include]
|
|
23
|
+
|
|
24
|
+
[libs]
|
|
25
|
+
node_modules/react-native/Libraries/react-native/react-native-interface.js
|
|
26
|
+
node_modules/react-native/flow/
|
|
27
|
+
node_modules/react-native/flow-github/
|
|
28
|
+
|
|
29
|
+
[options]
|
|
30
|
+
emoji=true
|
|
31
|
+
|
|
32
|
+
esproposal.optional_chaining=enable
|
|
33
|
+
esproposal.nullish_coalescing=enable
|
|
34
|
+
|
|
35
|
+
module.system=haste
|
|
36
|
+
module.system.haste.use_name_reducers=true
|
|
37
|
+
# get basename
|
|
38
|
+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
|
|
39
|
+
# strip .js or .js.flow suffix
|
|
40
|
+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
|
|
41
|
+
# strip .ios suffix
|
|
42
|
+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
|
|
43
|
+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
|
|
44
|
+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
|
|
45
|
+
module.system.haste.paths.blacklist=.*/__tests__/.*
|
|
46
|
+
module.system.haste.paths.blacklist=.*/__mocks__/.*
|
|
47
|
+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
|
|
48
|
+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
|
|
49
|
+
|
|
50
|
+
munge_underscores=true
|
|
51
|
+
|
|
52
|
+
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\)$' -> 'RelativeImageStub'
|
|
53
|
+
|
|
54
|
+
module.file_ext=.js
|
|
55
|
+
module.file_ext=.jsx
|
|
56
|
+
module.file_ext=.json
|
|
57
|
+
module.file_ext=.native.js
|
|
58
|
+
|
|
59
|
+
suppress_type=$FlowIssue
|
|
60
|
+
suppress_type=$FlowFixMe
|
|
61
|
+
suppress_type=$FlowFixMeProps
|
|
62
|
+
suppress_type=$FlowFixMeState
|
|
63
|
+
|
|
64
|
+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
|
|
65
|
+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
|
|
66
|
+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
|
67
|
+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
|
|
68
|
+
|
|
69
|
+
[version]
|
|
70
|
+
^0.78.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*.pbxproj -text
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
package/Example/App.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sample React Native App
|
|
3
|
+
* https://github.com/facebook/react-native
|
|
4
|
+
*
|
|
5
|
+
* @format
|
|
6
|
+
* @flow
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import React, {Component} from 'react';
|
|
10
|
+
import {Platform, StyleSheet, Text, View} from 'react-native';
|
|
11
|
+
|
|
12
|
+
const instructions = Platform.select({
|
|
13
|
+
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
|
14
|
+
android:
|
|
15
|
+
'Double tap R on your keyboard to reload,\n' +
|
|
16
|
+
'Shake or press menu button for dev menu',
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
type Props = {};
|
|
20
|
+
export default class App extends Component<Props> {
|
|
21
|
+
render() {
|
|
22
|
+
return (
|
|
23
|
+
<View style={styles.container}>
|
|
24
|
+
<Text style={styles.welcome}>Welcome to React Native!</Text>
|
|
25
|
+
<Text style={styles.instructions}>To get started, edit App.js</Text>
|
|
26
|
+
<Text style={styles.instructions}>{instructions}</Text>
|
|
27
|
+
</View>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const styles = StyleSheet.create({
|
|
33
|
+
container: {
|
|
34
|
+
flex: 1,
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
backgroundColor: '#F5FCFF',
|
|
38
|
+
},
|
|
39
|
+
welcome: {
|
|
40
|
+
fontSize: 20,
|
|
41
|
+
textAlign: 'center',
|
|
42
|
+
margin: 10,
|
|
43
|
+
},
|
|
44
|
+
instructions: {
|
|
45
|
+
textAlign: 'center',
|
|
46
|
+
color: '#333333',
|
|
47
|
+
marginBottom: 5,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1,65 @@
|
|
|
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.example",
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
android_resource(
|
|
52
|
+
name = "res",
|
|
53
|
+
package = "com.example",
|
|
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
|
+
)
|
|
@@ -0,0 +1,150 @@
|
|
|
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
|
|
19
|
+
* entryFile: "index.android.js",
|
|
20
|
+
*
|
|
21
|
+
* // whether to bundle JS and assets in debug mode
|
|
22
|
+
* bundleInDebug: false,
|
|
23
|
+
*
|
|
24
|
+
* // whether to bundle JS and assets in release mode
|
|
25
|
+
* bundleInRelease: true,
|
|
26
|
+
*
|
|
27
|
+
* // whether to bundle JS and assets in another build variant (if configured).
|
|
28
|
+
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
|
|
29
|
+
* // The configuration property can be in the following formats
|
|
30
|
+
* // 'bundleIn${productFlavor}${buildType}'
|
|
31
|
+
* // 'bundleIn${buildType}'
|
|
32
|
+
* // bundleInFreeDebug: true,
|
|
33
|
+
* // bundleInPaidRelease: true,
|
|
34
|
+
* // bundleInBeta: true,
|
|
35
|
+
*
|
|
36
|
+
* // whether to disable dev mode in custom build variants (by default only disabled in release)
|
|
37
|
+
* // for example: to disable dev mode in the staging build type (if configured)
|
|
38
|
+
* devDisabledInStaging: true,
|
|
39
|
+
* // The configuration property can be in the following formats
|
|
40
|
+
* // 'devDisabledIn${productFlavor}${buildType}'
|
|
41
|
+
* // 'devDisabledIn${buildType}'
|
|
42
|
+
*
|
|
43
|
+
* // the root of your project, i.e. where "package.json" lives
|
|
44
|
+
* root: "../../",
|
|
45
|
+
*
|
|
46
|
+
* // where to put the JS bundle asset in debug mode
|
|
47
|
+
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
|
|
48
|
+
*
|
|
49
|
+
* // where to put the JS bundle asset in release mode
|
|
50
|
+
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
|
|
51
|
+
*
|
|
52
|
+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
|
|
53
|
+
* // require('./image.png')), in debug mode
|
|
54
|
+
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
|
|
55
|
+
*
|
|
56
|
+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
|
|
57
|
+
* // require('./image.png')), in release mode
|
|
58
|
+
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
|
|
59
|
+
*
|
|
60
|
+
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
|
|
61
|
+
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
|
|
62
|
+
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
|
|
63
|
+
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
|
|
64
|
+
* // for example, you might want to remove it from here.
|
|
65
|
+
* inputExcludes: ["android/**", "ios/**"],
|
|
66
|
+
*
|
|
67
|
+
* // override which node gets called and with what additional arguments
|
|
68
|
+
* nodeExecutableAndArgs: ["node"],
|
|
69
|
+
*
|
|
70
|
+
* // supply additional arguments to the packager
|
|
71
|
+
* extraPackagerArgs: []
|
|
72
|
+
* ]
|
|
73
|
+
*/
|
|
74
|
+
|
|
75
|
+
project.ext.react = [
|
|
76
|
+
entryFile: "index.js"
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
apply from: "../../node_modules/react-native/react.gradle"
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Set this to true to create two separate APKs instead of one:
|
|
83
|
+
* - An APK that only works on ARM devices
|
|
84
|
+
* - An APK that only works on x86 devices
|
|
85
|
+
* The advantage is the size of the APK is reduced by about 4MB.
|
|
86
|
+
* Upload all the APKs to the Play Store and people will download
|
|
87
|
+
* the correct one based on the CPU architecture of their device.
|
|
88
|
+
*/
|
|
89
|
+
def enableSeparateBuildPerCPUArchitecture = false
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Run Proguard to shrink the Java bytecode in release builds.
|
|
93
|
+
*/
|
|
94
|
+
def enableProguardInReleaseBuilds = false
|
|
95
|
+
|
|
96
|
+
android {
|
|
97
|
+
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
98
|
+
buildToolsVersion rootProject.ext.buildToolsVersion
|
|
99
|
+
|
|
100
|
+
defaultConfig {
|
|
101
|
+
applicationId "com.example"
|
|
102
|
+
minSdkVersion rootProject.ext.minSdkVersion
|
|
103
|
+
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
104
|
+
versionCode 1
|
|
105
|
+
versionName "1.0"
|
|
106
|
+
ndk {
|
|
107
|
+
abiFilters "armeabi-v7a", "x86"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
splits {
|
|
111
|
+
abi {
|
|
112
|
+
reset()
|
|
113
|
+
enable enableSeparateBuildPerCPUArchitecture
|
|
114
|
+
universalApk false // If true, also generate a universal APK
|
|
115
|
+
include "armeabi-v7a", "x86"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
buildTypes {
|
|
119
|
+
release {
|
|
120
|
+
minifyEnabled enableProguardInReleaseBuilds
|
|
121
|
+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// applicationVariants are e.g. debug, release
|
|
125
|
+
applicationVariants.all { variant ->
|
|
126
|
+
variant.outputs.each { output ->
|
|
127
|
+
// For each separate APK per architecture, set a unique version code as described here:
|
|
128
|
+
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
|
|
129
|
+
def versionCodes = ["armeabi-v7a":1, "x86":2]
|
|
130
|
+
def abi = output.getFilter(OutputFile.ABI)
|
|
131
|
+
if (abi != null) { // null for the universal-debug, universal-release variants
|
|
132
|
+
output.versionCodeOverride =
|
|
133
|
+
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
dependencies {
|
|
140
|
+
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
141
|
+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
|
|
142
|
+
implementation "com.facebook.react:react-native:+" // From node_modules
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Run this once to be able to run the application with BUCK
|
|
146
|
+
// puts all compile dependencies into folder libs for BUCK to use
|
|
147
|
+
task copyDownloadableDepsToLibs(type: Copy) {
|
|
148
|
+
from configurations.compile
|
|
149
|
+
into 'libs'
|
|
150
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
# If your project uses WebView with JS, uncomment the following
|
|
13
|
+
# and specify the fully qualified class name to the JavaScript interface
|
|
14
|
+
# class:
|
|
15
|
+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
|
16
|
+
# public *;
|
|
17
|
+
#}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
2
|
+
package="com.example">
|
|
3
|
+
|
|
4
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
5
|
+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
6
|
+
|
|
7
|
+
<application
|
|
8
|
+
android:name=".MainApplication"
|
|
9
|
+
android:label="@string/app_name"
|
|
10
|
+
android:icon="@mipmap/ic_launcher"
|
|
11
|
+
android:allowBackup="false"
|
|
12
|
+
android:theme="@style/AppTheme">
|
|
13
|
+
<activity
|
|
14
|
+
android:name=".MainActivity"
|
|
15
|
+
android:label="@string/app_name"
|
|
16
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
|
|
17
|
+
android:windowSoftInputMode="adjustResize">
|
|
18
|
+
<intent-filter>
|
|
19
|
+
<action android:name="android.intent.action.MAIN" />
|
|
20
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
21
|
+
</intent-filter>
|
|
22
|
+
</activity>
|
|
23
|
+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
|
|
24
|
+
</application>
|
|
25
|
+
|
|
26
|
+
</manifest>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
package com.example;
|
|
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.
|
|
9
|
+
* This is used to schedule rendering of the component.
|
|
10
|
+
*/
|
|
11
|
+
@Override
|
|
12
|
+
protected String getMainComponentName() {
|
|
13
|
+
return "Example";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
package com.example;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
|
|
5
|
+
import com.facebook.react.ReactApplication;
|
|
6
|
+
import com.facebook.react.ReactNativeHost;
|
|
7
|
+
import com.facebook.react.ReactPackage;
|
|
8
|
+
import com.facebook.react.shell.MainReactPackage;
|
|
9
|
+
import com.facebook.soloader.SoLoader;
|
|
10
|
+
|
|
11
|
+
import java.util.Arrays;
|
|
12
|
+
import java.util.List;
|
|
13
|
+
|
|
14
|
+
public class MainApplication extends Application implements ReactApplication {
|
|
15
|
+
|
|
16
|
+
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
|
|
17
|
+
@Override
|
|
18
|
+
public boolean getUseDeveloperSupport() {
|
|
19
|
+
return BuildConfig.DEBUG;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@Override
|
|
23
|
+
protected List<ReactPackage> getPackages() {
|
|
24
|
+
return Arrays.<ReactPackage>asList(
|
|
25
|
+
new MainReactPackage()
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@Override
|
|
30
|
+
protected String getJSMainModuleName() {
|
|
31
|
+
return "index";
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
@Override
|
|
36
|
+
public ReactNativeHost getReactNativeHost() {
|
|
37
|
+
return mReactNativeHost;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@Override
|
|
41
|
+
public void onCreate() {
|
|
42
|
+
super.onCreate();
|
|
43
|
+
SoLoader.init(this, /* native exopackage */ false);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
2
|
+
|
|
3
|
+
buildscript {
|
|
4
|
+
ext {
|
|
5
|
+
buildToolsVersion = "27.0.3"
|
|
6
|
+
minSdkVersion = 16
|
|
7
|
+
compileSdkVersion = 27
|
|
8
|
+
targetSdkVersion = 26
|
|
9
|
+
supportLibVersion = "27.1.1"
|
|
10
|
+
}
|
|
11
|
+
repositories {
|
|
12
|
+
jcenter()
|
|
13
|
+
google()
|
|
14
|
+
}
|
|
15
|
+
dependencies {
|
|
16
|
+
classpath 'com.android.tools.build:gradle:3.1.4'
|
|
17
|
+
|
|
18
|
+
// NOTE: Do not place your application dependencies here; they belong
|
|
19
|
+
// in the individual module build.gradle files
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
allprojects {
|
|
24
|
+
repositories {
|
|
25
|
+
mavenLocal()
|
|
26
|
+
jcenter()
|
|
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
|
+
google()
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
task wrapper(type: Wrapper) {
|
|
37
|
+
gradleVersion = '4.4'
|
|
38
|
+
distributionUrl = distributionUrl.replace("bin", "all")
|
|
39
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|