Compare commits

..
887 Commits
Author SHA1 Message Date
gdlbo f84a04356a android:debuggable="false" 2022-07-14 12:15:00 +03:00
gdlbo 621bc6aef7 Update build.gradle 2022-07-14 02:44:53 +03:00
gdlbo e4dfb30870 Update build.gradle 2022-07-14 02:36:36 +03:00
gdlbo 2b4da660c7 disabled force miui dark theme 2022-07-14 01:43:15 +03:00
gdlbo a870e09609 added check for android sdk 26 to get adaptive icon 2022-07-14 01:37:27 +03:00
gdlbo 32f3a11713 some codebase to future update with support no adaptive icons 2022-07-14 01:34:11 +03:00
gdlbo 104ae44b84 Update DockBarEditorFragment.java 2022-07-14 01:12:55 +03:00
gdlbo 17f8932ff4 Update build.gradle 2022-07-14 01:12:52 +03:00
gdlbo 0d4d820993 added splashscreen for < Android 12
pls check
2022-07-14 00:35:14 +03:00
gdlbo 878bf49dc4 added cleaning web cache for theme changing 2022-07-14 00:13:56 +03:00
gdlbo fe8ab52595 deleted some useless and dead vk features 2022-07-13 23:45:57 +03:00
gdlbo dd1a3774f8 disabled feature 2022-07-13 19:07:42 +03:00
gdlbo 7e1bd28d26 dnt inj 2022-07-13 19:03:44 +03:00
gdlbo 59593db4ec recomm disabler 2022-07-13 18:49:45 +03:00
gdlbo 6694739a4f fixed crash + added notifs about verif 2022-07-13 18:41:41 +03:00
gdlbo 4323802862 Update IconsFragment.java 2022-07-13 18:06:31 +03:00
Vologhat c2056853e0 Update IconsFragment.java 2022-07-13 17:57:48 +03:00
gdlbo d15a439477 icon manager test dead 2022-07-13 17:41:44 +03:00
gdlbo bb59cfa68a VideoDownloader fix 2022-07-13 17:26:29 +03:00
gdlbo 144b502c25 Update TokenConfirmationHandlerChainCall.smali 2022-07-13 15:29:07 +03:00
gdlbo b6c8992441 fix 2022-07-13 15:18:31 +03:00
gdlbo 7a5124a820 some connection fixes 2022-07-13 15:05:13 +03:00
Vologhat f5cac67d38 added vk video opening externally 2022-07-13 13:21:40 +03:00
Vologhat 5b38ea3b3f added external player redirection 2022-07-13 05:34:22 +03:00
Vologhat e6a687264b fixed toolbar visibility 2022-07-13 04:20:02 +03:00
gdlbo 6d16fbe260 codebase for future multiple list pref with appnames and icons 2022-07-13 01:28:15 +03:00
aliveoutside 047c6c94be [musicdownloader] hook track bottomsheet 2022-07-13 04:23:58 +03:00
gdlbo 41229fbab0 Update OtherFragment.java 2022-07-13 01:10:50 +03:00
gdlbo 8fb885a373 some backup fixes 2022-07-13 01:03:04 +03:00
gdlbo dc294ccef0 added some icons 2022-07-13 00:50:17 +03:00
Vologhat 24ef392b1c added restore prefs from file 2022-07-13 00:30:37 +03:00
Vologhat da1efc7261 optimizations 2022-07-12 23:58:00 +03:00
Vologhat c42245abf3 added vkme mode checker 2022-07-12 23:49:53 +03:00
Vologhat 76dc857a43 fixed dockbar counter 2022-07-12 23:14:51 +03:00
gdlbo df11c3b517 icons fix 2022-07-12 23:11:45 +03:00
Vologhat f6500096fa refactored icon switcher 2022-07-12 23:08:41 +03:00
gdlbo 792c0afe06 added all to manifest 2022-07-12 23:04:29 +03:00
gdlbo 11f7faa0ad some fixes 2022-07-12 22:45:14 +03:00
gdlbo 75f03ac207 icon changer test
appname cursed
2022-07-12 21:55:20 +03:00
gdlbo b1df22d207 added resources 2022-07-12 19:32:50 +03:00
gdlbo 47737a72f8 null check 2022-07-12 18:29:59 +03:00
gdlbo 0331bcfa7b network check 2022-07-12 18:27:35 +03:00
gdlbo 0928227fac some fragments in dockbar fixes 2022-07-12 17:42:46 +03:00
gdlbo 8fbc961f47 superapp disabler fix 2022-07-12 17:34:04 +03:00
gdlbo 1f667b4133 new vkpay lol 2022-07-12 17:25:02 +03:00
gdlbo 379d6aab8e some sticker fixes 2022-07-12 16:28:00 +03:00
gdlbo 82e164b351 some filter fixes 2022-07-12 16:15:11 +03:00
gdlbo f4ca06d27e added some effects) 2022-07-12 15:49:02 +03:00
gdlbo a1fe7bb5db some filters fix + added more filters codebase 2022-07-12 15:21:05 +03:00
aliveoutside f01d5efa92 use track id as a temp folder name 2022-07-12 17:37:08 +03:00
gdlbo 9d0e607c0b monochrome wp 2022-07-12 14:14:10 +03:00
gdlbo 413c58c936 mosaic effect 2022-07-12 13:46:04 +03:00
gdlbo c83b6e4c76 fixed crash 2022-07-12 12:42:09 +03:00
gdlbo c5d1e73dc6 some fragments fixes 2022-07-12 12:12:48 +03:00
gdlbo 35d8b6106d restart app when dark theme changed to amoled 2022-07-12 11:11:47 +03:00
gdlbo 6d9f0b9413 restart app when milkshake val changed 2022-07-12 11:00:18 +03:00
gdlbo 2d98e6c40b disabled force dark theme for miui 2022-07-12 10:58:17 +03:00
gdlbo 10a300b614 fixed milkshake changer 2022-07-12 00:00:54 +03:00
gdlbo 902d50cef4 Update DockBarManager.java 2022-07-11 23:21:48 +03:00
Vologhat c518ce4482 Update DockBarManager.java 2022-07-11 21:59:05 +03:00
gdlbo 4d719e4308 codesyle cringe 2022-07-11 21:14:02 +03:00
gdlbo 5bd52c23ae lmao 2022-07-11 21:11:17 +03:00
gdlbo 2755c93147 fix dockbar 2022-07-11 20:58:45 +03:00
aliveoutside 25c5182877 create notifications for music downloading 2022-07-11 23:02:10 +03:00
gdlbo 5af8cb9745 Update BottomNavigationMenu.smali 2022-07-11 20:00:53 +03:00
gdlbo 45ca60570c Update CopyrightAds.txt 2022-07-11 19:57:37 +03:00
Vologhat d65334086e refactored dockbar editor 2022-07-11 19:57:03 +03:00
gdlbo c2b3e3f88e Update WallpaperMenuFragment.java 2022-07-11 19:35:07 +03:00
gdlbo 7b3b939cc6 Update WallpaperMenuFragment.java 2022-07-11 19:34:28 +03:00
gdlbo 0995366ae2 added stickers background if wallpaper is not null 2022-07-11 19:28:48 +03:00
gdlbo 16be89be00 fix dark toast lmao 2022-07-11 19:17:23 +03:00
gdlbo 3bf1a8d398 fixed dialog style 2022-07-11 19:11:51 +03:00
gdlbo 1e876a9217 fixed auth proxy dialog 2022-07-11 17:56:03 +03:00
aliveoutside 2d21a85259 check if ffmpeg converted successfully 2022-07-11 20:14:34 +03:00
aliveoutside 87ef92eff8 finish music downloader 2022-07-11 19:55:04 +03:00
aliveoutside 0e16bbf4f5 fix ts to mp3 converter 2022-07-11 19:26:05 +03:00
aliveoutside edb79e3d7d update ffmpeg libs for mp3 support 2022-07-11 19:25:41 +03:00
aliveoutside 1c6ba006b5 fix ffmpeg loading 2022-07-11 18:07:22 +03:00
gdlbo 6350dbc397 dialog design fixes 2022-07-11 14:36:22 +03:00
gdlbo 827ab9f82d disabled dockbar hook 2022-07-11 13:30:02 +03:00
gdlbo 587e729bdc added dev ver mark 2022-07-11 13:18:32 +03:00
gdlbo 851265e14a Update Globals.java 2022-07-11 13:13:17 +03:00
gdlbo b553ef1c75 fixed player on gappless phones 2022-07-11 13:08:37 +03:00
gdlbo 5570f8be88 added proxy button at start 2022-07-11 13:02:31 +03:00
gdlbo 775f4f12fe writebar coloring 2022-07-11 11:26:05 +03:00
gdlbo 1410aaf7ef Some animation fixes 2022-07-11 02:58:43 +03:00
gdlbo b85aece87b some wp fixes 2022-07-11 02:20:19 +03:00
gdlbo 4caf2f1e6e fixed some cringe blur 2022-07-11 01:38:22 +03:00
gdlbo 60eb78c27f Wallpaper in msg
Upgraded dialogs opening
2022-07-11 01:29:55 +03:00
aliveoutside 701edfa823 try to do ffmpeg convert 2022-07-11 01:34:28 +03:00
aliveoutside e234f3bce4 add some missing classes 2022-07-11 01:34:28 +03:00
aliveoutside f80241b5c0 add some missing classes 2022-07-11 01:34:27 +03:00
aliveoutside 9adc74ff46 update build.gradle 2022-07-11 01:34:27 +03:00
aliveoutside fbc4d054b0 add ffmpeg wrapper 2022-07-11 01:34:27 +03:00
aliveoutside 3676e1f568 add ffmpeg lib 2022-07-11 01:34:27 +03:00
aliveoutside 88832da5ea add libs to assets 2022-07-11 01:34:27 +03:00
gdlbo 2175dad72f Update GroupApiParser.smali 2022-07-10 19:16:43 +03:00
aliveoutside 7c45258976 fix permissions in AudioDownloader 2022-07-10 22:08:58 +03:00
gdlbo 01e1ccb4bf Renames for profiles and groups 2022-07-10 19:01:25 +03:00
gdlbo 966312373e Fix 2022-07-10 17:49:59 +03:00
gdlbo b1b06f480b menu inj test 2022-07-10 17:48:39 +03:00
Vologhat ea1252c07c add method check 2022-07-10 17:31:09 +03:00
Vologhat 871695731c added asyns downloading 2022-07-10 16:37:31 +03:00
gdlbo b7e1326489 Update vt_ui_oled.css 2022-07-10 16:03:42 +03:00
gdlbo d02ae1e212 amoled theme wtf 2022-07-10 16:01:04 +03:00
aliveoutside 6af700e187 test m3u8 downloader 2022-07-10 18:32:02 +03:00
gdlbo 01f0175467 fixed crash at start 2022-07-10 15:25:19 +03:00
gdlbo 86d85aec3c updated jars + added amoled theme values to code 2022-07-10 14:52:23 +03:00
aliveoutside c2001c24f6 move some stuff to music package 2022-07-10 17:35:10 +03:00
gdlbo 7726ad974c reformated code 2022-07-10 14:32:27 +03:00
Vologhat 1f859997f4 M3U8 Dumper 2022-07-10 14:11:27 +03:00
gdlbo 1c20fd4c19 Some online fixes 2022-07-10 10:54:25 +03:00
gdlbo bdee61948d Update OnlineFormatter.java 2022-07-10 04:05:03 +03:00
gdlbo 6c903dcd20 Update OnlineFormatter.java 2022-07-10 03:21:35 +03:00
gdlbo dd5cf0eace added appid saving + some fixes 2022-07-10 01:38:14 +03:00
aliveoutside c713d9a59b - Дашь списать домашку?
- Да, только не списывай точь-в-точь
-
2022-07-10 04:14:55 +03:00
gdlbo 2029447d86 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-07-10 01:08:41 +03:00
aliveoutside 81f225be5b m3u8 shit 2022-07-10 04:07:02 +03:00
gdlbo 6258e524d9 imports 2022-07-10 01:08:19 +03:00
gdlbo cf3ecaa325 Added local caching appid names 2022-07-10 01:07:55 +03:00
gdlbo 9c9afa9925 VideoDownloader inj 2022-07-09 22:40:56 +03:00
gdlbo 9ee1357b53 Fixed bug with reload mgs on old design on sdk 28+ 2022-07-09 22:18:28 +03:00
gdlbo cf376364ba Update StoryDownloader.java 2022-07-09 22:03:20 +03:00
gdlbo 0fa5a97661 Stories video downloader 2022-07-09 21:59:42 +03:00
gdlbo a3c7b2a6fb some stories download fixes 2022-07-09 21:24:35 +03:00
gdlbo a1cc6c5adf disabled fixGapps 2022-07-09 20:47:18 +03:00
gdlbo 86051d3b01 isMusicRestricted must be true by default 2022-07-09 20:26:49 +03:00
gdlbo 28e5bbf2de Update VideoDownloader.java 2022-07-09 20:22:38 +03:00
gdlbo 9373375a95 Update VideoDownloader.java 2022-07-09 20:19:05 +03:00
gdlbo 295f37b9f5 check if link is not valid 2022-07-09 20:18:31 +03:00
gdlbo 06c526ef74 Video downloader in settings 2022-07-09 20:09:02 +03:00
gdlbo d4f737167d updated jars 2022-07-09 19:48:22 +03:00
gdlbo 8c3be43f25 renamed music to media settings + some settings refactoring 2022-07-09 19:48:06 +03:00
gdlbo 880487f841 Update Newsfeed.java 2022-07-09 19:31:11 +03:00
gdlbo 2d73e10bbf Some settings logic fixes 2022-07-09 18:47:32 +03:00
gdlbo 6a37a8e9e4 fixed poll if 2022-07-09 16:03:28 +03:00
gdlbo 4868e506f3 show poll results 2022-07-09 15:58:38 +03:00
gdlbo db9721e96a updated jars 2022-07-09 15:58:18 +03:00
gdlbo 34c560e105 fix msg db 2022-07-09 15:26:37 +03:00
gdlbo c65f20f8bb Story downloader test
video download dead xd
2022-07-09 15:13:13 +03:00
gdlbo 0fefcafba8 updated jars 2022-07-09 15:12:45 +03:00
gdlbo 730e61836f Update NavigationDelegateBottom.smali 2022-07-08 14:29:07 +03:00
gdlbo f212fdcae8 VK Me mode inject 2022-07-08 14:10:27 +03:00
gdlbo 9acffafda0 kostil for dockbak lol 2022-07-08 13:58:26 +03:00
gdlbo 1a62889cb9 inj dockbar 2022-07-08 13:36:25 +03:00
gdlbo 4ff5ea9fec Fixed feed cache toggle 2022-07-08 11:03:15 +03:00
gdlbo 77bc356f4b Video redesign optional 2022-07-08 11:00:03 +03:00
gdlbo be5633f29c Update Toggles.java 2022-07-08 10:55:08 +03:00
gdlbo 1bf6c00e4c VTSettings fixes
fixed design
fixed proxy type null
2022-07-08 10:49:12 +03:00
gdlbo 9cc5eab93d Update DockBarManager.java 2022-07-08 10:35:26 +03:00
gdlbo 39bd57b3f6 Update DockBarManager.java 2022-07-08 10:31:35 +03:00
gdlbo a50452fb58 Update DockBarManager.java 2022-07-07 21:38:42 +03:00
gdlbo 63229b42c1 Fixed dockbar color?, fixed double vt icons 2022-07-07 20:37:49 +03:00
gdlbo 8e5f3ec3b6 fixed R.java.......... 2022-07-07 20:14:37 +03:00
gdlbo 61a4ef17a4 Revert "Update public.xml"
This reverts commit 0a3b6f5bc0.
2022-07-07 19:48:48 +03:00
gdlbo 4498d231ad IconManager manifest inject 2022-07-07 19:18:02 +03:00
gdlbo eb659dd453 Fixed AndroidManifest 2022-07-07 19:12:31 +03:00
Vologhat 7aa3205c79 Update R.java 2022-07-07 19:02:00 +03:00
gdlbo 3a49e3ba01 Update IconManager.java
fixed logic
2022-07-07 16:41:58 +03:00
gdlbo cb07a9c8dd Update IconManager.java 2022-07-07 16:40:40 +03:00
gdlbo bd8a20e64c Update IconManager.java 2022-07-07 16:33:14 +03:00
gdlbo dcb0471d33 Update IconManager.java 2022-07-07 16:30:24 +03:00
gdlbo 49c1ca45c8 IconManager codebase 2022-07-07 16:26:19 +03:00
aliveoutside e2ca160507 hook dockbar 2022-07-07 16:37:26 +03:00
gdlbo 0a3b6f5bc0 Update public.xml 2022-07-07 13:16:36 +03:00
gdlbo 2391174a0a Update R.java 2022-07-07 11:51:39 +03:00
gdlbo 1ddaa8d162 fix download icon for tgs 2022-07-07 11:39:29 +03:00
aliveoutside 54e5930e8d telegram stickers doesn't look like shit now 2022-07-07 04:58:27 +03:00
gdlbo dad839ca56 tgs inj 2022-07-06 18:07:49 +03:00
Vologhat 8d60831e65 fixed crashes in StickersFragment 2022-07-06 17:39:39 +03:00
gdlbo 837a888b37 some music fixes 2022-07-06 11:40:02 +03:00
gdlbo 39dae8f8e8 Update VTSettings.java 2022-07-06 10:04:57 +03:00
gdlbo 90761b1599 updated superapp in settings 2022-07-06 09:58:04 +03:00
Vologhat 75394d2239 fixed superapp injector 2022-07-05 20:51:02 +03:00
Vologhat bf3dab1585 fixed profile hiding 2022-07-05 20:43:20 +03:00
Vologhat f224645c9c optimizations 2022-07-05 20:11:06 +03:00
gdlbo 36a9d621b4 Update ProfileHide.java 2022-07-05 16:28:17 +03:00
gdlbo f1c2d2c95a profile hide inj test
profiles dead lmao
2022-07-05 16:25:01 +03:00
gdlbo b71581d48a Update JsonInjectors.java 2022-07-05 15:11:24 +03:00
gdlbo 81e85fba7e Update JsonInjectors.java 2022-07-05 15:00:31 +03:00
gdlbo ed6244919d upgraded convBar ext + added debug link 2022-07-05 14:51:44 +03:00
gdlbo 782ff2bb66 Update Proxy.java 2022-07-05 13:11:24 +03:00
gdlbo 2a02efec0d Update Proxy.java 2022-07-05 13:07:32 +03:00
gdlbo a74c48d8d0 proxy fixes 2022-07-05 13:02:24 +03:00
gdlbo 5054dbdc7d Some settings + proxy fixes 2022-07-03 14:11:33 +03:00
gdlbo 0db27e1690 Fix proxy summ for vt settings 2022-07-03 13:39:22 +03:00
gdlbo 93937be836 Fix crash for android 5, 5.1, 6 + added cute icon for superapp editor 2022-07-03 13:33:27 +03:00
gdlbo 2649b21ac7 fixed scaling pic 2022-07-02 14:00:54 +03:00
gdlbo d83dc9370d Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-07-02 12:55:27 +03:00
gdlbo c3bae00331 fixed rounding pic 2022-07-02 12:55:17 +03:00
gdlbo 13b5ad11a8 Merge pull request #410 from k1zn/vtl-remaster 2022-07-02 08:19:27 +03:00
k1zn bf90cbd9ee Fix Russian music subscription string 2022-07-02 02:00:06 +05:00
k1zn ac25b978e3 Fix Ukrainian music subscription string 2022-07-02 01:59:30 +05:00
gdlbo 6549c3e51a music subs warning 2022-07-01 15:41:35 +03:00
gdlbo aa301b007c deleted useless feature 2022-07-01 15:37:59 +03:00
gdlbo d17663bb6e fixed loopedanimstickers pref 2022-07-01 14:55:31 +03:00
gdlbo 49ae2bdbe3 Loop anim stickers test 2022-07-01 14:45:05 +03:00
gdlbo f2bc513869 added more font sizes 2022-07-01 14:29:52 +03:00
gdlbo 6abc2e4cf9 Fixes
Deleted unused code
Fixed some settings
Sorted toggles features
2022-07-01 14:24:16 +03:00
Vologhat 0fba48dd73 added backup settings in test mode 2022-06-30 19:47:11 +03:00
gdlbo 9fa484d378 fixed some toggles 2022-06-30 17:55:09 +03:00
gdlbo 697189a2b9 superapp editor test 2022-06-30 17:40:20 +03:00
gdlbo b39493bd3d Update JsonInjectors.java 2022-06-30 14:33:05 +03:00
Vologhat 44e1f1b265 fixed fox1d code 2022-06-30 14:20:31 +03:00
aliveoutside e73855a830 fix ne4italki popup menu 2022-06-30 01:59:33 +03:00
aliveoutside 4e50cf3f8d yes milkshake 2022-06-30 01:44:28 +03:00
gdlbo 7869a3163f startfragment inj 2022-06-29 20:31:31 +03:00
gdlbo 036e9939c7 Update SuperAppPresenter.smali 2022-06-29 20:29:27 +03:00
gdlbo b743f64b3e superapp inj
without superapp editor
2022-06-29 20:20:49 +03:00
gdlbo 0f40f58801 no shopping v2 2022-06-29 18:49:15 +03:00
gdlbo f52a20aa1a no shopping anymore in stock menu 2022-06-29 18:03:02 +03:00
gdlbo 158ca27531 Fixed crash in interface sett 2022-06-29 17:56:32 +03:00
gdlbo e48ed3aac6 fixed translation 2022-06-29 17:46:33 +03:00
gdlbo 733ed9daf0 More animations :) 2022-06-29 17:42:51 +03:00
gdlbo f15ea0ee00 Test fix anim crash in My Stickers 2022-06-29 17:41:29 +03:00
gdlbo e95bd7e3c1 anim inj 2022-06-29 17:08:51 +03:00
gdlbo af667093ef fixed imports 2022-06-29 16:49:15 +03:00
gdlbo 5b3c8fd9da fix 2022-06-29 16:40:44 +03:00
gdlbo cc76d48f00 deleted some unused code 2022-06-29 16:08:29 +03:00
gdlbo 994cfa9f21 do not seen stories inj 2022-06-29 16:03:17 +03:00
gdlbo cee15d5ebb showmenu inj 2022-06-29 15:46:25 +03:00
gdlbo 6fe72ebb9f disable videofeed inj 2022-06-29 15:39:50 +03:00
gdlbo a4cc33d3ce milkshake disabled by default + disabled welcome banner on milkshake 2022-06-29 15:29:13 +03:00
gdlbo 7eeb1c3bf2 fixed msgs 2022-06-29 13:49:43 +03:00
gdlbo ca49a100fa Maybe fix msg 2022-06-29 13:28:22 +03:00
gdlbo fd41df894f Update StandartFilter.txt 2022-06-29 12:02:39 +03:00
gdlbo 82b85e6bfd Refactored reposts adblock + updated filter 2022-06-29 11:53:24 +03:00
gdlbo b154e4c5f0 updated filters 2022-06-29 11:47:44 +03:00
gdlbo 03112dd9f7 some important fixes 2022-06-29 01:21:05 +03:00
aliveoutside ef51d5d2b9 update apktool 2022-06-28 19:57:25 +03:00
aliveoutside 58577e74f7 inject ne4italki into dialog menu 2022-06-28 19:57:25 +03:00
gdlbo 54aac33525 Updated Toggles 2022-06-28 01:27:44 +03:00
gdlbo b27cef0d1b Update Toggles.java 2022-06-28 01:05:45 +03:00
gdlbo 5dfc3b4f02 fixed crash in music + added disabler milkshake 2022-06-27 23:55:57 +03:00
aliveoutside 5acf70169c ne4italki 2022-06-27 20:54:04 +03:00
gdlbo 0e388f5888 toggles redirect 2022-06-27 19:45:51 +03:00
gdlbo 2a5c5cb24f ServerDialog disabler 2022-06-27 18:40:11 +03:00
gdlbo 58ec32be6f covbar inj test 2 2022-06-27 17:58:30 +03:00
gdlbo 21fb5fc48b covbar inj test 2022-06-27 16:47:41 +03:00
gdlbo d6fcafe8e0 fixed adfilter 2022-06-27 15:26:37 +03:00
gdlbo 95ade723f9 upgraded newsfeed ad posts detection
added support for reposts
refactored copyright posts detection
updated adblock filters
2022-06-27 15:15:42 +03:00
gdlbo de31594250 Update build.yml 2022-06-26 20:55:30 +03:00
gdlbo 0ff208c2f9 Messages -> Chats 2022-06-26 20:50:36 +03:00
gdlbo 92c69e3d97 Merge pull request #392 from iNotFlying/vtl-remaster 2022-06-26 17:49:40 +03:00
iNotFlying c065eaac6b Telegram icon fix 2022-06-26 18:47:55 +04:00
gdlbo fed9d76bcb Update FriendsGetRecommendationsWithMutual.smali 2022-06-26 17:04:33 +03:00
gdlbo fdb9819ca9 Merge pull request #391 from iNotFlying/vtl-remaster 2022-06-26 16:40:12 +03:00
iNotFlying 90b773dd52 New icons 2022-06-26 16:35:03 +04:00
gdlbo 206ffd17c8 Update OnlineFormatter.java 2022-06-25 20:29:41 +03:00
gdlbo 5363378ea1 Update OnlineFormatter.java 2022-06-25 20:27:02 +03:00
gdlbo bee1e760b8 Update OnlineFormatter.java 2022-06-25 20:15:28 +03:00
gdlbo 996760489f updated Online Formatter 2022-06-25 20:13:58 +03:00
gdlbo 65af8e24c1 Custom online detection
need to do make requests to get appid name from vk
2022-06-25 19:39:34 +03:00
gdlbo d59ef7ddfe ServerDialog upgraded 2022-06-25 15:36:44 +03:00
gdlbo 9ab654b290 ServerDialog upgraded 2022-06-25 15:36:10 +03:00
gdlbo 7217e75a15 ServerDialog null check 2022-06-25 14:50:12 +03:00
gdlbo ae4847d056 ServerDialog impl 2022-06-25 14:41:42 +03:00
gdlbo 88b882c74d fixed verifications 2022-06-25 12:39:17 +03:00
gdlbo 7b12cb9922 fixed number rounding in groups 2022-06-25 12:28:12 +03:00
gdlbo 06a6d6e575 fixed number rounding in groups 2022-06-25 12:24:31 +03:00
gdlbo 20f043885a fixed crash 2022-06-25 12:13:18 +03:00
gdlbo 7ff5d24d10 fixes of music and debug 2022-06-25 12:05:22 +03:00
gdlbo 70059b25d8 fixes of music and debug 2022-06-25 12:05:15 +03:00
gdlbo a7f23c7b72 fixed crashreport icon 2022-06-25 12:01:26 +03:00
gdlbo c056add894 added install permission 2022-06-25 11:57:57 +03:00
gdlbo fbca333163 fixed ota requests 2022-06-25 11:55:56 +03:00
gdlbo 52b153ba82 deleted benchmark tracker + fixes 2022-06-25 11:46:05 +03:00
gdlbo 6b9bc3cdd9 deleted music tracker 2022-06-25 11:33:37 +03:00
gdlbo c6647ff807 fixed profile open 2022-06-25 11:11:34 +03:00
gdlbo b4c2d075ab fixed libvoip lib 2022-06-25 11:00:11 +03:00
gdlbo 4835485085 fixes of LinkProcessorKt 2022-06-25 10:52:05 +03:00
gdlbo 937b01e55b added some redirects to settings 2022-06-25 10:30:56 +03:00
gdlbo 3630b44d38 added support to open links from m.vk.com 2022-06-25 09:23:01 +03:00
gdlbo 086b07ace9 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-25 09:19:06 +03:00
gdlbo 1efdad97eb gmap fix + added needed activities and services 2022-06-25 09:18:56 +03:00
gdlbo 4bd2b31e1d gmap fix 2022-06-25 09:11:33 +03:00
aliveoutside 97cd94de4a vkx integration 2022-06-25 04:05:11 +03:00
gdlbo 820b9fd969 newsfeed filter inj to NewsfeedCustomGet 2022-06-25 01:06:00 +03:00
gdlbo a64f4d1377 stories ads inj 2022-06-25 00:30:01 +03:00
gdlbo 15e9b5c712 awayphp inj 2022-06-25 00:28:08 +03:00
gdlbo c8302d6024 added donate button 2022-06-25 00:22:15 +03:00
gdlbo cc98e5bdb8 inj refresh newsfeed 2022-06-24 23:44:39 +03:00
gdlbo 9f07840030 swipe stories inj 2022-06-24 23:41:28 +03:00
gdlbo 534bd61c3a dockcounter inj 2022-06-24 23:41:13 +03:00
gdlbo e68847ca77 alteremoji inj 2022-06-24 23:33:31 +03:00
gdlbo 8a91ccd47e system emoji inj 2022-06-24 23:26:06 +03:00
aliveoutside e082511d59 fix init 2022-06-24 23:21:45 +03:00
gdlbo 146d4d42e8 fixed some settings logic for stupid users 2022-06-24 23:20:43 +03:00
gdlbo d364b2c87a added date formatter + deleted some unused code 2022-06-24 23:14:51 +03:00
gdlbo 257b2e33f2 chat count load inj + fixes 2022-06-24 22:54:56 +03:00
gdlbo b6afe6f5db date formatter in chats 2022-06-24 22:53:28 +03:00
gdlbo d6959cd074 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-24 22:37:47 +03:00
gdlbo 96f752c6ac value rounding 2022-06-24 22:37:40 +03:00
aliveoutside f8fa4b6c67 hooked stories disabler 2022-06-24 22:13:48 +03:00
gdlbo db7a94a10c shortpost 2022-06-24 22:07:18 +03:00
gdlbo 6aa9eef8ea fixed dialogs load 2022-06-24 20:27:43 +03:00
gdlbo dac5053eb5 upped vk ver 2022-06-24 20:02:23 +03:00
gdlbo c0a3a6c54f getDrawableFromUrl fix 2022-06-24 19:41:08 +03:00
gdlbo b2a34380b6 fix summ in feed 2022-06-24 13:31:16 +03:00
gdlbo 1237a9f8ac added filter for copyright links 2022-06-24 13:27:59 +03:00
aliveoutside 0a6d00b4ab Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-24 13:03:11 +03:00
gdlbo 27c8a1575f added filter for copyright links 2022-06-24 11:54:35 +03:00
gdlbo f7a137537c fixed ads in discover 2022-06-24 11:43:38 +03:00
gdlbo 8953ee1f7f added app version to about 2022-06-24 10:49:25 +03:00
gdlbo 8da5f35c33 renamed some strings 2022-06-24 10:39:31 +03:00
gdlbo 0bc2d2b896 added proxied static and oauth + refactored by copilot 2022-06-24 10:37:49 +03:00
gdlbo 3167dfab09 vk api proxy inj 2022-06-24 09:38:57 +03:00
gdlbo 6c1130aed2 voice inject 2022-06-24 09:31:29 +03:00
gdlbo bded70f6c6 pic compress inject 2022-06-24 09:27:27 +03:00
gdlbo 097a6feeb7 pic compress inject 2022-06-24 09:27:18 +03:00
aliveoutside bd2d49de85 implement messages undeleter (via reflection for now) 2022-06-24 03:56:12 +03:00
gdlbo 4dd43961d4 changed codestyle 2022-06-23 17:31:32 +03:00
gdlbo 9c968d1f4f added reload msg feature 2022-06-23 00:56:32 +03:00
gdlbo 261592a6b3 added multiacc + updated jars 2022-06-23 00:19:57 +03:00
gdlbo a5b45c318d fixed ru locale 2022-06-22 23:27:42 +03:00
gdlbo d50f42a8b0 fixed ssl by default 2022-06-22 23:22:14 +03:00
gdlbo 1ec2e1dd4b fixed some settings 2022-06-22 23:21:02 +03:00
gdlbo 62bd5588e3 ru locale 2022-06-22 23:20:32 +03:00
gdlbo 1c6fd7050d fixed auto detect theme + fixes of debug 2022-06-22 23:09:05 +03:00
gdlbo 94a5ddcc5f fixed workflow compiling 2022-06-22 23:00:55 +03:00
gdlbo 5b756b0c7a fixed windows compiling 2022-06-22 23:00:26 +03:00
gdlbo d940bb63d6 fixed proxy tab 2022-06-22 22:59:33 +03:00
gdlbo 4610626cc7 fixed auth + added old prefs to debug 2022-06-22 22:52:28 +03:00
gdlbo 09704a2f0f updated jars 2022-06-22 20:44:08 +03:00
gdlbo bce4952254 updated themes and disabled auto theme (dead) 2022-06-22 20:43:57 +03:00
gdlbo 4b7fb82710 fixes themes 2022-06-22 19:34:20 +03:00
gdlbo acb06b6953 fixed cringe logs 2022-06-22 19:16:13 +03:00
gdlbo c11bee25d1 added vkui inj + upgraded vkui coloring and theme changing 2022-06-22 18:55:45 +03:00
gdlbo 7543021cff fixed opening vk id and bugtracker 2022-06-22 18:33:00 +03:00
aliveoutside 019c29bfae fix crashing tgstickers fragment 2022-06-22 18:12:17 +03:00
gdlbo 1c7e010aa2 fixed icons 2022-06-22 18:04:46 +03:00
gdlbo a7c9b7dd58 added new params 2022-06-22 17:58:57 +03:00
gdlbo 8e0ff61597 added old icons 2022-06-22 17:56:34 +03:00
aliveoutside 8d5cc68a87 update icons in settings 2022-06-22 17:29:51 +03:00
gdlbo 3e765ba22c fixed FriendsGetRecommendationsWithMutual.smali 2022-06-22 16:49:13 +03:00
gdlbo bea91dd654 newsfeed inj 2022-06-22 16:43:18 +03:00
gdlbo d14f9a7a4d added offline and news injector 2022-06-22 16:41:41 +03:00
gdlbo 8694d39dcb fixed auto cleaning cache 2022-06-22 14:51:22 +03:00
gdlbo 7c808f608f fixed settings opening 2022-06-22 14:47:26 +03:00
gdlbo 42856485fc verifications 2022-06-22 14:21:52 +03:00
gdlbo 76e768dda8 navbar coloring (s0v@ killer tbh) 2022-06-22 12:37:44 +03:00
gdlbo 59d243bb5b deleted video/msg reporter 2022-06-22 12:14:22 +03:00
gdlbo 3a6cd04a84 fix network 2022-06-22 12:08:56 +03:00
gdlbo 4b0bc25e0b deleted vk ui analytics and anr 2022-06-22 11:52:38 +03:00
gdlbo 2ef6206599 deleted app start duration checker 2022-06-22 11:41:29 +03:00
gdlbo e092da882c deleted vk analytics reporter 2022-06-22 11:35:00 +03:00
gdlbo 9c10b06390 deleted my tracker 2022-06-22 11:29:40 +03:00
gdlbo 65208fba3c Deleted crashlytics 2022-06-22 11:17:00 +03:00
gdlbo 36d13cdd72 fixed strings compiling 2022-06-22 10:25:27 +03:00
gdlbo f9c3484c0e Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-22 10:21:33 +03:00
gdlbo f8e22cbfbc inited new version + app name 2022-06-22 10:21:17 +03:00
aliveoutside 5da7f8e2f4 add settings 2022-06-22 04:58:42 +03:00
gdlbo c7bfc871c1 added Toggles.java with hook 2022-06-22 01:23:00 +03:00
aliveoutside fd26567990 fix not loading messages 2022-06-22 04:06:51 +03:00
aliveoutside d27e304136 update jars 2022-06-22 03:55:21 +03:00
aliveoutside 7f91075a92 hide DeletedMessagesHandler for now 2022-06-22 03:54:57 +03:00
aliveoutside 4436c1d9f1 update buildscripts 2022-06-22 03:54:34 +03:00
aliveoutside 69822b4071 fix ModalBottomSheetWrapper 2022-06-22 03:44:08 +03:00
gdlbo 91117a5dea added Toggles.java with hook 2022-06-22 00:42:42 +03:00
gdlbo 2a1b799f7e fix Toggles.java 2022-06-22 00:17:14 +03:00
gdlbo 119d759105 added Toggles.java 2022-06-22 00:13:13 +03:00
aliveoutside b94462fdf0 fix galo4ki 2022-06-22 02:07:39 +03:00
aliveoutside 2820a132d8 fix OTAHelper 2022-06-22 02:07:39 +03:00
gdlbo 46625fdecc fixed imports and Themes.java 2022-06-21 23:05:33 +03:00
Vologhat 3ec0cfad4d Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-21 22:55:08 +03:00
aliveoutside 6e08ec86ae fix DeletedMessagesHandler 2022-06-22 01:52:15 +03:00
Vologhat 125abe9e36 extended ReflectionUtils 2022-06-21 22:54:44 +03:00
gdlbo eaf94aa97f Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-21 22:38:15 +03:00
aliveoutside 8a0c0f61f5 fix DockBarFragment 2022-06-22 01:31:01 +03:00
aliveoutside a49efd7403 fix otadownloader 2022-06-22 01:24:48 +03:00
aliveoutside 6196b828c3 fix net/request 2022-06-22 01:18:00 +03:00
aliveoutside 7a5421706e fix ExternalLinkHandler 2022-06-22 01:13:58 +03:00
gdlbo 43f62669e9 debuggable true 2022-06-21 22:36:49 +03:00
gdlbo f1d77a639c fixed setup with official vk 2022-06-21 22:36:18 +03:00
gdlbo b2e6f55487 Merge branch 'vtl-remaster' of https://github.com/vtosters/lite into vtl-remaster 2022-06-21 20:40:46 +03:00
aliveoutside c6b520fb65 fix dnr and dnt 2022-06-21 23:39:00 +03:00
aliveoutside e5d5447957 remove okhttp request 2022-06-21 23:39:00 +03:00
aliveoutside 3048b098b5 fix foaf 2022-06-21 23:39:00 +03:00
gdlbo b71430f135 fixes refl theme 2022-06-21 20:40:29 +03:00
gdlbo 20bae023d9 fixes refl theme 2022-06-21 20:38:10 +03:00
aliveoutside 9fd973c496 fix materialfragment is settings 2022-06-21 23:14:56 +03:00
aliveoutside 97ed8000b8 add activity to manifest 2022-06-21 23:14:56 +03:00
aliveoutside c7f18e434f fix materialfragment 2022-06-21 23:14:56 +03:00
gdlbo 6d5b9dd188 Update R.java 2022-06-21 20:14:42 +03:00
aliveoutside af59a13dd9 update jars 2022-06-21 23:00:13 +03:00
aliveoutside 771ac02c77 Revert "fixes private/public"
This reverts commit c49e985013.
2022-06-21 22:51:21 +03:00
aliveoutside 925065b317 dev mode 2022-06-21 22:37:24 +03:00
aliveoutside 2893050504 ssl 2022-06-21 22:28:30 +03:00
gdlbo 849a48597c Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-21 19:16:12 +03:00
aliveoutside ab85d0b03a enable music 2022-06-21 22:13:58 +03:00
aliveoutside 7ce2dd95e2 disable calls 2022-06-21 22:13:57 +03:00
gdlbo 07032c21db fixes analytics 2022-06-21 19:16:07 +03:00
gdlbo 9cb56466c8 fixes private/public 2022-06-21 19:11:41 +03:00
gdlbo c49e985013 fixes private/public 2022-06-21 19:08:51 +03:00
aliveoutside fbd3f1798a Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-21 22:01:12 +03:00
aliveoutside 66a53f3486 спустя два дня пофиксили 2022-06-21 21:58:55 +03:00
aliveoutside 45acdecedc Revert "deobf"
This reverts commit 755268de
2022-06-20 00:31:48 +03:00
aliveoutside ec105f2b55 partially ifx 2022-06-20 00:19:11 +03:00
gdlbo 858c5b9342 fixes 2022-06-19 23:37:59 +03:00
gdlbo b548f6adf3 fixes 2022-06-19 20:44:33 +03:00
gdlbo 719147997c fixes 2022-06-19 20:13:27 +03:00
gdlbo 9489ddad5e added new fonts 2022-06-19 20:13:18 +03:00
gdlbo f479c36fcd fix 2022-06-19 19:28:04 +03:00
gdlbo 9a925e7100 fix 2022-06-19 19:17:30 +03:00
gdlbo 7e7f091ab5 fixes 2022-06-19 15:32:24 +03:00
aliveoutside 8aa6c41037 update r.java 2022-06-19 18:21:48 +03:00
gdlbo f30994b82e fixes 2022-06-19 14:52:27 +03:00
gdlbo 873b83cb31 fixes 2022-06-19 14:38:22 +03:00
aliveoutside 4a04f50f98 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 17:17:50 +03:00
aliveoutside ff31cb0377 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 17:01:32 +03:00
aliveoutside 8c16e3dc42 fix preferences 2022-06-19 16:57:53 +03:00
aliveoutside 799d06dd10 fix preferences 2022-06-19 16:54:07 +03:00
gdlbo 985a2b30c6 fixes 2022-06-19 14:17:37 +03:00
gdlbo 66a8c909ee Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 14:01:28 +03:00
gdlbo 6439021fc2 fixes 2022-06-19 14:01:24 +03:00
gdlbo 0a09423e10 fixed all res 2022-06-19 13:11:07 +03:00
gdlbo 119ae933e2 added resources + fixed animfrag 2022-06-19 12:47:35 +03:00
aliveoutside 1fd27c5acf add assests 2022-06-19 07:05:35 +03:00
aliveoutside e3f338c91f update jars 2022-06-19 07:03:08 +03:00
aliveoutside 39723bcf5b remove multiacc (it's already in the client) 2022-06-19 07:02:55 +03:00
aliveoutside d570a77bd5 fix StickersPreferencesFragment 2022-06-19 06:59:52 +03:00
aliveoutside 7b1fcfb15a fix DeletedMessagesHandler 2022-06-19 06:52:32 +03:00
aliveoutside 17ba841440 add update jars script 2022-06-19 06:49:32 +03:00
aliveoutside 6ea830cbc7 fix verifications 2022-06-19 05:57:58 +03:00
aliveoutside 179b1769ae fix vkx 2022-06-19 05:53:17 +03:00
aliveoutside 3cae6da5d7 fix settings 2022-06-19 05:49:10 +03:00
aliveoutside b1ce420393 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 05:44:34 +03:00
aliveoutside a8d1bdc8a8 Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 05:30:56 +03:00
aliveoutside f9d0d239b8 fix messages settings 2022-06-19 05:03:00 +03:00
aliveoutside 877153a998 fix 2022-06-19 04:54:56 +03:00
aliveoutside 35c7c4c08d Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 04:48:03 +03:00
aliveoutside e3340a76db fix video downloader 2022-06-19 04:42:43 +03:00
aliveoutside 94cef1b5f8 deobf 2022-06-19 04:32:02 +03:00
gdlbo ecc224776e fixes 2022-06-19 02:44:29 +03:00
gdlbo 7deb1bba58 fixes 2022-06-19 02:13:23 +03:00
gdlbo 7ff965c73d Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster 2022-06-19 02:06:52 +03:00
gdlbo 9cc136bfda fixes 2022-06-19 02:06:47 +03:00
gdlbo 8ef0aeef13 fixes 2022-06-19 01:47:55 +03:00
gdlbo d906c1103b fixes 2022-06-19 00:27:34 +03:00
gdlbo 7bfdc6255c dev mode 2022-06-18 23:52:54 +03:00
gdlbo c5162a05aa music + ssl v2 2022-06-18 23:29:48 +03:00
gdlbo d5353a87dc ssl + debug check 2022-06-18 23:29:05 +03:00
aliveoutside 3072531c24 rename 2022-06-18 23:01:03 +03:00
aliveoutside d87ff342d4 disable calls 2022-06-18 20:04:41 +03:00
aliveoutside 3266b8ccd6 fix music 2022-06-18 20:01:17 +03:00
aliveoutside 03cc03b6bf fix buildscripts 2022-06-18 20:01:07 +03:00
aliveoutside 2df8cc5f2a add new files 2022-06-18 19:27:15 +03:00
aliveoutside 8fd7116759 init new ver 2022-06-18 19:12:50 +03:00
gdlbo bd4310e6e8 fixed deleting acc 2022-06-17 22:52:50 +03:00
gdlbo dfa7ba031e shakal mode 2022-06-17 19:49:41 +03:00
gdlbo 6ddea672ad fixed multi account 2022-06-17 19:27:35 +03:00
gdlbo 047378a11d updated gh actions script 2022-06-17 19:13:27 +03:00
gdlbo 3420c4abb0 added compress disabler 2022-06-17 19:10:57 +03:00
gdlbo 15a8d70f5f added compress disabler 2022-06-17 19:08:37 +03:00
gdlbo 91f90a6609 Merge remote-tracking branch 'origin/master' 2022-06-17 18:35:06 +03:00
gdlbo e170b70999 added auto cleaning cache 2022-06-17 18:35:01 +03:00
gdlbo b489011d24 Merge pull request #342 from k1zn/master
Fix avatar position on tablet
2022-06-17 18:27:20 +03:00
gdlbo 58adfbd261 added auto cleaning cache 2022-06-17 18:21:10 +03:00
Erik Kiznov 3bb18b6daf Fix README.md 2022-06-17 20:09:03 +05:00
Erik Kiznov 120bf18416 Fix avatar position on tablet 2022-06-17 19:36:42 +05:00
Vologhat 428c4ef7d6 changed buttons style 2022-06-17 17:12:26 +03:00
gdlbo 40fc05fc15 fix foxbin.f0x1d.com/enotik 2022-06-17 15:12:59 +03:00
gdlbo 2e913223a2 fix 2022-06-17 14:54:47 +03:00
gdlbo 48f12a912c fix 99% problems on android 11 and lower 2022-06-17 14:19:27 +03:00
gdlbo 0228c0b8a1 fixed colors 2022-06-17 13:58:41 +03:00
gdlbo ba07aeb4d7 fix vk icon in menu 2022-06-17 13:53:17 +03:00
gdlbo 529b13f18b fixed crash android 5.1 2022-06-17 13:34:40 +03:00
gdlbo 5720fddb59 fix crash MusicFragment 2022-06-16 23:30:08 +03:00
gdlbo f5c80b230a gcmfix v2 is here 2022-06-16 22:46:07 +03:00
gdlbo 87ee01bac9 gcmfix v2 is here 2022-06-16 22:32:00 +03:00
gdlbo 126ad044f2 gcmfix v2 is here 2022-06-16 22:30:00 +03:00
gdlbo b636648457 counters is back 2022-06-16 21:58:13 +03:00
gdlbo bf3672a8c4 fix rounded msg + improved vkme msg mode 2022-06-16 21:25:41 +03:00
gdlbo e6478d5161 fixed bg stickers issue 2022-06-16 21:14:13 +03:00
gdlbo ddea78aa4b VKID Protection alert in music settings 2022-06-16 20:25:02 +03:00
gdlbo b872fb17b8 VKID Protection alert 2022-06-16 19:38:18 +03:00
gdlbo 4ec2c17df1 VKID Protection alert 2022-06-16 19:35:45 +03:00
gdlbo 38a51f48d0 fix sharing action buttons 2022-06-16 17:05:42 +03:00
gdlbo 838897611c small fixes 2022-06-16 16:51:27 +03:00
gdlbo f42150063c small fixes 2022-06-16 16:37:35 +03:00
gdlbo d164d1219d verif icon coloring in dialogs 2022-06-16 16:24:23 +03:00
gdlbo fb71b4d781 toolbar fixes 2022-06-16 16:02:19 +03:00
gdlbo f338738c1e writebar fix 2022-06-16 14:16:46 +03:00
gdlbo fb704c7388 fix msg loading 2022-06-16 14:03:39 +03:00
gdlbo c99bca4200 online fixes 2022-06-16 13:18:09 +03:00
gdlbo 92f43acb80 fix 2022-06-16 09:12:39 +03:00
gdlbo a7c85a24f2 added signature check to detect github actions builds and etc 2022-06-16 01:26:07 +03:00
gdlbo fe5616b3f7 fixes 2022-06-16 01:06:11 +03:00
gdlbo 5c882c5ce2 fixes 2022-06-16 00:33:40 +03:00
gdlbo 61a4ed43b9 fixed toast 2022-06-16 00:15:31 +03:00
Vologhat b242ad7ae4 Merge branch 'ota' 2022-06-16 00:09:40 +03:00
Vologhat 1b02e806f8 Final fixes 2022-06-16 00:04:34 +03:00
gdlbo eaf23a24ba impossible color fix 2022-06-15 23:08:58 +03:00
gdlbo ce64296c01 kill androidx 2022-06-15 21:47:21 +03:00
Vologhat 6e3716fe01 final changes
added apk downloading and installing features, bottomshit wrapper with mirroring
2022-06-15 21:29:09 +03:00
gdlbo dcdd83243b color fixes 2022-06-15 21:11:30 +03:00
gdlbo 986ec2987c wtf debuggable must be false 2022-06-15 17:20:01 +03:00
gdlbo c98609db5d fixes 2022-06-15 17:13:18 +03:00
Vologhat 0b4e3c6303 added ota 2022-06-15 16:41:21 +03:00
gdlbo bc3e5a706d fixed auto theme 2022-06-15 07:59:10 +03:00
gdlbo 0b56d9dd23 fixes 2022-06-15 02:36:25 +03:00
gdlbo 62ccdf8eba upgraded new settings
refactored multi account counter
2022-06-15 02:13:33 +03:00
gdlbo 72f4226419 fixes 2022-06-14 23:48:07 +03:00
gdlbo f6a45beac5 isdarktheme now should work depending on the dark theme of the app v2 2022-06-14 13:26:47 +03:00
gdlbo a657ddef58 Merge pull request #313 from iNotFlying/master
New VK logo
2022-06-14 13:10:11 +03:00
gdlbo 726e38ff2e isdarktheme now should work depending on the dark theme of the app 2022-06-14 13:08:20 +03:00
iNotFlying 191d3f760e Some fixes 2022-06-14 10:48:25 +03:00
iNotFlying 2cd3b0f39c Merge branch 'vtosters:master' into master 2022-06-14 11:41:47 +04:00
gdlbo abd990eef7 injected new setting to default theme 2022-06-14 01:19:20 +03:00
gdlbo cd875af7d7 fixed dark theme in new settings 2022-06-14 01:07:17 +03:00
gdlbo b1e8f93371 fixed amoled css 2022-06-14 00:15:25 +03:00
gdlbo 64afd0222b amoled theme now is fully amoled theme 2022-06-14 00:11:33 +03:00
gdlbo 32369f1f38 fixes 2022-06-13 23:57:53 +03:00
gdlbo f00be506cc fixes 2022-06-13 22:49:22 +03:00
gdlbo 248fd1ce9c fixes 2022-06-13 22:40:10 +03:00
gdlbo 3e2d4bb665 vkme mode updated 2022-06-13 22:34:35 +03:00
iNotFlying 92689941ca New VK logo 2022-06-13 21:45:29 +03:00
gdlbo c46110cfea vkme mode updated 2022-06-13 21:07:16 +03:00
gdlbo b5250e0b8d vkme mode updated 2022-06-13 21:06:36 +03:00
gdlbo 0e81397305 vkme mode updated 2022-06-13 21:04:16 +03:00
gdlbo 95d306eaed vkme mode updated 2022-06-13 18:18:38 +03:00
gdlbo 339a4fe01f vkme mode updated 2022-06-13 12:38:50 +03:00
gdlbo 48cdbc7681 vkme mode updated 2022-06-13 12:20:21 +03:00
gdlbo 5e85ba10f4 vkme mode updated 2022-06-13 12:01:04 +03:00
gdlbo ea7dd7aba5 vkme mode test 2022-06-13 01:03:10 +03:00
gdlbo c60b766f37 test coloring bottomsheet 2022-06-12 20:02:15 +03:00
gdlbo da9ded2ae1 mini refactoring 2022-06-12 16:19:45 +03:00
gdlbo 29eb517bb9 fix https://github.com/vtosters/lite/issues/156 2022-06-12 15:44:05 +03:00
gdlbo 84a3f6caff fix 2022-06-12 01:49:10 +03:00
gdlbo b34821463a fix hardcoded text 2022-06-12 01:29:19 +03:00
gdlbo 127abbaaeb fix 2022-06-12 01:12:01 +03:00
gdlbo d462d42775 dropdown menu text color fix 2022-06-12 00:36:18 +03:00
gdlbo 5e80ad7e4e dropdown menu coloring!!!!!!! 2022-06-11 23:51:48 +03:00
gdlbo e1aadade5f fixes 2022-06-11 23:08:16 +03:00
gdlbo 77d6f5d977 fixes 2022-06-11 22:57:52 +03:00
gdlbo c4ae2ec0a3 fixes 2022-06-11 22:45:55 +03:00
gdlbo 07ee9269b7 fixes 2022-06-11 20:16:10 +03:00
gdlbo 3ee43f1c50 Animation fragment injector (beta) 2022-06-11 19:46:22 +03:00
gdlbo dd65196af9 fixed games button 2022-06-11 17:29:05 +03:00
gdlbo 5547de006b upgraded ColorStateList recoloring 2022-06-11 16:42:39 +03:00
gdlbo 0fbf571c60 some fixes of color inj 2022-06-11 15:24:04 +03:00
gdlbo f5f05697b6 Merge remote-tracking branch 'origin/master' 2022-06-11 14:26:43 +03:00
gdlbo 5f179f6a26 fixed search color 2022-06-11 14:26:39 +03:00
gdlbo 37c6d29e84 Fix string 2022-06-10 22:22:46 +03:00
gdlbo 0e81ba31cb fixed crash docs 2022-06-10 21:49:12 +03:00
gdlbo 1f24d32109 fixed crash docs 2022-06-10 21:37:52 +03:00
gdlbo ff16f84c43 some improves 2022-06-10 21:00:37 +03:00
gdlbo 5b929bf515 fixed issue with undelete by default (oops) 2022-06-10 19:42:20 +03:00
gdlbo bdcb3db238 fixed issue with dateformat value 2022-06-10 19:00:26 +03:00
gdlbo f7960b1695 Added an expanded view of the date format type selection
Full date in private messages
Minor improvements
Fixed a bug with anti-deletion of messages
2022-06-10 18:58:19 +03:00
gdlbo 825d1b95da improved disabling number shortening 2022-06-10 17:26:40 +03:00
gdlbo 0e7abaf3f0 fixed pic rounding 2022-06-10 16:40:50 +03:00
gdlbo 2731989ae8 fixed serach text coloring 2022-06-10 16:19:00 +03:00
gdlbo 5ad09e11df fixed casino moment 2022-06-10 16:17:32 +03:00
gdlbo 653d2eeeee fixed casino moment 2022-06-10 15:29:46 +03:00
gdlbo 756ad615ed fixed rounded msgs colors monet 2022-06-10 15:26:40 +03:00
gdlbo dd6abafad5 added pref disableanimstickers to debug 2022-06-09 00:04:14 +03:00
gdlbo 0434f06bb5 fixed some accents 2022-06-08 23:44:58 +03:00
gdlbo 50971098ad fixed accent vkim link 2022-06-08 23:26:30 +03:00
gdlbo 1787f10fca fixed load friends page 2022-06-08 22:58:52 +03:00
gdlbo 6d2684db70 added shadow in dialogs vkme 2022-06-08 21:18:05 +03:00
gdlbo f0f1b3a946 disabled divider in dialogs 2022-06-08 21:09:12 +03:00
gdlbo ae9b703726 fixed shadow 2022-06-08 20:55:19 +03:00
gdlbo 10512fb74b fixed shadow on 31 sdk+ 2022-06-08 20:47:52 +03:00
gdlbo ce9bdba30c sdk 31 rounded msgs 2022-06-08 20:29:30 +03:00
gdlbo 188c98589c amoled theme for rounded msgs 2022-06-08 19:55:11 +03:00
gdlbo e5fa42ff14 some fixes 2022-06-08 19:32:29 +03:00
gdlbo f42aa95003 init rounded msg for light theme 2022-06-08 19:26:01 +03:00
gdlbo b16dc816b6 added applying theme after restart 2022-06-08 19:25:01 +03:00
gdlbo b86fe4d65d init rounded msg for dark theme 2022-06-08 18:50:28 +03:00
gdlbo d7e17416f1 init rounded theme 2022-06-08 18:41:03 +03:00
gdlbo 91355f1dd5 fixed stickers time color 2022-06-08 18:28:56 +03:00
gdlbo ae9e3ed07c fixes some themes logic 2022-06-08 17:22:11 +03:00
gdlbo f701993b0f fixes + more translations 2022-06-08 15:14:34 +03:00
gdlbo c5bf617f65 fixes + more translations 2022-06-08 14:02:45 +03:00
gdlbo f09cae1684 fixes 2022-06-07 17:50:02 +03:00
gdlbo 99d7f06981 New feature open news settings via settings lmao 2022-06-07 11:56:23 +03:00
gdlbo eaaf7e2bbf fixed news logic 2022-06-07 11:26:29 +03:00
gdlbo 897382de2b Fixed some translations + fixed settings logic 2022-06-07 11:24:44 +03:00
gdlbo 55d02a8412 Fixed links 2022-06-07 10:51:24 +03:00
gdlbo 7733582238 Casino update from 7 to 5 2022-06-04 22:14:36 +03:00
gdlbo 754c8339df Added randomize to disable donate alert 2022-06-04 21:18:50 +03:00
gdlbo ebf7baaa65 fixed links + disable recomms 2022-06-04 20:36:00 +03:00
gdlbo 8b26b12813 Added donate banners lmao 2022-06-04 20:04:28 +03:00
gdlbo 5deb4186f9 Fixed market colors 2022-06-04 11:25:38 +03:00
gdlbo d3d501f94a Fix dark accent color on monet 2022-06-04 10:25:41 +03:00
gdlbo 634f1213d4 Merge pull request #283 from bxkr/master 2022-06-04 09:32:58 +03:00
Andrew 6fa97ee435 Update R.java 2022-06-04 06:10:16 +03:00
gdlbo 05b3342763 Fix pull requests building 2022-06-04 04:54:54 +03:00
Andrew d434f42d12 Preferences localization
- Added en,ru translations for hardcoded strings in preferences
- Updated public.xml
- Fixed some ru strings
2022-06-03 23:38:52 +03:00
gdlbo 084f13eda4 Fix actions compiling 2022-06-03 20:36:56 +03:00
gdlbo ed59b54618 Fix actions compiling 2022-06-03 20:33:29 +03:00
gdlbo df282b95ad fix some strings 2022-06-03 19:43:23 +03:00
gdlbo 1b38533c83 color fixes 2022-06-03 17:47:29 +03:00
gdlbo 8f4c370ab2 Update build.gradle 2022-06-03 16:00:11 +03:00
gdlbo 9360ea4d85 Color article fixes 2022-06-02 19:45:49 +03:00
gdlbo c87d6581c8 Color fixes 2022-06-02 19:28:16 +03:00
gdlbo 7133fc6c03 Disabled discover ads 2022-06-02 19:04:24 +03:00
gdlbo 46af5af250 Fix https://github.com/vtosters/lite/issues/266 2022-06-02 17:38:28 +03:00
gdlbo 5b9cc6778c Fixes 2022-06-02 16:42:45 +03:00
gdlbo 5260ad8243 Fixed comments load 2022-06-02 14:25:32 +03:00
gdlbo 2996772020 Updated gitignore 2022-06-02 14:02:37 +03:00
gdlbo d37534cb6b Fixed icon changing 2022-06-02 13:25:19 +03:00
gdlbo 92eb48c21e Fixed crash + fixed msg cache 2022-06-02 13:06:55 +03:00
gdlbo d9e867cb6e Refactoring of some code that suggested what to fix in the comments in our vk group 2022-06-02 12:33:52 +03:00
gdlbo f200c6e59a Refactoring of some code that suggested what to fix in the comments in our vk group 2022-06-02 11:20:11 +03:00
gdlbo c668f3bf9a Refactoring 2022-05-31 16:55:19 +03:00
gdlbo bd7afee09b added more documentations 2022-05-31 16:43:58 +03:00
gdlbo ff09a4aec0 Added our git links 2022-05-26 20:25:51 +03:00
gdlbo 1e6c60f2ed Fixed statusbar and navbar light coloring 2022-05-17 23:08:12 +03:00
gdlbo beedb1538d Poll fix 2022-05-17 20:05:16 +03:00
gdlbo 8463f9e963 Fixes 2022-05-17 18:40:56 +03:00
gdlbo ce8f88b8d4 reworked statusbar coloring 2022-05-17 00:35:39 +03:00
gdlbo ff7d080b5a fix music tabs 2022-05-16 22:38:57 +03:00
gdlbo 12ad83c607 reworked do not read 2022-05-16 21:50:32 +03:00
gdlbo cdf5d2c37c fixes 2022-05-16 21:27:59 +03:00
gdlbo 9af8e1729e copyright posts detect 2022-05-16 21:21:39 +03:00
gdlbo d5219ed322 Fixes + some imp of custom msg loader 2022-05-16 00:11:00 +03:00
gdlbo 7af9a72e77 Fixes 2022-05-15 21:23:48 +03:00
gdlbo 08817bde7e Reworked some cringe code 2022-05-15 21:11:25 +03:00
gdlbo d1e9aadd71 fixed white screamers (maybe) 2022-05-13 20:28:20 +03:00
gdlbo b6307182cd fixes 2022-05-13 19:59:36 +03:00
gdlbo cc70e55b53 Fix summ 2022-05-13 15:36:42 +03:00
gdlbo ed08e97a50 Color fixes 2022-05-13 15:12:02 +03:00
gdlbo 44904786d9 Some corrections 2022-05-13 14:13:36 +03:00
gdlbo 12b67ce189 color fix header 2022-05-13 14:10:18 +03:00
gdlbo 21b0edf092 Fixes 2022-05-13 14:05:00 +03:00
gdlbo 2adb446d80 Fix open notifs 2022-05-13 12:40:42 +03:00
gdlbo 60738458bb Fixes 2022-05-13 11:59:15 +03:00
gdlbo a591026258 Fix article custom verifs 2022-05-12 18:47:42 +03:00
gdlbo 1bab7fa17c Monet dockbar icons coloring 2022-05-12 18:04:12 +03:00
gdlbo 2713216728 Added more summaries 2022-05-12 16:50:30 +03:00
gdlbo f9a529275a System theme at start 2022-05-11 20:59:37 +03:00
gdlbo e992203b7c Some color fixes + upped default app version 2022-05-10 22:34:56 +03:00
gdlbo 0ed057d705 Added another cringe feature 2022-05-10 22:12:40 +03:00
gdlbo 9b70ca6faf Fixed doc upload 2022-05-10 21:27:25 +03:00
gdlbo 422c3e4a6c Fixed stats crash 2022-05-10 21:07:29 +03:00
gdlbo 6dac880d61 Custom opus lib bridges 2022-05-10 20:22:39 +03:00
gdlbo c911b2d64e Custom opus lib bridges 2022-05-10 20:18:59 +03:00
gdlbo 39f72f9058 Crashreporter fix 2022-05-10 14:35:33 +03:00
gdlbo 2bff354ad0 Amoled monet accent + color fixes 2022-05-10 14:11:14 +03:00
gdlbo cb55e9b96f Disabled stats.track*** 2022-05-10 13:53:14 +03:00
gdlbo 33f551d464 Fixed vk cringe refl 2022-05-10 13:26:00 +03:00
gdlbo 282fa7bdda Beautify code 2022-05-07 18:31:07 +03:00
gdlbo 0abd97e8e1 Deleted unused code 2022-05-07 11:16:22 +03:00
gdlbo 5dd616685d Decrypt 2022-05-06 14:50:02 +03:00
gdlbo aff99be92d Fixes 2022-05-06 14:05:23 +03:00
gdlbo c255f1e498 Undelete feature + fixes 2022-05-06 13:43:42 +03:00
gdlbo 70342daf07 Merge branch 'master' of https://github.com/vtosters/lite 2022-05-06 01:58:35 +03:00
gdlbo f95672e57d Encryption + Undelete code base 2022-05-06 01:57:33 +03:00
gdlbo 8f5da42df4 color fixes 2022-05-04 16:41:59 +03:00
gdlbo 4022903069 Fixed crash 2022-05-04 14:23:25 +03:00
gdlbo 4600c185e4 Added proxy user/pass auth 2022-05-04 13:12:39 +03:00
gdlbo 30e8ec0038 Update README.md 2022-05-03 23:45:37 +03:00
gdlbo 367b212ca3 Updated build gradle 2022-05-03 22:19:23 +03:00
gdlbo 6533feb62b Merge remote-tracking branch 'origin/master' 2022-05-03 22:11:35 +03:00
gdlbo 95ef37f6a3 Fix 2022-05-03 22:11:19 +03:00
Vologhat 6216c66d95 fix #204 (null pointer while account deleting) 2022-05-02 18:07:04 +03:00
gdlbo 02b6e4a728 Fix dockbar issue 2022-05-02 13:30:51 +03:00
gdlbo 00c1e926e6 Fixed store stickers colors 2022-05-02 12:54:58 +03:00
gdlbo ef8109e2e8 Reworked some about menu 2022-05-02 12:40:57 +03:00
gdlbo 732ee76957 Disabled anim stickers 2022-05-02 12:31:30 +03:00
gdlbo b97d2261de Fixed bug with new feed design 2022-05-02 11:03:39 +03:00
gdlbo c362bfc8da Fixes + new update feed logic 2022-05-02 10:44:57 +03:00
gdlbo cc445e4aea Oh sh*t I am sorry (for refactoring) 2022-05-02 09:44:30 +03:00
gdlbo 4ac83d59b5 Color fixes 2022-04-30 14:25:40 +03:00
gdlbo 5025a5fa94 Refactoring + renaming 2022-04-30 13:48:04 +03:00
gdlbo b8cb19c8db Refactoring + renaming 2022-04-30 13:17:32 +03:00
gdlbo 593153de8f Updated README.md + version null fix 2022-04-29 22:22:07 +03:00
gdlbo 6c36b83d64 Github Actions test 2022-04-29 21:51:56 +03:00
gdlbo 1381fdd3bb Github Actions test 2022-04-29 21:48:08 +03:00
gdlbo f680a37eb1 gh actions test 3 2022-04-29 21:42:51 +03:00
gdlbo 4531b7af52 gh actions test 2 2022-04-29 21:38:24 +03:00
gdlbo 0c4d1af2dc fix 2022-04-29 21:29:20 +03:00
gdlbo d6a18ecca6 gh actions test 2022-04-29 21:27:25 +03:00
gdlbo dc768952c3 Updated README.md 2022-04-29 20:56:14 +03:00
gdlbo 57cdcfcbd1 color fixes 2022-04-29 16:49:30 +03:00
gdlbo fb4837ce40 color fixes 2022-04-28 22:02:35 +03:00
gdlbo b85e1e6937 color fixes 2022-04-28 21:56:54 +03:00
gdlbo 727201ece9 Some fixes 2022-04-28 21:21:20 +03:00
gdlbo c711c3126e Clean up code 2022-04-28 21:11:04 +03:00
gdlbo cdcf218160 Fixes 2022-04-28 20:57:57 +03:00
gdlbo ee652593c0 Backup system fixes 2022-04-28 19:07:11 +03:00
gdlbo 90773529e6 Reset/Save prefs system init 2022-04-28 18:29:31 +03:00
gdlbo 0134a7c82c Reset/Save prefs system init 2022-04-28 18:29:21 +03:00
gdlbo fec3d40d7d fixes 2022-04-27 23:06:43 +03:00
gdlbo bdf36f42d3 fixes for music popup 2022-04-27 21:34:14 +03:00
gdlbo 23967490e9 https://github.com/vtosters/lite/issues/181 + color fixes for tabs 2022-04-27 21:09:29 +03:00
gdlbo 3bcd197618 Fixed crash
https://github.com/vtosters/lite/issues/192
2022-04-27 20:29:18 +03:00
gdlbo ac3eba5654 Deleted exit button :) 2022-04-27 20:25:29 +03:00
gdlbo 9576856b0b Added debug feature for clear all sticks cache 2022-04-27 20:15:47 +03:00
gdlbo f17975c92f Fixed pic theme 2022-04-27 20:08:23 +03:00
gdlbo 07a24eab2f Fixed header coloring 2022-04-27 19:37:48 +03:00
gdlbo edc9276fac Max tabs updated 2022-04-26 14:28:37 +03:00
gdlbo c7531eb652 Updated icons 2022-04-25 19:37:14 +03:00
gdlbo 5c1452ff57 Fixed msg strange bug + fixes 2022-04-25 17:24:13 +03:00
gdlbo e467044e41 Improved Dark theme 2022-04-25 16:47:43 +03:00
gdlbo 5c5780f720 Improved player progress color 2022-04-25 16:31:02 +03:00
gdlbo 7119bab9c9 Refactored vkui injector + added headers coloring 2022-04-25 15:51:07 +03:00
gdlbo 2eccc92510 Monet fixes 2022-04-25 14:23:18 +03:00
gdlbo b9e0fcdb04 Update preferences_themes.xml 2022-04-24 22:44:06 +03:00
gdlbo 5c15912b1b Update DockBarManager.java 2022-04-24 22:32:39 +03:00
gdlbo ac6525e49a Improved dark theme 2022-04-24 19:22:35 +03:00
gdlbo 3e67973a27 added more info + reformated xml 2022-04-24 18:42:17 +03:00
gdlbo ed4e295e71 Update ThemesFragment.java 2022-04-24 18:28:12 +03:00
gdlbo 73b57399d5 Improved Theme changing 2022-04-24 18:16:24 +03:00
gdlbo 9e0b67478d fixed comments 2022-04-24 17:57:26 +03:00
gdlbo 341eb37ff4 Fixes + Added comments sorting 2022-04-24 17:43:02 +03:00
gdlbo 6d68a77e42 fixes 2022-04-24 16:58:17 +03:00
gdlbo b50f56a5d4 Oh, fixes?
-Added styles list for dark and light themes
-Updated libs
-Auto refactored resources for easy editing
-Improved amoled theme
2022-04-23 21:36:08 +03:00
gdlbo e226438b09 Improved Amoled Theme 2022-04-23 00:03:37 +03:00
gdlbo a5db0793d6 Revert "Improved navbar coloring"
This reverts commit 07e1f1a1d3.
2022-04-22 23:01:45 +03:00
gdlbo 07e1f1a1d3 Improved navbar coloring 2022-04-22 19:29:18 +03:00
gdlbo de77e3484b Update preferences_themes.xml 2022-04-22 18:59:48 +03:00
gdlbo 24571ea22f Amoled Theme feature 2022-04-22 18:51:42 +03:00
gdlbo 515f90105c Improved Amoled Theme + Added support for SSFS 2022-04-22 18:04:56 +03:00
gdlbo 0d305dbc7e Amoled Theme Styles for VKIM + fixed vk refl 2022-04-22 17:39:37 +03:00
gdlbo 05bf888ba6 Test Amoled Theme Styles + Updated R.java 2022-04-22 17:03:41 +03:00
gdlbo a2a53e8215 Updated Libs 2022-04-22 16:08:23 +03:00
gdlbo e6290b8aba Updated gradle + amoled inject 2022-04-22 14:07:56 +03:00
gdlbo aa5f6e7cbe Improved dark theme 2022-04-16 18:41:11 +03:00
gdlbo 054b447236 Fixed bot keyboard 2022-04-16 17:58:12 +03:00
gdlbo 52db475469 Custom load of msg 2022-04-16 01:56:12 +03:00
gdlbo 6282800fdb Fixed all issues with msgs 2022-04-16 00:23:32 +03:00
gdlbo 20517fdf51 Fixed video downloading 2022-04-16 00:01:21 +03:00
gdlbo 40400817c1 Downgraded msg api 2022-04-15 23:41:18 +03:00
gdlbo 834e454eb2 Zaborona fix 2022-04-15 23:40:06 +03:00
gdlbo 2747c9efc8 Improved dark theme 2022-04-12 17:34:09 +03:00
gdlbo c2cc782ee3 Fixed vk refl 2022-04-12 16:37:52 +03:00
gdlbo d414e79b6b Fixed msg loading null 2022-04-12 15:07:35 +03:00
gdlbo 9e0f95ed94 Fixed strange twitter crash 2022-04-12 13:49:11 +03:00
gdlbo 167da56a0b Fixed strange statusbar coloring 2022-04-12 13:29:32 +03:00
gdlbo af213869c8 Improved white theme 2022-04-12 13:17:45 +03:00
gdlbo 39b9e42f62 Fixed crash 2022-04-11 22:56:11 +03:00
gdlbo 1aa07afabc haha bruh dev->beta
1989 китай ничего не было
2022-04-11 22:38:51 +03:00
gdlbo 84d7d0bef6 Fixed bugs 2022-04-11 22:22:13 +03:00
gdlbo fbb7f2320e Improved dark theme 2022-04-11 21:46:32 +03:00
gdlbo 506f5c7597 deleted confidential logging 2022-04-11 21:12:00 +03:00
gdlbo 38d3a40d7a Update MultiAccountAdapter.java 2022-04-11 21:10:16 +03:00
gdlbo 44cb073de8 fixes + disabled debuggable mode 2022-04-11 21:07:08 +03:00
Vologhat 8a680e5429 update multi account 2022-04-11 20:57:52 +03:00
gdlbo 16dbdc5ec3 Improved dark theme 2022-04-11 16:27:10 +03:00
gdlbo 4cece4566c Improved coloring 2022-04-11 14:24:50 +03:00
gdlbo 2340cbbbb2 Msg fixes 2022-04-11 01:23:12 +03:00
gdlbo e00feded18 Fixes 2022-04-11 01:01:08 +03:00
gdlbo d7c5e88c00 FIxed authactiviry cringe accent color on sdk31+ 2022-04-11 00:54:21 +03:00
gdlbo 7462d739f4 Improved dark theme 2022-04-11 00:29:28 +03:00
gdlbo f1bbdeac45 Improved dark theme 2022-04-11 00:13:21 +03:00
gdlbo 178bdbf988 Deleted new video feature 2022-04-10 23:54:53 +03:00
gdlbo 82a5d40a10 Improved dark theme 2022-04-10 23:47:51 +03:00
gdlbo c888bd3f3c Improved dark theme 2022-04-10 23:10:12 +03:00
gdlbo 53f45f49c3 Improved dark theme 2022-04-10 22:52:05 +03:00
gdlbo 3c108c7520 multiaccount fixes 2022-04-10 22:00:21 +03:00
Vologhat 11bce261ae multi account refactoring 2022-04-10 20:17:47 +03:00
gdlbo 5f8204c48e Improved dark theme 2022-04-10 19:53:51 +03:00
gdlbo f6043ed413 Update Prefs.java 2022-04-10 19:02:23 +03:00
Vologhat 5ab22cd5c4 fix notifications updater 2022-04-10 16:08:08 +03:00
gdlbo ee20e461d2 Update InterfaceFragment.java 2022-04-09 20:40:06 +03:00
gdlbo 9fa6513d4b Improved dark theme 2022-04-09 19:28:53 +03:00
gdlbo e86c7b190a Improved dark theme 2022-04-09 18:26:11 +03:00
gdlbo 0b2c5dc578 Improved dark theme 2022-04-09 17:57:00 +03:00
gdlbo 55b569c057 Improved dark theme 2022-04-09 16:50:33 +03:00
gdlbo 02d6fb3b14 Improved dark theme 2022-04-08 21:58:08 +03:00
gdlbo 8ed21f8fa9 Improved dark theme 2022-04-08 21:29:00 +03:00
gdlbo 6c1a12b345 Improved dark theme 2022-04-08 20:45:47 +03:00
gdlbo 05f4462195 Improved dark theme 2022-04-08 15:03:42 +03:00
gdlbo e4bb903391 Improved dark theme 2022-04-08 13:46:35 +03:00
gdlbo 5028fe9d7f Improved dark theme 2022-04-08 13:31:09 +03:00
gdlbo 9bca7a3598 Improved dark theme 2022-04-08 13:14:44 +03:00
gdlbo dddb414c7d Fixed crash crop 2022-04-08 11:57:33 +03:00
gdlbo ad67bed400 Fixed installing app 2022-04-07 20:43:15 +03:00
gdlbo 5ffa2fac40 Fixed win script 2022-04-07 20:30:26 +03:00
gdlbo cca1bc6607 Fixed win script 2022-04-07 20:28:38 +03:00
gdlbo 55f49d7d3a Updated keystore 2022-04-07 19:47:02 +03:00
gdlbo a24f8bef3d Fixed versioning null 2022-04-07 19:44:20 +03:00
gdlbo c41a0de1af Updated scripts 2022-04-07 19:15:46 +03:00
gdlbo d4c8b795fa Updated README.md 2022-04-07 19:10:11 +03:00
gdlbo 47c219ad8c Fixed podcasts colors 2022-04-07 18:55:01 +03:00
gdlbo 59b34ddf3e Added old icons feature 2022-04-07 18:40:04 +03:00
gdlbo 01f1e3993c Improved external video link parser 2022-04-07 18:23:57 +03:00
gdlbo c21cadad1d Disabled monet coloring for dockbar 2022-04-07 17:38:52 +03:00
gdlbo 307d15ff24 Fixed some color issues 2022-04-07 17:32:52 +03:00
gdlbo 5edebee51e Fixed some color issues 2022-04-07 16:44:55 +03:00
gdlbo 3d936f4abd Fixed miniplayer text color issues 2022-04-07 15:30:39 +03:00
gdlbo e725c05e9c Fixed settings stickers color issues 2022-04-07 15:26:02 +03:00
gdlbo 5a8a33cebc Fixed docs text color issue 2022-04-07 15:01:51 +03:00
gdlbo da28a5feca Fixed a11+ issue 2022-04-07 14:55:34 +03:00
gdlbo a058e84ddb Fixed crash 2022-04-07 13:54:15 +03:00
gdlbo 49ccf080ad Fixed crash on sdk31+ 2022-04-07 13:17:17 +03:00
gdlbo 176a9a89b6 Deleted libverify button 2022-04-04 20:45:48 +03:00
gdlbo 40f907300d Fixed crash 2022-04-04 20:34:38 +03:00
gdlbo 0219b14844 Update LinkProcessor1.smali 2022-04-03 18:30:23 +03:00
Vologhat 08acebd2c6 fix recycler view wrong resizing 2022-04-03 17:09:59 +03:00
gdlbo 9bf0109c0d Update DockBarManager.java 2022-04-03 14:15:12 +03:00
gdlbo 1f31ddd8d0 Update DockBarManager.java 2022-04-03 14:05:08 +03:00
gdlbo 9540fb68dc Update StandartFilter.txt 2022-04-03 13:44:58 +03:00
gdlbo 432975f409 Fixed crash
https://github.com/vtosters/lite/issues/103
2022-04-03 13:17:55 +03:00
Vologhat 8b2acc764a add saving and resetting 2022-04-03 12:26:17 +03:00
Vologhat f79ca38ef4 fix dockbar tabs limit 2022-04-03 12:23:42 +03:00
gdlbo 446cc973d6 Fixes fixes fixes 2022-04-02 23:53:54 +03:00
gdlbo a847d6a3eb Fixes dockbar 2022-04-02 23:41:20 +03:00
gdlbo 67f9d9bbd9 Fixes 2022-04-02 22:30:51 +03:00
gdlbo 2d49885572 Merge branch 'master' of https://github.com/vtosters/lite 2022-04-02 22:05:09 +03:00
gdlbo a940674c6f Some improvements 2022-04-02 22:04:16 +03:00
Vologhat 7bbb073552 add outline icons 2022-04-02 22:00:04 +03:00
Vologhat 105d784b4a add inability to unselect menu tab 2022-04-02 22:00:04 +03:00
Vologhat 23eb0fef69 add possibility to choice alternative fragments for "news" and "discover" 2022-04-02 22:00:04 +03:00
Vologhat b9afb74a01 level down min tabs count 2022-04-02 22:00:04 +03:00
Vologhat edfb68c946 fix color palette and tab items 2022-04-02 22:00:04 +03:00
Vologhat 66897e8e93 fix dockbar 2022-04-02 22:00:04 +03:00
Vologhat 3b754b79e7 add dockbar injector 2022-04-02 22:00:03 +03:00
Vologhat 11fa834af7 migration to android support due to androidx instability 2022-04-02 22:00:03 +03:00
Vologhat d319c97430 докбар 2022-04-02 22:00:03 +03:00
gdlbo 744f9866da Updated README.md 2022-04-02 22:00:02 +03:00
gdlbo 251746a57e Updated README.md https://github.com/vtosters/lite/pull/89 2022-04-02 22:00:02 +03:00
Daniil Isakov b1bbfe7e1b Grammar check, a bit of rephrasing 2022-04-02 22:00:02 +03:00
gdlbo 7a911de8ca updated multiacc 2022-04-02 22:00:02 +03:00
gdlbo e5398cc1be updated adblock filter 2022-04-02 22:00:02 +03:00
gdlbo b87f28f8bf updated resources + R.java again 2022-04-02 22:00:02 +03:00
gdlbo 5f8e16eb5d translation fixes 2022-04-02 22:00:02 +03:00
gdlbo f83e1cc0b7 Updated R.java + some fixes 2022-04-02 22:00:02 +03:00
gdlbo 447bc94100 Added multi account feature 2022-04-02 22:00:02 +03:00
gdlbo 17cdb9c87b Improved adblock 2022-04-02 22:00:02 +03:00
gdlbo 2cb35c17b2 Improvements of multiacc + added migrating from old type of accounts to new type 2022-04-02 22:00:01 +03:00
gdlbo 0e0ca2a504 Improvements of multiacc + deleted old accs xD 2022-04-02 22:00:01 +03:00
gdlbo dca61fcd16 Improvements of multiacc 2022-04-02 22:00:01 +03:00
gdlbo d0a198c6ad Multiaccount impl test 2022-04-02 22:00:01 +03:00
gdlbo c1211123dd fixed picker crash 2022-04-02 22:00:01 +03:00
gdlbo 3a9d4ffa12 Updated README.md 2022-04-01 19:05:57 +03:00
gdlbo 5855dc2abf Updated README.md https://github.com/vtosters/lite/pull/89 2022-04-01 18:56:52 +03:00
gdlbo ed3e6314d1 Merge pull request #84 from oplexz/patch-1 2022-04-01 09:53:41 +03:00
Daniil Isakov b83a36d41a Grammar check, a bit of rephrasing 2022-04-01 09:40:25 +03:00
gdlbo 1beaf3f436 updated multiacc 2022-04-01 08:43:52 +03:00
gdlbo 0bb9145288 updated adblock filter 2022-04-01 08:39:04 +03:00
gdlbo ba76a1f0fd updated resources + R.java again 2022-03-31 21:09:42 +03:00
gdlbo f0732ae3c3 translation fixes 2022-03-31 20:41:10 +03:00
gdlbo 8a761382f0 Updated R.java + some fixes 2022-03-31 20:19:28 +03:00
gdlbo 481e3ba041 Added multi account feature 2022-03-31 19:22:37 +03:00
gdlbo 4615a174f0 Improved adblock 2022-03-30 18:03:52 +03:00
gdlbo 18de5e9289 Improvements of multiacc + added migrating from old type of accounts to new type 2022-03-30 17:16:23 +03:00
gdlbo 122c6d8b80 Improvements of multiacc + deleted old accs xD 2022-03-30 17:01:50 +03:00
gdlbo d00f93ee94 Improvements of multiacc 2022-03-30 14:51:50 +03:00
gdlbo bbc2a8132a Multiaccount impl test 2022-03-30 00:22:49 +03:00
gdlbo f4e61583fa fixed picker crash 2022-03-28 10:13:12 +03:00
gdlbo 9ee72b2c6b Update SettingsListFragment$b.smali 2022-03-27 21:12:45 +03:00
Vologhat dd2c17e4ac fix script for windows 2022-03-27 20:31:31 +03:00
gdlbo e87dde9c6a fixed compilation on windows 2022-03-27 18:04:47 +03:00
gdlbo 83a5723dee fixed compilation on windows 2022-03-27 18:01:02 +03:00
aliveoutside 3e6b968400 fix icons in dropdown menu in newsfeed 2022-03-27 12:19:11 +03:00
aliveoutside c3f9dffd50 fix text color in dropdown menu in newsfeed 2022-03-27 12:19:11 +03:00
gdlbo 972504202e fixed proxy issue 2022-03-27 11:50:14 +03:00
gdlbo d26b0bed38 fixed video catalog issue 2022-03-27 11:40:32 +03:00
gdlbo e5b886ed21 fixed pic edit crash 2022-03-27 11:35:30 +03:00
gdlbo d9e6082f1a Fix doc upload crash 2022-03-26 23:38:53 +03:00
gdlbo 67001e272b Fix graffiti crash 2022-03-26 23:15:47 +03:00
gdlbo 5534aa3fda Updated shit Filter 2022-03-26 22:57:17 +03:00
gdlbo 55e73d3469 Updated ADBlock Filter + new test filter 2022-03-26 22:41:07 +03:00
gdlbo 8a7b03676d Updated ADBlock Filter 2022-03-26 21:37:17 +03:00
gdlbo 0adafcb433 Now some new features are enabled by default 2022-03-26 21:32:24 +03:00
gdlbo 356eb98b94 updated README.md 2022-03-26 21:25:43 +03:00
gdlbo 86b5af9210 fixed some color issues 2022-03-26 21:16:15 +03:00
gdlbo c4a5406330 fixed some crashes and other problems 2022-03-26 21:07:27 +03:00
gdlbo 857e6ff86b fixed some issues 2022-03-26 20:38:38 +03:00
aliveoutside 5bec30d2c7 fix animated stickers 2022-03-26 19:59:29 +03:00
gdlbo c7a226999f fixed some issues 2022-03-26 17:43:49 +03:00
gdlbo 1bea6d3f3e updated prefs 2022-03-26 17:03:58 +03:00
gdlbo ffa70d5684 updated README.md 2022-03-26 16:52:38 +03:00
gdlbo 8de9ea9c1b updated debug 2022-03-26 16:44:55 +03:00
gdlbo f8c4393074 updated README.md 2022-03-26 16:28:15 +03:00
gdlbo 79cada7128 Improvements + updated R.java and README.md 2022-03-26 16:27:02 +03:00
aliveoutside 4c40edd00c fix pinned dialogs loading 2022-03-26 16:17:37 +03:00
aliveoutside 20ab276cef fix "popular" videos 2022-03-26 15:44:24 +03:00
gdlbo 689f2d3876 libverify preference 2022-03-25 19:43:52 +03:00
gdlbo c403deb38d fix fix 2fa auth........ 2022-03-25 19:15:28 +03:00
gdlbo d90ecbb8d1 fixed versioning on macos/linux 2022-03-25 18:45:11 +03:00
gdlbo ae16a513ed fixed versioning on macos/linux 2022-03-25 18:30:26 +03:00
gdlbo 7339a28d92 updated README.md 2022-03-25 17:51:00 +03:00
gdlbo d544a633cc added bug report button 2022-03-25 17:28:14 +03:00
gdlbo a6b78dca57 fixed ssfs domain 2022-03-25 16:52:36 +03:00
gdlbo 7dd78345f1 fix Jetifier 2022-03-25 16:45:49 +03:00
gdlbo 0a67c2a910 fixed 2fa, fixed some issues with proxy, deleted xtrafrancyz proxy, fixed compiling, some other fixes 2022-03-25 16:42:25 +03:00
aliveoutside 4e9475a6eb update framework and add apksigner.jar 2022-03-25 16:16:13 +03:00
aliveoutside b5a6a8d027 fix crash when music download button clicked 2022-03-24 22:31:43 +03:00
aliveoutside 1e1869718f fix serverside features 2022-03-24 22:30:52 +03:00
aliveoutside ee69e29153 Update README.md 2022-03-24 19:59:23 +03:00
aliveoutside 137ba631af Update README.md 2022-03-24 19:41:44 +03:00
aliveoutside aa972fa5b3 init 2022-03-24 19:37:43 +03:00
2372 changed files with 146944 additions and 25710 deletions
-4
View File
@@ -4,15 +4,11 @@ on:
push:
branches:
- '*'
paths-ignore:
- '**.md'
pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- '**.md'
workflow_dispatch:
+1 -1
View File
@@ -28,4 +28,4 @@ smali2/build/resources.zip
/smali/VTLite.apk.cache/
smali/build/resources.zip
smali/assets/version.properties
*.keystore
smali/assets/version.properties
+57 -147
View File
@@ -1,189 +1,99 @@
<p align="center">
<a href="https://vtosters.app/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.discordapp.com/attachments/918864618116481029/1002916719595106344/VT_Fill_Logo_Dark.svg">
<img src="https://cdn.discordapp.com/attachments/918864618116481029/1002916719381201036/VT_Fill_Logo_Light.svg">
</picture>
</a>
<br>
<br>
<a href="https://t.me/s/vtosters">
<img src="https://img.shields.io/badge/-Telegram-blue?style=for-the-badge&logo=telegram&color=2AABEE"/>
</a>
<a href="https://vk.com/vtosters_official">
<img src="https://img.shields.io/badge/-VK-blue?style=for-the-badge&logo=vk&color=0077FF"/>
</a>
<a href="https://discord.gg/j9CAt3uYXj">
<img src="https://img.shields.io/badge/-Discord-blue?style=for-the-badge&logo=discord&color=5865F2&logoColor=FFFFFF"/>
</a>
<br>
<a href="https://github.com/vtosters/lite/issues">
<img src="https://img.shields.io/github/issues/vtosters/lite?style=flat-square"/>
</a>
<a href="https://github.com/vtosters/lite/network/members">
<img src="https://img.shields.io/github/forks/vtosters/lite?style=flat-square"/>
</a>
<a href="https://github.com/vtosters/lite/stargazers">
<img src="https://img.shields.io/github/stars/vtosters/lite?style=flat-square"/>
</a>
</p>
# VTosters Lite
**ВТостерс Lite** — это модифицированный клиент официального ВКонтакте, основанный на версии **5.56.1 (4838)**
ВТостерс Lite - это модифицированный клиент (декомпиляция) официального ВКонтакте основанный на версии 5.56.1 (4838)
* Вы можете предложить свои идеи/сообщить о багах в [Issues](https://github.com/vtosters/lite/issues)
О найденных багах сообщать в [issues](https://github.com/vtosters/lite/issues), просьба не плодить дубликаты, воспользуйтесь поиском перед созданием нового issue
* Скачивать самые актуальные версии можно с [Actions](https://github.com/vtosters/lite/actions)
<sup><sub>(могут содержать баги)</sub></sup>
Скачивать самые актуальные версии можно с [Actions](https://github.com/vtosters/lite/actions)
* Стабильные сборки находятся в [Releases](https://github.com/vtosters/lite/releases)
Стабильные сборки находятся в [Releases](https://github.com/vtosters/lite/releases)
Зеркало на нашем [<img src="https://git.maki.su/assets/img/logo.svg" align="center" width="20" height="20"/> Git](https://git.maki.su/gdlbo/lite)
Зеркало на нашем [Git](https://git.maki.su/gdlbo/lite)
### Быстрая навигация
* [Функционал](#функционал)
* [Отладка приложения](#отладка-приложения)
* [Разработка](#разработка)
* [Всё необходимое для сборки и компиляции](#всё-необходимое-для-сборки-и-компиляции)
* [Необходимые зависимости](#необходимые-зависимости)
* [Linux/macOS](#linuxmacos)
* [Windows](#windows)
## Функционал
* Лента
* Блокировка рекламы в ленте
* Блокировка постов через фильтры
* Возможность отключить рекомендации от ВК
* Редактор докбара
* Редактор элементов Superapp
* Медиа контент
* Округление дат
* 1 января в 4:20
* 1 января в 4:20:00
* 1 января 2000 в 4:20:00
* Округление чисел
* Сокращение постов **(Показать полностью)**
* Результаты опросов без участия
* Интеграция с <a href="https://www.last.fm/">LAST.FM</a> (а также возможность скробблинга)
* Новый раздел музыки
* Возможность скачивать видео
* Возможность найти фотографию через поисковые системы
* Интеграция с <a href="https://vkx.app/">VK X</a>
* Сообщения
* Обои в сообщениях
* Возможность выключения кнопки записи голосовых сообщений
* Возможность скрыть блок рекомендаций в сообщениях
* Режим **VK Me**
* Возможность вернуть вкладку уведомлений
* Встроенный переводчик текста для сообщений
* Возможность выбрать язык перевода
* Автоматический перевод ваших сообщений на выбранный язык
* Альтернативный дизайн эмодзи меню
* Возможность использовать системные эмодзи
* Активность
* Возможность видеть удаленные сообщения
* Функционал, позволяющий оставаться в «оффлайне» (принудительный оффлайн/не отправлять статус онлайна и т.п.)
* Нечиталка/неписалка для ЛС/бесед/ботов/групп
* Возможность отключить информацию о том, что вы просмотрели историю/прослушали голосовое сообщение
* Возможность видеть онлайн пользователей, если у вас скрыт онлайн через VK Messenger
* Отключить уведомление о том, что вы сделали скриншот в беседе
* Отключение редиректа через away.php
* Внешний вид
* **Milkshake** тема (дизайн новых версий ВК)
* Название заголовков в докбаре
* Возможность использовать акцент для иконок
* Возможность отключить счётчики в докбаре
* Смена иконки приложения (содержит много уникальных иконок для донатеров)
* Возможность покрасить панель навигации, веб-страницы
* Telegram Стикеры
* Возможность загружать свои стикерпаки из Telegram во ВКонтакте
* Интерфейс
* Возможность отключить блок историй наверху ленты
* Возможность отключить боковую камеру в разделе «Новости»
* Возможность отключить блок «Что у вас нового?» в разделе «Новости»
* Возможность менять раздел, который запускается при запуске
* Анимации фрагментов
* Возможность отключить редизайн видеопостов
* Возможность отключить блок миниаппов/VK Pay/Superapp
* Возможность отключить сокращение названий разделов в меню
* Возможность скрыть блок рекомендаций друзей в разделе «Друзья»
* Возможность скрыть подписи в настройках
* Прокси
* Возможность использовать **HTTP/HTTPS/SOCKS** прокси, менять домены **API/OAuth/Static**
* Другое
* Очистка кеша приложения (**всё/стикеры/изображения/видео/сообщения/WebView**)
* Автоочистка кеша при достижении указанного вами значения (**100/500 MB, 1/2/5 GB**)
* Функционал для **дебага приложения/бэкап возможности/верификации VTosters**
А также:
* Галочки, которые видны только пользователям приложения **ВТостерс Lite** (подробнее тут: [vtosters.app](https://vtosters.app) ➝ Пожертвования)
* Оптимизация приложения VK (удаление ненужных библиотек, которые встроены в оригинальный VK)
И многое другое!
Зеркало на [Github](https://github.com/vtosters/lite)
## Отладка приложения
Для отладки с помощью <a href="#"><img src="https://i.imgur.com/cPvvFDP.png" align="center" width="20" height="23"/></a> Android Studio необходимо пройти в `/smali/AndroidManifest.xml` и изменить значение `android:debuggable`:
Для отладки с помощью Android Studio необходимо пройти в `/smali/AndroidManifest.xml`
```
android:debuggable="false" -> android:debuggable="true"
```
`android:debuggable="false"` ➝ `android:debuggable="true"`
Для дополнительной отладки ответов, доп логов и подмены данных для дебаг приложения необходимо включить **Режим разработчика**
```
Настройки -> О приложении -> Для разработчиков -> Режим разработчика
```
Настройки, необходимые для **отладки** вне Android Studio, находятся по этой ссылке: [vk.com/vt/debug](https://vk.com/vt/debug)
Для просмотра трафика необходимо отключить функцию **SSL Pinning**
* Для дополнительной отладки ответов и логов необходимо включить **[Режим разработчика]**
```
Настройки -> О приложении -> Для разработчиков -> SSL Pinning
```
* Для просмотра SSL-трафика необходимо **отключить** функцию **[SSL Pinning]**
Для логгирования внутренних запросов к API необходимо включить функции **Логгирование API**
* Для логгирования внутренних запросов к API необходимо включить функцию **[Логгирование API]** <sup>(работает только при использовании внутреннего логгера!)</sup>
(Работает только при использовании внутреннего логгера!)
* Для использования внутреннего логгера необходимо включить функцию **[Запись логов в файл]**
```
Настройки -> О приложении -> Для разработчиков -> Логгирование API
```
Сразу после нажатия на запись приложение начнет записывать **все ваши действия** по пути `/Download/VK/logs/com.vtosters.lite/`
Для использования внутреннего логгера необходимо включить функции **Запись логов в файл**
```
Настройки -> О приложении -> Для разработчиков -> Запись логов в файл
```
Сразу после нажатия на запись аппа начнет записывать **все действия** в файлы по пути
```
/VK/logs/com.vtosters.lite
```
При следующем открытии аппы она автоматически запакует эти файлы и отправит вам в **Документы** ВК
При следующем открытии приложения оно автоматически сохранит логи и отправит вам в [**Документы** ВК](https://vk.com/docs), откуда вы можете скачать архив логов и работать с ними.
Позже архив можно будет скачать и работать с файлами логов которые находятся в нем
## Разработка
Для понимания работы декомпилированного кода требуется использовать **Dex to Java** декомпилятор [jadx](https://github.com/skylot/jadx) или же сторонние варианты как [Fernflower](https://github.com/fesh0r/fernflower)
Для понимания декомпилированного кода требуется использовать **Dex to Java** декомпилятор [jadx](https://github.com/skylot/jadx) или же сторонние варианты как [Fernflower](https://github.com/fesh0r/fernflower)
При нахождении решения каких-либо проблем ждем вас в [Pull Requests](https://github.com/vtosters/lite/pulls)
Рекомендуется установка **Android Debug Bridge** в систему ([Гайд как это сделать](https://technastic.com/system-wide-adb-fastboot-windows-10))
* Рекомендуется установка **ADB** в систему ([гайд](https://technastic.com/system-wide-adb-fastboot-windows-10))
Для индексации декомпилированного кода в Studio используется [dex2jar](https://github.com/pxb1988/dex2jar)
* Для индексации декомпилированного кода в Studio используется [dex2jar](https://github.com/pxb1988/dex2jar)
Сгенерированные библиотеки из дексов находятся в `/app/libs`
Сгенерированные библиотеки из .dex файлов находятся в `/app/libs`
При чистой перекомпиляции .dex в .jar может сломаться некоторая индексация файлов, исправляйте ручками что попадется (К примеру какие-то функции в дексах изменены с **private** на **public**)
При чистой перекомпиляции дексов в jar может сломаться некоторая индексация файлов, исправляйте ручками что попадется (К примеру какие-то функции в дексах изменены с **private** на **public**)
Для сборки декомпилированного кода и ресурсов используется [Apktool](https://github.com/iBotPeaches/Apktool)
А при нахождении решения каких-либо проблем ждем вас в [Pull Requests](https://github.com/vtosters/lite/pulls)
### Всё необходимое для сборки и компиляции
```diff
- Не меняйте имя пакета во избежание проблем с приложением
`Не меняйте packagename во избе­жа­ние проблем с приложением`
- Некоторые функции, связанные с музыкой не будут работать в пересобранном приложении
```
`Некоторые функции связанные с музыкой не будут работать в пересобранном приложении`
* Весь декомпилированный код клиента находится в `/smali`
Весь декомпилированный код клиента находится в `/smali`
* Весь исходный код модификации находится в `/app`
Весь исходный код модификации находится в `/app`
* Все необходимые скрипты/.jar файлы для компиляции APK, его подписывании и не только находятся в `/scripts`
Все необходимые скрипты/жарники для компиляции APK, его подписывании и не только находятся в `/scripts`
### Необходимые зависимости
<a href="https://www.oracle.com/java/technologies/downloads/"><img src="https://i.imgur.com/z8ZN19a.png" align="center" width="20" height="23"/> **JDK**</a> >11 версии
Требуется установленная **Java** >11 версии
<a href="https://developer.android.com/studio"><img src="https://i.imgur.com/cPvvFDP.png" align="center" width="20" height="23"/> **Android Studio**</a>
Требуется установленная **Android Studio**
### Linux/macOS
Для сборки используется файл `./build.sh`
```
./build.sh
```
![](https://cdn.discordapp.com/attachments/762063967979175946/961657476317581393/unknown.png)
<img src="https://i.imgur.com/8BMX8lG.png" width="550" height="368"/>
### Windows
Для сборки используется файл `build.bat`
```
build.bat
```
<img src="https://i.imgur.com/iZSUKJ6.png" width="550" height="368"/>
![](https://cdn.discordapp.com/attachments/762063967979175946/961682299366309928/unknown.png)
+1 -1
View File
@@ -73,7 +73,7 @@ android {
defaultConfig {
applicationId "ru.vtosters.lite.utils.lite"
minSdkVersion 21
minSdkVersion 24
targetSdkVersion 32
versionCode 1
versionName "1.0"
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
ea0425fab4379ae5f7e9db05a22d4b7afd709560
Binary file not shown.
@@ -0,0 +1 @@
3b92d8876dd59d5afc60a53bb23b103cede6a194
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
b26e21ded459fd6a5748e46f9c0a39d5b6b7f939
@@ -5,7 +5,7 @@ package bruhcollective.itaysonlab.libvkx;
// Works only with original signature of VT
public interface ILibVkxService extends android.os.IInterface {
public interface ILibVkxService extends android.os.IInterface{
void play(java.util.List<String> audio_ids, int index, String playbackContext) throws android.os.RemoteException;
int getUserId() throws android.os.RemoteException;
@@ -24,42 +24,42 @@ public interface ILibVkxService extends android.os.IInterface {
/**
* Default implementation for ILibVkxService.
*/
class Default implements ILibVkxService {
class Default implements ILibVkxService{
// Starts playback. playbackContext can be "other" if you don't sure what it is
@Override
public void play(java.util.List<String> audio_ids, int index, String playbackContext) throws android.os.RemoteException {
public void play(java.util.List<String> audio_ids, int index, String playbackContext) throws android.os.RemoteException{
}
// A UserID. CHECK FOR THIS TO BE EQUAL BEFORE SENDING ANYTHING TO SERVICE!
@Override
public int getUserId() throws android.os.RemoteException {
public int getUserId() throws android.os.RemoteException{
return 0;
}
// Cache add/remove
@Override
public void addTrackToCache(int track_id, int owner_id, String access_key) throws android.os.RemoteException {
public void addTrackToCache(int track_id, int owner_id, String access_key) throws android.os.RemoteException{
}
@Override
public void deleteTrackFromCache(int track_id, int owner_id) throws android.os.RemoteException {
public void deleteTrackFromCache(int track_id, int owner_id) throws android.os.RemoteException{
}
@Override
public boolean isTrackCached(int track_id, int owner_id) throws android.os.RemoteException {
public boolean isTrackCached(int track_id, int owner_id) throws android.os.RemoteException{
return false;
}
// Get a list of cached tracks. The response is close to VK's original response (an audio list)
// Also, the items in the list are JSON ones.
@Override
public java.util.List<String> getCache() throws android.os.RemoteException {
public java.util.List<String> getCache() throws android.os.RemoteException{
return null;
}
@Override
public android.os.IBinder asBinder() {
public android.os.IBinder asBinder(){
return null;
}
}
@@ -69,7 +69,7 @@ public interface ILibVkxService extends android.os.IInterface {
/**
* Local-side IPC implementation stub class.
*/
abstract class Stub extends android.os.Binder implements ILibVkxService {
abstract class Stub extends android.os.Binder implements ILibVkxService{
static final int TRANSACTION_play = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
static final int TRANSACTION_getUserId = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
static final int TRANSACTION_addTrackToCache = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
@@ -81,7 +81,7 @@ public interface ILibVkxService extends android.os.IInterface {
/**
* Construct the stub at attach it to the interface.
*/
public Stub() {
public Stub(){
this.attachInterface(this, DESCRIPTOR);
}
@@ -89,7 +89,7 @@ public interface ILibVkxService extends android.os.IInterface {
* Cast an IBinder object into an bruhcollective.itaysonlab.libvkx.ILibVkxService interface,
* generating a proxy if needed.
*/
public static ILibVkxService asInterface(android.os.IBinder obj) {
public static ILibVkxService asInterface(android.os.IBinder obj){
if ((obj == null)) {
return null;
}
@@ -100,7 +100,7 @@ public interface ILibVkxService extends android.os.IInterface {
return new Proxy(obj);
}
public static boolean setDefaultImpl(ILibVkxService impl) {
public static boolean setDefaultImpl(ILibVkxService impl){
if (Proxy.sDefaultImpl == null && impl != null) {
Proxy.sDefaultImpl = impl;
return true;
@@ -108,19 +108,19 @@ public interface ILibVkxService extends android.os.IInterface {
return false;
}
public static ILibVkxService getDefaultImpl() {
public static ILibVkxService getDefaultImpl(){
return Proxy.sDefaultImpl;
}
@Override
public android.os.IBinder asBinder() {
public android.os.IBinder asBinder(){
return this;
}
@Override
public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException {
public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException{
String descriptor = DESCRIPTOR;
switch (code) {
switch(code) {
case INTERFACE_TRANSACTION: {
reply.writeString(descriptor);
return true;
@@ -190,27 +190,27 @@ public interface ILibVkxService extends android.os.IInterface {
}
}
private static class Proxy implements ILibVkxService {
private static class Proxy implements ILibVkxService{
public static ILibVkxService sDefaultImpl;
private final android.os.IBinder mRemote;
Proxy(android.os.IBinder remote) {
Proxy(android.os.IBinder remote){
mRemote = remote;
}
@Override
public android.os.IBinder asBinder() {
public android.os.IBinder asBinder(){
return mRemote;
}
// Starts playback. playbackContext can be "other" if you don't sure what it is
public String getInterfaceDescriptor() {
public String getInterfaceDescriptor(){
return DESCRIPTOR;
}
// A UserID. CHECK FOR THIS TO BE EQUAL BEFORE SENDING ANYTHING TO SERVICE!
@Override
public void play(java.util.List<String> audio_ids, int index, String playbackContext) throws android.os.RemoteException {
public void play(java.util.List<String> audio_ids, int index, String playbackContext) throws android.os.RemoteException{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
@@ -232,7 +232,7 @@ public interface ILibVkxService extends android.os.IInterface {
// Cache add/remove
@Override
public int getUserId() throws android.os.RemoteException {
public int getUserId() throws android.os.RemoteException{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
int _result;
@@ -252,7 +252,7 @@ public interface ILibVkxService extends android.os.IInterface {
}
@Override
public void addTrackToCache(int track_id, int owner_id, String access_key) throws android.os.RemoteException {
public void addTrackToCache(int track_id, int owner_id, String access_key) throws android.os.RemoteException{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
@@ -273,7 +273,7 @@ public interface ILibVkxService extends android.os.IInterface {
}
@Override
public void deleteTrackFromCache(int track_id, int owner_id) throws android.os.RemoteException {
public void deleteTrackFromCache(int track_id, int owner_id) throws android.os.RemoteException{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
@@ -295,7 +295,7 @@ public interface ILibVkxService extends android.os.IInterface {
// Also, the items in the list are JSON ones.
@Override
public boolean isTrackCached(int track_id, int owner_id) throws android.os.RemoteException {
public boolean isTrackCached(int track_id, int owner_id) throws android.os.RemoteException{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
boolean _result;
@@ -317,7 +317,7 @@ public interface ILibVkxService extends android.os.IInterface {
}
@Override
public java.util.List<String> getCache() throws android.os.RemoteException {
public java.util.List<String> getCache() throws android.os.RemoteException{
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
java.util.List<String> _result;
@@ -1,6 +1,6 @@
package bruhcollective.itaysonlab.libvkx.client;
public class ClientConstants {
public class ClientConstants{
public final static String ACTION = "bruhcollective.itaysonlab.libvkx.LIBVKX_SERVICE";
public final static String PACKAGE = "ua.itaysonlab.vkx";
}
@@ -1,9 +1,8 @@
package bruhcollective.itaysonlab.libvkx.client;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.RemoteException;
@@ -11,68 +10,64 @@ import com.vk.dto.music.MusicTrack;
import com.vk.music.common.MusicPlaybackLaunchContext;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import b.h.g.g.PackageManagerHelper;
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
public class LibVKXClient {
@SuppressLint("StaticFieldLeak")
public class LibVKXClient{
private static LibVKXClientImpl impl;
public static LibVKXClientImpl getInstance(Context context) {
public static LibVKXClientImpl getInstance(Context context){
if (impl == null) {
impl = new LibVKXClientImpl(context);
}
return impl;
}
public static LibVKXClientImpl getInstance() {
public static LibVKXClientImpl getInstance(){
LibVKXClientImpl libVKXClientImpl = impl;
return libVKXClientImpl == null ? getInstance(getGlobalContext()) : libVKXClientImpl;
return libVKXClientImpl == null ? getInstance(getContext()) : libVKXClientImpl;
}
public static boolean isVkxInstalled() {
try {
getGlobalContext().getPackageManager().getPackageInfo("ua.itaysonlab.vkx", 0);
return true;
} catch (Exception unused) {
return false;
}
} // VKX check
public static boolean isVkxInstalled(){
return PackageManagerHelper.a(ClientConstants.PACKAGE, 128) != null;
}
public static boolean isIntegrationEnabled() {
public static boolean isIntegrationEnabled(){
return getBoolValue("libvkx_integration", false) && isVkxInstalled();
}
public static boolean play(MusicTrack musicTrack, List<MusicTrack> list, MusicPlaybackLaunchContext playerRefer) {
public static boolean play(MusicTrack musicTrack, List<MusicTrack> list, MusicPlaybackLaunchContext playerRefer){
if (!isIntegrationEnabled()) {
return false;
}
LibVKXClientImpl.LibVKXAction action = iLibVkxService -> LibVKXClient.lambdaplay(list, musicTrack, iLibVkxService);
LibVKXClientImpl.LibVKXAction action = iLibVkxService -> LibVKXClient.lambdaplay(list, musicTrack, playerRefer, iLibVkxService);
return getInstance().runOnService(action);
}
public static void lambdaplay(List<MusicTrack> list, MusicTrack musicTrack, ILibVkxService iLibVkxService) {
public static void lambdaplay(List list, MusicTrack musicTrack, MusicPlaybackLaunchContext playerRefer, ILibVkxService iLibVkxService){
int indexOf = list.indexOf(musicTrack);
var ids = new ArrayList<String>();
for (var track : list) {
ids.add(asId(track));
ArrayList arrayList = new ArrayList();
Iterator it = list.iterator();
while(it.hasNext()) {
arrayList.add(asId((MusicTrack) it.next()));
}
if (indexOf == -1) {
indexOf = 0;
}
try {
iLibVkxService.play(ids, indexOf, "");
iLibVkxService.play(arrayList, indexOf, "");
} catch (RemoteException e) {
e.printStackTrace();
}
}
private static String asId(MusicTrack musicTrack) {
String str = musicTrack.e + "_" + musicTrack.d;
private static String asId(MusicTrack musicTrack){
String str = musicTrack.d + "_" + musicTrack.e;
if (musicTrack.O == null || musicTrack.O.equals("")) {
return str;
}
@@ -1,6 +1,6 @@
package bruhcollective.itaysonlab.libvkx.client;
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserId;
import static ru.vtosters.lite.utils.Globals.getUserId;
import android.content.ComponentName;
import android.content.Context;
@@ -15,7 +15,7 @@ import java.util.List;
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
public class LibVKXClientImpl {
public class LibVKXClientImpl{
private ILibVkxService serviceInstance;
private PackageManager pm;
private Context ctx;
@@ -23,15 +23,15 @@ public class LibVKXClientImpl {
private boolean isBindFailed = false;
private LibVKXClientImpl() {
private LibVKXClientImpl(){
}
public LibVKXClientImpl(Context ctx) {
public LibVKXClientImpl(Context ctx){
this.ctx = ctx;
this.pm = ctx.getPackageManager();
}
public void finish() {
public void finish(){
if (cn != null) {
ctx.unbindService(cn);
}
@@ -39,7 +39,7 @@ public class LibVKXClientImpl {
serviceInstance = null;
}
public <T> T runOnServiceSync(LibVKXActionGeneric<T> action) {
public <T> T runOnServiceSync(LibVKXActionGeneric<T> action){
if (serviceInstance != null) {
return action.run(serviceInstance);
} else {
@@ -49,7 +49,7 @@ public class LibVKXClientImpl {
// true - action is ran
// false - action is failed, should fallback to default UI/UX
public boolean runOnService(LibVKXAction action) {
public boolean runOnService(LibVKXAction action){
if (serviceInstance != null) {
try {
if (serviceInstance.getUserId() != getUserId()) return false;
@@ -64,12 +64,12 @@ public class LibVKXClientImpl {
}
}
private boolean requestServiceInit(LibVKXAction runAfterBind) {
private boolean requestServiceInit(LibVKXAction runAfterBind){
if (!verifyBindActuality()) return false;
cn = new ServiceConnection() {
cn = new ServiceConnection(){
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
public void onServiceConnected(ComponentName name, IBinder service){
serviceInstance = ILibVkxService.Stub.asInterface(service);
if (serviceInstance == null) {
// op mycopok...
@@ -85,7 +85,7 @@ public class LibVKXClientImpl {
}
@Override
public void onServiceDisconnected(ComponentName name) {
public void onServiceDisconnected(ComponentName name){
serviceInstance = null;
}
};
@@ -94,16 +94,16 @@ public class LibVKXClientImpl {
return true;
}
private boolean verifyBindActuality() {
private boolean verifyBindActuality(){
if (!checkIfAppExists()) return false; // no need
return !isBindFailed;
}
private Intent getIntent() {
private Intent getIntent(){
return new Intent(ClientConstants.ACTION).setPackage(ClientConstants.PACKAGE);
}
private boolean checkIfAppExists() {
private boolean checkIfAppExists(){
List<ResolveInfo> resolveInfos = pm.queryIntentServices(getIntent(), 0);
if (resolveInfos == null || resolveInfos.isEmpty()) return false;
@@ -114,14 +114,14 @@ public class LibVKXClientImpl {
return false;
}
public interface LibVKXAction {
public interface LibVKXAction{
void run(ILibVkxService service);
}
public interface LibVKXActionGeneric<T> {
public interface LibVKXActionGeneric<T>{
T run(ILibVkxService service);
default T defaultValue() {
default T defaultValue(){
return null;
}
}
@@ -3,35 +3,35 @@ package com.aefyr.tsg.g2;
/**
* Created by Aefyr on 19.05.2018.
*/
public abstract class CustomStickersEventsListener implements TelegramStickersService.StickersEventsListener {
public abstract class CustomStickersEventsListener implements TelegramStickersService.StickersEventsListener{
@Override
public void onPackAdded(TelegramStickersPack pack, int atIndex) {
public void onPackAdded(TelegramStickersPack pack, int atIndex){
}
@Override
public void onPackChanged(TelegramStickersPack pack, int atIndex) {
public void onPackChanged(TelegramStickersPack pack, int atIndex){
}
@Override
public void onPackRemoved(TelegramStickersPack pack, int atIndex) {
public void onPackRemoved(TelegramStickersPack pack, int atIndex){
}
@Override
public void onPackDownloadError(TelegramStickersPack pack, Exception error) {
public void onPackDownloadError(TelegramStickersPack pack, Exception error){
}
@Override
public void onActivePacksListChanged() {
public void onActivePacksListChanged(){
}
@Override
public void onInactivePacksListChanged() {
public void onInactivePacksListChanged(){
}
}
@@ -7,7 +7,7 @@ import java.io.File;
/**
* Created by Aefyr on 20.05.2018.
*/
public abstract class CustomStickersPack {
public abstract class CustomStickersPack{
public abstract File folder();
@@ -1,6 +1,6 @@
package com.aefyr.tsg.g2;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import android.app.Notification;
import android.app.NotificationChannel;
@@ -20,7 +20,7 @@ import java.util.concurrent.atomic.AtomicLong;
/**
* Created by Aefyr on 20.05.2018.
*/
public class NotificationsHelper {
public class NotificationsHelper{
private static final int NOTIFICATION_ID_BASE = 3921337;
private static final String NOTIFICATION_CHANNEL_ID = "tgss_chan_v5";
private static final int MAX_UPDATE_NOTIFICATIONS_PER_SECOND = 3;
@@ -31,7 +31,7 @@ public class NotificationsHelper {
private final AtomicLong lastNotificationTime = new AtomicLong(0);
private int currentNotificationN = 0;
public NotificationsHelper(Context c) {
public NotificationsHelper(Context c){
this.c = c;
manager = NotificationManagerCompat.from(c);
@@ -44,7 +44,7 @@ public class NotificationsHelper {
}
}
public void packStartedDownloading(TelegramStickersPack pack) {
public void packStartedDownloading(TelegramStickersPack pack){
int notificationId = NOTIFICATION_ID_BASE + currentNotificationN++;
downloadingPacksNotificationsIds.put(pack, notificationId);
@@ -56,7 +56,7 @@ public class NotificationsHelper {
manager.notify(notificationId, builder.build());
}
public void packDownloadUpdated(TelegramStickersPack pack, int downloadProgress) {
public void packDownloadUpdated(TelegramStickersPack pack, int downloadProgress){
if (System.currentTimeMillis() - lastNotificationTime.get() < MIN_TIME_BETWEEN_UPDATE_NOTIFICATIONS)
return;
@@ -73,7 +73,7 @@ public class NotificationsHelper {
manager.notify(downloadingPacksNotificationsIds.get(pack), builder.build());
}
public void packDoneDownloading(TelegramStickersPack pack, boolean success, boolean wasUpdate, @Nullable Exception e) {
public void packDoneDownloading(TelegramStickersPack pack, boolean success, boolean wasUpdate, @Nullable Exception e){
Notification.Builder builder = commonBuilder();
builder.setProgress(0, 0, false);
builder.setOngoing(false);
@@ -94,11 +94,11 @@ public class NotificationsHelper {
manager.notify(downloadingPacksNotificationsIds.remove(pack), builder.build());
}
public void removePackNotification(TelegramStickersPack pack) {
public void removePackNotification(TelegramStickersPack pack){
manager.cancel(downloadingPacksNotificationsIds.remove(pack));
}
private Notification.Builder commonBuilder() {
private Notification.Builder commonBuilder(){
var builder = new Notification.Builder(c).setPriority(Notification.PRIORITY_MAX).setSmallIcon(getIdentifier("ic_download_24", "drawable"));
if (oreo()) {
builder.setChannelId(NOTIFICATION_CHANNEL_ID);
@@ -107,7 +107,7 @@ public class NotificationsHelper {
return builder;
}
private boolean oreo() {
private boolean oreo(){
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
}
}
@@ -8,17 +8,17 @@ import java.io.File;
/**
* Created by Aefyr on 20.05.2018.
*/
class PackDeletionTask extends AsyncTask<Void, Void, Boolean> {
class PackDeletionTask extends AsyncTask<Void, Void, Boolean>{
private static final String TAG = "TGSSAnnihilator";
private final TelegramStickersPack pack;
PackDeletionTask(TelegramStickersPack pack) {
PackDeletionTask(TelegramStickersPack pack){
this.pack = pack;
}
@Override
protected Boolean doInBackground(Void... voids) {
protected Boolean doInBackground(Void... voids){
boolean success = true;
for (File f : pack.folder.listFiles()) {
@@ -31,7 +31,7 @@ class PackDeletionTask extends AsyncTask<Void, Void, Boolean> {
}
@Override
protected void onPostExecute(Boolean aBoolean) {
protected void onPostExecute(Boolean aBoolean){
Log.d(TAG, String.format("Attempted deleting pack %s, success?%s", pack.id, aBoolean));
}
}
@@ -17,7 +17,7 @@ import java.util.List;
/**
* Created by Aefyr on 18.05.2018.
*/
public class TelegramStickersPack extends CustomStickersPack {
public class TelegramStickersPack extends CustomStickersPack{
public static final int UNKNOWN = -1;
public static final int DOWNLOADED = 0;
@@ -35,12 +35,12 @@ public class TelegramStickersPack extends CustomStickersPack {
public HashMap<String, List<Integer>> emojis = new HashMap<>();
public TelegramStickersPack(String id) {
public TelegramStickersPack(String id){
this.id = id.toLowerCase();
title = id;
}
public JSONObject encodeEmojis() throws JSONException {
public JSONObject encodeEmojis() throws JSONException{
JSONObject obj = new JSONObject();
for (HashMap.Entry<String, List<Integer>> en : emojis.entrySet()) {
JSONArray arr = new JSONArray();
@@ -51,9 +51,9 @@ public class TelegramStickersPack extends CustomStickersPack {
return obj;
}
public void loadEmojis(JSONObject obj) throws JSONException {
public void loadEmojis(JSONObject obj) throws JSONException{
Iterator<String> it = obj.keys();
while (it.hasNext()) {
while(it.hasNext()) {
String key = it.next();
//emojis.put(key, obj.getInt(key));
List<Integer> list = emojis.get(key);
@@ -65,7 +65,7 @@ public class TelegramStickersPack extends CustomStickersPack {
}
}
public Bitmap getIcon(int targetMaxSideSize) {
public Bitmap getIcon(int targetMaxSideSize){
if (state != DOWNLOADED && state != UPDATING)
throw new IllegalStateException("Unable to get an icon of a pack that hasn't been downloaded yet");
@@ -74,7 +74,7 @@ public class TelegramStickersPack extends CustomStickersPack {
return getScaledBitmap(icon, targetMaxSideSize);
}
private Bitmap getScaledBitmap(File bitmapFile, int targetMaxSideSize) {
private Bitmap getScaledBitmap(File bitmapFile, int targetMaxSideSize){
BitmapFactory.Options op = new BitmapFactory.Options();
op.inJustDecodeBounds = true;
op.inPreferredConfig = Bitmap.Config.ARGB_8888;
@@ -100,46 +100,46 @@ public class TelegramStickersPack extends CustomStickersPack {
}
@Override
public boolean equals(Object obj) {
public boolean equals(Object obj){
return obj instanceof TelegramStickersPack && ((TelegramStickersPack) obj).id.equalsIgnoreCase(id);
}
@Override
public int hashCode() {
public int hashCode(){
return id.toLowerCase().hashCode();
}
@Override
public File folder() {
public File folder(){
return folder;
}
@Override
public int stickersCount() {
public int stickersCount(){
return stickersCount;
}
@Override
public String name() {
public String name(){
return title;
}
@Override
public Bitmap getIconBitmap() {
public Bitmap getIconBitmap(){
return getIcon(128);
}
@Override
public Bitmap getStickerBitmap(int index) {
public Bitmap getStickerBitmap(int index){
return BitmapFactory.decodeFile(new File(folder, String.format("%03d.png", index + 1)).getAbsolutePath());
}
@Override
public File getStickerFile(int index) {
public File getStickerFile(int index){
return new File(folder, String.format("%03d.png", index + 1));
}
public Bitmap getStickerBitmap(int index, int maxSize) {
public Bitmap getStickerBitmap(int index, int maxSize){
return getScaledBitmap(new File(folder, String.format("%03d.png", index + 1)), maxSize);
}
}
@@ -1,6 +1,6 @@
package com.aefyr.tsg.g2;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Globals.getContext;
import android.content.Context;
import android.content.Intent;
@@ -24,7 +24,7 @@ import ru.vtosters.lite.ui.fragments.tgstickers.StickersFragment;
/**
* Created by Aefyr on 19.05.2018.
*/
public class TelegramStickersService {
public class TelegramStickersService{
private static final String TAG = "TGStickersService";
private static TelegramStickersService instance;
@@ -46,7 +46,7 @@ public class TelegramStickersService {
private final NotificationsHelper notificationsHelper;
private boolean ready = false;
private TelegramStickersService(Context context) {
private TelegramStickersService(Context context){
instance = this;
this.c = context.getApplicationContext();
@@ -67,15 +67,15 @@ public class TelegramStickersService {
updatePacks(true);
}
public static TelegramStickersService getInstance(Context c) {
public static TelegramStickersService getInstance(Context c){
return instance == null ? new TelegramStickersService(c) : instance;
}
private void updatePacks(final boolean notify) {
private void updatePacks(final boolean notify){
packs.clear();
dbHelper.getAllPacks(new TelegramStickersDbHelper.PacksLoadingListener() {
dbHelper.getAllPacks(new TelegramStickersDbHelper.PacksLoadingListener(){
@Override
public void onPackLoaded(final TelegramStickersPack pack) {
public void onPackLoaded(final TelegramStickersPack pack){
runOnUiThread(() -> {
packs.add(pack);
@@ -89,7 +89,7 @@ public class TelegramStickersService {
}
@Override
public void onAllPacksLoaded(ArrayList<TelegramStickersPack> packs) {
public void onAllPacksLoaded(ArrayList<TelegramStickersPack> packs){
ready = true;
if (notify) {
@@ -98,22 +98,22 @@ public class TelegramStickersService {
}
Log.d(TAG, String.format("Packs list loaded, running %d queued tasks...", queuedTasks.size()));
while (!queuedTasks.isEmpty())
while(!queuedTasks.isEmpty())
queuedTasks.remove(0).run();
}
});
}
public void addStickersEventsListener(StickersEventsListener listener) {
public void addStickersEventsListener(StickersEventsListener listener){
listeners.add(listener);
}
public void removeStickersEventsListener(StickersEventsListener listener) {
public void removeStickersEventsListener(StickersEventsListener listener){
listeners.remove(listener);
}
private void notifyPackAdded(TelegramStickersPack pack, int atIndex) {
getGlobalContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
private void notifyPackAdded(TelegramStickersPack pack, int atIndex){
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
@@ -122,8 +122,8 @@ public class TelegramStickersService {
}
}
private void notifyPackChanged(TelegramStickersPack pack, int atIndex) {
getGlobalContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
private void notifyPackChanged(TelegramStickersPack pack, int atIndex){
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
@@ -132,8 +132,8 @@ public class TelegramStickersService {
}
}
private void notifyPackRemoved(TelegramStickersPack pack, int atIndex) {
getGlobalContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
private void notifyPackRemoved(TelegramStickersPack pack, int atIndex){
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
@@ -142,8 +142,8 @@ public class TelegramStickersService {
}
}
private void notifyPackDownloadError(TelegramStickersPack pack, Exception error) {
getGlobalContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
private void notifyPackDownloadError(TelegramStickersPack pack, Exception error){
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
@@ -152,8 +152,8 @@ public class TelegramStickersService {
}
}
private void notifyActivePacksListChanged() {
getGlobalContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
private void notifyActivePacksListChanged(){
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
@@ -162,8 +162,8 @@ public class TelegramStickersService {
}
}
private void notifyInactivePacksListChanged() {
getGlobalContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
private void notifyInactivePacksListChanged(){
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
@@ -172,27 +172,27 @@ public class TelegramStickersService {
}
}
public void setBotKey(String botKey) {
public void setBotKey(String botKey){
grabber.setBotApiKey(botKey);
}
public ArrayList<TelegramStickersPack> getPacksListReference() {
public ArrayList<TelegramStickersPack> getPacksListReference(){
return packs;
}
public ArrayList<TelegramStickersPack> getActivePacksListReference() {
public ArrayList<TelegramStickersPack> getActivePacksListReference(){
return activePacks;
}
public ArrayList<TelegramStickersPack> getInactivePacksListReference() {
public ArrayList<TelegramStickersPack> getInactivePacksListReference(){
return inactivePacks;
}
public boolean isDoneLoading() {
public boolean isDoneLoading(){
return ready;
}
public boolean requestPackDownload(final String id, File packFolder) {
public boolean requestPackDownload(final String id, File packFolder){
if (currentlyDownloading.contains(id)) {
Log.e(TAG, String.format("Got request to download pack %s which is already downloading", id));
return false;
@@ -228,9 +228,9 @@ public class TelegramStickersService {
notificationsHelper.packStartedDownloading(newPack);
grabber.enableProxy();
grabber.grabPack(id, packFolder, pack.version, new TelegramStickersGrabber.PackDownloadListener() {
grabber.grabPack(id, packFolder, pack.version, new TelegramStickersGrabber.PackDownloadListener(){
@Override
public void onPackDownloaded(TelegramStickersPackInfo packInfo, boolean newVersionFound) {
public void onPackDownloaded(TelegramStickersPackInfo packInfo, boolean newVersionFound){
runOnUiThread(() -> {
newPack.state = TelegramStickersPack.DOWNLOADED;
@@ -250,7 +250,7 @@ public class TelegramStickersService {
}
@Override
public void onPackDownloadError(final Exception e) {
public void onPackDownloadError(final Exception e){
runOnUiThread(() -> {
Log.e(TAG, "Error while downloading pack " + newPack.id);
e.printStackTrace();
@@ -271,7 +271,7 @@ public class TelegramStickersService {
}
@Override
public void onGotPackInfo(final TelegramStickersPackInfo packInfo) {
public void onGotPackInfo(final TelegramStickersPackInfo packInfo){
runOnUiThread(() -> {
newPack.title = packInfo.title;
newPack.stickersCount = packInfo.stickersCount;
@@ -283,7 +283,7 @@ public class TelegramStickersService {
}
@Override
public void onStickerDownloaded(String pack, File sticker, String boundEmoji, int stickerIndex, int downloadedStickersCount, int totalStickersCount) {
public void onStickerDownloaded(String pack, File sticker, String boundEmoji, int stickerIndex, int downloadedStickersCount, int totalStickersCount){
stickerIndex--;
List<Integer> list = newPack.emojis.get(boundEmoji);
@@ -298,7 +298,7 @@ public class TelegramStickersService {
return true;
}
public void setPackEnabled(final TelegramStickersPack pack, final boolean enabled, final boolean notify) {
public void setPackEnabled(final TelegramStickersPack pack, final boolean enabled, final boolean notify){
if (!ready) {
queuedTasks.add(() -> setPackEnabled(pack, enabled, notify));
return;
@@ -324,7 +324,7 @@ public class TelegramStickersService {
}
}
public void deletePack(final TelegramStickersPack pack) {
public void deletePack(final TelegramStickersPack pack){
if (!ready) {
queuedTasks.add(() -> deletePack(pack));
return;
@@ -350,11 +350,11 @@ public class TelegramStickersService {
new PackDeletionTask(pack).executeOnExecutor(executor);
}
private void runOnUiThread(Runnable r) {
private void runOnUiThread(Runnable r){
uiThreadHandler.post(r);
}
private void syncPack(final TelegramStickersPack pack) {
private void syncPack(final TelegramStickersPack pack){
if (!ready) {
queuedTasks.add(() -> syncPack(pack));
return;
@@ -363,7 +363,7 @@ public class TelegramStickersService {
Log.d(TAG, "Sync=" + dbHelper.syncPack(pack));
}
public void swap(TelegramStickersPack p1, TelegramStickersPack p2) {
public void swap(TelegramStickersPack p1, TelegramStickersPack p2){
int i1 = p1.index;
int i2 = p2.index;
p1.index = i2;
@@ -383,7 +383,7 @@ public class TelegramStickersService {
getPacksListReference().set(li1, p2);
}
interface StickersEventsListener {
interface StickersEventsListener{
void onPackAdded(TelegramStickersPack pack, int atIndex);
void onPackRemoved(TelegramStickersPack pack, int atIndex);
@@ -5,16 +5,16 @@ import android.provider.BaseColumns;
/**
* Created by Aefyr on 19.05.2018.
*/
public final class TelegramStickersContract {
public final class TelegramStickersContract{
public static final String SQL_CREATE_ENTRIES = String.format("CREATE TABLE %s (%s INTEGER PRIMARY KEY, %s INTEGER AUTO_INCREMENT, %s TEXT, %s TEXT, %s TEXT, %s INTEGER, %s INTEGER, %s TEXT, %s TEXT)",
StickersTableEntry.TABLE_NAME, StickersTableEntry._ID, StickersTableEntry.COLUMN_NAME_INDEX, StickersTableEntry.COLUMN_NAME_ID, StickersTableEntry.COLUMN_NAME_NAME,
StickersTableEntry.COLUMN_NAME_FOLDER, StickersTableEntry.COLUMN_NAME_STICKERS_COUNT, StickersTableEntry.COLUMN_NAME_ENABLED, StickersTableEntry.COLUMN_NAME_VERSION, StickersTableEntry.COLUMN_NAME_EMOJIS);
private TelegramStickersContract() {
private TelegramStickersContract(){
}
public static class StickersTableEntry implements BaseColumns {
public static class StickersTableEntry implements BaseColumns{
public static final String TABLE_NAME = "packs";
public static final String COLUMN_NAME_ID = "id";
@@ -20,35 +20,35 @@ import java.util.ArrayList;
/**
* Created by Aefyr on 19.05.2018.
*/
public class TelegramStickersDbHelper extends SQLiteOpenHelper {
public class TelegramStickersDbHelper extends SQLiteOpenHelper{
private static final int DB_VERSION = 2;
private static final String DB_NAME = "TelegramStickers.db";
private SQLiteDatabase writableDb;
private SQLiteDatabase readableDb;
public TelegramStickersDbHelper(Context context) {
public TelegramStickersDbHelper(Context context){
super(context, DB_NAME, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
public void onCreate(SQLiteDatabase db){
db.execSQL(TelegramStickersContract.SQL_CREATE_ENTRIES);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
if (oldVersion == 1 && newVersion == 2) {
db.execSQL(String.format("ALTER TABLE %s ADD COLUMN %s TEXT", TelegramStickersContract.StickersTableEntry.TABLE_NAME, TelegramStickersContract.StickersTableEntry.COLUMN_NAME_EMOJIS));
}
}
public void loadDatabases() {
public void loadDatabases(){
writableDb = getWritableDatabase();
readableDb = getReadableDatabase();
}
public boolean syncPack(TelegramStickersPack pack) {
public boolean syncPack(TelegramStickersPack pack){
ContentValues sqlPack = new ContentValues();
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_ID, pack.id);
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_NAME, pack.title);
@@ -77,7 +77,7 @@ public class TelegramStickersDbHelper extends SQLiteOpenHelper {
return true;
}
private int getNewIndex() {
private int getNewIndex(){
Cursor c = readableDb.rawQuery("SELECT MAX(" + TelegramStickersContract.StickersTableEntry.COLUMN_NAME_INDEX + ") FROM " + TelegramStickersContract.StickersTableEntry.TABLE_NAME, new String[0]);
c.moveToLast();
int max;
@@ -91,30 +91,30 @@ public class TelegramStickersDbHelper extends SQLiteOpenHelper {
return max + 1;
}
public boolean deletePack(TelegramStickersPack pack) {
public boolean deletePack(TelegramStickersPack pack){
return writableDb.delete(TelegramStickersContract.StickersTableEntry.TABLE_NAME, TelegramStickersContract.StickersTableEntry.COLUMN_NAME_ID + "='" + pack.id + "'", null) == 1;
}
public void getAllPacks(PacksLoadingListener listener) {
public void getAllPacks(PacksLoadingListener listener){
new PacksLoadingTask(listener).execute();
}
public interface PacksLoadingListener {
public interface PacksLoadingListener{
void onPackLoaded(TelegramStickersPack pack);
void onAllPacksLoaded(ArrayList<TelegramStickersPack> packs);
}
private class PacksLoadingTask extends AsyncTask<Void, Void, ArrayList<TelegramStickersPack>> {
private class PacksLoadingTask extends AsyncTask<Void, Void, ArrayList<TelegramStickersPack>>{
PacksLoadingListener listener;
PacksLoadingTask(PacksLoadingListener listener) {
PacksLoadingTask(PacksLoadingListener listener){
this.listener = listener;
}
@Override
protected ArrayList<TelegramStickersPack> doInBackground(Void... voids) {
protected ArrayList<TelegramStickersPack> doInBackground(Void... voids){
if (readableDb == null)
loadDatabases();
@@ -125,7 +125,7 @@ public class TelegramStickersDbHelper extends SQLiteOpenHelper {
ArrayList<TelegramStickersPack> packs = new ArrayList<>(cursor.getCount() + 8);
while (cursor.moveToNext()) {
while(cursor.moveToNext()) {
Log.d("DB", "PACK LOADED");
String id = cursor.getString(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_ID));
String name = cursor.getString(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_NAME));
@@ -160,7 +160,7 @@ public class TelegramStickersDbHelper extends SQLiteOpenHelper {
}
@Override
protected void onPostExecute(ArrayList<TelegramStickersPack> packs) {
protected void onPostExecute(ArrayList<TelegramStickersPack> packs){
listener.onAllPacksLoaded(packs);
}
}
@@ -36,7 +36,7 @@ import ru.vtosters.lite.net.NetResponse;
/**
* Created by Aefyr on 11.05.2018.
*/
public class TelegramStickersGrabber {
public class TelegramStickersGrabber{
private static final String TAG = "TSG";
public static String REAL_TG_IP = null;
public static String PROXY_IP = null;
@@ -51,7 +51,7 @@ public class TelegramStickersGrabber {
private static String GET_FILE_URL;
private static String BOT_API_BASE_FILE_URL;
static {
static{
updateURLs();
}
@@ -60,7 +60,7 @@ public class TelegramStickersGrabber {
private String botApiKey = "";
private NetClient httpClient;
public TelegramStickersGrabber(String botApiKey) {
public TelegramStickersGrabber(String botApiKey){
this.botApiKey = botApiKey;
httpClient = new NetClient.Builder().connectTimeout(5, TimeUnit.SECONDS).build();
uiThreadHandler = new Handler(Looper.getMainLooper());
@@ -73,7 +73,7 @@ public class TelegramStickersGrabber {
}
}
public static void updateURLs() {
public static void updateURLs(){
BOT_API_BASE_FILE_URL = "https://api.telegram.org/file/bot%s/%s";
@@ -82,7 +82,7 @@ public class TelegramStickersGrabber {
GET_FILE_URL = BOT_API_BASE_URL + "getFile?file_id=%s";
}
public static boolean isTelegramBlocked() {
public static boolean isTelegramBlocked(){
NetClient client = new NetClient.Builder().connectTimeout(5, TimeUnit.SECONDS).build();
try {
if (PROXY_IP != null) {
@@ -112,14 +112,14 @@ public class TelegramStickersGrabber {
return false;
}
public void resetProxy() {
public void resetProxy(){
httpClient = new NetClient.Builder().connectTimeout(5, TimeUnit.SECONDS).build();
}
public void enableProxy() {
Thread kostil = new Thread() {
public void enableProxy(){
Thread kostil = new Thread(){
@Override
public void run() {
public void run(){
try {
if (PROXY_IP != null) {
Socket socket = new Socket(PROXY_IP, PROXY_PORT);
@@ -150,41 +150,41 @@ public class TelegramStickersGrabber {
}
}
public void grabPack(String id, File packFolder, String installedVersion, final PackDownloadListener listener) {
public void grabPack(String id, File packFolder, String installedVersion, final PackDownloadListener listener){
getPackInfo(id, packFolder, installedVersion, listener);
}
public void setBotApiKey(String key) {
public void setBotApiKey(String key){
botApiKey = key;
}
public void checkKey(final KeyCheckListener listener) {
public void checkKey(final KeyCheckListener listener){
Log.d(TAG, "Checking key: " + botApiKey);
NetRequest request = new NetRequest.Builder().get().url(String.format(BOT_API_BASE_URL + "getMe", botApiKey)).build();
httpClient.newCall(request).enqueue(new NetCallback() {
httpClient.newCall(request).enqueue(new NetCallback(){
@Override
public void onFailure(NetCall call, IOException e) {
public void onFailure(NetCall call, IOException e){
e.printStackTrace();
runOnUiThread(listener::onNetError);
}
@Override
public void onResponse(NetCall call, final NetResponse response) throws IOException {
public void onResponse(NetCall call, final NetResponse response) throws IOException{
runOnUiThread(() -> listener.onKeyChecked(response.code() == 200));
}
});
}
private void getPackInfo(final String packName, final File packFolder, final String installedVersion, final PackDownloadListener listener) {
private void getPackInfo(final String packName, final File packFolder, final String installedVersion, final PackDownloadListener listener){
NetRequest packInfoRequest = new NetRequest.Builder().get().url(String.format(GET_STICKER_SET_URL, botApiKey, packName)).build();
httpClient.newCall(packInfoRequest).enqueue(new NetCallback() {
httpClient.newCall(packInfoRequest).enqueue(new NetCallback(){
@Override
public void onFailure(NetCall call, IOException e) {
public void onFailure(NetCall call, IOException e){
listener.onPackDownloadError(e);
}
@Override
public void onResponse(NetCall call, NetResponse response) throws IOException {
public void onResponse(NetCall call, NetResponse response) throws IOException{
if (!response.isSuccessful()) {
if (response.getData() != null)
listener.onPackDownloadError(new TSGException(response.getDataString() + "\nURL: " + call.request().url()));
@@ -246,7 +246,7 @@ public class TelegramStickersGrabber {
});
}
private void getPack(final StickerSet set, final File packFolder, final TelegramStickersPackInfo packInfo, final PackDownloadListener listener) {
private void getPack(final StickerSet set, final File packFolder, final TelegramStickersPackInfo packInfo, final PackDownloadListener listener){
final GoalCounter downloadedStickers = new GoalCounter(set.stickers.size(), () -> {
Log.d(TAG, String.format("Pack %s has been downloaded to %s", set.id, packFolder.getAbsolutePath()));
@@ -262,9 +262,9 @@ public class TelegramStickersGrabber {
final int stickerIndex = i + 1;
AtomicBoolean sync = new AtomicBoolean();
httpClient.newCall(fileInfoRequest).enqueue(new NetCallback() {
httpClient.newCall(fileInfoRequest).enqueue(new NetCallback(){
@Override
public void onFailure(NetCall call, IOException e) {
public void onFailure(NetCall call, IOException e){
if (deathFlag.up())
return;
@@ -275,7 +275,7 @@ public class TelegramStickersGrabber {
}
@Override
public void onResponse(NetCall call, NetResponse response) throws IOException {
public void onResponse(NetCall call, NetResponse response) throws IOException{
if (deathFlag.up())
return;
@@ -305,9 +305,9 @@ public class TelegramStickersGrabber {
NetRequest fileDownloadRequest = new NetRequest.Builder().get().url(String.format(BOT_API_BASE_FILE_URL, botApiKey, filePath)).build();
httpClient.newCall(fileDownloadRequest).enqueue(new NetCallback() {
httpClient.newCall(fileDownloadRequest).enqueue(new NetCallback(){
@Override
public void onFailure(NetCall call, IOException e) {
public void onFailure(NetCall call, IOException e){
if (deathFlag.up())
return;
@@ -318,7 +318,7 @@ public class TelegramStickersGrabber {
}
@Override
public void onResponse(NetCall call, NetResponse response) throws IOException {
public void onResponse(NetCall call, NetResponse response) throws IOException{
if (deathFlag.up())
return;
@@ -407,7 +407,7 @@ public class TelegramStickersGrabber {
}
});
while (!sync.get())
while(!sync.get())
try {
Thread.sleep(100);
} catch (InterruptedException e1) {
@@ -415,11 +415,11 @@ public class TelegramStickersGrabber {
}
}
private void runOnUiThread(Runnable r) {
private void runOnUiThread(Runnable r){
uiThreadHandler.post(r);
}
public interface PackDownloadListener {
public interface PackDownloadListener{
void onPackDownloaded(TelegramStickersPackInfo pack, boolean newVersionFound);
void onPackDownloadError(Exception e);
@@ -429,27 +429,27 @@ public class TelegramStickersGrabber {
void onStickerDownloaded(String pack, File sticker, String boundEmoji, int stickerIndex, int downloadedStickersCount, int totalStickerCount);
}
public interface KeyCheckListener {
public interface KeyCheckListener{
void onKeyChecked(boolean ok);
void onNetError();
}
public class TSGException extends Exception {
public class TSGException extends Exception{
private static final long serialVersionUID = 7866915509988422944L;
private TSGException(String message) {
private TSGException(String message){
super(message);
}
}
private class StickerSet {
private class StickerSet{
String id;
String name;
String version;
ArrayList<Sticker> stickers;
StickerSet(String id, String name, String version, ArrayList<Sticker> stickers) {
StickerSet(String id, String name, String version, ArrayList<Sticker> stickers){
this.name = name;
this.stickers = stickers;
this.id = id;
@@ -457,22 +457,22 @@ public class TelegramStickersGrabber {
}
}
private class Sticker {
private class Sticker{
String emoji;
String fileId;
Sticker(String fileId, String emoji) {
Sticker(String fileId, String emoji){
this.fileId = fileId;
this.emoji = emoji;
}
@Override
public boolean equals(Object obj) {
public boolean equals(Object obj){
return obj instanceof Sticker && ((Sticker) obj).fileId.equals(fileId);
}
@Override
public int hashCode() {
public int hashCode(){
return (17 * emoji.hashCode()) << 32 + fileId.hashCode();
}
}
@@ -3,13 +3,13 @@ package com.aefyr.tsg.g2.stickersgrabber;
/**
* Created by Aefyr on 22.05.2018.
*/
public class TelegramStickersPackInfo {
public class TelegramStickersPackInfo{
public String id;
public String title;
public String version;
public int stickersCount;
TelegramStickersPackInfo(String id, String title, int stickersCount, String version) {
TelegramStickersPackInfo(String id, String title, int stickersCount, String version){
this.id = id;
this.title = title;
this.version = version;
@@ -3,18 +3,18 @@ package com.aefyr.tsg.g2.stickersgrabber.util;
/**
* Created by Aefyr on 11.05.2018.
*/
public class Flag {
public class Flag{
private boolean up = false;
public synchronized boolean up() {
public synchronized boolean up(){
return up;
}
public synchronized void raise() {
public synchronized void raise(){
up = true;
}
public synchronized void lower() {
public synchronized void lower(){
up = false;
}
}
@@ -5,34 +5,34 @@ import android.util.Log;
/**
* Created by Aefyr on 11.05.2018.
*/
public class GoalCounter {
public class GoalCounter{
private final int goal;
private final OnGoalReachListener listener;
private int i = 0;
public GoalCounter(int goal, OnGoalReachListener listener) {
public GoalCounter(int goal, OnGoalReachListener listener){
this.goal = goal;
this.listener = listener;
}
public synchronized void increase() {
public synchronized void increase(){
if (++i == goal)
listener.onGoalReached();
Log.d("COUNTER", "G=" + goal + ", I=" + i);
}
public synchronized void increase(int delta) {
public synchronized void increase(int delta){
if ((i += delta) == goal)
listener.onGoalReached();
}
public synchronized int value() {
public synchronized int value(){
return i;
}
public interface OnGoalReachListener {
public interface OnGoalReachListener{
void onGoalReached();
}
}
@@ -8,60 +8,60 @@ import com.arthenica.smartexception.java.Exceptions;
import java.util.Collections;
import java.util.List;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.Globals;
public class NativeLoader {
public class NativeLoader{
static final String[] FFMPEG_LIBRARIES = {"avutil", "swscale", "swresample", "avcodec", "avformat", "avfilter", "avdevice"};
private static void loadLibrary(String libraryName) {
String path = AndroidUtils.getGlobalContext().getFilesDir() + "/lib" + libraryName + ".so";
private static void loadLibrary(String libraryName){
String path = Globals.getContext().getFilesDir() + "/lib" + libraryName + ".so";
System.load(path);
}
private static List<String> loadExternalLibraries() {
private static List<String> loadExternalLibraries(){
// return Packages.getExternalLibraries();
return Collections.emptyList();
}
private static String loadNativeAbi() {
private static String loadNativeAbi(){
// return AbiDetect.getNativeAbi();
return Abi.ABI_ARMV7A_NEON.getName();
}
static String loadAbi() {
static String loadAbi(){
// return AbiDetect.getAbi();
return Abi.ABI_ARMV7A_NEON.getName();
}
static String loadPackageName() {
static String loadPackageName(){
return Packages.getPackageName();
}
static String loadVersion() {
static String loadVersion(){
return FFmpegKitConfig.getVersion();
}
static boolean loadIsLTSBuild() {
static boolean loadIsLTSBuild(){
return AbiDetect.isNativeLTSBuild();
}
static int loadLogLevel() {
static int loadLogLevel(){
return FFmpegKitConfig.getNativeLogLevel();
}
static String loadBuildDate() {
static String loadBuildDate(){
return FFmpegKitConfig.getBuildDate();
}
static void enableRedirection() {
static void enableRedirection(){
FFmpegKitConfig.enableRedirection();
}
static void loadFFmpegKitAbiDetect() {
static void loadFFmpegKitAbiDetect(){
loadLibrary("ffmpegkit_abidetect");
}
static boolean loadFFmpeg() {
static boolean loadFFmpeg(){
boolean nativeFFmpegLoaded = false;
boolean nativeFFmpegTriedAndFailed = false;
@@ -85,7 +85,7 @@ public class NativeLoader {
return nativeFFmpegTriedAndFailed;
}
static void loadFFmpegKit(boolean nativeFFmpegTriedAndFailed) {
static void loadFFmpegKit(boolean nativeFFmpegTriedAndFailed){
boolean nativeFFmpegKitLoaded = false;
if (!nativeFFmpegTriedAndFailed && "arm-v7a".equals(loadNativeAbi())) {
try {
@@ -102,7 +102,7 @@ public class NativeLoader {
}
static String getDeviceDebugInformation() {
static String getDeviceDebugInformation(){
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("brand: ");
stringBuilder.append(Build.BRAND);
@@ -43,7 +43,7 @@ import java.util.Set;
* @author Taner Sener
* @since 0.1.0
*/
public abstract class AbstractExceptions {
public abstract class AbstractExceptions{
/**
* <p>Default max depth used in methods which do not have a maxDepth argument.
@@ -90,14 +90,14 @@ public abstract class AbstractExceptions {
*
* @param packageString root package name to register
*/
public static void registerRootPackage(final String packageString) {
public static void registerRootPackage(final String packageString){
rootPackageSet.add(packageString);
}
/**
* <p>Clears previously registered root packages.
*/
public static void clearRootPackages() {
public static void clearRootPackages(){
rootPackageSet.clear();
}
@@ -106,14 +106,14 @@ public abstract class AbstractExceptions {
*
* @param packageString group package name to register
*/
public static void registerGroupPackage(final String packageString) {
public static void registerGroupPackage(final String packageString){
groupPackageSet.add(packageString);
}
/**
* <p>Clears previously registered group packages.
*/
public static void clearGroupPackages() {
public static void clearGroupPackages(){
groupPackageSet.clear();
}
@@ -123,7 +123,7 @@ public abstract class AbstractExceptions {
*
* @return current stack trace serializer implementation
*/
public static StackTraceElementSerializer getStackTraceElementSerializer() {
public static StackTraceElementSerializer getStackTraceElementSerializer(){
return stackTraceElementSerializer;
}
@@ -133,7 +133,7 @@ public abstract class AbstractExceptions {
*
* @param stackTraceElementSerializer new stack trace serializer implementation
*/
public static void setStackTraceElementSerializer(final StackTraceElementSerializer stackTraceElementSerializer) {
public static void setStackTraceElementSerializer(final StackTraceElementSerializer stackTraceElementSerializer){
AbstractExceptions.stackTraceElementSerializer = stackTraceElementSerializer;
}
@@ -143,7 +143,7 @@ public abstract class AbstractExceptions {
* @param packageString ignore package name to register
* @param ignoreCauseClasses ignore cause classes from this package too
*/
public static void registerIgnorePackage(final String packageString, final boolean ignoreCauseClasses) {
public static void registerIgnorePackage(final String packageString, final boolean ignoreCauseClasses){
ignorePackageSet.add(packageString);
if (ignoreCauseClasses) {
ignoreCausePackageSet.add(packageString);
@@ -153,7 +153,7 @@ public abstract class AbstractExceptions {
/**
* <p>Clears previously registered ignore packages.
*/
public static void clearIgnorePackages() {
public static void clearIgnorePackages(){
ignorePackageSet.clear();
ignoreCausePackageSet.clear();
}
@@ -165,7 +165,7 @@ public abstract class AbstractExceptions {
* converted to string will not include causes. If value is false causes will be appended to the stack trace of
* the main throwable.
*/
public static boolean getIgnoreAllCauses() {
public static boolean getIgnoreAllCauses(){
return ignoreAllCauses;
}
@@ -176,7 +176,7 @@ public abstract class AbstractExceptions {
* or converted to string will not include causes. If value is false causes will be appended to the stack trace of
* the main throwable.
*/
public static void setIgnoreAllCauses(final boolean ignoreAllCauses) {
public static void setIgnoreAllCauses(final boolean ignoreAllCauses){
AbstractExceptions.ignoreAllCauses = ignoreAllCauses;
}
@@ -190,7 +190,7 @@ public abstract class AbstractExceptions {
* @param throwable parent throwable
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable) {
public static String getStackTraceString(final Throwable throwable){
return getStackTraceString(throwable, false, rootPackageSet, groupPackageSet, ignorePackageSet, 0, ignoreAllCauses);
}
@@ -205,7 +205,7 @@ public abstract class AbstractExceptions {
* @param ignoreAllCauses ignore all causes in the exception chain
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final boolean ignoreAllCauses) {
public static String getStackTraceString(final Throwable throwable, final boolean ignoreAllCauses){
return getStackTraceString(throwable, false, rootPackageSet, groupPackageSet, ignorePackageSet, 0, ignoreAllCauses);
}
@@ -218,7 +218,7 @@ public abstract class AbstractExceptions {
* @param ignorePackageSet ignore packages to use for building the stack trace
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet) {
public static String getStackTraceString(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet){
return getStackTraceString(throwable, false, rootPackageSet, groupPackageSet, ignorePackageSet, 0, ignoreAllCauses);
}
@@ -232,7 +232,7 @@ public abstract class AbstractExceptions {
* @param ignoreAllCauses ignore all causes in the exception chain
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet, final boolean ignoreAllCauses) {
public static String getStackTraceString(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet, final boolean ignoreAllCauses){
return getStackTraceString(throwable, false, rootPackageSet, groupPackageSet, ignorePackageSet, 0, ignoreAllCauses);
}
@@ -243,7 +243,7 @@ public abstract class AbstractExceptions {
* @param rootPackage root package to use for building the stack trace
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final String rootPackage) {
public static String getStackTraceString(final Throwable throwable, final String rootPackage){
return getStackTraceString(throwable, false, Collections.singleton(rootPackage), new HashSet<String>(), new HashSet<String>(), 0, ignoreAllCauses);
}
@@ -255,7 +255,7 @@ public abstract class AbstractExceptions {
* @param groupPackage group package to use for building the stack trace
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final String rootPackage, final String groupPackage) {
public static String getStackTraceString(final Throwable throwable, final String rootPackage, final String groupPackage){
return getStackTraceString(throwable, false, Collections.singleton(rootPackage), Collections.singleton(groupPackage), new HashSet<String>(), 0, ignoreAllCauses);
}
@@ -266,7 +266,7 @@ public abstract class AbstractExceptions {
* @param maxDepth max depth in exception chain that will be used
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final int maxDepth) {
public static String getStackTraceString(final Throwable throwable, final int maxDepth){
return getStackTraceString(throwable, false, new HashSet<String>(), new HashSet<String>(), new HashSet<String>(), maxDepth, ignoreAllCauses);
}
@@ -278,7 +278,7 @@ public abstract class AbstractExceptions {
* @param ignoreAllCauses ignore all causes in the exception chain
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final int maxDepth, final boolean ignoreAllCauses) {
public static String getStackTraceString(final Throwable throwable, final int maxDepth, final boolean ignoreAllCauses){
return getStackTraceString(throwable, false, new HashSet<String>(), new HashSet<String>(), new HashSet<String>(), maxDepth, ignoreAllCauses);
}
@@ -294,7 +294,7 @@ public abstract class AbstractExceptions {
* @param ignoreAllCauses ignore all causes in the exception chain
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final boolean isCause, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet, final int maxDepth, final boolean ignoreAllCauses) {
public static String getStackTraceString(final Throwable throwable, final boolean isCause, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet, final int maxDepth, final boolean ignoreAllCauses){
final StringBuilder builder = new StringBuilder();
if (throwable == null) {
@@ -386,7 +386,7 @@ public abstract class AbstractExceptions {
* @param firstStackTraceElementInTheGroup first stack trace element of this group
* @return new value for the group element count
*/
public static int appendStackTraceGroupElement(final StringBuilder stringBuilder, final String currentGroupPackage, final int numberOfElementsInTheCurrentGroup, final StackTraceElement firstStackTraceElementInTheGroup) {
public static int appendStackTraceGroupElement(final StringBuilder stringBuilder, final String currentGroupPackage, final int numberOfElementsInTheCurrentGroup, final StackTraceElement firstStackTraceElementInTheGroup){
if (numberOfElementsInTheCurrentGroup > 0) {
if (stackTraceElementSerializer == null) {
throw new IllegalArgumentException("Stack trace element serializer not initialized.");
@@ -407,7 +407,7 @@ public abstract class AbstractExceptions {
* @return true if package of the given class name matches one of package names provided in <code>packageSet</code>,
* false otherwise
*/
public static boolean containsPackage(final String fullClassName, final Set<String> packageSet) {
public static boolean containsPackage(final String fullClassName, final Set<String> packageSet){
return getContainingPackage(fullClassName, packageSet) != null;
}
@@ -420,7 +420,7 @@ public abstract class AbstractExceptions {
* @return one of the package names in the <code>packageSet</code> that matches the package of the given class name
* or null if no matching package name is found in the <code>packageSet</code>
*/
public static String getContainingPackage(final String fullClassName, final Set<String> packageSet) {
public static String getContainingPackage(final String fullClassName, final Set<String> packageSet){
for (final String parentExceptionPackage : packageSet) {
if (fullClassName.startsWith(parentExceptionPackage)) {
return parentExceptionPackage;
@@ -436,7 +436,7 @@ public abstract class AbstractExceptions {
* @param throwable parent throwable
* @return a string containing all messages found in the exception chain
*/
public static String getAllMessages(final Throwable throwable) {
public static String getAllMessages(final Throwable throwable){
final StringBuilder messageBuilder = new StringBuilder();
getAllMessages(throwable, messageBuilder);
return messageBuilder.toString();
@@ -448,7 +448,7 @@ public abstract class AbstractExceptions {
* @param throwable parent throwable
* @param messageBuilder message builder
*/
public static void getAllMessages(final Throwable throwable, final StringBuilder messageBuilder) {
public static void getAllMessages(final Throwable throwable, final StringBuilder messageBuilder){
if (throwable != null) {
final String message = throwable.getMessage();
if (!isEmpty(message)) {
@@ -470,7 +470,7 @@ public abstract class AbstractExceptions {
* @param maxDepth max depth in exception chain that will be returned
* @return an array containing stack trace elements
*/
public static StackTraceElement[] getStackTrace(final Throwable throwable, final int maxDepth) {
public static StackTraceElement[] getStackTrace(final Throwable throwable, final int maxDepth){
final ArrayList<StackTraceElement> list = new ArrayList<StackTraceElement>();
if (throwable != null) {
@@ -492,7 +492,7 @@ public abstract class AbstractExceptions {
* @param ignorePackageSet ignore packages to use for building the stack trace
* @return an array containing stack trace elements
*/
public static StackTraceElement[] getStackTrace(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> ignorePackageSet) {
public static StackTraceElement[] getStackTrace(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> ignorePackageSet){
final ArrayList<StackTraceElement> list = new ArrayList<StackTraceElement>();
final ArrayList<StackTraceElement> partialList = new ArrayList<StackTraceElement>();
@@ -529,7 +529,7 @@ public abstract class AbstractExceptions {
* @return true if the given cause class is found in the exception chain of the <code>throwable</code>, false
* otherwise
*/
public static boolean containsCause(final Throwable throwable, final Class<?> causeClass) {
public static boolean containsCause(final Throwable throwable, final Class<?> causeClass){
return containsCause(throwable, causeClass, null);
}
@@ -547,7 +547,7 @@ public abstract class AbstractExceptions {
* @return true if the given cause class and cause message is found in the exception chain of the
* <code>throwable</code>, false otherwise
*/
public static boolean containsCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage) {
public static boolean containsCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage){
return (searchCause(throwable, causeClass, causeMessage, DEFAULT_MAX_DEPTH) != null);
}
@@ -557,7 +557,7 @@ public abstract class AbstractExceptions {
* @param throwable parent throwable
* @return the cause of the <code>throwable</code> found or null if <code>throwable</code> does not have a cause
*/
public static Throwable getCause(final Throwable throwable) {
public static Throwable getCause(final Throwable throwable){
return getCause(throwable, DEFAULT_MAX_DEPTH);
}
@@ -573,7 +573,7 @@ public abstract class AbstractExceptions {
* @return the cause of the <code>throwable</code> found until <code>maxDepth</code> is reached in the exception
* chain or null if <code>throwable</code> does not have a cause
*/
public static Throwable getCause(final Throwable throwable, final int maxDepth) {
public static Throwable getCause(final Throwable throwable, final int maxDepth){
if (throwable == null) {
return null;
}
@@ -601,7 +601,7 @@ public abstract class AbstractExceptions {
* @param causeClass class to search for
* @return the <code>throwable</code> found or null if no class in exception chain matches the given cause class
*/
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass) {
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass){
return searchCause(throwable, causeClass, null, DEFAULT_MAX_DEPTH);
}
@@ -618,7 +618,7 @@ public abstract class AbstractExceptions {
* @return the <code>throwable</code> found or null if no class in exception chain matches the given cause class
* and cause message
*/
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage) {
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage){
return searchCause(throwable, causeClass, causeMessage, DEFAULT_MAX_DEPTH);
}
@@ -636,7 +636,7 @@ public abstract class AbstractExceptions {
* @return the <code>throwable</code> found or null if no class in exception chain matches the given cause class
* and cause message
*/
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage, final int maxDepth) {
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage, final int maxDepth){
if (throwable == null) {
return null;
}
@@ -675,7 +675,7 @@ public abstract class AbstractExceptions {
* @param maxDepth max depth in exception chain that will be searched
* @return the <code>throwable</code> found or null if no class in exception chain matches the given cause class
*/
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final int maxDepth) {
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final int maxDepth){
if (throwable == null) {
return null;
}
@@ -702,7 +702,7 @@ public abstract class AbstractExceptions {
* @param value string to check
* @return true if given string is null or has zero length after trim(), false otherwise
*/
public static boolean isEmpty(final String value) {
public static boolean isEmpty(final String value){
if (value == null) {
return true;
}
@@ -716,7 +716,7 @@ public abstract class AbstractExceptions {
* @param className fully qualified class name
* @return name of the package
*/
public static String packageName(final String className) {
public static String packageName(final String className){
if (className == null) {
return "";
}
@@ -38,7 +38,7 @@ package com.arthenica.smartexception;
* @author Taner Sener
* @since 0.1.0
*/
public interface StackTraceElementSerializer {
public interface StackTraceElementSerializer{
/**
* <p>Converts the given <code>stackTraceElement</code> into a string.
@@ -44,13 +44,13 @@ import java.util.Set;
* @author Taner Sener
* @since 0.1.0
*/
public class Exceptions {
public class Exceptions{
static {
AbstractExceptions.setStackTraceElementSerializer(new StackTraceElementSerializer() {
static{
AbstractExceptions.setStackTraceElementSerializer(new StackTraceElementSerializer(){
@Override
public String toString(StackTraceElement stackTraceElement) {
public String toString(StackTraceElement stackTraceElement){
final StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(stackTraceElement.getClassName());
@@ -75,17 +75,17 @@ public class Exceptions {
}
@Override
public String getModuleName(StackTraceElement stackTraceElement) {
public String getModuleName(StackTraceElement stackTraceElement){
return "";
}
@Override
public String getNativeMethodDefinition() {
public String getNativeMethodDefinition(){
return "(Native Method)";
}
@Override
public String getUnknownSourceDefinition() {
public String getUnknownSourceDefinition(){
return "(Unknown Source)";
}
});
@@ -96,14 +96,14 @@ public class Exceptions {
*
* @param packageString root package name to register
*/
public static void registerRootPackage(final String packageString) {
public static void registerRootPackage(final String packageString){
AbstractExceptions.registerRootPackage(packageString);
}
/**
* <p>Clears previously registered root packages.
*/
public static void clearRootPackages() {
public static void clearRootPackages(){
AbstractExceptions.clearRootPackages();
}
@@ -112,14 +112,14 @@ public class Exceptions {
*
* @param packageString group package name to register
*/
public static void registerGroupPackage(final String packageString) {
public static void registerGroupPackage(final String packageString){
AbstractExceptions.registerGroupPackage(packageString);
}
/**
* <p>Clears previously registered group packages.
*/
public static void clearGroupPackages() {
public static void clearGroupPackages(){
AbstractExceptions.clearGroupPackages();
}
@@ -129,7 +129,7 @@ public class Exceptions {
*
* @return current stack trace serializer implementation
*/
public static StackTraceElementSerializer getStackTraceElementSerializer() {
public static StackTraceElementSerializer getStackTraceElementSerializer(){
return AbstractExceptions.getStackTraceElementSerializer();
}
@@ -139,7 +139,7 @@ public class Exceptions {
*
* @param stackTraceElementSerializer new stack trace serializer implementation
*/
public static void setStackTraceElementSerializer(final StackTraceElementSerializer stackTraceElementSerializer) {
public static void setStackTraceElementSerializer(final StackTraceElementSerializer stackTraceElementSerializer){
AbstractExceptions.setStackTraceElementSerializer(stackTraceElementSerializer);
}
@@ -149,14 +149,14 @@ public class Exceptions {
* @param packageString ignore package name to register
* @param ignoreCauseClasses ignore cause classes from this package too
*/
public static void registerIgnorePackage(final String packageString, final boolean ignoreCauseClasses) {
public static void registerIgnorePackage(final String packageString, final boolean ignoreCauseClasses){
AbstractExceptions.registerIgnorePackage(packageString, ignoreCauseClasses);
}
/**
* <p>Clears previously registered ignore packages.
*/
public static void clearIgnorePackages() {
public static void clearIgnorePackages(){
AbstractExceptions.clearIgnorePackages();
}
@@ -167,7 +167,7 @@ public class Exceptions {
* converted to string will not include causes. If value is false causes will be appended to the stack trace of
* the main throwable.
*/
public static boolean getIgnoreAllCauses() {
public static boolean getIgnoreAllCauses(){
return AbstractExceptions.getIgnoreAllCauses();
}
@@ -178,7 +178,7 @@ public class Exceptions {
* or converted to string will not include causes. If value is false causes will be appended to the stack trace of
* the main throwable.
*/
public static void setIgnoreAllCauses(final boolean ignoreAllCauses) {
public static void setIgnoreAllCauses(final boolean ignoreAllCauses){
AbstractExceptions.setIgnoreAllCauses(ignoreAllCauses);
}
@@ -192,7 +192,7 @@ public class Exceptions {
* @param throwable parent throwable
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable) {
public static String getStackTraceString(final Throwable throwable){
return AbstractExceptions.getStackTraceString(throwable);
}
@@ -207,7 +207,7 @@ public class Exceptions {
* @param ignoreAllCauses ignore all causes in the exception chain
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final boolean ignoreAllCauses) {
public static String getStackTraceString(final Throwable throwable, final boolean ignoreAllCauses){
return AbstractExceptions.getStackTraceString(throwable, ignoreAllCauses);
}
@@ -220,7 +220,7 @@ public class Exceptions {
* @param ignorePackageSet ignore packages to use for building the stack trace
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet) {
public static String getStackTraceString(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet){
return AbstractExceptions.getStackTraceString(throwable, rootPackageSet, groupPackageSet, ignorePackageSet);
}
@@ -234,7 +234,7 @@ public class Exceptions {
* @param ignoreAllCauses ignore all causes in the exception chain
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet, final boolean ignoreAllCauses) {
public static String getStackTraceString(final Throwable throwable, final Set<String> rootPackageSet, final Set<String> groupPackageSet, final Set<String> ignorePackageSet, final boolean ignoreAllCauses){
return AbstractExceptions.getStackTraceString(throwable, rootPackageSet, groupPackageSet, ignorePackageSet, ignoreAllCauses);
}
@@ -245,7 +245,7 @@ public class Exceptions {
* @param rootPackage root package to use for building the stack trace
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final String rootPackage) {
public static String getStackTraceString(final Throwable throwable, final String rootPackage){
return AbstractExceptions.getStackTraceString(throwable, rootPackage);
}
@@ -257,7 +257,7 @@ public class Exceptions {
* @param groupPackage group package to use for building the stack trace
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final String rootPackage, final String groupPackage) {
public static String getStackTraceString(final Throwable throwable, final String rootPackage, final String groupPackage){
return AbstractExceptions.getStackTraceString(throwable, rootPackage, groupPackage);
}
@@ -268,7 +268,7 @@ public class Exceptions {
* @param maxDepth max depth in exception chain that will be used
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final int maxDepth) {
public static String getStackTraceString(final Throwable throwable, final int maxDepth){
return AbstractExceptions.getStackTraceString(throwable, maxDepth);
}
@@ -280,7 +280,7 @@ public class Exceptions {
* @param ignoreAllCauses ignore all causes in the exception chain
* @return a string containing the smart stack trace for the given <code>throwable</code>
*/
public static String getStackTraceString(final Throwable throwable, final int maxDepth, final boolean ignoreAllCauses) {
public static String getStackTraceString(final Throwable throwable, final int maxDepth, final boolean ignoreAllCauses){
return AbstractExceptions.getStackTraceString(throwable, maxDepth, ignoreAllCauses);
}
@@ -290,7 +290,7 @@ public class Exceptions {
* @param throwable parent throwable
* @return a string containing all messages found in the exception chain
*/
public static String getAllMessages(final Throwable throwable) {
public static String getAllMessages(final Throwable throwable){
return AbstractExceptions.getAllMessages(throwable);
}
@@ -306,7 +306,7 @@ public class Exceptions {
* @return true if the given cause class is found in the exception chain of the <code>throwable</code>, false
* otherwise
*/
public static boolean containsCause(final Throwable throwable, final Class<?> causeClass) {
public static boolean containsCause(final Throwable throwable, final Class<?> causeClass){
return AbstractExceptions.containsCause(throwable, causeClass);
}
@@ -324,7 +324,7 @@ public class Exceptions {
* @return true if the given cause class and cause message is found in the exception chain of the
* <code>throwable</code>, false otherwise
*/
public static boolean containsCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage) {
public static boolean containsCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage){
return AbstractExceptions.containsCause(throwable, causeClass, causeMessage);
}
@@ -334,7 +334,7 @@ public class Exceptions {
* @param throwable parent throwable
* @return the cause of the <code>throwable</code> found or null if <code>throwable</code> does not have a cause
*/
public static Throwable getCause(final Throwable throwable) {
public static Throwable getCause(final Throwable throwable){
return AbstractExceptions.getCause(throwable);
}
@@ -350,7 +350,7 @@ public class Exceptions {
* @return the cause of the <code>throwable</code> found until <code>maxDepth</code> is reached in the exception
* chain or null if <code>throwable</code> does not have a cause
*/
public static Throwable getCause(final Throwable throwable, final int maxDepth) {
public static Throwable getCause(final Throwable throwable, final int maxDepth){
return AbstractExceptions.getCause(throwable, maxDepth);
}
@@ -365,7 +365,7 @@ public class Exceptions {
* @param causeClass class to search for
* @return the <code>throwable</code> found or null if no class in exception chain matches the given cause class
*/
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass) {
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass){
return AbstractExceptions.searchCause(throwable, causeClass);
}
@@ -382,7 +382,7 @@ public class Exceptions {
* @return the <code>throwable</code> found or null if no class in exception chain matches the given cause class
* and cause message
*/
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage) {
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage){
return AbstractExceptions.searchCause(throwable, causeClass, causeMessage);
}
@@ -400,7 +400,7 @@ public class Exceptions {
* @return the <code>throwable</code> found or null if no class in exception chain matches the given cause class
* and cause message
*/
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage, final int maxDepth) {
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final String causeMessage, final int maxDepth){
return AbstractExceptions.searchCause(throwable, causeClass, causeMessage, maxDepth);
}
@@ -416,7 +416,7 @@ public class Exceptions {
* @param maxDepth max depth in exception chain that will be searched
* @return the <code>throwable</code> found or null if no class in exception chain matches the given cause class
*/
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final int maxDepth) {
public static Throwable searchCause(final Throwable throwable, final Class<?> causeClass, final int maxDepth){
return AbstractExceptions.searchCause(throwable, causeClass, maxDepth);
}
@@ -1,35 +0,0 @@
package com.vk.api.gifts;
import android.content.Context;
import com.vk.api.base.ApiRequest;
import com.vk.dto.gift.CatalogedGift;
import org.json.JSONException;
import org.json.JSONObject;
public class GiftGetByStickerId extends ApiRequest<GiftGetByStickerId.a> {
public static class a {
public final int a;
public final CatalogedGift b;
public a(int i, CatalogedGift catalogedGift) {
this.a = i;
this.b = catalogedGift;
}
}
public GiftGetByStickerId(Context context, int i) {
super("execute.getGiftByStickerId");
b("sticker_id", i);
c("no_inapp", "0");
b("force_payment", 1);
}
@Override // com.vk.api.sdk.o.VKRequest
public GiftGetByStickerId.a a(JSONObject jSONObject) throws JSONException {
JSONObject jSONObject2 = jSONObject.getJSONObject("response");
return new a(jSONObject2.optInt("balance"),
new CatalogedGift(jSONObject2.getJSONObject("gift")));
}
}
@@ -1,51 +0,0 @@
package com.vk.core.ui;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
public class VKLayoutInflater extends LayoutInflater {
private final static String[] DEFAULT_PACKAGES = {
"android.widget.", "android.webkit.", "android.app."
};
public VKLayoutInflater(LayoutInflater original, Context context) {
super(original, context);
}
@Override
public LayoutInflater cloneInContext(Context newContext) {
return new VKLayoutInflater(this, newContext);
}
public final View createView(View parent, String name, Context context, AttributeSet attrs) {
if (!name.startsWith("android.")) {
try {
return onCreateView(parent, name, attrs);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
try {
return createView(name, null, attrs);
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
}
return null;
}
@Override
protected View onCreateView(String name, AttributeSet attrs) throws ClassNotFoundException {
for (var defPackage : DEFAULT_PACKAGES) {
try {
View view = createView(name, defPackage, attrs);
if (view != null) return view;
} catch (ClassCastException | ClassNotFoundException ignored) {
}
}
return super.onCreateView(name, attrs);
}
}
@@ -1,119 +0,0 @@
package com.vk.core.ui;
import android.content.Context;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import android.view.InflateException;
import android.view.LayoutInflater;
import android.view.View;
import android.webkit.WebView;
import android.widget.CheckBox;
import android.widget.RadioButton;
import android.widget.Switch;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.appcompat.widget.SwitchCompat;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vk.core.util.OsUtil;
import com.vk.core.view.NavigationSpinner;
import com.vk.core.view.TextViewColorStateListAndAlphaSupportPreV23;
import com.vk.core.view.VKAppBarLayout;
public class VKUILayoutFactory implements LayoutInflater.Factory2 {
private final static int[] FONT_ATTR = { android.R.attr.font };
private AppCompatDelegate mDelegate;
private VKLayoutInflater mInflater;
public VKUILayoutFactory(AppCompatDelegate delegate, VKLayoutInflater inflater) {
mDelegate = delegate;
mInflater = inflater;
}
private void setTypeface(TextView textView, Context context, AttributeSet attrs) {
TypedArray ta = context.obtainStyledAttributes(attrs, FONT_ATTR, android.R.attr.textViewStyle, 0);
if (ta == null) return;
Font font = Font.Companion.a(ta.getString(0));
if (font != null && Build.VERSION.SDK_INT < font.a())
textView.setTypeface(font.c());
ta.recycle();
}
@Nullable
@Override
public View onCreateView(@Nullable View parent, @NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
View view = null;
try {
if (!(parent instanceof NavigationSpinner) && !OsUtil.b())
view = new TextViewColorStateListAndAlphaSupportPreV23(context, attrs, 0);
else if (mDelegate != null)
view = mDelegate.createView(parent, name, context, attrs);
else if (mInflater != null)
view = mInflater.createView(parent, name, context, attrs);
} catch (Throwable unused) {
throw new InflateException(
"parent=" + parent.getClass().getName()
+ ":" + getResourceIdName(view)
+ ", view=" + name
+ ":" + getResourceIdName(context, attrs));
}
if (view == null &&
("com.google.android.material.appbar.AppBarLayout".equals(name)
|| "android.support.design.widget.AppBarLayout".equals(name)))
view = new VKAppBarLayout(context, attrs);
if (view != null) {
if (!(view.getTag() instanceof String)) {
if (view instanceof TextView) {
setTypeface((TextView) view, context, attrs);
if (view instanceof CheckBox)
VKThemeHelper.k.a((CheckBox) view);
else if (view instanceof RadioButton)
VKThemeHelper.k.a((RadioButton) view);
else if (view instanceof SwitchCompat)
VKThemeHelper.k.a((SwitchCompat) view);
else if (view instanceof Switch)
VKThemeHelper.k.a((Switch) view);
} else if (view instanceof WebView) {
VKThemeHelper.a((WebView) view);
}
VKThemeHelper.k.a(view, attrs);
}
}
return view;
}
private String getResourceIdName(View view) {
try {
if (view != null) {
if (view.getId() != -1)
return view.getResources().getResourceName(view.getId());
return "NO_ID";
}
return "null";
} catch (Throwable unused) {
return "FAILED_TO_GET_ID";
}
}
private String getResourceIdName(Context context, AttributeSet attrs) {
TypedArray ta = context.obtainStyledAttributes(attrs, new int[] { android.R.attr.id });
int resId = ta.getResourceId(0, -1);
ta.recycle();
return resId != -1
? context.getResources().getResourceName(resId)
: "NO_ID";
}
@Nullable
@Override
public View onCreateView(@NonNull String name, @NonNull Context context, @NonNull AttributeSet attrs) {
return onCreateView(null, name, context, attrs);
}
}
@@ -1,37 +0,0 @@
package com.vk.im.ui.components.common;
public enum DialogAction {
OPEN_USER_PROFILE,
OPEN_GROUP_PROFILE,
CHAT_SETTINGS,
SEARCH,
ADD_CHAT_MEMBER,
CREATE_SHORTCUT,
PINNED_MSG_HIDE,
PINNED_MSG_SHOW,
PINNED_MSG_DETACH,
SHOW_ATTACHES,
NOTIFICATIONS_ON,
NOTIFICATIONS_OFF,
GROUP_RECEIVE_MSGS_ENABLE,
GROUP_RECEIVE_MSGS_DISABLE,
GROUP_RECEIVE_NOTIFY_DISABLE,
CHANNEL_INVITE_LINK,
CLEAR_HISTORY,
CLEAR_HISTORY_AND_LEAVE,
LEAVE,
LEAVE_CHANNEL,
RETURN,
RETURN_TO_CHANNEL,
MARK_AS_READ,
AUDIO_BTN_AUDIO_CALL,
AUDIO_BTN_VIDEO_CALL,
VIDEO_BTN_VIDEO_CALL,
VIDEO_BTN_AUDIO_CALL,
DNR_ON,
DNR_OFF,
DNT_ON,
DNT_OFF,
pinmsg,
unpinmsg,
}
@@ -1,148 +0,0 @@
package com.vk.im.ui.components.common;
import com.vk.core.extensions.CollectionExt;
import com.vk.core.network.TimeProvider;
import com.vk.im.engine.ImConfig;
import com.vk.im.engine.models.MemberType;
import com.vk.im.engine.models.Profile;
import com.vk.im.engine.models.ProfilesSimpleInfo;
import com.vk.im.engine.models.dialogs.ChatSettings;
import com.vk.im.engine.models.dialogs.Dialog;
import com.vk.im.engine.models.groups.Group;
import com.vk.im.engine.utils.DialogPermissionHelper;
import com.vk.im.ui.p.ImBridge7;
import java.util.ArrayList;
import java.util.List;
import ru.vtosters.lite.dnr.DNRInjector;
public final class DialogActionsHelper {
public static final DialogActionsHelper a = new DialogActionsHelper();
public final List<DialogAction> a(ImConfig imConfig, Dialog dialog, ProfilesSimpleInfo profilesSimpleInfo) {
if (dialog != null && profilesSimpleInfo != null) {
long b2 = TimeProvider.f.b();
ChatSettings z1 = dialog.z1();
boolean z = false;
boolean I1 = z1 != null && z1.I1();
ArrayList<DialogAction> arrayList = new ArrayList<>();
DNRInjector.inject(dialog, arrayList);
arrayList.add(DialogAction.SEARCH);
if (dialog.S1()) {
arrayList.add(DialogAction.SHOW_ATTACHES);
}
if (!I1 && !dialog.W1()) {
arrayList.add(DialogAction.CLEAR_HISTORY);
}
if (I1) {
arrayList.add(DialogAction.CHANNEL_INVITE_LINK);
}
if (dialog.K1() != null) {
CollectionExt.a(arrayList, DialogAction.PINNED_MSG_DETACH, !I1);
CollectionExt.a(arrayList, DialogAction.PINNED_MSG_SHOW, !dialog.L1());
CollectionExt.a(arrayList, DialogAction.PINNED_MSG_HIDE, dialog.L1());
}
if (dialog.a(MemberType.USER)) {
arrayList.add(DialogAction.OPEN_USER_PROFILE);
}
if (dialog.a(MemberType.GROUP)) {
arrayList.add(DialogAction.OPEN_GROUP_PROFILE);
Group group = profilesSimpleInfo.w1().get(dialog.I1());
if (group != null) {
if (group.v1()) {
arrayList.add(DialogAction.GROUP_RECEIVE_MSGS_DISABLE);
} else {
CollectionExt.a(arrayList, DialogAction.GROUP_RECEIVE_NOTIFY_DISABLE, group.w1());
CollectionExt.a(arrayList, DialogAction.GROUP_RECEIVE_MSGS_ENABLE, !group.w1());
}
}
}
if (dialog.W1()) {
DialogAction dialogAction = DialogAction.ADD_CHAT_MEMBER;
ChatSettings z12 = dialog.z1();
if (z12 != null) {
z = z12.y1();
}
CollectionExt.a(arrayList, dialogAction, z);
CollectionExt.a(arrayList, DialogAction.CHAT_SETTINGS, DialogPermissionHelper.a.a(dialog));
}
CollectionExt.a(arrayList, DialogAction.NOTIFICATIONS_ON, !dialog.b(b2));
CollectionExt.a(arrayList, DialogAction.NOTIFICATIONS_OFF, dialog.b(b2));
return arrayList;
}
return new ArrayList<>();
}
public final List<DialogAction> a(Dialog dialog, ProfilesSimpleInfo profilesSimpleInfo) {
long b2 = TimeProvider.f.b();
Profile profile = profilesSimpleInfo.get(dialog.getId());
if (!(profile instanceof Group)) {
profile = null;
}
Group group = (Group) profile;
ChatSettings z1 = dialog.z1();
ArrayList<DialogAction> arrayList = new ArrayList<>();
DNRInjector.inject(dialog, arrayList);
// if (dialog.hasUnread()) {
arrayList.add(DialogAction.MARK_AS_READ);
// }
if (!dialog.W1()) {
arrayList.add(DialogAction.CREATE_SHORTCUT);
arrayList.add(DialogAction.CLEAR_HISTORY);
CollectionExt.a(arrayList, DialogAction.NOTIFICATIONS_OFF, dialog.b(b2));
CollectionExt.a(arrayList, DialogAction.NOTIFICATIONS_ON, !dialog.b(b2));
}
if (dialog.a(MemberType.GROUP) && group != null) {
if (group.v1()) {
arrayList.add(DialogAction.GROUP_RECEIVE_MSGS_DISABLE);
} else {
CollectionExt.a(arrayList, DialogAction.GROUP_RECEIVE_NOTIFY_DISABLE, group.w1());
CollectionExt.a(arrayList, DialogAction.GROUP_RECEIVE_MSGS_ENABLE, !group.w1());
}
}
if (dialog.W1() && z1 != null) {
if (!z1.L1()) {
arrayList.add(DialogAction.CREATE_SHORTCUT);
CollectionExt.a(arrayList, DialogAction.NOTIFICATIONS_OFF, dialog.b(b2));
CollectionExt.a(arrayList, DialogAction.NOTIFICATIONS_ON, !dialog.b(b2));
}
CollectionExt.a(arrayList, DialogAction.CLEAR_HISTORY, z1.L1());
if (z1.I1()) {
CollectionExt.a(arrayList, DialogAction.LEAVE_CHANNEL, !z1.L1());
CollectionExt.a(arrayList, DialogAction.RETURN_TO_CHANNEL, z1.L1());
} else {
CollectionExt.a(arrayList, DialogAction.RETURN, z1.L1());
CollectionExt.a(arrayList, DialogAction.LEAVE, !z1.L1());
CollectionExt.a(arrayList, DialogAction.CLEAR_HISTORY_AND_LEAVE, !z1.L1());
}
}
return arrayList;
}
public final boolean a(Dialog dialog) {
if (dialog.V1() || !dialog.y1()) {
return false;
}
return !dialog.U1() || !ImBridge7.a().a();
}
}
@@ -1,15 +0,0 @@
package com.vk.im.ui.components.common;
public enum MsgAction {
RETRY,
REPLY,
FORWARD,
COPY,
EDIT,
DELETE,
SPAM,
PIN,
UNPIN,
TRANSLATE,
READTO
}
@@ -1,43 +0,0 @@
package com.vk.im.ui.components.common;
import com.vk.core.extensions.CollectionExt;
import com.vk.im.engine.ImConfig;
import com.vk.im.engine.ImEngine;
import com.vk.im.engine.models.dialogs.Dialog;
import com.vk.im.engine.models.messages.Msg;
import com.vk.im.engine.utils.MsgPermissionHelper;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public final class MsgActionHelper {
public static final MsgActionHelper a = new MsgActionHelper();
public final List<MsgAction> a(ImEngine imEngine, Dialog dialog, Collection<? extends Msg> collection) {
return a(imEngine != null ? imEngine.g() : null, dialog, collection);
}
public final List<MsgAction> a(ImConfig imConfig, Dialog dialog, Collection<? extends Msg> collection) {
if (imConfig != null && dialog != null && collection != null) {
MsgPermissionHelper.a aVar = new MsgPermissionHelper.a(imConfig, dialog, collection);
ArrayList<MsgAction> arrayList = new ArrayList<>();
CollectionExt.a(arrayList, MsgAction.RETRY, MsgPermissionHelper.b.g(aVar));
CollectionExt.a(arrayList, MsgAction.REPLY, MsgPermissionHelper.b.f(aVar));
CollectionExt.a(arrayList, MsgAction.FORWARD, MsgPermissionHelper.b.d(aVar));
CollectionExt.a(arrayList, MsgAction.COPY, MsgPermissionHelper.b.a(aVar));
CollectionExt.a(arrayList, MsgAction.EDIT, MsgPermissionHelper.b.c(aVar));
CollectionExt.a(arrayList, MsgAction.DELETE, MsgPermissionHelper.b.b(aVar));
CollectionExt.a(arrayList, MsgAction.SPAM, MsgPermissionHelper.b.h(aVar));
CollectionExt.a(arrayList, MsgAction.PIN, MsgPermissionHelper.b.e(aVar));
CollectionExt.a(arrayList, MsgAction.UNPIN, MsgPermissionHelper.b.i(aVar));
CollectionExt.a(arrayList, MsgAction.TRANSLATE, true);
CollectionExt.a(arrayList, MsgAction.READTO, true);
return arrayList;
}
return new ArrayList<>();
}
}
+21 -21
View File
@@ -1,7 +1,7 @@
package com.vtosters.lite;
public class R {
public static final class anim {
public class R{
public static final class anim{
public static final int abc_fade_in = 0x7f010000;
public static final int abc_fade_out = 0x7f010001;
public static final int abc_grow_fade_in_from_bottom = 0x7f010002;
@@ -75,7 +75,7 @@ public class R {
public static final int vkme_exit_noop = 0x7f010046;
}
public static final class animator {
public static final class animator{
public static final int design_appbar_state_list_animator = 0x7f020000;
public static final int design_fab_hide_motion_spec = 0x7f020001;
public static final int design_fab_show_motion_spec = 0x7f020002;
@@ -88,7 +88,7 @@ public class R {
public static final int mtrl_fab_transformation_sheet_expand_spec = 0x7f020009;
}
public static final class array {
public static final class array{
public static final int ad_report_reasons = 0x7f030000;
public static final int ad_report_reasons_api = 0x7f030001;
public static final int address_will_be_opened = 0x7f030002;
@@ -180,7 +180,7 @@ public class R {
public static final int when_day_of_week = 0x7f030058;
}
public static final class attr {
public static final class attr{
public static final int BMSB_error_text_color = 0x7f040000;
public static final int BuyMusicSubscriptionButtonStyle = 0x7f040001;
public static final int PIAlphaNormal = 0x7f040002;
@@ -2091,7 +2091,7 @@ public class R {
public static final int zOrderOnTop = 0x7f040773;
}
public static final class bool {
public static final class bool{
public static final int abc_action_bar_embed_tabs = 0x7f050000;
public static final int abc_allow_stacked_button_bar = 0x7f050001;
public static final int abc_config_actionMenuItemAllCaps = 0x7f050002;
@@ -2110,7 +2110,7 @@ public class R {
public static final int vk_is_tablet = 0x7f05000f;
}
public static final class color {
public static final class color{
public static final int abc_background_cache_hint_selector_material_dark = 0x7f060000;
public static final int abc_background_cache_hint_selector_material_light = 0x7f060001;
public static final int abc_btn_colored_borderless_text_material = 0x7f060002;
@@ -2918,7 +2918,7 @@ public class R {
public static final int abc_color_highlight_material = 0x7f060004;
}
public static final class dimen {
public static final class dimen{
public static final int _post_side_padding = 0x7f070000;
public static final int abc_action_bar_content_inset_material = 0x7f070001;
public static final int abc_action_bar_content_inset_with_nav = 0x7f070002;
@@ -3783,7 +3783,7 @@ public class R {
public static final int camera_target_text_size = 0x7f070074;
}
public static final class drawable {
public static final class drawable{
public static final int $$notification_receive_28_60fps__1__0 = 0x7f080000;
public static final int $$notification_receive_28_60fps__1__1 = 0x7f080001;
public static final int $$notification_receive_28_60fps__1__2 = 0x7f080002;
@@ -6801,7 +6801,7 @@ public class R {
public static final int promo_qr_2 = 0x7f0809cf;
}
public static final class font {
public static final class font{
public static final int fortun_af_led7seg_3 = 0x7f090000;
public static final int roboto_black = 0x7f090001;
public static final int roboto_black_italic = 0x7f090002;
@@ -6824,7 +6824,7 @@ public class R {
public static final int vk_tt_commons_demi_bold = 0x7f090013;
}
public static final class id {
public static final class id{
public static final int ALT = 0x7f0a0000;
public static final int CIRCLE = 0x7f0a0001;
public static final int CTRL = 0x7f0a0002;
@@ -10931,7 +10931,7 @@ public class R {
public static final int choose_btn = 0x7f0a1007;
}
public static final class integer {
public static final class integer{
public static final int abc_config_activityDefaultDur = 0x7f0b0000;
public static final int abc_config_activityShortDur = 0x7f0b0001;
public static final int angle_rtl_180 = 0x7f0b0002;
@@ -10980,14 +10980,14 @@ public class R {
public static final int s2dip = 0x7f0b0028;
}
public static final class interpolator {
public static final class interpolator{
public static final int mtrl_fast_out_linear_in = 0x7f0c0000;
public static final int mtrl_fast_out_slow_in = 0x7f0c0001;
public static final int mtrl_linear = 0x7f0c0002;
public static final int mtrl_linear_out_slow_in = 0x7f0c0003;
}
public static final class layout {
public static final class layout{
public static final int ab_done_right = 0x7f0d0000;
public static final int abc_action_bar_title_item = 0x7f0d0001;
public static final int abc_action_bar_up_container = 0x7f0d0002;
@@ -12749,7 +12749,7 @@ public class R {
public static final int tgs_entry = 0x7f0d06de;
}
public static final class menu {
public static final class menu{
public static final int add = 0x7f0e0000;
public static final int attach_item = 0x7f0e0001;
public static final int audio = 0x7f0e0002;
@@ -12824,7 +12824,7 @@ public class R {
public static final int vkim_photo_viewer = 0x7f0e0047;
}
public static final class mipmap {
public static final class mipmap{
public static final int adaptive_launcher_background = 0x7f0f0000;
public static final int adaptive_launcher_foreground = 0x7f0f0001;
public static final int ic_launcher_round = 0x7f0f0002;
@@ -12840,7 +12840,7 @@ public class R {
public static final int ic_skip_previous_alpha_40_28 = 0x7f0f000b;
}
public static final class plurals {
public static final class plurals{
public static final int accessibility_comments = 0x7f100000;
public static final int accessibility_likes = 0x7f100001;
public static final int accessibility_reposts = 0x7f100002;
@@ -13113,7 +13113,7 @@ public class R {
public static final int x_stickers = 0x7f10010d;
}
public static final class raw {
public static final class raw{
public static final int amu_ballon_gx_prefix = 0x7f110000;
public static final int amu_basic_folder = 0x7f110001;
public static final int amu_basic_placemark = 0x7f110002;
@@ -13153,7 +13153,7 @@ public class R {
public static final int vklogo = 0x7f110024;
}
public static final class string {
public static final class string{
public static final int abc_action_bar_home_description = 0x7f120000;
public static final int abc_action_bar_up_description = 0x7f120001;
public static final int abc_action_menu_overflow_description = 0x7f120002;
@@ -18525,7 +18525,7 @@ public class R {
public static final int your_gender = 0x7f1214f8;
}
public static final class style {
public static final class style{
public static final int ActionBarGrayTheme = 0x7f130000;
public static final int ActionBarProgress = 0x7f130001;
public static final int ActionBarSpinner = 0x7f130002;
@@ -19662,7 +19662,7 @@ public class R {
public static final int Base_V28_Theme_AppCompat_Light = 0x7f1300a3;
}
public static final class xml {
public static final class xml{
public static final int account_preferences = 0x7f150000;
public static final int authenticator = 0x7f150001;
public static final int contacts_custom_type = 0x7f150002;
@@ -1,334 +0,0 @@
package com.vtosters.lite.ui.bottomnavigation;
import static ru.vtosters.lite.utils.ThemesUtils.getCSTDock;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.view.menu.MenuItemImpl;
import androidx.appcompat.view.menu.MenuView;
import androidx.core.content.ContextCompat;
import androidx.core.graphics.drawable.DrawableCompat;
import androidx.core.view.ViewCompat;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vtosters.lite.R;
import me.grishka.appkit.utils.V;
public class BottomNavigationItemView extends FrameLayout implements MenuView.ItemView {
private final TextView mSmallLabel;
private final TextView mLargeLabel;
private final View mCounterContainer;
private final TextView mCounter;
private final View mDot;
private int mItemPos;
private MenuItemImpl mItemData;
private ColorStateList mColorStateList;
private final int mMargin;
private final float mSmallScale;
private boolean mShiftingModeEnabled;
private boolean mIconsModeEnabled;
private boolean mStaticModeEnabled;
private final ImageView mIcon;
private final ImageView mActionIcon;
public BottomNavigationItemView(@NonNull Context context) {
this(context, null);
}
public BottomNavigationItemView(@NonNull Context context, AttributeSet attrs) {
this(context, attrs, 0);
}
public BottomNavigationItemView(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
this.mItemPos = -1;
this.mMargin = getResources().getDimensionPixelSize(R.dimen.design_bottom_navigation_margin);
this.mSmallScale = 10.0f;
float mLargeScale = 10.0f;
LayoutInflater.from(context).inflate(R.layout.design_bottom_navigation_item, this, true);
this.setBackgroundResource(R.drawable.design_bottom_navigation_item_background);
this.mIcon = this.findViewById(R.id.icon);
this.mIcon.getLayoutParams().width = V.a(28.0F);
this.mIcon.getLayoutParams().height = V.a(28.0F);
var colorStateList = getCSTDock();
this.mSmallLabel = this.findViewById(R.id.smallLabel);
mSmallLabel.setTextColor(colorStateList);
this.mLargeLabel = this.findViewById(R.id.largeLabel);
mLargeLabel.setTextColor(colorStateList);
LayoutInflater.from(this.getContext()).inflate(R.layout.navigation_bottom_counter, this, true);
this.mCounterContainer = this.findViewById(R.id.counter_container);
this.mCounter = this.findViewById(R.id.counter);
this.mDot = this.findViewById(R.id.dot);
LayoutInflater.from(this.getContext()).inflate(R.layout.navigation_bottom_action, this, true);
this.mActionIcon = this.findViewById(R.id.action_icon);
VKThemeHelper.a(this.mActionIcon, R.attr.tabbar_active_icon, PorterDuff.Mode.MULTIPLY);
}
public void a() {
this.mActionIcon.setVisibility(GONE);
}
public void b() {
this.mActionIcon.setVisibility(VISIBLE);
}
@SuppressLint("RestrictedApi")
public MenuItemImpl getItemData() {
return this.mItemData;
}
public int getItemPosition() {
return this.mItemPos;
}
@SuppressLint("RestrictedApi")
public void initialize(MenuItemImpl impl, int i) {
this.mItemData = impl;
this.setCheckable(impl.isCheckable());
this.setChecked(impl.isChecked());
this.setEnabled(impl.isEnabled());
this.setIcon(impl.getIcon());
this.setTitle(impl.getTitle());
this.setId(impl.getItemId());
this.setContentDescription(impl.getTitle());
}
@SuppressLint("RestrictedApi")
public int[] onCreateDrawableState(int extraSpace) {
int[] baseState = super.onCreateDrawableState(extraSpace + 1);
if (this.mItemData != null && this.mItemData.isCheckable() && this.mItemData.isChecked()) {
FrameLayout.mergeDrawableStates(baseState, new int[]{android.R.attr.state_checked});
}
return baseState;
}
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
super.onLayout(changed, left, top, right, bottom);
if (/*this.mShiftingModeEnabled &&*/ this.mCounterContainer.getVisibility() != GONE) {
left = this.mCounterContainer.getMeasuredWidth() / 2
+ V.a(4.0F)
+ Math.min(this.getMeasuredWidth() / 2
- this.mCounterContainer.getWidth()
- V.a(4.0F), 0);
this.mCounterContainer.layout(this.mCounterContainer.getLeft() + left,
this.mCounterContainer.getTop(),
this.mCounterContainer.getRight() + left,
this.mCounterContainer.getBottom());
}
}
@SuppressLint("RestrictedApi")
public boolean prefersCondensedTitle() {
return false;
}
@SuppressLint("RestrictedApi")
public void setCheckable(boolean var1) {
this.refreshDrawableState();
}
@SuppressLint("RestrictedApi")
public void setChecked(boolean checked) {
this.mItemData.setChecked(checked);
ViewCompat.setPivotX(mLargeLabel, mLargeLabel.getWidth() / 2);
ViewCompat.setPivotY(mLargeLabel, mLargeLabel.getBaseline());
ViewCompat.setPivotX(mSmallLabel, mSmallLabel.getWidth() / 2);
ViewCompat.setPivotY(mSmallLabel, mSmallLabel.getBaseline());
if (this.mIconsModeEnabled) {
var iconParams = (LayoutParams) this.mIcon.getLayoutParams();
iconParams.gravity = Gravity.CENTER;
iconParams.topMargin = 0;
iconParams.bottomMargin = 0;
this.mIcon.setLayoutParams(iconParams);
var counterContainerParams = (LayoutParams) this.mCounterContainer.getLayoutParams();
counterContainerParams.gravity = Gravity.CENTER;
counterContainerParams.topMargin = this.mMargin + V.a(1.5F);
counterContainerParams.bottomMargin = this.mMargin + V.a(1.5F);
this.mCounterContainer.setLayoutParams(counterContainerParams);
this.mCounterContainer.setTranslationY((float) (-V.a(5.5F)));
this.mLargeLabel.setVisibility(GONE);
this.mSmallLabel.setVisibility(GONE);
} else {
if (mShiftingModeEnabled) {
if (checked) {
var iconParams = (LayoutParams) this.mIcon.getLayoutParams();
iconParams.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
iconParams.topMargin = this.mMargin;
this.mIcon.setLayoutParams(iconParams);
var counterContainerParams = (LayoutParams) this.mCounterContainer.getLayoutParams();
counterContainerParams.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
counterContainerParams.topMargin = this.mMargin + V.a(1.5F);
counterContainerParams.bottomMargin = this.mMargin + V.a(1.5F);
this.mCounterContainer.setLayoutParams(counterContainerParams);
this.mCounterContainer.setTranslationY(-V.a(5.5F));
this.mLargeLabel.setVisibility(VISIBLE);
ViewCompat.setScaleX(this.mLargeLabel, 1.0F);
ViewCompat.setScaleY(this.mLargeLabel, 1.0F);
} else {
var iconParams = (LayoutParams) this.mIcon.getLayoutParams();
iconParams.gravity = Gravity.CENTER;
iconParams.topMargin = this.mMargin;
this.mIcon.setLayoutParams(iconParams);
var counterContainerParams = (LayoutParams) this.mCounterContainer.getLayoutParams();
counterContainerParams.gravity = Gravity.CENTER;
counterContainerParams.topMargin = this.mMargin + V.a(1.5F);
counterContainerParams.bottomMargin = this.mMargin + V.a(1.5F);
this.mCounterContainer.setLayoutParams(counterContainerParams);
this.mCounterContainer.setTranslationY((float) (-V.a(5.5F)));
this.mLargeLabel.setVisibility(INVISIBLE);
ViewCompat.setScaleX(this.mLargeLabel, 0.5F);
ViewCompat.setScaleY(this.mLargeLabel, 0.5F);
}
mSmallLabel.setVisibility(INVISIBLE);
} else {
// ViewCompat.setScaleX(mLargeLabel, !mStaticModeEnabled && !checked ? mLargeScale : 1.0f);
// ViewCompat.setScaleY(mLargeLabel, !mStaticModeEnabled && !checked ? mLargeScale : 1.0f);
ViewCompat.setScaleX(mSmallLabel, !mStaticModeEnabled && checked ? mSmallScale : 1.0f);
ViewCompat.setScaleY(mSmallLabel, !mStaticModeEnabled && checked ? mSmallScale : 1.0f);
// make mLargeLabel and mSmallLabel are bold
mLargeLabel.setTypeface(null, Typeface.BOLD);
mSmallLabel.setTypeface(null, Typeface.BOLD);
// make mLargeLabel and mSmallLabel text size is 10sp
mLargeLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10);
mSmallLabel.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10);
mLargeLabel.setVisibility(/*checked ? VISIBLE :*/ INVISIBLE);
mSmallLabel.setVisibility(VISIBLE);//checked ? INVISIBLE : VISIBLE);
var iconParams = (LayoutParams) this.mIcon.getLayoutParams();
iconParams.gravity = Gravity.CENTER;
iconParams.topMargin = 0;
iconParams.bottomMargin = V.a(6);
this.mIcon.setLayoutParams(iconParams);
var counterContainerParams = (LayoutParams) this.mCounterContainer.getLayoutParams();
counterContainerParams.gravity = Gravity.CENTER;
counterContainerParams.topMargin = 0;
counterContainerParams.bottomMargin = V.a(8);
this.mCounterContainer.setLayoutParams(counterContainerParams);
this.mCounterContainer.setTranslationY(-V.a(5.5F));
}
}
this.refreshDrawableState();
}
public void setCounterText(@Nullable CharSequence text) {
this.mCounter.setText(text);
if (text == null) {
this.mCounterContainer.setVisibility(GONE);
} else if (TextUtils.isEmpty(text)) {
this.mCounterContainer.setVisibility(VISIBLE);
this.mCounter.setVisibility(GONE);
this.mDot.setVisibility(VISIBLE);
} else {
this.mCounterContainer.setVisibility(VISIBLE);
this.mCounter.setVisibility(VISIBLE);
this.mDot.setVisibility(mItemPos);
}
}
public void setEnabled(boolean b) {
super.setEnabled(b);
this.mSmallLabel.setEnabled(b);
this.mLargeLabel.setEnabled(b);
this.mIcon.setEnabled(b);
}
@SuppressLint("RestrictedApi")
public void setIcon(Drawable drawable) {
if (drawable != null) {
if (drawable.getConstantState() != null)
drawable = drawable.getConstantState().newDrawable();
drawable = DrawableCompat.wrap(drawable).mutate();
DrawableCompat.setTintList(drawable, this.mColorStateList);
}
this.mIcon.setImageDrawable(drawable);
}
@SuppressLint("RestrictedApi")
public void setIconTintList(ColorStateList colorStateList) {
this.mColorStateList = colorStateList;
MenuItemImpl impl = this.mItemData;
if (impl != null) {
this.setIcon(impl.getIcon());
}
}
public void setIconsMode(boolean enabled) {
this.mIconsModeEnabled = enabled;
}
public void setStaticMode(boolean enabled) {
this.mStaticModeEnabled = enabled;
}
public void setItemBackground(int resId) {
ViewCompat.setBackground(this, resId != 0 ? ContextCompat.getDrawable(this.getContext(), resId) : null);
}
public void setItemPosition(int pos) {
this.mItemPos = pos;
}
public void setShiftingMode(boolean var1) {
this.mShiftingModeEnabled = var1;
}
@SuppressLint("RestrictedApi")
public void setShortcut(boolean b, char c) {
}
public void setTextColor(ColorStateList colorStateList) {
}
@SuppressLint("RestrictedApi")
public void setTitle(CharSequence title) {
this.mSmallLabel.setText(title);
this.mLargeLabel.setText(title);
}
@SuppressLint("RestrictedApi")
public boolean showsIcon() {
return true;
}
}
@@ -1,4 +1,4 @@
package ru.vtosters.lite.hooks;
package ru.vtosters.lite.audio.gcm;
import static ru.vtosters.lite.utils.Preferences.musicFixNew;
@@ -27,28 +27,28 @@ import java.util.concurrent.atomic.AtomicBoolean;
import javax.net.ssl.HttpsURLConnection;
public class GcmHook {
public class GCMFix{
private static final String agent = String.format("Android-GCM/1.5 (%s %s)", Build.MODEL, Build.MODEL);
public static ArrayList<String> langs = new ArrayList<>();
private static KeyPair pair;
private static int rid = 0;
static {
static{
genNewKey();
}
public static String requestTokenV2(String orig) {
if (musicFixNew()) return "null";
public static String requestTokenV2(String orig){
if (musicFixNew()) return "null"; // TODO FIX TOKENMOD v2 cyz vk shit
return orig;
}
public static String requestToken(String orig) {
if (musicFixNew()) return "{null}";
public static String requestToken(String orig){
if (musicFixNew()) return "{null}"; // TODO FIX TOKENMOD v2 cyz vk shit
if (orig.equals("")) return requestToken();
return orig;
}
public static String requestToken() {
public static String requestToken(){
String xappide;
try {
String aid = getRandomAid();
@@ -59,17 +59,17 @@ public class GcmHook {
bytes[0] = (byte) (((bytes[0] & 15) + 112) & 255);
xappide = Base64.encodeToString(bytes, 2).substring(0, 11);
} catch (NoSuchAlgorithmException e) {
xappide = "";
xappide = "";
}
AtomicBoolean wait = new AtomicBoolean(false);
StringBuilder sb = new StringBuilder();
List<String> params = new ArrayList<>();
fillParams(params, sig, pub2, xappide, Long.parseLong(aid.split(" ")[1].split(":")[0]), false);
Callback callback = str -> GcmHook.lambdaRequestToken(sb, wait, str);
Callback callback = str -> GCMFix.lambdaRequestToken(sb, wait, str);
doRequest("https://android.clients.google.com/c2dm/register3", "POST", params, aid, callback);
while (!wait.get()) {
while(!wait.get()) {
Thread.sleep(100);
}
String token = sb.toString();
@@ -81,7 +81,7 @@ public class GcmHook {
String sig2 = getSig(pub22);
params.clear();
fillParams(params, sig2, pub22, xappide, Long.parseLong(aid.split(" ")[1].split(":")[0]), true);
doRequest("https://android.clients.google.com/c2dm/register3", "POST", params, aid, GcmHook::lambda$requestToken$1);
doRequest("https://android.clients.google.com/c2dm/register3", "POST", params, aid, GCMFix::lambda$requestToken$1);
return token;
} catch (FileNotFoundException e2) {
return requestToken();
@@ -90,15 +90,15 @@ public class GcmHook {
}
}
static void lambdaRequestToken(StringBuilder sb, AtomicBoolean wait, String s) {
static void lambdaRequestToken(StringBuilder sb, AtomicBoolean wait, String s){
sb.append(s.substring(20));
wait.set(true);
}
static void lambda$requestToken$1(String str) {
static void lambda$requestToken$1(String str){
}
private static void fillParams(List<String> params, String sig, String pub2, String xappid, long androidId, boolean del) {
private static void fillParams(List<String> params, String sig, String pub2, String xappid, long androidId, boolean del){
rid++;
params.add("X-subtype=841415684880");
if (del) {
@@ -108,7 +108,7 @@ public class GcmHook {
params.add("X-X-subscription=841415684880");
}
params.add("X-X-subtype=841415684880");
params.add("X-app_ver=" + "7.26");
params.add("X-app_ver=" + "5.56.1");
params.add("X-kid=|ID|" + rid + "|");
params.add("X-osv=30");
params.add("X-sig=" + sig);
@@ -129,16 +129,16 @@ public class GcmHook {
if (!del) {
params.add("X-gmp_app_id=1:841415684880:android:632f429381141121");
}
params.add("X-app_ver_name=" + "7.26");
params.add("X-app_ver_name=" + "5.56.1");
params.add("app=com.vkontakte.android");
params.add("sender=841415684880");
params.add("device=" + androidId);
params.add("cert=48761eef50ee53afc4cc9c5f10e6bde7f8f5b82f");
params.add("app_ver=" + "12338");
params.add("app_ver=" + "4838");
params.add("gcm_ver=11949470");
}
private static String join(String chr, Iterable<String> arr) {
private static String join(String chr, Iterable<String> arr){
String str = "";
for (String s : arr) {
str = str.isEmpty() ? s : str + chr + s;
@@ -146,11 +146,11 @@ public class GcmHook {
return str;
}
private static String join(String chr, String[] arr) {
private static String join(String chr, String[] arr){
return join(chr, Arrays.asList(arr));
}
private static void doRequest(String url, String method, List<String> params, String aidlogin, Callback callback) throws IOException {
private static void doRequest(String url, String method, List<String> params, String aidlogin, Callback callback) throws IOException{
HttpsURLConnection con = (HttpsURLConnection) new URL(url).openConnection();
con.setRequestMethod(method);
con.setRequestProperty("Authorization", aidlogin);
@@ -169,13 +169,13 @@ public class GcmHook {
}
private static String getRandomAid() {
var arr1 = new String[]{"3974055026275073921", "4418584909973341826", "4585634953328772978"};
var arr2 = new String[]{"1932960345884890854", "6594645578425092292", "1792344590975444730"};
var arr1 = new String[]{ "3974055026275073921", "4418584909973341826", "4585634953328772978" };
var arr2 = new String[]{ "1932960345884890854", "6594645578425092292", "1792344590975444730" };
int r = new Random().nextInt(2);
return "AidLogin " + arr1[r] + ":" + arr2[r];
}
private static String genNewKey() {
private static String genNewKey(){
try {
KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA");
gen.initialize(2048);
@@ -186,12 +186,12 @@ public class GcmHook {
return Base64.encodeToString(pair.getPublic().getEncoded(), 0);
}
private static String getSig(String pub2) {
private static String getSig(String pub2){
try {
PrivateKey key = pair.getPrivate();
Signature sign = Signature.getInstance(key instanceof RSAPrivateKey ? "SHA256withRSA" : "SHA256withECDSA");
sign.initSign(key);
sign.update(join("\n", new String[]{"com.vkontakte.android", pub2}).getBytes(StandardCharsets.UTF_8));
sign.update(join("\n", new String[] {"com.vkontakte.android", pub2}).getBytes(StandardCharsets.UTF_8));
return Base64.encodeToString(sign.sign(), 0);
} catch (Exception e) {
e.printStackTrace();
@@ -199,7 +199,7 @@ public class GcmHook {
}
}
public interface Callback {
public interface Callback{
void doCallback(String str);
}
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.deviceinfo;
public class Device {
public class Device{
private String androidId;
private String bluetoothMac;
private String boardName;
@@ -16,81 +16,81 @@ public class Device {
private String serialId;
private String wifiMac;
public Device withSerialId(String str) {
public Device withSerialId(String str){
this.serialId = str;
return this;
}
public Device withAndroidId(String str) {
public Device withAndroidId(String str){
this.androidId = str;
return this;
}
public Device withWifiMac(String str) {
public Device withWifiMac(String str){
this.wifiMac = str;
return this;
}
public Device withBluetoothMac(String str) {
public Device withBluetoothMac(String str){
this.bluetoothMac = str;
return this;
}
public Device withSdkVersion(int i) {
public Device withSdkVersion(int i){
this.sdkVersion = i;
return this;
}
public Device withFirmwareId(String str) {
public Device withFirmwareId(String str){
this.firmwareId = str;
return this;
}
public Device withFirmwareDisplay(String str) {
public Device withFirmwareDisplay(String str){
this.firmwareDisplay = str;
return this;
}
public Device withProductName(String str) {
public Device withProductName(String str){
this.productName = str;
return this;
}
public Device withDeviceName(String str) {
public Device withDeviceName(String str){
this.deviceName = str;
return this;
}
public Device withBoardName(String str) {
public Device withBoardName(String str){
this.boardName = str;
return this;
}
public Device withCpuAbi(String str) {
public Device withCpuAbi(String str){
this.cpuAbi = str;
return this;
}
public Device withManufacturerName(String str) {
public Device withManufacturerName(String str){
this.manufacturerName = str;
return this;
}
public Device withBrandName(String str) {
public Device withBrandName(String str){
this.brandName = str;
return this;
}
public Device withModelName(String str) {
public Device withModelName(String str){
this.modelName = str;
return this;
}
public String toString() {
public String toString(){
return "Device{serialId='" + this.serialId + "', androidId='" + this.androidId + "', wifiMac='" + this.wifiMac + "', bluetoothMac='" + this.bluetoothMac + "'}";
}
public String toDeviceName() {
public String toDeviceName(){
return "Device{sdkVersion=" + this.sdkVersion + ", productName='" + this.productName + "', deviceName='" + this.deviceName + "', boardName='" + this.boardName + "', cpuAbi='" + this.cpuAbi + "', manufacturerName='" + this.manufacturerName + "', brandName='" + this.brandName + "', modelName='" + this.modelName + "'}";
}
}
@@ -18,14 +18,14 @@ import java.lang.reflect.Method;
import java.net.NetworkInterface;
import java.util.Collections;
public class DeviceInfoCollector {
public class DeviceInfoCollector{
private static final String TAG = "DeviceInfoCollector";
public Device collect(Context context) {
public Device collect(Context context){
return new Device().withSerialId(serialId()).withAndroidId(androidId(context)).withWifiMac(wifiMac(context)).withBluetoothMac(bluetoothMac(context)).withSdkVersion(Build.VERSION.SDK_INT).withFirmwareId(Build.ID).withFirmwareDisplay(Build.DISPLAY).withProductName(Build.PRODUCT).withDeviceName(Build.DEVICE).withBoardName(Build.BOARD).withCpuAbi(Build.CPU_ABI).withManufacturerName(Build.MANUFACTURER).withBrandName(Build.BRAND).withModelName(Build.MODEL);
}
private String serialId() {
private String serialId(){
String str;
try {
Class<?> cls = Class.forName("android.os.SystemProperties");
@@ -53,11 +53,11 @@ public class DeviceInfoCollector {
return null;
}
private String androidId(Context context) {
private String androidId(Context context){
return Settings.Secure.getString(context.getContentResolver(), "android_id").toLowerCase();
}
private String wifiMac(Context context) {
private String wifiMac(Context context){
String wifiMacFromManager = wifiMacFromManager(context);
if (isInvalidMac(wifiMacFromManager)) {
wifiMacFromManager = wifiMacFromNetworkInterfaces();
@@ -74,7 +74,7 @@ public class DeviceInfoCollector {
return null;
}
private String wifiMacFromManager(Context context) {
private String wifiMacFromManager(Context context){
WifiInfo connectionInfo;
try {
WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
@@ -88,7 +88,7 @@ public class DeviceInfoCollector {
}
}
private String wifiMacFromNetworkInterfaces() {
private String wifiMacFromNetworkInterfaces(){
try {
for (NetworkInterface networkInterface : Collections.list(NetworkInterface.getNetworkInterfaces())) {
if ("wlan0".equalsIgnoreCase(networkInterface.getName())) {
@@ -114,7 +114,7 @@ public class DeviceInfoCollector {
}
}
private String wifiMacFromFileSystem() {
private String wifiMacFromFileSystem(){
try {
FileReader fileReader = new FileReader("/sys/class/net/wlan0/address");
try {
@@ -137,7 +137,7 @@ public class DeviceInfoCollector {
return null;
}
private String bluetoothMac(Context context) {
private String bluetoothMac(Context context){
String bluetoothMacFromAdapter = bluetoothMacFromAdapter();
if (isInvalidMac(bluetoothMacFromAdapter)) {
bluetoothMacFromAdapter = bluetoothMacFromContentResolver(context);
@@ -151,7 +151,7 @@ public class DeviceInfoCollector {
return null;
}
private String bluetoothMacFromAdapter() {
private String bluetoothMacFromAdapter(){
try {
BluetoothAdapter defaultAdapter = BluetoothAdapter.getDefaultAdapter();
if (defaultAdapter == null) {
@@ -173,7 +173,7 @@ public class DeviceInfoCollector {
}
}
private String bluetoothMacFromContentResolver(Context context) {
private String bluetoothMacFromContentResolver(Context context){
try {
return Settings.Secure.getString(context.getContentResolver(), "bluetooth_address");
} catch (Exception e) {
@@ -182,11 +182,11 @@ public class DeviceInfoCollector {
}
}
private boolean isInvalidSerial(String str) {
private boolean isInvalidSerial(String str){
return TextUtils.isEmpty(str) || EnvironmentCompat.MEDIA_UNKNOWN.equalsIgnoreCase(str);
}
private boolean isInvalidMac(String str) {
private boolean isInvalidMac(String str){
return TextUtils.isEmpty(str) || "02:00:00:00:00:00".equalsIgnoreCase(str) || "00:00:00:00:00:00".equalsIgnoreCase(str);
}
}
@@ -4,37 +4,18 @@ import static ru.vtosters.lite.dnr.DNRModule.hookDNR;
import static ru.vtosters.lite.dnr.DNRModule.hookDNT;
import static ru.vtosters.lite.dnr.DNRModule.isDnrEnabledFor;
import static ru.vtosters.lite.dnr.DNRModule.isDntEnabledFor;
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.sendToast;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import android.content.Context;
import android.util.Log;
import com.vk.core.network.Network;
import com.vk.im.engine.models.dialogs.Dialog;
import com.vk.im.engine.models.messages.Msg;
import com.vk.im.engine.models.messages.MsgFromUser;
import com.vk.im.ui.components.common.DialogAction;
import com.vk.im.ui.components.common.MsgAction;
import com.vk.im.ui.components.viewcontrollers.popup.DelegateMsg;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import ru.vtosters.lite.ui.dialogs.Translate;
public class DNRInjector {
public static void inject(Dialog dialog, List<DialogAction> list) {
public class DNRInjector{
public static void inject(Dialog dialog, List<DialogAction> list){
int peerId = dialog.getId();
list.add(DialogAction.valueOf("pinmsg"));
list.add(DialogAction.valueOf("unpinmsg"));
if (isDnrEnabledFor(peerId)) {
list.add(DialogAction.valueOf("DNR_OFF"));
} else {
@@ -48,25 +29,17 @@ public class DNRInjector {
}
}
public static LinkedHashMap<DialogAction, Integer> injectToHashMap(LinkedHashMap<DialogAction, Integer> hashMap) {
public static LinkedHashMap<DialogAction, Integer> injectToHashMap(LinkedHashMap<DialogAction, Integer> hashMap){
hashMap.put(DialogAction.valueOf("DNR_ON"), getIdentifier("DNR_ON", "string"));
hashMap.put(DialogAction.valueOf("DNR_OFF"), getIdentifier("DNR_OFF", "string"));
hashMap.put(DialogAction.valueOf("DNT_ON"), getIdentifier("DNT_ON", "string"));
hashMap.put(DialogAction.valueOf("DNT_OFF"), getIdentifier("DNT_OFF", "string"));
hashMap.put(DialogAction.valueOf("pinmsg"), getIdentifier("pinmsg", "string"));
hashMap.put(DialogAction.valueOf("unpinmsg"), getIdentifier("unpinmsg", "string"));
return hashMap;
}
public static boolean onClick(Dialog dialog, DialogAction action) {
public static boolean onClick(Dialog dialog, DialogAction action){
var id = dialog.getId();
if (action == DialogAction.valueOf("MARK_AS_READ")) {
DNRModule.hookRead(dialog);
}
if (action == DialogAction.valueOf("DNR_ON")) {
setDnr(dialog, true);
return true;
@@ -83,80 +56,14 @@ public class DNRInjector {
return true;
}
if (action == DialogAction.valueOf("pinmsg")) {
pinnedMsg(id, true);
return true;
} else if (action == DialogAction.valueOf("unpinmsg")) {
pinnedMsg(id, false);
return true;
}
return false;
}
public static LinkedHashMap<MsgAction, DelegateMsg.a.a> injectToHashMapMsg(LinkedHashMap<MsgAction, DelegateMsg.a.a> hashMap) {
hashMap.put(MsgAction.valueOf("TRANSLATE"), new DelegateMsg.a.a(getIdentifier("translator", "string")));
hashMap.put(MsgAction.valueOf("READTO"), new DelegateMsg.a.a(getIdentifier("readto", "string")));
return hashMap;
}
public static boolean onClickMsg(Context context, MsgAction action, Msg msg) {
var text = ((MsgFromUser) msg).f();
var fullMsg = ((MsgFromUser) msg).j2(); // text + reply
var reply = fullMsg.substring(text.length() + 1);
if (action == MsgAction.valueOf("READTO")) {
DNRModule.hookReadStartMsgTo(msg);
return true;
}
var isTextExist = !text.isEmpty() && !text.equals(" ");
var isReplyExist = !reply.isEmpty() && !reply.equals(" ");
if (action == MsgAction.valueOf("TRANSLATE")) {
if (isTextExist && isReplyExist) {
Translate.showTranslatedText(context, text + "\n\nРеплай:\n" + reply);
} else if (isReplyExist) {
Translate.showTranslatedText(context, "Реплай:\n" + reply);
} else if (isTextExist) {
Translate.showTranslatedText(context, text);
} else {
sendToast("Нет текста для перевода");
}
}
return false;
}
public static void pinnedMsg(int dialogid, boolean needToBePinned) {
Thread thread = new Thread(() -> {
try {
var request = new Request.a()
.b("https://api.vk.com/method/" + (needToBePinned ? "messages.pinConversation" : "messages.unpinConversation") + "?peer_id=" + dialogid + "&access_token=" + getUserToken() + "&v=5.119")
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8"))
.a();
try {
var response = new OkHttpClient().a(request).execute().a().g();
Log.d("Pins", response);
} catch (IOException e) {
Log.e("Pins", "Error while pinning message", e);
}
} catch (Exception e) {
e.printStackTrace();
}
});
thread.start();
sendToast("Диалог успешно " + (needToBePinned ? "закреплен" : "откреплен"));
}
public static void setDnr(Dialog dialog, boolean value) {
public static void setDnr(Dialog dialog, boolean value){
hookDNR(dialog.getId());
}
public static void setDnt(Dialog dialog, boolean value) {
public static void setDnt(Dialog dialog, boolean value){
hookDNT(dialog.getId());
}
}
@@ -1,73 +1,66 @@
package ru.vtosters.lite.dnr;
import static ru.vtosters.lite.net.Request.makeRequest;
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
import static ru.vtosters.lite.utils.ProxyUtils.getApi;
import android.util.Log;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import static ru.vtosters.lite.utils.Proxy.getApi;
import com.vk.core.util.ToastUtils;
import com.vk.im.engine.commands.messages.SetUserActivityCmd;
import com.vk.im.engine.models.dialogs.Dialog;
import com.vk.im.engine.models.messages.Msg;
import java.util.List;
import ru.vtosters.lite.dnr.helpers.DoNotReadDBHelper;
import ru.vtosters.lite.dnr.helpers.DoNotTypeDBHelper;
public class DNRModule {
public class DNRModule{
public static DoNotReadDBHelper mDoNotReadDBHelper = new DoNotReadDBHelper();
public static DoNotTypeDBHelper mDoNotTypeDBHelper = new DoNotTypeDBHelper();
public static Dialog mDialog;
public static boolean isDnrEnabledFor(int id) {
public static boolean isDnrEnabledFor(int id){
var isEnabled = mDoNotReadDBHelper.isEnabledForPeerId(id);
return isEnabled;
}
public static List<Integer> getDnrEnabled() {
public static List<Integer> getDnrEnabled(){
return mDoNotReadDBHelper.get();
}
public static List<Integer> getDntEnabled() {
public static List<Integer> getDntEnabled(){
return mDoNotTypeDBHelper.get();
}
public static boolean isDntEnabledFor(int id) {
public static boolean isDntEnabledFor(int id){
var isEnabled = mDoNotTypeDBHelper.isEnabledForPeerId(id);
return isEnabled;
}
public static boolean isDntEnabledFor(SetUserActivityCmd cmd) {
public static boolean isDntEnabledFor(SetUserActivityCmd cmd){
return isDntEnabledFor(cmd.b);
}
public static boolean isDnrEnabledFor(Dialog dialog) {
public static boolean isDnrEnabledFor(Dialog dialog){
if (dialog == null) return false;
return isDnrEnabledFor(dialog.getId());
}
public static boolean isDntEnabledFor(Dialog dialog) {
public static boolean isDntEnabledFor(Dialog dialog){
if (dialog == null) return false;
return isDntEnabledFor(dialog.getId());
}
public static void hookRead(Dialog dialog) {
makeRequest("https://" + getApi() + "/method/messages.markAsRead?start_message_id=" + dialog.F1() + "&peer_id=" + dialog.getId() + "&v=5.119&access_token=" + getUserToken(), response -> {
public static void hookRead(Dialog dialog){
makeRequest("https://" + getApi() + "/method/messages.markAsRead?start_message_id=" + dialog.F1() + "&peer_id=" + dialog.getId() + "&v=5.91&access_token=" + getUserToken(), response -> {
ToastUtils.a("Чат помечен как прочитанный!");
});
}
public static void hookReadStartMsgTo(Msg dialog) {
Log.d("DNR", "hookReadStartMsgTo: " + dialog.C1() + " " + dialog.v1());
makeRequest("https://" + getApi() + "/method/messages.markAsRead?start_message_id=" + dialog.C1() + "&peer_id=" + dialog.v1() + "&v=5.119&access_token=" + getUserToken(), response -> {
});
}
public static void hookDNR(int peerId) {
public static void hookDNR(int peerId){
mDoNotReadDBHelper.setEnabledForPeerId(peerId, !mDoNotReadDBHelper.isEnabledForPeerId(peerId));
}
public static void hookDNT(int peerId) {
public static void hookDNT(int peerId){
mDoNotTypeDBHelper.setEnabledForPeerId(peerId, !mDoNotTypeDBHelper.isEnabledForPeerId(peerId));
}
}
@@ -2,16 +2,12 @@ package ru.vtosters.lite.dnr;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
public class DNRPrefs {
public static boolean getStoriesRead() {
public class DNRPrefs{
public static boolean getStoriesRead(){
return getBoolValue("read_s", false);
}
public static boolean getVoiceListened() {
return getBoolValue("listen_v", false);
}
public static boolean getMarkAsReadWithoutExceptions(int peerId) {
public static boolean getMarkAsReadWithoutExceptions(int peerId){
if (readPM(peerId))
return true;
if (readConversations(peerId))
@@ -19,43 +15,43 @@ public class DNRPrefs {
return readBots(peerId);
}
public static boolean getMarkAsRead(int peerId) {
public static boolean getMarkAsRead(int peerId){
return isInDNRExceptions(peerId);
}
public static boolean isInDNRExceptions(int peerId) {
public static boolean isInDNRExceptions(int peerId){
return DNRModule.mDoNotReadDBHelper.isEnabledForPeerId(peerId);
}
public static boolean isInDNTExceptions(int peerId) {
public static boolean isInDNTExceptions(int peerId){
return DNRModule.mDoNotTypeDBHelper.isEnabledForPeerId(peerId);
}
public static boolean readPM(int peer) {
public static boolean readPM(int peer){
return (peer > 0 && peer < 2000000000) && getBoolValue("read_pm", false);
}
public static boolean readConversations(int peer) {
public static boolean readConversations(int peer){
return (peer > 2000000000) && getBoolValue("read_conversations", false);
}
public static boolean readBots(int peer) {
public static boolean readBots(int peer){
return (peer < 0) && getBoolValue("read_bot", false);
}
public static boolean writePM(int peer) {
public static boolean writePM(int peer){
return (peer > 0 && peer < 2000000000) && getBoolValue("write_pm", false);
}
public static boolean writeConversations(int peer) {
public static boolean writeConversations(int peer){
return (peer > 2000000000) && getBoolValue("write_conversations", false);
}
public static boolean writeBots(int peer) {
public static boolean writeBots(int peer){
return (peer < 0) && getBoolValue("write_bot", false);
}
public static boolean getActivityWithoutExceptions(int peerId) {
public static boolean getActivityWithoutExceptions(int peerId){
if (writePM(peerId))
return true;
if (writeConversations(peerId))
@@ -63,7 +59,7 @@ public class DNRPrefs {
return writeBots(peerId);
}
public static boolean getActivity(int peerId) {
public static boolean getActivity(int peerId){
return isInDNTExceptions(peerId);
}
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.dnr.helpers;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Globals.getContext;
import android.content.ContentValues;
import android.database.Cursor;
@@ -12,22 +12,22 @@ import java.util.List;
import ru.vtosters.lite.dnr.DNRPrefs;
public class DoNotReadDBHelper extends SQLiteOpenHelper {
public DoNotReadDBHelper() {
super(getGlobalContext(), "dnr", null, 1);
public class DoNotReadDBHelper extends SQLiteOpenHelper{
public DoNotReadDBHelper(){
super(getContext(), "dnr", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
public void onCreate(SQLiteDatabase db){
db.execSQL("create table dnr (peerId integer primary key, enabled integer)");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
}
public boolean isEnabledForPeerId(int peerId) {
public boolean isEnabledForPeerId(int peerId){
try (Cursor c = getReadableDatabase().query("dnr", null, null, null, null, null, null)) {
if (c.moveToFirst()) {
int peerIdIndex = c.getColumnIndex("peerId");
@@ -36,7 +36,7 @@ public class DoNotReadDBHelper extends SQLiteOpenHelper {
do {
if (c.getInt(peerIdIndex) == peerId)
return c.getInt(enabledIndex) == 1;
} while (c.moveToNext());
} while(c.moveToNext());
}
} catch (Exception e) {
e.printStackTrace();
@@ -45,7 +45,7 @@ public class DoNotReadDBHelper extends SQLiteOpenHelper {
return DNRPrefs.getMarkAsReadWithoutExceptions(peerId);
}
public List<Integer> get() {
public List<Integer> get(){
ArrayList<Integer> rs = new ArrayList<>();
try (Cursor c = getReadableDatabase().query("dnr", null, null, null, null, null, null)) {
@@ -57,7 +57,7 @@ public class DoNotReadDBHelper extends SQLiteOpenHelper {
if (c.getInt(enabledIndex) == 1) {
rs.add(c.getInt(peerIdIndex));
}
} while (c.moveToNext());
} while(c.moveToNext());
}
} catch (Exception e) {
e.printStackTrace();
@@ -66,7 +66,7 @@ public class DoNotReadDBHelper extends SQLiteOpenHelper {
return rs;
}
public void setEnabledForPeerId(int peerId, boolean enabled) {
public void setEnabledForPeerId(int peerId, boolean enabled){
ContentValues cv = new ContentValues();
cv.put("enabled", enabled ? 1 : 0);
@@ -1,6 +1,6 @@
package ru.vtosters.lite.dnr.helpers;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Globals.getContext;
import android.content.ContentValues;
import android.database.Cursor;
@@ -12,22 +12,22 @@ import java.util.List;
import ru.vtosters.lite.dnr.DNRPrefs;
public class DoNotTypeDBHelper extends SQLiteOpenHelper {
public DoNotTypeDBHelper() {
super(getGlobalContext(), "dnt", null, 1);
public class DoNotTypeDBHelper extends SQLiteOpenHelper{
public DoNotTypeDBHelper(){
super(getContext(), "dnt", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
public void onCreate(SQLiteDatabase db){
db.execSQL("create table dnt (peerId integer primary key, enabled integer)");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion){
}
public List<Integer> get() {
public List<Integer> get(){
ArrayList<Integer> rs = new ArrayList<>();
try (Cursor c = getReadableDatabase().query("dnt", null, null, null, null, null, null)) {
@@ -39,7 +39,7 @@ public class DoNotTypeDBHelper extends SQLiteOpenHelper {
if (c.getInt(enabledIndex) == 1) {
rs.add(c.getInt(peerIdIndex));
}
} while (c.moveToNext());
} while(c.moveToNext());
}
} catch (Exception e) {
e.printStackTrace();
@@ -48,7 +48,7 @@ public class DoNotTypeDBHelper extends SQLiteOpenHelper {
return rs;
}
public boolean isEnabledForPeerId(int peerId) {
public boolean isEnabledForPeerId(int peerId){
try (Cursor c = getReadableDatabase().query("dnt", null, null, null, null, null, null)) {
if (c.moveToFirst()) {
int peerIdIndex = c.getColumnIndex("peerId");
@@ -57,7 +57,7 @@ public class DoNotTypeDBHelper extends SQLiteOpenHelper {
do {
if (c.getInt(peerIdIndex) == peerId)
return c.getInt(enabledIndex) == 1;
} while (c.moveToNext());
} while(c.moveToNext());
}
} catch (Exception e) {
e.printStackTrace();
@@ -66,7 +66,7 @@ public class DoNotTypeDBHelper extends SQLiteOpenHelper {
return DNRPrefs.getActivityWithoutExceptions(peerId);
}
public void setEnabledForPeerId(int peerId, boolean enabled) {
public void setEnabledForPeerId(int peerId, boolean enabled){
ContentValues cv = new ContentValues();
cv.put("enabled", enabled ? 1 : 0);
@@ -10,45 +10,35 @@ import com.vk.core.util.ToastUtils;
import com.vk.dto.music.MusicTrack;
import java.io.File;
import java.util.Random;
import ru.vtosters.lite.downloaders.notifications.NotificationChannels;
import ru.vtosters.lite.music.Callback;
import ru.vtosters.lite.music.FFMpeg;
import ru.vtosters.lite.music.M3UDownloader;
import ru.vtosters.lite.music.MP3Downloader;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.Globals;
public class AudioDownloader {
private static NotificationManagerCompat notificationManager = NotificationManagerCompat.from(AndroidUtils.getGlobalContext());
public class AudioDownloader{
private static NotificationManagerCompat notificationManager = NotificationManagerCompat.from(Globals.getContext());
public static void downloadAudio(MusicTrack track) {
if (AndroidUtils.getDefaultPrefs().getBoolean("new_music_downloading_way", false)) {
downloadMP3(track);
} else {
downloadM3U8(track);
}
}
public static void downloadM3U8(MusicTrack track) {
public static void downloadAudio(MusicTrack track){
if (track.D == null) {
ToastUtils.a("Не удалось найти ссылку на аудиозапись");
return;
}
var musicPath = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC).getAbsolutePath();
var tempId = track.d;
var downloadPath = musicPath + File.separator + tempId;
var notification = buildDownloadNotification(track, tempId);
downloadM3U8(track, downloadPath, new Callback() {
downloadM3U8(track, downloadPath, new Callback(){
@Override
public void onProgress(int progress) {
public void onProgress(int progress){
notification.setProgress(100, progress, false);
notificationManager.notify(tempId, notification.build());
}
@Override
public void onSuccess() {
public void onSuccess(){
try {
var fileName = track.toString();
var success = FFMpeg.convert(downloadPath, musicPath + File.separator + fileName + ".mp3");
@@ -69,19 +59,19 @@ public class AudioDownloader {
}
@Override
public void onFailure() {
public void onFailure(){
notification.setContentText("Не удалось загрузить аудиозапись").setProgress(0, 0, false);
notificationManager.notify(tempId, notification.build());
}
@Override
public void onSizeReceived(long size, long header) {
public void onSizeReceived(long size, long header){
}
});
}
private static void downloadM3U8(MusicTrack track, String path, Callback callback) {
private static void downloadM3U8(MusicTrack track, String path, Callback callback){
File outDir = new File(path);
if (!outDir.exists())
if (outDir.mkdir())
@@ -89,15 +79,11 @@ public class AudioDownloader {
else
Log.e("AudioDownloader", "Directory creation failed");
Log.i("AudioDownloader", "Downloading audio to " + path);
M3UDownloader.execute(track.D, outDir, callback);
new M3UDownloader(track.D, outDir, callback).execute();
}
private static void downloadMP3(MusicTrack track) {
MP3Downloader.execute(track);
}
private static NotificationCompat.Builder buildDownloadNotification(MusicTrack track, int id) {
var notificationBuilder = new NotificationCompat.Builder(AndroidUtils.getGlobalContext(), NotificationChannels.MUSIC_DOWNLOAD_CHANNEL_ID)
private static NotificationCompat.Builder buildDownloadNotification(MusicTrack track, int id){
var notificationBuilder = new NotificationCompat.Builder(Globals.getContext(), "music_downloads")
.setSmallIcon(android.R.drawable.stat_sys_download)
.setContentTitle("Загрузка аудиозаписи")
.setContentText(track.toString())
@@ -1,6 +1,6 @@
package ru.vtosters.lite.downloaders;
import static ru.vtosters.lite.utils.AndroidUtils.getString;
import static ru.vtosters.lite.utils.Globals.getString;
import android.annotation.SuppressLint;
import android.app.DownloadManager;
@@ -15,13 +15,13 @@ import java.io.File;
import b.h.g.m.FileUtils;
import ru.vtosters.lite.ui.activities.APKInstallActivity;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.Globals;
public class OTADownloader {
public class OTADownloader{
private static final BroadcastReceiver callback = new BroadcastReceiver() {
private static final BroadcastReceiver callback = new BroadcastReceiver(){
@Override
public void onReceive(Context context, Intent intent) {
public void onReceive(Context context, Intent intent){
var extras = intent.getExtras();
if (extras == null || !intent.getAction().equals(DownloadManager.ACTION_DOWNLOAD_COMPLETE))
return;
@@ -29,7 +29,7 @@ public class OTADownloader {
var query = new DownloadManager.Query();
var id = extras.getLong(DownloadManager.EXTRA_DOWNLOAD_ID);
query.setFilterById(id);
var manager = (DownloadManager) AndroidUtils.getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE);
var manager = (DownloadManager) Globals.getContext().getSystemService(Context.DOWNLOAD_SERVICE);
var cursor = manager.query(query);
if (cursor.moveToFirst()) {
@SuppressLint("Range") var status = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS));
@@ -48,14 +48,14 @@ public class OTADownloader {
File apk = maxIndex == -1 ? new File(downloadDir, "VTLite.apk") : new File(downloadDir, "VTLite-" + maxIndex + ".apk");
APKInstallActivity.installOta(context, FileUtils.n(apk));
} else if (status == DownloadManager.STATUS_FAILED) {
AndroidUtils.sendToast(getString("downloaderr"));
Globals.sendToast(getString("downloaderr"));
}
}
}
};
public static void downloadBuild(String url) {
var context = AndroidUtils.getGlobalContext();
public static void downloadBuild(String url){
var context = Globals.getContext();
var uri = Uri.parse(url);
context.registerReceiver(callback, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
@@ -65,7 +65,7 @@ public class OTADownloader {
request.setTitle("VTLite.apk");
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "VTLite.apk");
var manager = (DownloadManager) AndroidUtils.getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE);
var manager = (DownloadManager) Globals.getContext().getSystemService(Context.DOWNLOAD_SERVICE);
manager.enqueue(request);
}
}
@@ -1,7 +1,6 @@
package ru.vtosters.lite.downloaders;
import static ru.vtosters.lite.downloaders.VideoDownloader.downloadVideo;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Globals.getContext;
import android.app.DownloadManager;
import android.content.Context;
@@ -13,8 +12,8 @@ import com.vk.dto.stories.model.StoryEntry;
import java.util.List;
public class StoryDownloader {
public static Runnable injectButton(StoryEntry story) {
public class StoryDownloader{
public static Runnable injectButton(StoryEntry story){
return () -> {
// if story is a pic
if (story.T1()) {
@@ -24,7 +23,7 @@ public class StoryDownloader {
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setTitle("photo" + story.E.a);
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DCIM, "/Stories/photo" + story.E.a + ".jpg");
((DownloadManager) getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
((DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
return;
}
@@ -1,10 +1,10 @@
package ru.vtosters.lite.downloaders;
import static ru.vtosters.lite.net.Request.makeRequest;
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.getString;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import android.app.AlertDialog;
import android.app.DownloadManager;
@@ -17,7 +17,6 @@ import android.widget.Toast;
import com.vk.core.dialogs.bottomsheet.MenuBottomSheetAction;
import com.vk.core.util.ToastUtils;
import com.vk.dto.common.VideoFile;
import com.vtosters.lite.R;
import org.json.JSONArray;
import org.json.JSONException;
@@ -27,26 +26,29 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import ru.vtosters.lite.utils.ExternalLinkParser;
import com.vtosters.lite.R;
public class VideoDownloader {
import ru.vtosters.lite.utils.ExternalLinkHandler;
import ru.vtosters.lite.utils.Preferences;
public class VideoDownloader{
private static final int DOWNLOAD_ID = 0;
private static final int OPEN_EXTERNAL_LINK_ID = 1;
public static boolean onClick(int id, VideoFile video, Context ctx) {
public static boolean onClick(int id, VideoFile video, Context ctx){
if (id == DOWNLOAD_ID) {
downloadVideo(video, ctx);
return true;
} else if (id == OPEN_EXTERNAL_LINK_ID) {
ExternalLinkParser.parseVideoFile(video, ctx, true);
ExternalLinkHandler.parseVideoFile(video, ctx, true);
}
return false;
}
public static void injectAction(ArrayList<MenuBottomSheetAction> list, VideoFile video) {
public static void injectAction(ArrayList<MenuBottomSheetAction> list, VideoFile video){
if (!video.U && !video.I1()) {
addAction(list, DOWNLOAD_ID, R.drawable.ic_download_outline_24, R.string.download, 9);
addAction(list, OPEN_EXTERNAL_LINK_ID, R.drawable.ic_link_outline_28, getIdentifier("interfacevideoext_short", "string"), 9);
addAction(list, OPEN_EXTERNAL_LINK_ID, R.drawable.ic_link_outline_28, getIdentifier("interfacevideoext", "string"), 9);
}
}
@@ -54,7 +56,7 @@ public class VideoDownloader {
actions.add(new MenuBottomSheetAction(ints[0], ints[1], ints[2], ints[3]));
}
public static void downloadVideo(VideoFile videoFile, Context context) {
public static void downloadVideo(VideoFile videoFile, Context context){
final List<String> list = new ArrayList<>();
final List<String> urls = new ArrayList<>();
@@ -105,7 +107,7 @@ public class VideoDownloader {
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setTitle(videoFile.toString());
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_MOVIES, videoFile + ".mp4");
((DownloadManager) getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
((DownloadManager) getContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
return;
}
@@ -121,7 +123,7 @@ public class VideoDownloader {
builder.show();
}
public static void parseVideoLink(String url, Context ctx) {
public static void parseVideoLink(String url, Context ctx){
if (url.contains("vk.com/story")) {
ToastUtils.a("Не поддерживается загрузка историй");
return;
@@ -1,32 +0,0 @@
package ru.vtosters.lite.downloaders.notifications;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.os.Build;
import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationManagerCompat;
import ru.vtosters.lite.utils.AndroidUtils;
public class NotificationChannels {
public static final String MUSIC_DOWNLOAD_CHANNEL_ID = "music_download_channel";
public static final String MUSIC_DOWNLOAD_CHANNEL_NAME = "Загрузка музыки";
public static final String MUSIC_DOWNLOAD_CHANNEL_DESCRIPTION = "Прогресс загрузки музыки";
@RequiresApi(api = Build.VERSION_CODES.O)
public static void createChannels() {
createMusicDownloadChannel();
}
@RequiresApi(api = Build.VERSION_CODES.O)
public static void createMusicDownloadChannel() {
var musicDownloadChannel = new NotificationChannel(MUSIC_DOWNLOAD_CHANNEL_ID, MUSIC_DOWNLOAD_CHANNEL_NAME, NotificationManager.IMPORTANCE_LOW);
musicDownloadChannel.setDescription(MUSIC_DOWNLOAD_CHANNEL_DESCRIPTION);
musicDownloadChannel.setShowBadge(true);
musicDownloadChannel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
var notificationManager = NotificationManagerCompat.from(AndroidUtils.getGlobalContext());
notificationManager.createNotificationChannel(musicDownloadChannel);
}
}
@@ -19,10 +19,10 @@ import ru.vtosters.lite.encryption.processors.MP3InvisibleProcessor;
import ru.vtosters.lite.encryption.processors.VTostersAESProcessor;
import ru.vtosters.lite.encryption.processors.VTostersProcessor;
public class EncryptProvider {
public class EncryptProvider{
public static List<IMProcessor> processors = new ArrayList<>();
static {
static{
processors.add(new VTostersProcessor());
processors.add(new VTostersAESProcessor());
processors.add(new DefaultCoffeeProcessor());
@@ -31,7 +31,7 @@ public class EncryptProvider {
processors.add(new MP3InvisibleProcessor());
}
public static IMProcessor getProcessorFor(int peerId) {
public static IMProcessor getProcessorFor(int peerId){
IMProcessor enabled = null;
for (IMProcessor processor : EncryptProvider.processors) {
if (processor.isUsedToEncrypt(peerId)) {
@@ -41,20 +41,20 @@ public class EncryptProvider {
return enabled;
}
public static String getBody(MsgFromUser msg) {
public static String getBody(MsgFromUser msg){
return msg.f();
}
public static int getPeerId(Msg msg) {
public static int getPeerId(Msg msg){
return msg.v1();
}
// This will run through EVERY single processor available.
public static String decryptMessage(MsgFromUser msg) {
public static String decryptMessage(MsgFromUser msg){
return decryptMessage(getBody(msg), getPeerId(msg));
}
public static String decryptMessage(String msgBody, int peer) {
public static String decryptMessage(String msgBody, int peer){
try {
for (IMProcessor processor : processors) {
if ((processor.isUsed() || !processor.isPublic()) && processor.isEncrypted(msgBody) && (processor.isPublic() || getKeyForProcessor(processor, peer) != null))
@@ -66,7 +66,7 @@ public class EncryptProvider {
return msgBody;
}
private static byte[] getKeyForProcessor(IMProcessor processor, int peer) {
private static byte[] getKeyForProcessor(IMProcessor processor, int peer){
if (processor.isPublic()) return null;
String keyString = processor.getEncryptionKeyFor(peer);
if (keyString == null) return null;
@@ -85,7 +85,7 @@ public class EncryptProvider {
}
// This will use only the processor which was chosen in chat menu [that's why ID is needed, bruh]
public static String encryptMessage(MsgFromUser msg) {
public static String encryptMessage(MsgFromUser msg){
String msgBody = getBody(msg);
@@ -104,7 +104,7 @@ public class EncryptProvider {
}
// For rendering UI
public static List<Pair<String, String>> getUserVisibleEncoders() {
public static List<Pair<String, String>> getUserVisibleEncoders(){
List<Pair<String, String>> theList = new ArrayList<>();
for (IMProcessor processor : processors) {
@@ -5,11 +5,11 @@ import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.Globals;
public abstract class IMProcessor {
public abstract class IMProcessor{
// By default it checks start and end tag.
public boolean isEncrypted(String source) {
public boolean isEncrypted(String source){
//Log.d("IMProcessor", "Checking if encrypted: "+source+" / "+getUIName());
return source.startsWith(startTag()) && source.endsWith(endTag());
}
@@ -23,19 +23,19 @@ public abstract class IMProcessor {
// Automatically removes tags. Magic!
@NonNull
public String encode(@NonNull String source, @Nullable byte[] key) {
public String encode(@NonNull String source, @Nullable byte[] key){
//Log.d("IMProcessor", "Encoding "+source);
return startTag() + encodeInternal(source, key) + endTag();
}
@NonNull
public String decode(@NonNull String source, @Nullable byte[] key) {
public String decode(@NonNull String source, @Nullable byte[] key){
//Log.d("IMProcessor", "Decoding");
return decodeInternal(source.substring(startTag().length(), source.length() - endTag().length()), key);
}
// Public - no key required.
public boolean isPublic() {
public boolean isPublic(){
return true;
}
@@ -47,40 +47,40 @@ public abstract class IMProcessor {
abstract public String getPrefKey();
@NonNull
public String startTag() {
public String startTag(){
return "";
}
@NonNull
public String endTag() {
public String endTag(){
return "";
}
public boolean isUsed() {
public boolean isUsed(){
//Log.d("IMProcessor", "Checking if decoded with "+getUIName());
return getBoolValue("VT_IMDecode_" + getPrefKey(), true);
}
public boolean isUsedToEncrypt(int id) {
public boolean isUsedToEncrypt(int id){
//Log.d("IMProcessor", "Checking if "+id+" is ready to be encrypted with "+getUIName());
return getBoolValue("VT_IMEncode_" + getPrefKey() + "_" + id, false);
}
public void enableEncryptFor(int id) {
AndroidUtils.getDefaultPrefs().edit().putBoolean("VT_IMEncode_" + getPrefKey() + "_" + id, true).apply();
public void enableEncryptFor(int id){
Globals.getDefprefs().edit().putBoolean("VT_IMEncode_" + getPrefKey() + "_" + id, true).apply();
}
public void disableEncryptFor(int id) {
AndroidUtils.getDefaultPrefs().edit().putBoolean("VT_IMEncode_" + getPrefKey() + "_" + id, false).apply();
public void disableEncryptFor(int id){
Globals.getDefprefs().edit().putBoolean("VT_IMEncode_" + getPrefKey() + "_" + id, false).apply();
}
public void setEncryptionKeyFor(int id, @Nullable String key) {
public void setEncryptionKeyFor(int id, @Nullable String key){
if (key == null || key.isEmpty()) key = "VTAesDefault";
AndroidUtils.getDefaultPrefs().edit().putString("VT_IMEncodeKey_" + getPrefKey() + "_" + id, key).apply();
Globals.getDefprefs().edit().putString("VT_IMEncodeKey_" + getPrefKey() + "_" + id, key).apply();
}
@Nullable
public String getEncryptionKeyFor(int id) {
return AndroidUtils.getDefaultPrefs().getString("VT_IMEncodeKey_" + getPrefKey() + "_" + id, null);
public String getEncryptionKeyFor(int id){
return Globals.getDefprefs().getString("VT_IMEncodeKey_" + getPrefKey() + "_" + id, null);
}
}
@@ -9,12 +9,12 @@ import java.nio.charset.StandardCharsets;
import ru.vtosters.lite.encryption.base.IMProcessor;
public class BeeCryptProcessor extends IMProcessor {
public class BeeCryptProcessor extends IMProcessor{
private static final String BC_CHARSET = "жъЖЪ";
@NonNull
@Override
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String encodeInternal(@NonNull String source, @Nullable byte[] key){
try {
String a = Base64.encodeToString(source.getBytes(StandardCharsets.UTF_8), 2);
StringBuilder res = new StringBuilder();
@@ -35,16 +35,16 @@ public class BeeCryptProcessor extends IMProcessor {
}
@Override
public boolean isEncrypted(String source) {
public boolean isEncrypted(String source){
return source.matches("[жъЖЪ]{16,}");
}
@NonNull
@Override
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String decodeInternal(@NonNull String source, @Nullable byte[] key){
StringBuilder b64 = new StringBuilder();
int i = 0;
while (i < source.length() - 3) {
while(i < source.length() - 3) {
try {
String bintxt = source.substring(i, i + 4);
int c = 0;
@@ -63,13 +63,13 @@ public class BeeCryptProcessor extends IMProcessor {
@NonNull
@Override
public String getUIName() {
public String getUIName(){
return "MP3 [beecrypt]";
}
@NonNull
@Override
public String getPrefKey() {
public String getPrefKey(){
return "mp3_bc";
}
}
@@ -10,11 +10,11 @@ import javax.crypto.spec.SecretKeySpec;
import ru.vtosters.lite.encryption.base.IMProcessor;
public class DefaultCoffeeProcessor extends IMProcessor {
public class DefaultCoffeeProcessor extends IMProcessor{
private final static String KEY = "stupidUsersMustD";
private static Cipher dCipher, eCipher;
static {
static{
try {
SecretKeySpec key = new SecretKeySpec(KEY.getBytes(), "AES");
@@ -28,7 +28,7 @@ public class DefaultCoffeeProcessor extends IMProcessor {
}
}
private String toHex(String text) {
private String toHex(String text){
char[] chars = text.toCharArray();
StringBuilder str = new StringBuilder();
for (char aChar : chars) {
@@ -41,7 +41,7 @@ public class DefaultCoffeeProcessor extends IMProcessor {
return string.substring(0, string.length() - 1);
}
private String fromHex(String text) {
private String fromHex(String text){
text = text.replace(" ", "");
char[] chars = text.toCharArray();
char[] chars2 = new char[chars.length / 2];
@@ -55,7 +55,7 @@ public class DefaultCoffeeProcessor extends IMProcessor {
@NonNull
@Override
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String encodeInternal(@NonNull String source, @Nullable byte[] key){
try {
return toHex(Base64.encodeToString(eCipher.doFinal(source.getBytes()), 0));
} catch (Exception e) {
@@ -67,7 +67,7 @@ public class DefaultCoffeeProcessor extends IMProcessor {
@NonNull
@Override
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String decodeInternal(@NonNull String source, @Nullable byte[] key){
try {
return new String(dCipher.doFinal(Base64.decode(fromHex(source), 0)));
} catch (Exception e) {
@@ -79,25 +79,25 @@ public class DefaultCoffeeProcessor extends IMProcessor {
@Override
@NonNull
public String startTag() {
public String startTag(){
return "VK CO FF EE ";
}
@Override
@NonNull
public String endTag() {
public String endTag(){
return " VK CO FF EE";
}
@NonNull
@Override
public String getUIName() {
public String getUIName(){
return "VK Coffee [default]";
}
@NonNull
@Override
public String getPrefKey() {
public String getPrefKey(){
return "coffee_default";
}
}
@@ -2,28 +2,28 @@ package ru.vtosters.lite.encryption.processors;
import androidx.annotation.NonNull;
public class DonateCoffeeProcessor extends DefaultCoffeeProcessor {
public class DonateCoffeeProcessor extends DefaultCoffeeProcessor{
@Override
@NonNull
public String startTag() {
public String startTag(){
return "II ";
}
@Override
@NonNull
public String endTag() {
public String endTag(){
return " II";
}
@NonNull
@Override
public String getUIName() {
public String getUIName(){
return "VK Coffee [hidden]";
}
@NonNull
@Override
public String getPrefKey() {
public String getPrefKey(){
return "coffee_donate";
}
}
@@ -9,17 +9,17 @@ import java.nio.charset.StandardCharsets;
import ru.vtosters.lite.encryption.base.IMProcessor;
public class MP3InvisibleProcessor extends IMProcessor {
private static String toStr(int a, String cc) {
public class MP3InvisibleProcessor extends IMProcessor{
private static String toStr(int a, String cc){
StringBuilder s = new StringBuilder();
while (a > 0) {
while(a > 0) {
s.insert(0, cc.charAt(a % cc.length()));
a /= cc.length();
}
return s.toString();
}
private static int toNum(String a, String cc) {
private static int toNum(String a, String cc){
int n = 0;
for (int i = 0; i < a.length(); i++) {
int start = (a.length() - i) - 1;
@@ -30,7 +30,7 @@ public class MP3InvisibleProcessor extends IMProcessor {
@NonNull
@Override
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String encodeInternal(@NonNull String source, @Nullable byte[] key){
try {
byte[] bytes = source.getBytes(StandardCharsets.UTF_8);
java.lang.String[] plainText = new String[bytes.length];
@@ -46,7 +46,7 @@ public class MP3InvisibleProcessor extends IMProcessor {
@NonNull
@Override
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String decodeInternal(@NonNull String source, @Nullable byte[] key){
try {
java.lang.String[] t = source.replaceAll("^" + "  ", "").split(" ");
byte[] plainText = new byte[t.length];
@@ -61,19 +61,19 @@ public class MP3InvisibleProcessor extends IMProcessor {
}
@Override
public boolean isEncrypted(String source) {
public boolean isEncrypted(String source){
return source.matches("^" + "  " + "([" + " ​‌‏ " + "\\s]*)");
}
@NonNull
@Override
public String getUIName() {
public String getUIName(){
return "MP3 [invisible]";
}
@NonNull
@Override
public String getPrefKey() {
public String getPrefKey(){
return "mp3";
}
}
@@ -17,22 +17,22 @@ import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import ru.vtosters.lite.encryption.base.IMProcessor;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.Globals;
public class VTostersAESProcessor extends IMProcessor {
public class VTostersAESProcessor extends IMProcessor{
private final static String CIPHER_INSTANCE = "AES/CBC/PKCS7Padding";
private final static String KEY_METHOD = "AES";
private final HashMap<byte[], Cipher> decodeMap = new HashMap<>();
private final HashMap<byte[], Cipher> encodeMap = new HashMap<>();
public void free(byte[] key) {
public void free(byte[] key){
decodeMap.remove(key);
encodeMap.remove(key);
}
@NonNull
private Cipher wrapEncoder(byte[] key) throws InvalidAlgorithmParameterException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException {
private Cipher wrapEncoder(byte[] key) throws InvalidAlgorithmParameterException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException{
if (encodeMap.containsKey(key)) return encodeMap.get(key);
Triple<Cipher, SecretKeySpec, IvParameterSpec> encodeCipher = getBaseCipher(key);
@@ -43,7 +43,7 @@ public class VTostersAESProcessor extends IMProcessor {
}
@NonNull
private Cipher wrapDecoder(byte[] key) throws InvalidAlgorithmParameterException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException {
private Cipher wrapDecoder(byte[] key) throws InvalidAlgorithmParameterException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException{
if (decodeMap.containsKey(key)) return decodeMap.get(key);
Triple<Cipher, SecretKeySpec, IvParameterSpec> decodeCipher = getBaseCipher(key);
@@ -54,7 +54,7 @@ public class VTostersAESProcessor extends IMProcessor {
}
@NonNull
private Triple<Cipher, SecretKeySpec, IvParameterSpec> getBaseCipher(byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException {
private Triple<Cipher, SecretKeySpec, IvParameterSpec> getBaseCipher(byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException{
byte[] off = new byte[16];
System.arraycopy(key, 0, off, 0, off.length);
return new Triple<>(Cipher.getInstance(CIPHER_INSTANCE), new SecretKeySpec(key, KEY_METHOD), new IvParameterSpec(off));
@@ -62,7 +62,7 @@ public class VTostersAESProcessor extends IMProcessor {
@NonNull
@Override
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String encodeInternal(@NonNull String source, @Nullable byte[] key){
try {
return Base64.encodeToString(wrapEncoder(key).doFinal(source.getBytes(StandardCharsets.UTF_8)), Base64.DEFAULT);
} catch (Exception e) {
@@ -73,7 +73,7 @@ public class VTostersAESProcessor extends IMProcessor {
@NonNull
@Override
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String decodeInternal(@NonNull String source, @Nullable byte[] key){
try {
return new String(wrapDecoder(key).doFinal(Base64.decode(source, Base64.DEFAULT)), StandardCharsets.UTF_8);
} catch (Exception e) {
@@ -83,46 +83,46 @@ public class VTostersAESProcessor extends IMProcessor {
}
@Override
public boolean isPublic() {
public boolean isPublic(){
return false;
}
@NonNull
@Override
public String startTag() {
public String startTag(){
return "VT0ST3RS [AES] ";
}
@NonNull
@Override
public String endTag() {
public String endTag(){
return " VT0ST3RS [AES]";
}
@NonNull
@Override
public String getUIName() {
public String getUIName(){
return "VTosters [AES]";
}
@NonNull
@Override
public String getPrefKey() {
public String getPrefKey(){
return "vtaes";
}
@Nullable
@Override
public String getEncryptionKeyFor(int id) {
return AndroidUtils.getDefaultPrefs().getString("VT_IMEncodeKey_" + getPrefKey() + "_" + id, "VTAesDefault");
public String getEncryptionKeyFor(int id){
return Globals.getDefprefs().getString("VT_IMEncodeKey_" + getPrefKey() + "_" + id, "VTAesDefault");
}
public static class Triple<F, S, T> {
public static class Triple<F, S, T>{
public final F first;
public final S second;
public final T third;
public Triple(F first, S second, T third) {
public Triple(F first, S second, T third){
this.first = first;
this.second = second;
this.third = third;
@@ -7,40 +7,40 @@ import androidx.annotation.Nullable;
import ru.vtosters.lite.encryption.base.IMProcessor;
public class VTostersProcessor extends IMProcessor {
public class VTostersProcessor extends IMProcessor{
@NonNull
@Override
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String encodeInternal(@NonNull String source, @Nullable byte[] key){
return Base64.encodeToString(source.getBytes(), Base64.DEFAULT);
}
@NonNull
@Override
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
protected String decodeInternal(@NonNull String source, @Nullable byte[] key){
return new String(Base64.decode(source, Base64.DEFAULT));
}
@Override
@NonNull
public String startTag() {
public String startTag(){
return "VT0ST3RS ";
}
@Override
@NonNull
public String endTag() {
public String endTag(){
return " VT0ST3RS";
}
@NonNull
@Override
public String getUIName() {
public String getUIName(){
return "VTosters Classique [Base64]";
}
@NonNull
@Override
public String getPrefKey() {
public String getPrefKey(){
return "vt64";
}
}
@@ -1,9 +1,9 @@
package ru.vtosters.lite.ui.components;
package ru.vtosters.lite.f0x1d;
import static ru.vtosters.lite.utils.About.getBuildNumber;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.getString;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.Activity;
import android.app.Notification;
@@ -20,29 +20,28 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import ru.vtosters.lite.deviceinfo.DeviceInfoCollector;
import ru.vtosters.lite.services.LogWriterService;
public class CrashReporter {
public class Crashreporter{
protected static String logString;
public static String getStackTrace(Throwable th) {
public static String getStackTrace(Throwable th){
StringWriter stringWriter = new StringWriter();
th.printStackTrace(new PrintWriter(stringWriter));
return stringWriter.toString();
}
public static void init(Activity activity) {
public static void init(Activity activity){
final var defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler((thread, th) -> CrashReporter.start(defaultUncaughtExceptionHandler, thread, th, activity));
Thread.setDefaultUncaughtExceptionHandler((thread, th) -> Crashreporter.start(defaultUncaughtExceptionHandler, thread, th, activity));
}
static void start(Thread.UncaughtExceptionHandler uncaughtExceptionHandler, Thread thread, Throwable th, Activity activity) {
logString = getStackTrace(th) + "\n\n" + new DeviceInfoCollector().collect(getGlobalContext()).toDeviceName() + ", commit: " + getBuildNumber();
static void start(Thread.UncaughtExceptionHandler uncaughtExceptionHandler, Thread thread, Throwable th, Activity activity){
logString = getStackTrace(th) + "\n\n" + new DeviceInfoCollector().collect(getContext()).toDeviceName() + ", commit: " + getBuildNumber();
if (Build.VERSION.SDK_INT >= 26) {
var notificationChannel = new NotificationChannel("crashes", "crash", NotificationManager.IMPORTANCE_DEFAULT);
notificationChannel.enableVibration(true);
notificationChannel.enableLights(true);
((NotificationManager) getGlobalContext().getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(notificationChannel);
((NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(notificationChannel);
}
var foxbinIntent = new Intent("com.f0x1d.dogbin.ACTION_UPLOAD_TO_FOXBIN");
@@ -54,19 +53,19 @@ public class CrashReporter {
foxbinIntent.addFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);
}
var saveLogIntent = new Intent(getGlobalContext(), LogWriterService.class);
var saveLogIntent = new Intent(getContext(), LogWriterService.class);
saveLogIntent.putExtra("log", logString);
saveLogIntent.putExtra("notificationId", 1);
var psaveLogIntent = PendingIntent.getService(getGlobalContext(), 0, saveLogIntent, PendingIntent.FLAG_CANCEL_CURRENT);
var psaveLogIntent = PendingIntent.getService(getContext(), 0, saveLogIntent, PendingIntent.FLAG_CANCEL_CURRENT);
var builder = new Notification.Builder(getGlobalContext());
var builder = new Notification.Builder(getContext());
builder.setSmallIcon(getIdentifier("ic_bug_24", "drawable"));
builder.setContentTitle(getString("vtl_crashed"));
builder.setContentText(logString);
builder.setStyle(new Notification.BigTextStyle().bigText(logString));
builder.setAutoCancel(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
builder.addAction(new Notification.Action(0, getString("vtl_crash_upload"), PendingIntent.getActivity(getGlobalContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT)));
builder.addAction(new Notification.Action(0, getString("vtl_crash_upload"), PendingIntent.getActivity(getContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT)));
builder.addAction(new Notification.Action(0, getString("vtl_crash_save"), psaveLogIntent));
} else {
builder.setContentIntent(PendingIntent.getActivity(activity, 0, foxbinIntent, PendingIntent.FLAG_ONE_SHOT));
@@ -77,13 +76,13 @@ public class CrashReporter {
}
((NotificationManager) getGlobalContext().getSystemService(Context.NOTIFICATION_SERVICE)).notify(-2147483548, builder.build());
((NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE)).notify(-2147483548, builder.build());
Log.e("VTosters Lite", "crashed: " + th.getLocalizedMessage());
uncaughtExceptionHandler.uncaughtException(thread, th);
}
private static boolean isFoxbinInstalled() {
var pm = getGlobalContext().getPackageManager();
private static boolean isFoxbinInstalled(){
var pm = getContext().getPackageManager();
try {
pm.getPackageInfo("com.f0x1d.dogbin", 0);
return true;
@@ -1,8 +1,8 @@
package ru.vtosters.lite.services;
package ru.vtosters.lite.f0x1d;
import static android.widget.Toast.LENGTH_SHORT;
import static android.widget.Toast.makeText;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Globals.getContext;
import android.app.NotificationManager;
import android.app.Service;
@@ -18,22 +18,17 @@ import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
public class LogWriterService extends Service {
public LogWriterService() {
public class LogWriterService extends Service{
public LogWriterService(){
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
public int onStartCommand(Intent intent, int flags, int startId){
super.onStartCommand(intent, flags, startId);
Log.d("LogWriterService", "The service has been started");
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd.HH-mm-ss", Locale.getDefault());
var file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/VTL_log_" + dateFormat.format(new Date()) + ".txt");
var file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/VTL_log.txt");
try {
var exists = file.createNewFile();
@@ -44,18 +39,18 @@ public class LogWriterService extends Service {
writeLog(intent, file);
} catch (Exception e) {
e.printStackTrace();
makeText(getGlobalContext(), "Не удалось сохранить лог-файл", LENGTH_SHORT).show();
makeText(getContext(), "Не удалось сохранить лог-файл", LENGTH_SHORT).show();
}
var notificationId = intent.getIntExtra("notificationId", 1);
var manager = (NotificationManager) getGlobalContext().getSystemService(Context.NOTIFICATION_SERVICE);
var manager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
manager.cancel(notificationId);
makeText(getGlobalContext(), "Лог-файл был сохранен", LENGTH_SHORT).show();
makeText(getContext(), "Лог-файл был сохранен", LENGTH_SHORT).show();
stopSelf();
return START_NOT_STICKY;
}
private void writeLog(Intent intent, File file) throws IOException {
private void writeLog(Intent intent, File file) throws IOException{
FileOutputStream stream;
stream = new FileOutputStream(file);
stream.write(intent.getStringExtra("log").getBytes(StandardCharsets.UTF_8));
@@ -65,7 +60,7 @@ public class LogWriterService extends Service {
@Nullable
@Override
public IBinder onBind(Intent intent) {
public IBinder onBind(Intent intent){
return null;
}
}
@@ -1,4 +1,4 @@
package ru.vtosters.lite.utils;
package ru.vtosters.lite.f0x1d;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
@@ -23,18 +23,19 @@ import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import ru.vtosters.lite.utils.Globals;
public class VTVerifications {
public class VTVerifications{
public static final List<Integer> sVerifications = new ArrayList<>();
public static final List<Integer> sPrometheuses = new ArrayList<>();
public static final List<Integer> sDevelopers = new ArrayList<>();
public static final List<Integer> sServiceAccounts = new ArrayList<>();
private static final OkHttpClient sClient = new OkHttpClient();
public static void load(Context context) {
public static void load(Context context){
var prefs = context.getSharedPreferences("vt_another_data", 0);
if (!NetworkUtils.isNetworkConnected() && prefs.contains("ids")) {
if (!Globals.isNetworkConnected() && prefs.contains("ids")) {
parseJson(prefs.getString("ids", "[]"));
return;
}
@@ -44,10 +45,10 @@ public class VTVerifications {
.a(RequestBody.a(MediaType.b("application/json; charset=UTF-8"), "{\"types\":[0,228,404,1337]}"))
.a();
sClient.a(request).a(new Callback() {
sClient.a(request).a(new Callback(){
@Override
public void a(Call call, Response response) {
public void a(Call call, Response response){
try {
var payload = response.a().g();
parseJson(payload);
@@ -60,7 +61,7 @@ public class VTVerifications {
}
@Override
public void a(Call call, IOException e) {
public void a(Call call, IOException e){
Log.d("VTVerifications", "" + e);
}
@@ -73,7 +74,7 @@ public class VTVerifications {
* 404 - Developer
* 1337 - Service account
*/
private static void parseJson(String payload) {
private static void parseJson(String payload){
try {
var json = new JSONObject(payload);
processIds(json.optJSONArray("0"), sVerifications);
@@ -85,7 +86,7 @@ public class VTVerifications {
}
}
private static void processIds(JSONArray jsonIds, List<Integer> member) {
private static void processIds(JSONArray jsonIds, List<Integer> member){
if (jsonIds == null || jsonIds.length() == 0)
return;
@@ -93,27 +94,27 @@ public class VTVerifications {
member.add(jsonIds.optInt(i));
}
public static boolean isVerified(int id) {
public static boolean isVerified(int id){
return sVerifications.contains(id);
}
public static boolean isPrometheus(int id) {
public static boolean isPrometheus(int id){
return sPrometheuses.contains(id);
}
public static boolean isDeveloper(int id) {
public static boolean isDeveloper(int id){
return sDevelopers.contains(id);
}
public static boolean isServiceAccount(int id) {
public static boolean isServiceAccount(int id){
return sServiceAccounts.contains(id);
}
public static boolean vtverif() {
public static boolean vtverif(){
return getBoolValue("VT_Verification", true);
}
private static int getId(JSONObject json) {
private static int getId(JSONObject json){
var id = json.optInt("id", 0);
if (!json.optString(NavigatorKeys.e).equals("group") && !json.optString(NavigatorKeys.e).equals("page")
|| json.optString(NavigatorKeys.e).isEmpty())
@@ -122,7 +123,7 @@ public class VTVerifications {
return -id;
}
public static boolean isVerified(JSONObject jSONObject) {
public static boolean isVerified(JSONObject jSONObject){
if (jSONObject.optInt("verified", 0) == 1) {
return true;
}
@@ -134,7 +135,7 @@ public class VTVerifications {
return isVerified(getId(jSONObject));
}
public static boolean hasPrometheus(JSONObject jSONObject) {
public static boolean hasPrometheus(JSONObject jSONObject){
if (jSONObject.optInt("trending", 0) == 1) {
return true;
}
@@ -146,7 +147,7 @@ public class VTVerifications {
return isPrometheus(getId(jSONObject));
}
public static boolean hasDeveloper(JSONObject jSONObject) {
public static boolean hasDeveloper(JSONObject jSONObject){
if (!getBoolValue("VT_Dev", true)) {
return false;
}
@@ -154,7 +155,7 @@ public class VTVerifications {
return isDeveloper(getId(jSONObject));
}
public static VerifyInfo VerifyInfo(JSONObject jSONObject) {
public static VerifyInfo VerifyInfo(JSONObject jSONObject){
return new VerifyInfo(isVerified(jSONObject), hasPrometheus(jSONObject));
}
}
@@ -2,68 +2,51 @@ package ru.vtosters.lite.foaf;
import static android.widget.Toast.LENGTH_SHORT;
import static android.widget.Toast.makeText;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.getString;
import static ru.vtosters.lite.utils.ProxyUtils.apiproxy;
import static ru.vtosters.lite.utils.ProxyUtils.getApi;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Proxy.apiproxy;
import static ru.vtosters.lite.utils.Proxy.getApi;
import android.app.ProgressDialog;
import android.content.Context;
import android.util.Log;
import androidx.exifinterface.media.ExifInterface;
import com.vk.core.dialogs.alert.VkAlertDialog;
import com.vk.core.network.Network;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import ru.vtosters.lite.net.Request;
import ru.vtosters.lite.utils.Preferences;
public class FoafBase {
public class FoafBase{
private static final Pattern FOAF_REGEX = Pattern.compile("<ya:created dc:date=\"(.+?)\"\\/>");
private static final Pattern FOAF_REGEX_LAST_SEEN = Pattern.compile("<ya:lastLoggedIn dc:date=\"(.*)(((\\+|-)\\d\\d):(\\d\\d))\"\\/>");
private static final Pattern FOAF_REGEX_LOGIN = Pattern.compile("<ya:created dc:date=\"(.+?)\"\\/>");
private static final OkHttpClient client = new OkHttpClient();
public static long getLastSeen(long origtime, int id) throws ParseException, IOException {
var request = new okhttp3.Request.a()
.b(getLink(id))
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8")).a();
String response = null;
try {
response = client.a(request).execute().a().g();
} catch (IOException e) {
Log.e("FoafBase", e.getMessage());
}
Matcher matcher = FOAF_REGEX_LAST_SEEN.matcher(response);
public static long getLastSeen(long origtime, int id) throws ParseException, IOException{
if (!Preferences.foaf()) return origtime;
Matcher matcher = FOAF_REGEX_LAST_SEEN.matcher(
client.a(
new okhttp3.Request.a().a(getLink(id)).b().a()
).execute().a().g());
if (!matcher.find()) {
return origtime;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss", Locale.US);
sdf.setTimeZone(TimeZone.getTimeZone("Europe/Moscow"));
Date date = sdf.parse(matcher.group(1));
sdf.setTimeZone(TimeZone.getDefault());
return sdf.parse(sdf.format(date)).getTime() / 1000;
return new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss", Locale.getDefault()).parse(matcher.group(1)).getTime() / 1000;
}
private static String getLink(int i) {
private static String getLink(int i){
String str;
StringBuilder sb;
if (apiproxy()) {
@@ -78,7 +61,7 @@ public class FoafBase {
return sb.toString();
}
public static void loadAndShow(Context context, int i) {
public static void loadAndShow(Context context, int i){
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setMessage(getString("com_facebook_loading"));
progressDialog.setCancelable(false);
@@ -88,7 +71,7 @@ public class FoafBase {
Request.makeRequest(getLink(i), callback);
}
static void lambdaLoadAndShow(ProgressDialog progressDialog, Context context, int i, String str) {
static void lambdaLoadAndShow(ProgressDialog progressDialog, Context context, int i, String str){
try {
progressDialog.cancel();
Matcher matcher = FOAF_REGEX.matcher(str);
@@ -101,11 +84,11 @@ public class FoafBase {
a2.setMessage(getString("foafid") + " " + i + getString("foafregdate") + " " + normalHumanDate + getString("foafdate") + " " + daysPassedFromFoafDate(normalHumanDate)).setPositiveButton(17039370, null).create().show();
} catch (Exception e) {
e.printStackTrace();
makeText(getGlobalContext(), getString("foaferr"), LENGTH_SHORT).show();
makeText(context, getString("foaferr"), LENGTH_SHORT).show();
}
}
private static long daysPassedFromFoafDate(String str) {
private static long daysPassedFromFoafDate(String str){
try {
Date parse = new SimpleDateFormat("yyyy-MM-dd").parse(str.split(" ")[1]);
return TimeUnit.DAYS.convert(new Date().getTime() - parse.getTime(), TimeUnit.MILLISECONDS);
@@ -115,7 +98,7 @@ public class FoafBase {
}
}
private static String getNormalHumanDate(String str) {
private static String getNormalHumanDate(String str){
String[] split = str.split(ExifInterface.GPS_DIRECTION_TRUE);
return split[1].split("\\+")[0] + " " + split[0];
}
@@ -1,17 +0,0 @@
package ru.vtosters.lite.hooks;
import com.vk.extensions.ViewExtKt;
import com.vk.navigation.right.RightMenuPresenter;
import ru.vtosters.lite.ui.views.VTLCheckableButton;
public class DayNightButtonHook {
public static void injectOnClick(VTLCheckableButton button, RightMenuPresenter presenter) {
button.postOnAnimationDelayed(() -> {
var rect = ViewExtKt.e(button);
presenter.a(new float[] { rect.centerX(), rect.centerY() });
}, 550); // minimal delay for fix toggle animation
button.toggle();
}
}
@@ -1,39 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.util.Log;
import java.util.Random;
public class DeviceInfoHook{
public static String getDeviceInfo(String input) {
Log.d("DeviceInfoHook", "getDeviceInfo: " + input);
if (getBoolValue("hideDeviceInfo", true)) return "";
return input;
}
public static String getDeviceId(String input) {
Log.d("DeviceInfoHook", "getDeviceId: " + input);
Log.d("DeviceInfoHook", "getDeviceId shuffled: " + shuffle(input));
if (getBoolValue("hideDeviceInfo", true)) return shuffle(input);
return input;
}
public static String shuffle(String string) {
StringBuilder sb = new StringBuilder(string.length());
double rnd;
for (char c: string.toCharArray()) {
rnd = Math.random();
if (rnd < 0.34)
sb.append(c);
else if (rnd < 0.67)
sb.insert(sb.length() / 2, c);
else
sb.insert(0, c);
sb.append(new Random().nextInt(10));
sb.deleteCharAt(0);
}
return sb.toString();
}
}
@@ -1,18 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.ui.components.FragAnimationKit.setAnimations;
import static ru.vtosters.lite.utils.AndroidUtils.getPrefsValue;
import androidx.fragment.app.FragmentTransaction;
public class FragAnimationHook {
public static boolean animateOpen(FragmentTransaction transaction) {
setAnimations(transaction);
return getPrefsValue("anim_rtrn_type").equals("noanim") || getPrefsValue("anim_rtrn_type").isEmpty();
}
public static void animateClose(FragmentTransaction transaction) {
setAnimations(transaction);
}
}
@@ -1,676 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.foaf.FoafBase.getLastSeen;
import static ru.vtosters.lite.hooks.DateHook.getLocale;
import static ru.vtosters.lite.utils.Base64Utils.decode;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.checkCaption;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.checkCopyright;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isBadNews;
import static ru.vtosters.lite.utils.Preferences.ads;
import static ru.vtosters.lite.utils.Preferences.adsgroup;
import static ru.vtosters.lite.utils.Preferences.adsstories;
import static ru.vtosters.lite.utils.Preferences.authorsrecomm;
import static ru.vtosters.lite.utils.Preferences.dev;
import static ru.vtosters.lite.utils.Preferences.friendsblock;
import static ru.vtosters.lite.utils.Preferences.friendsrecomm;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.hasVerification;
import static ru.vtosters.lite.utils.Preferences.podcastcatalog;
import static ru.vtosters.lite.utils.Preferences.postsrecomm;
import static ru.vtosters.lite.utils.ThemesUtils.accentColors;
import static ru.vtosters.lite.utils.ThemesUtils.getAccentColor;
import static ru.vtosters.lite.utils.ThemesUtils.hex2;
import static ru.vtosters.lite.utils.VTVerifications.isDeveloper;
import static ru.vtosters.lite.utils.VTVerifications.isPrometheus;
import static ru.vtosters.lite.utils.VTVerifications.isVerified;
import android.graphics.Color;
import android.util.Log;
import com.vk.core.network.Network;
import com.vk.core.util.DeviceIdProvider;
import com.vk.core.util.LangUtils;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.text.ParseException;
import java.util.Locale;
import java.util.Objects;
import java.util.Random;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import ru.vtosters.lite.utils.AccountManagerUtils;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.NewsFeedFiltersUtils;
public class JsonInjectors {
private static final OkHttpClient mClient = new OkHttpClient();
public static JSONObject profileButton(JSONObject orig) throws JSONException {
var id = orig.getInt("id");
var newItem = new JSONArray();
if (orig.has("buttons")) {
newItem = orig.getJSONArray("buttons");
}
if (!haveDonateButton() && id == AccountManagerUtils.getUserId()) {
newItem.put(donateRecomm());
}
if (!orig.has("type") && AccountManagerUtils.isVKTester()) {
newItem.put(vktesters(id));
}
// get text color from all items
for (int i = 0; i < newItem.length(); i++) {
var item = newItem.getJSONObject(i);
if (item.has("text_color")) {
var textColor = item.getString("text_color");
if (accentColors.contains(Color.parseColor(textColor.startsWith("#") ? textColor : "#" + textColor))) {
item.put("text_color", hex2(getAccentColor()));
}
}
}
orig.put("buttons", newItem);
return orig;
}
public static JSONObject donateRecomm() throws JSONException {
var title = "Помоги проекту донатом и получи бонус!";
var link = "https://vk.com/vtosters_official";
var text_color = "2D81E0";
var json = new JSONObject();
var icons = new JSONArray();
var action = new JSONObject();
action.put("target", "internal");
action.put("type", "open_url"); // may be open_url, open_internal_vkui, open_game, help_hint, show_full_post, open_vkapp, show_recommendations_for_post and groups_advertisement
action.put("url", link);
json.put("action", action);
json.put("title", title);
var icon1 = new JSONObject();
icon1.put("url", "https://sun2-10.userapi.com/NLd_rNpGuSaBnPV6O-j5mqCGZk8BK8drAMd2LQ/5R-DEF37PFs.png");
icon1.put("width", "20");
icon1.put("height", "20");
icons.put(icon1);
var icon2 = new JSONObject();
icon2.put("url", "https://sun2-12.userapi.com/N8y9pU1meJq_eug-wB1u-HUuGyMqDfdq7A025w/A4Aio-xuLY8.png");
icon2.put("width", "40");
icon2.put("height", "40");
icons.put(icon2);
var icon3 = new JSONObject();
icon3.put("url", "https://sun2-9.userapi.com/3Hx4hff63_2Lt6wjjthJMF_3QLUswNNlQKoAXQ/oyzEu1NL9T8.png");
icon3.put("width", "80");
icon3.put("height", "80");
icons.put(icon3);
json.put("icons", icons);
json.put("text_color", text_color);
return json;
}
public static JSONObject vktesters(int id) throws JSONException {
var title = "Карточка Тестера";
var text_color = "2D81E0";
var link = "https://static.vk.com/bugs?lang=" + LangUtils.a() + "#/reporter" + id;
var json = new JSONObject();
var icons = new JSONArray();
var action = new JSONObject();
action.put("target", "internal");
action.put("type", "open_internal_vkui");
action.put("url", link);
json.put("action", action);
json.put("title", title);
var icon1 = new JSONObject();
icon1.put("url", "https://sun2-10.userapi.com/NLd_rNpGuSaBnPV6O-j5mqCGZk8BK8drAMd2LQ/5R-DEF37PFs.png");
icon1.put("width", "20");
icon1.put("height", "20");
icons.put(icon1);
var icon2 = new JSONObject();
icon2.put("url", "https://sun2-12.userapi.com/N8y9pU1meJq_eug-wB1u-HUuGyMqDfdq7A025w/A4Aio-xuLY8.png");
icon2.put("width", "40");
icon2.put("height", "40");
icons.put(icon2);
var icon3 = new JSONObject();
icon3.put("url", "https://sun2-9.userapi.com/3Hx4hff63_2Lt6wjjthJMF_3QLUswNNlQKoAXQ/oyzEu1NL9T8.png");
icon3.put("width", "80");
icon3.put("height", "80");
icons.put(icon3);
json.put("icons", icons);
json.put("text_color", text_color);
return json;
}
public static JSONObject convBar(JSONObject orig) throws JSONException {
var peerid = Objects.requireNonNull(orig.optJSONObject("peer")).optInt("id");
var pic = "https://image.pngaaa.com/641/326641-middle.png"; // can be null
var text = "Я не загрузил данные (9(9((";
var link = "https://vtosters.app"; // can be null
var linktitle = "Test button"; // can be null
// "{\"layout\":\"tertiary\",\"text\":\"" + linktitle + "\",\"type\":\"link\",\"link\":\"" + link + "\"}";
var buttons = decode("eyJsYXlvdXQiOiJ0ZXJ0aWFyeSIsInRleHQiOiI=") + linktitle + decode("IiwidHlwZSI6ImxpbmsiLCJsaW5rIjoi") + link + decode("In0=");
// ,"icon":" + pic + "
var icon = decode("LCJpY29uIjoi") + pic + decode("Ig==");
var hasIcon = !pic.isEmpty();
var hasButton = !buttons.isEmpty();
var isPicture = pic.endsWith(".png") || pic.endsWith(".jpg") || pic.endsWith(".jpeg") || pic.endsWith(".webp");
if (!isPicture) hasIcon = false;
if (!hasIcon) icon = "";
if (!hasButton) buttons = "";
if (isVerified(peerid)) text = "Я купил VTosters Premium";
if (isPrometheus(peerid)) text = "Я купил VTosters Premium Gold Prime Pro Plus";
if (isDeveloper(peerid)) text = "Я создал говно";
if (!isVerified(peerid) || text.equals("")) {
if (getBoolValue("convBarRecomm", false)) {
return null;
} else {
return orig.optJSONObject("conversation_bar");
}
}
if (!dev()) return orig.optJSONObject("conversation_bar");
// JSONObject("{\"name\":\"group_admin_welcome\",\"text\":\"" + textverif + "\",\"buttons\":[],\"icon\":\"" + pic + "\"}");
return new JSONObject(decode("eyJuYW1lIjoiZ3JvdXBfYWRtaW5fd2VsY29tZSIsInRleHQiOiI=")
+ text + decode("IiwiYnV0dG9ucyI6Ww==")
+ buttons + decode("XQ==")
+ icon
+ decode("fQ=="));
}
public static JSONObject menu(JSONObject orig) throws JSONException {
var Special = orig.optJSONArray("special");
var Main = orig.getJSONArray("main");
var Other = orig.optJSONArray("other");
if (Special != null) {
orig.remove("special");
}
return orig;
}
public static JSONObject superapp(JSONObject json) throws JSONException {
var superApps = AndroidUtils.getPreferences().getString("superapp_items",
"menu,miniapps,vkpay_slim,greeting,promo,holiday,weather,sport,games,informer,food,event,music,vk_run").split(",");
if (superApps.length == 0) return json;
var oldItems = json.optJSONArray("items");
var newItems = new JSONArray();
if (oldItems != null) {
for (int i = 0; i < oldItems.length(); i++) {
var item = oldItems.optJSONObject(i);
var type = item.optString("type");
for (String superApp : superApps) {
if (type.equals(superApp))
newItems.put(item);
}
}
for (int i = 0; i < superApps.length; i++) {
for (int j = i; j < newItems.length(); j++) {
var item = newItems.optJSONObject(j);
if (superApps[i].equals(item.optString("type")))
newItems.put(j, newItems.getJSONObject(i))
.put(i, item);
}
}
}
return json.putOpt("items", newItems);
}
public static JSONObject musiclink(JSONObject json) {
var oldItems = json.optJSONArray("links");
var section = json.optJSONObject("section");
var linksblock = section.optJSONArray("blocks");
var newBlock = new JSONArray();
if (oldItems != null) {
if (oldItems.optJSONObject(0).optString("url").contains("?section=recent")) {
json.remove("links");
for (int i = 0; i < linksblock.length(); i++) {
var item = linksblock.optJSONObject(i);
var datatype = item.optString("data_type");
var layname = item.optJSONObject("layout").optString("name");
if (!datatype.equals("links") && !layname.equals("separator")) {
newBlock.put(item);
}
}
try {
section.putOpt("blocks", newBlock);
} catch (JSONException e) {
e.printStackTrace();
}
if (dev()) Log.d("VKMusic", "Removed links buttons");
}
}
return json;
}
public static JSONObject setOnlineInfo(JSONObject json) throws ParseException, IOException, JSONException {
var id = json.optInt("id");
var onlineinfo = json.optJSONObject("online_info");
var time = getLastSeen(0L, id);
if (time != 0L && onlineinfo != null && !onlineinfo.optBoolean("is_online") && id != AccountManagerUtils.getUserId()) {
json.remove("online_info");
var online_info = new JSONObject()
.put("visible", true)
.put("last_seen", time)
.put("is_online", false)
.put("app_id", 0)
.put("is_mobile", false);
var last_seen = new JSONObject()
.put("platform", 4)
.put("time", time);
json.put("last_seen", last_seen).put("online_info", online_info);
}
return json;
}
public static JSONObject storiesads(JSONObject json, boolean isDeleteFix) throws JSONException {
if (!adsstories()) {
return json;
}
if (json.has("ads")) {
if (isDeleteFix) {
json.optJSONObject("ads").optJSONObject("settings")
.put("stories_interval", 0)
.put("authors_interval", 0)
.put("time_interval", 0)
.put("stories_init", 0)
.put("authors_init", 0)
.put("time_init", 0);
if (dev()) Log.d("StoriesAds", "Set ads settings at zero values");
} else {
json.remove("ads");
if (dev()) Log.d("StoriesAds", "Removed ads block");
}
}
if (!json.has("items")) return json;
var items = json.optJSONArray("items");
for (int i = 0; i < items.length(); i++) {
var item = items.optJSONObject(i);
if (item != null) {
parseStoriesItem(item);
}
}
return json;
}
private static void parseStoriesItem(JSONObject item) throws JSONException {
var stories = item.optJSONArray("stories");
var newStories = new JSONArray();
if (stories == null) return;
for (int j = 0; j < stories.length(); j++) {
var story = stories.optJSONObject(j);
if (!story.optBoolean("is_ads") && !story.optBoolean("is_promo")) {
newStories.put(story);
} else {
if (dev())
Log.d("StoriesAds", "Fetched ad, owner id " + story.optString("owner_id") + ", caption " + story.optString("caption"));
}
}
item.put("stories", newStories);
}
public static Boolean isAds(JSONObject list, String type) throws JSONException {
if (list == null || type == null || !ads()) return false;
if (list.has("ads")
|| type.equals("ads")
|| type.equals("carousel")
|| type.equals("html5_ad")
|| type.equals("ads_easy_promote")) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: ads");
return true;
}
if (type.equals("promo_button")
|| type.equals("app_widget")
|| type.equals("app_video")
|| type.equals("app_slider")
|| type.equals("tags_suggestions")) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: promo");
return true;
}
return false;
}
public static JSONArray newsfeedlist(JSONArray items) throws JSONException {
for (int j = 0; j < items.length(); j++) {
var list = items.optJSONObject(j);
var name = list.optString("id");
if (!name.equals("kpop") && !name.equals("foryou") && !name.equals("qazaqstan")) {
list.put("is_hidden", false).put("is_unavailable", false);
if (dev()) Log.d("NewsfeedListInj", "Unlocked " + name + " in newsfeed list");
}
}
return items;
}
public static JSONArray newsfeedadtest(JSONArray items) throws JSONException {
if (!getBoolValue("newadblock", true)) return items;
var newItems = new JSONArray();
for (int j = 0; j < items.length(); j++) {
var list = items.optJSONObject(j);
var type = list.optString("type");
if (isAds(list, type)) {
continue;
}
if (authorsrecomm() && (type.equals("authors_rec")
|| type.startsWith("recommended_") && (type.endsWith("audios")
|| type.endsWith("artists")
|| type.endsWith("playlists")
|| type.endsWith("groups")))) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: authorsrecomm");
continue;
}
if (postsrecomm() && (type.equals("inline_user_rec") || type.equals("live_recommended"))) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: postsrecomm");
continue;
}
if (friendsrecomm() && (type.equals("user_rec") || type.equals("friends_recomm"))) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: friendsrecomm");
continue;
}
if (adsgroup() && list.optInt("marked_as_ads") == 1) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: marked_as_ads is true");
continue;
}
if (isBadNews(list.optString("text"))) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: text filters");
continue;
}
if (checkCopyright(list)) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: copyright filters");
continue;
}
if (checkCaption(list)) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: caption filters");
continue;
}
if (NewsFeedFiltersUtils.injectFiltersReposts(list)) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: repost ad");
continue;
}
newItems.put(list);
}
return newItems;
}
public static JSONObject music(JSONObject json) throws JSONException {
var catalog = json.optJSONObject("catalog");
JSONArray oldItems = null;
if (catalog != null) {
oldItems = catalog.optJSONArray("sections");
}
if (oldItems != null && oldItems.optJSONObject(0).optString("url").contains("general")) {
if (podcastcatalog()) {
var podcasts = fetchCatalogPodcast();
if (podcasts != null) {
var catalogarr = podcasts.optJSONObject("catalog").optJSONArray("sections").optJSONObject(0);
var title = catalogarr.optString("title");
var id = catalogarr.optString("id");
var url = catalogarr.optString("url");
if (dev()) Log.d("VKMusic", "Added " + title + " in music sections");
oldItems.put(new JSONObject().put("id", id).put("title", title).put("url", url));
}
}
var playlists = fetchCatalogId("https://vk.com/audio?section=my_playlists");
if (playlists != null) {
var catalogarr = playlists.optJSONObject("catalog").optJSONArray("sections").optJSONObject(0);
var title = catalogarr.optString("title");
var id = catalogarr.optString("id");
var url = catalogarr.optString("url");
if (dev()) Log.d("VKMusic", "Added " + title + " in music sections");
oldItems.put(new JSONObject().put("id", id).put("title", title).put("url", url));
}
var albums = fetchCatalogId("https://vk.com/audio?section=albums");
if (albums != null) {
var catalogarr = albums.optJSONObject("catalog").optJSONArray("sections").optJSONObject(0);
var title = catalogarr.optString("title");
var id = catalogarr.optString("id");
var url = catalogarr.optString("url");
if (dev()) Log.d("VKMusic", "Added " + title + " in music sections");
oldItems.put(new JSONObject().put("id", id).put("title", title).put("url", url));
}
var recent = fetchCatalogId("https://vk.com/audio?section=recent");
if (recent != null) {
var catalogarr = recent.optJSONObject("catalog").optJSONArray("sections").optJSONObject(0);
var title = catalogarr.optString("title");
var id = catalogarr.optString("id");
var url = catalogarr.optString("url");
if (dev()) Log.d("VKMusic", "Added " + title + " in music sections");
oldItems.put(new JSONObject().put("id", id).put("title", title).put("url", url));
}
for (int i = 0; i < oldItems.length(); i++) {
var item = oldItems.optJSONObject(i);
var title = item.optString("title");
var id = item.optString("id");
var url = item.optString("url");
var value = AndroidUtils.getPrefsValue("musicdefcatalog");
Log.d("VKMusic", "title: " + title + " id: " + id + " url: " + url + " value: " + value);
if (url.contains(value)) {
catalog.put("default_section", id);
if (dev()) Log.d("VKMusic", "Added " + title + " as default music section");
}
}
}
return json;
}
public static JSONObject fetchCatalogId(String section) {
if (section == null) return null;
var request = new Request.a()
.b("https://api.vk.com/method/catalog.getAudio"
+ "?v=5.119"
+ "&https=1"
+ "&need_blocks=1"
+ "&lang="
+ getLocale()
+ "&device_id="
+ DeviceIdProvider.d(AndroidUtils.getGlobalContext())
+ "&url="
+ section
+ "&access_token="
+ AccountManagerUtils.getUserToken())
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8")).a();
try {
return new JSONObject(mClient.a(request).execute().a().g()).getJSONObject("response");
} catch (JSONException | IOException e) {
Log.d("VTLMusic", "Error: " + e.getMessage());
}
return null;
}
public static JSONObject fetchCatalogPodcast() {
var request = new Request.a()
.b("https://api.vk.com/method/catalog.getPodcasts"
+ "?v=5.119"
+ "&https=1"
+ "&need_blocks=1"
+ "&lang="
+ getLocale()
+ "&device_id="
+ DeviceIdProvider.d(AndroidUtils.getGlobalContext())
+ "&access_token="
+ AccountManagerUtils.getUserToken())
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8")).a();
try {
return new JSONObject(mClient.a(request).execute().a().g()).getJSONObject("response");
} catch (JSONException | IOException e) {
Log.d("VTLMusic", "Error: " + e.getMessage());
}
return null;
}
public static JSONObject friends(JSONObject json) throws JSONException {
JSONObject catalog = json;
boolean sectionexecute = true;
boolean hasBirthday = false;
if (json.optJSONObject("catalog") != null) {
catalog = json.optJSONObject("catalog");
sectionexecute = false;
}
JSONArray section = null;
JSONObject sections = null;
if (sectionexecute) {
sections = catalog.optJSONObject("section");
} else {
section = catalog.optJSONArray("sections");
}
JSONArray oldItems;
if (sectionexecute) {
oldItems = sections.optJSONArray("blocks");
} else {
oldItems = section.optJSONObject(0).optJSONArray("blocks");
}
var newItems = new JSONArray();
if (oldItems != null) {
for (int i = 0; i < oldItems.length(); i++) {
var type = oldItems.optJSONObject(i);
var name = type.optJSONObject("layout").optString("name");
var buttons = "";
var skip = false;
if (type.optJSONArray("buttons") != null) {
buttons = type.optJSONArray("buttons").optJSONObject(0).optString("ref_layout_name");
}
if (name.contains("list_friend_suggests") || buttons.contains("list_friend_suggests") || name.contains("separator")) {
skip = friendsblock();
}
if (buttons.contains("friends_birthdays_list")) {
hasBirthday = true;
}
if (name.contains("separator") && hasBirthday) {
skip = false;
hasBirthday = false;
}
if (!skip) {
newItems.put(type);
}
}
}
if (sectionexecute) {
sections.putOpt("blocks", newItems);
} else {
section.optJSONObject(0).putOpt("blocks", newItems);
}
return json;
}
public static boolean haveDonateButton() {
int randomshower = new Random().nextInt(6);
return hasVerification() || randomshower != 1;
}
}
@@ -1,39 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.ui.dialogs.ServerDialog.sendRequest;
import static ru.vtosters.lite.utils.CacheUtils.getInstance;
import static ru.vtosters.lite.utils.Preferences.checkupdates;
import static ru.vtosters.lite.utils.ThemesUtils.isDarkTheme;
import static ru.vtosters.lite.utils.ThemesUtils.setNeededTheme;
import android.app.Activity;
import android.os.Build;
import android.preference.PreferenceManager;
import ru.vtosters.lite.downloaders.notifications.NotificationChannels;
import ru.vtosters.lite.ui.dialogs.DisableBattery;
import ru.vtosters.lite.ui.dialogs.InstallGMS;
import ru.vtosters.lite.ui.dialogs.OTADialog;
import ru.vtosters.lite.ui.dialogs.ServerDialog;
import ru.vtosters.lite.ui.dialogs.Start;
public class MainActivityInjector {
public static void inject(Activity activity) {
setNeededTheme(activity);
ServerDialog.activity = activity;
sendRequest();
if (checkupdates()) OTADialog.checkUpdates(activity);
Start.alert(activity);
InstallGMS.alert(activity);
DisableBattery.alert(activity);
PreferenceManager.getDefaultSharedPreferences(activity)
.edit()
.putBoolean("isdark", isDarkTheme())
.commit();
getInstance().autoCleaningCache();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannels.createChannels();
}
// VKIDProtection.alert(activity);
}
}
@@ -1,107 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.ui.dialogs.MessageSettings.argDialog;
import static ru.vtosters.lite.ui.dialogs.MessageSettings.bombCount;
import static ru.vtosters.lite.ui.dialogs.MessageSettings.isSilentEnabled;
import static ru.vtosters.lite.utils.Preferences.autoalltranslate;
import static ru.vtosters.lite.utils.Preferences.autotranslate;
import static ru.vtosters.lite.utils.Preferences.savemsgsett;
import android.text.TextUtils;
import android.view.View;
import com.vk.api.internal.MethodCall;
import ru.vtosters.lite.translators.BaseTranslator;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.ArrayList;
public class MessagesHook {
public static String injectOwnText(String oldText) {
if (!autotranslate() || TextUtils.isEmpty(oldText))
return oldText;
var instance = BaseTranslator.getInstance();
return replaceMentions(oldText, instance);
}
public static String injectOwnTextAll(String oldText) {
if (!autoalltranslate() || TextUtils.isEmpty(oldText)) {
return oldText;
}
var instance = BaseTranslator.getInstance();
return replaceMentions(oldText, instance);
}
public static String replaceMentions(String oldText, BaseTranslator instance) {
try {
var matcher = Pattern.compile("(\\[(?:club|id|public)\\d+\\|[^]]+\\])|(@[^\\s]+)").matcher(oldText);
var mentionsCount = 0;
var textBuff = new StringBuffer();
var mentions = new ArrayList<String>();
while (matcher.find()) {
mentions.add(matcher.group());
matcher.appendReplacement(textBuff, "vtl_mention" + mentionsCount + ""); ++mentionsCount;
}
matcher.appendTail(textBuff);
var translatedText = instance.getTranslation(textBuff.toString());
var matcherMentions = Pattern.compile("vtl_mention(\\d+)").matcher(translatedText);
var retTextBuff = new StringBuffer();
while (matcherMentions.find()) {
matcherMentions.appendReplacement(retTextBuff, mentions.get(
Integer.parseInt(matcherMentions.group(1))
));
}
matcherMentions.appendTail(retTextBuff);
return retTextBuff.toString();
} catch(Exception e) {
e.printStackTrace();
return instance.getTranslation(oldText);
}
}
public static void onLongClick(View view) {
view.setOnLongClickListener(v -> {
argDialog(v.getContext());
return true;
});
}
public static void injRequest(MethodCall.a req) {
var time = expireTime();
if (time > 0) {
req.a("expire_ttl", time);
if (!savemsgsett()) bombCount = "0";
}
if (isSilentEnabled) {
req.a("silent", 1);
if (!savemsgsett()) isSilentEnabled = false;
}
}
private static int expireTime() {
switch (bombCount) {
case "15s":
return 15;
case "1m":
return 60;
case "5m":
return 300;
case "1h":
return 3600;
case "24h":
return 86400;
default:
return 0;
}
}
}
@@ -1,76 +0,0 @@
package ru.vtosters.lite.hooks;
import static java.lang.Long.MAX_VALUE;
import static ru.vtosters.lite.utils.AndroidUtils.getPrefsValue;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.checkCaption;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.checkCopyright;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.injectFiltersReposts;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isAds;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isAuthorRecommendations;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isBadNews;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isFriendsRecommendations;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isGroupAds;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isMusicBlock;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isNewsBlock;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isPostRecommendations;
import static ru.vtosters.lite.utils.NewsFeedFiltersUtils.isRecomsGroup;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.vkme;
import com.vk.core.preference.Preference;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
public class NewsfeedHook {
public static boolean injectFilters(JSONObject obj) throws JSONException {
if (getBoolValue("newadblock", true)) return true;
var optString = obj.optString("type", "");
if (isAds(optString) || isAuthorRecommendations(optString) || isPostRecommendations(optString) || isFriendsRecommendations(optString) || isRecomsGroup(optString) || isMusicBlock(optString) || isNewsBlock(optString)) {
return false;
}
optString = obj.optString("post_type", "");
if (isAds(optString) || isAuthorRecommendations(optString) || isPostRecommendations(optString) || isFriendsRecommendations(optString) || isMusicBlock(optString) || isNewsBlock(optString)) {
return false;
}
optString = obj.optString("filters", "");
if (isAds(optString) || isAuthorRecommendations(optString) || isPostRecommendations(optString) || isFriendsRecommendations(optString)) {
return false;
}
if (checkCopyright(obj)) return false;
if (isBadNews(obj.optString("text", ""))) return false;
if (checkCaption(obj)) return false;
if (isGroupAds(obj)) return false;
return !injectFiltersReposts(obj);
} // inject our filters to newsfeed, getpost and discover
public static long getUpdateNewsfeed(boolean refresh_timeout) {
if (vkme()) {
return MAX_VALUE;
}
switch (getPrefsValue("newsupdate")) {
case "no_update":
return MAX_VALUE;
case "imd_update":
return 10000L;
default:
return Preference.b().getLong(refresh_timeout ? "refresh_timeout_top" : "refresh_timeout_recent", 600000L);
}
}
public static List hideElement(ArrayList list) {
if (!getBoolValue("whatsnew", true)) {
list.clear();
}
return list;
}
}
@@ -1,169 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import static ru.vtosters.lite.utils.AndroidUtils.getPreferences;
import android.annotation.SuppressLint;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.Toast;
import com.vk.core.dialogs.actionspopup.ActionsPopup;
import com.vk.core.drawable.RecoloredDrawable;
import com.vk.dto.common.AttachmentWithMedia;
import com.vtosters.lite.R;
import com.vtosters.lite.attachments.PhotoAttachment;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.net.URLEncoder;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.ThemesUtils;
public class PhotoViewer {
static OkHttpClient client = new OkHttpClient();
public static boolean interceptClick(AttachmentWithMedia attachment, MenuItem item, View view) {
if (item.getItemId() == AndroidUtils.getIdentifier("search_photo", "id")) {
searchPhoto(getUrlFromAttachment((PhotoAttachment) attachment));
return true;
} else if (item.getItemId() == AndroidUtils.getIdentifier("copy_photo_url", "id")) {
copyPhotoUrl(getUrlFromAttachment((PhotoAttachment) attachment));
return true;
} else if (item.getItemId() == AndroidUtils.getIdentifier("open_original_photo", "id")) {
openUrl(getUrlFromAttachment((PhotoAttachment) attachment));
return true;
}
return true;
}
@SuppressLint("UseCompatLoadingForDrawables")
public static void addMenuItems(AttachmentWithMedia attachment, ActionsPopup.b actionPopup, int i, boolean z) {
actionPopup.a(getIdentifier("search_photo_content", "string"),
ThemesUtils.isDarkTheme()
? AndroidUtils.getGlobalContext().getDrawable(R.drawable.ic_menu_search_outline_28)
: new RecoloredDrawable(AndroidUtils.getGlobalContext().getDrawable(R.drawable.ic_menu_search_outline_28), ThemesUtils.getAccentColor()),
false,
() -> {
searchPhoto(getUrlFromAttachment((PhotoAttachment) attachment));
return null;
}
);
actionPopup.a(getIdentifier("copy_photo_url_content", "string"),
!ThemesUtils.isDarkTheme()
? new RecoloredDrawable(AndroidUtils.getGlobalContext().getDrawable(R.drawable.ic_copy_outline_28), ThemesUtils.getAccentColor())
: new RecoloredDrawable(AndroidUtils.getGlobalContext().getDrawable(R.drawable.ic_copy_outline_28), Color.WHITE),
false,
() -> {
copyPhotoUrl(getUrlFromAttachment((PhotoAttachment) attachment));
return null;
}
);
actionPopup.a(getIdentifier("open_original_photo_content", "string"),
ThemesUtils.isDarkTheme()
? AndroidUtils.getGlobalContext().getDrawable(R.drawable.ic_link_outline_28)
: new RecoloredDrawable(AndroidUtils.getGlobalContext().getDrawable(R.drawable.ic_link_outline_28),
ThemesUtils.getAccentColor()),
false,
() -> {
openUrl(getUrlFromAttachment((PhotoAttachment) attachment));
return null;
}
);
}
private static String getUrlFromAttachment(PhotoAttachment attachment) {
var imageSizes = attachment.D.Q.t1();
if (imageSizes.isEmpty())
return null;
var max = imageSizes.get(0);
for (int i = 1; i < imageSizes.size(); ++i) {
var size = imageSizes.get(i);
if (max != null && max.t1() < size.t1()) {
max = size;
}
}
return max.url;
}
private static void searchPhoto(String url) {
if (url == null || url.isEmpty()) return;
switch (getPreferences().getInt("search_engine", 0)) {
case 0:
searchWithYandex(url);
break;
case 1:
searchWithGoogle(url);
break;
case 2:
searchWithBing(url);
break;
}
}
private static void searchWithYandex(String url) {
var request = new Request.a()
.b(String.format("https://yandex.ru/images-apphost/image-download?url=%s&images_avatars_size=preview&images_avatars_namespace=images-cbir",
URLEncoder.encode(url)))
.a();
client.a(request).a(new Callback() {
@Override
public void a(Call call, IOException e) {
Log.d("PhotoViewer", e + "");
}
@Override
public void a(Call call, Response response) throws IOException {
try {
JSONObject payload = new JSONObject(response.a().g());
var cbirId = payload.optInt("image_shard") + "/" + payload.optString("image_id");
var imageUrl = String.format("https://avatars.mds.yandex.net/get-images-cbir/%s/orig", cbirId);
var searchUrl = String.format("https://yandex.ru/images/search?rpt=imageview&url=%s&cbir_id=%s", imageUrl, cbirId);
openUrl(searchUrl);
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
private static void searchWithGoogle(String url) {
openUrl("https://www.google.ru/searchbyimage?image_url=" +
URLEncoder.encode(url));
}
private static void searchWithBing(String url) {
openUrl("https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIDP&sbisrc=UrlPaste&q=imgurl:"
+ URLEncoder.encode(url));
}
private static void copyPhotoUrl(String url) {
if (url == null || url.isEmpty()) return;
ClipboardManager manager = (ClipboardManager) AndroidUtils.getGlobalContext().getSystemService(Context.CLIPBOARD_SERVICE);
manager.setPrimaryClip(ClipData.newPlainText("vk_photo_url", url));
Toast.makeText(AndroidUtils.getGlobalContext(), AndroidUtils.getIdentifier("copied_to_clipboard", "string"), Toast.LENGTH_SHORT).show();
}
private static void openUrl(String url) {
var uri = Uri.parse(url);
var intent = new Intent(Intent.ACTION_VIEW, uri);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
AndroidUtils.getGlobalContext().startActivity(intent);
}
}
@@ -1,67 +0,0 @@
package ru.vtosters.lite.hooks;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import androidx.recyclerview.widget.RecyclerView;
import com.vk.newsfeed.holders.BaseFooterHolder;
import com.vtosters.lite.R;
import ru.vtosters.lite.utils.Preferences;
public class PostViewHook {
/**
* For displaying child elements with custom direction in rtl container we should remove their, set layout direction and add again */
private static void saveChildDirectionForRlt(ViewGroup container) {
var children = new View[container.getChildCount()];
for (int i = 0; i < container.getChildCount(); i++) {
var child = container.getChildAt(i);
child.setLayoutDirection(View.LAYOUT_DIRECTION_LTR);
children[i] = child;
}
container.removeAllViews();
for (View child : children) {
container.addView(child);
}
container.setLayoutDirection(View.LAYOUT_DIRECTION_RTL);
}
// res/layout/likes_panel.xml
public static void injectBaseFooterHolder(BaseFooterHolder baseFooterHolder) {
if (!Preferences.isLikesOnRightEnabled())
return;
try {
var container = (ViewGroup) ((RecyclerView.ViewHolder) baseFooterHolder).itemView;
saveChildDirectionForRlt((ViewGroup) container.getChildAt(1));
} catch (Exception e) {
e.printStackTrace();
}
}
// res/layout/photo_viewer_bottom.xml
public static void injectPhotoViewer(View container) {
if (!Preferences.isLikesOnRightEnabled())
return;
try {
var bottomPanel = (ViewGroup) container.findViewById(R.id.photo_viewer_bottom_panel);
saveChildDirectionForRlt(bottomPanel);
} catch (Exception e) {
e.printStackTrace();
}
}
// res/layout/video_bottom_view.xml
public static void injectVideoView(RelativeLayout container) {
if (!Preferences.isLikesOnRightEnabled())
return;
try {
var bottomBar = (ViewGroup) container.findViewById(R.id.bottom_bar);
saveChildDirectionForRlt(bottomBar);
} catch (Exception e) {
e.printStackTrace();
}
}
}
@@ -1,26 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.utils.Preferences.dev;
import android.util.Log;
import com.vk.api.internal.MethodCall;
import java.util.LinkedHashMap;
public class RequestDumper{
public static void addParams(MethodCall.a paramslist, String method, LinkedHashMap params, String apiver) {
if (method.contains("execute.getGiftByStickerId")) {
apiver = "5.187";
}
if (dev()) {
Log.d("RequestDumper", "Method: " + method);
Log.d("RequestDumper", "API version: " + apiver);
Log.d("RequestDumper", "Params: " + params);
}
paramslist.a(method);
paramslist.a(params);
paramslist.b(apiver);
}
}
@@ -1,86 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.ui.components.DockBarEditorManager.getInstance;
import static ru.vtosters.lite.utils.AndroidUtils.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.milkshake;
import static ru.vtosters.lite.utils.Preferences.superapp;
import static ru.vtosters.lite.utils.Preferences.videonewcatalog;
import static ru.vtosters.lite.utils.Preferences.vkme;
import com.vk.apps.AppsFragment;
import com.vk.discover.ThemedFeedFragment;
import com.vk.fave.fragments.FaveTabFragment;
import com.vk.menu.MenuFragment;
import com.vk.menu.SearchMenuFragment;
import com.vk.music.fragment.MusicCatalogFragment1;
import com.vk.music.fragment.MusicFragment;
import com.vk.newsfeed.HomeFragment;
import com.vk.newsfeed.NewsfeedFragment;
import com.vk.notifications.NotificationsContainerFragment;
import com.vk.profile.catalog.CommunitiesCatalogFragment;
import com.vk.superapp.SuperAppFragment;
import com.vtosters.lite.fragments.ProfileFragment;
import com.vtosters.lite.fragments.friends.FriendsFragment;
import com.vtosters.lite.fragments.gifts.BirthdaysFragment;
import com.vtosters.lite.fragments.lives.LivesTabsFragment;
import com.vtosters.lite.fragments.money.MoneyTransfersFragment;
import com.vtosters.lite.fragments.p2.DocumentsViewFragment;
import com.vtosters.lite.fragments.s2.GroupsFragment1;
import com.vtosters.lite.fragments.t2.c.DialogsFragment;
import com.vtosters.lite.fragments.y2.VideoCatalogFragment;
import com.vtosters.lite.fragments.y2.VideosFragment;
import com.vtosters.lite.general.fragments.GamesFragment;
import com.vtosters.lite.general.fragments.PhotosFragment;
import ru.vtosters.lite.ui.fragments.VTSettings;
public class StartFragmentHook {
public static Class getStartFragment() {
if (vkme()) {
return DialogsFragment.class;
}
switch (getPrefsValue("start_values")) {
case "newsfeed":
return milkshake() ? HomeFragment.class : NewsfeedFragment.class;
case "messenger":
return DialogsFragment.class;
case "groups":
return milkshake() ? CommunitiesCatalogFragment.class : GroupsFragment1.class;
case "music":
return getBoolValue("musicnewcatalog", true) ? MusicCatalogFragment1.class : MusicFragment.class;
case "friends":
return FriendsFragment.class;
case "photos":
return PhotosFragment.class;
case "videos":
return videonewcatalog() ? VideoCatalogFragment.class : VideosFragment.class;
case "settings":
return VTSettings.class;
case "apps":
return AppsFragment.class;
case "discover":
return ThemedFeedFragment.class;
case "notifications":
return NotificationsContainerFragment.class;
case "money":
return MoneyTransfersFragment.class;
case "games":
return GamesFragment.class;
case "liked":
return FaveTabFragment.class;
case "menu":
return milkshake() ? (superapp() ? SuperAppFragment.class : SearchMenuFragment.class) : MenuFragment.class;
case "profile":
return ProfileFragment.class;
case "lives":
return LivesTabsFragment.class;
case "docs":
return DocumentsViewFragment.class;
case "brtd":
return BirthdaysFragment.class;
default:
return getInstance().getSelectedTabs().get(0).fragmentClass;
}
}
}
@@ -1,14 +0,0 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.utils.Preferences.adsstories;
import static ru.vtosters.lite.utils.Preferences.stories;
public class StoriesHook {
public static String ads() {
return adsstories() ? "null" : "ads";
}
public static boolean showstories() {
return stories();
}
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.music;
public interface Callback {
public interface Callback{
void onProgress(int progress);
void onSuccess();
@@ -11,22 +11,21 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.IOUtils;
import ru.vtosters.lite.utils.Globals;
public class FFMpeg {
public class FFMpeg{
private static final int BUFFER_SIZE = 2048;
private static void copyAssets() {
private static void copyAssets(){
try {
String[] files = AndroidUtils.getGlobalContext().getAssets().list("ffmpeg");
String[] files = Globals.getContext().getAssets().list("ffmpeg");
for (String file : files) {
if (file.endsWith(".so")) {
InputStream in = AndroidUtils.getGlobalContext().getAssets().open("ffmpeg" + File.separator + file);
FileOutputStream out = new FileOutputStream(AndroidUtils.getGlobalContext().getFilesDir() + File.separator + file);
InputStream in = Globals.getContext().getAssets().open("ffmpeg" + File.separator + file);
FileOutputStream out = new FileOutputStream(Globals.getContext().getFilesDir() + File.separator + file);
byte[] buffer = new byte[BUFFER_SIZE];
int read;
while ((read = in.read(buffer)) != -1) {
while((read = in.read(buffer)) != -1) {
out.write(buffer, 0, read);
}
in.close();
@@ -38,15 +37,15 @@ public class FFMpeg {
}
}
private static void checkFFMpegLibs() {
var lib = new File(AndroidUtils.getGlobalContext().getFilesDir(), "libffmpegkit_abidetect.so");
private static void checkFFMpegLibs(){
var lib = new File(Globals.getContext().getFilesDir(), "libffmpegkit_abidetect.so");
if (!lib.exists()) {
ToastUtils.a("Копирование библиотеки ffmpegkit");
copyAssets();
}
}
public static boolean convert(String in, String out) {
public static boolean convert(String in, String out){
checkFFMpegLibs();
// write the list of all .ts files to a txt file in "in" directory
@@ -65,20 +64,27 @@ public class FFMpeg {
e.printStackTrace();
}
// concatenate .ts files to a single .ts file
FFmpegKit.execute("-f concat -safe 0 -i " + in + "/list.txt -c copy " + in + "/all.ts");
var concat = FFmpegKit.execute("-f concat -safe 0 -i " + in + "/list.txt -c copy " + in + "/all.ts");
// convert .ts file to .mp3 file via ffmpeg
var session = FFmpegKit.execute("-i " + in + "/all.ts -f mp3 -acodec mp3 -q:a 0 -y '" + out + "'");
var session = FFmpegKit.execute("-i " + in + "/all.ts -f mp3 -acodec mp3 -b 320 -y '" + out + "'");
var rc = session.getReturnCode();
if (ReturnCode.isSuccess(rc)) {
// remove temp files
IOUtils.deleteRecursive(new File(in));
deleteRecursively(new File(in));
return true;
} else {
Log.e("FFMpeg", "FFmpegKit failed with return code " + rc);
return false;
}
}
Log.e("FFMpeg", "FFmpegKit failed with return code " + rc);
return false;
private static void deleteRecursively(File fileOrDirectory){
if (fileOrDirectory.isDirectory()) for (File child : fileOrDirectory.listFiles())
deleteRecursively(child);
fileOrDirectory.delete();
}
}
@@ -16,55 +16,64 @@ import okhttp3.Call;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import ru.vtosters.lite.utils.IOUtils;
import ru.vtosters.lite.utils.StreamUtils;
public class M3UDownloader {
public class M3UDownloader{
private static OkHttpClient client = new OkHttpClient();
private final String mURL;
private final File mOutDir;
private final Callback mCallback;
private OkHttpClient mClient = new OkHttpClient();
public static void execute(String url, File outDir, Callback callback) {
public M3UDownloader(String url, File outDir, Callback callback){
mURL = url;
mOutDir = outDir;
mCallback = callback;
}
public void execute(){
var request = new Request.a()
.b(url)
.b(mURL)
.a();
client.a(request).a(new okhttp3.Callback() {
mClient.a(request).a(new okhttp3.Callback(){
@Override
public void a(Call call, IOException e) {
public void a(Call call, IOException e){
}
@Override
public void a(Call call, Response response) throws IOException {
parse(response.a().g(), outDir, callback);
public void a(Call call, Response response) throws IOException{
parse(response.a().g());
}
});
}
private static void parse(String payload, File outDir, Callback callback) {
private void parse(String payload){
try {
VKM3UParser parser = new VKM3UParser(payload);
List<TransportStream> tses = parser.getTransportStreams();
callback.onProgress(5);
mCallback.onProgress(5);
for (TransportStream ts : tses) {
String tsURL = parser.getBaseUrl() + ts.getName();
Log.d("M3UDownloader", "Downloading " + tsURL);
InputStream is = IOUtils.openStream(tsURL);
InputStream is = StreamUtils.openStream(tsURL);
byte[] content;
if (TransportStream.METHOD_AES128.equals(ts.getMethod())) {
String key = IOUtils.readAllLines(IOUtils.openStream(ts.getKeyURL()));
content = IOUtils.decodeStream(is, key);
String key = StreamUtils.readAllLines(StreamUtils.openStream(ts.getKeyURL()));
content = StreamUtils.decodeStream(is, key);
} else {
content = IOUtils.readAllBytes(is);
content = StreamUtils.readAllBytes(is);
}
File tsDump = new File(outDir, ts.getName());
IOUtils.writeToFile(tsDump, content);
callback.onSizeReceived((long) content.length * tses.size(), parser.getHeapSize());
callback.onProgress(10 + Math.round(80.0f * tses.indexOf(ts) / tses.size()));
File tsDump = new File(mOutDir, ts.getName());
StreamUtils.writeToFile(tsDump, content);
mCallback.onSizeReceived((long) content.length * tses.size(), parser.getHeapSize());
mCallback.onProgress(10 + Math.round(80.0f * tses.indexOf(ts) / tses.size()));
}
} catch (IOException | NoSuchPaddingException | NoSuchAlgorithmException | InvalidAlgorithmParameterException | InvalidKeyException e) {
e.printStackTrace();
callback.onFailure();
mCallback.onFailure();
return;
}
callback.onSuccess();
mCallback.onSuccess();
}
}
@@ -1,83 +0,0 @@
package ru.vtosters.lite.music;
import android.app.DownloadManager;
import android.net.Uri;
import android.os.Environment;
import android.util.Log;
import android.widget.Toast;
import com.vk.dto.music.MusicTrack;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import ru.vtosters.lite.downloaders.AudioDownloader;
import ru.vtosters.lite.utils.AndroidUtils;
public class MP3Downloader {
private static final String URL_FORMAT = "https://api.vk.com/method/audio.getById?v=5.131&access_token=%s&audios=%s&copyright=https://vtosters.app/";
private static final OkHttpClient client = new OkHttpClient();
public static void execute(MusicTrack track) {
var token = AndroidUtils.getPreferences().getString("vk_admin_token", "");
if (token.isEmpty()) {
Toast.makeText(AndroidUtils.getGlobalContext(), "Обновите токен VK Admin в настройках", Toast.LENGTH_SHORT).show();
return;
}
var request = new Request.a()
.b(String.format(URL_FORMAT, token, track.y1()))
.a();
client.a(request).a(new Callback() {
@Override
public void a(Call call, IOException e) {
Log.d("MP3Downloader", e + "");
}
@Override
public void a(Call call, Response response) throws IOException {
var payload = response.a().g();
Log.d("MP3Downloader", payload);
try {
JSONObject jsonObj = new JSONObject(payload);
if (jsonObj.has("response")) {
JSONObject responseNode = new JSONObject(payload).getJSONArray("response")
.getJSONObject(0);
if (responseNode.has("url")) {
var url = responseNode.optString("url");
Log.d("MP3Downloader", url);
if (url != null) {
if (url.endsWith(".mp3")) {
downloadMP3(track.toString(), url);
} else if (VKM3UParser.isM3U8(url)) {
AudioDownloader.downloadM3U8(track);
}
}
}
}
} catch (JSONException e) {
Log.d("MP3Downloader", e + "");
}
}
});
}
private static void downloadMP3(String title, String url) {
var downloadManager = AndroidUtils.getGlobalContext().getSystemService(DownloadManager.class);
var request = new DownloadManager.Request(Uri.parse(url))
.setAllowedOverRoaming(true)
.setTitle("Downloading " + title)
.setDestinationInExternalFilesDir(AndroidUtils.getGlobalContext(),
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath(),
title + ".mp3")
.setVisibleInDownloadsUi(true);
downloadManager.enqueue(request);
}
}
@@ -1,176 +0,0 @@
package ru.vtosters.lite.music;
import static java.lang.String.valueOf;
import static ru.vtosters.lite.utils.AndroidUtils.MD5;
import static ru.vtosters.lite.utils.AndroidUtils.edit;
import static ru.vtosters.lite.utils.AndroidUtils.getDefaultPrefs;
import static ru.vtosters.lite.utils.AndroidUtils.getPreferences;
import static ru.vtosters.lite.utils.AndroidUtils.sendToast;
import android.util.Log;
import com.vk.dto.music.MusicTrack;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Map;
import java.util.TreeMap;
import ru.vtosters.lite.net.NetCall;
import ru.vtosters.lite.net.NetCallback;
import ru.vtosters.lite.net.NetClient;
import ru.vtosters.lite.net.NetRequest;
import ru.vtosters.lite.net.NetResponse;
public class Scrobbler {
private static final String key = "5965d63402414776c54c266db0211746";
private static final String keysecret = "d982180eed13275bb948e41cf225f88f";
private static final String url = "https://ws.audioscrobbler.com/2.0/";
private static final NetClient client = new NetClient.Builder().build();
private static final ArrayList<String> scrobbled = new ArrayList<>();
public static void scrobbleTrack(long duration, String artist, String title, String uid) {
var string = getDefaultPrefs().getString("sessionKey", null);
var timestamp = System.currentTimeMillis() / 1000;
Log.d("Scrobbler", "scrobbleTrack: " + title + " - " + artist + " - " + duration + " - " + uid);
if (!needToBeScrobble(uid) ||
string == null ||
string.isEmpty() ||
artist == null ||
artist.isEmpty() ||
title == null ||
title.isEmpty() ||
duration == 0) return;
scrobbled.add(uid); // add to scrobbled list
TreeMap<String, String> treeMap = new TreeMap<>(); // create map for request
treeMap.put("method", "track.scrobble");
treeMap.put("sk", string);
treeMap.put("artist[0]", artist);
treeMap.put("track[0]", title);
treeMap.put("timestamp[0]", valueOf(timestamp));
treeMap.put("api_key", key);
treeMap.put("duration[0]", valueOf(duration));
treeMap.put("api_sig", signMD5(treeMap));
treeMap.put("format", "json");
client.newCall(new NetRequest.Builder().url(url).post().params(treeMap).build()).enqueue(new NetCallback() {
@Override
public void onFailure(NetCall call, IOException e) {
Log.d("Scrobbler", "Error: " + e.getMessage());
}
@Override
public void onResponse(NetCall call, NetResponse response) {
Log.d("Scrobbler", "Scrobbled: " + artist + " - " + title);
Log.d("Scrobbler", "Response scrobble: " + response.getDataString());
}
});
}
public static void grabMusicTrack(MusicTrack musictrack) {
var uid = musictrack.y1();
var artist = musictrack.C;
var title = musictrack.f;
var duration = musictrack.h;
if (uid.isEmpty() || artist == null || artist.isEmpty() || title == null || title.isEmpty() || duration == 0) {
Log.d("Scrobbler", "grabTrackInfo: " + "Empty track, info: " + artist + " - " + title + " - " + duration + " - " + uid);
return;
}
scrobbleTrack(duration, artist, title, uid);
}
private static String signMD5(Map<String, String> map) {
var sb = new StringBuilder();
for (Map.Entry<String, String> entry : map.entrySet()) {
sb.append(entry.getKey());
sb.append(entry.getValue());
}
sb.append(keysecret);
return MD5(sb.toString());
}
public static void auth(String login, String pass) {
if (login == null || pass == null) {
sendToast("Логин или пароль не заданы");
return;
}
TreeMap<String, String> treeMap = new TreeMap<>(); // create map for request
treeMap.put("method", "auth.getMobileSession");
treeMap.put("api_key", key);
treeMap.put("username", login);
treeMap.put("password", pass);
treeMap.put("api_sig", signMD5(treeMap));
treeMap.put("format", "json");
client.newCall(new NetRequest.Builder().url(url).post().params(treeMap).build()).enqueue(new NetCallback() {
@Override
public void onFailure(NetCall call, IOException e) {
Log.d("Scrobbler", "Auth failed", e);
sendToast("Ошибка входа");
}
@Override
public void onResponse(NetCall call, NetResponse response) {
try {
var jSONObject = new JSONObject(response.getDataString());
sessionFetcher(jSONObject);
Log.d("Scrobbler", "Auth response " + response.getDataString());
} catch (JSONException e) {
Log.d("Scrobbler", "Auth failed", e);
}
}
});
}
public static void sessionFetcher(JSONObject jsonObject) throws JSONException {
if (!jsonObject.has("session")) {
Log.d("Scrobbler", "Auth failed - no session");
return;
}
var session = jsonObject.getJSONObject("session");
var name = session.getString("name");
var key = session.getString("key");
getDefaultPrefs().edit().putString("username", name).
putString("sessionKey", key).apply();
Log.d("Scrobbler", "Auth success as " + name + ", key " + key);
}
public static void logout() {
edit().remove("username").apply();
edit().remove("sessionKey").apply();
scrobbled.clear();
sendToast("Вы успешно вышли из учетной записи");
}
public static boolean needToBeScrobble(String uid) {
return isLoggedIn() && isScrobblingEnabled() && !scrobbled.contains(uid);
}
public static boolean isLoggedIn() {
return getDefaultPrefs().getString("sessionKey", null) != null;
}
public static boolean isScrobblingEnabled() {
return getPreferences().getBoolean("lastfm_enabled", false);
}
public static String getUserName() {
return getDefaultPrefs().getString("username", null);
}
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.music;
public class TransportStream {
public class TransportStream{
public static final String METHOD_NONE = "NONE";
public static final String METHOD_AES128 = "AES-128";
@@ -9,28 +9,28 @@ public class TransportStream {
private String mName;
private String mKeyURL;
public TransportStream() {
public TransportStream(){
this.mMethod = METHOD_NONE;
}
public TransportStream(String method, String keyURL) {
public TransportStream(String method, String keyURL){
this.mMethod = method;
this.mKeyURL = keyURL;
}
public String getMethod() {
public String getMethod(){
return mMethod;
}
public String getName() {
public String getName(){
return mName;
}
public void setName(String name) {
public void setName(String name){
mName = name;
}
public String getKeyURL() {
public String getKeyURL(){
return mKeyURL;
}
}
@@ -4,7 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
public class VKM3UParser {
public class VKM3UParser{
private final String mData;
private final List<TransportStream> mTransportStreams = new ArrayList<>();
@@ -13,15 +13,15 @@ public class VKM3UParser {
private int mHeapSize = 0;
private String mBaseURL;
public VKM3UParser(String data) {
public VKM3UParser(String data){
mData = data;
init();
}
private void init() {
private void init(){
int i = 0;
Scanner scanner = new Scanner(mData);
while (scanner.hasNext()) {
while(scanner.hasNext()) {
String line = scanner.nextLine();
mHeapSize += line.getBytes().length;
if (line.startsWith("#EXT-X-TARGETDURATION")) {
@@ -40,30 +40,26 @@ public class VKM3UParser {
} else if (line.startsWith("#EXTINF")) {
if (mTransportStreams.size() == i)
mTransportStreams.add(new TransportStream());
} else if (isM3U8(line)) {
} else if (line.endsWith(".ts") || line.endsWith(".tp") || line.endsWith(".mpeg-ts") || line.endsWith(".m2ts")) {
mTransportStreams.get(i).setName(line);
++i;
}
}
}
private String getDirectiveValue(String directive) {
private String getDirectiveValue(String directive){
return directive.substring(directive.indexOf(":") + 1);
}
public static boolean isM3U8(String str) {
return str.endsWith(".ts") || str.endsWith(".tp") || str.endsWith(".mpeg-ts") || str.endsWith(".m2ts");
}
public int getHeapSize() {
public int getHeapSize(){
return mHeapSize;
}
public String getBaseUrl() {
public String getBaseUrl(){
return mBaseURL;
}
public List<TransportStream> getTransportStreams() {
public List<TransportStream> getTransportStreams(){
return mTransportStreams;
}
}
@@ -1,7 +1,6 @@
package ru.vtosters.lite.net;
import android.util.Base64;
import android.util.Log;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -16,16 +15,16 @@ import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.TreeMap;
public final class NetCall {
public final class NetCall{
private final NetRequest req;
private final NetClient cl;
protected NetCall(NetClient cl, NetRequest req) {
protected NetCall(NetClient cl, NetRequest req){
this.req = req;
this.cl = cl;
}
private static String constructArgs(Map<String, String> args) throws UnsupportedEncodingException {
private static String constructArgs(Map<String, String> args) throws UnsupportedEncodingException{
args = new TreeMap<>(args);
String str = "";
for (Map.Entry<String, String> en : args.entrySet()) {
@@ -35,11 +34,11 @@ public final class NetCall {
return str;
}
public NetRequest request() {
public NetRequest request(){
return req;
}
public NetResponse execute() throws IOException {
public NetResponse execute() throws IOException{
Proxy proxy = cl.getProxy();
PasswordAuthentication auth = cl.getAuthenticator();
HttpURLConnection con = (HttpURLConnection) new URL(req.url()).openConnection(proxy != null ? proxy : Proxy.NO_PROXY);
@@ -68,7 +67,7 @@ public final class NetCall {
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024 * 1024];
int c;
while ((c = in.read(buffer)) != -1) bos.write(buffer, 0, c);
while((c = in.read(buffer)) != -1) bos.write(buffer, 0, c);
in.close();
bos.close();
NetResponse r = new NetResponse(bos.toByteArray());
@@ -76,10 +75,10 @@ public final class NetCall {
return r;
}
public void enqueue(NetCallback cb) {
new Thread() {
public void enqueue(NetCallback cb){
new Thread(){
@Override
public void run() {
public void run(){
try {
NetResponse resp = execute();
cb.onResponse(NetCall.this, resp);
@@ -90,7 +89,6 @@ public final class NetCall {
interrupt();
join();
} catch (Exception e) {
Log.e("NetCall", "Failed to interrupt and join thread", e);
}
}
}.start();
@@ -2,7 +2,7 @@ package ru.vtosters.lite.net;
import java.io.IOException;
public interface NetCallback {
public interface NetCallback{
void onFailure(NetCall netCall, IOException iOException);
void onResponse(NetCall netCall, NetResponse netResponse) throws IOException;
@@ -4,18 +4,18 @@ import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.util.concurrent.TimeUnit;
public class NetClient {
public class NetClient{
private final long timeout;
private final Proxy proxy;
private final PasswordAuthentication authenticator;
protected NetClient(Builder b) {
protected NetClient(Builder b){
timeout = b.timeout;
proxy = b.proxy;
authenticator = b.auth;
}
public Builder newBuilder() {
public Builder newBuilder(){
Builder b = new Builder();
b.timeout = timeout;
b.proxy = proxy;
@@ -23,30 +23,30 @@ public class NetClient {
return b;
}
public NetCall newCall(NetRequest req) {
public NetCall newCall(NetRequest req){
return new NetCall(this, req);
}
public PasswordAuthentication getAuthenticator() {
public PasswordAuthentication getAuthenticator(){
return authenticator;
}
public Proxy getProxy() {
public Proxy getProxy(){
return proxy;
}
public long getTimeout() {
public long getTimeout(){
return timeout;
}
public static final class Builder {
public static final class Builder{
private long timeout;
private Proxy proxy;
private PasswordAuthentication auth;
public Builder connectTimeout(long l, TimeUnit unit) {
public Builder connectTimeout(long l, TimeUnit unit){
int m;
switch (unit) {
switch(unit) {
case SECONDS:
m = 1000;
break;
@@ -70,17 +70,17 @@ public class NetClient {
return this;
}
public Builder proxyAuthenticator(PasswordAuthentication auth) {
public Builder proxyAuthenticator(PasswordAuthentication auth){
this.auth = auth;
return this;
}
public Builder proxy(Proxy proxy) {
public Builder proxy(Proxy proxy){
this.proxy = proxy;
return this;
}
public NetClient build() {
public NetClient build(){
return new NetClient(this);
}
}
@@ -3,59 +3,59 @@ package ru.vtosters.lite.net;
import java.util.Map;
import java.util.TreeMap;
public class NetRequest {
public class NetRequest{
private final String url;
private final String requestMethod;
private final Map<String, String> params;
protected NetRequest(Builder b) {
protected NetRequest(Builder b){
url = b.url;
requestMethod = b.req;
params = b.params;
}
public Map<String, String> getRequestParams() {
public Map<String, String> getRequestParams(){
return params;
}
public String url() {
public String url(){
return url;
}
public String getRequestMethod() {
public String getRequestMethod(){
return requestMethod;
}
public static final class Builder {
public static final class Builder{
private String url;
private String req = "GET";
private Map<String, String> params;
public NetRequest build() {
public NetRequest build(){
return new NetRequest(this);
}
public Builder url(String url) {
public Builder url(String url){
this.url = url;
return this;
}
public Builder get() {
public Builder get(){
req = "GET";
return this;
}
public Builder post() {
public Builder post(){
req = "POST";
return this;
}
public Builder params(Map<String, String> params) {
public Builder params(Map<String, String> params){
this.params = params;
return this;
}
public Builder param(String param, String value) {
public Builder param(String param, String value){
if (params == null) params = new TreeMap<>();
params.put(param, value);
return this;
@@ -4,35 +4,35 @@ import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
public final class NetResponse {
public final class NetResponse{
private final byte[] data;
private int code;
protected NetResponse(byte[] data) {
protected NetResponse(byte[] data){
this.data = data;
}
protected void setCode(int code) {
protected void setCode(int code){
this.code = code;
}
public boolean isSuccessful() {
public boolean isSuccessful(){
return code() == 200;
}
public int code() {
public int code(){
return code;
}
public byte[] getData() {
public byte[] getData(){
return data;
}
public InputStream getDataStream() {
public InputStream getDataStream(){
return new ByteArrayInputStream(data);
}
public String getDataString() {
public String getDataString(){
return new String(data, StandardCharsets.UTF_8);
}
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.net;
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import android.os.AsyncTask;
@@ -11,33 +11,33 @@ import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Request {
public static void makeRequest(byte[] bArr, RequestCallback RequestCallback) {
public class Request{
public static void makeRequest(byte[] bArr, RequestCallback RequestCallback){
new MakeRequestTask(bArr, RequestCallback).execute();
}
public static void makeRequest(String str, RequestCallback RequestCallback) {
public static void makeRequest(String str, RequestCallback RequestCallback){
new MakeRequestTask(str.getBytes(), RequestCallback).execute();
}
public interface RequestCallback {
public interface RequestCallback{
void onResponse(String str);
}
private static class MakeRequestTask extends AsyncTask<Void, Void, String> {
private static class MakeRequestTask extends AsyncTask<Void, Void, String>{
private final RequestCallback callback;
private final byte[] url;
private final boolean mIsPut;
private final boolean mIsVTostersRequest;
public MakeRequestTask(byte[] bArr, RequestCallback RequestCallback) {
public MakeRequestTask(byte[] bArr, RequestCallback RequestCallback){
mIsVTostersRequest = false;
mIsPut = false;
callback = RequestCallback;
url = bArr;
}
public String doInBackground(Void... voidArr) {
public String doInBackground(Void... voidArr){
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(new String(url)).openConnection();
httpURLConnection.setRequestMethod(mIsPut ? "PUT" : "GET");
@@ -53,7 +53,7 @@ public class Request {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
StringBuffer stringBuffer = new StringBuffer();
while (true) {
while(true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
stringBuffer.append(readLine);
@@ -68,7 +68,7 @@ public class Request {
}
}
public void onPostExecute(String str) {
public void onPostExecute(String str){
super.onPostExecute(str);
callback.onResponse(str);
}
@@ -1,12 +1,12 @@
package ru.vtosters.lite.tgs;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Globals.getContext;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
public class TGPref {
private static final SharedPreferences Prefs = PreferenceManager.getDefaultSharedPreferences(getGlobalContext());
public class TGPref{
private static final SharedPreferences Prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
private static final String CNCT_METHOD = "VTGS:CM";
private static final String TG_BOTKEY = "VTGS:BKey";
@@ -16,55 +16,55 @@ public class TGPref {
private static final String TG_PROXYUSER = "VTGS:PUS";
private static final String TG_PROXYUSEPASS = "VTGS:PUsePassword";
public static int getTGConnectMethod() {
public static int getTGConnectMethod(){
return Integer.parseInt(Prefs.getString(CNCT_METHOD, "0"));
}
public static void setTGConnectMethod(int method) {
public static void setTGConnectMethod(int method){
Prefs.edit().putString(CNCT_METHOD, String.valueOf(method)).apply();
}
public static String getTGBotKey() {
public static String getTGBotKey(){
return Prefs.getString(TG_BOTKEY, null);
}
public static void setTGBotKey(String key) {
public static void setTGBotKey(String key){
Prefs.edit().putString(TG_BOTKEY, key).apply();
}
public static String getTGProxyIP() {
public static String getTGProxyIP(){
return Prefs.getString(TG_PROXYIP, null);
}
public static void setTGProxyIP(String ip) {
public static void setTGProxyIP(String ip){
Prefs.edit().putString(TG_PROXYIP, ip).apply();
}
public static int getTGProxyPort() {
public static int getTGProxyPort(){
return Prefs.getInt(TG_PROXYPORT, 0);
}
public static void setTGProxyPort(int port) {
public static void setTGProxyPort(int port){
Prefs.edit().putInt(TG_PROXYPORT, port).apply();
}
public static String getTGProxyPass() {
public static String getTGProxyPass(){
return Prefs.getString(TG_PROXYPASS, "");
}
public static String getTGProxyUser() {
public static String getTGProxyUser(){
return Prefs.getString(TG_PROXYUSER, "");
}
public static void setTGProxyUserPass(String user, String pass) {
public static void setTGProxyUserPass(String user, String pass){
Prefs.edit().putString(TG_PROXYUSER, user).putString(TG_PROXYPASS, pass).apply();
}
public static boolean isTGProxyPassEnabled() {
public static boolean isTGProxyPassEnabled(){
return Prefs.getBoolean(TG_PROXYUSEPASS, false);
}
public static void setTGProxyPassEnabled(boolean en) {
public static void setTGProxyPassEnabled(boolean en){
Prefs.edit().putBoolean(TG_PROXYUSEPASS, en).apply();
}
}
@@ -1,7 +1,7 @@
package ru.vtosters.lite.tgs;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.AndroidUtils.getString;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getString;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -23,14 +23,14 @@ import org.json.JSONObject;
import java.util.List;
import java.util.Stack;
public class TGRoot {
public class TGRoot{
public static final int N = 76820000;
public static final int X = 976820000;
private final static Stack<Integer> pendingStickers = new Stack<>();
private static final String TAG = "TGRoot";
public static String getSummary() {
switch (TGPref.getTGConnectMethod()) {
public static String getSummary(){
switch(TGPref.getTGConnectMethod()) {
case 0:
return getString("ctypedirect");
case 2:
@@ -40,7 +40,7 @@ public class TGRoot {
}
}
public static Attachment processSticker(StickerItem item) {
public static Attachment processSticker(StickerItem item){
int id = item.getId();
if (id < N) return null;
@@ -48,7 +48,7 @@ public class TGRoot {
int stickerId = (id - N) % 120;
TelegramStickersPack pack = null;
for (TelegramStickersPack p : TelegramStickersService.getInstance(getGlobalContext()).getActivePacksListReference()) {
for (TelegramStickersPack p : TelegramStickersService.getInstance(getContext()).getActivePacksListReference()) {
if (p.index == index) {
pack = p;
break;
@@ -67,9 +67,9 @@ public class TGRoot {
return att;
}
public static void injectStickers(List<StickerStockItem> list) {
public static void injectStickers(List<StickerStockItem> list){
try {
List<TelegramStickersPack> packs = TelegramStickersService.getInstance(getGlobalContext()).getActivePacksListReference();
List<TelegramStickersPack> packs = TelegramStickersService.getInstance(getContext()).getActivePacksListReference();
for (int i = packs.size() - 1; i >= 0; i--)
list.add(0, toStickerPack(packs.get(i)));
} catch (Exception e) {
@@ -77,12 +77,12 @@ public class TGRoot {
}
}
public static StickerStockItem getPackBySticker(int stickerId) {
public static StickerStockItem getPackBySticker(int stickerId){
if (stickerId < N) return null;
int index = (stickerId - N) / 120;
TelegramStickersPack p = null;
for (TelegramStickersPack p_ : TelegramStickersService.getInstance(getGlobalContext())
for (TelegramStickersPack p_ : TelegramStickersService.getInstance(getContext())
.getActivePacksListReference()) {
if (p_.index == index) {
p = p_;
@@ -99,7 +99,7 @@ public class TGRoot {
}
}
private static StickerStockItem toStickerPack(TelegramStickersPack p) throws JSONException {
private static StickerStockItem toStickerPack(TelegramStickersPack p) throws JSONException{
JSONArray arr = new JSONArray();
for (int j = 0; j < p.stickersCount; j++)
@@ -143,7 +143,7 @@ public class TGRoot {
.put("photo_592", photo), X + p.index);
}
public static Attach modifyStickerIM(int i, StickerItem stickerItem, String str) {
public static Attach modifyStickerIM(int i, StickerItem stickerItem, String str){
if (stickerItem.getId() < 76820000) {
return AppAttachToImAttachConverter.a.a(i, stickerItem, str);
}
@@ -1,38 +0,0 @@
package ru.vtosters.lite.themes;
import android.content.res.ColorStateList;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import com.vk.core.view.TintTextView;
import ru.vtosters.lite.utils.ThemesUtils;
public class Recolor {
private static int getColor(int original) {
var color = VTLColors.getColor(original);
if (color != -1) return color;
return original;
}
public static void recolorToolbar(Toolbar toolbar) {
if (ThemesUtils.isCustomThemeApplied())
toolbar.setBackgroundColor(ThemesUtils.getHeaderBackground());
}
public static void recolorIconToAccent(ImageView iv) {
if (ThemesUtils.isCustomThemeApplied())
iv.setImageTintList(ColorStateList.valueOf(VTLColors.getAccentColor()));
}
public static void recolorTextToAccent(TextView iv) {
iv.setTextColor(VTLColors.getAccentColor());
}
public static void recolorTintTextViewToAccent(TintTextView ttv) {
ttv.setDrawableTint(VTLColors.getAccentColor());
}
}
@@ -1,94 +0,0 @@
package ru.vtosters.lite.themes;
import android.content.Context;
import android.util.Log;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vk.core.util.ContextExtKt;
import com.vtosters.lite.R;
import ru.vtosters.lite.themes.managers.ThemesManager;
import ru.vtosters.lite.themes.models.ThemeModel;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.Preferences;
import ru.vtosters.lite.utils.ThemesUtils;
public class VTLColors {
private static final ThemesManager themesManager = ThemesManager.getInstance();
private static final ThemeModel currentTheme = themesManager.getCurrentTheme();
public static int getAccentColor() {
return getColor(R.attr.accent, R.attr.accentColor, R.attr.colorAccent, R.attr.vk_accent);
}
public static int getTextPrimaryColor() {
return getColor(R.attr.text_primary);
}
public static int getTextSecondaryColor() {
return getColor(R.attr.text_secondary);
}
public static int getTabbarBackground() {
return getColor(R.attr.tabbar_background);
}
public static int getTabbarActiveColor() {
if (ThemesUtils.isCustomThemeApplied())
return getColor(R.attr.tabbar_active_icon);
return Preferences.dockbar_accent()
? getAccentColor()
: AndroidUtils.getResources().getColor(ThemesUtils.isDarkTheme() ? R.color.white : R.color.gray_700);
}
public static int getTabbarInactiveColor() {
if (ThemesUtils.isCustomThemeApplied())
return getColor(R.attr.tabbar_inactive_icon);
return AndroidUtils.getResources().getColor(ThemesUtils.isDarkTheme() ? R.color.gray_500 : R.color.vk_steel_gray_300);
}
public static int getBackgroundContent() {
return getColor(R.attr.background_content);
}
public static int getBackgroundPage() {
return getColor(R.attr.background_page);
}
public static int getHeaderBackground() {
return getColor(R.attr.header_background);
}
public static int getHeaderText() {
return getColor(R.attr.header_text);
}
//region Hooks
public static int getColor(int... attrs) {
return getColor(attrs[0]);
}
public static int getColor(int attr) {
if (ThemesUtils.isCustomThemeApplied()) {
int color = currentTheme.getColor(attr);
if (color != -1)
return color;
}
return VKThemeHelper.d(attr);
}
public static int getColor(Context context, int colorId) {
try {
Log.d("VTLColors", "getColor(Landroid/content/Context;I): " + AndroidUtils.getResources().getResourceEntryName(colorId));
} catch (Throwable ignored) {
}
if (ThemesUtils.isCustomThemeApplied()) {
int color = currentTheme.getColor(colorId);
if (color != -1)
return color;
}
return ContextExtKt.h(context, colorId);
}
//endregion
}
@@ -1,140 +0,0 @@
package ru.vtosters.lite.themes;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.os.Build;
import android.util.AttributeSet;
import android.util.SparseIntArray;
import android.util.TypedValue;
import com.vtosters.lite.R;
import java.lang.reflect.Field;
import ru.vtosters.lite.themes.managers.ThemesManager;
import ru.vtosters.lite.utils.ReflectionUtils;
import ru.vtosters.lite.utils.ThemesUtils;
public class VTLResources {
private static final int STYLE_NUM_ENTRIES = Build.VERSION.SDK_INT >= 29 ? 7 : 6;
public static final SparseIntArray forcedAttrs = new SparseIntArray();
public static final SparseIntArray otherAttrs = new SparseIntArray();
private static Field dataField;
static {
try {
dataField = ReflectionUtils.getDeclaredField(TypedArray.class, "mData");
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
otherAttrs.put(R.attr.vklib_alv_optionIconTint, R.attr.im_dropdown_icon_color);
otherAttrs.put(R.attr.vkim_colorPrimary, R.attr.accent);
otherAttrs.put(R.attr.statusBarColorBack, R.attr.statusBarColorBack);
otherAttrs.put(R.attr.statusBarColorFront, R.attr.statusBarColorFront);
// android attributes
otherAttrs.put(android.R.attr.backgroundTint, R.attr.accent);
otherAttrs.put(android.R.attr.tint, R.attr.accent);
otherAttrs.put(android.R.attr.color, R.attr.accent);
forcedAttrs.put(-0x8e5515, R.attr.accent);
forcedAttrs.put(-0xe6e6e6, R.attr.background_content);
}
public static void prepareTypedArray(TypedArray target, int[] attrs) {
if (!ThemesUtils.isCustomThemeApplied() || attrs == null) return;
var theme = ThemesManager.getInstance().getCurrentTheme();
var data = getData(target);
for (int i = 0; i < attrs.length; i++) {
//var attr = attrs[i];
var off = STYLE_NUM_ENTRIES * i;
var type = data[off];
var replacement = -1;
if (type == TypedValue.TYPE_ATTRIBUTE) {
replacement = theme.getColor(data[off + 0x1]);
} else if (type == TypedValue.TYPE_INT_COLOR_ARGB8 || type == TypedValue.TYPE_INT_COLOR_RGB8) {
replacement = forcedAttrs.get(data[off + 0x1], -1);
if (replacement == -1
&& ThemesUtils.accentColors.contains(data[off + 0x1]))
replacement = ThemesUtils.getAccentColor();
}
if (replacement == -1) continue;
try {
data[off] = TypedValue.TYPE_INT_COLOR_RGB8; // type
data[off + 0x1] = replacement; // data
data[off + 0x2] = 0x0; // asset cookie
data[off + 0x3] = 0x0; // resource id
} catch (Throwable ignored) {
}
}
}
private static int[] getData(TypedArray target) {
try {
return (int[]) dataField.get(target);
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return new int[0];
}
//region Hooks
public static TypedArray obtainStyledAttributes(Context context, int[] attrs) {
var target = context.obtainStyledAttributes(attrs);
prepareTypedArray(target, attrs);
return target;
}
public static TypedArray obtainStyledAttributes(Context context, int resId, int[] attrs) {
var target = context.obtainStyledAttributes(resId, attrs);
prepareTypedArray(target, attrs);
return target;
}
public static TypedArray obtainStyledAttributes(Context context, AttributeSet set, int[] attrs) {
var target = context.obtainStyledAttributes(set, attrs);
prepareTypedArray(target, attrs);
return target;
}
public static TypedArray obtainStyledAttributes(Context context, AttributeSet set, int[] attrs, int defStyleAttr, int defStyleRes) {
var target = context.obtainStyledAttributes(set, attrs, defStyleAttr, defStyleRes);
prepareTypedArray(target, attrs);
return target;
}
public static int getColor(Resources res, int colorId) {
return VTLColors.getColor(colorId);//res.getColor(colorId);
}
@SuppressLint("NewApi")
public static int getColor(Resources res, int colorId, Resources.Theme theme) {
return VTLColors.getColor(colorId);
}
@SuppressLint("UseCompatLoadingForColorStateLists")
public static ColorStateList getColorStateList(Resources res, int colorId) {
if (ThemesUtils.isCustomThemeApplied()) {
int color = VTLColors.getColor(colorId);
if (color != -1)
return ColorStateList.valueOf(color);
}
return res.getColorStateList(colorId);
}
@SuppressLint("NewApi")
public static ColorStateList getColorStateList(Resources res, int colorId, Resources.Theme theme) {
if (ThemesUtils.isCustomThemeApplied()) {
int color = VTLColors.getColor(colorId);
if (color != -1)
return ColorStateList.valueOf(color);
}
return res.getColorStateList(colorId, theme);
}
//endregion
}
@@ -1,97 +0,0 @@
package ru.vtosters.lite.themes.managers;
import android.os.Environment;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import ru.vtosters.lite.themes.models.PaletteModel;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.IOUtils;
public class PalettesManager {
private static PalettesManager instance;
private static File palettesDir = new File(Environment.getExternalStorageDirectory(), "VTL/themes/palettes");
private List<PaletteModel> palettes = new ArrayList<>();
public static PalettesManager getInstance() {
if (instance == null)
instance = new PalettesManager();
return instance;
}
public PalettesManager() {
load();
}
public void load() {
palettes.clear();
if (!palettesDir.exists())
palettesDir.mkdirs();
final var palettes = palettesDir.listFiles((dir, name) -> name.endsWith(".json"));
var check = true;
if (palettes == null || palettes.length == 0)
check = copyPaletteFromAssets();
if (check)
parsePalettes();
}
private boolean copyPaletteFromAssets() {
try {
final var manager = AndroidUtils.getGlobalContext().getAssets();
final var assets = manager.list("vtl_themes/palettes/");
if (assets == null || assets.length == 0) return false;
var i = 0;
for (var asset : assets) {
try {
IOUtils.copyFile(manager.open("vtl_themes/palettes/" + asset), new File(palettesDir, asset));
i++;
} catch (IOException e) {
e.printStackTrace();
}
}
return i > 0;
} catch (IOException e) {
e.printStackTrace();
}
return false;
}
private void parsePalettes() {
var arr = palettesDir.listFiles((dir, name) -> name.endsWith(".json"));
if (arr == null || arr.length == 0)
throw new RuntimeException("Can't load palettes");
for (var file : arr) {
try {
var json = new JSONObject(IOUtils.readAllLines(file));
palettes.add(PaletteModel.fromJson(json));
} catch (IOException | JSONException e) {
e.printStackTrace();
}
}
}
public PaletteModel getPalette(String id) {
for (PaletteModel palette : palettes) {
if (id.equals(palette.id))
return palette;
}
return null;
}
public PaletteModel getPalette(int i) {
return palettes.get(i);
}
public int getPalettesCount() {
return palettes.size();
}
}
@@ -1,247 +0,0 @@
package ru.vtosters.lite.themes.managers;
import android.app.Activity;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Environment;
import android.os.StrictMode;
import android.util.Log;
import com.vtosters.lite.auth.VKAccountManager;
import org.json.JSONException;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
import ru.vtosters.lite.ui.dialogs.ThemesEditorBottomSheetDialog;
import ru.vtosters.lite.themes.models.ThemeModel;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.IOUtils;
import ru.vtosters.lite.utils.ThemesUtils;
public class ThemesManager {
private static File themesDir;
private static ThemesManager instance;
private static ThemeModel currentTheme = null;
private List<ThemeModel> themes = new ArrayList<>();
public static ThemesManager getInstance() {
if (instance == null)
instance = new ThemesManager();
return instance;
}
public ThemesManager() {
init();
}
private void init() {
themes = new ArrayList<>();
currentTheme = new ThemeModel().setName("Тема по умолчанию")
.setAuthor("Разработчики ВК")
.setDarkMode(ThemesUtils.isDarkTheme())
.setId("default");
themes.add(currentTheme);
themesDir = new File(Environment.getExternalStorageDirectory(), "VTL/themes");
if (!themesDir.exists()) {
themesDir.mkdirs();
return;
}
// Support themes from Sova V RE (.svt)
var files = themesDir.listFiles((dir, name) -> name.endsWith(".vtlt") || name.endsWith(".svt") || name.endsWith(".json"));
if (files == null || files.length == 0)
return;
var currentThemeId = AndroidUtils.getPreferences().getString("vtl_theme_id", "default");
for (File file : files) {
try {
ThemeModel theme;
var abs = file.getAbsolutePath();
if (abs.endsWith(".svt") || abs.endsWith(".json"))
theme = svt2vtlt(file);
else
theme = read(file);
if (theme != null) {
Log.d("ThemesManager", theme.toString());
if (currentThemeId.equals(theme.id))
currentTheme = theme;
themes.add(theme);
}
} catch (IOException | JSONException e) {
e.printStackTrace();
}
}
if ("default".equals(currentTheme.id))
setTheme(currentTheme);
}
private ThemeModel svt2vtlt(File file) {
try {
var theme = read(file);
save(theme);
return theme;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public void reload() {
init();
}
public File getThemeFile(ThemeModel theme) throws IOException {
if (!themesDir.exists()) {
themesDir.mkdirs();
throw new FileNotFoundException("theme file not found");
}
var themeFile = new File(themesDir, theme.id + ".svt");
if (!themeFile.exists()) {
themeFile = new File(themesDir, theme.id + ".vtlt");
if (!themeFile.exists())
themeFile.createNewFile();
}
return themeFile;
}
public void setTheme(ThemeModel theme) {
AndroidUtils.getPreferences()
.edit()
.putString("vtl_theme_id", theme.id)
.commit();
}
public ThemeModel getTheme(int i) {
return themes.get(i);
}
public ThemeModel getCurrentTheme() {
return currentTheme;
}
public int getThemesCount() {
return themes.size();
}
public boolean isCurrentTheme(ThemeModel theme) {
return currentTheme.id.equals(theme.id);
}
public boolean hasTheme(ThemeModel theme) {
return hasTheme(theme.id);
}
public boolean hasTheme(String id) {
for (ThemeModel theme : themes) {
if (id.equals(theme.id))
return true;
}
return false;
}
/*
* Theme file storing method from Sova V RE is storing json clearly or compressed with gzip.
* If first byte byte is 0x1 or 0x2 json has been compressed with gzip,
* but if first byte is 0x2 next int is length of json string. */
private ThemeModel read(InputStream fis) throws IOException, JSONException {
InputStream is = fis;
var first = is.read();
if (first > 0x0 && first < 0x3) {
var gzis = new GZIPInputStream(is);
var dis = new DataInputStream(gzis);
if (first == 0x2)
dis.readInt();
is = dis;
}
return ThemeModel.fromJson(IOUtils.readAllLines(is));
}
private ThemeModel read(File file) throws IOException, JSONException {
return read(new FileInputStream(file));
}
public void save(ThemeModel theme) throws IOException, JSONException {
var buffer = theme.toJson().toString().getBytes(StandardCharsets.UTF_8);
var fos = new FileOutputStream(getThemeFile(theme));
// writing with data length
fos.write(0x2);
var gzos = new GZIPOutputStream(fos);
var dos = new DataOutputStream(gzos);
dos.writeInt(buffer.length);
dos.write(buffer);
dos.close();
}
public void delete(ThemeModel theme) {
try {
getThemeFile(theme).delete();
} catch (IOException e) {
e.printStackTrace();
}
themes.remove(theme);
if (isCurrentTheme(theme)) {
setTheme(null);
}
}
public void create(Activity activity, String name) throws JSONException, IOException {
var id = name.toLowerCase().replace(" ", "-");
if (hasTheme(id)) {
var i = 1;
while (hasTheme(id + "-" + i)) {
i++;
}
id += "-" + i;
}
var userProfile = VKAccountManager.d().e1();
ThemeModel theme = new ThemeModel()
.setName(name)
.setAuthor(userProfile.c + " " + userProfile.e)
.setDarkMode(true)
// .setColors(DEFAULT_COLORS)
.setId(id);
themes.add(theme);
ThemesEditorBottomSheetDialog.create(activity, theme, false);
save(theme);
}
public void copy(ContentResolver contentResolver, Uri uri) throws IOException, JSONException {
var theme = read(contentResolver.openInputStream(uri));
if (isCurrentTheme(theme)) {
int i = 1;
while (hasTheme(theme.id + "-" + i)) {
i++;
}
theme.id += "-" + i;
}
themes.add(theme);
save(theme);
}
public void share(Context context, ThemeModel theme) throws Exception {
var vmPolicy = StrictMode.getVmPolicy();
StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().build());
var intent = new Intent(Intent.ACTION_SEND)
.setType("file/*")
.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(getThemeFile(theme)));
context.startActivity(Intent.createChooser(intent, ""));
StrictMode.setVmPolicy(vmPolicy);
}
}
@@ -1,26 +0,0 @@
package ru.vtosters.lite.themes.models;
public class ColorModel {
public String resName;
public int id;
public int color;
public ColorModel(int id, int color) {
this.id = id;
this.color = color;
}
public ColorModel(String resName, int id, int color) {
this.resName = resName;
this.id = id;
this.color = color;
}
public static ColorModel create(int id, int color) {
return new ColorModel(id, color);
}
public static ColorModel create(String resName, int id, int color) {
return new ColorModel(resName, id, color);
}
}

Some files were not shown because too many files have changed in this diff Show More