Skip to content

Commit

Permalink
Se deja función estandar para ecriptación archivos
Browse files Browse the repository at this point in the history
  • Loading branch information
rmendozah committed May 30, 2018
1 parent 0988398 commit d8a3edf
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/android/cl/kunder/webview/WebViewActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ public void onCreate(Bundle savedInstanceState) {
if(shouldShowLoading){
showLoading();
}
loadUrl((url.matches("^(.*://|javascript:)[\\s\\S]*$")?"":"file:///android_asset/www/+++/")+url);

loadUrl((url.matches("^(.://|javascript:)[\\s\\S]$") ? "" : "file:///android_asset/www/" + (isPluginCryptFileActive() ? "+++/" : "")) + url);
}

public static boolean showLoading() {
Expand Down Expand Up @@ -92,4 +93,17 @@ public void run() {
});
return true;
}

/**
* Revisa si existe el plugin cordova-plugin-crypt-file
* @return boolean
*/
private boolean isPluginCryptFileActive() {
try {
Class.forName("com.tkyaji.cordova.DecryptResource");
return true;
} catch(Exception e) {
return false;
}
}
}

0 comments on commit d8a3edf

Please sign in to comment.