@nativescript/android 8.9.0-napi-v8.9 → 8.9.0-next.2025-02-20-13440184782
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/README.md +3 -4
- package/framework/app/build.gradle +4 -8
- package/framework/app/libs/runtime-libs/nativescript-optimized-with-inspector.aar +0 -0
- package/framework/app/libs/runtime-libs/nativescript-optimized.aar +0 -0
- package/framework/app/libs/runtime-libs/nativescript-regular.aar +0 -0
- package/framework/app/src/main/assets/internal/ts_helpers.js +175 -325
- package/framework/app/src/main/java/com/tns/AndroidJsV8Inspector.java +1 -1
- package/framework/app/src/main/java/com/tns/LogcatLogger.java +9 -8
- package/framework/app/src/main/java/com/tns/RuntimeHelper.java +4 -4
- package/framework/build-tools/android-metadata-generator.jar +0 -0
- package/framework/build-tools/dts-generator.jar +0 -0
- package/framework/build-tools/jsparser/js_parser.js +1 -1
- package/framework/build-tools/static-binding-generator.jar +0 -0
- package/framework/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/framework/gradle.properties +23 -26
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Android Runtime for NativeScript
|
|
2
2
|
[](https://travis-ci.org/NativeScript/android-runtime)
|
|
3
3
|
|
|
4
4
|
Contains the source code for the NativeScript's Android Runtime. [NativeScript](https://www.nativescript.org/) is a framework which enables developers to write truly native mobile applications for Android and iOS using JavaScript and CSS. Each mobile platform has its own ecosystem and offers completely different development tools and language(s) - Java for Android and Objective C (Swift) for iOS. In order to translate JavaScript code to the corresponding native APIs some kind of proxy mechanism is needed. This is exactly what the "Runtime" parts of NativeScript are responsible for. The Android Runtime may be thought of as "The Bridge" between the JavaScript and Android worlds. A NativeScript application for Android is a standard native package (apk) which besides the JavaScript files embed the runtime as well.
|
|
@@ -77,15 +77,14 @@ Note: You might need to run the Android Studio from the command line in order to
|
|
|
77
77
|
Windows:
|
|
78
78
|
|
|
79
79
|
```Shell
|
|
80
|
-
gradlew
|
|
80
|
+
gradlew
|
|
81
81
|
```
|
|
82
82
|
|
|
83
83
|
Mac/Linux:
|
|
84
84
|
|
|
85
85
|
```Shell
|
|
86
|
-
./gradlew
|
|
86
|
+
./gradlew
|
|
87
87
|
```
|
|
88
|
-
You can pass in `QUICKJS`, `HERMES`, `JSC` or `V8` to compile the runtime with the respective JS engine.
|
|
89
88
|
|
|
90
89
|
* The build process includes building of the runtime package (both optimized and with unstripped v8 symbol table), as well as all supplementary tools used for the android builds: metadata-generator, binding-generator, metadata-generator, static-binding-generator
|
|
91
90
|
* The result of the build will be in the dist folder.
|
|
@@ -77,8 +77,8 @@ def METADATA_JAVA_OUT = "mdg-java-out.txt"
|
|
|
77
77
|
def pluginsJarLibraries = new LinkedList<String>()
|
|
78
78
|
def allJarLibraries = new LinkedList<String>()
|
|
79
79
|
|
|
80
|
-
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk : NS_DEFAULT_COMPILE_SDK_VERSION as int }
|
|
81
|
-
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk : NS_DEFAULT_COMPILE_SDK_VERSION as int }
|
|
80
|
+
def computeCompileSdkVersion = { -> project.hasProperty("compileSdk") ? compileSdk as int : NS_DEFAULT_COMPILE_SDK_VERSION as int }
|
|
81
|
+
def computeTargetSdkVersion = { -> project.hasProperty("targetSdk") ? targetSdk as int : NS_DEFAULT_COMPILE_SDK_VERSION as int }
|
|
82
82
|
def computeMinSdkVersion = { -> project.hasProperty("minSdk") ? minSdk : NS_DEFAULT_MIN_SDK_VERSION as int }
|
|
83
83
|
def computeBuildToolsVersion = { ->
|
|
84
84
|
project.hasProperty("buildToolsVersion") ? buildToolsVersion : NS_DEFAULT_BUILD_TOOLS_VERSION as String
|
|
@@ -239,7 +239,7 @@ android {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
sourceSets.main {
|
|
242
|
-
jniLibs.srcDirs = ["$projectDir/libs/jni", "$projectDir/snapshot-build/build/ndk-build/libs"
|
|
242
|
+
jniLibs.srcDirs = ["$projectDir/libs/jni", "$projectDir/snapshot-build/build/ndk-build/libs"]
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
signingConfigs {
|
|
@@ -260,7 +260,7 @@ android {
|
|
|
260
260
|
}
|
|
261
261
|
buildTypes {
|
|
262
262
|
release {
|
|
263
|
-
signingConfig signingConfigs.
|
|
263
|
+
signingConfig signingConfigs.release
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
|
|
@@ -333,10 +333,6 @@ dependencies {
|
|
|
333
333
|
outLogger.withStyle(Style.SuccessHeader).println "\t + using android X library androidx.appcompat:appcompat:$androidXAppCompatVersion"
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
if (ns_engine == "HERMES") {
|
|
337
|
-
implementation 'com.facebook.fbjni:fbjni:0.3.0'
|
|
338
|
-
}
|
|
339
|
-
|
|
340
336
|
def androidXMaterialVersion = "${ns_default_androidx_material_version}"
|
|
341
337
|
if (project.hasProperty("androidXMaterial")) {
|
|
342
338
|
androidXMaterialVersion = androidXMaterial
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,327 +1,177 @@
|
|
|
1
1
|
(function () {
|
|
2
|
-
var __decorate =
|
|
3
|
-
(this && this.__decorate) ||
|
|
4
|
-
function (decorators, target, key, desc) {
|
|
5
|
-
var c = arguments.length;
|
|
6
|
-
var r =
|
|
7
|
-
c < 3
|
|
8
|
-
? target
|
|
9
|
-
: desc === null
|
|
10
|
-
? (desc = Object.getOwnPropertyDescriptor(target, key))
|
|
11
|
-
: desc,
|
|
12
|
-
d;
|
|
13
2
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
Object.defineProperty(global, "__native", { value: __native });
|
|
190
|
-
Object.defineProperty(global, "__extends", { value: __extends });
|
|
191
|
-
Object.defineProperty(global, "__decorate", { value: __decorate });
|
|
192
|
-
|
|
193
|
-
if (!global.__ns__worker) {
|
|
194
|
-
global.JavaProxy = JavaProxy;
|
|
195
|
-
}
|
|
196
|
-
global.Interfaces = Interfaces;
|
|
197
|
-
|
|
198
|
-
if (global.WeakRef && !global.WeakRef.prototype.get) {
|
|
199
|
-
global.WeakRef.prototype.get = global.WeakRef.prototype.deref;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
global.setNativeArrayProp = (target, prop, value, receiver) => {
|
|
203
|
-
if (!isNaN(prop)) {
|
|
204
|
-
receiver.setValueAtIndex(parseInt(prop), value);
|
|
205
|
-
return true;
|
|
206
|
-
}
|
|
207
|
-
target[prop] = value;
|
|
208
|
-
return true;
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
global.getNativeArrayProp = (target, prop, receiver) => {
|
|
212
|
-
if (!isNaN(prop)) {
|
|
213
|
-
return receiver.getValueAtIndex(parseInt(prop));
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
if (prop === Symbol.iterator) {
|
|
217
|
-
let index = 0;
|
|
218
|
-
const l = target.length;
|
|
219
|
-
return function () {
|
|
220
|
-
return {
|
|
221
|
-
next: function () {
|
|
222
|
-
if (index < l) {
|
|
223
|
-
return {
|
|
224
|
-
value: receiver.getValueAtIndex(index++),
|
|
225
|
-
done: false,
|
|
226
|
-
};
|
|
227
|
-
} else {
|
|
228
|
-
return { done: true };
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
};
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
if (prop === "map") {
|
|
235
|
-
return function (callback) {
|
|
236
|
-
const values = receiver.getAllValues();
|
|
237
|
-
const result = [];
|
|
238
|
-
const l = target.length;
|
|
239
|
-
for (let i = 0; i < l; i++) {
|
|
240
|
-
result.push(callback(values[i], i, target));
|
|
241
|
-
}
|
|
242
|
-
return result;
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (prop === "toString") {
|
|
247
|
-
return function () {
|
|
248
|
-
const result = receiver.getAllValues();
|
|
249
|
-
return result.join(",");
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (prop === "forEach") {
|
|
254
|
-
return function (callback) {
|
|
255
|
-
const values = receiver.getAllValues();
|
|
256
|
-
const l = values.length;
|
|
257
|
-
for (let i = 0; i < l; i++) {
|
|
258
|
-
callback(values[i], i, target);
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
return target[prop];
|
|
263
|
-
};
|
|
264
|
-
|
|
265
|
-
function findInPrototypeChain(obj, prop) {
|
|
266
|
-
while (obj) {
|
|
267
|
-
if (obj.hasOwnProperty(prop)) {
|
|
268
|
-
return Object.getOwnPropertyDescriptor(obj, prop);
|
|
269
|
-
}
|
|
270
|
-
obj = Object.getPrototypeOf(obj);
|
|
271
|
-
}
|
|
272
|
-
return undefined;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
globalThis.__prepareHostObject = function (hostObject, jsThis) {
|
|
276
|
-
// const prototype = Object.getPrototypeOf(jsThis);
|
|
277
|
-
// Object.setPrototypeOf(hostObject, prototype);
|
|
278
|
-
Object.defineProperty(hostObject, "super", {
|
|
279
|
-
get: () => jsThis["super"],
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
|
|
283
|
-
const EXTERNAL_PROP = "[[external]]";
|
|
284
|
-
const REFERENCE_PROP_JSC = "[[jsc_reference_info]]";
|
|
285
|
-
|
|
286
|
-
function __createNativeProxy(object, objectId) {
|
|
287
|
-
const proxy = new Proxy(object, {
|
|
288
|
-
get: function (target, prop) {
|
|
289
|
-
if (prop === EXTERNAL_PROP) return this[EXTERNAL_PROP];
|
|
290
|
-
if (prop === REFERENCE_PROP_JSC) return this[REFERENCE_PROP_JSC];
|
|
291
|
-
if (target.__is__javaArray) {
|
|
292
|
-
return global.getNativeArrayProp(target, prop, target);
|
|
293
|
-
}
|
|
294
|
-
return target[prop];
|
|
295
|
-
},
|
|
296
|
-
set: function (target, prop, value) {
|
|
297
|
-
if (prop === EXTERNAL_PROP) {
|
|
298
|
-
this[EXTERNAL_PROP] = value;
|
|
299
|
-
return true;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
if (prop === REFERENCE_PROP_JSC) {
|
|
303
|
-
this[REFERENCE_PROP_JSC] = value;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
if (target.__is__javaArray && !isNaN(prop)) {
|
|
307
|
-
target.setValueAtIndex(parseInt(prop), value);
|
|
308
|
-
return true;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
target[prop] = value;
|
|
312
|
-
return true;
|
|
313
|
-
},
|
|
314
|
-
});
|
|
315
|
-
return proxy;
|
|
316
|
-
}
|
|
317
|
-
globalThis.__createNativeProxy = __createNativeProxy;
|
|
318
|
-
|
|
319
|
-
globalThis.getErrorStack = (err) => {
|
|
320
|
-
if (err) return err.stack;
|
|
321
|
-
const stack = new Error("").stack;
|
|
322
|
-
const lines = stack.split("\n");
|
|
323
|
-
// Line 2 results in invalid stack if not replaced when doing typescript extend.
|
|
324
|
-
lines[2] = " at extend(native)";
|
|
325
|
-
return lines.join("\n");
|
|
326
|
-
};
|
|
327
|
-
})();
|
|
3
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
4
|
+
var c = arguments.length;
|
|
5
|
+
var r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
6
|
+
|
|
7
|
+
if (typeof global.Reflect === "object" && typeof global.Reflect.decorate === "function") {
|
|
8
|
+
r = global.Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
12
|
+
if (d = decorators[i]) {
|
|
13
|
+
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// For backward compatibility.
|
|
21
|
+
var __native = function (thiz) {
|
|
22
|
+
// we are setting the __container__ property to the base class when the super method is called
|
|
23
|
+
// if the constructor returns the __native(this) call we will use the old implementation
|
|
24
|
+
// copying all the properties to the result
|
|
25
|
+
// otherwise if we are using the result from the super() method call we won't need such logic
|
|
26
|
+
// as thiz already contains the parent properties
|
|
27
|
+
// this way we now support both implementations in typescript generated constructors:
|
|
28
|
+
// 1: super(); return __native(this);
|
|
29
|
+
// 2: return super() || this;
|
|
30
|
+
if (thiz.__container__) {
|
|
31
|
+
var result = thiz.__proto__;
|
|
32
|
+
|
|
33
|
+
for (var prop in thiz) {
|
|
34
|
+
if (thiz.hasOwnProperty(prop)) {
|
|
35
|
+
thiz.__proto__[prop] = thiz[prop];
|
|
36
|
+
delete thiz[prop];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
thiz.constructor = undefined;
|
|
41
|
+
thiz.__proto__ = undefined;
|
|
42
|
+
Object.freeze(thiz);
|
|
43
|
+
Object.preventExtensions(thiz);
|
|
44
|
+
return result;
|
|
45
|
+
} else {
|
|
46
|
+
return thiz;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
var __extends = function (Child, Parent) {
|
|
51
|
+
var extendNativeClass = !!Parent.extend && (Parent.extend.toString().indexOf("[native code]") > -1);
|
|
52
|
+
if (!extendNativeClass) {
|
|
53
|
+
__extends_ts(Child, Parent);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (Parent.__isPrototypeImplementationObject) {
|
|
57
|
+
throw new Error("Can not extend an already extended native object.");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function extend(thiz) {
|
|
61
|
+
var child = thiz.__proto__.__child;
|
|
62
|
+
if (!child.__extended) {
|
|
63
|
+
var parent = thiz.__proto__.__parent;
|
|
64
|
+
child.__extended = parent.extend(child.name, child.prototype, true);
|
|
65
|
+
// This will deal with "i instanceof child"
|
|
66
|
+
child[Symbol.hasInstance] = function (instance) {
|
|
67
|
+
return instance instanceof this.__extended;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return child.__extended;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
Parent.__activityExtend = function (parent, name, implementationObject) {
|
|
74
|
+
__log("__activityExtend called");
|
|
75
|
+
return parent.extend(name, implementationObject);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
Parent.call = function (thiz) {
|
|
79
|
+
var Extended = extend(thiz);
|
|
80
|
+
thiz.__container__ = true;
|
|
81
|
+
if (arguments.length > 1) {
|
|
82
|
+
thiz.__proto__ = new (Function.prototype.bind.apply(Extended, [null].concat(Array.prototype.slice.call(arguments, 1))));
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
thiz.__proto__ = new Extended()
|
|
86
|
+
}
|
|
87
|
+
return thiz.__proto__;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
Parent.apply = function (thiz, args) {
|
|
91
|
+
var Extended = extend(thiz);
|
|
92
|
+
thiz.__container__ = true;
|
|
93
|
+
if (args && args.length > 0) {
|
|
94
|
+
thiz.__proto__ = new (Function.prototype.bind.apply(Extended, [null].concat(args)));
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
thiz.__proto__ = new Extended();
|
|
98
|
+
}
|
|
99
|
+
return thiz.__proto__;
|
|
100
|
+
};
|
|
101
|
+
__extends_ns(Child, Parent);
|
|
102
|
+
Child.__isPrototypeImplementationObject = true;
|
|
103
|
+
Child.__proto__ = Parent;
|
|
104
|
+
Child.prototype.__parent = Parent;
|
|
105
|
+
Child.prototype.__child = Child;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
var __extends_ts = function (child, parent) {
|
|
109
|
+
extendStaticFunctions(child, parent);
|
|
110
|
+
assignPrototypeFromParentToChild(parent, child);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
var __extends_ns = function (child, parent) {
|
|
114
|
+
if (!parent.extend) {
|
|
115
|
+
assignPropertiesFromParentToChild(parent, child);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
assignPrototypeFromParentToChild(parent, child);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
var extendStaticFunctions =
|
|
122
|
+
Object.setPrototypeOf
|
|
123
|
+
|| (hasInternalProtoProperty() && function (child, parent) { child.__proto__ = parent; })
|
|
124
|
+
|| assignPropertiesFromParentToChild;
|
|
125
|
+
|
|
126
|
+
function hasInternalProtoProperty() {
|
|
127
|
+
return { __proto__: [] } instanceof Array;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function assignPropertiesFromParentToChild(parent, child) {
|
|
131
|
+
for (var property in parent) {
|
|
132
|
+
if (parent.hasOwnProperty(property)) {
|
|
133
|
+
child[property] = parent[property];
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function assignPrototypeFromParentToChild(parent, child) {
|
|
139
|
+
function __() {
|
|
140
|
+
this.constructor = child;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
if (parent === null) {
|
|
144
|
+
child.prototype = Object.create(null);
|
|
145
|
+
} else {
|
|
146
|
+
__.prototype = parent.prototype;
|
|
147
|
+
child.prototype = new __();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
function JavaProxy(className) {
|
|
153
|
+
return function (target) {
|
|
154
|
+
var extended = target.extend(className, target.prototype)
|
|
155
|
+
extended.name = className;
|
|
156
|
+
return extended;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function Interfaces(interfacesArr) {
|
|
161
|
+
return function (target) {
|
|
162
|
+
if (interfacesArr instanceof Array) {
|
|
163
|
+
// attach interfaces: [] to the object
|
|
164
|
+
target.prototype.interfaces = interfacesArr;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
Object.defineProperty(global, "__native", { value: __native });
|
|
170
|
+
Object.defineProperty(global, "__extends", { value: __extends });
|
|
171
|
+
Object.defineProperty(global, "__decorate", { value: __decorate });
|
|
172
|
+
|
|
173
|
+
if (!global.__ns__worker) {
|
|
174
|
+
global.JavaProxy = JavaProxy;
|
|
175
|
+
}
|
|
176
|
+
global.Interfaces = Interfaces;
|
|
177
|
+
})()
|
|
@@ -291,7 +291,7 @@ class AndroidJsV8Inspector {
|
|
|
291
291
|
@Override
|
|
292
292
|
protected void onMessage(final NanoWSD.WebSocketFrame message) {
|
|
293
293
|
if (currentRuntimeLogger.isEnabled()) {
|
|
294
|
-
Log.d("
|
|
294
|
+
Log.d("V8Inspector", "To dbg backend: " + message.getTextPayload() + " ThreadId:" + Thread.currentThread().getId());
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
inspectorMessages.offer(message.getTextPayload());
|
|
@@ -6,7 +6,7 @@ import android.util.Log;
|
|
|
6
6
|
public final class LogcatLogger implements Logger {
|
|
7
7
|
private final static String DEFAULT_LOG_TAG = "TNS.Java";
|
|
8
8
|
|
|
9
|
-
private boolean enabled
|
|
9
|
+
private boolean enabled;
|
|
10
10
|
|
|
11
11
|
public LogcatLogger(Context context) {
|
|
12
12
|
this.initLogging(context);
|
|
@@ -33,12 +33,13 @@ public final class LogcatLogger implements Logger {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
private void initLogging(Context context) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
boolean isDebuggableApp = Util.isDebuggableApp(context);
|
|
37
|
+
if (isDebuggableApp) {
|
|
38
|
+
String verboseLoggingProp = Util.readSystemProperty("nativescript.verbose.logging");
|
|
39
|
+
|
|
40
|
+
if (Util.isPositive(verboseLoggingProp)) {
|
|
41
|
+
setEnabled(true);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
43
44
|
}
|
|
44
45
|
}
|
|
@@ -23,7 +23,7 @@ public final class RuntimeHelper {
|
|
|
23
23
|
private RuntimeHelper() {
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
private static AndroidJsV8Inspector v8Inspector;
|
|
27
27
|
|
|
28
28
|
// hasErrorIntent tells you if there was an event (with an uncaught
|
|
29
29
|
// exception) raised from ErrorReport
|
|
@@ -151,8 +151,8 @@ public final class RuntimeHelper {
|
|
|
151
151
|
runtime = Runtime.initializeRuntimeWithConfiguration(config);
|
|
152
152
|
if (isDebuggable) {
|
|
153
153
|
try {
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
v8Inspector = new AndroidJsV8Inspector(context.getFilesDir().getAbsolutePath(), context.getPackageName());
|
|
155
|
+
v8Inspector.start();
|
|
156
156
|
|
|
157
157
|
// the following snippet is used as means to notify the VSCode extension
|
|
158
158
|
// debugger that the debugger agent has started
|
|
@@ -176,7 +176,7 @@ public final class RuntimeHelper {
|
|
|
176
176
|
shouldBreak = true;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
v8Inspector.waitForDebugger(shouldBreak);
|
|
180
180
|
} catch (IOException e) {
|
|
181
181
|
if (Util.isDebuggableApp(context)) {
|
|
182
182
|
e.printStackTrace();
|
|
Binary file
|
|
Binary file
|