@onekeyfe/react-native-webview-cleaner 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/LICENSE +21 -0
- package/README.md +9 -0
- package/android/build.gradle +25 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/cancue/RNWebViewCleaner/RNWebViewCleanerModule.java +32 -0
- package/android/src/main/java/com/cancue/RNWebViewCleaner/RNWebViewCleanerPackage.java +28 -0
- package/ios/RNWebViewCleaner/RNWebViewCleaner.h +12 -0
- package/ios/RNWebViewCleaner/RNWebViewCleaner.m +29 -0
- package/ios/RNWebViewCleaner.xcodeproj/project.pbxproj +302 -0
- package/ios/RNWebViewCleaner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNWebViewCleaner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/RNWebViewCleaner.xcodeproj/xcuserdata/cancue.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/commonjs/index.js +13 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +166 -0
- package/react-native-webview-cleaner.podspec +28 -0
- package/src/index.ts +7 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 M.H. Kang
|
|
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,25 @@
|
|
|
1
|
+
|
|
2
|
+
apply plugin: 'com.android.library'
|
|
3
|
+
|
|
4
|
+
android {
|
|
5
|
+
compileSdkVersion 30
|
|
6
|
+
buildToolsVersion "23.0.1"
|
|
7
|
+
|
|
8
|
+
defaultConfig {
|
|
9
|
+
minSdkVersion 16
|
|
10
|
+
targetSdkVersion 22
|
|
11
|
+
versionCode 1
|
|
12
|
+
versionName "1.0"
|
|
13
|
+
ndk {
|
|
14
|
+
abiFilters "armeabi-v7a", "x86"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
lintOptions {
|
|
18
|
+
warning 'InvalidPackage'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
dependencies {
|
|
23
|
+
implementation 'com.facebook.react:react-native:+'
|
|
24
|
+
}
|
|
25
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
package com.cancue.RNWebViewCleaner;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
4
|
+
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
|
5
|
+
import com.facebook.react.bridge.ReactMethod;
|
|
6
|
+
import com.facebook.react.bridge.Callback;
|
|
7
|
+
|
|
8
|
+
import android.webkit.WebView;
|
|
9
|
+
import android.webkit.WebStorage;
|
|
10
|
+
import android.webkit.CookieManager;
|
|
11
|
+
|
|
12
|
+
public class RNWebViewCleanerModule extends ReactContextBaseJavaModule {
|
|
13
|
+
|
|
14
|
+
private final ReactApplicationContext reactContext;
|
|
15
|
+
|
|
16
|
+
public RNWebViewCleanerModule(ReactApplicationContext reactContext) {
|
|
17
|
+
super(reactContext);
|
|
18
|
+
this.reactContext = reactContext;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@Override
|
|
22
|
+
public String getName() {
|
|
23
|
+
return "RNWebViewCleaner";
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
@ReactMethod
|
|
27
|
+
public void clearAll() {
|
|
28
|
+
CookieManager.getInstance().removeAllCookies(null);
|
|
29
|
+
CookieManager.getInstance().flush();
|
|
30
|
+
WebStorage.getInstance().deleteAllData();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
package com.cancue.RNWebViewCleaner;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactPackage;
|
|
4
|
+
import com.facebook.react.bridge.NativeModule;
|
|
5
|
+
import com.facebook.react.bridge.ReactApplicationContext;
|
|
6
|
+
import com.facebook.react.uimanager.ViewManager;
|
|
7
|
+
import com.facebook.react.bridge.JavaScriptModule;
|
|
8
|
+
|
|
9
|
+
import java.util.Arrays;
|
|
10
|
+
import java.util.Collections;
|
|
11
|
+
import java.util.List;
|
|
12
|
+
|
|
13
|
+
public class RNWebViewCleanerPackage implements ReactPackage {
|
|
14
|
+
@Override
|
|
15
|
+
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
|
|
16
|
+
return Arrays.<NativeModule>asList(new RNWebViewCleanerModule(reactContext));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Deprecated in RN 0.47 - facebook/react-native@ce6fb33
|
|
20
|
+
public List<Class<? extends JavaScriptModule>> createJSModules() {
|
|
21
|
+
return Collections.emptyList();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@Override
|
|
25
|
+
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
|
26
|
+
return Collections.emptyList();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNWebViewCleaner.h
|
|
3
|
+
// RNWebViewCleaner
|
|
4
|
+
//
|
|
5
|
+
// Created by M.H. Kang on 05/12/2018.
|
|
6
|
+
// Copyright © 2018 M.H. Kang. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <React/RCTBridgeModule.h>
|
|
10
|
+
|
|
11
|
+
@interface RNWebViewCleaner : NSObject <RCTBridgeModule>
|
|
12
|
+
@end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNWebViewCleaner.m
|
|
3
|
+
// RNWebViewCleaner
|
|
4
|
+
//
|
|
5
|
+
// Created by M.H. Kang on 05/12/2018.
|
|
6
|
+
// Copyright © 2018 M.H. Kang. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "RNWebViewCleaner.h"
|
|
10
|
+
|
|
11
|
+
#import <WebKit/WebKit.h>
|
|
12
|
+
|
|
13
|
+
@implementation RNWebViewCleaner
|
|
14
|
+
|
|
15
|
+
RCT_EXPORT_MODULE();
|
|
16
|
+
|
|
17
|
+
RCT_EXPORT_METHOD(clearAll: (RCTPromiseResolveBlock)resolve rejecter: (RCTPromiseRejectBlock)reject)
|
|
18
|
+
{
|
|
19
|
+
NSSet *websiteDataTypes = [WKWebsiteDataStore allWebsiteDataTypes];
|
|
20
|
+
NSDate *dateFrom = [NSDate dateWithTimeIntervalSince1970:0];
|
|
21
|
+
|
|
22
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
23
|
+
[[WKWebsiteDataStore defaultDataStore] removeDataOfTypes:websiteDataTypes modifiedSince:dateFrom completionHandler:^{
|
|
24
|
+
resolve(nil);
|
|
25
|
+
}];
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
@end
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 50;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXBuildFile section */
|
|
10
|
+
7EE8D02E21B7B3F50057F45C /* RNWebViewCleaner.m in Sources */ = {isa = PBXBuildFile; fileRef = 7EE8D02D21B7B3F50057F45C /* RNWebViewCleaner.m */; };
|
|
11
|
+
7EE8D02F21B7B3F50057F45C /* RNWebViewCleaner.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 7EE8D02C21B7B3F50057F45C /* RNWebViewCleaner.h */; };
|
|
12
|
+
/* End PBXBuildFile section */
|
|
13
|
+
|
|
14
|
+
/* Begin PBXCopyFilesBuildPhase section */
|
|
15
|
+
7EE8D02721B7B3F40057F45C /* CopyFiles */ = {
|
|
16
|
+
isa = PBXCopyFilesBuildPhase;
|
|
17
|
+
buildActionMask = 2147483647;
|
|
18
|
+
dstPath = "include/$(PRODUCT_NAME)";
|
|
19
|
+
dstSubfolderSpec = 16;
|
|
20
|
+
files = (
|
|
21
|
+
7EE8D02F21B7B3F50057F45C /* RNWebViewCleaner.h in CopyFiles */,
|
|
22
|
+
);
|
|
23
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
24
|
+
};
|
|
25
|
+
/* End PBXCopyFilesBuildPhase section */
|
|
26
|
+
|
|
27
|
+
/* Begin PBXFileReference section */
|
|
28
|
+
7EE8D02921B7B3F50057F45C /* libRNWebViewCleaner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNWebViewCleaner.a; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
29
|
+
7EE8D02C21B7B3F50057F45C /* RNWebViewCleaner.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNWebViewCleaner.h; sourceTree = "<group>"; };
|
|
30
|
+
7EE8D02D21B7B3F50057F45C /* RNWebViewCleaner.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RNWebViewCleaner.m; sourceTree = "<group>"; };
|
|
31
|
+
/* End PBXFileReference section */
|
|
32
|
+
|
|
33
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
34
|
+
7EE8D02621B7B3F40057F45C /* Frameworks */ = {
|
|
35
|
+
isa = PBXFrameworksBuildPhase;
|
|
36
|
+
buildActionMask = 2147483647;
|
|
37
|
+
files = (
|
|
38
|
+
);
|
|
39
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
40
|
+
};
|
|
41
|
+
/* End PBXFrameworksBuildPhase section */
|
|
42
|
+
|
|
43
|
+
/* Begin PBXGroup section */
|
|
44
|
+
7EE8D02021B7B3F40057F45C = {
|
|
45
|
+
isa = PBXGroup;
|
|
46
|
+
children = (
|
|
47
|
+
7EE8D02B21B7B3F50057F45C /* RNWebViewCleaner */,
|
|
48
|
+
7EE8D02A21B7B3F50057F45C /* Products */,
|
|
49
|
+
);
|
|
50
|
+
sourceTree = "<group>";
|
|
51
|
+
};
|
|
52
|
+
7EE8D02A21B7B3F50057F45C /* Products */ = {
|
|
53
|
+
isa = PBXGroup;
|
|
54
|
+
children = (
|
|
55
|
+
7EE8D02921B7B3F50057F45C /* libRNWebViewCleaner.a */,
|
|
56
|
+
);
|
|
57
|
+
name = Products;
|
|
58
|
+
sourceTree = "<group>";
|
|
59
|
+
};
|
|
60
|
+
7EE8D02B21B7B3F50057F45C /* RNWebViewCleaner */ = {
|
|
61
|
+
isa = PBXGroup;
|
|
62
|
+
children = (
|
|
63
|
+
7EE8D02C21B7B3F50057F45C /* RNWebViewCleaner.h */,
|
|
64
|
+
7EE8D02D21B7B3F50057F45C /* RNWebViewCleaner.m */,
|
|
65
|
+
);
|
|
66
|
+
path = RNWebViewCleaner;
|
|
67
|
+
sourceTree = "<group>";
|
|
68
|
+
};
|
|
69
|
+
/* End PBXGroup section */
|
|
70
|
+
|
|
71
|
+
/* Begin PBXNativeTarget section */
|
|
72
|
+
7EE8D02821B7B3F40057F45C /* RNWebViewCleaner */ = {
|
|
73
|
+
isa = PBXNativeTarget;
|
|
74
|
+
buildConfigurationList = 7EE8D03221B7B3F50057F45C /* Build configuration list for PBXNativeTarget "RNWebViewCleaner" */;
|
|
75
|
+
buildPhases = (
|
|
76
|
+
7EE8D02521B7B3F40057F45C /* Sources */,
|
|
77
|
+
7EE8D02621B7B3F40057F45C /* Frameworks */,
|
|
78
|
+
7EE8D02721B7B3F40057F45C /* CopyFiles */,
|
|
79
|
+
);
|
|
80
|
+
buildRules = (
|
|
81
|
+
);
|
|
82
|
+
dependencies = (
|
|
83
|
+
);
|
|
84
|
+
name = RNWebViewCleaner;
|
|
85
|
+
productName = RNWebViewCleaner;
|
|
86
|
+
productReference = 7EE8D02921B7B3F50057F45C /* libRNWebViewCleaner.a */;
|
|
87
|
+
productType = "com.apple.product-type.library.static";
|
|
88
|
+
};
|
|
89
|
+
/* End PBXNativeTarget section */
|
|
90
|
+
|
|
91
|
+
/* Begin PBXProject section */
|
|
92
|
+
7EE8D02121B7B3F40057F45C /* Project object */ = {
|
|
93
|
+
isa = PBXProject;
|
|
94
|
+
attributes = {
|
|
95
|
+
LastUpgradeCheck = 1010;
|
|
96
|
+
ORGANIZATIONNAME = " cancue";
|
|
97
|
+
TargetAttributes = {
|
|
98
|
+
7EE8D02821B7B3F40057F45C = {
|
|
99
|
+
CreatedOnToolsVersion = 10.1;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
buildConfigurationList = 7EE8D02421B7B3F40057F45C /* Build configuration list for PBXProject "RNWebViewCleaner" */;
|
|
104
|
+
compatibilityVersion = "Xcode 9.3";
|
|
105
|
+
developmentRegion = en;
|
|
106
|
+
hasScannedForEncodings = 0;
|
|
107
|
+
knownRegions = (
|
|
108
|
+
en,
|
|
109
|
+
);
|
|
110
|
+
mainGroup = 7EE8D02021B7B3F40057F45C;
|
|
111
|
+
productRefGroup = 7EE8D02A21B7B3F50057F45C /* Products */;
|
|
112
|
+
projectDirPath = "";
|
|
113
|
+
projectRoot = "";
|
|
114
|
+
targets = (
|
|
115
|
+
7EE8D02821B7B3F40057F45C /* RNWebViewCleaner */,
|
|
116
|
+
);
|
|
117
|
+
};
|
|
118
|
+
/* End PBXProject section */
|
|
119
|
+
|
|
120
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
121
|
+
7EE8D02521B7B3F40057F45C /* Sources */ = {
|
|
122
|
+
isa = PBXSourcesBuildPhase;
|
|
123
|
+
buildActionMask = 2147483647;
|
|
124
|
+
files = (
|
|
125
|
+
7EE8D02E21B7B3F50057F45C /* RNWebViewCleaner.m in Sources */,
|
|
126
|
+
);
|
|
127
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
128
|
+
};
|
|
129
|
+
/* End PBXSourcesBuildPhase section */
|
|
130
|
+
|
|
131
|
+
/* Begin XCBuildConfiguration section */
|
|
132
|
+
7EE8D03021B7B3F50057F45C /* Debug */ = {
|
|
133
|
+
isa = XCBuildConfiguration;
|
|
134
|
+
buildSettings = {
|
|
135
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
136
|
+
CLANG_ANALYZER_NONNULL = YES;
|
|
137
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
|
138
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
|
139
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
140
|
+
CLANG_ENABLE_MODULES = YES;
|
|
141
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
142
|
+
CLANG_ENABLE_OBJC_WEAK = YES;
|
|
143
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
144
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
145
|
+
CLANG_WARN_COMMA = YES;
|
|
146
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
147
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
148
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
149
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
|
150
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
151
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
152
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
153
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
154
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
155
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
156
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
157
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
158
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
159
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
160
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
161
|
+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
|
162
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
163
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
164
|
+
CODE_SIGN_IDENTITY = "iPhone Developer";
|
|
165
|
+
COPY_PHASE_STRIP = NO;
|
|
166
|
+
DEBUG_INFORMATION_FORMAT = dwarf;
|
|
167
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
168
|
+
ENABLE_TESTABILITY = YES;
|
|
169
|
+
GCC_C_LANGUAGE_STANDARD = gnu11;
|
|
170
|
+
GCC_DYNAMIC_NO_PIC = NO;
|
|
171
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
172
|
+
GCC_OPTIMIZATION_LEVEL = 0;
|
|
173
|
+
GCC_PREPROCESSOR_DEFINITIONS = (
|
|
174
|
+
"DEBUG=1",
|
|
175
|
+
"$(inherited)",
|
|
176
|
+
);
|
|
177
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
178
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
179
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
180
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
181
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
182
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
183
|
+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
|
184
|
+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
|
185
|
+
MTL_FAST_MATH = YES;
|
|
186
|
+
ONLY_ACTIVE_ARCH = YES;
|
|
187
|
+
SDKROOT = iphoneos;
|
|
188
|
+
SKIP_INSTALL = YES;
|
|
189
|
+
};
|
|
190
|
+
name = Debug;
|
|
191
|
+
};
|
|
192
|
+
7EE8D03121B7B3F50057F45C /* Release */ = {
|
|
193
|
+
isa = XCBuildConfiguration;
|
|
194
|
+
buildSettings = {
|
|
195
|
+
ALWAYS_SEARCH_USER_PATHS = NO;
|
|
196
|
+
CLANG_ANALYZER_NONNULL = YES;
|
|
197
|
+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
|
198
|
+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
|
|
199
|
+
CLANG_CXX_LIBRARY = "libc++";
|
|
200
|
+
CLANG_ENABLE_MODULES = YES;
|
|
201
|
+
CLANG_ENABLE_OBJC_ARC = YES;
|
|
202
|
+
CLANG_ENABLE_OBJC_WEAK = YES;
|
|
203
|
+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
|
204
|
+
CLANG_WARN_BOOL_CONVERSION = YES;
|
|
205
|
+
CLANG_WARN_COMMA = YES;
|
|
206
|
+
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
|
207
|
+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
|
208
|
+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
|
209
|
+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
|
210
|
+
CLANG_WARN_EMPTY_BODY = YES;
|
|
211
|
+
CLANG_WARN_ENUM_CONVERSION = YES;
|
|
212
|
+
CLANG_WARN_INFINITE_RECURSION = YES;
|
|
213
|
+
CLANG_WARN_INT_CONVERSION = YES;
|
|
214
|
+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
|
215
|
+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
|
216
|
+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
|
217
|
+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
|
218
|
+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
|
219
|
+
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
|
220
|
+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
|
221
|
+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
|
222
|
+
CLANG_WARN_UNREACHABLE_CODE = YES;
|
|
223
|
+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
|
224
|
+
CODE_SIGN_IDENTITY = "iPhone Developer";
|
|
225
|
+
COPY_PHASE_STRIP = NO;
|
|
226
|
+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
|
227
|
+
ENABLE_NS_ASSERTIONS = NO;
|
|
228
|
+
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
|
229
|
+
GCC_C_LANGUAGE_STANDARD = gnu11;
|
|
230
|
+
GCC_NO_COMMON_BLOCKS = YES;
|
|
231
|
+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
|
232
|
+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
|
233
|
+
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
|
234
|
+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
|
235
|
+
GCC_WARN_UNUSED_FUNCTION = YES;
|
|
236
|
+
GCC_WARN_UNUSED_VARIABLE = YES;
|
|
237
|
+
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
|
|
238
|
+
MTL_ENABLE_DEBUG_INFO = NO;
|
|
239
|
+
MTL_FAST_MATH = YES;
|
|
240
|
+
SDKROOT = iphoneos;
|
|
241
|
+
SKIP_INSTALL = YES;
|
|
242
|
+
VALIDATE_PRODUCT = YES;
|
|
243
|
+
};
|
|
244
|
+
name = Release;
|
|
245
|
+
};
|
|
246
|
+
7EE8D03321B7B3F50057F45C /* Debug */ = {
|
|
247
|
+
isa = XCBuildConfiguration;
|
|
248
|
+
buildSettings = {
|
|
249
|
+
CODE_SIGN_STYLE = Automatic;
|
|
250
|
+
DEVELOPMENT_TEAM = 5KJHG28RP2;
|
|
251
|
+
HEADER_SEARCH_PATHS = (
|
|
252
|
+
"$(SRCROOT)/../../../React",
|
|
253
|
+
"$(SRCROOT)/../../react-native/React",
|
|
254
|
+
);
|
|
255
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
256
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
257
|
+
SKIP_INSTALL = YES;
|
|
258
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
|
259
|
+
};
|
|
260
|
+
name = Debug;
|
|
261
|
+
};
|
|
262
|
+
7EE8D03421B7B3F50057F45C /* Release */ = {
|
|
263
|
+
isa = XCBuildConfiguration;
|
|
264
|
+
buildSettings = {
|
|
265
|
+
CODE_SIGN_STYLE = Automatic;
|
|
266
|
+
DEVELOPMENT_TEAM = 5KJHG28RP2;
|
|
267
|
+
HEADER_SEARCH_PATHS = (
|
|
268
|
+
"$(SRCROOT)/../../../React",
|
|
269
|
+
"$(SRCROOT)/../../react-native/React",
|
|
270
|
+
);
|
|
271
|
+
OTHER_LDFLAGS = "-ObjC";
|
|
272
|
+
PRODUCT_NAME = "$(TARGET_NAME)";
|
|
273
|
+
SKIP_INSTALL = YES;
|
|
274
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
|
275
|
+
};
|
|
276
|
+
name = Release;
|
|
277
|
+
};
|
|
278
|
+
/* End XCBuildConfiguration section */
|
|
279
|
+
|
|
280
|
+
/* Begin XCConfigurationList section */
|
|
281
|
+
7EE8D02421B7B3F40057F45C /* Build configuration list for PBXProject "RNWebViewCleaner" */ = {
|
|
282
|
+
isa = XCConfigurationList;
|
|
283
|
+
buildConfigurations = (
|
|
284
|
+
7EE8D03021B7B3F50057F45C /* Debug */,
|
|
285
|
+
7EE8D03121B7B3F50057F45C /* Release */,
|
|
286
|
+
);
|
|
287
|
+
defaultConfigurationIsVisible = 0;
|
|
288
|
+
defaultConfigurationName = Release;
|
|
289
|
+
};
|
|
290
|
+
7EE8D03221B7B3F50057F45C /* Build configuration list for PBXNativeTarget "RNWebViewCleaner" */ = {
|
|
291
|
+
isa = XCConfigurationList;
|
|
292
|
+
buildConfigurations = (
|
|
293
|
+
7EE8D03321B7B3F50057F45C /* Debug */,
|
|
294
|
+
7EE8D03421B7B3F50057F45C /* Release */,
|
|
295
|
+
);
|
|
296
|
+
defaultConfigurationIsVisible = 0;
|
|
297
|
+
defaultConfigurationName = Release;
|
|
298
|
+
};
|
|
299
|
+
/* End XCConfigurationList section */
|
|
300
|
+
};
|
|
301
|
+
rootObject = 7EE8D02121B7B3F40057F45C /* Project object */;
|
|
302
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>SchemeUserState</key>
|
|
6
|
+
<dict>
|
|
7
|
+
<key>RNWebViewCleaner.xcscheme_^#shared#^_</key>
|
|
8
|
+
<dict>
|
|
9
|
+
<key>orderHint</key>
|
|
10
|
+
<integer>0</integer>
|
|
11
|
+
</dict>
|
|
12
|
+
</dict>
|
|
13
|
+
</dict>
|
|
14
|
+
</plist>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _default = exports.default = {
|
|
9
|
+
clearAll: () => {
|
|
10
|
+
_reactNative.NativeModules.RNWebViewCleaner.clearAll();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_default","exports","default","clearAll","NativeModules","RNWebViewCleaner"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAA6C,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE9B;EACbC,QAAQ,EAAEA,CAAA,KAAM;IACdC,0BAAa,CAACC,gBAAgB,CAACF,QAAQ,CAAC,CAAC;EAC3C;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","clearAll","RNWebViewCleaner"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,cAAc;AAE5C,eAAe;EACbC,QAAQ,EAAEA,CAAA,KAAM;IACdD,aAAa,CAACE,gBAAgB,CAACD,QAAQ,CAAC,CAAC;EAC3C;AACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";;;AAEA,wBAIE"}
|
package/package.json
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@onekeyfe/react-native-webview-cleaner",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "webview cleaner",
|
|
5
|
+
"main": "lib/commonjs/index",
|
|
6
|
+
"module": "lib/module/index",
|
|
7
|
+
"types": "lib/typescript/src/index.d.ts",
|
|
8
|
+
"react-native": "src/index",
|
|
9
|
+
"source": "src/index",
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"lib",
|
|
13
|
+
"keys",
|
|
14
|
+
"android",
|
|
15
|
+
"ios",
|
|
16
|
+
"cpp",
|
|
17
|
+
"*.podspec",
|
|
18
|
+
"!ios/build",
|
|
19
|
+
"!android/build",
|
|
20
|
+
"!android/gradle",
|
|
21
|
+
"!android/gradlew",
|
|
22
|
+
"!android/gradlew.bat",
|
|
23
|
+
"!android/local.properties",
|
|
24
|
+
"!**/__tests__",
|
|
25
|
+
"!**/__fixtures__",
|
|
26
|
+
"!**/__mocks__",
|
|
27
|
+
"!**/.*"
|
|
28
|
+
],
|
|
29
|
+
"scripts": {
|
|
30
|
+
"example": "yarn workspace react-native-webview-cleaner-example",
|
|
31
|
+
"test": "jest",
|
|
32
|
+
"typecheck": "tsc --noEmit",
|
|
33
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
34
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
35
|
+
"prepare": "bob build",
|
|
36
|
+
"release": "release-it"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"react-native",
|
|
40
|
+
"ios",
|
|
41
|
+
"android"
|
|
42
|
+
],
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "git+https://github.com/OneKeyHQ/react-native-webview-cleaner.git"
|
|
46
|
+
},
|
|
47
|
+
"author": "OneKeyHQ <hi@onekey.so> (https://github.com/OneKeyHQ)",
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/OneKeyHQ/react-native-webview-cleaner/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/OneKeyHQ/react-native-webview-cleaner#readme",
|
|
53
|
+
"publishConfig": {
|
|
54
|
+
"registry": "https://registry.npmjs.org/"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@commitlint/config-conventional": "^17.0.2",
|
|
58
|
+
"@evilmartians/lefthook": "^1.5.0",
|
|
59
|
+
"@react-native/eslint-config": "^0.72.2",
|
|
60
|
+
"@release-it/conventional-changelog": "^5.0.0",
|
|
61
|
+
"@types/jest": "^28.1.2",
|
|
62
|
+
"@types/react": "~17.0.21",
|
|
63
|
+
"@types/react-native": "0.70.0",
|
|
64
|
+
"commitlint": "^17.0.2",
|
|
65
|
+
"del-cli": "^5.0.0",
|
|
66
|
+
"eslint": "^8.4.1",
|
|
67
|
+
"eslint-config-prettier": "^8.5.0",
|
|
68
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
69
|
+
"jest": "^28.1.1",
|
|
70
|
+
"pod-install": "^0.1.0",
|
|
71
|
+
"prettier": "^2.0.5",
|
|
72
|
+
"react": "18.2.0",
|
|
73
|
+
"react-native": "0.73.1",
|
|
74
|
+
"react-native-builder-bob": "^0.23.2",
|
|
75
|
+
"release-it": "^15.0.0",
|
|
76
|
+
"turbo": "^1.10.7",
|
|
77
|
+
"typescript": "^5.0.2"
|
|
78
|
+
},
|
|
79
|
+
"resolutions": {
|
|
80
|
+
"@types/react": "17.0.21"
|
|
81
|
+
},
|
|
82
|
+
"peerDependencies": {
|
|
83
|
+
"react": "*",
|
|
84
|
+
"react-native": "*"
|
|
85
|
+
},
|
|
86
|
+
"workspaces": [
|
|
87
|
+
"example"
|
|
88
|
+
],
|
|
89
|
+
"packageManager": "yarn@3.6.1",
|
|
90
|
+
"engines": {
|
|
91
|
+
"node": ">= 18.0.0"
|
|
92
|
+
},
|
|
93
|
+
"jest": {
|
|
94
|
+
"preset": "react-native",
|
|
95
|
+
"modulePathIgnorePatterns": [
|
|
96
|
+
"<rootDir>/example/node_modules",
|
|
97
|
+
"<rootDir>/lib/"
|
|
98
|
+
]
|
|
99
|
+
},
|
|
100
|
+
"commitlint": {
|
|
101
|
+
"extends": [
|
|
102
|
+
"@commitlint/config-conventional"
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
"release-it": {
|
|
106
|
+
"git": {
|
|
107
|
+
"commitMessage": "chore: release ${version}",
|
|
108
|
+
"tagName": "v${version}"
|
|
109
|
+
},
|
|
110
|
+
"npm": {
|
|
111
|
+
"publish": true
|
|
112
|
+
},
|
|
113
|
+
"github": {
|
|
114
|
+
"release": true
|
|
115
|
+
},
|
|
116
|
+
"plugins": {
|
|
117
|
+
"@release-it/conventional-changelog": {
|
|
118
|
+
"preset": "angular"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"eslintConfig": {
|
|
123
|
+
"root": true,
|
|
124
|
+
"extends": [
|
|
125
|
+
"@react-native",
|
|
126
|
+
"prettier"
|
|
127
|
+
],
|
|
128
|
+
"rules": {
|
|
129
|
+
"prettier/prettier": [
|
|
130
|
+
"error",
|
|
131
|
+
{
|
|
132
|
+
"quoteProps": "consistent",
|
|
133
|
+
"singleQuote": true,
|
|
134
|
+
"tabWidth": 2,
|
|
135
|
+
"trailingComma": "es5",
|
|
136
|
+
"useTabs": false
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"eslintIgnore": [
|
|
142
|
+
"node_modules/",
|
|
143
|
+
"lib/"
|
|
144
|
+
],
|
|
145
|
+
"prettier": {
|
|
146
|
+
"quoteProps": "consistent",
|
|
147
|
+
"singleQuote": true,
|
|
148
|
+
"tabWidth": 2,
|
|
149
|
+
"trailingComma": "es5",
|
|
150
|
+
"useTabs": false
|
|
151
|
+
},
|
|
152
|
+
"react-native-builder-bob": {
|
|
153
|
+
"source": "src",
|
|
154
|
+
"output": "lib",
|
|
155
|
+
"targets": [
|
|
156
|
+
"commonjs",
|
|
157
|
+
"module",
|
|
158
|
+
[
|
|
159
|
+
"typescript",
|
|
160
|
+
{
|
|
161
|
+
"project": "tsconfig.build.json"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
]
|
|
165
|
+
}
|
|
166
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "react-native-webview-cleaner"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.description = <<-DESC
|
|
10
|
+
react-native-webview-cleaner
|
|
11
|
+
DESC
|
|
12
|
+
s.homepage = "https://github.com/github_account/react-native-webview-cleaner"
|
|
13
|
+
# brief license entry:
|
|
14
|
+
s.license = "MIT"
|
|
15
|
+
# optional - use expanded license entry instead:
|
|
16
|
+
# s.license = { :type => "MIT", :file => "LICENSE" }
|
|
17
|
+
s.authors = { "Your Name" => "yourname@email.com" }
|
|
18
|
+
s.platforms = { :ios => "9.0" }
|
|
19
|
+
s.source = { :git => "https://github.com/github_account/react-native-webview-cleaner.git", :tag => "#{s.version}" }
|
|
20
|
+
|
|
21
|
+
s.source_files = "ios/**/*.{h,c,m,swift}"
|
|
22
|
+
s.requires_arc = true
|
|
23
|
+
|
|
24
|
+
s.dependency "React"
|
|
25
|
+
# ...
|
|
26
|
+
# s.dependency "..."
|
|
27
|
+
end
|
|
28
|
+
|