File tree Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Expand file tree Collapse file tree 4 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export = {
2222 getPath : app . getPath ,
2323 loadUrl : app . loadURL ,
2424 reload : app . reload ,
25+ exec : app . exec ,
2526 location,
2627 mobiledata,
27- }
28+ }
Original file line number Diff line number Diff line change @@ -10,4 +10,8 @@ export function loadURL(url:string){
1010
1111export function reload ( ) :void {
1212 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 = {
2626 getPath : app . getPath ,
2727 reload : app . reload ,
2828 loadURL : app . loadURL ,
29+ exec : app . exec ,
2930 location,
3031 mobiledata,
31- }
32+ }
Original file line number Diff line number Diff line change @@ -8,4 +8,8 @@ export function loadURL(url:string){
88
99export function reload ( ) :void {
1010 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