cernekee / ics-openconnect

Android UI for OpenConnect VPN client
GNU General Public License v2.0
358 stars 130 forks source link

custom csd_wrapper not working on 5.0 lollipop #1

Closed widewing closed 9 years ago

widewing commented 9 years ago

I see it generated tmp file for the script in the app's cache dir, but it's not executed. It was working perfectly in previous android versions (including L Preview)

cernekee commented 9 years ago

The issue I saw on the early 'L' builds is that the non-PIE curl binary is rejected by the new linker version:

https://code.google.com/p/android-developer-preview/issues/detail?id=888

Current plan is to bundle the run_pie binary in a future release.

widewing commented 9 years ago

Actually the PIE issue is another issue. I replaced it with pie enabled curl and yes it works on l preview. But this not work anymore after I upgrade 5.0.0 release. I tested it with a simple script: just echo a test string into sdcard, nothing happened.

cernekee commented 9 years ago

Actually the PIE issue is another issue. I replaced it with pie enabled curl and yes it works on l preview.

I have added a workaround for this. Could you try this apk (or build the -next branch)?

https://dl.dropboxusercontent.com/u/169702767/openconnect/openconnect-1.10-beta1.apk

But this not work anymore after I upgrade 5.0.0 release.

FWIW I tested the above apk on 5.0 (Hammerhead LRX210), on ICS 4.0 in the emulator (ARM), and on a Nexus 7 (2012) running 4.2.2. I think the curl problem has been resolved, at least.

I tested it with a simple script: just echo a test string into sdcard, nothing happened.

Apps might need to go through a special API to write to /sdcard on newer Android versions, or your access may be confined to a specific directory. I haven't actually used this but it is documented here.

A more reliable test case might involve writing to /data/data/app.openconnect/files. I've also had some success in the past killing the app, then using strace -o /data/local/tmp/log -fF -p PID (as root) to attach to zygote and watch what happens when the app starts. The downside is that this produces a lot of data and slows everything down. You'll want to search for the execve() calls to see what happens when your script runs.

widewing commented 9 years ago

This build works like a charm! I must have got something wrong with my tests

cernekee commented 9 years ago

Thanks for the feedback. I'll make a new release soon.

I replaced it with pie enabled curl

One thing that occurred to me is that you would need to build the new curl into a fresh APK (and sign it with your own key), because AssetExtractor will try to overwrite any local copies under /data/data/app.openconnect if the CRC doesn't match the bundled version.

Or you could just use a different name like curl-pie, and call it using that name from your script...