Repository: mustafa1dev/TeleVip-Lsposed Branch: main Commit: 9f96215ee5f9 Files: 162 Total size: 412.1 KB Directory structure: gitextract_bnkwr53f/ ├── .gitignore ├── LICENSE ├── README.md ├── SUMMARY ├── app/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ ├── androidTest/ │ │ └── java/ │ │ └── com/ │ │ └── my/ │ │ └── televip/ │ │ └── ExampleInstrumentedTest.java │ ├── main/ │ │ ├── AndroidManifest.xml │ │ ├── assets/ │ │ │ ├── lang/ │ │ │ │ ├── ar.json │ │ │ │ ├── en.json │ │ │ │ └── zh.json │ │ │ └── xposed_init │ │ ├── java/ │ │ │ └── com/ │ │ │ └── my/ │ │ │ └── televip/ │ │ │ ├── Callback/ │ │ │ │ └── IntCallback.java │ │ │ ├── Class/ │ │ │ │ ├── ClassLoad.java │ │ │ │ └── ClassNames.java │ │ │ ├── ClientChecker.java │ │ │ ├── Clients/ │ │ │ │ ├── Momogram.java │ │ │ │ ├── Nagram.java │ │ │ │ ├── NagramX.java │ │ │ │ ├── Nicegram.java │ │ │ │ ├── TGConnect.java │ │ │ │ ├── Telega.java │ │ │ │ ├── Telegram.java │ │ │ │ ├── TelegramBeta.java │ │ │ │ ├── TelegramPlus.java │ │ │ │ ├── TelegramWeb.java │ │ │ │ ├── Telegraph.java │ │ │ │ ├── XPlus.java │ │ │ │ ├── forkgram.java │ │ │ │ ├── forkgramBeta.java │ │ │ │ ├── iMe.java │ │ │ │ └── iMeWeb.java │ │ │ ├── Configs/ │ │ │ │ ├── ConfigItem.java │ │ │ │ ├── ConfigManager.java │ │ │ │ └── ConfigPreferences.java │ │ │ ├── Database/ │ │ │ │ └── MessageDatabase.java │ │ │ ├── Drawable/ │ │ │ │ ├── ArrowDrawable.java │ │ │ │ └── GhostDrawable.java │ │ │ ├── MainHook.java │ │ │ ├── TeleVip.java │ │ │ ├── Utils.java │ │ │ ├── application/ │ │ │ │ ├── AndroidUtilities.java │ │ │ │ └── ApplicationLoaderHook.java │ │ │ ├── audio.java │ │ │ ├── base/ │ │ │ │ └── AbstractMethodHook.java │ │ │ ├── dex/ │ │ │ │ └── DexInjector.java │ │ │ ├── features/ │ │ │ │ ├── DisableChannelSwipeBack.java │ │ │ │ ├── DisableNumberRounding.java │ │ │ │ ├── DisableProfileSwipeBack.java │ │ │ │ ├── DisableStories.java │ │ │ │ ├── DownloadSpeed.java │ │ │ │ ├── EnableSavingStories.java │ │ │ │ ├── FixTLError.java │ │ │ │ ├── GhostMode.java │ │ │ │ ├── HideOnline.java │ │ │ │ ├── HidePhone.java │ │ │ │ ├── HidePinnedMessages.java │ │ │ │ ├── HideProxySponsor.java │ │ │ │ ├── HideSeen.java │ │ │ │ ├── HideStoryRead.java │ │ │ │ ├── HideTyping.java │ │ │ │ ├── HideUpdateApp.java │ │ │ │ ├── PreventMedia.java │ │ │ │ ├── RemovesContentSaving.java │ │ │ │ ├── SaveEditsHistory.java │ │ │ │ ├── SecretMediaSave.java │ │ │ │ ├── ShowDeletedMessages.java │ │ │ │ ├── TelePremium.java │ │ │ │ └── otherFeatures/ │ │ │ │ ├── ChatHook.java │ │ │ │ ├── CopyNameHook.java │ │ │ │ ├── FeatureInitializer.java │ │ │ │ ├── FeatureStateManager.java │ │ │ │ └── ProfileHook.java │ │ │ ├── hooks/ │ │ │ │ └── HMethod.java │ │ │ ├── language/ │ │ │ │ ├── Keys.java │ │ │ │ └── Translator.java │ │ │ ├── logging/ │ │ │ │ └── Logger.java │ │ │ ├── obfuscate/ │ │ │ │ ├── AutomationResolver.java │ │ │ │ └── struct/ │ │ │ │ ├── ClassInfo.java │ │ │ │ ├── FieldInfo.java │ │ │ │ ├── MethodInfo.java │ │ │ │ └── ResolverRegistry.java │ │ │ ├── settings/ │ │ │ │ ├── SettingsManager.java │ │ │ │ ├── controller/ │ │ │ │ │ └── SettingsController.java │ │ │ │ ├── hook/ │ │ │ │ │ └── SettingsHook.java │ │ │ │ └── ui/ │ │ │ │ ├── SettingsActivity.java │ │ │ │ └── SettingsAdapter.java │ │ │ ├── structs/ │ │ │ │ └── DeletedMessageInfo.java │ │ │ ├── ui/ │ │ │ │ └── toolBar/ │ │ │ │ └── MainToolBar.java │ │ │ └── virtuals/ │ │ │ ├── ActionBar/ │ │ │ │ ├── ActionBarMenuItem.java │ │ │ │ ├── AlertDialog.java │ │ │ │ └── SimpleTextView.java │ │ │ ├── Adapters/ │ │ │ │ └── DrawerLayoutAdapter.java │ │ │ ├── ChatMessageCellDefault.java │ │ │ ├── OfficialChatMessageCell.java │ │ │ ├── SQLite/ │ │ │ │ ├── SQLiteCursor.java │ │ │ │ └── SQLiteDatabase.java │ │ │ ├── SettingsIconResolver.java │ │ │ ├── TeleVip/ │ │ │ │ └── Bridge/ │ │ │ │ └── Bridge.java │ │ │ ├── Theme.java │ │ │ ├── androidx/ │ │ │ │ └── ViewHolder.java │ │ │ ├── messenger/ │ │ │ │ ├── BaseController.java │ │ │ │ ├── DispatchQueue.java │ │ │ │ ├── FileLoadOperation.java │ │ │ │ ├── FileLoader.java │ │ │ │ ├── ImageLocation.java │ │ │ │ ├── ImageReceiver.java │ │ │ │ ├── LocaleController.java │ │ │ │ ├── MessageObject.java │ │ │ │ ├── MessagesController.java │ │ │ │ ├── MessagesStorage.java │ │ │ │ ├── NotificationCenter.java │ │ │ │ ├── UserConfig.java │ │ │ │ ├── Utilities.java │ │ │ │ └── browser/ │ │ │ │ └── Browser.java │ │ │ ├── tgnet/ │ │ │ │ ├── ConnectionsManager.java │ │ │ │ ├── NativeByteBuffer.java │ │ │ │ ├── RequestDelegate.java │ │ │ │ └── TLRPC.java │ │ │ └── ui/ │ │ │ ├── BaseFragment.java │ │ │ ├── Cells/ │ │ │ │ ├── ChatMessageCell.java │ │ │ │ ├── HeaderCell.java │ │ │ │ ├── ShadowSectionCell.java │ │ │ │ ├── TextCheckCell.java │ │ │ │ ├── TextInfoCell.java │ │ │ │ └── TextSettingsCell.java │ │ │ ├── ChatActivity.java │ │ │ ├── Components/ │ │ │ │ ├── LayoutHelper.java │ │ │ │ └── RecyclerListView.java │ │ │ ├── LaunchActivity.java │ │ │ ├── PhotoViewer.java │ │ │ ├── ProfileActivity.java │ │ │ └── SecretMediaViewer.java │ │ └── res/ │ │ ├── drawable/ │ │ │ ├── baseline_arrow_back_24.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── ic_launcher_foreground.xml │ │ │ ├── messages.xml │ │ │ └── sync.xml │ │ ├── mipmap-anydpi/ │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── values/ │ │ │ ├── arrays.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ └── xml/ │ │ ├── backup_rules.xml │ │ └── data_extraction_rules.xml │ └── test/ │ └── java/ │ └── com/ │ └── my/ │ └── televip/ │ └── ExampleUnitTest.java ├── build.gradle ├── gradle/ │ ├── libs.versions.toml │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── settingsadapter/ ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src/ ├── main/ │ ├── AndroidManifest.xml │ └── java/ │ └── com/ │ └── televip/ │ └── SettingsAdapter/ │ ├── Bridge.java │ └── SettingsAdapter.java └── test/ └── java/ └── com/ └── televip/ └── settingsadapter/ └── ExampleUnitTest.java ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ <<<<<<< HEAD *.iml .gradle /local.properties /.idea/caches /.idea/libraries /.idea/modules.xml /.idea/workspace.xml /.idea/navEditor.xml /.idea/assetWizardSettings.xml .DS_Store /build /captures .externalNativeBuild .cxx local.properties ======= # Gradle files .gradle/ build/ # Local configuration file (sdk path, etc) local.properties # Log/OS Files *.log # Android Studio generated files and folders captures/ .externalNativeBuild/ .cxx/ *.apk output.json # IntelliJ *.iml .idea/ misc.xml deploymentTargetDropDown.xml render.experimental.xml # Keystore files *.jks *.keystore # Google Services (e.g. APIs or Firebase) google-services.json # Android Profiling *.hprof >>>>>>> e9865a95eb7ed2d3a6e3c0283d94db23f9eefe06 ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . ================================================ FILE: README.md ================================================ # TeleVip LSPosed A module for modifying Telegram with the following features: 1. Hide "Seen" status for groups, channels, and private messages. 2. Hide "Typing..." indicator. 3. Hide story view status. 4. Removes Content-Saving. 5. Boost Telegram download speed. 6. Enable Local Premium. 7. Save stories to the gallery, including those that cannot normally be saved. 8. Hide Phone Number. 9. Hide Online Status. 10. Prevent Deletion of Secret Media. 11. Show Deleted Messages. 12. Disable Stories. 13. Hide Update App. 14. Save Messages Edits History. 15. Disable Number Rounding. 16. Disable Channel Swipe 17. Disable Profile Swipe 18. Hide Pinned Messages 19. Enable Secret Media 20. Hide Proxy Sponsor There are additional features that are not listed here. # Support clients 1. Telegram 12.6.4 (66662) 2. Plus 12.5.1.1 (22150) 3. TG Connect 11.13.1 (11130109) 4. Nagram 12.6.4 (1235) 5. Skygram 10.20.6 (40639) TeleVip 1.4.6 6. iMe 12.3.6 (12030602) 7. iMe Direct 12.3.6 (12030609) 8. X Plus 12.0.1 (61669) 9. Cherrygram 11.9.1 (59100) TeleVip 2.0 10. Nicegram 1.54.0 (2079) 11. Telegram web 12.6.4 (66669) 12. Telegram Beta 12.7.0 (67369) 13. Nekogram 11.5.3S (55150) TeleVip 1.4.6 14. ForkGram 12.6.6.0 (667008) 15. ForkClient Beta 12.5.2.0 (658109) 16. NagramX 12.6.4-e3e4419 (1247) 17. Teegra 10.3.2 (41469) TeleVip 3.2 18. Telegraph 12.5.1.2 (65832) 19. Telega 2.4.3 (107) 20. Momogram 12.6.4-6a8da4a514 (11269) # Telegram All TeleVip updates are posted on my Telegram channel: [TeleVip](https://t.me/t_l0_e) # Warning This module is intended for educational purposes only. Its use may result in issues with your Telegram account, including the risk of banning or suspension. Use it at your own risk. # License This project is licensed under the GNU General Public License v3.0 (GPLv3). See the [LICENSE](./LICENSE) file for more details. Partially based on [Re-Telegram](https://github.com/Sakion-Team/Re-Telegram). Developed by an @mustafa1dev ================================================ FILE: SUMMARY ================================================ TeleVip A module for modifying Telegram ================================================ FILE: app/.gitignore ================================================ /build ================================================ FILE: app/build.gradle ================================================ apply plugin: 'com.android.application' android { namespace 'com.my.televip' compileSdk 36 defaultConfig { applicationId "com.my.televip" minSdk 27 targetSdk 36 versionCode 310 versionName "3.4" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { useSupportLibrary true } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } } dependencies { compileOnly libs.api implementation(libs.gson) implementation(libs.appcompat) implementation(libs.material) } tasks.register("copyLargestDexAsJava") { dependsOn(":settingsadapter:assembleDebug") doLast { def apkFile = fileTree("$rootDir/settingsadapter/build/intermediates/apk/debug") .matching { include "*.apk" } .singleFile def tempDir = new File(buildDir, "tmp/dexExtract") tempDir.mkdirs() copy { from zipTree(apkFile) into tempDir include "classes*.dex" } def dexFiles = fileTree(tempDir).matching { include "classes*.dex" }.files if (dexFiles.isEmpty()) { throw new GradleException("No dex files found!") } def largestDex = dexFiles.max { it.length() } // قراءة dex كـ bytes byte[] dexBytes = largestDex.bytes def hex = dexBytes.collect { String.format("%02X", it) }.join("") def outputDir = file("$projectDir/src/main/java/com/my/televip/dex") outputDir.mkdirs() def javaFile = new File(outputDir, "DexHolder.java") javaFile.text = """ package com.my.televip.dex; public class DexHolder { public static final byte[] DEX_BYTES = hexToBytes("${hex}"); private static byte[] hexToBytes(String hex) { int len = hex.length(); byte[] data = new byte[len / 2]; for (int i = 0; i < len; i += 2) { data[i / 2] = (byte) ((Character.digit(hex.charAt(i), 16) << 4) + Character.digit(hex.charAt(i+1), 16)); } return data; } } """ println "Generated DexHolder with largest dex: ${largestDex.name}" } } preBuild.dependsOn("copyLargestDexAsJava") ================================================ FILE: app/proguard-rules.pro ================================================ # Add project specific ProGuard rules here. # You can control the set of applied configuration files using the # proguardFiles setting in build.gradle. # # For more details, see # http://developer.android.com/guide/developing/tools/proguard.html # If your project uses WebView with JS, uncomment the following # and specify the fully qualified class name to the JavaScript interface # class: #-keepclassmembers class fqcn.of.javascript.interface.for.webview { # public *; #} # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable # If you keep the line number information, uncomment this to # hide the original source file name. #-renamesourcefileattribute SourceFile ================================================ FILE: app/src/androidTest/java/com/my/televip/ExampleInstrumentedTest.java ================================================ package com.my.televip; import android.content.Context; import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; import org.junit.Test; import org.junit.runner.RunWith; import static org.junit.Assert.*; /** * Instrumented test, which will execute on an Android device. * * @see Testing documentation */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { @Test public void useAppContext() { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); assertEquals("com.my.televip", appContext.getPackageName()); } } ================================================ FILE: app/src/main/AndroidManifest.xml ================================================ ================================================ FILE: app/src/main/assets/lang/ar.json ================================================ { "ToTheBeginning": "اذهب إلى أول رسالة", "ToTheMessage": "إلى الرسالة", "InputMessageId": "ادخل معرف الرسالة", "Done": "حسناً", "NewName": "الاسم الجديد", "Change": "تغيير", "Cancel": "إلغاء", "ChangeTo": "تم التغيير الى", "NameDeleted": "تم حذف الاسم", "GhostMode": "وضع الشبح 👻", "ByMustafa": "تم تطوير من قبل @m_1_iq", "HideSeen": "اخفاء علامة الاستلام", "HideStoryView": "اخفاء مشاهدة قصة", "HideTyping": "اخفاء مؤشر الكتابة", "TelegramPremium": "فتح تيليجرام المميز", "RemovesContentSaving": "إزالة قيود حفظ المحتوى", "EnableSavingStories": "السماح بحفظ القصص", "GhostModeSettings": "وضع الشبح", "Save": "حفظ", "DeveloperChannel": "قناة المطور", "HideOnline": "إخفاء حالة الاتصال بالإنترنت", "PreventMedia": "تعطيل حذف الوسائط السرية", "HidePhone": "اخفاء رقم هاتف", "ShowDeletedMessages": "إظهار الرسائل المحذوفة", "Deleted": "محذوفه", "Copied": "تم نسخ '%s' إلى الحافظة" , "UserOffline": "لست متصلاً بالإنترنت", "DisableStories": "اخفاء القصص", "HideUpdateApp": "اخفاء تحديث تطبيق", "JoinTeleVip": "انضم إلى قناة TeleVip لتكون أول من يحصل على أحدث التحديثات والميزات الجديدة أولاً بأول", "Join": "انضم", "DontShowAgain": "لا تظهر مرة اخرى", "RestartApp": "إعادة تشغيل التطبيق", "RestartRequired": "إعادة التشغيل مطلوبة", "DisableNumberRounding": "تعطيل تقريب الأرقام", "EditsHistory": "تاريخ التعديلات", "SaveEditsHistory": "حفظ سجل تعديلات الرسالة", "StoriesSettings": "القصص", "MessagesSettings": "الرسائل", "MediaSettings": "الوسائط", "OtherFeaturesSettings": "مميزات اخرى", "FixTLError": "إخفاء TL Error", "ShowMessageID": "عرض معرف الرسالة", "DownloadSpeed": "تنزيل فائق سرعة", "ConnectionsSettings": "اتصالات", "Message": "رسالة ", "Edited": " تم التعديل في ", "MarkReadAfterSend": "تعيين الرسائل كمقروءة بعد الإرسال أو عند النقر على تفاعل", "OfflineVisibilityInfo": "عند تفعيل ميزة 'إخفاء حالة الاتصال بالإنترنت'، لن يتم إخفاء حالة اتصالك بشكل كامل، بل يتم تقليل عدد مرات ظهورك كمتصل. قد تظهر متصلاً عند التفاعل مع التطبيق، مثل إرسال الرسائل أو التفاعل معها أو قراءة الرسائل. ستعود حالتك إلى غير متصل بعد حوالي 30-60 ثانية. للحصول على أفضل نتيجة، يُنصح بتفعيل جميع خيارات وضع الشبح.", "DisableChannelSwipeBack": "تعطيل الرجوع بالسحب في القنوات", "DisableProfileSwipeBack": "تعطيل الرجوع بالسحب في الملف الشخصي", "HidePinnedMessages": "إخفاء الرسائل المثبتة", "UiSettings": "واجهة المستخدم", "SecretMediaSave": "تفعيل حفظ الوسائط السرية", "HideProxySponsor": "إخفاء راعي الخادم الوسيط" } ================================================ FILE: app/src/main/assets/lang/en.json ================================================ { "ToTheBeginning": "Go to First Message", "ToTheMessage": "To The Message", "InputMessageId": "Input Message Id", "Done": "Done", "NewName": "New Name", "Change": "Change", "Cancel": "Cancel", "ChangeTo": "Change to", "NameDeleted": "Name deleted", "GhostMode": "Ghost Mode 👻", "ByMustafa": "by @m_1_iq", "HideSeen": "Hide 'Seen' status", "HideStoryView": "Hide 'Story View' status", "HideTyping": "Hide Typing...", "TelegramPremium": "Enable Local Premium", "RemovesContentSaving": "Removes Content-Saving", "EnableSavingStories": "Enable Saving Stories", "GhostModeSettings": "Ghost Mode", "Save": "Save", "DeveloperChannel": "Developer Channel", "HideOnline": "Hide 'Online' status", "PreventMedia": "Prevent Deletion of Secret Media.", "HidePhone": "Hide 'Phone' number", "ShowDeletedMessages": "Show 'Deleted Messages'", "Deleted": "deleted", "Copied": "Copied '%s' to the clipboard", "UserOffline": "You are currently offline", "DisableStories": "Disable 'Stories'", "HideUpdateApp": "Hide Update App", "JoinTeleVip": "Join the TeleVip channel to be among the first to get the latest updates and new features", "Join": "Join", "DontShowAgain": "Don't show again", "RestartApp": "Restart App", "RestartRequired": "Restart required", "DisableNumberRounding": "Disable Number Rounding", "EditsHistory": "Edits History", "SaveEditsHistory": "Save Messages Edits History", "StoriesSettings": "Stories", "MessagesSettings": "Messages", "MediaSettings": "Media", "OtherFeaturesSettings": "Other Features", "FixTLError": "Hide TL Error", "ShowMessageID": "Show Message ID", "DownloadSpeed": "Download Speed Boost", "ConnectionsSettings": "Connections", "Message": "Message ", "Edited": " Edited on ", "MarkReadAfterSend": "Mark messages as read after sending or tap a reaction", "OfflineVisibilityInfo": "When the “Hide Online Status” feature is enabled, your online status will not be completely hidden. Instead, it reduces how often you appear as online. You may still appear online when interacting with the app, such as sending messages, reacting to them, or reading messages. Your status will return to offline after about 30–60 seconds. For the best result, it is recommended to enable all Ghost Mode options.", "DisableChannelSwipeBack": "Disable Channel Swipe Back", "DisableProfileSwipeBack": "Disable Profile Swipe Back", "HidePinnedMessages": "Hide Pinned Messages", "UiSettings": "UI", "SecretMediaSave": "Enable Secret Media Save", "HideProxySponsor": "Hide Proxy Sponsor" } ================================================ FILE: app/src/main/assets/lang/zh.json ================================================ { "ToTheBeginning": "跳转到第一条消息", "ToTheMessage": "跳转到消息", "InputMessageId": "输入消息 ID", "Done": "完成", "NewName": "新名字", "Change": "更改", "Cancel": "取消", "ChangeTo": "更改为", "NameDeleted": "名称已删除", "GhostMode": "幽灵模式 👻", "ByMustafa": "by @m_1_iq", "HideSeen": "隐藏“已查看”状态", "HideStoryView": "隐藏 '故事观看' 状态", "HideTyping": "隐藏正在输入...", "TelegramPremium": "启用 Telegram 本地会员", "RemovesContentSaving": "移除内容保存限制", "EnableSavingStories": "启用保存故事", "GhostModeSettings": "幽灵模式", "Save": "保存", "DeveloperChannel": "开发者频道", "HideOnline": "隐藏 '在线' 状态", "PreventMedia": "防止删除秘密媒体", "HidePhone": "隐藏 '电话' 号码", "ShowDeletedMessages": "显示已删除的消息", "Deleted": "已删除", "Copied": "已复制“%s”到剪贴板", "UserOffline": "您当前处于离线状态", "DisableStories": "禁用 故事", "HideUpdateApp": "隐藏应用更新", "JoinTeleVip": "加入 TeleVip 频道,第一时间获取最新更新和新功能", "Join": "加入", "DontShowAgain": "不再显示", "RestartApp": "重新启动应用", "RestartRequired": "需要重新启动", "DisableNumberRounding": "禁用数字四舍五入", "EditsHistory": "编辑历史", "SaveEditsHistory": "保存消息编辑历史", "StoriesSettings": "故事", "MessagesSettings": "消息", "MediaSettings": "媒体", "OtherFeaturesSettings": "其他功能", "FixTLError": "隐藏 TL Error", "ShowMessageID": "显示消息ID", "DownloadSpeed": "下载速度加速", "ConnectionsSettings": "连接", "Message": "消息 ", "Edited": " 编辑于 ", "MarkReadAfterSend": "发送消息后或点击反应后,将消息标记为已读", "OfflineVisibilityInfo": "启用“隐藏在线状态”功能后,您的在线状态不会被完全隐藏,而是会减少您显示为在线的频率。当您与应用进行交互时,例如发送消息、对消息做出反应或阅读消息,您仍可能会显示为在线。大约30–60秒后,您的状态将恢复为离线。为了获得最佳效果,建议启用所有幽灵模式选项。", "DisableChannelSwipeBack": "禁用频道滑动返回", "DisableProfileSwipeBack": "禁用个人资料滑动返回", "HidePinnedMessages": "隐藏置顶消息", "UiSettings": "用户界面", "SecretMediaSave": "启用秘密媒体保存", "HideProxySponsor": "隐藏代理赞助商" } ================================================ FILE: app/src/main/assets/xposed_init ================================================ com.my.televip.MainHook ================================================ FILE: app/src/main/java/com/my/televip/Callback/IntCallback.java ================================================ package com.my.televip.Callback; @FunctionalInterface public interface IntCallback { void run(int param); } ================================================ FILE: app/src/main/java/com/my/televip/Class/ClassLoad.java ================================================ package com.my.televip.Class; import android.content.Context; import com.my.televip.ClientChecker; import com.my.televip.Utils; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import java.util.HashMap; import java.util.Map; import de.robv.android.xposed.XposedHelpers; public class ClassLoad { private static final Map> cache = new HashMap<>(); public static Class getClass(String name) { String resolved = AutomationResolver.resolve(name); if (cache.containsKey(resolved)) { return cache.get(resolved); } try { Class cls = XposedHelpers.findClassIfExists( resolved, Utils.classLoader ); if (cls != null) { cache.put(resolved, cls); } else { if ((ClientChecker.check(ClientChecker.ClientType.Nagram) || ClientChecker.check(ClientChecker.ClientType.Momogram)) && name.equals(ClassNames.DRAWABLE)) return null; Logger.w("Not found " + name + ", " + resolved + " " + Utils.issue); } return cls; } catch (Throwable e) { Logger.e(e); return null; } } public static Class getClass(String name, ClassLoader classLoader) { String resolved = AutomationResolver.resolve(name); if (cache.containsKey(resolved)) { return cache.get(resolved); } try { Class cls = XposedHelpers.findClassIfExists( resolved, classLoader ); if (cls != null) { cache.put(resolved, cls); } else { Logger.w("Not found " + name + ", " + resolved + " " + Utils.issue); } return cls; } catch (Throwable e) { Logger.e(e); return null; } } private static Context applicationContext; public static Context getApplicationContext() { if (applicationContext == null) { applicationContext = (Context) XposedHelpers.getStaticObjectField( getClass(ClassNames.APPLICATION_LOADER), AutomationResolver.resolve("ApplicationLoader", "applicationContext", AutomationResolver.ResolverType.Field) ); } return applicationContext; } } ================================================ FILE: app/src/main/java/com/my/televip/Class/ClassNames.java ================================================ package com.my.televip.Class; public class ClassNames { public static final String MESSAGE_OBJECT = "org.telegram.messenger.MessageObject"; public static final String CHAT_ACTIVITY = "org.telegram.ui.ChatActivity"; public static final String PROFILE_ACTIVITY = "org.telegram.ui.ProfileActivity"; public static final String DRAWABLE = "org.telegram.messenger.R$drawable"; public static final String MESSAGES_CONTROLLER = "org.telegram.messenger.MessagesController"; public static final String MESSAGES_STORAGE = "org.telegram.messenger.MessagesStorage"; public static final String THEME = "org.telegram.ui.ActionBar.Theme"; public static final String APPLICATION_LOADER = "org.telegram.messenger.ApplicationLoader"; public static final String DRAWER_LAYOUT_ADAPTER = "org.telegram.ui.Adapters.DrawerLayoutAdapter"; public static final String LOCALE_CONTROLLER = "org.telegram.messenger.LocaleController"; public static final String NOTIFICATIONS_CONTROLLER = "org.telegram.messenger.NotificationsController"; public static final String NOTIFICATION_CENTER = "org.telegram.messenger.NotificationCenter"; public static final String LAUNCH_ACTIVITY = "org.telegram.ui.LaunchActivity"; public static final String ALERT_DIALOG_BUILDER = "org.telegram.ui.ActionBar.AlertDialog.Builder"; public static final String TEXT_SETTINGS_CELL = "org.telegram.ui.Cells.TextSettingsCell"; public static final String TLRPC_ENCRYPTED_CHAT = "org.telegram.tgnet.TLRPC$EncryptedChat"; public static final String TL_OBJECT = "org.telegram.tgnet.TLObject"; public static final String STORY_ITEM_HOLDER = "org.telegram.ui.Stories.PeerStoriesView$StoryItemHolder"; public static final String TLRPC_USER = "org.telegram.tgnet.TLRPC$User"; public static final String STORIES_CONTROLLER = "org.telegram.ui.Stories.StoriesController"; public static final String FILE_LOAD_OPERATION = "org.telegram.messenger.FileLoadOperation"; public static final String CONNECTIONS_MANAGER = "org.telegram.tgnet.ConnectionsManager"; public static final String TL_ACCOUNT_UPDATE_STATUS = "org.telegram.tgnet.tl.TL_account$updateStatus"; public static final String REQUEST_DELEGATE = "org.telegram.tgnet.RequestDelegate"; public static final String REQUEST_DELEGATE_TIMESTAMP = "org.telegram.tgnet.RequestDelegateTimestamp"; public static final String QUICK_ACK_DELEGATE = "org.telegram.tgnet.QuickAckDelegate"; public static final String WRITE_TO_SOCKET_DELEGATE = "org.telegram.tgnet.WriteToSocketDelegate"; public static final String TL_HELP_APP_UPDATE = "org.telegram.tgnet.TLRPC$TL_help_appUpdate"; public static final String TL_UPDATE_DELETE_MESSAGES = "org.telegram.tgnet.TLRPC$TL_updateDeleteMessages"; public static final String TL_UPDATE_DELETE_CHANNEL_MESSAGES = "org.telegram.tgnet.TLRPC$TL_updateDeleteChannelMessages"; public static final String CHAT_MESSAGE_CELL = "org.telegram.ui.Cells.ChatMessageCell"; public static final String DOWNLOAD_CONTROLLER = "org.telegram.messenger.DownloadController"; public static final String TL_MESSAGE = "org.telegram.tgnet.TLRPC$Message"; public static final String SECRET_MEDIA_VIEWER = "org.telegram.ui.SecretMediaViewer"; public static final String PHOTO_VIEWER = "org.telegram.ui.PhotoViewer"; public static final String PHOTO_VIEWER_PROVIDER = "org.telegram.ui.PhotoViewer$PhotoViewerProvider"; public static final String USER_CONFIG = "org.telegram.messenger.UserConfig"; public static final String TL_MESSAGES_MESSAGES = "org.telegram.tgnet.TLRPC$messages_Messages"; public static final String ALERT_DIALOG_BUTTON_CLICK = "org.telegram.ui.ActionBar.AlertDialog$OnButtonClickListener"; public static final String UTILITIES = "org.telegram.messenger.Utilities"; public static final String TL_MESSAGES_AFFECTED = "org.telegram.tgnet.TLRPC$TL_messages_affectedMessages"; public static final String TL_CHANNELS_READ_HISTORY = "org.telegram.tgnet.TLRPC$TL_channels_readHistory"; public static final String TL_MESSAGES_READ_HISTORY = "org.telegram.tgnet.TLRPC$TL_messages_readHistory"; public static final String SHARED_CONFIG = "org.telegram.messenger.SharedConfig"; public static final String TLRPC_CHAT = "org.telegram.tgnet.TLRPC$Chat"; public static final String CHAT_MESSAGE_CELL_DELEGATE = "org.telegram.ui.ChatActivity$ChatMessageCellDelegate"; public static final String FILE_LOADER = "org.telegram.messenger.FileLoader"; public static final String SETTINGS_ADAPTER_LIST_ADAPTER = "com.televip.SettingsAdapter.SettingsAdapter$ListAdapter"; public static final String ANDROID_UTILITIES = "org.telegram.messenger.AndroidUtilities"; public static final String SETTINGS_ADAPTER_RECYCLER_LIST_VIEW = "com.televip.SettingsAdapter.SettingsAdapter$RecyclerListView"; public static final String SETTINGS_ADAPTER = "com.televip.SettingsAdapter.SettingsAdapter"; } ================================================ FILE: app/src/main/java/com/my/televip/ClientChecker.java ================================================ package com.my.televip; import java.util.Arrays; public class ClientChecker { public static boolean check(ClientType client, String pkgName) { return Arrays.asList(client.getPackageNames()).contains(pkgName); } public static boolean check(ClientType client) { return check(client, Utils.pkgName); } public enum ClientType { Telegram("org.telegram.messenger", com.my.televip.Clients.Telegram.class), TelegramWeb("org.telegram.messenger.web", com.my.televip.Clients.TelegramWeb.class), TelegramPlus("org.telegram.plus", com.my.televip.Clients.TelegramPlus.class), TGConnect("com.tgconnect.android", com.my.televip.Clients.TGConnect.class), Nagram("xyz.nextalone.nagram", com.my.televip.Clients.Nagram.class), Nicegram("app.nicegram", com.my.televip.Clients.Nicegram.class), TelegramBeta("org.telegram.messenger.beta", com.my.televip.Clients.TelegramBeta.class), NagramX("nu.gpu.nagram", com.my.televip.Clients.NagramX.class), XPlus("com.xplus.messenger", com.my.televip.Clients.XPlus.class), iMe("com.iMe.android", com.my.televip.Clients.iMe.class), iMeWeb("com.iMe.android.web", com.my.televip.Clients.iMeWeb.class), forkgram("org.forkgram.messenger", com.my.televip.Clients.forkgram.class), forkgramBeta("org.forkclient.messenger.beta", com.my.televip.Clients.forkgramBeta.class), Telegraph("ir.ilmili.telegraph", com.my.televip.Clients.Telegraph.class), Telega("ru.dahl.messenger", com.my.televip.Clients.Telega.class), Momogram(new String[]{"nekox.messenger.broken", "momo.gram"}, com.my.televip.Clients.Momogram.class); private final String[] packageNames; private final Class resolverClass; ClientType(String packageName, Class resolverClass) { this.packageNames = new String[]{packageName}; this.resolverClass = resolverClass; } ClientType(String[] packageNames, Class resolverClass) { this.packageNames = packageNames; this.resolverClass = resolverClass; } public String[] getPackageNames() { return packageNames; } public Class getResolverClass() { return resolverClass; } public static ClientType fromPackage(String pkg){ for (ClientType type: ClientType.values()){ for (String name: type.getPackageNames()){ if (name.equals(pkg)) return type; } } return null; } public static boolean containsPackage(String pkg){ return fromPackage(pkg) != null; } } } ================================================ FILE: app/src/main/java/com/my/televip/Clients/Momogram.java ================================================ package com.my.televip.Clients; import com.my.televip.Class.ClassLoad; import com.my.televip.Class.ClassNames; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Momogram { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name, classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() { ParameterResolver.register("sendRequestInternal",new Class[]{ClassLoad.getClass(ClassNames.TL_OBJECT), ClassLoad.getClass(ClassNames.REQUEST_DELEGATE), ClassLoad.getClass(ClassNames.REQUEST_DELEGATE_TIMESTAMP), ClassLoad.getClass(ClassNames.QUICK_ACK_DELEGATE), ClassLoad.getClass(ClassNames.WRITE_TO_SOCKET_DELEGATE), int.class, int.class, int.class, boolean.class, int.class, Runnable.class}); } } ================================================ FILE: app/src/main/java/com/my/televip/Clients/Nagram.java ================================================ package com.my.televip.Clients; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Nagram { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() { ParameterResolver.register("markMessagesAsDeletedInternal",new Class[]{ArrayList.class, boolean.class, int.class, int.class, long.class}); ParameterResolver.register("putMessages",new Class[]{int.class, int.class, int.class, long.class, long.class, ClassLoad.getClass(ClassNames.TL_MESSAGES_MESSAGES), boolean.class}); } } ================================================ FILE: app/src/main/java/com/my/televip/Clients/NagramX.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class NagramX { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/Nicegram.java ================================================ package com.my.televip.Clients; import android.view.View; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Nicegram { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() { ParameterResolver.register("fillMessageMenu",new Class[]{ClassLoad.getClass(ClassNames.MESSAGE_OBJECT), ArrayList.class, ArrayList.class, ArrayList.class, ArrayList.class, ArrayList.class, ArrayList.class}); ParameterResolver.register("processSelectedOption",new Class[]{int.class, View.class}); } } ================================================ FILE: app/src/main/java/com/my/televip/Clients/TGConnect.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class TGConnect { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/Telega.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Telega { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/Telegram.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class Telegram { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name, classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/TelegramBeta.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class TelegramBeta { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/TelegramPlus.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class TelegramPlus { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/TelegramWeb.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class TelegramWeb { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/Telegraph.java ================================================ package com.my.televip.Clients; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.Utils; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import de.robv.android.xposed.XC_MethodReplacement; import de.robv.android.xposed.XposedHelpers; public class Telegraph { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() { classList.add(new ClassInfo("org.telegram.messenger.ApplicationLoader", "org.telegram.messenger.com5")); classList.add(new ClassInfo("org.telegram.ui.ActionBar.AlertDialog$OnButtonClickListener", "org.telegram.ui.ActionBar.AlertDialog$coN")); classList.add(new ClassInfo("org.telegram.ui.ActionBar.Theme", "org.telegram.ui.ActionBar.x")); classList.add(new ClassInfo("org.telegram.messenger.LocaleController", "org.telegram.messenger.h9")); classList.add(new ClassInfo("org.telegram.ui.Cells.ChatMessageCell","org.telegram.ui.Cells.COm7")); classList.add(new ClassInfo("org.telegram.messenger.MessagesController","org.telegram.messenger.Zq")); classList.add(new ClassInfo("org.telegram.messenger.MessagesStorage","org.telegram.messenger.uw")); classList.add(new ClassInfo("org.telegram.messenger.NotificationsController","org.telegram.messenger.Yx")); classList.add(new ClassInfo("org.telegram.messenger.NotificationCenter","org.telegram.messenger.Ow")); classList.add(new ClassInfo("org.telegram.messenger.MessageObject","org.telegram.messenger.ih")); classList.add(new ClassInfo("org.telegram.messenger.UserConfig","org.telegram.messenger.OE")); classList.add(new ClassInfo("org.telegram.ui.Stories.StoriesController","org.telegram.ui.Stories.w2")); classList.add(new ClassInfo("org.telegram.ui.Stories.PeerStoriesView$StoryItemHolder","org.telegram.ui.Stories.m$coM2")); classList.add(new ClassInfo("org.telegram.ui.ActionBar.BaseFragment","org.telegram.ui.ActionBar.com8")); classList.add(new ClassInfo("org.telegram.ui.PhotoViewer$PhotoViewerProvider","org.telegram.ui.PhotoViewer$lpt1")); classList.add(new ClassInfo("org.telegram.ui.ChatActivity","org.telegram.ui.Og")); classList.add(new ClassInfo("org.telegram.messenger.BaseController","org.telegram.messenger.com7")); classList.add(new ClassInfo("org.telegram.messenger.AndroidUtilities","org.telegram.messenger.com4")); classList.add(new ClassInfo("org.telegram.ui.Cells.TextCheckCell","org.telegram.ui.Cells.N0")); classList.add(new ClassInfo("org.telegram.ui.Cells.ShadowSectionCell","org.telegram.ui.Cells.Q")); classList.add(new ClassInfo("org.telegram.ui.Cells.HeaderCell","org.telegram.ui.Cells.lPT6")); classList.add(new ClassInfo("org.telegram.ui.Cells.TextSettingsCell","org.telegram.ui.Cells.n1")); classList.add(new ClassInfo("org.telegram.ui.Components.UniversalAdapter","org.telegram.ui.Components.iN")); classList.add(new ClassInfo("org.telegram.messenger.SharedConfig","org.telegram.messenger.DC")); classList.add(new ClassInfo("org.telegram.messenger.MessagesStorage$IntCallback","org.telegram.messenger.uw$AUx")); classList.add(new ClassInfo("org.telegram.ui.ChatActivity$ChatMessageCellDelegate","org.telegram.ui.Og$LPT6")); fieldList.add(new FieldInfo("ApplicationLoader", "applicationContext", "b")); fieldList.add(new FieldInfo("LaunchActivity", "drawerLayoutAdapter", "M")); fieldList.add(new FieldInfo("LaunchActivity", "drawerLayoutContainer", "L")); fieldList.add(new FieldInfo("LocaleController", "currentLocale", "y")); fieldList.add(new FieldInfo("ChatMessageCell","currentMessageObject","W6")); fieldList.add(new FieldInfo("MessagesController","dialogMessage","C")); fieldList.add(new FieldInfo("MessagesController","dialogMessagesByIds","F")); fieldList.add(new FieldInfo("NotificationCenter","messagesDeleted","c0")); fieldList.add(new FieldInfo("MessagesController$ReadTask","dialogId","a")); fieldList.add(new FieldInfo("Theme","chat_timePaint","o3")); fieldList.add(new FieldInfo("ChatMessageCell","currentTimeString","fb")); fieldList.add(new FieldInfo("ChatMessageCell","timeTextWidth","cb")); fieldList.add(new FieldInfo("ChatMessageCell","timeWidth","bb")); fieldList.add(new FieldInfo("ProfileActivity","userId","J0")); fieldList.add(new FieldInfo("LaunchActivity","frameLayout","H")); fieldList.add(new FieldInfo("ChatActivity","selectedObject","S4")); fieldList.add(new FieldInfo("MessagesStorage","database","b")); fieldList.add(new FieldInfo("UserConfig","clientUserId","i")); fieldList.add(new FieldInfo("UserConfig","selectedAccount","j0")); fieldList.add(new FieldInfo("UItem","id","d")); fieldList.add(new FieldInfo("SettingsActivity$SettingCell","iconView","c")); fieldList.add(new FieldInfo("ChatActivity","pinnedMessageView","l2")); fieldList.add(new FieldInfo("PhotoViewer$PlaceProviderObject","imageReceiver","a")); methodList.add(new MethodInfo("AlertDialog","setTitle", "H")); methodList.add(new MethodInfo("AlertDialog","setView", "O")); methodList.add(new MethodInfo("AlertDialog","setMessage", "G")); methodList.add(new MethodInfo("AlertDialog","setPositiveButton", "F")); methodList.add(new MethodInfo("AlertDialog","setNegativeButton", "z")); methodList.add(new MethodInfo("AlertDialog","setNeutralButton", "A")); methodList.add(new MethodInfo("AlertDialog","show", "R")); methodList.add(new MethodInfo("AlertDialog$OnButtonClickListener","onClick", "a")); methodList.add(new MethodInfo("Theme","getActiveTheme", "T3")); methodList.add(new MethodInfo("Theme","isDark", "J")); methodList.add(new MethodInfo("Theme","getEventType", "O2")); methodList.add(new MethodInfo("DrawerLayoutContainer", "closeDrawer", "e")); methodList.add(new MethodInfo("LocaleController", "getInstance", "E1")); methodList.add(new MethodInfo("ChatMessageCell","measureTime","z6")); methodList.add(new MethodInfo("MessagesController","deleteMessages","M9")); methodList.add(new MethodInfo("MessagesStorage","markMessagesAsDeleted","l7")); methodList.add(new MethodInfo("MessagesStorage","markMessagesAsDeletedInternal","o7")); methodList.add(new MethodInfo("MessagesStorage","updateDialogsWithDeletedMessagesInternal","h9")); methodList.add(new MethodInfo("MessagesStorage","updateDialogsWithDeletedMessages","g9")); methodList.add(new MethodInfo("NotificationsController","removeDeletedMessagesFromNotifications","q1")); methodList.add(new MethodInfo("NotificationCenter","postNotificationName","B")); methodList.add(new MethodInfo("UserConfig","isPremium","N")); methodList.add(new MethodInfo("MessagesController","completeReadTask","u9")); methodList.add(new MethodInfo("MessagesController","getUser","mc")); methodList.add(new MethodInfo("MessagesStorage","getDatabase","z5")); methodList.add(new MethodInfo("StoriesController","hasStories","f1")); methodList.add(new MethodInfo("StoriesController","hasStories2","g1")); methodList.add(new MethodInfo("MessagesController","storiesEnabled","Og")); methodList.add(new MethodInfo("MessagesController","storyEntitiesAllowed","Ng")); methodList.add(new MethodInfo("MessagesController","storyEntitiesAllowed2","Pg")); methodList.add(new MethodInfo("PeerStoriesView$StoryItemHolder","allowScreenshots","r")); methodList.add(new MethodInfo("UserConfig","getClientUserId","v")); methodList.add(new MethodInfo("ProfileActivity","updateProfileData","Ie")); methodList.add(new MethodInfo("MessagesController","isChatNoForwards","Qc")); methodList.add(new MethodInfo("ChatActivity","sendSecretMessageRead","Fx")); methodList.add(new MethodInfo("ChatActivity","sendSecretMediaDelete","Ex")); methodList.add(new MethodInfo("TextCheckCell","setTextAndValueAndCheck","j")); methodList.add(new MethodInfo("TextCheckCell","setTextAndCheck","i")); methodList.add(new MethodInfo("TextCheckCell","isChecked","d")); methodList.add(new MethodInfo("AndroidUtilities","isTablet","u4")); methodList.add(new MethodInfo("TextSettingsCell","setText","c")); methodList.add(new MethodInfo("LocaleController","formatShortNumber","x0")); methodList.add(new MethodInfo("ChatActivity","fillMessageMenu","Ur")); methodList.add(new MethodInfo("ChatActivity","processSelectedOption","Qw")); methodList.add(new MethodInfo("MessagesStorage","putMessages","P7")); methodList.add(new MethodInfo("SettingsActivity$SettingCell","set","a")); methodList.add(new MethodInfo("SettingsActivity","fillItems","M0")); methodList.add(new MethodInfo("SettingsActivity","onClick","Q0")); methodList.add(new MethodInfo("MessagesStorage","getInstance","N5")); methodList.add(new MethodInfo("MessagesStorage","getStorageQueue","g6")); methodList.add(new MethodInfo("MessagesStorage","getDialogMaxMessageId","E5")); methodList.add(new MethodInfo("MessagesController","getInstance","Cb")); methodList.add(new MethodInfo("MessagesController","processNewDifferenceParams","af")); methodList.add(new MethodInfo("MessagesController","getInputChannel","qb")); methodList.add(new MethodInfo("UserConfig","getCurrentUser","w")); methodList.add(new MethodInfo("ChatActivity","createPinnedMessageView","mr")); methodList.add(new MethodInfo("ChatActivity","updatePinnedMessageView","Uz")); methodList.add(new MethodInfo("ChatActivity","hasSelectedNoforwardsMessage","yt")); methodList.add(new MethodInfo("Theme","isCurrentThemeDark","U3")); methodList.add(new MethodInfo("MessagesController","checkPromoInfoInternal","q9")); methodList.add(new MethodInfo("MessagesController","hidePromoDialog","Hc")); methodList.add(new MethodInfo("ChatActivity$ChatMessageCellDelegate","didPressImage","C")); methodList.add(new MethodInfo("PhotoViewer","getInstance","pc")); methodList.add(new MethodInfo("PhotoViewer","setParentActivity","Oe")); methodList.add(new MethodInfo("PhotoViewer","openPhoto","Kd")); ParameterResolver.register("fillMessageMenu", new Class[]{ClassLoad.getClass(ClassNames.MESSAGE_OBJECT), ClassLoad.getClass(ClassNames.MESSAGE_OBJECT), ArrayList.class, ArrayList.class, ArrayList.class}); } public static void removeAd(){ try { Class connectionsManager = XposedHelpers.findClassIfExists("org.telegram.tgnet.ConnectionsManager", Utils.classLoader); if (connectionsManager != null) { HMethod.hookMethod(connectionsManager, "native_expireFile", long.class, new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) { return false; } }); HMethod.hookMethod(connectionsManager, "native_daysFile", long.class, new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) { return 999; } }); HMethod.hookMethod(connectionsManager, "native_checkLicense", long.class, new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) { return true; } }); HMethod.hookMethod(connectionsManager, "native_removeInstance", int.class, boolean.class, new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) { return true; } }); } } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/Clients/XPlus.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class XPlus { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes) { objectList.put(name, classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null) { has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/forkgram.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class forkgram { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/forkgramBeta.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class forkgramBeta { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/iMe.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class iMe { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Clients/iMeWeb.java ================================================ package com.my.televip.Clients; import com.my.televip.obfuscate.struct.ClassInfo; import com.my.televip.obfuscate.struct.FieldInfo; import com.my.televip.obfuscate.struct.MethodInfo; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class iMeWeb { private static final List classList = new ArrayList<>(); private static final List fieldList = new ArrayList<>(); private static final List methodList = new ArrayList<>(); public static class ClassResolver { public static String resolve(String name) { for (ClassInfo info : classList) if (info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String name) { boolean has = false; for (ClassInfo info : classList) { if (info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class FieldResolver { public static String resolve(String className, String name) { for (FieldInfo info : fieldList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (FieldInfo info : fieldList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class MethodResolver { public static String resolve(String className, String name) { for (MethodInfo info : methodList) if (info.getClassName().equals(className) && info.getOriginal().equals(name)) return info.getResolved(); return null; } public static boolean has(String className, String name) { boolean has = false; for (MethodInfo info : methodList) { if (info.getClassName().equals(className) && info.getOriginal().equals(name)) { has = true; break; } } return has; } } public static class ParameterResolver { static Map[]> objectList = new HashMap<>(); public static void register(String name, Class[] classes){ objectList.put(name,classes); } public static Class[] resolve(String name) { return objectList.get(name); } public static boolean has(String name) { boolean has = false; Class[] classes = objectList.get(name); if (classes != null){ has = true; } return has; } } public static void loadParameter() {} } ================================================ FILE: app/src/main/java/com/my/televip/Configs/ConfigItem.java ================================================ package com.my.televip.Configs; public class ConfigItem { public static final int HEADER = 0, SWITCH = 1, BUTTON = 2, DIVIDER = 3, INFO = 4; private final int type; private String key; private String text; private boolean value; private Runnable runnable; public ConfigItem(int type, String key, String text, boolean value, Runnable runnable) { this.type = type; this.key = key; this.text = text; this.value = value; this.runnable = runnable; } public ConfigItem(int type, String key, boolean value, Runnable runnable) { this.type = type; this.key = key; this.value = value; this.runnable = runnable; } public ConfigItem(int type, String key) { this.type = type; this.key = key; } public ConfigItem(int type) { this.type = type; } public int getType() { return type; } public String getKey() { return key; } public String getText() { return text; } public boolean isEnable() { return value; } public void setEnable(boolean value) { this.value = value; ConfigPreferences.putBoolean(key, value); } public Runnable getRunnable() { return runnable; } public void run() { if (runnable != null) runnable.run(); } } ================================================ FILE: app/src/main/java/com/my/televip/Configs/ConfigManager.java ================================================ package com.my.televip.Configs; import android.content.Context; import com.my.televip.ClientChecker; import com.my.televip.Clients.Telegraph; import com.my.televip.features.DisableChannelSwipeBack; import com.my.televip.features.DisableNumberRounding; import com.my.televip.features.DisableProfileSwipeBack; import com.my.televip.features.DisableStories; import com.my.televip.features.DownloadSpeed; import com.my.televip.features.EnableSavingStories; import com.my.televip.features.FixTLError; import com.my.televip.features.GhostMode; import com.my.televip.features.HideOnline; import com.my.televip.features.HidePhone; import com.my.televip.features.HidePinnedMessages; import com.my.televip.features.HideProxySponsor; import com.my.televip.features.HideUpdateApp; import com.my.televip.features.PreventMedia; import com.my.televip.features.RemovesContentSaving; import com.my.televip.features.SaveEditsHistory; import com.my.televip.features.SecretMediaSave; import com.my.televip.features.ShowDeletedMessages; import com.my.televip.features.TelePremium; import com.my.televip.features.otherFeatures.CopyNameHook; import com.my.televip.features.otherFeatures.FeatureInitializer; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.logging.Logger; import com.my.televip.virtuals.ui.Cells.ChatMessageCell; import java.util.ArrayList; import java.util.List; public class ConfigManager { private static final List configs = new ArrayList<>(); // GhostMode public static ConfigItem ghostModeSettings; public static ConfigItem hideSeen; public static ConfigItem markReadAfterSend; public static ConfigItem hideTyping; public static ConfigItem hideStoryView; public static ConfigItem hidePhone; public static ConfigItem hideOnline; public static ConfigItem onlineInfo; public static ConfigItem shadows; // Stories public static ConfigItem stories; public static ConfigItem disableStories; // Messages public static ConfigItem messages; public static ConfigItem showDeletedMessages; public static ConfigItem showMessageId; public static ConfigItem saveEditsHistory; // Connections public static ConfigItem connections; public static ConfigItem downloadSpeed; // Media public static ConfigItem media; public static ConfigItem secretMediaSave; public static ConfigItem preventMedia; public static ConfigItem enableSavingStories; //UI public static ConfigItem ui; public static ConfigItem hidePinnedMessages; public static ConfigItem disableChannelSwipeBack; public static ConfigItem disableProfileSwipeBack; public static ConfigItem hideProxySponsor; // Other Features public static ConfigItem otherFeatures; public static ConfigItem removesContentSaving; public static ConfigItem telegramPremium; public static ConfigItem disableNumberRounding; public static ConfigItem hideUpdateApp; public static ConfigItem fixTLError; // Button public static ConfigItem btnChannel; public static ConfigItem btnRestartApp; public static void loadAndRead(Context context){ ConfigPreferences.init(); load(context); readFeature(context); } public static void load(Context context) { configs.clear(); // GhostMode ghostModeSettings = new ConfigItem(ConfigItem.HEADER, Keys.GhostModeSettings); configs.add(ghostModeSettings); hideSeen = new ConfigItem(ConfigItem.SWITCH, Keys.HideSeen, ConfigPreferences.getBoolean(Keys.HideSeen), GhostMode::init); configs.add(hideSeen); markReadAfterSend = new ConfigItem(ConfigItem.SWITCH, Keys.MarkReadAfterSend, ConfigPreferences.getBoolean(Keys.MarkReadAfterSend), GhostMode::init); configs.add(markReadAfterSend); hideTyping = new ConfigItem(ConfigItem.SWITCH, Keys.HideTyping, ConfigPreferences.getBoolean(Keys.HideTyping), GhostMode::init); configs.add(hideTyping); hideStoryView = new ConfigItem(ConfigItem.SWITCH, Keys.HideStoryView, ConfigPreferences.getBoolean(Keys.HideStoryView), GhostMode::init); configs.add(hideStoryView); hidePhone = new ConfigItem(ConfigItem.SWITCH, Keys.HidePhone, Translator.get(Keys.RestartRequired), ConfigPreferences.getBoolean(Keys.HidePhone), HidePhone::init); configs.add(hidePhone); hideOnline = new ConfigItem(ConfigItem.SWITCH, Keys.HideOnline, Translator.get(Keys.RestartRequired), ConfigPreferences.getBoolean(Keys.HideOnline), () -> { GhostMode.init(); HideOnline.init(); }); configs.add(hideOnline); onlineInfo = new ConfigItem(ConfigItem.INFO, Keys.OfflineVisibilityInfo); configs.add(onlineInfo); shadows = new ConfigItem(ConfigItem.DIVIDER); configs.add(shadows); // Stories stories = new ConfigItem(ConfigItem.HEADER, Keys.StoriesSettings); configs.add(stories); disableStories = new ConfigItem(ConfigItem.SWITCH, Keys.DisableStories, Translator.get(Keys.RestartRequired), ConfigPreferences.getBoolean(Keys.DisableStories), DisableStories::init); configs.add(disableStories); configs.add(shadows); // Messages messages = new ConfigItem(ConfigItem.HEADER, Keys.MessagesSettings); configs.add(messages); showDeletedMessages = new ConfigItem(ConfigItem.SWITCH, Keys.ShowDeletedMessages, ConfigPreferences.getBoolean(Keys.ShowDeletedMessages), ShowDeletedMessages::initProcessing); configs.add(showDeletedMessages); if (!ClientChecker.check(ClientChecker.ClientType.NagramX)) { showMessageId = new ConfigItem(ConfigItem.SWITCH, Keys.ShowMessageID, ConfigPreferences.getBoolean(Keys.ShowMessageID), ChatMessageCell::init); configs.add(showMessageId); } saveEditsHistory = new ConfigItem(ConfigItem.SWITCH, Keys.SaveEditsHistory, ConfigPreferences.getBoolean(Keys.SaveEditsHistory), () -> SaveEditsHistory.init(context)); configs.add(saveEditsHistory); configs.add(shadows); // Connections connections = new ConfigItem(ConfigItem.HEADER, Keys.ConnectionsSettings); configs.add(connections); downloadSpeed = new ConfigItem(ConfigItem.SWITCH, Keys.DownloadSpeed, ConfigPreferences.getBoolean(Keys.DownloadSpeed), DownloadSpeed::init); configs.add(downloadSpeed); configs.add(shadows); // Media media = new ConfigItem(ConfigItem.HEADER, Keys.MediaSettings); configs.add(media); secretMediaSave = new ConfigItem(ConfigItem.SWITCH, Keys.SecretMediaSave, ConfigPreferences.getBoolean(Keys.SecretMediaSave), SecretMediaSave::init); configs.add(secretMediaSave); preventMedia = new ConfigItem(ConfigItem.SWITCH, Keys.PreventMedia, ConfigPreferences.getBoolean(Keys.PreventMedia), PreventMedia::init); configs.add(preventMedia); enableSavingStories = new ConfigItem(ConfigItem.SWITCH, Keys.EnableSavingStories, ConfigPreferences.getBoolean(Keys.EnableSavingStories), EnableSavingStories::init); configs.add(enableSavingStories); configs.add(shadows); // UI ui = new ConfigItem(ConfigItem.HEADER, Keys.UiSettings); configs.add(ui); hidePinnedMessages = new ConfigItem(ConfigItem.SWITCH, Keys.HidePinnedMessages, ConfigPreferences.getBoolean(Keys.HidePinnedMessages), HidePinnedMessages::init); configs.add(hidePinnedMessages); disableChannelSwipeBack = new ConfigItem(ConfigItem.SWITCH, Keys.DisableChannelSwipeBack, ConfigPreferences.getBoolean(Keys.DisableChannelSwipeBack), DisableChannelSwipeBack::init); configs.add(disableChannelSwipeBack); disableProfileSwipeBack = new ConfigItem(ConfigItem.SWITCH, Keys.DisableProfileSwipeBack, ConfigPreferences.getBoolean(Keys.DisableProfileSwipeBack), DisableProfileSwipeBack::init); configs.add(disableProfileSwipeBack); hideProxySponsor = new ConfigItem(ConfigItem.SWITCH, Keys.HideProxySponsor, Translator.get(Keys.RestartRequired), ConfigPreferences.getBoolean(Keys.HideProxySponsor), GhostMode::init); configs.add(hideProxySponsor); configs.add(shadows); // Other Features otherFeatures = new ConfigItem(ConfigItem.HEADER, Keys.OtherFeaturesSettings); configs.add(otherFeatures); removesContentSaving = new ConfigItem(ConfigItem.SWITCH, Keys.RemovesContentSaving, ConfigPreferences.getBoolean(Keys.RemovesContentSaving), RemovesContentSaving::init); configs.add(removesContentSaving); telegramPremium = new ConfigItem(ConfigItem.SWITCH, Keys.TelegramPremium, ConfigPreferences.getBoolean(Keys.TelegramPremium), TelePremium::init); configs.add(telegramPremium); if (!ClientChecker.check(ClientChecker.ClientType.Telegraph)) { disableNumberRounding = new ConfigItem(ConfigItem.SWITCH, Keys.DisableNumberRounding, "5.3K -> 5300", ConfigPreferences.getBoolean(Keys.DisableNumberRounding), DisableNumberRounding::init); hideUpdateApp = new ConfigItem(ConfigItem.SWITCH, Keys.HideUpdateApp, Translator.get(Keys.RestartRequired), ConfigPreferences.getBoolean(Keys.HideUpdateApp), HideUpdateApp::init); fixTLError = new ConfigItem(ConfigItem.SWITCH, Keys.FixTLError, ConfigPreferences.getBoolean(Keys.FixTLError), FixTLError::init); configs.add(disableNumberRounding); configs.add(hideUpdateApp); configs.add(fixTLError); } configs.add(shadows); btnChannel = new ConfigItem(ConfigItem.BUTTON, Keys.DeveloperChannel); configs.add(btnChannel); configs.add(shadows); btnRestartApp = new ConfigItem(ConfigItem.BUTTON, Keys.RestartApp); configs.add(btnRestartApp); configs.add(shadows); if (hideProxySponsor.isEnable()) HideProxySponsor.removePromoDialog(); if ((showDeletedMessages.isEnable() || showMessageId.isEnable()) && !ChatMessageCell.isEnable) ChatMessageCell.init(); } public static List getItems(Context context) { load(context); List items = new ArrayList<>(); for (ConfigItem configItem : configs) { if (configItem == null) continue; items.add(new ConfigItem(configItem.getType(), configItem.getKey(), configItem.getText(), configItem.isEnable(), configItem.getRunnable())); } return items; } public static void readFeature(Context context) { try { for (ConfigItem item : configs) { if (item == null) continue; if (item.getType() != ConfigItem.SWITCH) continue; if (item.isEnable()) item.run(); } if (!ClientChecker.check(ClientChecker.ClientType.Telegraph)) { FeatureInitializer.init(context); CopyNameHook.init(context); } else { Telegraph.removeAd(); } } catch (Throwable e) { Logger.e(e); } } public static boolean isGhostMode(){ return hideSeen.isEnable() || hideStoryView.isEnable() || hideTyping.isEnable() || hideOnline.isEnable() || markReadAfterSend.isEnable() || hideProxySponsor.isEnable(); } } ================================================ FILE: app/src/main/java/com/my/televip/Configs/ConfigPreferences.java ================================================ package com.my.televip.Configs; import android.app.Activity; import android.content.SharedPreferences; import com.my.televip.Class.ClassLoad; import com.my.televip.logging.Logger; public class ConfigPreferences { private static SharedPreferences sharedPreferences; public static void init(){ sharedPreferences = ClassLoad.getApplicationContext().getSharedPreferences("TeleVip", Activity.MODE_PRIVATE); } public static boolean getBoolean(String key) { try { return sharedPreferences.getBoolean(key, false); } catch (ClassCastException e) { sharedPreferences.edit().remove(key).apply(); return false; } } public static void putBoolean(String key, boolean b) { try { sharedPreferences.edit().putBoolean(key, b).apply(); } catch (ClassCastException e) { sharedPreferences.edit().remove(key).apply(); } } public static String getString(String key) { try { return sharedPreferences.getString(key, null); } catch (ClassCastException e) { sharedPreferences.edit().remove(key).apply(); return null; } } public static void putString(String key, String v) { try { sharedPreferences.edit().putString(key, v).apply(); } catch (ClassCastException e) { sharedPreferences.edit().remove(key).apply(); } } public static void remove(String key){ try { sharedPreferences.edit().remove(key).apply(); } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/Database/MessageDatabase.java ================================================ package com.my.televip.Database; import android.content.ContentValues; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import com.my.televip.logging.Logger; import java.io.File; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Locale; public class MessageDatabase extends SQLiteOpenHelper { private final String TABLE_MESSAGES = "messages"; private final String COLUMN_ID = "id"; private final String COLUMN_MSG_ID = "msg_id"; private final String COLUMN_MESSAGE = "message"; private final String COLUMN_MESSAGE_EDITED = "message_Edited"; private final String COLUMN_MSG_COUNT = "msg_count"; public MessageDatabase(Context context) { super(context, getDataBasePath(context), null, 1); } public static String getDataBasePath(Context context) { File appDir = new File(context.getDataDir(), "TeleVip"); if (!appDir.exists()) { appDir.mkdirs(); } return new File(appDir, "SaveMessages.db").getAbsolutePath(); } @Override public void onCreate(SQLiteDatabase db) { String TABLE_CREATE = "CREATE TABLE " + TABLE_MESSAGES + " (" + COLUMN_ID + " LONG, " + COLUMN_MSG_ID + " INTEGER, " + COLUMN_MSG_COUNT + " INTEGER, " + COLUMN_MESSAGE + " TEXT, " + COLUMN_MESSAGE_EDITED + " TEXT " + ");"; db.execSQL(TABLE_CREATE); } @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { db.execSQL("DROP TABLE IF EXISTS " + TABLE_MESSAGES); onCreate(db); } public void addMessage(long id, int msgId, String message) { try { SQLiteDatabase database = getWritableDatabase(); if (!searchMessage(id, msgId, message)) { ContentValues values = new ContentValues(); values.put(COLUMN_ID, id); values.put(COLUMN_MSG_ID, msgId); values.put(COLUMN_MESSAGE, message); int maxMsgCount = getMaxMessageCount(id, msgId); values.put(COLUMN_MSG_COUNT, maxMsgCount + 1); String formattedDate = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss", Locale.US).format(new Date()); values.put(COLUMN_MESSAGE_EDITED, formattedDate); database.insert(TABLE_MESSAGES, null, values); } } catch (Throwable t) { Logger.e(t); } } public boolean searchMessage(long id, int msgId, String message) { if (message == null) return false; try { SQLiteDatabase database = getReadableDatabase(); String query = "SELECT * FROM " + TABLE_MESSAGES + " WHERE " + COLUMN_ID + " = ? AND " + COLUMN_MSG_ID + " = ? AND " + COLUMN_MESSAGE + " = ?"; Cursor cursor = database.rawQuery(query, new String[]{ String.valueOf(id), String.valueOf(msgId), message }); boolean exists = cursor.getCount() > 0; cursor.close(); return exists; } catch (Throwable t) { Logger.e(t); } return false; } public boolean searchMessage(long id, int msgId) { try { SQLiteDatabase database = getReadableDatabase(); String query = "SELECT * FROM " + TABLE_MESSAGES + " WHERE " + COLUMN_ID + " = ? AND " + COLUMN_MSG_ID + " = ?"; Cursor cursor = database.rawQuery(query, new String[]{ String.valueOf(id), String.valueOf(msgId) }); boolean exists = cursor.getCount() > 0; cursor.close(); return exists; } catch (Throwable t) { Logger.e(t); } return false; } public String getMessage(long id, int msgId) { try { SQLiteDatabase database = getReadableDatabase(); String query = "SELECT " + COLUMN_MESSAGE + " FROM " + TABLE_MESSAGES + " WHERE " + COLUMN_ID + " = ? AND " + COLUMN_MSG_ID + " = ?"; Cursor cursor = database.rawQuery(query, new String[]{String.valueOf(id), String.valueOf(msgId)}); String message = null; if (cursor.moveToFirst()) { message = cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_MESSAGE)); } cursor.close(); return message; } catch (Throwable t) { Logger.e(t); } return null; } public String getMessage(long id, int msgId, int msgCount) { try { SQLiteDatabase database = getReadableDatabase(); String query = "SELECT " + COLUMN_MESSAGE + " FROM " + TABLE_MESSAGES + " WHERE " + COLUMN_ID + " = ? AND " + COLUMN_MSG_ID + " = ? AND " + COLUMN_MSG_COUNT + " = ?"; Cursor cursor = database.rawQuery(query, new String[]{String.valueOf(id), String.valueOf(msgId), String.valueOf(msgCount)}); String message = null; if (cursor.moveToFirst()) { message = cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_MESSAGE)); } cursor.close(); return message; } catch (Throwable t) { Logger.e(t); } return null; } public String getMessageEdited(long id, int msgId, int msgCount) { try { SQLiteDatabase database = getReadableDatabase(); String query = "SELECT " + COLUMN_MESSAGE_EDITED + " FROM " + TABLE_MESSAGES + " WHERE " + COLUMN_ID + " = ? AND " + COLUMN_MSG_ID + " = ? AND " + COLUMN_MSG_COUNT + " = ?"; Cursor cursor = database.rawQuery(query, new String[]{String.valueOf(id), String.valueOf(msgId), String.valueOf(msgCount)}); String messageEdited = null; if (cursor.moveToFirst()) { messageEdited = cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_MESSAGE_EDITED)); } cursor.close(); return messageEdited; } catch (Throwable t) { Logger.e(t); } return null; } public int getMaxMessageCount(long id, int msgId) { int maxCount = 0; try { SQLiteDatabase database = getReadableDatabase(); String query = "SELECT MAX(" + COLUMN_MSG_COUNT + ") as max_count FROM " + TABLE_MESSAGES + " WHERE " + COLUMN_ID + " = ? AND " + COLUMN_MSG_ID + " = ?"; Cursor cursor = database.rawQuery(query, new String[]{String.valueOf(id), String.valueOf(msgId)}); if (cursor.moveToFirst()) { maxCount = cursor.getInt(cursor.getColumnIndexOrThrow("max_count")); } cursor.close(); } catch (Throwable t) { Logger.e(t); } return maxCount; } } ================================================ FILE: app/src/main/java/com/my/televip/Drawable/ArrowDrawable.java ================================================ package com.my.televip.Drawable; import static android.view.View.LAYOUT_DIRECTION_RTL; import android.graphics.Canvas; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.Path; import android.graphics.drawable.Drawable; import com.my.televip.virtuals.Theme; public class ArrowDrawable extends Drawable { private final Paint paint; private final Path path; public ArrowDrawable() { paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.FILL); paint.setColor(Theme.getArrowDrawableColor()); path = new Path(); path.moveTo(20f, 11f); path.lineTo(7.8f, 11f); path.lineTo(13.4f, 5.4f); path.lineTo(12f, 4f); path.lineTo(4f, 12f); path.lineTo(12f, 20f); path.lineTo(13.4f, 18.6f); path.lineTo(7.8f, 13f); path.lineTo(20f, 13f); path.lineTo(20f, 11f); path.close(); } @Override public void draw(Canvas canvas) { float scaleX = getBounds().width() / 24f; float scaleY = getBounds().height() / 24f; canvas.save(); // دعم autoMirrored عند RTL if ((getLayoutDirection() == LAYOUT_DIRECTION_RTL)) { canvas.translate(getBounds().width(), 0); canvas.scale(-scaleX, scaleY); } else { canvas.scale(scaleX, scaleY); } canvas.drawPath(path, paint); canvas.restore(); } @Override public void setAlpha(int alpha) { paint.setAlpha(alpha); invalidateSelf(); } @Override public void setColorFilter(ColorFilter colorFilter) { paint.setColorFilter(colorFilter); invalidateSelf(); } @Override public int getOpacity() { return paint.getAlpha() == 255 ? android.graphics.PixelFormat.OPAQUE : android.graphics.PixelFormat.TRANSLUCENT; } } ================================================ FILE: app/src/main/java/com/my/televip/Drawable/GhostDrawable.java ================================================ package com.my.televip.Drawable; import static android.view.View.LAYOUT_DIRECTION_RTL; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.ColorFilter; import android.graphics.Paint; import android.graphics.Path; import android.graphics.PixelFormat; import android.graphics.drawable.Drawable; public class GhostDrawable extends Drawable { private final Paint paint; private final Path bodyPath; private final Path eyeLeft; private final Path eyeRight; private final Paint eyePaint; public GhostDrawable() { paint = new Paint(Paint.ANTI_ALIAS_FLAG); paint.setStyle(Paint.Style.FILL); paint.setColor(Color.WHITE); // جسم الشبح bodyPath = new Path(); bodyPath.moveTo(12f, 1.83f); bodyPath.cubicTo(6.94f, 1.83f, 2.84f, 5.96f, 2.84f, 11.06f); bodyPath.lineTo(2.84f, 20.82f); bodyPath.cubicTo(2.84f, 21.37f, 3.4f, 21.71f, 3.88f, 21.47f); bodyPath.lineTo(6.2f, 20.3f); bodyPath.cubicTo(7.77f, 19.51f, 9.67f, 19.97f, 10.73f, 21.38f); bodyPath.cubicTo(11.44f, 22.34f, 12.83f, 22.44f, 13.68f, 21.58f); bodyPath.lineTo(14.05f, 21.21f); bodyPath.cubicTo(15.37f, 19.88f, 17.43f, 19.63f, 19.05f, 20.6f); bodyPath.lineTo(20.35f, 21.39f); bodyPath.cubicTo(20.7f, 21.59f, 21.15f, 21.35f, 21.15f, 20.92f); bodyPath.lineTo(21.15f, 11.06f); bodyPath.cubicTo(21.15f, 5.96f, 17.05f, 1.83f, 12f, 1.83f); bodyPath.close(); // العين اليمنى eyeRight = new Path(); eyeRight.addCircle(15.5f, 11f, 1.5f, Path.Direction.CW); // العين اليسرى eyeLeft = new Path(); eyeLeft.addCircle(8.5f, 11f, 1.5f, Path.Direction.CW); eyePaint = new Paint(Paint.ANTI_ALIAS_FLAG); eyePaint.setStyle(Paint.Style.FILL); eyePaint.setColor(0xFF000000); // أسود (تقدر تغيّره) } @Override public void draw(Canvas canvas) { float scaleX = getBounds().width() / 24f; float scaleY = getBounds().height() / 24f; canvas.save(); if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) { canvas.translate(getBounds().width(), 0); canvas.scale(-scaleX, scaleY); } else { canvas.scale(scaleX, scaleY); } // رسم الجسم canvas.drawPath(bodyPath, paint); // رسم العيون canvas.drawPath(eyeLeft, eyePaint); canvas.drawPath(eyeRight, eyePaint); canvas.restore(); } @Override public void setAlpha(int alpha) { paint.setAlpha(alpha); invalidateSelf(); } @Override public void setColorFilter(ColorFilter colorFilter) { paint.setColorFilter(colorFilter); invalidateSelf(); } @Override public int getOpacity() { return paint.getAlpha() == 255 ? PixelFormat.OPAQUE : PixelFormat.TRANSLUCENT; } } ================================================ FILE: app/src/main/java/com/my/televip/MainHook.java ================================================ package com.my.televip; import android.app.Activity; import android.os.Bundle; import com.my.televip.Class.ClassLoad; import com.my.televip.Class.ClassNames; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import de.robv.android.xposed.IXposedHookLoadPackage; import de.robv.android.xposed.IXposedHookZygoteInit; import de.robv.android.xposed.callbacks.XC_LoadPackage; public class MainHook implements IXposedHookLoadPackage, IXposedHookZygoteInit { private boolean isStart; @Override public void initZygote(StartupParam startupParam){ Utils.modulePath = startupParam.modulePath; } @Override public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) { if (!ClientChecker.ClientType.containsPackage(lpparam.packageName)) { return; } Utils.pkgName = lpparam.packageName; Utils.classLoader = lpparam.classLoader; HMethod.hookMethod(ClassLoad.getClass(ClassNames.LAUNCH_ACTIVITY), "onCreate", Bundle.class, new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { Activity launchActivity = (Activity) param.thisObject; if (!isStart) { TeleVip.startHook(launchActivity); isStart = true; } } }); } } ================================================ FILE: app/src/main/java/com/my/televip/TeleVip.java ================================================ package com.my.televip; import static com.my.televip.obfuscate.AutomationResolver.resolverRegistry; import android.content.Context; import com.my.televip.Configs.ConfigManager; import com.my.televip.application.AndroidUtilities; import com.my.televip.application.ApplicationLoaderHook; import com.my.televip.dex.DexInjector; import com.my.televip.language.Translator; import com.my.televip.logging.Logger; import com.my.televip.settings.SettingsManager; import com.my.televip.settings.controller.SettingsController; import com.my.televip.virtuals.TeleVip.Bridge.Bridge; public class TeleVip { public static void startHook(Context context) { try { resolverRegistry.loadParameter(); Translator.init(); AndroidUtilities.init(context); DexInjector.injectDex(Utils.classLoader); SettingsController settingsController = new SettingsController(context); Bridge.init(context, settingsController); ConfigManager.loadAndRead(context); SettingsManager.init(settingsController); ApplicationLoaderHook.init(); } catch (Throwable e){ Logger.e(e); } } } ================================================ FILE: app/src/main/java/com/my/televip/Utils.java ================================================ package com.my.televip; import java.util.ArrayList; public class Utils { public static String pkgName = null; public static String modulePath = null; public static ClassLoader classLoader = null; public static final String issue = "Your Telegram client may be an incompatible version with TeleVip. Please download the latest version that is compatible with TeleVip."; public static ArrayList castList(Object obj, Class clazz) { ArrayList result = new ArrayList<>(); if (obj instanceof ArrayList) { for (Object o : (ArrayList) obj) result.add(clazz.cast(o)); return result; } return result; } } ================================================ FILE: app/src/main/java/com/my/televip/application/AndroidUtilities.java ================================================ package com.my.televip.application; import android.annotation.SuppressLint; import android.content.Context; import android.os.Handler; import com.my.televip.Class.ClassLoad; import com.my.televip.logging.Logger; public class AndroidUtilities { private static float density = 1; public static volatile Handler applicationHandler; public static void runOnUIThread(Runnable runnable) { if (applicationHandler == null) { return; } applicationHandler.post(runnable); } public static void init(Context context) { try { applicationHandler = new Handler(ClassLoad.getApplicationContext().getMainLooper()); density = context.getResources().getDisplayMetrics().density; } catch (Throwable e) { Logger.e(e); } } public static int dp(float value) { if (value == 0) { return 0; } return (int) Math.ceil(density * value); } public static int getStatusBarHeight(Context context) { @SuppressLint({"InternalInsetResource", "DiscouragedApi"}) int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); return resourceId > 0 ? context.getResources().getDimensionPixelSize(resourceId) : 0; } } ================================================ FILE: app/src/main/java/com/my/televip/application/ApplicationLoaderHook.java ================================================ package com.my.televip.application; import android.app.Application; import android.content.Context; import com.my.televip.Class.ClassLoad; import com.my.televip.Class.ClassNames; import com.my.televip.Utils; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import java.io.File; import de.robv.android.xposed.XC_MethodHook; public class ApplicationLoaderHook { private static boolean initialized = false; public static void init() { // our minSdk is 21 so there is no need to wait for MultiDex to initialize if (initialized) return; if (ClassLoad.getClass(ClassNames.APPLICATION_LOADER) == null) { return; } HMethod.hookMethod(ClassLoad.getClass(ClassNames.APPLICATION_LOADER), AutomationResolver.resolve("ApplicationLoader", "onCreate", AutomationResolver.ResolverType.Method), new XC_MethodHook(51) { @Override protected void beforeHookedMethod(MethodHookParam param) { Context app = (Application) param.thisObject; try { app = app.getApplicationContext(); } catch (Throwable ignored) {} if (app == null) { Logger.w("ApplicationLoader is wrong, " + Utils.issue); return; } File dir = new File(app.getFilesDir().getParentFile(), "TeleVip"); if (!dir.exists()) if (!dir.mkdir()) { Logger.w("Cannot create " + dir.getAbsolutePath() + " dir, please create by yourself!"); } } }); initialized = true; } } ================================================ FILE: app/src/main/java/com/my/televip/audio.java ================================================ package com.my.televip; import android.media.AudioAttributes; import android.media.AudioManager; import android.media.MediaPlayer; import java.io.IOException; public class audio { public static boolean playing = false; private static MediaPlayer mediaPlayer; public static void init(){ mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); AudioAttributes audioAttributes = new AudioAttributes.Builder() .setUsage(AudioAttributes.USAGE_MEDIA) .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC) .build(); mediaPlayer.setAudioAttributes(audioAttributes); } public static void start(){ int num = (int) (Math.random() * 3); String audioUrl; if (num == 0) { audioUrl = "https://qurango.net/radio/abdulbasit_abdulsamad_mojawwad"; } else if (num == 1) { audioUrl = "https://qurango.net/radio/yasser_aldosari"; } else { audioUrl = "https://backup.qurango.net/radio/maher"; } try { mediaPlayer.reset(); mediaPlayer.setDataSource(audioUrl); mediaPlayer.prepareAsync(); mediaPlayer.setOnPreparedListener(mp -> { mediaPlayer.start(); playing = true; }); } catch (IllegalArgumentException | IllegalStateException | IOException e) { playing = false; init(); } } public static void stop() { if (mediaPlayer != null && mediaPlayer.isPlaying()) { mediaPlayer.stop(); } if (mediaPlayer != null) { mediaPlayer.release(); init(); } playing = false; } } ================================================ FILE: app/src/main/java/com/my/televip/base/AbstractMethodHook.java ================================================ package com.my.televip.base; import com.my.televip.logging.Logger; import de.robv.android.xposed.XC_MethodHook; public abstract class AbstractMethodHook extends XC_MethodHook { protected void beforeMethod(MethodHookParam param) throws Throwable { } protected void afterMethod(MethodHookParam param) throws Throwable { } @Override protected void beforeHookedMethod(MethodHookParam param) throws Throwable { super.beforeHookedMethod(param); try { beforeMethod(param); } catch (Throwable throwable) { Logger.e(throwable); } } @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { super.afterHookedMethod(param); try { afterMethod(param); } catch (Throwable throwable) { Logger.e(throwable); } } } ================================================ FILE: app/src/main/java/com/my/televip/dex/DexInjector.java ================================================ package com.my.televip.dex; import com.my.televip.logging.Logger; import java.nio.ByteBuffer; import dalvik.system.InMemoryDexClassLoader; public class DexInjector { public static ClassLoader classLoader; public static void injectDex(ClassLoader classLoader) { try { byte[] dexBytes = DexHolder.DEX_BYTES; ByteBuffer buffer = ByteBuffer.wrap(dexBytes); DexInjector.classLoader = new InMemoryDexClassLoader( buffer, classLoader ); } catch (Throwable e){ Logger.e(e); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/DisableChannelSwipeBack.java ================================================ package com.my.televip.features; import android.view.MotionEvent; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; public class DisableChannelSwipeBack { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.CHAT_ACTIVITY) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ChatActivity", "isSwipeBackEnabled", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("isSwipeBackEnabled", new Class[]{MotionEvent.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.disableChannelSwipeBack.isEnable()) { param.setResult(false); } } })); } } } catch (Throwable e){ Logger.e(e); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/DisableNumberRounding.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; public class DisableNumberRounding { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.LOCALE_CONTROLLER) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.LOCALE_CONTROLLER), AutomationResolver.resolve("LocaleController", "formatShortNumber", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("formatShortNumber", new Class[]{int.class, int[].class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.disableNumberRounding.isEnable()) { int[] rounded = (int[]) param.args[1]; int number = (int) param.args[0]; if (rounded != null) { rounded[0] = number; } param.setResult(String.valueOf(number)); } } })); } } } catch (Throwable t) { Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/DisableProfileSwipeBack.java ================================================ package com.my.televip.features; import android.view.MotionEvent; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; public class DisableProfileSwipeBack { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.CHAT_ACTIVITY) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ProfileActivity", "isSwipeBackEnabled", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("isSwipeBackEnabled", new Class[]{MotionEvent.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.disableProfileSwipeBack.isEnable()) { param.setResult(false); } } })); } } } catch (Throwable e){ Logger.e(e); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/DisableStories.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.ClientChecker; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; public class DisableStories { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER), new String[]{AutomationResolver.resolve("MessagesController", "storiesEnabled", AutomationResolver.ResolverType.Method), AutomationResolver.resolve("MessagesController", "storyEntitiesAllowed", AutomationResolver.ResolverType.Method)}, new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.disableStories.isEnable()) param.setResult(false); } }); HMethod.hookMethod(ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER), AutomationResolver.resolve("MessagesController", "storyEntitiesAllowed2", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("storyEntitiesAllowed", new Class[]{ClassLoad.getClass(ClassNames.TLRPC_USER)}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.disableStories.isEnable()) param.setResult(false); } })); } if (ClassLoad.getClass(ClassNames.STORIES_CONTROLLER) != null) { if (ClientChecker.check(ClientChecker.ClientType.NagramX)) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.STORIES_CONTROLLER), AutomationResolver.resolve("StoriesController", "hasStories2", AutomationResolver.ResolverType.Method), long.class, new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.disableStories.isEnable()) param.setResult(false); } }); } else { HMethod.hookMethod(ClassLoad.getClass(ClassNames.STORIES_CONTROLLER), AutomationResolver.resolve("StoriesController", "hasStories", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.disableStories.isEnable()) param.setResult(false); } }); } } } } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/DownloadSpeed.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.messenger.FileLoadOperation; public class DownloadSpeed { public static boolean isEnable = false; public static void init(){ try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.FILE_LOAD_OPERATION) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.FILE_LOAD_OPERATION), AutomationResolver.resolve("FileLoadOperation", "updateParams", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { if (ConfigManager.downloadSpeed.isEnable()) { FileLoadOperation fileLoadOperation = new FileLoadOperation(param.thisObject); int downloadChunkSizeBig = 1024 * 512; int maxDownloadRequests = 8; long defaultMaxFileSize = 1024L * 1024L * 2000L; int maxCdnParts = (int) (defaultMaxFileSize / downloadChunkSizeBig); fileLoadOperation.setDownloadChunkSizeBig(downloadChunkSizeBig); fileLoadOperation.setMaxDownloadRequests(maxDownloadRequests); fileLoadOperation.setMaxDownloadRequestsBig(maxDownloadRequests); fileLoadOperation.setMaxCdnParts(maxCdnParts); param.setResult(null); } } }); } } } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/EnableSavingStories.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; public class EnableSavingStories { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.STORY_ITEM_HOLDER) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.STORY_ITEM_HOLDER), AutomationResolver.resolve("PeerStoriesView$StoryItemHolder", "allowScreenshots", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.enableSavingStories.isEnable()) param.setResult(true); } }); } } } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/FixTLError.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.messenger.NotificationCenter; public class FixTLError { public static boolean isEnable = false; public static void init(){ try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.LAUNCH_ACTIVITY) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.LAUNCH_ACTIVITY), AutomationResolver.resolve("LaunchActivity", "didReceivedNotification", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("didReceivedNotification", new Class[]{int.class, int.class, Object[].class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { int id = (int) param.args[0]; if (id == NotificationCenter.getTlSchemeParseException() && ConfigManager.fixTLError.isEnable()) param.setResult(null); } })); } } } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/GhostMode.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassLoad; import com.my.televip.Class.ClassNames; import com.my.televip.ClientChecker; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedHelpers; public class GhostMode { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.CONNECTIONS_MANAGER) != null && ConfigManager.isGhostMode()) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.CONNECTIONS_MANAGER), AutomationResolver.resolve("ConnectionsManager", "sendRequestInternal", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("sendRequestInternal", new Class[]{ClassLoad.getClass(ClassNames.TL_OBJECT), ClassLoad.getClass(ClassNames.REQUEST_DELEGATE), ClassLoad.getClass(ClassNames.REQUEST_DELEGATE_TIMESTAMP), ClassLoad.getClass(ClassNames.QUICK_ACK_DELEGATE), ClassLoad.getClass(ClassNames.WRITE_TO_SOCKET_DELEGATE), int.class, int.class, int.class, boolean.class, int.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { try { if (HideSeen.isReadMessages) { HideSeen.isReadMessages = false; } else if (ConfigManager.isGhostMode()) { Object object = param.args[0]; if (ClientChecker.check(ClientChecker.ClientType.Nagram)) { HideSeen.saveReadHistory(object); } if (ConfigManager.hideOnline.isEnable()) { if (ClassLoad.getClass(ClassNames.TL_ACCOUNT_UPDATE_STATUS) != null) { if (ClassLoad.getClass(ClassNames.TL_ACCOUNT_UPDATE_STATUS).isInstance(object)) { XposedHelpers.setBooleanField(object, AutomationResolver.resolve("TL_account$updateStatus", "offline", AutomationResolver.ResolverType.Field), true); } } } if (ConfigManager.hideSeen.isEnable() && HideSeen.isReadMessageRequest(object)) { HideSeen.sendFakeReadResponse(param.args[1]); param.setResult(null); return; } if (ConfigManager.hideTyping.isEnable() && HideTyping.isTypingRequest(object)) { param.setResult(null); return; } if (ConfigManager.hideStoryView.isEnable() && HideStoryRead.isReadStoriesRequest(object)) { param.setResult(null); return; } if (ConfigManager.hideProxySponsor.isEnable() && HideProxySponsor.isPromoDataRequest(object)) { param.setResult(null); return; } HideSeen.handleReadAfterSend(object); } } catch (Throwable e) { XposedBridge.log(e); } } })); } } } catch (Throwable t) { Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/HideOnline.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import com.my.televip.virtuals.ActionBar.SimpleTextView; import com.my.televip.virtuals.ui.ProfileActivity; public class HideOnline { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.PROFILE_ACTIVITY) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.PROFILE_ACTIVITY), AutomationResolver.resolve("ProfileActivity", "updateProfileData", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("updateProfileData", new Class[]{boolean.class}), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { if (ConfigManager.hideOnline.isEnable()) { final ProfileActivity profileActivity = new ProfileActivity(param.thisObject); if (profileActivity.getUserId() != 0 && profileActivity.getUserId() == profileActivity.getBaseFragment().getUserConfig().getClientUserId()) { Object[] onlineTextViewArray = profileActivity.getOnlineTextView(); if (onlineTextViewArray != null && onlineTextViewArray.length > 1) { SimpleTextView simpleTextView = new SimpleTextView(onlineTextViewArray[1]); if (simpleTextView.getSimpleTextView() != null) { simpleTextView.setText(Translator.get(Keys.UserOffline)); } } } } } }) ); } } } catch (Throwable t) { Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/HidePhone.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import com.my.televip.virtuals.messenger.UserConfig; import com.my.televip.virtuals.tgnet.TLRPC; public class HidePhone { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.USER_CONFIG) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.USER_CONFIG), AutomationResolver.resolve("UserConfig", "getClientUserId", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.hidePhone.isEnable()) { UserConfig userConfig = new UserConfig(param.thisObject); if (userConfig.getCurrentUser().getUser() != null) { TLRPC.User user = userConfig.getCurrentUser(); if (user.getPhone() != null) { user.setPhone(null); } } } } }); } } } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/HidePinnedMessages.java ================================================ package com.my.televip.features; import android.view.View; import com.my.televip.Class.ClassNames; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import com.my.televip.virtuals.ui.ChatActivity; public class HidePinnedMessages { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.CHAT_ACTIVITY) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ChatActivity", "createPinnedMessageView", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { if (ConfigManager.hidePinnedMessages.isEnable()) { View button = new ChatActivity(param.thisObject).getPinnedMessageView(); if (button != null && button.getVisibility() != View.GONE) button.setVisibility(View.GONE); } } }); HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ChatActivity", "updatePinnedMessageView", AutomationResolver.ResolverType.Method), boolean.class, int.class, new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { if (ConfigManager.hidePinnedMessages.isEnable()) { View button = new ChatActivity(param.thisObject).getPinnedMessageView(); if (button != null && button.getVisibility() != View.GONE) button.setVisibility(View.GONE); } } }); } } } catch (Throwable e){ Logger.e(e); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/HideProxySponsor.java ================================================ package com.my.televip.features; import com.my.televip.virtuals.messenger.MessagesController; public class HideProxySponsor { public static boolean isPromoDataRequest(Object object){ return object.getClass().getName().contains("TL_help_getPromoData"); } public static void removePromoDialog() { if (MessagesController.getGlobalMainSettings() == null) return; MessagesController.getGlobalMainSettings().edit().remove("proxy_dialog").remove("proxyDialogAddress").remove("nextPromoInfoCheckTime").apply(); } } ================================================ FILE: app/src/main/java/com/my/televip/features/HideSeen.java ================================================ package com.my.televip.features; import com.my.televip.Callback.IntCallback; import com.my.televip.Class.ClassNames; import com.my.televip.ClientChecker; import com.my.televip.Configs.ConfigManager; import com.my.televip.application.AndroidUtilities; import com.my.televip.Class.ClassLoad; import com.my.televip.logging.Logger; import com.my.televip.virtuals.SQLite.SQLiteCursor; import com.my.televip.virtuals.messenger.MessagesController; import com.my.televip.virtuals.messenger.MessagesStorage; import com.my.televip.virtuals.messenger.UserConfig; import com.my.televip.virtuals.messenger.Utilities; import com.my.televip.virtuals.tgnet.ConnectionsManager; import com.my.televip.virtuals.tgnet.RequestDelegate; import com.my.televip.virtuals.tgnet.TLRPC; import de.robv.android.xposed.XposedHelpers; public class HideSeen { public static Object TLChannels_readHistory; public static Object TLMessages_readHistory; public static void sendFakeReadResponse(Object onCompleteOrig) { try { TLRPC.TL_messages_affectedMessages fakeRes = new TLRPC.TL_messages_affectedMessages(); fakeRes.setPts(-1); fakeRes.setPtsCount(0); RequestDelegate onComplete = new RequestDelegate(onCompleteOrig); Utilities.getStageQueue().postRunnable(() -> { try { if (onComplete.requestDelegate != null) { onComplete.run(fakeRes.getTL_messages_affectedMessages(), null); } } catch (Throwable e) { Logger.e(e); } }); } catch (Throwable e) { Logger.e(e); } } public static boolean isTLMessagesReadHistoryRequest(Object object) { return object.getClass().getName().contains("TL_messages_readHistory"); } public static boolean isTLChannelsReadHistoryRequest(Object object) { return object.getClass().getName().contains("TL_channels_readHistory"); } public static boolean isReadMessageRequest(Object object) { return object.getClass().getName().contains("TL_messages_readHistory") || object.getClass().getName().contains("TL_messages_readEncryptedHistory") || object.getClass().getName().contains("TL_messages_readDiscussion") || object.getClass().getName().contains("TL_messages_readMessageContents") || object.getClass().getName().contains("TL_channels_readMessageContents") || object.getClass().getName().contains("TL_channels_readHistory"); } public static void saveReadHistory(Object object) { if (HideSeen.TLChannels_readHistory == null && HideSeen.isTLChannelsReadHistoryRequest(object)) { HideSeen.TLChannels_readHistory = object; } else if (HideSeen.TLMessages_readHistory == null && HideSeen.isTLMessagesReadHistoryRequest(object)) { HideSeen.TLMessages_readHistory = object; } } public static void handleReadAfterSend(Object object) { try { if (ConfigManager.hideSeen.isEnable() && ConfigManager.markReadAfterSend.isEnable()) { TLRPC.InputPeer peer = extractPeerFromSendObject(object); if (peer != null && peer.inputPeer != null) { Long dialogId = getDialogId(peer); MessagesStorage messagesStorage = getMessagesStorage(); messagesStorage.getStorageQueue().postRunnable(() -> getDialogMaxMessageId(messagesStorage, dialogId, (param -> markReadOnServer(param, peer)))); } } } catch (Throwable e) { Logger.e(e); } } public static void getDialogMaxMessageId(MessagesStorage messagesStorage, long dialog_id, IntCallback callback) { messagesStorage.getStorageQueue().postRunnable(() -> { SQLiteCursor cursor = null; int[] max = new int[1]; try { cursor = messagesStorage.getDatabase().queryFinalized("SELECT MAX(mid) FROM messages_v2 WHERE uid = " + dialog_id); if (cursor.next()) { max[0] = cursor.intValue(0); } } catch (Throwable e) { Logger.e(e); } finally { if (cursor != null) { cursor.dispose(); } } AndroidUtilities.runOnUIThread(() -> callback.run(max[0])); }); } public static boolean isReadMessages = false; public static void markReadOnServer(int messageId, TLRPC.InputPeer peer) { try { Object req; if (peer.inputPeer.getClass().getName().contains("TL_inputPeerChannel")) { TLRPC.TL_channels_readHistory request; if (!ClientChecker.check(ClientChecker.ClientType.Nagram)) { request = new TLRPC.TL_channels_readHistory(); request.setChannel(MessagesController.getInputChannel(peer)); } else { request = new TLRPC.TL_channels_readHistory(TLChannels_readHistory); request.setChannel(MessagesController.getInputChannel(getDialogId(peer))); } request.setMax_id(messageId); req = request.getTL_channels_readHistory(); } else { TLRPC.TL_messages_readHistory request; if (!ClientChecker.check(ClientChecker.ClientType.Nagram)) { request = new TLRPC.TL_messages_readHistory(); } else { request = new TLRPC.TL_messages_readHistory(TLMessages_readHistory); } request.setPeer(peer); request.setMax_id(messageId); req = request.getTL_messages_readHistory(); } isReadMessages = true; getConnectionsManager().sendRequest(req, RequestDelegate.run((response, error) -> { if (error == null) { if (ClassLoad.getClass(ClassNames.TL_MESSAGES_AFFECTED).isInstance(response)) { TLRPC.TL_messages_affectedMessages res = new TLRPC.TL_messages_affectedMessages(response); if (!ClientChecker.check(ClientChecker.ClientType.Nagram)) { getMessagesController().processNewDifferenceParams(-1, res.getPts(), -1, res.getPtsCount()); } else { getMessagesController().processNewDifferenceParams(res.getPts(), -1, res.getPtsCount()); } } } })); } catch (Throwable e) { Logger.e(e); } } private static TLRPC.InputPeer extractPeerFromSendObject(Object object) { if (object.getClass().getName().contains("TL_messages_sendMessage") || object.getClass().getName().contains("TL_messages_sendMedia") || object.getClass().getName().contains("TL_messages_sendReaction") || object.getClass().getName().contains("TL_messages_sendPaidReaction") || object.getClass().getName().contains("TL_messages_sendMultiMedia")) { return new TLRPC.InputPeer(getPeer(object)); } return null; } private static Object getPeer(Object msg) { return XposedHelpers.getObjectField(msg, "peer"); } public static Long getDialogId(TLRPC.InputPeer peer) { long dialogId; if (peer.getChat_id() != 0) { dialogId = -peer.getChat_id(); } else if (peer.getChannel_id() != 0) { dialogId = -peer.getChannel_id(); } else { dialogId = peer.getUser_id(); } return dialogId; } public static MessagesStorage getMessagesStorage() { return MessagesStorage.getInstance(UserConfig.getSelectedAccount()); } public static ConnectionsManager getConnectionsManager() { return ConnectionsManager.getInstance(UserConfig.getSelectedAccount()); } public static MessagesController getMessagesController() { return MessagesController.getInstance(UserConfig.getSelectedAccount()); } } ================================================ FILE: app/src/main/java/com/my/televip/features/HideStoryRead.java ================================================ package com.my.televip.features; public class HideStoryRead { public static boolean isReadStoriesRequest(Object object){ return object.getClass().getName().contains("TL_stories_readStories") || object.getClass().getName().contains("TL_stories_incrementStoryViews"); } } ================================================ FILE: app/src/main/java/com/my/televip/features/HideTyping.java ================================================ package com.my.televip.features; public class HideTyping { public static boolean isTypingRequest(Object object){ return object.getClass().getName().contains("TL_messages_setTyping") || object.getClass().getName().contains("TL_messages_setEncryptedTyping"); } } ================================================ FILE: app/src/main/java/com/my/televip/features/HideUpdateApp.java ================================================ package com.my.televip.features; import android.app.Activity; import android.content.SharedPreferences; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XC_MethodReplacement; public class HideUpdateApp { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; SharedPreferences preferences = ClassLoad.getApplicationContext().getSharedPreferences("mainconfig", Activity.MODE_PRIVATE); preferences.edit().remove("appUpdate").apply(); preferences.edit().remove("appUpdateCheckTime").apply(); preferences.edit().remove("appUpdateBuild").apply(); if (ClassLoad.getClass(ClassNames.SHARED_CONFIG) != null) { HMethod.hookMethod( ClassLoad.getClass(ClassNames.SHARED_CONFIG), AutomationResolver.resolve("SharedConfig", "setNewAppVersionAvailable", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("setNewAppVersionAvailable", new Class[]{ClassLoad.getClass(ClassNames.TL_HELP_APP_UPDATE)}), new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) { return false; } })); HMethod.hookMethod( ClassLoad.getClass(ClassNames.SHARED_CONFIG), AutomationResolver.resolve("SharedConfig", "isAppUpdateAvailable", AutomationResolver.ResolverType.Method), new XC_MethodReplacement() { @Override protected Object replaceHookedMethod(MethodHookParam param) { return false; } }); } } } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/PreventMedia.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import com.my.televip.virtuals.ui.SecretMediaViewer; import de.robv.android.xposed.XposedHelpers; public class PreventMedia { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.CHAT_ACTIVITY) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ChatActivity", "sendSecretMessageRead", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("sendSecretMessageRead", new Class[]{ClassLoad.getClass(ClassNames.MESSAGE_OBJECT), boolean.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.preventMedia.isEnable()) param.setResult(null); } })); HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ChatActivity", "sendSecretMediaDelete", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("sendSecretMediaDelete", new Class[]{ClassLoad.getClass(ClassNames.MESSAGE_OBJECT)}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.preventMedia.isEnable()) param.setResult(null); } })); } if (ClassLoad.getClass(ClassNames.SECRET_MEDIA_VIEWER) != null) { SecretMediaViewer.openMedia(); HMethod.hookMethod(ClassLoad.getClass(ClassNames.SECRET_MEDIA_VIEWER), AutomationResolver.resolve("SecretMediaViewer", "closePhoto", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("closePhoto", new Class[]{boolean.class, boolean.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.preventMedia.isEnable()) { Object thisObject = param.thisObject; XposedHelpers.setObjectField(thisObject, AutomationResolver.resolve("SecretMediaViewer", "onClose", AutomationResolver.ResolverType.Field), null); } } })); } } } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/RemovesContentSaving.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; public class RemovesContentSaving { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER), AutomationResolver.resolve("MessagesController", "isChatNoForwards", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("isChatNoForwards", new Class[]{ClassLoad.getClass(ClassNames.TLRPC_CHAT)}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.removesContentSaving.isEnable()) param.setResult(false); } })); } if (ClassLoad.getClass(ClassNames.CHAT_ACTIVITY) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ChatActivity", "hasSelectedNoforwardsMessage", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.removesContentSaving.isEnable()) param.setResult(false); } }); } if (ClassLoad.getClass(ClassNames.MESSAGE_OBJECT) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.MESSAGE_OBJECT), AutomationResolver.resolve("MessageObject", "canForwardMessage", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.removesContentSaving.isEnable()) param.setResult(true); } }); } } } catch (Throwable t) { Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/SaveEditsHistory.java ================================================ package com.my.televip.features; import android.content.Context; import android.text.method.ScrollingMovementMethod; import android.widget.ScrollView; import android.widget.TextView; import com.my.televip.Class.ClassNames; import com.my.televip.ClientChecker; import com.my.televip.Configs.ConfigManager; import com.my.televip.Database.MessageDatabase; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import com.my.televip.virtuals.ActionBar.AlertDialog; import com.my.televip.virtuals.SettingsIconResolver; import com.my.televip.virtuals.SQLite.SQLiteCursor; import com.my.televip.virtuals.SQLite.SQLiteDatabase; import com.my.televip.virtuals.Theme; import com.my.televip.virtuals.messenger.BaseController; import com.my.televip.virtuals.messenger.MessageObject; import com.my.televip.virtuals.messenger.MessagesStorage; import com.my.televip.virtuals.messenger.UserConfig; import com.my.televip.virtuals.tgnet.NativeByteBuffer; import com.my.televip.virtuals.tgnet.TLRPC; import com.my.televip.virtuals.ui.ChatActivity; import java.util.ArrayList; import java.util.Locale; public class SaveEditsHistory { private static MessageDatabase messageDatabase; public static boolean isEnable = false; public static void init(Context context) { try { if (!isEnable) { isEnable = true; messageDatabase = new MessageDatabase(context); if (ClassLoad.getClass(ClassNames.CHAT_ACTIVITY) != null) { HMethod.hookMethod( ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ChatActivity", "fillMessageMenu", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("fillMessageMenu", new Class[]{ClassLoad.getClass(ClassNames.MESSAGE_OBJECT), ArrayList.class, ArrayList.class, ArrayList.class}), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { if (ConfigManager.saveEditsHistory.isEnable()) { ChatActivity chatActivity = new ChatActivity(param.thisObject); if (chatActivity.getSelectedObject() != null) { MessageObject messageObject = chatActivity.getSelectedObject(); if (messageObject.getMessageOwner() != null) { TLRPC.Message message = messageObject.getMessageOwner(); if (message != null && message.getFrom_id() != null && message.getID() > 0) { long user_id = message.getFrom_id().getUser_id(); long chat_id = message.getFrom_id().getChat_id(); long channel_id = message.getFrom_id().getChannel_id(); long dialogId = 0; if (user_id != 0) { dialogId = user_id; } else if (chat_id != 0) { dialogId = chat_id; } else if (channel_id != 0) { dialogId = channel_id; } if (dialogId != 0 && messageDatabase.getMessage(dialogId, message.getID()) != null) { ArrayList icons; ArrayList items; ArrayList options; if (ClientChecker.check(ClientChecker.ClientType.Telegraph)) { icons = (ArrayList) param.args[2]; items = (ArrayList) param.args[3]; options = (ArrayList) param.args[4]; } else { icons = (ArrayList) param.args[1]; items = (ArrayList) param.args[2]; options = (ArrayList) param.args[3]; } items.add(Translator.get(Keys.EditsHistory)); options.add(8353847); if (!ClientChecker.check(ClientChecker.ClientType.Nagram)) icons.add(SettingsIconResolver.getIconSettings()); } } } } } } })); HMethod.hookMethod( ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ChatActivity", "processSelectedOption", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("processSelectedOption", new Class[]{int.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.saveEditsHistory.isEnable()) { int option = (int) param.args[0]; ChatActivity chatActivity = new ChatActivity(param.thisObject); if (option == 8353847) { if (chatActivity.getSelectedObject() != null) { MessageObject messageObject = chatActivity.getSelectedObject(); if (messageObject.getMessageOwner() != null) { TLRPC.Message message = messageObject.getMessageOwner(); if (message.message != null && message.getFrom_id() != null && message.getID() > 0 && message.getMessage() != null) { if (getDialogId(message.getFrom_id()) != 0 & messageDatabase.searchMessage(getDialogId(message.getFrom_id()), message.getID())) { AlertDialog alertDialog = new AlertDialog(context); alertDialog.setTitle(Translator.get(Keys.EditsHistory)); TextView textView = new TextView(context); int maxMsgCount = messageDatabase.getMaxMessageCount(getDialogId(message.getFrom_id()), message.getID()); StringBuilder builder = new StringBuilder(); if (maxMsgCount > 0) { for (int i = 1; i <= maxMsgCount; i++) { String msg = messageDatabase.getMessage(getDialogId(message.getFrom_id()), message.getID(), i); String messageEdited = messageDatabase.getMessageEdited(getDialogId(message.getFrom_id()), message.getID(), i); if (msg != null && messageEdited != null) { builder.append(Translator.get(Keys.Message)).append(i).append(Translator.get(Keys.Edited)).append(messageEdited).append("\n"); builder.append(msg).append("\n"); } } } else { builder.append(messageDatabase.getMessage(getDialogId(message.getFrom_id()), message.getID())); } textView.setText(builder.toString()); textView.setPadding(32, 32, 32, 32); textView.setTextSize(16); textView.setTextColor(Theme.getTextColor()); textView.setMovementMethod(new ScrollingMovementMethod()); textView.setTextIsSelectable(true); ScrollView scrollView = new ScrollView(context); scrollView.addView(textView); alertDialog.setView(scrollView); alertDialog.setPositiveButton(Translator.get(Keys.Done), null); alertDialog.show(); } } } } } } } })); } if (ClassLoad.getClass(ClassNames.MESSAGES_STORAGE) != null) { HMethod.hookMethod( ClassLoad.getClass(ClassNames.MESSAGES_STORAGE), AutomationResolver.resolve("MessagesStorage", "putMessages", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("putMessages", new Class[]{ClassLoad.getClass(ClassNames.TL_MESSAGES_MESSAGES), long.class, int.class, int.class, boolean.class, int.class, long.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.saveEditsHistory.isEnable()) { int load_type = (int) param.args[2]; if (ClientChecker.check(ClientChecker.ClientType.Nagram)) { load_type = (int) param.args[0]; } if (load_type == -2) { Object messagesStorageObject = param.thisObject; Object messagesObject = param.args[0]; if (ClientChecker.check(ClientChecker.ClientType.Nagram)) { messagesObject = param.args[5]; } if (messagesObject != null) { MessagesStorage messagesStorage = new MessagesStorage(messagesStorageObject); TLRPC.messages_Messages messages = new TLRPC.messages_Messages(messagesObject); int count = messages.getMessages().size(); BaseController baseController = new BaseController(messagesStorageObject); UserConfig userConfig = baseController.getUserConfig(); SQLiteDatabase sqLiteDatabase = messagesStorage.getDatabase(); for (int a = 0; a < count; a++) { TLRPC.Message message = new TLRPC.Message(messages.getMessages().get(a)); int id = message.getID(); SQLiteCursor cursor = sqLiteDatabase.queryFinalized(String.format(Locale.US, "SELECT mid, data, ttl, mention, read_state, send_state, custom_params FROM messages_v2 WHERE mid = %d AND uid = %d", id, MessageObject.getDialogId(message))); if (cursor.next()) { NativeByteBuffer data = cursor.byteBufferValue(1); if (data.nativeByteBuffer != null) { TLRPC.Message oldMessage = TLRPC.Message.TLdeserialize(data, data.readInt32(false), false); oldMessage.readAttachPath(data, userConfig.getClientUserId()); data.reuse(); if (oldMessage.getMessage() != null && message.getMessage() != null) { if (oldMessage.getFrom_id() != null && (!oldMessage.getMessage().equals(message.getMessage()))) { if (getDialogId(message.getFrom_id()) != 0) { messageDatabase.addMessage(getDialogId(message.getFrom_id()), oldMessage.getID(), oldMessage.getMessage()); } } } } } } } } } } })); } } } catch (Throwable t) { Logger.e(t); } } private static long getDialogId(TLRPC.Peer peer) { long user_id = peer.getUser_id(); long chat_id = peer.getChat_id(); long channel_id = peer.getChannel_id(); long dialogId = 0; if (user_id != 0) { dialogId = user_id; } else if (chat_id != 0) { dialogId = chat_id; } else if (channel_id != 0) { dialogId = channel_id; } return dialogId; } } ================================================ FILE: app/src/main/java/com/my/televip/features/SecretMediaSave.java ================================================ package com.my.televip.features; import android.app.Activity; import android.content.Context; import android.content.ContextWrapper; import android.view.View; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.messenger.MessageObject; import com.my.televip.virtuals.tgnet.TLRPC; import com.my.televip.virtuals.ui.Cells.ChatMessageCell; import com.my.televip.virtuals.ui.PhotoViewer; import com.my.televip.virtuals.ui.SecretMediaViewer; import java.io.File; public class SecretMediaSave { public static boolean isEnable = false; public static long id; public static File pathImage; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.MESSAGE_OBJECT) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.MESSAGE_OBJECT), AutomationResolver.resolve("MessageObject", "isSecret", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.secretMediaSave.isEnable()) param.setResult(false); } }); } if (ClassLoad.getClass(ClassNames.CHAT_MESSAGE_CELL_DELEGATE) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_MESSAGE_CELL_DELEGATE), AutomationResolver.resolve("ChatActivity$ChatMessageCellDelegate", "didPressImage", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("didPressImage", new Class[]{ClassLoad.getClass(ClassNames.CHAT_MESSAGE_CELL), float.class, float.class, boolean.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { try { if (ConfigManager.secretMediaSave.isEnable() && param.args[0] != null) { ChatMessageCell messageCell = new ChatMessageCell(param.args[0]); if (messageCell.getChatMessageCell() != null) { MessageObject messageObject = messageCell.getMessageObject(); if (messageObject.getMessageObject() != null) { TLRPC.Message message = messageObject.getMessageOwner(); if (message.getTtl() > 0) message.setTtl(0); } bindPhotoViewerToActivity(messageCell); } } } catch (Throwable e) { Logger.e(e); } } })); } if (ClassLoad.getClass(ClassNames.FILE_LOADER) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.FILE_LOADER), AutomationResolver.resolve("FileLoader", "getPathToMessage", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("getPathToMessage", new Class[]{ClassLoad.getClass(ClassNames.TL_MESSAGE)}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { try { if (ConfigManager.secretMediaSave.isEnable() && param.args[0] != null && pathImage != null) { TLRPC.Message message = new TLRPC.Message(param.args[0]); if (message.getID() == id) { param.setResult(pathImage); } } } catch (Throwable e) { Logger.e(e); } } })); } if (ConfigManager.secretMediaSave.isEnable()) SecretMediaViewer.openMedia(); } } catch (Throwable e){ Logger.e(e); } } private static void bindPhotoViewerToActivity(ChatMessageCell cell) { try { if (!(cell.getChatMessageCell() instanceof View)) return; View view = (View) cell.getChatMessageCell(); Context context = view.getContext(); Activity activity = extractActivityFromContext(context); if (activity == null) return; PhotoViewer.getInstance().setParentActivity(activity); } catch (Throwable ignored) {} } private static Activity extractActivityFromContext(Context context) { while (context instanceof ContextWrapper) { if (context instanceof Activity) return (Activity) context; context = ((ContextWrapper) context).getBaseContext(); } return null; } } ================================================ FILE: app/src/main/java/com/my/televip/features/ShowDeletedMessages.java ================================================ package com.my.televip.features; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; import android.os.Process; import android.text.TextUtils; import android.util.SparseArray; import com.my.televip.Class.ClassNames; import com.my.televip.Configs.ConfigManager; import com.my.televip.Utils; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.structs.DeletedMessageInfo; import com.my.televip.logging.Logger; import com.my.televip.virtuals.messenger.MessageObject; import com.my.televip.virtuals.messenger.NotificationCenter; import com.my.televip.virtuals.messenger.UserConfig; import com.my.televip.virtuals.tgnet.TLRPC; import com.my.televip.virtuals.ui.Cells.ChatMessageCell; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; import java.util.Objects; import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArraySet; import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedHelpers; public class ShowDeletedMessages { private static final Handler storage = new Handler(makeLooper("Storage")); private static final CopyOnWriteArraySet deletedMessageInfos = new CopyOnWriteArraySet<>(); private static final CopyOnWriteArraySet shouldDeletedMessageInfo = new CopyOnWriteArraySet<>(); private static final CopyOnWriteArraySet shouldDeletedMessageInfo2 = new CopyOnWriteArraySet<>(); public static final int FLAG_DELETED = 1 << 31; private static boolean isDeleteMessage = false; public static final boolean DEBUG_MODE = false; public static boolean isEnable = false; public static Looper makeLooper(String str) { HandlerThread handlerThread = new HandlerThread("TeleVip - " + str, Process.THREAD_PRIORITY_DISPLAY); handlerThread.start(); return handlerThread.getLooper(); } public static void markMessagesDeleted(Object thisMessagesStorage, final long dialogId, ArrayList delMsg) { try { deletedMessageInfos.add(new DeletedMessageInfo(UserConfig.getSelectedAccount(), dialogId, delMsg)); storage.post(() -> { Object db = XposedHelpers.callMethod(thisMessagesStorage, AutomationResolver.resolve("MessagesStorage", "getDatabase", AutomationResolver.ResolverType.Method)); String query = "SELECT data,mid,uid " + "FROM messages_v2 " + "WHERE " + (dialogId == 0 ? "is_channel" : "uid") + " = " + dialogId + " AND mid IN (" + TextUtils.join(",", delMsg) + ");"; String update = "UPDATE messages_v2 SET data = ? WHERE uid = ? AND mid = ?"; Object cursor = XposedHelpers.callMethod(db, AutomationResolver.resolve("SQLiteDatabase", "queryFinalized", AutomationResolver.ResolverType.Method), new Class[]{String.class, Object[].class}, query, new Object[]{}); Object state = XposedHelpers.callMethod(db, AutomationResolver.resolve("SQLiteDatabase", "executeFast", AutomationResolver.ResolverType.Method), new Class[]{String.class}, update); while ((boolean) XposedHelpers.callMethod(cursor, AutomationResolver.resolve("SQLiteCursor", "next", AutomationResolver.ResolverType.Method))) { Object data = XposedHelpers.callMethod(cursor, AutomationResolver.resolve("SQLiteCursor", "byteBufferValue", AutomationResolver.ResolverType.Method), new Class[]{int.class}, 0); int mid = (int) XposedHelpers.callMethod(cursor, AutomationResolver.resolve("SQLiteCursor", "intValue", AutomationResolver.ResolverType.Method), new Class[]{int.class}, 1); long lastDialogId = (long) XposedHelpers.callMethod(cursor, AutomationResolver.resolve("SQLiteCursor", "longValue", AutomationResolver.ResolverType.Method), new Class[]{int.class}, 2); XposedHelpers.callMethod(data, "position", new Class[]{int.class}, 4); int flags = (int) XposedHelpers.callMethod(data, "readInt32", new Class[]{boolean.class}, true); flags |= FLAG_DELETED; XposedHelpers.callMethod(data, "position", new Class[]{int.class}, 4); XposedHelpers.callMethod(data, "writeInt32", new Class[]{int.class}, flags); XposedHelpers.callMethod(data, "position", new Class[]{int.class}, 0); XposedHelpers.callMethod(state, AutomationResolver.resolve("SQLitePreparedStatement", "requery", AutomationResolver.ResolverType.Method)); XposedHelpers.callMethod(state, AutomationResolver.resolve("SQLitePreparedStatement", "bindByteBuffer", AutomationResolver.ResolverType.Method), new Class[]{int.class, data.getClass()}, 1, data); XposedHelpers.callMethod(state, AutomationResolver.resolve("SQLitePreparedStatement", "bindLong", AutomationResolver.ResolverType.Method), new Class[]{int.class, long.class}, 2, lastDialogId); XposedHelpers.callMethod(state, AutomationResolver.resolve("SQLitePreparedStatement", "bindInteger", AutomationResolver.ResolverType.Method), new Class[]{int.class, int.class}, 3, mid); XposedHelpers.callMethod(state, AutomationResolver.resolve("SQLitePreparedStatement", "step", AutomationResolver.ResolverType.Method)); XposedHelpers.callMethod(data, "reuse"); } XposedHelpers.callMethod(cursor, AutomationResolver.resolve("SQLiteCursor", "dispose", AutomationResolver.ResolverType.Method)); XposedHelpers.callMethod(state, AutomationResolver.resolve("SQLitePreparedStatement", "dispose", AutomationResolver.ResolverType.Method)); }); } catch (Throwable e){ Logger.e(e); } } public static void markMessagesDeletedForController(Object thisMessagesController, long dialogId, ArrayList delMsg) { markMessagesDeleted(XposedHelpers.callMethod(thisMessagesController, "getMessagesStorage"), dialogId, delMsg); } private static DeletedMessageInfo isShouldDeletedMessage(long channelID, int messageId) { for (DeletedMessageInfo deletedMessagesId : shouldDeletedMessageInfo) if (deletedMessagesId.getSelectedAccount() == UserConfig.getSelectedAccount() && deletedMessagesId.getChannelID() == channelID && deletedMessagesId.getMessageIds().contains(messageId)) return deletedMessagesId; return null; } private static DeletedMessageInfo isDeletedMessage(long channelID, int messageId) { for (DeletedMessageInfo deletedMessagesId : deletedMessageInfos) if (deletedMessagesId.getSelectedAccount() == UserConfig.getSelectedAccount() && deletedMessagesId.getChannelID() == channelID && deletedMessagesId.getMessageIds().contains(messageId)) return deletedMessagesId; return null; } private static DeletedMessageInfo isShouldDeletedMessage2(long channelID, int messageId) { for (DeletedMessageInfo deletedMessagesId : shouldDeletedMessageInfo2) if (deletedMessagesId.getSelectedAccount() == UserConfig.getSelectedAccount() && deletedMessagesId.getChannelID() == channelID && deletedMessagesId.getMessageIds().contains(messageId)) return deletedMessagesId; return null; } private static void addShouldDeletedMessage(long channelID, Integer messageId) { try { boolean needInit = true; DeletedMessageInfo info = null; for (DeletedMessageInfo deletedMessagesId : shouldDeletedMessageInfo) { if (deletedMessagesId.getSelectedAccount() == UserConfig.getSelectedAccount() && deletedMessagesId.getChannelID() == channelID) { info = deletedMessagesId; needInit = false; break; } } if (needInit) shouldDeletedMessageInfo.add(new DeletedMessageInfo(UserConfig.getSelectedAccount(), channelID, messageId)); else { if (!info.getMessageIds().contains(messageId)) // No duplication info.insertMessageId(messageId); } } catch (Throwable e){ Logger.e(e); } } private static void addShouldDeletedMessage2(long channelID, Integer messageId) { try { boolean needInit = true; DeletedMessageInfo info = null; for (DeletedMessageInfo deletedMessagesId : shouldDeletedMessageInfo2) { if (deletedMessagesId.getSelectedAccount() == UserConfig.getSelectedAccount() && deletedMessagesId.getChannelID() == channelID) { info = deletedMessagesId; needInit = false; break; } } if (needInit) shouldDeletedMessageInfo2.add(new DeletedMessageInfo(UserConfig.getSelectedAccount(), channelID, messageId)); else { if (!info.getMessageIds().contains(messageId)) // No duplication info.insertMessageId(messageId); } } catch (Throwable e){ Logger.e(e); } } public static void init() { try { if (ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER) != null) { Method[] messagesControllerMethods = ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER).getDeclaredMethods(); List methodNames = new ArrayList<>(); for (Method method : messagesControllerMethods) if (method.getParameterCount() == 5 && method.getParameterTypes()[0] == ArrayList.class && method.getParameterTypes()[1] == ArrayList.class && method.getParameterTypes()[2] == ArrayList.class && method.getParameterTypes()[3] == boolean.class && method.getParameterTypes()[4] == int.class) methodNames.add(method.getName()); if (methodNames.size() != 1) Logger.w("Failed to hook processUpdateArray! Reason: " + (methodNames.isEmpty() ? "No method found" : "Multiple methods found") + ", " + Utils.issue); else { String methodName = methodNames.get(0); HMethod.hookMethod(ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER), methodName, ArrayList.class, ArrayList.class, ArrayList.class, boolean.class, int.class, new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { try { CopyOnWriteArrayList updates = new CopyOnWriteArrayList<>(Utils.castList(param.args[0], Object.class)); if (!updates.isEmpty()) { ArrayList newUpdates = new ArrayList<>(); for (Object item : updates) { if (!item.getClass().equals(ClassLoad.getClass(ClassNames.TL_UPDATE_DELETE_CHANNEL_MESSAGES)) && !item.getClass().equals(ClassLoad.getClass(ClassNames.TL_UPDATE_DELETE_MESSAGES))) newUpdates.add(item); if (item.getClass().equals(ClassLoad.getClass(ClassNames.TL_UPDATE_DELETE_CHANNEL_MESSAGES))) { TLRPC.TL_updateDeleteChannelMessages channelMessages = new TLRPC.TL_updateDeleteChannelMessages(item); Object dialogMessage = XposedHelpers.getObjectField(param.thisObject, AutomationResolver.resolve("MessagesController", "dialogMessage", AutomationResolver.ResolverType.Field)); ArrayList dialogMessages = (ArrayList) XposedHelpers.callMethod(dialogMessage, AutomationResolver.resolve("LongSparseArray", "get", AutomationResolver.ResolverType.Method), new Class[]{int.class}, -channelMessages.getChannelID()); if (dialogMessages != null) { for (final Object msgObj : dialogMessages) { TLRPC.Message owner = new MessageObject(msgObj).getMessageOwner(); if (channelMessages.getMessages().contains(owner.getID())) { owner.setFlags(owner.getFlags() | FLAG_DELETED); } } } markMessagesDeletedForController(param.thisObject, -channelMessages.getChannelID(), channelMessages.getMessages()); } if (item.getClass().equals(ClassLoad.getClass(ClassNames.TL_UPDATE_DELETE_MESSAGES))) { ArrayList messages = new TLRPC.TL_updateDeleteMessages(item).getMessages(); SparseArray dialogMessages = (SparseArray) XposedHelpers.getObjectField(param.thisObject, AutomationResolver.resolve("MessagesController", "dialogMessagesByIds", AutomationResolver.ResolverType.Field)); for (int id : messages) { Object msgObj = dialogMessages.get(id); if (msgObj == null) { break; } else { TLRPC.Message owner = new MessageObject(msgObj).getMessageOwner(); owner.setFlags(owner.getFlags() | FLAG_DELETED); } } markMessagesDeletedForController(param.thisObject, DeletedMessageInfo.NOT_CHANNEL, messages); } if (DEBUG_MODE && (item.getClass().equals(ClassLoad.getClass(ClassNames.TL_UPDATE_DELETE_MESSAGES)) || item.getClass().equals(ClassLoad.getClass(ClassNames.TL_UPDATE_DELETE_CHANNEL_MESSAGES)))) Logger.w("Protected message! event: " + item.getClass()); } param.args[0] = newUpdates; } } catch (Throwable throwable) { Logger.e(throwable); } } }); } } } catch (Throwable e){ Logger.e(e); } } public static void initProcessing() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.MESSAGES_STORAGE) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.MESSAGES_STORAGE), AutomationResolver.resolve("MessagesStorage", "markMessagesAsDeletedInternal", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("markMessagesAsDeletedInternal", new Class[]{long.class, ArrayList.class, boolean.class, int.class, int.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { long dialogId = (long) param.args[0]; if (ChatMessageCell.currentMessageObject != null && (System.currentTimeMillis() - ChatMessageCell.lastVisibleTime) < 4000) { long objectId = ChatMessageCell.currentMessageObject.getDialogId(); if (objectId == dialogId) return; } ArrayList deletedMessages = new ArrayList<>(); ArrayList original = Utils.castList(param.args[1], Integer.class); if (original.isEmpty()) return; long channel_id = (long) param.args[0]; if (channel_id > 0) channel_id = 0; for (Integer msgId : original) { DeletedMessageInfo shouldDeletedMessage = isShouldDeletedMessage(channel_id, msgId); DeletedMessageInfo shouldDeletedMessage2 = isShouldDeletedMessage2(channel_id, msgId); if (shouldDeletedMessage2 != null || isDeletedMessage(channel_id, msgId) == null) { deletedMessages.add(msgId); if (shouldDeletedMessage != null) shouldDeletedMessageInfo.remove(shouldDeletedMessage); if (shouldDeletedMessage2 != null) shouldDeletedMessageInfo2.remove(shouldDeletedMessage2); } } ArrayList fork = new ArrayList<>(original); fork.removeAll(deletedMessages); if (!fork.isEmpty()) markMessagesDeleted(param.thisObject, channel_id, fork); if (deletedMessages.isEmpty()) param.setResult(null); else { ((ArrayList) param.args[1]).clear(); ((ArrayList) param.args[1]).addAll(deletedMessages); } } })); HMethod.hookMethod(ClassLoad.getClass(ClassNames.MESSAGES_STORAGE), AutomationResolver.resolve("MessagesStorage", "updateDialogsWithDeletedMessagesInternal", AutomationResolver.ResolverType.Method), long.class, long.class, ArrayList.class, ArrayList.class, new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.showDeletedMessages.isEnable()) { long dialogId = (long) param.args[0]; if (ChatMessageCell.currentMessageObject != null && (System.currentTimeMillis() - ChatMessageCell.lastVisibleTime) < 4000) { long objectId = ChatMessageCell.currentMessageObject.getDialogId(); if (objectId == dialogId) return; } long channelID = -((long) param.args[1]); if (channelID > 0) channelID = 0; ArrayList deletedMessages = new ArrayList<>(); Object msgIds = param.args[2]; if (msgIds == null) return; ArrayList original = Utils.castList(msgIds, Integer.class); if (original.isEmpty()) return; for (Integer msgId : original) if (isShouldDeletedMessage(channelID, msgId) == null) if (isDeletedMessage(channelID, msgId) != null) addShouldDeletedMessage(channelID, msgId); else deletedMessages.remove(msgId); else if (isShouldDeletedMessage2(channelID, msgId) == null) if (isDeletedMessage(channelID, msgId) != null) addShouldDeletedMessage2(channelID, msgId); else deletedMessages.remove(msgId); else deletedMessages.add(msgId); ArrayList fork = new ArrayList<>(original); fork.removeAll(deletedMessages); if (!fork.isEmpty()) markMessagesDeleted(param.thisObject, channelID, fork); if (deletedMessages.isEmpty()) param.setResult(null); else { ((ArrayList) param.args[2]).clear(); ((ArrayList) param.args[2]).addAll(deletedMessages); } } } }); Method updateDialogsWithDeletedMessagesMethod = null; for (Method method : ClassLoad.getClass(ClassNames.MESSAGES_STORAGE).getDeclaredMethods()) { if (method.getName().equals(AutomationResolver.resolve("MessagesStorage", "updateDialogsWithDeletedMessages", AutomationResolver.ResolverType.Method)) && Objects.equals(method.getParameterTypes()[2], ArrayList.class)) { updateDialogsWithDeletedMessagesMethod = method; break; } } if (updateDialogsWithDeletedMessagesMethod == null) { Logger.w("Failed to hook updateDialogsWithDeletedMessages! Reason: No method found, " + Utils.issue); return; } XposedBridge.hookMethod(updateDialogsWithDeletedMessagesMethod, new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.showDeletedMessages.isEnable()) { long dialogId = (long) param.args[0]; if (ChatMessageCell.currentMessageObject != null && (System.currentTimeMillis() - ChatMessageCell.lastVisibleTime) < 4000) { long objectId = ChatMessageCell.currentMessageObject.getDialogId(); if (objectId == dialogId) return; } long channelID = -((long) param.args[1]); if (channelID > 0) channelID = 0; ArrayList deletedMessages = new ArrayList<>(); Object msgIds = param.args[2]; if (msgIds == null) return; ArrayList original = Utils.castList(msgIds, Integer.class); if (original.isEmpty()) return; for (Integer msgId : original) { if (isShouldDeletedMessage(channelID, msgId) == null) if (isDeletedMessage(channelID, msgId) != null) addShouldDeletedMessage(channelID, msgId); else deletedMessages.remove(msgId); else if (isShouldDeletedMessage2(channelID, msgId) == null) if (isDeletedMessage(channelID, msgId) != null) addShouldDeletedMessage2(channelID, msgId); else deletedMessages.remove(msgId); else deletedMessages.add(msgId); } ArrayList fork = new ArrayList<>(original); fork.removeAll(deletedMessages); if (!fork.isEmpty()) markMessagesDeleted(param.thisObject, channelID, fork); if (deletedMessages.isEmpty()) param.setResult(null); else { ((ArrayList) param.args[2]).clear(); ((ArrayList) param.args[2]).addAll(deletedMessages); } } } }); HMethod.hookMethod( ClassLoad.getClass(ClassNames.MESSAGES_STORAGE), AutomationResolver.resolve("MessagesStorage", "markMessagesAsDeleted", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("markMessagesAsDeleted", new Class[]{long.class, java.util.ArrayList.class, boolean.class, boolean.class, int.class, int.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (!isDeleteMessage) { param.setResult(null); } } } )); } if (ClassLoad.getClass(ClassNames.NOTIFICATIONS_CONTROLLER) != null) { Method removeDeletedMessagesFromNotifications = null; for (Method method : ClassLoad.getClass(ClassNames.NOTIFICATIONS_CONTROLLER).getDeclaredMethods()) if (method.getName().equals(AutomationResolver.resolve("NotificationsController", "removeDeletedMessagesFromNotifications", AutomationResolver.ResolverType.Method))) removeDeletedMessagesFromNotifications = method; if (removeDeletedMessagesFromNotifications == null) Logger.w("Failed to hook removeDeletedMessagesFromNotifications! Reason: No method found, " + Utils.issue); else XposedBridge.hookMethod(removeDeletedMessagesFromNotifications, new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.showDeletedMessages.isEnable()) param.setResult(null); } }); } if (ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER) != null) { HMethod.hookMethod( ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER), AutomationResolver.resolve("MessagesController", "deleteMessages", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("deleteMessages", new Class[]{java.util.ArrayList.class, java.util.ArrayList.class, ClassLoad.getClass(ClassNames.TLRPC_ENCRYPTED_CHAT), long.class, boolean.class, int.class, boolean.class, long.class, ClassLoad.getClass(ClassNames.TL_OBJECT), int.class, boolean.class, int.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { isDeleteMessage = true; } } )); } if (ClassLoad.getClass(ClassNames.NOTIFICATION_CENTER) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.NOTIFICATION_CENTER), AutomationResolver.resolve("NotificationCenter", "postNotificationName", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("postNotificationName", new Class[]{int.class, Object[].class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (!isDeleteMessage) { int id = (int) param.args[0]; if (id == NotificationCenter.getMessagesDeleted()) { param.setResult(null); } } } @Override protected void afterMethod(MethodHookParam param) { isDeleteMessage = false; } })); } ShowDeletedMessages.init(); ShowDeletedMessages.initAutoDownload(); } } catch (Throwable e){ Logger.e(e); } } public static void initAutoDownload() { if (ClassLoad.getClass(ClassNames.DOWNLOAD_CONTROLLER) == null) return; HMethod.hookMethod(ClassLoad.getClass(ClassNames.DOWNLOAD_CONTROLLER), AutomationResolver.resolve("DownloadController", "canDownloadMedia", AutomationResolver.ResolverType.Method), ClassLoad.getClass(ClassNames.TL_MESSAGE), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { TLRPC.Message message = new TLRPC.Message(param.args[0]); if ((message.getFlags() & FLAG_DELETED) != 0) param.setResult(0); } }); } } ================================================ FILE: app/src/main/java/com/my/televip/features/TelePremium.java ================================================ package com.my.televip.features; import com.my.televip.Class.ClassNames; import com.my.televip.ClientChecker; import com.my.televip.Configs.ConfigManager; import com.my.televip.Utils; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import de.robv.android.xposed.XC_MethodHook; import de.robv.android.xposed.XposedHelpers; public class TelePremium { public static boolean isEnable = false; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.USER_CONFIG) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.USER_CONFIG), AutomationResolver.resolve("UserConfig", "isPremium", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override public void beforeMethod(XC_MethodHook.MethodHookParam param) { if (ConfigManager.telegramPremium.isEnable()) param.setResult(true); } }); } if (ClientChecker.check(ClientChecker.ClientType.iMe) || ClientChecker.check(ClientChecker.ClientType.iMeWeb)) { Class ForkPremiumPreferencClass = XposedHelpers.findClassIfExists("com.iMe.storage.data.locale.prefs.impl.ForkPremiumPreference", Utils.classLoader); if (ForkPremiumPreferencClass != null) { HMethod.hookMethod(ForkPremiumPreferencClass, "isPremium", new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.telegramPremium.isEnable()) param.setResult(true); } }); } } } } catch (Throwable t){ Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/otherFeatures/ChatHook.java ================================================ package com.my.televip.features.otherFeatures; import android.content.Context; import android.text.InputType; import android.widget.EditText; import android.widget.LinearLayout; import com.my.televip.Class.ClassLoad; import com.my.televip.Class.ClassNames; import com.my.televip.ClientChecker; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.ActionBar.ActionBarMenuItem; import com.my.televip.virtuals.ActionBar.AlertDialog; import com.my.televip.virtuals.Theme; import com.my.televip.virtuals.ui.ChatActivity; import de.robv.android.xposed.XposedHelpers; public class ChatHook { private static boolean initialized = false; public static void init(Context context, String className) { if (initialized || className == null || ClientChecker.check(ClientChecker.ClientType.Nagram)) return; Class clazz = ClassLoad.getClass(className); if (clazz == null) FeatureStateManager.reset(context); initialized = true; HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_ACTIVITY), AutomationResolver.resolve("ChatActivity", "createView", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("createView", new Class[]{Context.class}), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { ChatActivity chatActivity = new ChatActivity(param.thisObject); ActionBarMenuItem headerItem = chatActivity.getHeaderItem(); if (headerItem.getActionBarMenuItem() != null) { int drawableResource = XposedHelpers.getStaticIntField(ClassLoad.getClass(ClassNames.DRAWABLE), "msg_go_up"); if (!ClientChecker.check(ClientChecker.ClientType.iMe) && !ClientChecker.check(ClientChecker.ClientType.iMeWeb) && !ClientChecker.check(ClientChecker.ClientType.TelegramPlus) && !ClientChecker.check(ClientChecker.ClientType.XPlus) && !ClientChecker.check(ClientChecker.ClientType.forkgram) && !ClientChecker.check(ClientChecker.ClientType.forkgramBeta)) { headerItem.lazilyAddSubItem(8353847, drawableResource, Translator.get(Keys.ToTheBeginning)); } drawableResource = XposedHelpers.getStaticIntField(ClassLoad.getClass(ClassNames.DRAWABLE), "player_new_order"); headerItem.lazilyAddSubItem(8353848, drawableResource, Translator.get(Keys.ToTheMessage)); } } })); HMethod.hookMethod(clazz, "onItemClick", int.class, new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { try { int id = (int) param.args[0]; final Object thisClass = XposedHelpers.getObjectField(param.thisObject, AutomationResolver.resolve("ChatActivity", "this$0", AutomationResolver.ResolverType.Field)); ChatActivity chat = new ChatActivity(thisClass); if (id == 8353847) { chat.scrollToMessageId(1, 0, true, 0, true, 0); } else if (id == 8353848) { AlertDialog dialog = new AlertDialog(context); dialog.setTitle(Translator.get(Keys.InputMessageId)); EditText input = new EditText(context); input.setInputType(InputType.TYPE_CLASS_NUMBER); if (Theme.isLight()) { input.setTextColor(0xFF000000); input.setHintTextColor(0xFF424242); } else { input.setTextColor(0xFFFFFFFF); input.setHintTextColor(0xFFBDBDBD); } input.setTextSize(18); input.setPadding(20, 20, 20, 20); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT ); params.setMargins(20, 20, 20, 20); input.setLayoutParams(params); LinearLayout layout = new LinearLayout(context); layout.setOrientation(LinearLayout.VERTICAL); layout.addView(input); dialog.setView(layout); dialog.setPositiveButton(Translator.get(Keys.Done), AlertDialog.click(() -> { String text = input.getText().toString().trim(); if (!text.isEmpty()) { int msgId = Integer.parseInt(text); chat.scrollToMessageId(msgId, 0, true, 0, true, 0); } })); dialog.show(); } } catch (Throwable t) { Logger.e(t); } } }); } } ================================================ FILE: app/src/main/java/com/my/televip/features/otherFeatures/CopyNameHook.java ================================================ package com.my.televip.features.otherFeatures; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.widget.Toast; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.ActionBar.SimpleTextView; import com.my.televip.virtuals.ui.ProfileActivity; public class CopyNameHook { public static void init(Context context) { try { if (ClassLoad.getClass(ClassNames.PROFILE_ACTIVITY) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.PROFILE_ACTIVITY), AutomationResolver.resolve("ProfileActivity", "createView", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("createView", new Class[]{Context.class}), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { final ProfileActivity profileActivity = new ProfileActivity(param.thisObject); Object[] nameTextViewArray = profileActivity.getNameTextView(); if (nameTextViewArray != null && nameTextViewArray.length > 1) { SimpleTextView simpleTextView = new SimpleTextView(nameTextViewArray[1]); if (simpleTextView.getSimpleTextView() != null) { simpleTextView.getSimpleTextView().setOnClickListener(v -> { if (simpleTextView.getText() != null) { String name = Translator.get(Keys.Copied, simpleTextView.getText()); ((ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("clipboard", simpleTextView.getText())); Toast.makeText(context, name, Toast.LENGTH_LONG).show(); } }); } } } })); } } catch (Throwable t) { Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/otherFeatures/FeatureInitializer.java ================================================ package com.my.televip.features.otherFeatures; import android.content.Context; import com.my.televip.ClientChecker; import com.my.televip.Utils; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class FeatureInitializer { public static void init(Context context) { if (ClientChecker.check(ClientChecker.ClientType.TelegramPlus)) return; try { if (!FeatureStateManager.isChatEnabled() || !FeatureStateManager.isProfileEnabled()) { Class actionBarClass = XposedHelpers.findClassIfExists( AutomationResolver.resolve("org.telegram.ui.ActionBar.ActionBar"), Utils.classLoader ); HMethod.hookMethod( actionBarClass, AutomationResolver.resolve("ActionBar", "setActionBarMenuOnItemClick", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { Object clazz = param.args[0]; if (clazz == null) return; String name = clazz.getClass().getName(); if (name.contains("ChatActivity") && !FeatureStateManager.isChatEnabled()) { FeatureStateManager.saveChat(name); ChatHook.init(context, name); } if (name.contains("ProfileActivity") && !FeatureStateManager.isProfileEnabled()) { FeatureStateManager.saveProfile(name); ProfileHook.init(context, name); } } }); } else { ChatHook.init(context, FeatureStateManager.getChatClass()); ProfileHook.init(context, FeatureStateManager.getProfileClass()); } } catch (Throwable t) { Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/features/otherFeatures/FeatureStateManager.java ================================================ package com.my.televip.features.otherFeatures; import android.content.Context; import com.my.televip.Configs.ConfigPreferences; public class FeatureStateManager { public static final String KEY_CHAT = "ChatOnItemClick"; public static final String KEY_CHAT_BOOL = "ChatOnItemClick_boolean"; public static final String KEY_PROFILE = "ProfileOnItemClick"; public static final String KEY_PROFILE_BOOL = "ProfileOnItemClick_boolean"; public static boolean isChatEnabled() { return ConfigPreferences.getBoolean(KEY_CHAT_BOOL); } public static boolean isProfileEnabled() { return ConfigPreferences.getBoolean(KEY_PROFILE_BOOL); } public static String getChatClass() { return ConfigPreferences.getString(KEY_CHAT); } public static String getProfileClass() { return ConfigPreferences.getString(KEY_PROFILE); } public static void saveChat(String className) { ConfigPreferences.putBoolean(KEY_CHAT_BOOL, true); ConfigPreferences.putString(KEY_CHAT, className); } public static void saveProfile(String className) { ConfigPreferences.putBoolean(KEY_PROFILE_BOOL, true); ConfigPreferences.putString(KEY_PROFILE, className); } public static void reset(Context context) { ConfigPreferences.remove(KEY_CHAT); ConfigPreferences.remove(KEY_CHAT_BOOL); ConfigPreferences.remove(KEY_PROFILE); ConfigPreferences.remove(KEY_PROFILE_BOOL); FeatureInitializer.init(context); } } ================================================ FILE: app/src/main/java/com/my/televip/features/otherFeatures/ProfileHook.java ================================================ package com.my.televip.features.otherFeatures; import android.content.ClipData; import android.content.ClipboardManager; import android.content.Context; import android.widget.Toast; import com.my.televip.Class.ClassLoad; import com.my.televip.Class.ClassNames; import com.my.televip.ClientChecker; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.ActionBar.ActionBarMenuItem; import com.my.televip.virtuals.ui.ProfileActivity; import de.robv.android.xposed.XposedHelpers; public class ProfileHook { private static boolean initialized = false; public static void init(Context context, String className) { if (initialized || className == null) return; Class clazz = ClassLoad.getClass(className); if (clazz == null) FeatureStateManager.reset(context); initialized = true; HMethod.hookMethod(ClassLoad.getClass(ClassNames.PROFILE_ACTIVITY), AutomationResolver.resolve("ProfileActivity", "createActionBarMenu", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("createActionBarMenu", new Class[]{boolean.class}), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { ProfileActivity profileActivity = new ProfileActivity(param.thisObject); ActionBarMenuItem otherItem = profileActivity.getOtherItem(); if (otherItem.getActionBarMenuItem() != null) { int drawableResource = 0x7f0806d3; if (!ClientChecker.check(ClientChecker.ClientType.Nagram) && !ClientChecker.check(ClientChecker.ClientType.Momogram)) { drawableResource = XposedHelpers.getStaticIntField(ClassLoad.getClass(ClassNames.DRAWABLE), "msg_filled_menu_users"); } if (getID(profileActivity) > 1) { otherItem.addSubItem(8353847, drawableResource, String.valueOf(getID(profileActivity))); } } } })); HMethod.hookMethod(clazz, "onItemClick", int.class, new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { int id = (int) param.args[0]; if (id == 8353847) { final Object thisClass = XposedHelpers.getObjectField(param.thisObject, AutomationResolver.resolve("ProfileActivity", "this$0", AutomationResolver.ResolverType.Field)); ProfileActivity profile = new ProfileActivity(thisClass); ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); cm.setPrimaryClip(ClipData.newPlainText("id", String.valueOf(getID(profile)))); Toast.makeText(context, String.valueOf(getID(profile)), Toast.LENGTH_LONG).show(); } } }); } private static long getID(ProfileActivity profile) { if (profile.getUserId() > 1) { return profile.getUserId(); } else { return profile.getChatId(); } } } ================================================ FILE: app/src/main/java/com/my/televip/hooks/HMethod.java ================================================ package com.my.televip.hooks; import com.my.televip.logging.Logger; import de.robv.android.xposed.XposedHelpers; public class HMethod { public static void hookMethod(Class cls, String name, Object... args) { try { if (cls != null) { XposedHelpers.findAndHookMethod(cls, name, args); } } catch (Throwable t) { Logger.e(t); } } public static void hookMethod(Class cls, String[] names, Object... args) { try { if (cls != null) { for (String name : names) { XposedHelpers.findAndHookMethod(cls, name, args); } } } catch (Throwable t) { Logger.e(t); } } } ================================================ FILE: app/src/main/java/com/my/televip/language/Keys.java ================================================ package com.my.televip.language; public class Keys { public static final String ToTheBeginning = "ToTheBeginning"; public static final String ToTheMessage = "ToTheMessage"; public static final String InputMessageId = "InputMessageId"; public static final String Done = "Done"; public static final String Cancel = "Cancel"; public static final String GhostMode = "GhostMode"; public static final String ByMustafa = "ByMustafa"; public static final String HideSeen = "HideSeen"; public static final String HideStoryView = "HideStoryView"; public static final String HideTyping = "HideTyping"; public static final String TelegramPremium = "TelegramPremium"; public static final String RemovesContentSaving = "RemovesContentSaving"; public static final String EnableSavingStories = "EnableSavingStories"; public static final String GhostModeSettings = "GhostModeSettings"; public static final String DeveloperChannel = "DeveloperChannel"; public static final String HideOnline = "HideOnline"; public static final String PreventMedia = "PreventMedia"; public static final String HidePhone = "HidePhone"; public static final String ShowDeletedMessages = "ShowDeletedMessages"; public static final String Deleted = "Deleted"; public static final String Copied = "Copied"; public static final String UserOffline = "UserOffline"; public static final String DisableStories = "DisableStories"; public static final String HideUpdateApp = "HideUpdateApp"; public static final String JoinTeleVip = "JoinTeleVip"; public static final String Join = "Join"; public static final String DontShowAgain = "DontShowAgain"; public static final String RestartApp = "RestartApp"; public static final String RestartRequired = "RestartRequired"; public static final String DisableNumberRounding = "DisableNumberRounding"; public static final String EditsHistory = "EditsHistory"; public static final String SaveEditsHistory = "SaveEditsHistory"; public static final String StoriesSettings = "StoriesSettings"; public static final String MessagesSettings = "MessagesSettings"; public static final String MediaSettings = "MediaSettings"; public static final String OtherFeaturesSettings = "OtherFeaturesSettings"; public static final String FixTLError = "FixTLError"; public static final String ShowMessageID = "ShowMessageID"; public static final String DownloadSpeed = "DownloadSpeed"; public static final String ConnectionsSettings = "ConnectionsSettings"; public static final String Message = "Message"; public static final String Edited = "Edited"; public static final String MarkReadAfterSend = "MarkReadAfterSend"; public static final String OfflineVisibilityInfo = "OfflineVisibilityInfo"; public static final String HidePinnedMessages = "HidePinnedMessages"; public static final String DisableChannelSwipeBack = "DisableChannelSwipeBack"; public static final String DisableProfileSwipeBack = "DisableProfileSwipeBack"; public static final String UiSettings = "UiSettings"; public static final String SecretMediaSave = "SecretMediaSave"; public static final String HideProxySponsor = "HideProxySponsor"; } ================================================ FILE: app/src/main/java/com/my/televip/language/Translator.java ================================================ package com.my.televip.language; import com.my.televip.Utils; import com.my.televip.logging.Logger; import com.my.televip.virtuals.messenger.LocaleController; import org.json.JSONObject; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; public class Translator { private static final Map langMap = new HashMap<>(); private static LocaleController localeController; public static void init() { try { loadAllLanguages(); localeController = new LocaleController(); } catch (Throwable e) { Logger.e(e); } } private static void loadAllLanguages() { try (ZipFile zipFile = new ZipFile(Utils.modulePath)) { Enumeration entries = zipFile.entries(); while (entries.hasMoreElements()) { ZipEntry entry = entries.nextElement(); String name = entry.getName(); if (name.startsWith("assets/lang/") && name.endsWith(".json")) { String langCode = name.substring( name.lastIndexOf("/") + 1, name.lastIndexOf(".") ); InputStream is = zipFile.getInputStream(entry); String json = readFully(is); is.close(); langMap.put(langCode, new JSONObject(json)); } } } catch (Throwable e) { Logger.e(e); } } private static String readFully(InputStream is) throws Exception { byte[] buffer = new byte[4096]; int bytesRead; StringBuilder sb = new StringBuilder(); while ((bytesRead = is.read(buffer)) != -1) { sb.append(new String(buffer, 0, bytesRead, StandardCharsets.UTF_8)); } return sb.toString(); } public static String get(String key) { try { if (localeController.getCurrentLocale() != null) { String lang = localeController.getCurrentLocale().getLanguage(); JSONObject langJson = langMap.get(lang); if (langJson != null && langJson.has(key)) { return langJson.optString(key); } JSONObject enJson = langMap.get("en"); String text; if (enJson != null && enJson.has(key)) { text = enJson.optString(key); } else { text = key; } return text; } } catch (Throwable e) { Logger.e(e); } return key; } public static String get(String key, Object... args) { try { if (localeController.getCurrentLocale() != null) { String lang = localeController.getCurrentLocale().getLanguage(); String text = null; JSONObject langJson = langMap.get(lang); if (langJson != null && langJson.has(key)) { text = langJson.optString(key); } if (text == null) { JSONObject enJson = langMap.get("en"); if (enJson != null && enJson.has(key)) { text = enJson.optString(key); } else { text = key; } } if (args != null && args.length > 0) { return String.format(text, args); } return text; } } catch (Throwable e) { Logger.e(e); } return key; } } ================================================ FILE: app/src/main/java/com/my/televip/logging/Logger.java ================================================ package com.my.televip.logging; import static com.my.televip.Utils.pkgName; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; import android.os.Build; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.struct.ResolverRegistry; import de.robv.android.xposed.XposedBridge; public class Logger { public static void w(String text) { XposedBridge.log("[TeleVip] [Warning] pkgName: "+ pkgName + " " + text); } public static void l(String text) { XposedBridge.log("[TeleVip] pkgName: "+ pkgName +" " + text); } public static void e(Throwable throwable) { try { StringBuilder log = new StringBuilder(); log.append("[TeleVip] [Error] pkgName: ").append(pkgName).append(" ").append(throwable).append("\n"); log.append("appName = ").append(ResolverRegistry.getResolverClass().getSimpleName()).append("\n"); try { PackageManager pm = ClassLoad.getApplicationContext().getPackageManager(); PackageInfo info = pm.getPackageInfo(ClassLoad.getApplicationContext().getPackageName(), 0); String versionName = info.versionName; int versionCode = info.versionCode; log.append("versionName: ").append(versionName).append("\n"); log.append("versionCode: ").append(versionCode).append("\n"); } catch (Throwable e) { log.append("versionName/versionCode: error retrieving\n"); } log.append("OS Version: ").append(Build.VERSION.RELEASE).append("\n"); log.append("SDK: ").append(Build.VERSION.SDK_INT).append("\n"); log.append("Manufacturer: ").append(Build.MANUFACTURER).append("\n"); log.append("Model: ").append(Build.MODEL).append("\n"); for (StackTraceElement element : throwable.getStackTrace()) { log.append("[TeleVip] at ").append(element.toString()).append("\n"); } XposedBridge.log(log.toString()); } catch (Throwable g) {} } } ================================================ FILE: app/src/main/java/com/my/televip/obfuscate/AutomationResolver.java ================================================ package com.my.televip.obfuscate; import com.my.televip.obfuscate.struct.ResolverRegistry; import de.robv.android.xposed.XC_MethodHook; public class AutomationResolver { public static ResolverRegistry resolverRegistry = new ResolverRegistry(ResolverRegistry.getResolverClass()); public static String resolve(String className) { if (resolverRegistry.hasClass(className)) { return resolverRegistry.resolveClass(className); } return className; } public static Class[] resolveObject(String name, Class[] classes) { if (resolverRegistry.hasParameter(name)) { return resolverRegistry.resolveParameter(name); } return classes; } public static String resolve(String className, String name, ResolverType type) { if (type == ResolverType.Field && resolverRegistry.hasField(className, name)) { return resolverRegistry.resolveField(className, name); } if (type == ResolverType.Method && resolverRegistry.hasMethod(className, name)) { return resolverRegistry.resolveMethod(className, name); } name = name.replace("storyEntitiesAllowed2", "storyEntitiesAllowed"); name = name.replace("hasStories2", "hasStories"); return name; } public static Object[] merge(Class[] classes, XC_MethodHook hook) { if (classes != null) { Object[] result = new Object[classes.length + 1]; System.arraycopy(classes, 0, result, 0, classes.length); result[classes.length] = hook; return result; } return null; } public enum ResolverType { Field, Method } } ================================================ FILE: app/src/main/java/com/my/televip/obfuscate/struct/ClassInfo.java ================================================ package com.my.televip.obfuscate.struct; public class ClassInfo { private final String original; private final String resolved; public ClassInfo(String original, String resolved) { this.original = original; this.resolved = resolved; } public String getOriginal() { return this.original; } public String getResolved() { return this.resolved; } } ================================================ FILE: app/src/main/java/com/my/televip/obfuscate/struct/FieldInfo.java ================================================ package com.my.televip.obfuscate.struct; public class FieldInfo { private final String className; private final String original; private final String resolved; public FieldInfo(String className, String original, String resolved) { this.className = className; this.original = original; this.resolved = resolved; } public String getClassName() { return this.className; } public String getOriginal() { return this.original; } public String getResolved() { return this.resolved; } } ================================================ FILE: app/src/main/java/com/my/televip/obfuscate/struct/MethodInfo.java ================================================ package com.my.televip.obfuscate.struct; public class MethodInfo { private final String className; private final String original; private final String resolved; public MethodInfo(String className, String original, String resolved) { this.className = className; this.original = original; this.resolved = resolved; } public String getClassName() { return this.className; } public String getOriginal() { return this.original; } public String getResolved() { return this.resolved; } } ================================================ FILE: app/src/main/java/com/my/televip/obfuscate/struct/ResolverRegistry.java ================================================ package com.my.televip.obfuscate.struct; import com.my.televip.ClientChecker; import com.my.televip.Utils; public class ResolverRegistry { Class finalField; Class finalMethod; Class finalParameter; Class finalClass; Class clazz; public ResolverRegistry(Class clazz){ this.clazz = clazz; try { Class fieldResolverClass = null; Class methodResolverClass = null; Class parameterResolverClass = null; Class classResolverClass = null; for (Class inner : clazz.getDeclaredClasses()) { if (inner.getSimpleName().equals("FieldResolver")) fieldResolverClass = inner; if (inner.getSimpleName().equals("MethodResolver")) methodResolverClass = inner; if (inner.getSimpleName().equals("ParameterResolver")) parameterResolverClass = inner; if (inner.getSimpleName().equals("ClassResolver")) classResolverClass = inner; } finalField = fieldResolverClass; finalMethod = methodResolverClass; finalParameter = parameterResolverClass; finalClass = classResolverClass; } catch (Throwable ignored) {} } public boolean hasClass(String className){ try { return (boolean)finalClass.getMethod("has", String.class).invoke(null, className); } catch (Throwable e){ return false; } } public String resolveClass(String className){ try { return (String) finalClass.getMethod("resolve", String.class).invoke(null, className); } catch (Throwable e){ return null; } } public boolean hasField(String className, String name){ try { return (boolean)finalField.getMethod("has", String.class,String.class).invoke(null, className ,name); } catch (Throwable e){ return false; } } public String resolveField(String className, String name){ try { return (String) finalField.getMethod("resolve", String.class,String.class).invoke(null, className ,name); } catch (Throwable e){ return null; } } public boolean hasMethod(String className, String name){ try { return (boolean)finalMethod.getMethod("has", String.class,String.class).invoke(null, className ,name); } catch (Throwable e){ return false; } } public String resolveMethod(String className, String name){ try { return (String) finalMethod.getMethod("resolve", String.class,String.class).invoke(null, className ,name); } catch (Throwable e){ return null; } } public boolean hasParameter(String name){ try { return (boolean)finalParameter.getMethod("has", String.class).invoke(null, name); } catch (Throwable e){ return false; } } public Class[] resolveParameter(String name){ try { return (Class[]) finalParameter.getMethod("resolve", String.class).invoke(null, name); } catch (Throwable e){ return null; } } public void loadParameter(){ try { clazz.getMethod("loadParameter").invoke(null); } catch (Throwable ignored){} } public static Class getResolverClass() { ClientChecker.ClientType clientType = ClientChecker.ClientType.fromPackage(Utils.pkgName); if (clientType == null) return null; return clientType.getResolverClass(); } } ================================================ FILE: app/src/main/java/com/my/televip/settings/SettingsManager.java ================================================ package com.my.televip.settings; import com.my.televip.Utils; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.settings.controller.SettingsController; import com.my.televip.settings.hook.SettingsHook; import com.my.televip.settings.ui.SettingsActivity; import de.robv.android.xposed.XposedHelpers; public class SettingsManager { public static void init(SettingsController settingsController) { SettingsActivity.init(settingsController); Class SettingsActivityClass = XposedHelpers.findClassIfExists( AutomationResolver.resolve("org.telegram.ui.SettingsActivity"), Utils.classLoader ); Class SettingsActivity$SettingCell$FactoryClass = XposedHelpers.findClassIfExists( AutomationResolver.resolve("org.telegram.ui.SettingsActivity$SettingCell$Factory"), Utils.classLoader ); SettingsHook settings = new SettingsHook(); if (SettingsActivityClass != null && SettingsActivity$SettingCell$FactoryClass != null) { settings.newSettings(SettingsActivityClass, SettingsActivity$SettingCell$FactoryClass, settingsController); } else { settings.oldSettings(settingsController); } } } ================================================ FILE: app/src/main/java/com/my/televip/settings/controller/SettingsController.java ================================================ package com.my.televip.settings.controller; import android.content.Context; import android.view.View; import android.widget.FrameLayout; import com.my.televip.Configs.ConfigPreferences; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.settings.ui.SettingsActivity; import com.my.televip.logging.Logger; import com.my.televip.virtuals.ActionBar.AlertDialog; import com.my.televip.virtuals.messenger.browser.Browser; import com.my.televip.virtuals.ui.LaunchActivity; public class SettingsController { public FrameLayout settingsView; private final Context context; public SettingsController(Context context) { this.context = context; } public void openView(){ try { if (settingsView == null) { settingsView = new FrameLayout(context); } settingsView.removeAllViews(); SettingsActivity settingsActivity = new SettingsActivity(context); showDialog(); settingsView.addView(settingsActivity.createView(this)); show(settingsView); } catch (Throwable e) { Logger.e(e); } } private void showDialog() { try { if (!ConfigPreferences.getBoolean("DSA")) { AlertDialog alertDialog = new AlertDialog(context); alertDialog.setTitle(Translator.get(Keys.GhostMode)); alertDialog.setMessage(Translator.get(Keys.JoinTeleVip)); alertDialog.setPositiveButton(Translator.get(Keys.Join), AlertDialog.click(() -> { Browser.openUrl(context, "https://t.me/t_l0_e"); hide(); })); alertDialog.setNegativeButton(Translator.get(Keys.Cancel), null); alertDialog.setNeutralButton(Translator.get(Keys.DontShowAgain), AlertDialog.click(() -> ConfigPreferences.putBoolean("DSA", true))); alertDialog.show(); } } catch (Throwable e) { Logger.e(e); } } public void show(View target) { LaunchActivity launchActivity = new LaunchActivity(context); if (target.getParent() == null) { launchActivity.frameLayout.addView(target); } for (int i = 0; i < launchActivity.frameLayout.getChildCount(); i++) { View child = launchActivity.frameLayout.getChildAt(i); child.setVisibility(child == target ? View.VISIBLE : View.GONE); } target.bringToFront(); } public void hide() { LaunchActivity launchActivity = new LaunchActivity(settingsView.getContext()); for (int i = 0; i < launchActivity.frameLayout.getChildCount(); i++) { View child = launchActivity.frameLayout.getChildAt(i); child.setVisibility(child == settingsView ? View.GONE : View.VISIBLE); } if (settingsView != null && settingsView.getParent() != null) { launchActivity.frameLayout.removeView(settingsView); } SettingsActivity.isSettings = false; } } ================================================ FILE: app/src/main/java/com/my/televip/settings/hook/SettingsHook.java ================================================ package com.my.televip.settings.hook; import android.view.View; import android.widget.ImageView; import com.my.televip.Class.ClassNames; import com.my.televip.ClientChecker; import com.my.televip.Drawable.GhostDrawable; import com.my.televip.Utils; import com.my.televip.base.AbstractMethodHook; import com.my.televip.hooks.HMethod; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.settings.controller.SettingsController; import com.my.televip.logging.Logger; import com.my.televip.virtuals.Adapters.DrawerLayoutAdapter; import com.my.televip.virtuals.SettingsIconResolver; import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Arrays; import de.robv.android.xposed.XposedBridge; import de.robv.android.xposed.XposedHelpers; public class SettingsHook { public int id_item_add = -1; private Constructor itemConstructor; public void newSettings(Class SettingsActivityClass, Class SettingsActivity$SettingCell$FactoryClass, SettingsController settingsController){ AbstractMethodHook fillItemsHook = new AbstractMethodHook() { @Override protected void afterMethod(final MethodHookParam param) { ArrayList arrayList = (ArrayList) param.args[0]; if (arrayList != null) { int color1 = 0xFFF46F6F; int color2 = 0xFFDF5555; Object uItem = XposedHelpers.callStaticMethod(SettingsActivity$SettingCell$FactoryClass, AutomationResolver.resolve("SettingCell$Factory","of", AutomationResolver.ResolverType.Method), 8353847, color1, color2, 8353847, Translator.get(Keys.GhostMode), Translator.get(Keys.ByMustafa)); if (id_item_add == -1) { for (int i = 0; i < arrayList.size(); i++) { Object obj = arrayList.get(i); int id_item = XposedHelpers.getIntField(obj, AutomationResolver.resolve("UItem","id", AutomationResolver.ResolverType.Field)); if (id_item > 0) { arrayList.add(i, uItem); id_item_add = i; break; } } } else { arrayList.add(id_item_add, uItem); } } } }; Class SettingsActivity$SettingCellClass = XposedHelpers.findClassIfExists( AutomationResolver.resolve("org.telegram.ui.SettingsActivity$SettingCell"), Utils.classLoader ); GhostDrawable ghostDrawable = new GhostDrawable(); HMethod.hookMethod(SettingsActivity$SettingCellClass, AutomationResolver.resolve("SettingsActivity$SettingCell","set", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("set", new Class[]{int.class, int.class, int.class, CharSequence.class, CharSequence.class, CharSequence.class}), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { int id = (int) param.args[2]; if (id == 8353847) { ImageView iconView = (ImageView) XposedHelpers.getObjectField(param.thisObject, AutomationResolver.resolve("SettingsActivity$SettingCell", "iconView", AutomationResolver.ResolverType.Field)); iconView.setImageDrawable(ghostDrawable); } } })); Class UniversalAdapterClass = XposedHelpers.findClassIfExists(AutomationResolver.resolve("org.telegram.ui.Components.UniversalAdapter"), Utils.classLoader); HMethod.hookMethod(SettingsActivityClass, AutomationResolver.resolve("SettingsActivity", "fillItems", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("fillItems", new Class[]{java.util.ArrayList.class, UniversalAdapterClass}), fillItemsHook)); AbstractMethodHook onClickHook = new AbstractMethodHook() { @Override protected void afterMethod(final MethodHookParam param) { Object uItem = param.args[0]; if (uItem != null){ int id = XposedHelpers.getIntField(uItem, AutomationResolver.resolve("UItem","id", AutomationResolver.ResolverType.Field)); if (id == 8353847) { settingsController.openView(); } } } }; Class UItemClass = XposedHelpers.findClassIfExists(AutomationResolver.resolve("org.telegram.ui.Components.UItem"), Utils.classLoader); HMethod.hookMethod( SettingsActivityClass, AutomationResolver.resolve("SettingsActivity", "onClick", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("onClick", new Class[]{UItemClass, View.class, int.class, float.class, float.class}), onClickHook)); } public void oldSettings(SettingsController settingsController){ final Class itemClass = XposedHelpers.findClassIfExists(AutomationResolver.resolve("org.telegram.ui.Adapters.DrawerLayoutAdapter$Item"), Utils.classLoader); if (itemClass != null) { HMethod.hookMethod( ClassLoad.getClass(ClassNames.DRAWER_LAYOUT_ADAPTER), AutomationResolver.resolve("DrawerLayoutAdapter", "resetItems", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) throws Throwable { DrawerLayoutAdapter drawerLayoutAdapter = new DrawerLayoutAdapter(param.thisObject); ArrayList items = drawerLayoutAdapter.getItems(); if (itemConstructor == null) { itemConstructor = itemClass.getDeclaredConstructor(AutomationResolver.resolveObject("item", new Class[]{int.class, CharSequence.class, int.class})); itemConstructor.setAccessible(true); } Object newItem = itemConstructor.newInstance(8353847, Translator.get(Keys.GhostMode), SettingsIconResolver.getIconSettings()); if (items instanceof ArrayList) { ArrayList typedItems = (ArrayList) items; if (!ClientChecker.check(ClientChecker.ClientType.Telegraph)) { typedItems.add(newItem); } else { typedItems.add(0, newItem); } } } } ); AbstractMethodHook onCreateHook = new AbstractMethodHook() { @Override protected void afterMethod(final MethodHookParam param) { Object Launch = param.thisObject; Object drawerLayoutAdapter = XposedHelpers.getObjectField(Launch, AutomationResolver.resolve("LaunchActivity", "drawerLayoutAdapter", AutomationResolver.ResolverType.Field)); if (drawerLayoutAdapter != null) { Object args = param.args[1]; int id = (int) XposedHelpers.callMethod(drawerLayoutAdapter, AutomationResolver.resolve("DrawerLayoutAdapter", "getId", AutomationResolver.ResolverType.Method), args); if (id == 8353847) { Object drawerLayoutContainer = XposedHelpers.getObjectField(Launch, AutomationResolver.resolve("LaunchActivity", "drawerLayoutContainer", AutomationResolver.ResolverType.Field)); if (drawerLayoutContainer != null) { XposedHelpers.callMethod(drawerLayoutContainer, AutomationResolver.resolve("DrawerLayoutContainer", "closeDrawer", AutomationResolver.ResolverType.Method)); } settingsController.openView(); } } } }; if (ClassLoad.getClass(ClassNames.LAUNCH_ACTIVITY) != null) { Method onCreateMethod = null; for (Method method : ClassLoad.getClass(ClassNames.LAUNCH_ACTIVITY).getDeclaredMethods()) { if (Arrays.equals(method.getParameterTypes(), AutomationResolver.resolveObject("onCreateMethod", new Class[]{android.view.View.class, int.class, float.class, float.class}))) { onCreateMethod = method; break; } } if (onCreateMethod == null) { Logger.w("Failed to hook onCreateMethod! Reason: No method found, " + Utils.issue); return; } XposedBridge.hookMethod(onCreateMethod, onCreateHook); } } } } ================================================ FILE: app/src/main/java/com/my/televip/settings/ui/SettingsActivity.java ================================================ package com.my.televip.settings.ui; import android.content.Context; import android.view.View; import android.widget.LinearLayout; import com.my.televip.Class.ClassLoad; import com.my.televip.Class.ClassNames; import com.my.televip.Configs.ConfigManager; import com.my.televip.Drawable.ArrowDrawable; import com.my.televip.audio; import com.my.televip.base.AbstractMethodHook; import com.my.televip.dex.DexInjector; import com.my.televip.hooks.HMethod; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.logging.Logger; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.settings.controller.SettingsController; import com.my.televip.ui.toolBar.MainToolBar; import com.my.televip.virtuals.TeleVip.Bridge.Bridge; import com.my.televip.virtuals.Theme; import com.my.televip.virtuals.ui.Components.RecyclerListView; import de.robv.android.xposed.XposedHelpers; public class SettingsActivity { public static boolean isSettings; private final Context context; public RecyclerListView listView; private LinearLayout layout; public View createView(SettingsController settingsController) { try { if (SettingsAdapter.items != null && !SettingsAdapter.items.isEmpty()) SettingsAdapter.items.clear(); SettingsAdapter.items = ConfigManager.getItems(context); layout = new LinearLayout(context); layout.setOrientation(LinearLayout.VERTICAL); layout.setBackgroundColor(Theme.getBackgroundGrayColor()); MainToolBar toolbar = new MainToolBar(context); toolbar.setColorTitle(Theme.getTextToolBarColor()); toolbar.setRippleColor(Theme.getToolBarRippleColor()); toolbar.setTextTitle(Translator.get(Keys.GhostMode)); ArrowDrawable arrow = new ArrowDrawable(); toolbar.setImageDrawable(arrow); toolbar.getImage().setOnClickListener(v -> settingsController.hide()); layout.addView(toolbar); listView = new RecyclerListView(context); Object adapter = XposedHelpers.newInstance( ClassLoad.getClass(ClassNames.SETTINGS_ADAPTER_LIST_ADAPTER, DexInjector.classLoader), context); listView.setAdapter(adapter); listView.setBackgroundColor(Theme.getBackgroundWhiteOrBlueColor()); listView.setVerticalScrollBarEnabled(false); listView.setLayoutManager(Bridge.getLayoutManager(context)); LinearLayout.LayoutParams recyclerParams = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, 0, 1f ); recyclerParams.setMargins(10, 10, 10, 0); layout.addView(listView.getRecyclerListView(), recyclerParams); } catch (Throwable e) { Logger.e(e); } return layout; } public SettingsActivity(Context context) { this.context = context; isSettings = true; } public static void init(SettingsController settingsController) { audio.init(); try { HMethod.hookMethod(ClassLoad.getClass(ClassNames.LAUNCH_ACTIVITY), "onBackPressed", new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (isSettings) { settingsController.hide(); settingsController.settingsView = null; param.setResult(null); } } }); HMethod.hookMethod(ClassLoad.getClass(ClassNames.ANDROID_UTILITIES), AutomationResolver.resolve("AndroidUtilities", "isTablet", AutomationResolver.ResolverType.Method), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (isSettings) { param.setResult(true); } } }); } catch (Throwable e) { Logger.e(e); } } } ================================================ FILE: app/src/main/java/com/my/televip/settings/ui/SettingsAdapter.java ================================================ package com.my.televip.settings.ui; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.text.TextUtils; import android.view.View; import android.widget.TextView; import com.my.televip.Configs.ConfigItem; import com.my.televip.Configs.ConfigManager; import com.my.televip.Utils; import com.my.televip.audio; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.settings.controller.SettingsController; import com.my.televip.virtuals.Theme; import com.my.televip.virtuals.androidx.ViewHolder; import com.my.televip.virtuals.messenger.browser.Browser; import com.my.televip.virtuals.ui.Cells.HeaderCell; import com.my.televip.virtuals.ui.Cells.TextCheckCell; import com.my.televip.virtuals.ui.Cells.TextInfoCell; import com.my.televip.virtuals.ui.Cells.TextSettingsCell; import java.util.List; import de.robv.android.xposed.XposedHelpers; public class SettingsAdapter { public static List items; private static boolean isLongText = false; public static int getRow(int position) { return items.get(position).getType(); } public static int getRowCount() { return items.size(); } public static void onBindViewHolder(Context context, Object holder, SettingsController settingsController, int position, int viewType) { ConfigItem item = items.get(position); switch (viewType) { case ConfigItem.HEADER: HeaderCellHolder headerCell = new HeaderCellHolder(holder); headerCell.cell.setText(Translator.get(item.getKey())); break; case ConfigItem.SWITCH: TextCheckCellHolder textCheck = new TextCheckCellHolder(holder); if (item.getText() != null) { textCheck.cell.setTextAndValueAndCheck( Translator.get(item.getKey()), item.getText(), item.isEnable(), true, false ); } else { textCheck.cell.setTextAndCheck( Translator.get(item.getKey()), item.isEnable(), false ); } textCheck.cell.getTextView().setLines(0); textCheck.cell.getTextView().setMaxLines(0); textCheck.cell.getTextView().setSingleLine(false); textCheck.cell.getTextView().setEllipsize(null); break; case ConfigItem.BUTTON: TextSettingsCellHolder settingsCell = new TextSettingsCellHolder(holder); if (item.getKey().equals(Keys.DeveloperChannel)) { settingsCell.cell.setText(Translator.get(Keys.DeveloperChannel), false); } else if (item.getKey().equals(Keys.RestartApp)) { settingsCell.cell.setText(Translator.get(Keys.RestartApp), false); } settingsCell.cell.getTextView().setTextColor(Theme.getTextBlueColor()); break; case ConfigItem.DIVIDER: ShadowSectionCellHolder shadowSectionCell = new ShadowSectionCellHolder(holder); shadowSectionCell.cell.setBackgroundColor((Theme.getBackgroundGrayColor())); break; case ConfigItem.INFO: TextInfoCellHolder textInfoCell = new TextInfoCellHolder(holder); TextView textView = textInfoCell.text.getTextView(); if (item.getKey().equals(Keys.OfflineVisibilityInfo)) { textView.setMaxLines(2); textView.setEllipsize(TextUtils.TruncateAt.END); textView.setText(Translator.get(Keys.OfflineVisibilityInfo)); if (textView.getMaxLines() == 2) { isLongText = false; } textView.setOnClickListener(v -> { if (!isLongText) { textView.setMaxLines(Integer.MAX_VALUE); textView.setEllipsize(null); isLongText = true; } else { textView.setMaxLines(2); textView.setEllipsize(TextUtils.TruncateAt.END); textView.setText(Translator.get(Keys.OfflineVisibilityInfo)); isLongText = false; } }); } break; } ViewHolder viewHolder = new ViewHolder(holder); viewHolder.getItemView().setOnLongClickListener(v -> { if (audio.playing) { audio.stop(); } else { audio.start(); } return true; }); viewHolder.getItemView().setOnClickListener(v -> { int pos = viewHolder.getAdapterPosition(); ConfigItem featureItem = items.get(pos); if (viewType == ConfigItem.SWITCH) { TextCheckCellHolder textCheck = new TextCheckCellHolder(holder); boolean checked = !textCheck.cell.isChecked(); textCheck.cell.setChecked(checked); if (featureItem != null) { featureItem.setEnable(checked); ConfigManager.load(context); featureItem.run(); } } else if (viewType == ConfigItem.BUTTON) { if (featureItem.getKey().equals(Keys.DeveloperChannel)) { Browser.openUrl(context, "https://t.me/t_l0_e"); settingsController.hide(); } else if (featureItem.getKey().equals(Keys.RestartApp)) { Intent intent = context .getPackageManager() .getLaunchIntentForPackage(Utils.pkgName); if (intent != null) { intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); context.startActivity(intent); } ((Activity)context).finishAffinity(); android.os.Process.killProcess(android.os.Process.myPid()); } } }); } public static class HeaderCellHolder { HeaderCell cell; public HeaderCellHolder(Object obj) { cell = new HeaderCell(XposedHelpers.getObjectField(obj, "headerCell")); } } public static class TextCheckCellHolder { TextCheckCell cell; public TextCheckCellHolder(Object obj) { cell = new TextCheckCell(XposedHelpers.getObjectField(obj, "textCheckCell")); } } public static class TextSettingsCellHolder { TextSettingsCell cell; public TextSettingsCellHolder(Object obj) { cell = new TextSettingsCell(XposedHelpers.getObjectField(obj, "textSettingsCell")); } } public static class ShadowSectionCellHolder { View cell; public ShadowSectionCellHolder(Object obj) { cell = (View) XposedHelpers.getObjectField(obj, "view"); } } public static class TextInfoCellHolder { TextInfoCell text; public TextInfoCellHolder(Object obj) { text = (TextInfoCell) XposedHelpers.getObjectField(obj, "view"); } } } ================================================ FILE: app/src/main/java/com/my/televip/structs/DeletedMessageInfo.java ================================================ package com.my.televip.structs; import java.util.ArrayList; public class DeletedMessageInfo { public static final long NOT_CHANNEL = 0; private final int selectedAccount; private final long channelID; private final ArrayList messageIds; public DeletedMessageInfo(int selectedAccount, long channelID, ArrayList messageIds) { this.selectedAccount = selectedAccount; this.channelID = channelID; this.messageIds = messageIds; } public DeletedMessageInfo(int selectedAccount, long channelID, int messageId) { this.selectedAccount = selectedAccount; this.channelID = channelID; this.messageIds = new ArrayList<>(); this.messageIds.add(messageId); } public int getSelectedAccount() { return this.selectedAccount; } public long getChannelID() { return this.channelID; } public ArrayList getMessageIds() { return this.messageIds; } public void insertMessageId(Integer messageId) { this.messageIds.add(messageId); } } ================================================ FILE: app/src/main/java/com/my/televip/ui/toolBar/MainToolBar.java ================================================ package com.my.televip.ui.toolBar; import android.annotation.SuppressLint; import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Typeface; import android.graphics.drawable.Drawable; import android.text.TextUtils; import android.view.Gravity; import android.widget.ImageView; import android.widget.LinearLayout; import android.widget.TextView; import com.my.televip.application.AndroidUtilities; import com.my.televip.virtuals.Theme; public class MainToolBar extends LinearLayout { private final Context context; private TextView title; private ImageView image; public MainToolBar(Context context){ super(context); this.context = context; createToolbar(); } private int getStatusBarHeight(Context context) { int result = 0; @SuppressLint({"InternalInsetResource", "DiscouragedApi"}) int resourceId = context.getResources() .getIdentifier("status_bar_height", "dimen", "android"); if (resourceId > 0) { result = context.getResources().getDimensionPixelSize(resourceId); } return result; } public void createToolbar(){ int statusBar = getStatusBarHeight(context); this.setOrientation(LinearLayout.HORIZONTAL); this.setLayoutParams(new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, AndroidUtilities.dp(56) + statusBar)); this.setBackgroundColor(Theme.getToolBarColor()); this.setFitsSystemWindows(false); this.setGravity(Gravity.BOTTOM | Gravity.CENTER_VERTICAL); this.setPadding( AndroidUtilities.dp(8), statusBar, // أهم سطر AndroidUtilities.dp(16), 0 ); image = new ImageView(context); LinearLayout.LayoutParams iconParams = new LinearLayout.LayoutParams( AndroidUtilities.dp(40), AndroidUtilities.dp(40) ); iconParams.gravity = Gravity.CENTER_VERTICAL; image.setLayoutParams(iconParams); image.setPadding( AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8), AndroidUtilities.dp(8) ); image.setScaleType(ImageView.ScaleType.FIT_CENTER); title = new TextView(context); title.setTextSize(18); title.setTypeface(Typeface.DEFAULT_BOLD); title.setSingleLine(true); title.setEllipsize(TextUtils.TruncateAt.END); LinearLayout.LayoutParams titleParams = new LinearLayout.LayoutParams( 0, LayoutParams.WRAP_CONTENT, 1f ); titleParams.gravity = Gravity.CENTER_VERTICAL; titleParams.setMargins(AndroidUtilities.dp(8), 0, 0, 0); title.setLayoutParams(titleParams); this.addView(image); this.addView(title); } public void setTextTitle(CharSequence title) { this.title.setText(title); } public void setColorTitle(int colorTitle) { this.title.setTextColor(colorTitle); } public void setImageDrawable(Drawable drawable){ this.image.setImageDrawable(drawable); } public void setRippleColor(int color) { Drawable rippleDrawable = new android.graphics.drawable.RippleDrawable( ColorStateList.valueOf(color), null, null ); image.setBackground(rippleDrawable); } public ImageView getImage(){ return this.image; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ActionBar/ActionBarMenuItem.java ================================================ package com.my.televip.virtuals.ActionBar; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class ActionBarMenuItem { Object actionBarMenuItem; public ActionBarMenuItem(Object obj){ actionBarMenuItem = obj; } public void lazilyAddSubItem(int id, int resId, String name){ XposedHelpers.callMethod(actionBarMenuItem, AutomationResolver.resolve("ActionBarMenuItem", "lazilyAddSubItem", AutomationResolver.ResolverType.Method), id, resId, name); } public void addSubItem(int id, int resId, String name){ XposedHelpers.callMethod(actionBarMenuItem, AutomationResolver.resolve("ActionBarMenuItem", "addSubItem", AutomationResolver.ResolverType.Method), id, resId, name); } public Object getActionBarMenuItem(){ return actionBarMenuItem; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ActionBar/AlertDialog.java ================================================ package com.my.televip.virtuals.ActionBar; import android.content.Context; import android.content.DialogInterface; import android.view.View; import com.my.televip.Class.ClassNames; import com.my.televip.Utils; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import java.lang.reflect.Proxy; import de.robv.android.xposed.XposedHelpers; public class AlertDialog { @FunctionalInterface public interface OnClick { void onClick(); } public static Object click(OnClick lambda) { Class listenerClass = ClassLoad.getClass(ClassNames.ALERT_DIALOG_BUTTON_CLICK); if (listenerClass != null) { return Proxy.newProxyInstance( Utils.classLoader, new Class[]{listenerClass}, (proxy, method, args) -> { if (method.getName().equals(AutomationResolver.resolve("AlertDialog$OnButtonClickListener", "onClick", AutomationResolver.ResolverType.Method))) { lambda.onClick(); } return null; } ); } else { return (DialogInterface.OnClickListener) (dialog, which) -> lambda.onClick(); } } Object alertDialog; public AlertDialog(Context context) { alertDialog = XposedHelpers.newInstance(ClassLoad.getClass(ClassNames.ALERT_DIALOG_BUILDER), context); } public void setTitle(CharSequence title) { XposedHelpers.callMethod(alertDialog, AutomationResolver.resolve("AlertDialog", "setTitle", AutomationResolver.ResolverType.Method), title); } public void setView(View view) { XposedHelpers.callMethod(alertDialog, AutomationResolver.resolve("AlertDialog", "setView", AutomationResolver.ResolverType.Method), view); } public void setMessage(CharSequence message) { XposedHelpers.callMethod(alertDialog, AutomationResolver.resolve("AlertDialog", "setMessage", AutomationResolver.ResolverType.Method), message); } public void setPositiveButton(CharSequence text, Object obj) { XposedHelpers.callMethod(alertDialog, AutomationResolver.resolve("AlertDialog", "setPositiveButton", AutomationResolver.ResolverType.Method), text, obj ); } public void setNegativeButton(CharSequence text, Object obj) { XposedHelpers.callMethod(alertDialog, AutomationResolver.resolve("AlertDialog", "setNegativeButton", AutomationResolver.ResolverType.Method), text, obj ); } public void setNeutralButton(CharSequence text, Object obj) { XposedHelpers.callMethod(alertDialog, AutomationResolver.resolve("AlertDialog", "setNeutralButton", AutomationResolver.ResolverType.Method), text, obj ); } public void show() { XposedHelpers.callMethod(alertDialog, AutomationResolver.resolve("AlertDialog", "show", AutomationResolver.ResolverType.Method)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ActionBar/SimpleTextView.java ================================================ package com.my.televip.virtuals.ActionBar; import android.view.View; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class SimpleTextView { Object simpleTextView; public SimpleTextView(Object textview){ simpleTextView = textview; } public CharSequence getText(){ return (CharSequence) XposedHelpers.getObjectField(simpleTextView, AutomationResolver.resolve("SimpleTextView", "text", AutomationResolver.ResolverType.Field)); } public void setText(CharSequence text){ XposedHelpers.callMethod(simpleTextView, AutomationResolver.resolve("SimpleTextView", "setText", AutomationResolver.ResolverType.Method), text); } public View getSimpleTextView(){ return (View) simpleTextView; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/Adapters/DrawerLayoutAdapter.java ================================================ package com.my.televip.virtuals.Adapters; import com.my.televip.obfuscate.AutomationResolver; import java.util.ArrayList; import de.robv.android.xposed.XposedHelpers; public class DrawerLayoutAdapter { private final Object drawerLayout; public DrawerLayoutAdapter(Object obj){ drawerLayout = obj; } public ArrayList getItems(){ return (ArrayList) XposedHelpers.getObjectField(drawerLayout, AutomationResolver.resolve("DrawerLayoutAdapter", "items", AutomationResolver.ResolverType.Field)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ChatMessageCellDefault.java ================================================ package com.my.televip.virtuals; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import de.robv.android.xposed.XposedHelpers; public class ChatMessageCellDefault { protected final Object instance; protected ChatMessageCellDefault(Object instance) { this.instance = instance; } public int getTimeTextWidth() { return XposedHelpers.getIntField(this.instance, AutomationResolver.resolve("ChatMessageCell", "timeTextWidth", AutomationResolver.ResolverType.Field)); } public int getTimeWidth() { return XposedHelpers.getIntField(this.instance, AutomationResolver.resolve("ChatMessageCell", "timeWidth", AutomationResolver.ResolverType.Field)); } public void setTimeTextWidth(int width) { try { XposedHelpers.setIntField(this.instance, AutomationResolver.resolve("ChatMessageCell", "timeTextWidth", AutomationResolver.ResolverType.Field), width); } catch (Throwable e) { Logger.e(e); } } public void setTimeWidth(int width) { try { XposedHelpers.setIntField(this.instance, AutomationResolver.resolve("ChatMessageCell", "timeWidth", AutomationResolver.ResolverType.Field), width); } catch (Throwable e) { Logger.e(e); } } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/OfficialChatMessageCell.java ================================================ package com.my.televip.virtuals; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import de.robv.android.xposed.XposedHelpers; public class OfficialChatMessageCell extends ChatMessageCellDefault { public OfficialChatMessageCell(Object instance) { super(instance); } public CharSequence getCurrentTimeString() { return (CharSequence) XposedHelpers.getObjectField(this.instance, AutomationResolver.resolve("ChatMessageCell", "currentTimeString", AutomationResolver.ResolverType.Field)); } public void setCurrentTimeString(CharSequence currentTimeString) { try { XposedHelpers.setObjectField(this.instance, AutomationResolver.resolve("ChatMessageCell", "currentTimeString", AutomationResolver.ResolverType.Field), currentTimeString); /*Field currentTimeStringField = FieldUtils.getFieldOfClass(this.instance, "currentTimeString"); if (currentTimeStringField != null) currentTimeStringField.set(this.instance, currentTimeString); else throw new NullPointerException("Not found currentTimeString in " + this.instance.getClass().getName());*/ } catch (Throwable e) { Logger.e(e); } } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/SQLite/SQLiteCursor.java ================================================ package com.my.televip.virtuals.SQLite; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.tgnet.NativeByteBuffer; import de.robv.android.xposed.XposedHelpers; public class SQLiteCursor { Object sqLiteCursor; public SQLiteCursor(Object obj){ sqLiteCursor = obj; } public boolean next(){ return (boolean) XposedHelpers.callMethod(sqLiteCursor, AutomationResolver.resolve("SQLiteCursor", "next", AutomationResolver.ResolverType.Method)); } public int intValue(int columnIndex) { return (int) XposedHelpers.callMethod(sqLiteCursor, AutomationResolver.resolve("SQLiteCursor", "intValue", AutomationResolver.ResolverType.Method), columnIndex); } public void dispose() { XposedHelpers.callMethod(sqLiteCursor, AutomationResolver.resolve("SQLiteCursor", "dispose", AutomationResolver.ResolverType.Method)); } public NativeByteBuffer byteBufferValue(int columnIndex){ return new NativeByteBuffer(XposedHelpers.callMethod(sqLiteCursor, AutomationResolver.resolve("SQLiteCursor", "byteBufferValue", AutomationResolver.ResolverType.Method), columnIndex)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/SQLite/SQLiteDatabase.java ================================================ package com.my.televip.virtuals.SQLite; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class SQLiteDatabase { Object sqLiteDatabase; public SQLiteDatabase(Object obj){ sqLiteDatabase = obj; } public SQLiteCursor queryFinalized(String s){ return new SQLiteCursor(XposedHelpers.callMethod(sqLiteDatabase, AutomationResolver.resolve("SQLiteDatabase", "queryFinalized", AutomationResolver.ResolverType.Method), s, new Object[0])); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/SettingsIconResolver.java ================================================ package com.my.televip.virtuals; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import de.robv.android.xposed.XposedHelpers; public class SettingsIconResolver { private static Integer cachedIcon = null; public static int getIconSettings() { if (ClassLoad.getClass(ClassNames.DRAWABLE) == null) { return 0; } if (cachedIcon != null) return cachedIcon; String[] names = { "msg_settings", "msg_settings_old", "msg_settings_ny", "msg_settings_14", "msg_settings_hw" }; for (String name : names) { try { int drawableResource = XposedHelpers.getStaticIntField(ClassLoad.getClass(ClassNames.DRAWABLE), name); if (drawableResource != 0) { cachedIcon = drawableResource; return drawableResource; } } catch (Throwable ignored) {} } return 0; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/TeleVip/Bridge/Bridge.java ================================================ package com.my.televip.virtuals.TeleVip.Bridge; import android.content.Context; import android.util.TypedValue; import android.view.View; import com.my.televip.Class.ClassNames; import com.my.televip.base.AbstractMethodHook; import com.my.televip.dex.DexInjector; import com.my.televip.Class.ClassLoad; import com.my.televip.hooks.HMethod; import com.my.televip.settings.ui.SettingsAdapter; import com.my.televip.settings.controller.SettingsController; import com.my.televip.logging.Logger; import com.my.televip.virtuals.Theme; import com.my.televip.virtuals.ui.Cells.HeaderCell; import com.my.televip.virtuals.ui.Cells.ShadowSectionCell; import com.my.televip.virtuals.ui.Cells.TextCheckCell; import com.my.televip.virtuals.ui.Cells.TextInfoCell; import com.my.televip.virtuals.ui.Cells.TextSettingsCell; import de.robv.android.xposed.XC_MethodHook; import de.robv.android.xposed.XposedHelpers; public class Bridge { public static Object getLayoutManager(Context context){ return XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.SETTINGS_ADAPTER, DexInjector.classLoader), "getLayoutManager", context); } public static void init(Context context, SettingsController settingsController){ try { Class bridgeClass = XposedHelpers.findClassIfExists("com.televip.SettingsAdapter.Bridge", DexInjector.classLoader); Class textCheckCellClass = XposedHelpers.findClassIfExists("com.televip.SettingsAdapter.SettingsAdapter$TextCheckCellHolder", DexInjector.classLoader); Class textSettingsCellClass = XposedHelpers.findClassIfExists("com.televip.SettingsAdapter.SettingsAdapter$TextSettingsCellHolder", DexInjector.classLoader); Class headerCellClass = XposedHelpers.findClassIfExists("com.televip.SettingsAdapter.SettingsAdapter$HeaderCellHolder", DexInjector.classLoader); Class shadowSectionCellClass = XposedHelpers.findClassIfExists("com.televip.SettingsAdapter.SettingsAdapter$ShadowSectionCellHolder", DexInjector.classLoader); Class textInfoCellClass = XposedHelpers.findClassIfExists("com.televip.SettingsAdapter.SettingsAdapter$TextInfoCellHolder", DexInjector.classLoader); HMethod.hookMethod(bridgeClass, "getRow", int.class, new AbstractMethodHook() { @Override protected void beforeMethod(XC_MethodHook.MethodHookParam param) { param.setResult(SettingsAdapter.getRow((int) param.args[0])); } }); HMethod.hookMethod(bridgeClass, "log", String.class, new AbstractMethodHook() { @Override protected void beforeMethod(XC_MethodHook.MethodHookParam param) { Logger.l((String) param.args[0]); } }); HMethod.hookMethod(bridgeClass, "getRowCount", new AbstractMethodHook() { @Override protected void beforeMethod(XC_MethodHook.MethodHookParam param) { param.setResult(SettingsAdapter.getRowCount()); } }); HMethod.hookMethod(bridgeClass, "onBindViewHolder", Object.class, int.class, int.class, new AbstractMethodHook() { @Override protected void beforeMethod(XC_MethodHook.MethodHookParam param) { SettingsAdapter.onBindViewHolder(context, param.args[0], settingsController, (int) param.args[1], (int) param.args[2]); } }); TypedValue outValue = new TypedValue(); context.getTheme().resolveAttribute( android.R.attr.selectableItemBackground, outValue, true ); XposedHelpers.findAndHookConstructor(textCheckCellClass, View.class, Object.class, new AbstractMethodHook() { @Override protected void beforeMethod(XC_MethodHook.MethodHookParam param) { TextCheckCell textCheckCell = new TextCheckCell(context); textCheckCell.getView().setBackgroundColor(Theme.getBackgroundWhiteOrBlueColor()); textCheckCell.getView().setBackgroundResource(outValue.resourceId); textCheckCell.getView().setClickable(true); textCheckCell.getView().setFocusable(true); param.args[0] = textCheckCell.getView(); param.args[1] = textCheckCell.textCell; } }); XposedHelpers.findAndHookConstructor(textSettingsCellClass, View.class, Object.class, new AbstractMethodHook() { @Override protected void beforeMethod(XC_MethodHook.MethodHookParam param) { TextSettingsCell textSettingsCell = new TextSettingsCell(context); textSettingsCell.getView().setBackgroundColor(Theme.getBackgroundWhiteOrBlueColor()); textSettingsCell.getView().setBackgroundResource(outValue.resourceId); textSettingsCell.getView().setClickable(true); textSettingsCell.getView().setFocusable(true); param.args[0] = textSettingsCell.getView(); param.args[1] = textSettingsCell.textSettingsCell; } }); XposedHelpers.findAndHookConstructor(headerCellClass, View.class, Object.class, new AbstractMethodHook() { @Override protected void beforeMethod(XC_MethodHook.MethodHookParam param) { HeaderCell header = new HeaderCell(context); header.getView().setBackgroundColor(Theme.getBackgroundWhiteOrBlueColor()); param.args[0] = header.getView(); param.args[1] = header.headerCell; } }); XposedHelpers.findAndHookConstructor(shadowSectionCellClass, View.class, new AbstractMethodHook() { @Override protected void beforeMethod(XC_MethodHook.MethodHookParam param) { param.args[0] = new ShadowSectionCell(context).getView(); } }); XposedHelpers.findAndHookConstructor(textInfoCellClass, View.class, new AbstractMethodHook() { @Override protected void beforeMethod(XC_MethodHook.MethodHookParam param) { TextInfoCell textInfoCell = new TextInfoCell(context); textInfoCell.setBackgroundColor(Theme.getBackgroundGrayColor()); param.args[0] = textInfoCell; } }); } catch (Throwable e){ Logger.e(e); } } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/Theme.java ================================================ package com.my.televip.virtuals; import android.graphics.Color; import android.text.TextPaint; import com.my.televip.Class.ClassNames; import com.my.televip.Utils; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; import de.robv.android.xposed.XposedHelpers; public class Theme { public static TextPaint getTextPaint(ClassLoader classLoader) { Class theme = XposedHelpers.findClassIfExists(AutomationResolver.resolve("org.telegram.ui.ActionBar.Theme"), classLoader); List fields = new ArrayList<>(); for (Field declaredField : theme.getDeclaredFields()) if (declaredField.getName().equals(AutomationResolver.resolve("Theme", "chat_timePaint", AutomationResolver.ResolverType.Field))) fields.add(declaredField); if (!fields.isEmpty()) { try { Field textPaintField = null; for (Field field : fields) { if (field.getType().equals(TextPaint.class)) { textPaintField = field; } } if (textPaintField != null) return (TextPaint) textPaintField.get(null); else { for (Field field : fields) { if (field.getType().getName().contains("TextPaint")) { textPaintField = field; } } if (textPaintField != null) return (TextPaint) textPaintField.get(null); else Logger.w("Not found chat_timePaint field in Theme, " + Utils.issue); } } catch (IllegalAccessException e) { Logger.e(e); } } else Logger.w("Not found chat_timePaint field in Theme, " + Utils.issue); return null; } public static boolean isLight(){ return !((boolean)XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.THEME), AutomationResolver.resolve("Theme", "isCurrentThemeDark", AutomationResolver.ResolverType.Method))); } public static int getBackgroundGrayColor(){ return isLight() ? Color.rgb(241, 241, 243) : Color.rgb(21, 30, 39); } public static int getBackgroundWhiteOrBlueColor(){ return isLight() ? Color.WHITE : Color.rgb(29, 39, 51); } public static int getToolBarColor(){ return isLight() ? Color.WHITE : Color.rgb(36, 45, 57); } public static int getToolBarRippleColor(){ return isLight() ? 0x20000000 : 0x20FFFFFF; } public static int getTextToolBarColor(){ return isLight() ? Color.BLACK : Color.WHITE; } public static int getTextColor(){ return isLight() ? Color.BLACK : Color.WHITE; } public static int getTextBlueColor(){ return isLight() ? Color.rgb(100, 164, 221) : Color.rgb(112, 184, 221); } public static int getTextGrayColor(){ return isLight() ? Color.rgb(128, 128, 128) : Color.rgb(103,115,128); } public static int getArrowDrawableColor(){ return isLight() ? Color.BLACK : Color.WHITE; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/androidx/ViewHolder.java ================================================ package com.my.televip.virtuals.androidx; import android.view.View; import de.robv.android.xposed.XposedHelpers; public class ViewHolder { Object viewHolder; public ViewHolder(Object view){ viewHolder = view; } public View getItemView(){ return (View) XposedHelpers.getObjectField(viewHolder, "itemView"); } public int getAdapterPosition(){ return (int)XposedHelpers.callMethod(viewHolder, "getAdapterPosition"); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/BaseController.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class BaseController { Object baseController; public BaseController(Object obj){baseController = obj;} public UserConfig getUserConfig(){ return new UserConfig(XposedHelpers.callMethod(baseController, AutomationResolver.resolve("BaseController", "getUserConfig", AutomationResolver.ResolverType.Method))); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/DispatchQueue.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class DispatchQueue { Object dispatchQueue; public DispatchQueue(Object obj){ dispatchQueue = obj; } public void postRunnable(Runnable runnable) { XposedHelpers.callMethod(dispatchQueue, AutomationResolver.resolve("DispatchQueue", "postRunnable", AutomationResolver.ResolverType.Method), runnable); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/FileLoadOperation.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class FileLoadOperation { private final Object fileOperation; public FileLoadOperation(Object fileOperation){ this.fileOperation = fileOperation; } public void setDownloadChunkSizeBig(int v){ XposedHelpers.setIntField(fileOperation, AutomationResolver.resolve("FileLoadOperation", "downloadChunkSizeBig", AutomationResolver.ResolverType.Field), v); } public void setMaxDownloadRequests(int v){ XposedHelpers.setIntField(fileOperation, AutomationResolver.resolve("FileLoadOperation", "maxDownloadRequests", AutomationResolver.ResolverType.Field), v); } public void setMaxDownloadRequestsBig(int v){ XposedHelpers.setIntField(fileOperation, AutomationResolver.resolve("FileLoadOperation", "maxDownloadRequestsBig", AutomationResolver.ResolverType.Field), v); } public void setMaxCdnParts(int v){ XposedHelpers.setIntField(fileOperation, AutomationResolver.resolve("FileLoadOperation", "maxCdnParts", AutomationResolver.ResolverType.Field), v); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/FileLoader.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import java.io.File; import de.robv.android.xposed.XposedHelpers; public class FileLoader { Object fileLoader; public FileLoader(Object fileLoader){ this.fileLoader = fileLoader; } public File getLocalFile(ImageLocation location) { return (File) XposedHelpers.callMethod(fileLoader, AutomationResolver.resolve("FileLoader", "getLocalFile", AutomationResolver.ResolverType.Method), location.imageLocation); } public static FileLoader getInstance(int num) { return new FileLoader(XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.FILE_LOADER), AutomationResolver.resolve("FileLoader", "getInstance", AutomationResolver.ResolverType.Method), num)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/ImageLocation.java ================================================ package com.my.televip.virtuals.messenger; public class ImageLocation { public Object imageLocation; public ImageLocation(Object image){ imageLocation = image; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/ImageReceiver.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class ImageReceiver { public Object imageReceiver; public ImageReceiver(Object imageReceiver){ this.imageReceiver = imageReceiver; } public ImageLocation getImageLocation() { return new ImageLocation(XposedHelpers.callMethod(imageReceiver, AutomationResolver.resolve("ImageReceiver", "getImageLocation", AutomationResolver.ResolverType.Method))); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/LocaleController.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import java.util.Locale; import de.robv.android.xposed.XposedHelpers; public class LocaleController { Object localeController; public LocaleController(){ localeController = XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.LOCALE_CONTROLLER), AutomationResolver.resolve("LocaleController", "getInstance", AutomationResolver.ResolverType.Method)); } public Locale getCurrentLocale() { return (Locale) XposedHelpers.getObjectField(localeController, AutomationResolver.resolve("LocaleController", "currentLocale", AutomationResolver.ResolverType.Field)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/MessageObject.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.tgnet.TLRPC; import de.robv.android.xposed.XposedHelpers; public class MessageObject { static Object messageObject; public MessageObject(Object obj){ messageObject = obj; } public TLRPC.Message getMessageOwner(){ return new TLRPC.Message(XposedHelpers.getObjectField(messageObject, AutomationResolver.resolve("MessageObject","messageOwner", AutomationResolver.ResolverType.Field))); } public long getDialogId() { return (long) XposedHelpers.callMethod(messageObject, AutomationResolver.resolve("MessageObject", "getDialogId", AutomationResolver.ResolverType.Method)); } public static long getDialogId(TLRPC.Message message) { return (long) XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.MESSAGE_OBJECT), AutomationResolver.resolve("MessageObject", "getDialogId", AutomationResolver.ResolverType.Method), message.message); } public Object getMessageObject(){ return messageObject; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/MessagesController.java ================================================ package com.my.televip.virtuals.messenger; import android.content.SharedPreferences; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.tgnet.TLRPC; import de.robv.android.xposed.XposedHelpers; public class MessagesController { final Object messagesController; public MessagesController(Object instance) { this.messagesController = instance; } public void processNewDifferenceParams(int seq, int pts, int date, int pts_count) { XposedHelpers.callMethod(messagesController, AutomationResolver.resolve("MessagesController", "processNewDifferenceParams", AutomationResolver.ResolverType.Method), seq, pts, date, pts_count); } public void processNewDifferenceParams(int pts, int date, int pts_count) { //Nagram XposedHelpers.callMethod(messagesController, "processNewDifferenceParams", pts, date, pts_count); } public static Object getInputChannel(TLRPC.InputPeer peer) { return XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER), AutomationResolver.resolve("MessagesController", "getInputChannel", AutomationResolver.ResolverType.Method), peer.inputPeer); } public static SharedPreferences getGlobalMainSettings() { return (SharedPreferences) XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER), AutomationResolver.resolve("MessagesController", "getGlobalMainSettings", AutomationResolver.ResolverType.Method)); } public static Object getInputChannel(long id) { return XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER), AutomationResolver.resolve("MessagesController", "getInputChannel", AutomationResolver.ResolverType.Method), id); } public static MessagesController getInstance(int num){ return new MessagesController(XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.MESSAGES_CONTROLLER), AutomationResolver.resolve("MessagesController", "getInstance", AutomationResolver.ResolverType.Method), num)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/MessagesStorage.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.SQLite.SQLiteDatabase; import de.robv.android.xposed.XposedHelpers; public class MessagesStorage { Object messagesStorage; public MessagesStorage(Object obj) { messagesStorage = obj; } public SQLiteDatabase getDatabase() { return new SQLiteDatabase(XposedHelpers.getObjectField(messagesStorage, AutomationResolver.resolve("MessagesStorage", "database", AutomationResolver.ResolverType.Field))); } public DispatchQueue getStorageQueue() { return new DispatchQueue(XposedHelpers.callMethod(messagesStorage, AutomationResolver.resolve("MessagesStorage", "getStorageQueue", AutomationResolver.ResolverType.Method))); } public static MessagesStorage getInstance(int num) { return new MessagesStorage(XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.MESSAGES_STORAGE), AutomationResolver.resolve("MessagesStorage", "getInstance", AutomationResolver.ResolverType.Method), num)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/NotificationCenter.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class NotificationCenter { private static int messagesDeleted = -1; private static int tlSchemeParseException = -1; public static int getMessagesDeleted() { if (messagesDeleted == -1) { messagesDeleted = XposedHelpers.getStaticIntField(ClassLoad.getClass(ClassNames.NOTIFICATION_CENTER), AutomationResolver.resolve("NotificationCenter", "messagesDeleted", AutomationResolver.ResolverType.Field)); } return messagesDeleted; } public static int getTlSchemeParseException() { if (tlSchemeParseException == -1) { tlSchemeParseException = XposedHelpers.getStaticIntField(ClassLoad.getClass(ClassNames.NOTIFICATION_CENTER), AutomationResolver.resolve("NotificationCenter", "tlSchemeParseException", AutomationResolver.ResolverType.Field)); } return tlSchemeParseException; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/UserConfig.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.tgnet.TLRPC; import de.robv.android.xposed.XposedHelpers; public class UserConfig { Object userConfig; public UserConfig(Object obl){ userConfig = obl; } public static int getSelectedAccount() { String selectedAccountField = AutomationResolver.resolve("UserConfig", "selectedAccount", AutomationResolver.ResolverType.Field); return XposedHelpers.getStaticIntField(ClassLoad.getClass(ClassNames.USER_CONFIG), selectedAccountField); } public long getClientUserId(){ return XposedHelpers.getLongField(userConfig, AutomationResolver.resolve("UserConfig" , "clientUserId", AutomationResolver.ResolverType.Field)); } public TLRPC.User getCurrentUser(){ return new TLRPC.User(XposedHelpers.callMethod(userConfig, AutomationResolver.resolve("UserConfig" , "getCurrentUser", AutomationResolver.ResolverType.Method))); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/Utilities.java ================================================ package com.my.televip.virtuals.messenger; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class Utilities { public static DispatchQueue getStageQueue(){ return new DispatchQueue(XposedHelpers.getStaticObjectField(ClassLoad.getClass(ClassNames.UTILITIES), AutomationResolver.resolve("Utilities", "stageQueue", AutomationResolver.ResolverType.Field))); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/messenger/browser/Browser.java ================================================ package com.my.televip.virtuals.messenger.browser; import android.content.Context; import com.my.televip.Utils; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class Browser { public static void openUrl(Context context, String url){ XposedHelpers.callStaticMethod( XposedHelpers.findClass(AutomationResolver.resolve("org.telegram.messenger.browser.Browser"), Utils.classLoader), AutomationResolver.resolve("Browser", "openUrl", AutomationResolver.ResolverType.Method), context, url ); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/tgnet/ConnectionsManager.java ================================================ package com.my.televip.virtuals.tgnet; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class ConnectionsManager { final Object connectionsManager; public ConnectionsManager(Object instance) { this.connectionsManager = instance; } public void sendRequest(Object object, Object completionBlock) { XposedHelpers.callMethod(connectionsManager, AutomationResolver.resolve("ConnectionsManager", "sendRequest", AutomationResolver.ResolverType.Method), object, completionBlock); } public static ConnectionsManager getInstance(int num){ return new ConnectionsManager(XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.CONNECTIONS_MANAGER), AutomationResolver.resolve("ConnectionsManager", "getInstance", AutomationResolver.ResolverType.Method), num)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/tgnet/NativeByteBuffer.java ================================================ package com.my.televip.virtuals.tgnet; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class NativeByteBuffer { public final Object nativeByteBuffer; public NativeByteBuffer(Object obj){ nativeByteBuffer = obj; } public void reuse(){ XposedHelpers.callMethod(nativeByteBuffer, AutomationResolver.resolve("NativeByteBuffer", "reuse", AutomationResolver.ResolverType.Method)); } public int readInt32(boolean exception) { return (int) XposedHelpers.callMethod(nativeByteBuffer, AutomationResolver.resolve("NativeByteBuffer","readInt32", AutomationResolver.ResolverType.Method), exception); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/tgnet/RequestDelegate.java ================================================ package com.my.televip.virtuals.tgnet; import com.my.televip.Class.ClassNames; import com.my.televip.Utils; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import java.lang.reflect.Proxy; import de.robv.android.xposed.XposedHelpers; public class RequestDelegate { public Object requestDelegate; public RequestDelegate(Object obj){ requestDelegate = obj; } public void run(Object response, Object error){ XposedHelpers.callMethod(requestDelegate, AutomationResolver.resolve("RequestDelegate", "run", AutomationResolver.ResolverType.Method), response, error); } @FunctionalInterface public interface requestDelegate { void run(Object response, Object error); } public static Object run(requestDelegate lambda) { Class requestDelegateClass = ClassLoad.getClass(ClassNames.REQUEST_DELEGATE); if (requestDelegateClass != null) { return Proxy.newProxyInstance( Utils.classLoader, new Class[]{requestDelegateClass}, (proxy, method, args) -> { if (method.getParameterCount() == 2 && method.getParameterTypes()[0] == ClassLoad.getClass(ClassNames.TL_OBJECT)) { lambda.run(args[0], args[1]); } return null; } ); } return null; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/tgnet/TLRPC.java ================================================ package com.my.televip.virtuals.tgnet; import com.my.televip.Class.ClassNames; import com.my.televip.Utils; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import java.util.ArrayList; import de.robv.android.xposed.XposedHelpers; public class TLRPC { public static class Peer { private final Object peer; public Peer(Object peer) { this.peer = peer; } public long getUser_id(){ return XposedHelpers.getLongField(peer,"user_id"); } public long getChat_id(){ return XposedHelpers.getLongField(peer,"chat_id"); } public long getChannel_id(){ return XposedHelpers.getLongField(peer,"channel_id"); } } public static class User { Object user; public User(Object user) { this.user = user; } public String getPhone() { return (String) XposedHelpers.getObjectField(user, AutomationResolver.resolve("User", "phone", AutomationResolver.ResolverType.Field)); } public void setPhone(String phone){ XposedHelpers.setObjectField(user, AutomationResolver.resolve("User", "phone", AutomationResolver.ResolverType.Field), phone); } public Object getUser(){ return user; } } public static class Message { public final Object message; private int id; public Message(Object message) { this.message = message; } public int getID(){ if (id == 0){ id = XposedHelpers.getIntField(message, "id"); } return id; } public String getMessage(){ return (String) XposedHelpers.getObjectField(message, "message"); } public Peer getFrom_id(){ return new TLRPC.Peer(XposedHelpers.getObjectField(message, "from_id")); } public int getFlags(){ return XposedHelpers.getIntField(message,"flags"); } public void setFlags(int flags){ XposedHelpers.setIntField(message, "flags", flags); } public int getTtl(){ return XposedHelpers.getIntField(message,"ttl"); } public void setTtl(Object ttl){ XposedHelpers.setObjectField(message, "ttl", ttl); } public static Message TLdeserialize(NativeByteBuffer stream, int constructor, boolean exception){ return new Message(XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.TL_MESSAGE), AutomationResolver.resolve("TLRPC$Message", "TLdeserialize", AutomationResolver.ResolverType.Method), stream.nativeByteBuffer, constructor, exception)); } public void readAttachPath(NativeByteBuffer stream, long currentUserId){ XposedHelpers.callMethod(message, AutomationResolver.resolve("TLRPC$Message", "readAttachPath", AutomationResolver.ResolverType.Method), stream.nativeByteBuffer, currentUserId); } } public static class InputPeer { public final Object inputPeer; public InputPeer(Object message) { this.inputPeer = message; } public long getUser_id(){ return XposedHelpers.getLongField(inputPeer,"user_id"); } public long getChat_id(){ return XposedHelpers.getLongField(inputPeer,"chat_id"); } public long getChannel_id(){ return XposedHelpers.getLongField(inputPeer,"channel_id"); } } public static class messages_Messages { Object messages_Messages; public messages_Messages(Object messages) { messages_Messages = messages; } public ArrayList getMessages(){ return (ArrayList) XposedHelpers.getObjectField(messages_Messages, AutomationResolver.resolve("TLRPC$messages_Messages", "messages", AutomationResolver.ResolverType.Field)); } } public static class TL_updateDeleteChannelMessages { private final Object instance; public TL_updateDeleteChannelMessages(Object instance) { this.instance = instance; } public long getChannelID() { try { return XposedHelpers.getLongField(this.instance, "channel_id"); } catch (Throwable e) { Logger.e(e); } return Long.MIN_VALUE; } public ArrayList getMessages() { try { return Utils.castList(XposedHelpers.getObjectField(this.instance, "messages"), Integer.class); } catch (Throwable e) { Logger.e(e); } return null; } } public static class TL_updateDeleteMessages { private final Object instance; public TL_updateDeleteMessages(Object instance) { this.instance = instance; } public ArrayList getMessages() { try { return Utils.castList(XposedHelpers.getObjectField(this.instance, "messages"), Integer.class); } catch (Throwable e) { Logger.e(e); } return null; } } public static class TL_messages_affectedMessages { final Object instance; public TL_messages_affectedMessages() { this.instance = XposedHelpers.newInstance(ClassLoad.getClass(ClassNames.TL_MESSAGES_AFFECTED)); } public TL_messages_affectedMessages(Object instance) { this.instance = instance; } public int getPts(){ return XposedHelpers.getIntField(instance, "pts"); } public int getPtsCount(){ return XposedHelpers.getIntField(instance, "pts_count"); } public void setPts(int pts){ XposedHelpers.setIntField(instance, "pts", pts); } public void setPtsCount(int pts_count){ XposedHelpers.setIntField(instance, "pts_count", pts_count); } public Object getTL_messages_affectedMessages(){ return instance; } } public static class TL_channels_readHistory { final Object instance; public TL_channels_readHistory() { this.instance = XposedHelpers.newInstance(ClassLoad.getClass(ClassNames.TL_CHANNELS_READ_HISTORY)); } public TL_channels_readHistory(Object instance) { this.instance = instance; } public void setChannel(Object channel){ XposedHelpers.setObjectField(instance, "channel", channel); } public void setMax_id(int max_id){ XposedHelpers.setIntField(instance, "max_id", max_id); } public Object getTL_channels_readHistory(){ return instance; } } public static class TL_messages_readHistory { final Object instance; public TL_messages_readHistory() { this.instance = XposedHelpers.newInstance(ClassLoad.getClass(ClassNames.TL_MESSAGES_READ_HISTORY)); } public TL_messages_readHistory(Object instance) { this.instance = instance; } public void setPeer(InputPeer peer){ XposedHelpers.setObjectField(instance, "peer", peer.inputPeer); } public void setMax_id(int max_id){ XposedHelpers.setIntField(instance, "max_id", max_id); } public Object getTL_messages_readHistory(){ return instance; } } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/BaseFragment.java ================================================ package com.my.televip.virtuals.ui; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.messenger.UserConfig; import de.robv.android.xposed.XposedHelpers; public class BaseFragment { Object baseFragment; public BaseFragment(Object obj){ baseFragment = obj; } public UserConfig getUserConfig(){ return new UserConfig(XposedHelpers.callMethod(baseFragment, AutomationResolver.resolve("BaseFragment", "getUserConfig", AutomationResolver.ResolverType.Method))); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/Cells/ChatMessageCell.java ================================================ package com.my.televip.virtuals.ui.Cells; import android.graphics.Color; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.TextPaint; import android.text.style.ForegroundColorSpan; import com.my.televip.Class.ClassNames; import com.my.televip.Configs.ConfigManager; import com.my.televip.Utils; import com.my.televip.base.AbstractMethodHook; import com.my.televip.features.ShowDeletedMessages; import com.my.televip.hooks.HMethod; import com.my.televip.language.Keys; import com.my.televip.language.Translator; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import com.my.televip.virtuals.OfficialChatMessageCell; import com.my.televip.virtuals.Theme; import com.my.televip.virtuals.messenger.MessageObject; import com.my.televip.virtuals.tgnet.TLRPC; import de.robv.android.xposed.XposedHelpers; public class ChatMessageCell { public static boolean isEnable = false; public static MessageObject currentMessageObject; public static long lastVisibleTime = -1; public static void init() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.CHAT_MESSAGE_CELL) != null) { HMethod.hookMethod(ClassLoad.getClass(ClassNames.CHAT_MESSAGE_CELL), AutomationResolver.resolve("ChatMessageCell", "measureTime", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("measureTime", new Class[]{ClassLoad.getClass(ClassNames.MESSAGE_OBJECT)}), new AbstractMethodHook() { @Override protected void afterMethod(MethodHookParam param) { if (ConfigManager.showDeletedMessages.isEnable() || ConfigManager.showMessageId.isEnable()) { try { currentMessageObject = new MessageObject(XposedHelpers.getObjectField(param.thisObject, AutomationResolver.resolve("ChatMessageCell", "currentMessageObject", AutomationResolver.ResolverType.Field))); lastVisibleTime = System.currentTimeMillis(); Object msgObj = param.args[0]; if (msgObj == null) return; MessageObject messageObject = new MessageObject(msgObj); TLRPC.Message owner = messageObject.getMessageOwner(); if (owner == null) return; int flags = owner.getFlags(); if (ConfigManager.showMessageId.isEnable()) { if (owner.getID() != 0) { String textId = "ID " + owner.getID(); setSpannableStringBuilderText(textId, param.thisObject, false); } } if ((flags & ShowDeletedMessages.FLAG_DELETED) != 0 & ConfigManager.showDeletedMessages.isEnable()) { setSpannableStringBuilderText(Translator.get(Keys.Deleted), param.thisObject, true); } else { TextPaint paint = Theme.getTextPaint(Utils.classLoader); paint.setShadowLayer(0, 0, 0, Color.WHITE); } } catch (Throwable throwable) { Logger.e(throwable); } } } })); } } } catch (Throwable t){ Logger.e(t); } } public static SpannableStringBuilder convertToStringBuilder(CharSequence charSequence) { if (charSequence != null) return charSequence instanceof SpannableStringBuilder ? (SpannableStringBuilder) charSequence : new SpannableStringBuilder(charSequence); else return null; } private static void setSpannableStringBuilderText(String text, Object thisObject, boolean color){ OfficialChatMessageCell cell = new OfficialChatMessageCell(thisObject); SpannableStringBuilder time = convertToStringBuilder(cell.getCurrentTimeString()); if (time == null) return; SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(text); if (color) spannableStringBuilder.setSpan(new ForegroundColorSpan(Color.rgb(255, 0, 0)), 0, spannableStringBuilder.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); spannableStringBuilder.append(" "); time.insert(0, spannableStringBuilder); cell.setCurrentTimeString(time); TextPaint paint = Theme.getTextPaint(Utils.classLoader); if (paint != null) { int ceil = (int) Math.ceil(paint.measureText(spannableStringBuilder, 0, spannableStringBuilder.length())); cell.setTimeTextWidth(ceil + cell.getTimeTextWidth()); cell.setTimeWidth(ceil + cell.getTimeWidth()); } } Object chatMessageCell; public ChatMessageCell(Object cell){ chatMessageCell = cell; } public MessageObject getMessageObject() { return new MessageObject(XposedHelpers.callMethod(chatMessageCell, AutomationResolver.resolve("ChatMessageCell", "getMessageObject", AutomationResolver.ResolverType.Method))); } public Object getChatMessageCell(){ return chatMessageCell; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/Cells/HeaderCell.java ================================================ package com.my.televip.virtuals.ui.Cells; import android.content.Context; import android.view.View; import com.my.televip.Utils; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class HeaderCell { public Object headerCell; public HeaderCell(Context context){ Class headerCellClass = XposedHelpers.findClassIfExists(AutomationResolver.resolve("org.telegram.ui.Cells.HeaderCell"), Utils.classLoader); headerCell = XposedHelpers.newInstance(headerCellClass, context); } public HeaderCell(Object obj){ headerCell = obj; } public View getView(){ return (View) headerCell; } public void setText(CharSequence text){ XposedHelpers.callMethod(headerCell, AutomationResolver.resolve("HeaderCell","setText", AutomationResolver.ResolverType.Method), text); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/Cells/ShadowSectionCell.java ================================================ package com.my.televip.virtuals.ui.Cells; import android.content.Context; import android.view.View; import com.my.televip.Utils; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class ShadowSectionCell { Object shadowSectionCell; public ShadowSectionCell(Context context){ Class shadowSectionCellClass = XposedHelpers.findClassIfExists(AutomationResolver.resolve("org.telegram.ui.Cells.ShadowSectionCell"), Utils.classLoader); shadowSectionCell = XposedHelpers.newInstance(shadowSectionCellClass, context); } public View getView(){ return (View) shadowSectionCell; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/Cells/TextCheckCell.java ================================================ package com.my.televip.virtuals.ui.Cells; import android.content.Context; import android.view.View; import android.widget.TextView; import com.my.televip.Utils; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class TextCheckCell { public Object textCell; public TextCheckCell(Context context){ Class textCheckClass = XposedHelpers.findClassIfExists(AutomationResolver.resolve("org.telegram.ui.Cells.TextCheckCell"), Utils.classLoader); textCell = XposedHelpers.newInstance(textCheckClass, context); } public TextCheckCell(Object obj){ textCell = obj; } public void setTextAndValueAndCheck(CharSequence text, String value, boolean checked, boolean multiline, boolean divider){ XposedHelpers.callMethod(textCell, AutomationResolver.resolve("TextCheckCell","setTextAndValueAndCheck", AutomationResolver.ResolverType.Method), text, value, checked, multiline, divider); } public void setTextAndCheck(CharSequence text, boolean checked, boolean divider){ XposedHelpers.callMethod(textCell, AutomationResolver.resolve("TextCheckCell","setTextAndCheck", AutomationResolver.ResolverType.Method), text, checked, divider); } public void setChecked(boolean checked){ XposedHelpers.callMethod(textCell, AutomationResolver.resolve("TextCheckCell","setChecked", AutomationResolver.ResolverType.Method), checked); } public boolean isChecked(){ return (boolean) XposedHelpers.callMethod(textCell, AutomationResolver.resolve("TextCheckCell","isChecked", AutomationResolver.ResolverType.Method)); } public TextView getTextView(){ return (TextView) XposedHelpers.getObjectField(textCell,AutomationResolver.resolve("TextCheckCell","textView", AutomationResolver.ResolverType.Field)); } public View getView(){ return (View) textCell; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/Cells/TextInfoCell.java ================================================ package com.my.televip.virtuals.ui.Cells; import android.content.Context; import android.util.TypedValue; import android.view.Gravity; import android.widget.FrameLayout; import android.widget.TextView; import com.my.televip.application.AndroidUtilities; import com.my.televip.virtuals.Theme; import com.my.televip.virtuals.ui.Components.LayoutHelper; public class TextInfoCell extends FrameLayout { private final TextView textView; public TextInfoCell(Context context) { super(context); textView = new TextView(context); textView.setTextColor(Theme.getTextGrayColor()); textView.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 13); textView.setGravity(Gravity.CENTER); textView.setPadding(0, AndroidUtilities.dp(19), 0, AndroidUtilities.dp(19)); addView(textView, LayoutHelper.createFrame(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.CENTER, 17, 0, 17, 0)); } @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { super.onMeasure(MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(widthMeasureSpec), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); } public TextView getTextView() { return textView; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/Cells/TextSettingsCell.java ================================================ package com.my.televip.virtuals.ui.Cells; import android.content.Context; import android.view.View; import android.widget.TextView; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class TextSettingsCell { public Object textSettingsCell; public TextSettingsCell(Context context){ textSettingsCell = XposedHelpers.newInstance(ClassLoad.getClass(ClassNames.TEXT_SETTINGS_CELL), context); } public TextSettingsCell(Object obj){ textSettingsCell = obj; } public View getView(){ return (View) textSettingsCell; } public void setText(CharSequence text, boolean divider){ XposedHelpers.callMethod(textSettingsCell, AutomationResolver.resolve("TextSettingsCell","setText", AutomationResolver.ResolverType.Method), text, divider); } public TextView getTextView(){ return (TextView) XposedHelpers.getObjectField(textSettingsCell,AutomationResolver.resolve("TextSettingsCell","textView", AutomationResolver.ResolverType.Field)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/ChatActivity.java ================================================ package com.my.televip.virtuals.ui; import android.view.View; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.ActionBar.ActionBarMenuItem; import com.my.televip.virtuals.messenger.MessageObject; import de.robv.android.xposed.XposedHelpers; public class ChatActivity { final Object chatActivity; public ChatActivity(Object obj){ chatActivity = obj; } public MessageObject getSelectedObject(){ return new MessageObject(XposedHelpers.getObjectField(chatActivity, AutomationResolver.resolve("ChatActivity","selectedObject", AutomationResolver.ResolverType.Field))); } public ActionBarMenuItem getHeaderItem(){ return new ActionBarMenuItem(XposedHelpers.getObjectField(chatActivity, AutomationResolver.resolve("ChatActivity", "headerItem", AutomationResolver.ResolverType.Field))); } public View getPinnedMessageView(){ return (View) XposedHelpers.getObjectField(chatActivity, AutomationResolver.resolve("ChatActivity", "pinnedMessageView", AutomationResolver.ResolverType.Field)); } public void scrollToMessageId(int id, int fromMessageId, boolean select, int loadIndex, boolean forceScroll, int forcePinnedMessageId){ XposedHelpers.callMethod(chatActivity, AutomationResolver.resolve("ChatActivity", "scrollToMessageId", AutomationResolver.ResolverType.Method), id, fromMessageId, select, loadIndex, forceScroll, forcePinnedMessageId); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/Components/LayoutHelper.java ================================================ package com.my.televip.virtuals.ui.Components; import android.widget.FrameLayout; import com.my.televip.application.AndroidUtilities; public class LayoutHelper { public static final int MATCH_PARENT = -1; public static final int WRAP_CONTENT = -2; private static int getSize(float size) { return (int) (size < 0 ? size : AndroidUtilities.dp(size)); } public static FrameLayout.LayoutParams createFrame(int width, float height, int gravity, float leftMargin, float topMargin, float rightMargin, float bottomMargin) { FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(getSize(width), getSize(height), gravity); layoutParams.setMargins(AndroidUtilities.dp(leftMargin), AndroidUtilities.dp(topMargin), AndroidUtilities.dp(rightMargin), AndroidUtilities.dp(bottomMargin)); return layoutParams; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/Components/RecyclerListView.java ================================================ package com.my.televip.virtuals.ui.Components; import android.content.Context; import android.view.View; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.dex.DexInjector; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class RecyclerListView { public final Object recyclerListView; public RecyclerListView(Context context){ recyclerListView = XposedHelpers.newInstance(ClassLoad.getClass(ClassNames.SETTINGS_ADAPTER_RECYCLER_LIST_VIEW, DexInjector.classLoader), context); } public void setAdapter(Object adapter) { XposedHelpers.callMethod(recyclerListView, AutomationResolver.resolve("RecyclerListView", "setAdapter", AutomationResolver.ResolverType.Method), adapter); } public void setBackgroundColor(int color) { ((View)recyclerListView).setBackgroundColor(color); } public void setVerticalScrollBarEnabled(boolean b) { ((View)recyclerListView).setVerticalScrollBarEnabled(b); } public void setLayoutManager(Object layout) { XposedHelpers.callMethod(recyclerListView, AutomationResolver.resolve("RecyclerListView", "setLayoutManager", AutomationResolver.ResolverType.Method), layout); } public View getRecyclerListView() { return (View) recyclerListView; } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/LaunchActivity.java ================================================ package com.my.televip.virtuals.ui; import android.widget.FrameLayout; import com.my.televip.obfuscate.AutomationResolver; import de.robv.android.xposed.XposedHelpers; public class LaunchActivity { Object launchActivity; public FrameLayout frameLayout; public LaunchActivity(Object obj){ launchActivity = obj; frameLayout = (FrameLayout) XposedHelpers.getObjectField(obj, AutomationResolver.resolve("LaunchActivity","frameLayout", AutomationResolver.ResolverType.Field)); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/PhotoViewer.java ================================================ package com.my.televip.virtuals.ui; import android.app.Activity; import com.my.televip.Class.ClassNames; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.messenger.ImageReceiver; import com.my.televip.virtuals.messenger.MessageObject; import de.robv.android.xposed.XposedHelpers; public class PhotoViewer { Object photoViewer; public PhotoViewer(Object photoViewer){ this.photoViewer = photoViewer; } public static PhotoViewer getInstance(){ return new PhotoViewer(XposedHelpers.callStaticMethod(ClassLoad.getClass(ClassNames.PHOTO_VIEWER), AutomationResolver.resolve("PhotoViewer", "getInstance", AutomationResolver.ResolverType.Method))); } public void setParentActivity(Activity activity){ XposedHelpers.callMethod(photoViewer, AutomationResolver.resolve("PhotoViewer", "setParentActivity", AutomationResolver.ResolverType.Method), activity); } public void openPhoto(MessageObject messageObject, long l, long l2, long l3, PhotoViewerProvider provider, boolean b){ XposedHelpers.callMethod(photoViewer, AutomationResolver.resolve("PhotoViewer", "openPhoto", AutomationResolver.ResolverType.Method), messageObject.getMessageObject(),l, l2, l3, provider.getPhotoViewerProvider(), b); } public static class PhotoViewerProvider { Object photoViewerProvider; public PhotoViewerProvider(Object photoViewer) { photoViewerProvider = photoViewer; } public PlaceProviderObject getPlaceForPhoto(MessageObject messageObject, Object fileLocation, int index, boolean needPreview, boolean closing) { return new PlaceProviderObject(XposedHelpers.callMethod(photoViewerProvider, AutomationResolver.resolve("PhotoViewer$PhotoViewerProvider", "getPlaceForPhoto", AutomationResolver.ResolverType.Method), messageObject.getMessageObject(), fileLocation, index, needPreview, closing)); } public Object getPhotoViewerProvider() { return photoViewerProvider; } } public static class PlaceProviderObject { Object placeProviderObject; public PlaceProviderObject(Object placeProvider) { placeProviderObject = placeProvider; } public ImageReceiver getImageReceiver() { return new ImageReceiver(XposedHelpers.getObjectField(placeProviderObject, AutomationResolver.resolve("PhotoViewer$PlaceProviderObject", "imageReceiver", AutomationResolver.ResolverType.Field))); } } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/ProfileActivity.java ================================================ package com.my.televip.virtuals.ui; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.virtuals.ActionBar.ActionBarMenuItem; import de.robv.android.xposed.XposedHelpers; public class ProfileActivity { Object profileActivity; public ProfileActivity(Object obj){ profileActivity = obj; } public long getChatId(){ return XposedHelpers.getLongField(profileActivity, AutomationResolver.resolve("ProfileActivity", "chatId", AutomationResolver.ResolverType.Field)); } public long getUserId(){ return XposedHelpers.getLongField(profileActivity, AutomationResolver.resolve("ProfileActivity", "userId", AutomationResolver.ResolverType.Field)); } public Object[] getNameTextView(){ return (Object[]) XposedHelpers.getObjectField(profileActivity, AutomationResolver.resolve("ProfileActivity", "nameTextView", AutomationResolver.ResolverType.Field)); } public Object[] getOnlineTextView(){ return (Object[]) XposedHelpers.getObjectField(profileActivity, AutomationResolver.resolve("ProfileActivity", "onlineTextView", AutomationResolver.ResolverType.Field)); } public ActionBarMenuItem getOtherItem(){ return new ActionBarMenuItem(XposedHelpers.getObjectField(profileActivity, AutomationResolver.resolve("ProfileActivity", "otherItem", AutomationResolver.ResolverType.Field))); } public BaseFragment getBaseFragment(){ return new BaseFragment(profileActivity); } } ================================================ FILE: app/src/main/java/com/my/televip/virtuals/ui/SecretMediaViewer.java ================================================ package com.my.televip.virtuals.ui; import com.my.televip.Class.ClassNames; import com.my.televip.Configs.ConfigManager; import com.my.televip.base.AbstractMethodHook; import com.my.televip.features.SecretMediaSave; import com.my.televip.hooks.HMethod; import com.my.televip.Class.ClassLoad; import com.my.televip.obfuscate.AutomationResolver; import com.my.televip.logging.Logger; import com.my.televip.virtuals.messenger.FileLoader; import com.my.televip.virtuals.messenger.MessageObject; import com.my.televip.virtuals.messenger.UserConfig; import com.my.televip.virtuals.tgnet.TLRPC; import java.io.File; public class SecretMediaViewer { private static boolean isEnable = false; public static void openMedia() { try { if (!isEnable) { isEnable = true; if (ClassLoad.getClass(ClassNames.SECRET_MEDIA_VIEWER) == null) return; HMethod.hookMethod(ClassLoad.getClass(ClassNames.SECRET_MEDIA_VIEWER), AutomationResolver.resolve("SecretMediaViewer", "openMedia", AutomationResolver.ResolverType.Method), AutomationResolver.merge(AutomationResolver.resolveObject("PhotoViewer$PhotoViewerProvider", new Class[]{ClassLoad.getClass(ClassNames.MESSAGE_OBJECT), ClassLoad.getClass(ClassNames.PHOTO_VIEWER_PROVIDER), java.lang.Runnable.class, java.lang.Runnable.class}), new AbstractMethodHook() { @Override protected void beforeMethod(MethodHookParam param) { if (ConfigManager.preventMedia.isEnable() && !ConfigManager.secretMediaSave.isEnable()) { param.args[2] = null; param.args[3] = null; MessageObject messageObject = new MessageObject(param.args[0]); if (messageObject.getMessageObject() != null) { TLRPC.Message messageOwner = messageObject.getMessageOwner(); if (messageOwner.message != null) { messageOwner.setTtl(0); } } } if (ConfigManager.secretMediaSave.isEnable() && (param.args.length >= 2 || param.args[0] != null)) { MessageObject messageObject = new MessageObject(param.args[0]); PhotoViewer.PhotoViewerProvider provider = new PhotoViewer.PhotoViewerProvider(param.args[1]); final PhotoViewer.PlaceProviderObject object = provider.getPlaceForPhoto(messageObject, null, 0, true, false); if (object.getImageReceiver().imageReceiver != null) { FileLoader fileLoader = FileLoader.getInstance(UserConfig.getSelectedAccount()); File image = fileLoader.getLocalFile(object.getImageReceiver().getImageLocation()); if (image != null) { SecretMediaSave.pathImage = image; SecretMediaSave.id = messageObject.getMessageOwner().getID(); } PhotoViewer.getInstance().openPhoto(messageObject, messageObject.getDialogId(), 0L, 0L, provider, false); param.setResult(null); } } } })); } } catch (Throwable e) { Logger.e(e); } } } ================================================ FILE: app/src/main/res/drawable/baseline_arrow_back_24.xml ================================================ ================================================ FILE: app/src/main/res/drawable/ic_launcher_background.xml ================================================ ================================================ FILE: app/src/main/res/drawable/ic_launcher_foreground.xml ================================================ ================================================ FILE: app/src/main/res/drawable/messages.xml ================================================ ================================================ FILE: app/src/main/res/drawable/sync.xml ================================================ ================================================ FILE: app/src/main/res/mipmap-anydpi/ic_launcher.xml ================================================ ================================================ FILE: app/src/main/res/mipmap-anydpi/ic_launcher_round.xml ================================================ ================================================ FILE: app/src/main/res/values/arrays.xml ================================================ org.telegram.messenger org.telegram.plus com.tgconnect.android com.iMe.android com.xplus.messenger xyz.nextalone.nagram uz.unnarsx.cherrygram app.nicegram org.telegram.messenger.web org.telegram.messenger.beta org.forkclient.messenger.beta org.forkgram.messenger nu.gpu.nagram com.iMe.android.web ir.ilmili.telegraph ru.dahl.messenger nekox.messenger.broken ================================================ FILE: app/src/main/res/values/strings.xml ================================================ TeleVip ================================================ FILE: app/src/main/res/values/themes.xml ================================================