diff --git a/DevelopmentWorkflow.md b/DevelopmentWorkflow.md
index 245f06c..b17c764 100644
--- a/DevelopmentWorkflow.md
+++ b/DevelopmentWorkflow.md
@@ -5,6 +5,7 @@
- [Prerequisites](#prerequisites)
- [Develop locally](#develop-locally)
- [Testing the plugin](#testing-the-plugin)
+- [Native android changes](#native-android-changes)
@@ -34,4 +35,15 @@ npm run demo.android
The demo application is configured to run on a simulator/emulator on the local machine. If you want to test on a real device, you should change the URL in the `demo/app/home-view-model.ts` to point to the machine that is running the demo server. Be careful if using an online test service, e.g. [http://httpbin.org/post](http://httpbin.org/post). Some services are configured to return the uploaded file contents in the server response, which might crash the demo app if the uploaded file is large.
+## Native android changes
+
+For android, the plugin uses [a fork](https://github.com/NativeScript/android-upload-service) of the [gotev/android-upload-service](https://github.com/gotev/android-upload-service) library for Android.
+Avoid fixes and new features in the fork. Use the original repository and then update the fork with the changes.
+The native library is used in the plugin as an aar file added in the plugin's platforms/android directory.
+Here's how to reflect any changes in the native library in this plugin. First make sure the changes are included in the fork. Then clone the fork and run the following command in its root directory:
+```
+./gradlew clean assembleRelease
+```
+This will produce a new aar file here: android-upload-service/uploadservice/build/outputs/aar/uploadservice-release.aar. Use it to replace the previous aar in the plugin: nativescript-background-http/src/platforms/android/uploadservice-release.aar
+
For details on plugins development workflow, read [NativeScript plugins documentation](https://docs.nativescript.org/plugins/building-plugins#step-2-set-up-a-development-workflow) covering that topic.
diff --git a/README.md b/README.md
index d37ef35..37830e5 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@ A cross platform plugin for [the NativeScript framework](http://www.nativescript
[There is a stock NativeScript `http` module that can handle GET/POST requests that work with strings and JSONs](http://docs.nativescript.org/ApiReference/http/HOW-TO). It however comes short in features when it comes to really large files.
-The plugin uses [NSURLSession with background session configuration for iOS](https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSURLSessionConfiguration_class/index.html#//apple_ref/occ/clm/NSURLSessionConfiguration/backgroundSessionConfigurationWithIdentifier:); and the [alexbbb/android-upload-service](https://github.com/alexbbb/android-upload-service) library for Android.
+The plugin uses [NSURLSession with background session configuration for iOS](https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSURLSessionConfiguration_class/index.html#//apple_ref/occ/clm/NSURLSessionConfiguration/backgroundSessionConfigurationWithIdentifier:); and [a fork](https://github.com/NativeScript/android-upload-service) of the [gotev/android-upload-service](https://github.com/gotev/android-upload-service) library for Android.
## Installation
diff --git a/demo-angular/app/App_Resources/Android/src/main/AndroidManifest.xml b/demo-angular/app/App_Resources/Android/src/main/AndroidManifest.xml
index adb8ac1..b288a62 100644
--- a/demo-angular/app/App_Resources/Android/src/main/AndroidManifest.xml
+++ b/demo-angular/app/App_Resources/Android/src/main/AndroidManifest.xml
@@ -11,7 +11,7 @@
android:xlargeScreens="true"/>
diff --git a/demo-vue/app/App_Resources/Android/AndroidManifest.xml b/demo-vue/app/App_Resources/Android/AndroidManifest.xml
index d05f4de..9961000 100644
--- a/demo-vue/app/App_Resources/Android/AndroidManifest.xml
+++ b/demo-vue/app/App_Resources/Android/AndroidManifest.xml
@@ -11,7 +11,7 @@
android:xlargeScreens="true"/>
diff --git a/demo/app/App_Resources/Android/src/main/AndroidManifest.xml b/demo/app/App_Resources/Android/src/main/AndroidManifest.xml
index adb8ac1..b288a62 100644
--- a/demo/app/App_Resources/Android/src/main/AndroidManifest.xml
+++ b/demo/app/App_Resources/Android/src/main/AndroidManifest.xml
@@ -11,7 +11,7 @@
android:xlargeScreens="true"/>
diff --git a/src/.npmignore b/src/.npmignore
index 1a3062f..6ab38bf 100644
--- a/src/.npmignore
+++ b/src/.npmignore
@@ -7,5 +7,4 @@ tsconfig.json
*.tgz
/package
/platforms/android/**/*
-!platforms/android/include.gradle
-!platforms/android/nativescript_background_http.aar
\ No newline at end of file
+!platforms/android/uploadservice-release.aar
\ No newline at end of file
diff --git a/src/package.json b/src/package.json
index 0133db3..435975a 100644
--- a/src/package.json
+++ b/src/package.json
@@ -17,12 +17,9 @@
"scripts": {
"tsc": "tsc -skipLibCheck",
"build": "npm i && tsc",
- "postclone": "npm i && node scripts/postclone.js && cd ../demo && npm i && cd ../src && npm run plugin.link",
"test.android": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build android && tns test android --justlaunch",
"test.ios": "npm i && npm run tsc && npm run tslint && cd ../demo && tns build ios && tns test ios --justlaunch",
"tslint": "cd .. && tslint \"**/*.ts\" --config tslint.json --exclude \"**/node_modules/**\"",
- "plugin.link": "npm link && cd ../demo && npm link nativescript-background-http && cd ../src",
- "plugin.tscwatch": "npm run tsc -- -w",
"demo.ios": "npm i && npm run tsc && cd ../demo && tns run ios",
"demo-angular.ios": "npm i && npm run tsc && cd ../demo-angular && tns run ios",
"demo-vue.ios": "npm i && npm run tsc && cd ../demo-vue && tns run ios",
@@ -34,8 +31,7 @@
"server": "cd ../demo-server && npm run start",
"plugin.prepare": "npm run tsc && cd ../demo && tns plugin remove nativescript-background-http && tns plugin add ../src",
"clean": "cd ../demo && rimraf hooks node_modules platforms && cd ../src && rimraf node_modules && npm run plugin.link",
- "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'",
- "prepare": "node scripts/prepare.js"
+ "ci.tslint": "npm i && tslint '**/*.ts' --config '../tslint.json' --exclude '**/node_modules/**'"
},
"keywords": [
"background",
diff --git a/src/platforms/android/AndroidManifest.xml b/src/platforms/android/AndroidManifest.xml
deleted file mode 100644
index e927afa..0000000
--- a/src/platforms/android/AndroidManifest.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/platforms/android/include.gradle b/src/platforms/android/include.gradle
deleted file mode 100644
index 82bc6b2..0000000
--- a/src/platforms/android/include.gradle
+++ /dev/null
@@ -1,8 +0,0 @@
-//default elements
-android {
-}
-
-//optional elements
-dependencies {
- implementation 'net.gotev:uploadservice:3.5.2'
-}
\ No newline at end of file
diff --git a/src/platforms/android/uploadservice-release.aar b/src/platforms/android/uploadservice-release.aar
new file mode 100644
index 0000000..1ffef5a
Binary files /dev/null and b/src/platforms/android/uploadservice-release.aar differ
diff --git a/src/scripts/prepare.js b/src/scripts/prepare.js
deleted file mode 100644
index 79c030c..0000000
--- a/src/scripts/prepare.js
+++ /dev/null
@@ -1,21 +0,0 @@
-const { exec } = require('child_process');
-const semver = require('semver');
-
-exec('tns --version', (err, stdout, stderr) => {
- if (err) {
- // node couldn't execute the command
- console.log(`tns --version err: ${err}`);
- return;
- }
-
- const regex = /^(?:\d+\.){2}\d+.*?$/m;
- const matches = stdout.match(regex);
- console.log("Extracted tns version: " + matches[0]);
- const tnsVersion = semver.major(semver.coerce(matches[0]));
-
- // execute 'tns plugin build' for {N} version > 4. This command builds .aar in platforms/android folder.
- if (tnsVersion >= 4) {
- console.log(`executing 'tns plugin build'`);
- exec('tns plugin build');
- }
-});
\ No newline at end of file