Skip to content

Commit

Permalink
- Bug fixed unable to read play store version.
Browse files Browse the repository at this point in the history
 - Updated version
  • Loading branch information
LemonNicholas committed May 21, 2018
1 parent a9d6adc commit 5bb30c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ android {
minSdkVersion 14
targetSdkVersion 27
versionCode 27
versionName "2.6.5"
versionName "2.6.6"
}

buildTypes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ class Config {
static final String AMAZON_URL = "http://www.amazon.com/gp/mas/dl/android?p=";
static final String FDROID_URL = "https://f-droid.org/repository/browse/?fdid=";

static final String PLAY_STORE_TAG_RELEASE = "itemprop=\"softwareVersion\">";
// static final String PLAY_STORE_TAG_RELEASE = "itemprop=\"softwareVersion\">";
// static final String PLAY_STORE_OLD_TAG_RELEASE = "itemprop=\"softwareVersion\">";
static final String PLAY_STORE_NEW_TAG_RELEASE = "<div class=\"BgcNfc\">Current Version</div><span class=\"htlgb\"><div><span class=\"htlgb\">";

static final String GITHUB_TAG_RELEASE = "/tree/";
static final String AMAZON_TAG_RELEASE = "<strong>Version:</strong>";
static final String FDROID_TAG_RELEASE = "<b>Version";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static Update getLatestAppVersionHttp(Context context, UpdateFrom updateFrom, Gi
while ((line = reader.readLine()) != null) {
switch (updateFrom) {
default:
if (line.contains(Config.PLAY_STORE_TAG_RELEASE)) {
if (line.contains(Config.PLAY_STORE_NEW_TAG_RELEASE)) {
str.append(line);
isAvailable = true;
}
Expand Down Expand Up @@ -204,7 +204,7 @@ private static String getVersion(UpdateFrom updateFrom, Boolean isAvailable, Str
if (isAvailable) {
switch (updateFrom) {
default:
String[] splitPlayStore = source.split(Config.PLAY_STORE_TAG_RELEASE);
String[] splitPlayStore = source.split(Config.PLAY_STORE_NEW_TAG_RELEASE);
if (splitPlayStore.length > 1) {
splitPlayStore = splitPlayStore[1].split("(<)");
version = splitPlayStore[0].trim();
Expand Down

0 comments on commit 5bb30c8

Please sign in to comment.