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

[CRASH] IllegalArgumentException: Malformed URL #24

Closed ildar closed 6 years ago

ildar commented 6 years ago

logcat excerpt:

06-02 01:29:06.130   504   577 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #4
06-02 01:29:06.130   504   577 E AndroidRuntime: Process: hu.vsza.adsdroid, PID: 504
06-02 01:29:06.130   504   577 E AndroidRuntime: Theme: themes:{default=overlay:org.cyanogenmod.hexolibre, iconPack:system, fontPkg:org.cyanogenmod.hexolibre, com.android.systemui=overlay:org.cyanogenmod.hexolibre, com.android.systemui.navbar=overlay:org.cyanogenmod.hexolibre}
06-02 01:29:06.130   504   577 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
06-02 01:29:06.130   504   577 E AndroidRuntime:    at android.os.AsyncTask$3.done(AsyncTask.java:309)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:818)
06-02 01:29:06.130   504   577 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Malformed URL: //www.alldatasheet.com/datasheet-pdf/pdf/413767/UTC/LM393-D08-T.html
06-02 01:29:06.130   504   577 E AndroidRuntime:    at a.a.a.d.a(Unknown Source)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at a.a.a.d.d(Unknown Source)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at a.a.h.a(Unknown Source)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at hu.vsza.a.a.a(Unknown Source)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at hu.vsza.adsdroid.b.a(Unknown Source)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at hu.vsza.adsdroid.b.doInBackground(Unknown Source)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at android.os.AsyncTask$2.call(AsyncTask.java:295)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
06-02 01:29:06.130   504   577 E AndroidRuntime:    ... 4 more
06-02 01:29:06.130   504   577 E AndroidRuntime: Caused by: java.net.MalformedURLException: Protocol not found: //www.alldatasheet.com/datasheet-pdf/pdf/413767/UTC/LM393-D08-T.html
06-02 01:29:06.130   504   577 E AndroidRuntime:    at java.net.URL.<init>(URL.java:176)
06-02 01:29:06.130   504   577 E AndroidRuntime:    at java.net.URL.<init>(URL.java:125)
06-02 01:29:06.130   504   577 E AndroidRuntime:    ... 12 more
dnet commented 6 years ago

Thanks, it seems they started using relative links now, and this was the only place I accessed href directly instead of using the absUrl wrapper which handles this stuff gracefully. Maybe they're trying to roll out HTTPS support? They don't have a redirect, but some things work. Then again, I tried just changing the URL in the source code to HTTPS and things started to break, so this is not something I'll implement right now. It works, that's enough for me right now. :)

I released 1.7.1, you can download it from the releases page or ping the F-droid people to build and publish it as well.

dnet commented 6 years ago

Also, thanks for the logcat output, it made fixing the bug much quicker, I got a rough idea of what the problem was just by looking at it before I even fired up a debugger. :+1:

ildar commented 6 years ago

вс, 3 июн. 2018 г. в 1:06, András Veres-Szentkirályi < notifications@github.com>:

... or ping the F-droid people to build and publish it as well.

just "pinged"

phuyuk commented 6 years ago

Thanks for the fix (1.7.1). The app (F-Droid 1.7) was crashing with every attempted download. However, as a 'closed' issue, I almost missed this and gave up.