rssreader
rssreader copied to clipboard
Freeze on Android Device
I assume there are classes that needs to be retained on Proguard.cfg hence the freeze issue (are there any information so It works on android). Tested using Android 14 (SDK 34) compiled using Java 17 and rssreader v3.6.0 (the build tools complains using java 21 so I use lower version). The java file is this:
import com.apptasticsoftware.rssreader.Item;
import com.apptasticsoftware.rssreader.RssReader;
import org.apache.commons.text.StringEscapeUtils;
import java.io.InputStream;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.time.ZonedDateTime;
import java.util.Date;
import java.util.List;
public class RSS {
private static RssReader reader;
private static RssReader getReader() {
if (reader == null)
reader = new RssReader();
return reader;
}
public static String getLog(Date buildDateOriginal, SimpleDateFormat DateFor, Date max) {
String message = "";
try {
URL url = new URL("https://github.com/Card-Forge/forge/commits/master.atom");
InputStream inputStream = url.openStream();
List<Item> items = getReader().read(inputStream).toList();
StringBuilder logs = new StringBuilder();
int c = 0;
for (Item i : items) {
if (i.getTitle().isEmpty())
continue;
String title = TextUtil.stripNonValidXMLCharacters(i.getTitle().get());
if (title.contains("Merge"))
continue;
ZonedDateTime zonedDateTime = i.getPubDateZonedDateTime().isPresent() ? i.getPubDateZonedDateTime().get() : null;
if (zonedDateTime == null)
continue;
Date feedDate = Date.from(zonedDateTime.toInstant());
if (buildDateOriginal != null && feedDate.before(buildDateOriginal))
continue;
if (max != null && feedDate.after(max))
continue;
logs.append(DateFor.format(feedDate)).append(" | ").append(StringEscapeUtils.unescapeXml(title).replace("\n", "").replace(" ", "")).append("\n\n");
if (c >= 15)
break;
c++;
}
if (logs.length() > 0)
message += ("\n\nLatest Changes:\n\n" + logs);
inputStream.close();
} catch (Exception e) {
//e.printStackTrace();
}
return message;
}
}
It works fine on desktop version though.