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