Austin Huang
4 years ago
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
21 changed files with 163 additions and 65 deletions
-
4app/build.gradle
-
12app/src/main/java/awais/instagrabber/InstaGrabberApplication.java
-
2app/src/main/java/awais/instagrabber/asyncs/CreateThreadAction.java
-
3app/src/main/java/awais/instagrabber/asyncs/GetActivityAsyncTask.java
-
3app/src/main/java/awais/instagrabber/asyncs/UsernameFetcher.java
-
5app/src/main/java/awais/instagrabber/fragments/HashTagFragment.java
-
10app/src/main/java/awais/instagrabber/repositories/FriendshipRepository.java
-
10app/src/main/java/awais/instagrabber/repositories/NewsRepository.java
-
5app/src/main/java/awais/instagrabber/repositories/StoriesRepository.java
-
12app/src/main/java/awais/instagrabber/utils/Constants.java
-
4app/src/main/java/awais/instagrabber/utils/ExportImportUtils.java
-
8app/src/main/java/awais/instagrabber/utils/FlavorTown.java
-
14app/src/main/java/awais/instagrabber/utils/LocaleUtils.java
-
17app/src/main/java/awais/instagrabber/utils/SettingsHelper.java
-
2app/src/main/java/awais/instagrabber/utils/UpdateChecker.java
-
77app/src/main/java/awais/instagrabber/utils/UserAgentUtils.java
-
2app/src/main/java/awais/instagrabber/webservices/AddCookiesInterceptor.java
-
10app/src/main/java/awais/instagrabber/webservices/FriendshipService.java
-
10app/src/main/java/awais/instagrabber/webservices/NewsService.java
-
4app/src/main/java/awais/instagrabber/webservices/StoriesService.java
-
14app/src/main/java/awais/instagrabber/webservices/TagsService.java
@ -9,8 +9,10 @@ public final class Constants { |
|||
public static final String APP_THEME = "app_theme_v19"; |
|||
public static final String APP_LANGUAGE = "app_language_v19"; |
|||
public static final String STORY_SORT = "story_sort"; |
|||
// int prefs |
|||
// int prefs, do not export |
|||
public static final String PREV_INSTALL_VERSION = "prevVersion"; |
|||
public static final String BROWSER_UA_CODE = "browser_ua_code"; |
|||
public static final String APP_UA_CODE = "app_ua_code"; |
|||
// boolean prefs |
|||
public static final String DOWNLOAD_USER_FOLDER = "download_user_folder"; |
|||
// deprecated: public static final String BOTTOM_TOOLBAR = "bottom_toolbar"; |
|||
@ -31,6 +33,8 @@ public final class Constants { |
|||
public static final String COOKIE = "cookie"; |
|||
public static final String SHOW_QUICK_ACCESS_DIALOG = "show_quick_dlg"; |
|||
public static final String DEVICE_UUID = "device_uuid"; |
|||
public static final String BROWSER_UA = "browser_ua"; |
|||
public static final String APP_UA = "app_ua"; |
|||
//////////////////////// EXTRAS //////////////////////// |
|||
public static final String EXTRAS_USER = "user"; |
|||
public static final String EXTRAS_HASHTAG = "hashtag"; |
|||
@ -54,12 +58,6 @@ public final class Constants { |
|||
// Notification ids |
|||
public static final int ACTIVITY_NOTIFICATION_ID = 10; |
|||
|
|||
// spoof |
|||
public static final String USER_AGENT = "Mozilla/5.0 (Linux; Android 8.1.0; motorola one Build/OPKS28.63-18-3; wv) " + |
|||
"AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/70.0.3538.80 Mobile Safari/537.36"; |
|||
public static final String I_USER_AGENT = |
|||
"Instagram 169.3.0.30.135 Android (27/8.1.0; 320dpi; 720x1362; motorola; motorola one; deen_sprout; qcom; pt_BR; 264009054)"; |
|||
public static final String A_USER_AGENT = "https://Barinsta.AustinHuang.me / mailto:[email protected]"; |
|||
// see https://github.com/dilame/instagram-private-api/blob/master/src/core/constants.ts |
|||
public static final String SUPPORTED_CAPABILITIES = "[ { \"name\": \"SUPPORTED_SDK_VERSIONS\", \"value\":" + |
|||
" \"13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,25.0,26.0,27.0,28.0,29.0,30.0,31.0," + |
|||
|
@ -30,7 +30,7 @@ public final class UpdateChecker extends AsyncTask<Void, Void, Boolean> { |
|||
HttpURLConnection conn = |
|||
(HttpURLConnection) new URL("https://f-droid.org/api/v1/packages/me.austinhuang.instagrabber").openConnection(); |
|||
conn.setUseCaches(false); |
|||
conn.setRequestProperty("User-Agent", Constants.A_USER_AGENT); |
|||
conn.setRequestProperty("User-Agent", "https://Barinsta.AustinHuang.me / mailto:[email protected]"); |
|||
conn.connect(); |
|||
|
|||
final int responseCode = conn.getResponseCode(); |
|||
|
@ -0,0 +1,77 @@ |
|||
package awais.instagrabber.utils; |
|||
|
|||
import androidx.annotation.NonNull; |
|||
|
|||
public class UserAgentUtils { |
|||
|
|||
/* GraphQL user agents (which are just standard browser UA's). |
|||
* Go to https://www.whatismybrowser.com/guides/the-latest-user-agent/ to update it |
|||
* Windows first (Assume win64 not wow64): Chrome, Firefox, Edge |
|||
* Then macOS: Chrome, Firefox, Safari |
|||
*/ |
|||
public static final String[] browsers = { |
|||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36", |
|||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0", |
|||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36 Edg/87.0.664.75", |
|||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36", |
|||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 11.1; rv:84.0) Gecko/20100101 Firefox/84.0", |
|||
"Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.2 Safari/605.1.15" |
|||
}; |
|||
// use APKpure, assume x86 |
|||
private static final String igVersion = "169.3.0.30.135"; |
|||
private static final String igVersionCode = "264009054"; |
|||
// https://github.com/dilame/instagram-private-api/blob/master/src/samples/devices.json |
|||
// presumed constant, so no need to update |
|||
public static final String[] devices = { |
|||
"25/7.1.1; 440dpi; 1080x1920; Xiaomi; Mi Note 3; jason; qcom", |
|||
"23/6.0.1; 480dpi; 1080x1920; Xiaomi; Redmi Note 3; kenzo; qcom", |
|||
"23/6.0; 480dpi; 1080x1920; Xiaomi; Redmi Note 4; nikel; mt6797", |
|||
"24/7.0; 480dpi; 1080x1920; Xiaomi/xiaomi; Redmi Note 4; mido; qcom", |
|||
"23/6.0; 480dpi; 1080x1920; Xiaomi; Redmi Note 4X; nikel; mt6797", |
|||
"27/8.1.0; 440dpi; 1080x2030; Xiaomi/xiaomi; Redmi Note 5; whyred; qcom", |
|||
"23/6.0.1; 480dpi; 1080x1920; Xiaomi; Redmi 4; markw; qcom", |
|||
"27/8.1.0; 440dpi; 1080x2030; Xiaomi/xiaomi; Redmi 5 Plus; vince; qcom", |
|||
"25/7.1.2; 440dpi; 1080x2030; Xiaomi/xiaomi; Redmi 5 Plus; vince; qcom", |
|||
"26/8.0.0; 480dpi; 1080x1920; Xiaomi; MI 5; gemini; qcom", |
|||
"27/8.1.0; 480dpi; 1080x1920; Xiaomi/xiaomi; Mi A1; tissot_sprout; qcom", |
|||
"26/8.0.0; 480dpi; 1080x1920; Xiaomi; MI 6; sagit; qcom", |
|||
"25/7.1.1; 440dpi; 1080x1920; Xiaomi; MI MAX 2; oxygen; qcom", |
|||
"24/7.0; 480dpi; 1080x1920; Xiaomi; MI 5s; capricorn; qcom", |
|||
"26/8.0.0; 480dpi; 1080x1920; samsung; SM-A520F; a5y17lte; samsungexynos7880", |
|||
"26/8.0.0; 480dpi; 1080x2076; samsung; SM-G950F; dreamlte; samsungexynos8895", |
|||
"26/8.0.0; 640dpi; 1440x2768; samsung; SM-G950F; dreamlte; samsungexynos8895", |
|||
"26/8.0.0; 420dpi; 1080x2094; samsung; SM-G955F; dream2lte; samsungexynos8895", |
|||
"26/8.0.0; 560dpi; 1440x2792; samsung; SM-G955F; dream2lte; samsungexynos8895", |
|||
"24/7.0; 480dpi; 1080x1920; samsung; SM-A510F; a5xelte; samsungexynos7580", |
|||
"26/8.0.0; 480dpi; 1080x1920; samsung; SM-G930F; herolte; samsungexynos8890", |
|||
"26/8.0.0; 480dpi; 1080x1920; samsung; SM-G935F; hero2lte; samsungexynos8890", |
|||
"26/8.0.0; 420dpi; 1080x2094; samsung; SM-G965F; star2lte; samsungexynos9810", |
|||
"26/8.0.0; 480dpi; 1080x2076; samsung; SM-A530F; jackpotlte; samsungexynos7885", |
|||
"24/7.0; 640dpi; 1440x2560; samsung; SM-G925F; zerolte; samsungexynos7420", |
|||
"26/8.0.0; 420dpi; 1080x1920; samsung; SM-A720F; a7y17lte; samsungexynos7880", |
|||
"24/7.0; 640dpi; 1440x2560; samsung; SM-G920F; zeroflte; samsungexynos7420", |
|||
"24/7.0; 420dpi; 1080x1920; samsung; SM-J730FM; j7y17lte; samsungexynos7870", |
|||
"26/8.0.0; 480dpi; 1080x2076; samsung; SM-G960F; starlte; samsungexynos9810", |
|||
"26/8.0.0; 420dpi; 1080x2094; samsung; SM-N950F; greatlte; samsungexynos8895", |
|||
"26/8.0.0; 420dpi; 1080x2094; samsung; SM-A730F; jackpot2lte; samsungexynos7885", |
|||
"26/8.0.0; 420dpi; 1080x2094; samsung; SM-A605FN; a6plte; qcom", |
|||
"26/8.0.0; 480dpi; 1080x1920; HUAWEI/HONOR; STF-L09; HWSTF; hi3660", |
|||
"27/8.1.0; 480dpi; 1080x2280; HUAWEI/HONOR; COL-L29; HWCOL; kirin970", |
|||
"26/8.0.0; 480dpi; 1080x2032; HUAWEI/HONOR; LLD-L31; HWLLD-H; hi6250", |
|||
"26/8.0.0; 480dpi; 1080x2150; HUAWEI; ANE-LX1; HWANE; hi6250", |
|||
"26/8.0.0; 480dpi; 1080x2032; HUAWEI; FIG-LX1; HWFIG-H; hi6250", |
|||
"27/8.1.0; 480dpi; 1080x2150; HUAWEI/HONOR; COL-L29; HWCOL; kirin970", |
|||
"26/8.0.0; 480dpi; 1080x2038; HUAWEI/HONOR; BND-L21; HWBND-H; hi6250", |
|||
"23/6.0.1; 420dpi; 1080x1920; LeMobile/LeEco; Le X527; le_s2_ww; qcom" |
|||
}; |
|||
|
|||
@NonNull |
|||
public static String generateBrowserUA(final int code) { |
|||
return browsers[code - 1]; |
|||
} |
|||
|
|||
@NonNull |
|||
public static String generateAppUA(final int code, final String lang) { |
|||
return "Instagram " + igVersion + " Android (" + devices[code] + "; " + lang + "; " + igVersionCode + ")"; |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue