Skip to content

Commit 4aa41d9

Browse files
authored
release: @react-native-oh-tpl/react-native-randombytes@3.6.1-0.0.4 (#5)
1 parent a8ef763 commit 4aa41d9

File tree

7 files changed

+98
-123
lines changed

7 files changed

+98
-123
lines changed

OAT.xml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<configuration>
3+
<oatconfig>
4+
<licensefile>LICENSE</licensefile>
5+
<policylist>
6+
<policy name="projectPolicy" desc="">
7+
<policyitem type="license" name="MIT" path=".*" desc="license under the MIT"/>
8+
</policy>
9+
<policy name="projectPolicy" desc="">
10+
<policyitem type="compatibility" name="GPL-2.0+" path=".*" desc="Process that runs independently, invoked by the X process."/>
11+
<policyitem type="compatibility" name="Apache-2.0" path=".*" desc="不影响兼容性"/>
12+
<policyitem type="compatibility" name="BSDStyleLicense" path=".*" desc="不影响兼容性" />
13+
<policyitem type="compatibility" name="MIT" path=".*" desc="不影响兼容性" />
14+
<policyitem type="compatibility" name="GPLStyleLicense" path=".*" desc="不影响兼容性" />
15+
</policy>
16+
</policylist>
17+
<filefilterlist>
18+
<filefilter name="copyrightPolicyFilter" desc="Filters for compatibility,license header policies">
19+
<filteritem type="filepath" name="harmony/random_bytes/hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不手动修改"/>
20+
<filteritem type="filepath" name="harmony/random_bytes/src/main/cpp/generated/.*" desc="Codegen生成文件,不手动修改"/>
21+
<filteritem type="filepath" name="harmony/random_bytes/src/main/ets/generated/.*" desc="Codegen生成文件,不手动修改"/>
22+
<filteritem type="filename" name="*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改"/>
23+
<filteritem type="filename" name="*/*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改"/>
24+
<filteritem type="filename" name="LICENSE" desc="版权文件,不添加版权头"/>
25+
<filteritem type="filepath" name="hvigorw" desc="工程模板,不修改版权头,以防有修改版权风险"/>
26+
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不修改版权头,以防有修改版权风险"/>
27+
<filteritem type="filepath" name="js/*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
28+
<filteritem type="filepath" name="js/*.ts" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
29+
<filteritem type="filepath" name="src/*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
30+
<filteritem type="filepath" name="src/*.ts" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
31+
<filteritem type="filepath" name="*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
32+
<filteritem type="filepath" name="*.ts" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
33+
<filteritem type="filepath" name="index.*" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
34+
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
35+
<filteritem type="filepath" name="hvigor/hvigor-config.json5" desc="工程模板,不修改版权头,以防有修改版权风险"/>
36+
</filefilter>
37+
<filefilter name="defaultPolicyFilter" desc="Filters for compatibility,license header policies">
38+
<filteritem type="filepath" name="harmony/random_bytes/hvigorfile.ts" desc="hvigor构建脚本,DevEco Studio自动生成,不手动修改"/>
39+
<filteritem type="filepath" name="harmony/random_bytes/src/main/cpp/generated/.*" desc="Codegen生成文件,不手动修改"/>
40+
<filteritem type="filepath" name="harmony/random_bytes/src/main/ets/generated/.*" desc="Codegen生成文件,不手动修改"/>
41+
<filteritem type="filename" name="*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改"/>
42+
<filteritem type="filename" name="*/*.json5" desc="hvigor配置文件,DevEco Studio自动生成,不手动修改"/>
43+
<filteritem type="filename" name="LICENSE" desc="版权文件,不添加许可证头"/>
44+
<filteritem type="filepath" name="hvigorw" desc="工程模板,不添加许可证头"/>
45+
<filteritem type="filepath" name="hvigorw.bat" desc="工程模板,不添加许可证头"/>
46+
<filteritem type="filepath" name="js/*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
47+
<filteritem type="filepath" name="js/*.ts" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
48+
<filteritem type="filepath" name="src/*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
49+
<filteritem type="filepath" name="src/*.ts" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
50+
<filteritem type="filepath" name="*.js" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
51+
<filteritem type="filepath" name="*.ts" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
52+
<filteritem type="filepath" name="index.*" desc="第三方开源软件源码,不修改版权头,以防有修改版权风险"/>
53+
<filteritem type="filepath" name="hvigor/hvigor-wrapper.js" desc="工程模板,不修改版权头,以防有修改版权风险"/>
54+
<filteritem type="filepath" name="hvigor/hvigor-config.json5" desc="工程模板,不修改版权头,以防有修改版权风险"/>
55+
</filefilter>
56+
57+
<filefilter name="binaryFileTypePolicyFilter" desc="Filters for copyright header policies">
58+
<filteritem type="filepath" name="harmony/random_bytes.har" desc="项目打包文件"/>
59+
</filefilter>
60+
</filefilterlist>
61+
</oatconfig>
62+
</configuration>

README.OpenSource

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"Name": "react-native-randombytes",
4+
"License": "MIT License",
5+
"License File": "https://github.com/react-native-oh-library/react-native-randombytes/blob/sig/LICENSE",
6+
"Version Number": "3.0.0-alpha.1",
7+
"Owner" : "xiafeng@huawei.com",
8+
"Upstream URL": "https://github.com/react-native-oh-library/react-native-randombytes",
9+
"Description": "A <LinearGradient> element for React Native"
10+
}
11+
]

README.md

Lines changed: 7 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,123 +1,14 @@
1-
# react-native-randombytes
1+
# @react-native-oh-tpl/react-native-randombytes
22

3-
## DEPRECATED
3+
## 文档地址 / Documentation URL
44

5-
Use [react-native-get-random-values](https://www.npmjs.com/package/react-native-get-random-values) instead
5+
[中文 / Chinese](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/react-native-randombytes.md)
66

7-
## Usage
7+
## Codegen
88

9-
```js
10-
import { randomBytes } from 'react-native-randombytes'
9+
该库已接入 codegen,具体请查阅文档。
1110

12-
// synchronous API
13-
// uses SJCL
14-
const rand = randomBytes(4)
11+
## 请悉知 / Acknowledgements
1512

16-
// asynchronous API
17-
// uses iOS-side SecRandomCopyBytes
18-
randomBytes(4, (err, bytes) => {
19-
// bytes is a Buffer object
20-
console.log(bytes.toString('hex'))
21-
})
22-
```
23-
24-
## Installation
25-
26-
1. Follow the steps in the next section
27-
1. You have two options depending on your needs:
28-
1. if you're trying to get Node.js or browser crypto modules working in React Native, follow the installation workflow in [react-native-crypto](https://github.com/tradle/react-native-crypto).
29-
1. if you only need asynchronous random bytes generation, and don't care about getting back `Buffer` objects, you can do the following:
30-
31-
```js
32-
import { NativeModules } from 'react-native'
33-
const { RNRandomBytes } = NativeModules
34-
RNRandomBytes.randomBytes(32, (err, bytes) => {
35-
// bytes is a base64string
36-
})
37-
```
38-
39-
### Automatic - Android / iOS (recommended)
40-
41-
```bash
42-
react-native link
43-
```
44-
45-
### Manual
46-
47-
If Automatic installation failed you, dry your tears and read on.
48-
49-
#### `iOS`
50-
51-
* Drag RNRandomBytes.xcodeproj from node_modules/react-native-randombytes into your XCode project.
52-
53-
* Click on the project in XCode, go to Build Phases, then Link Binary With Libraries and add `libRNRandomBytes.a`
54-
55-
Confused? See an example with screenshots [here](http://facebook.github.io/react-native/docs/linking-libraries-ios.html#content)
56-
57-
58-
#### `Android`
59-
60-
* Update Gradle Settings
61-
62-
```gradle
63-
// file: android/settings.gradle
64-
...
65-
66-
include ':randombytes', ':app'
67-
project(':randombytes').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-randombytes/android')
68-
```
69-
70-
* Update Gradle Build
71-
72-
```gradle
73-
// file: android/app/build.gradle
74-
...
75-
76-
dependencies {
77-
...
78-
compile project(':randombytes')
79-
}
80-
```
81-
82-
* Register React Package
83-
84-
```java
85-
...
86-
import com.bitgo.randombytes.RandomBytesPackage // import
87-
88-
public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler {
89-
90-
private ReactInstanceManager mReactInstanceManager;
91-
private ReactRootView mReactRootView;
92-
93-
@Override
94-
protected void onCreate(Bundle savedInstanceState) {
95-
super.onCreate(savedInstanceState);
96-
mReactRootView = new ReactRootView(this);
97-
mReactInstanceManager = ReactInstanceManager.builder()
98-
.setApplication(getApplication())
99-
.setBundleAssetName("index.android.bundle")
100-
.setJSMainModuleName("index.android")
101-
.addPackage(new MainReactPackage())
102-
.addPackage(new RandomBytesPackage()) // register package here
103-
.setUseDeveloperSupport(BuildConfig.DEBUG)
104-
.setInitialLifecycleState(LifecycleState.RESUMED)
105-
.build();
106-
mReactRootView.startReactApplication(mReactInstanceManager, "AwesomeProject", null);
107-
setContentView(mReactRootView);
108-
}
109-
...
110-
111-
```
112-
113-
### `Windows`
114-
115-
116-
```bash
117-
react-native link react-native-randombytes
118-
```
119-
120-
Depending on your project versions and the state of RN-Windows this may not always work. If it does not, a manual installation guide can be found here:
121-
122-
https://github.com/Microsoft/react-native-windows/blob/master/docs/LinkingLibrariesWindows.md
13+
本项目基于 [The MIT License (MIT)](https://github.com/react-native-oh-library/react-native-randombytes/blob/sig/LICENSE) ,请自由地享受和参与开源。
12314

harmony/random_bytes.har

610 Bytes
Binary file not shown.

harmony/random_bytes/BuildProfile.ets

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1+
/**
2+
* Use these variables when you tailor your ArkTS code. They must be of the const type.
3+
*/
4+
export const HAR_VERSION = '3.6.1-0.0.4';
5+
export const BUILD_MODE_NAME = 'debug';
6+
export const DEBUG = true;
7+
export const TARGET_NAME = 'default';
8+
9+
/**
10+
* BuildProfile Class is used only for compatibility purposes.
11+
*/
112
export default class BuildProfile {
2-
static readonly HAR_VERSION = '3.6.1-0.0.3';
3-
static readonly BUILD_MODE_NAME = 'debug';
4-
static readonly DEBUG = true;
5-
static readonly TARGET_NAME = 'default';
13+
static readonly HAR_VERSION = HAR_VERSION;
14+
static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
15+
static readonly DEBUG = DEBUG;
16+
static readonly TARGET_NAME = TARGET_NAME;
617
}

harmony/random_bytes/oh-package.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "react-native-randombytes",
3-
"version": "3.6.1-0.0.3",
2+
"name": "@react-native-oh-tpl/react-native-randombytes",
3+
"version": "3.6.1-0.0.4",
44
"description": "randomBytes for react-native",
55
"main": "Index.ets",
66
"author": "",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@react-native-oh-tpl/react-native-randombytes",
3-
"version": "3.6.1-0.0.3",
3+
"version": "3.6.1-0.0.4",
44
"description": "randomBytes for react-native",
55
"main": "index.js",
66
"repository": {

0 commit comments

Comments
 (0)