Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: index.html outside of the package? #50

Open
ktrzeciaknubisa opened this issue Jul 21, 2015 · 2 comments
Open

Android: index.html outside of the package? #50

ktrzeciaknubisa opened this issue Jul 21, 2015 · 2 comments

Comments

@ktrzeciaknubisa
Copy link
Member

When having this folder structure:

  • www
    • index.html
    • jxcore
      • app.js

I'm trying to read index.html in app.js:

var path = require("path");

var fs = require("fs");
try {
  var _index = fs.readFileSync(path.join(__dirname, "..", "index.html")).toString();
  console.log("read ok");
} catch (ex) {
  console.log("cannot read", ex);
}

And this fails on Android ("file does not exists"), while works on iOS.

Once I move the index.html into jxcore folder and read from there - it works for both.

@obastemur obastemur changed the title Android: index.js outside of the package? Android: index.html outside of the package? Jul 22, 2015
@obastemur
Copy link
Member

JXcore cordova plugin proxies the jxcore folder under www from compressed APK file. Maybe we should proxy right from www

@plika
Copy link
Contributor

plika commented Aug 6, 2015

Maybe we should proxy right from www

IMHO we shouldn't. jxcore folder under APK is read only location.

I believe we should better address another issue. Files under jxcore folder is accessible over webui. Most application uses jxcore/app.js as their default entry point, the backend logic is kind of visible to end user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants