Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/libs/Environment/betaChecker/index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ function isBetaBuild() {
fetch(CONST.PLAY_STORE_URL)
.then(res => res.text())
.then((text) => {
const productionVersionMatch = text.match(/<span[^>]+class="htlgb"[^>]*>([-\d.]+)<\/span>/);
const productionVersionSearch = text.match(/\[\[\["\d+\.\d+\.\d+/);
if (!productionVersionSearch) {
resolve(false);
}

const productionVersion = productionVersionSearch[0].match(/\d+\.\d+\.\d+/);

// If we have a match for the production version regex and the current version is not the same
// as the production version, we are on a beta build
const isBeta = productionVersionMatch && productionVersionMatch[1].trim() !== version;
const isBeta = productionVersion && productionVersionSearch[0].trim() !== version;
resolve(isBeta);
})
.catch(() => {
Expand Down