SimpleMobileTools / Simple-Calendar

A simple calendar with events, tasks, customizable colors, widgets and no ads.
https://www.simplemobiletools.com
GNU General Public License v3.0
3.55k stars 1.16k forks source link

java.lang.illegalArguementException: Invalid format: "" #683

Closed ghost closed 6 years ago

ghost commented 6 years ago

A calendar can be created in Evolution 3.22.6 a couple different ways:

When a webcal-sourced calendar is exported from Evolution and then imported into Simple Calendar, there is no issue. So the first question is whether the bug is in Evolution or Simple Calendar. I took two .ics files (one working, the other causing SC to crash) and supplied them to these ICS validation services:

tibbi commented 6 years ago

seems to work fine to me, might be affected by github whitespaces indeed. Please send the original .ics file to hello@simplemobiletools.com. Thanks

ghost commented 6 years ago

@tibbi

Git accepts zip files, so I've attached an ICS file wrapped in a zip.

sc_cannot_import.zip

(edit) BTW, considering whitespace could matter, I tried running unix2dos on the ics file, and vice-versa, and both forms get the java exception on import. Then I tried to copy/paste my example above into a file, and that file also gets the java exception on import.

So I'm not sure what could cause this to fail to reproduce for you. My version of Simple Calendar is 4.2.0 and it's running on Android 5.1.1.

ghost commented 6 years ago

I have reproduced the problem in the android emulator. So in principle you should be able to follow these steps to reproduce it:

create a VM based on Android 5.0.1

android create avd --name scdebug --target 'Google Inc.:Google APIs (x86 System Image):19' --device '5.1in WVGA'

launch it

emulator64-x86 -http-proxy https://localhost:8118 -no-boot-anim -debug-all -show-kernel -scale 0.9 -avd scdebug

install Simple Calendar

adb install com.simplemobiletools.calendar_127.apk

make the root filesystem writable

adb shell
su
mount -o rw,remount rootfs /
^D
^D

copy the ICS file

adb push bogus.ics /

Launch Simple Calendar and import /bogus.ics. Results in java.lang.illegalArguementException followed by a (false) "import successful" message.

tibbi commented 6 years ago

ah, didnt know you use an ancient version of the Calendar. Update it to 5.1.1 please and retry.

ghost commented 6 years ago

@tibbi

ah, didnt know you use an ancient version of the Calendar. Update it to 5.1.1 please and retry.

Makes no difference. Both 5.1.1 and 5.1.2 have the same failure.

tibbi commented 6 years ago

try storing the file on the internal storage of your mobile, not at the root path. It could be something like /storage/emulated/0/... or so

ghost commented 6 years ago

@tibbi

try storing the file on the internal storage of your mobile, not at the root path. It could be something like /storage/emulated/0/... or so

I'm a bit baffled that import data sitting in a location where Simple Calendar has access would even be cause for suspicion.

On my unrooted phone I was in fact forced to stage the ICS file on the SD card (where there is user write permission). On the emulated AVD I was forced to stage the file in / (because when pushing the file to /storage/sdcard/ the file then appears only in adb-shell and not in the phone's interface). For the AVD the root folder was apparently the only place that's mutually accessible from both adb and the apps.

Also note that external SD card storage is further proven to work with Simple Calendar running on a physical bare metal phone when the ICS file is generated from webcal data. Both successful and failure imports were from files in the same directory.

So either way it makes no difference where the file is accessed from w.r.t this bug.

Have you tried to reproduce this in the emulator?

tibbi commented 6 years ago

should be fixed in the pro version 6.0 released soon