dnet / adsdroid

Unofficial AllDataSheet Android application
https://techblog.vsza.hu/posts/Unofficial_Android_app_for_alldatasheet.com.html
MIT License
29 stars 11 forks source link

Downloaded PDFs are corrupted; alldatasheets blocked you? #6

Closed chanibal closed 10 years ago

chanibal commented 10 years ago

When I try to view any datasheet (ex. attiny85), I get an "cannot open PDF file" from my pdf reader. The contents of the pdf downloaded to /sdcard/ATtiny85-20140111-230016.pdf are:

<script type='text/javascript' src='http://ads.supplyframe.com/openads/adjs.php?​
n=544970556&what=zone:448&target=_blank
&taxonomy=/Electronic+Components/​Semiconductors+and+Integrated+Circuits/Microprocessors,+Microcontrollers,+DSPs/​AR​M,+​RISC-Based+Microcontrollers
&term=ATtiny85&exclude=,'>​</script>

(whitespace trimmed, added line breaks)

Tested on motorola xoom 3g, android 4.0.3, not rooted.

Note: didn't build the app from source, but used the binary distribution from http://techblog.vsza.hu/posts/Unofficial_Android_app_for_alldatasheet.com.html; the filename had a name of adsdroid-release-v1.4 and last commit says "bumped version to 1.4", so i guess it's the same (may be mistaken, through).

dnet commented 10 years ago

Thanks for the report, and sorry for the delay. When they introduced iframe ads, I used a pretty dumb algorithm to find which one to use (the first one that is a child of a td), and this fragility caught me now, when they added another iframe. With this fix, I tried to look for relative URLs, which should solve the issue for the foreseeable future (as long as the don't start serving ads from local URLs). You can download the APK from https://github.com/dnet/adsdroid/releases/tag/v1.5 and vsza.hu should redirect here as well.