Skip to content

Commit

Permalink
Added write permission in config.xml. Removed Legacy Support Librarie…
Browse files Browse the repository at this point in the history
…s. (#36)
  • Loading branch information
kolbasa committed Oct 31, 2021
1 parent fcc7bbd commit 87c1b81
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 41 deletions.
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,6 @@ I actively maintain the plugin.

npm install cordova-plugin-apkupdater

### Android Legacy Support Libraries

It is not recommended, but you can install the plugin without AndroidX. Just set the following variable:

cordova plugin add cordova-plugin-apkupdater --variable AndroidXEnabled=false

<br>

# Basic example

### Ionic 2+ with Typescript
Expand Down
3 changes: 1 addition & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
<engine name="cordova-android" version=">=9.0.0"/>
</engines>

<hook type="after_plugin_add" src="src/nodejs/hooks/after-plugin-add.js"/>

<js-module src="www/ApkUpdater.js" name="ApkUpdater">
<clobbers target="window.ApkUpdater"/>
</js-module>
Expand All @@ -45,6 +43,7 @@
<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</config-file>

<config-file target="AndroidManifest.xml" parent="application" mode="merge">
Expand Down
2 changes: 1 addition & 1 deletion src/android/tools/PermissionManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static boolean hasWritePermission(Context context) {

public static void requestWritePermission(Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
((Activity) context).requestPermissions(new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);
((Activity) context).requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE);
}
}

Expand Down
30 changes: 0 additions & 30 deletions src/nodejs/hooks/after-plugin-add.js

This file was deleted.

0 comments on commit 87c1b81

Please sign in to comment.