File tree 4 files changed +14
-4
lines changed
4 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export = {
22
22
getPath : app . getPath ,
23
23
loadUrl : app . loadURL ,
24
24
reload : app . reload ,
25
+ exec : app . exec ,
25
26
location,
26
27
mobiledata,
27
- }
28
+ }
Original file line number Diff line number Diff line change @@ -10,4 +10,8 @@ export function loadURL(url:string){
10
10
11
11
export function reload ( ) :void {
12
12
location . reload ( ) ;
13
- }
13
+ }
14
+
15
+ export function exec ( cmd :string , args :Array < string > = [ ] ) {
16
+ return JSON . parse ( NativeModules . App . exec ( [ cmd ] . concat ( args ) ) ) ;
17
+ }
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export = {
26
26
getPath : app . getPath ,
27
27
reload : app . reload ,
28
28
loadURL : app . loadURL ,
29
+ exec : app . exec ,
29
30
location,
30
31
mobiledata,
31
- }
32
+ }
Original file line number Diff line number Diff line change @@ -8,4 +8,8 @@ export function loadURL(url:string){
8
8
9
9
export function reload ( ) :void {
10
10
location . reload ( ) ;
11
- }
11
+ }
12
+
13
+ export function exec ( cmd :string , args :Array < string > = [ ] ) {
14
+ return JSON . parse ( ( < any > window ) . android . exec ( [ cmd ] . concat ( args ) ) ) ;
15
+ }
You can’t perform that action at this time.
0 commit comments