Showing preview only (274K chars total). Download the full file or copy to clipboard to get everything.
Repository: c-kzxvldkhX/receiptnotice
Branch: master
Commit: 15211be6b194
Files: 120
Total size: 233.8 KB
Directory structure:
gitextract_8bhqj9sl/
├── .gitattributes
├── .github/
│ ├── FUNDING.yml
│ ├── file_to_push_get_new_build
│ └── workflows/
│ └── android.yml
├── .gitignore
├── .idea/
│ ├── caches/
│ │ └── build_file_checksums.ser
│ ├── codeStyles/
│ │ └── Project.xml
│ ├── gradle.xml
│ ├── misc.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ └── vcs.xml
├── LICENSE
├── README-zh.md
├── README.md
├── app/
│ ├── .gitignore
│ ├── build.gradle
│ ├── proguard-rules.pro
│ └── src/
│ ├── main/
│ │ ├── AndroidManifest.xml
│ │ ├── assets/
│ │ │ └── web/
│ │ │ └── useragreement.html
│ │ ├── java/
│ │ │ └── com/
│ │ │ └── weihuagu/
│ │ │ └── receiptnotice/
│ │ │ ├── DatabaseHelper.java
│ │ │ ├── ForTest.java
│ │ │ ├── MainApplication.java
│ │ │ ├── NLService.java
│ │ │ ├── NotificationCollectorMonitorService.java
│ │ │ ├── NotificationHandle.java
│ │ │ ├── NotificationHandleFactory.java
│ │ │ ├── OnlyWriteToDateBase.java
│ │ │ ├── PmentayNotificationHandle.java
│ │ │ ├── ReceiptnoticeAccessibilityService.java
│ │ │ ├── TestBeanWithPostFullInformationMap.java
│ │ │ ├── action/
│ │ │ │ ├── ActionStatusBarNotification.java
│ │ │ │ ├── AsyncResponse.java
│ │ │ │ ├── HandlePost.java
│ │ │ │ ├── IDoPost.java
│ │ │ │ └── PostTask.java
│ │ │ ├── audiorecognize/
│ │ │ │ ├── AudioHub.java
│ │ │ │ └── RecordService.java
│ │ │ ├── filteringmiddleware/
│ │ │ │ ├── AlipayTransferBean.java
│ │ │ │ └── PostMapFilter.java
│ │ │ ├── pushclassification/
│ │ │ │ └── pmentay/
│ │ │ │ ├── AlipayPmentayNotificationHandle.java
│ │ │ │ ├── BankDistinguisher.java
│ │ │ │ ├── BanksProxy.java
│ │ │ │ ├── CashbarPmentayNotificationHandle.java
│ │ │ │ ├── IcbcelifePmentayNotificationHandle.java
│ │ │ │ ├── MipushPmentayNotificationHandle.java
│ │ │ │ ├── UnionpayPmentayNotificationHandle.java
│ │ │ │ ├── WechatPmentayNotificationHandle.java
│ │ │ │ └── XposedmodulePmentayNotificationHandle.java
│ │ │ ├── util/
│ │ │ │ ├── AuthorityUtil.java
│ │ │ │ ├── ByteUtil.java
│ │ │ │ ├── Constants.java
│ │ │ │ ├── DataBaseHolder.java
│ │ │ │ ├── DeviceInfoUtil.java
│ │ │ │ ├── ExternalInfoUtil.java
│ │ │ │ ├── FileLogUtil.java
│ │ │ │ ├── LogUtil.java
│ │ │ │ ├── NetUtil.java
│ │ │ │ ├── NotificationUtil.java
│ │ │ │ ├── OneFileLogItem.java
│ │ │ │ ├── OneFileUtil.java
│ │ │ │ ├── PreferenceUtil.java
│ │ │ │ ├── RandomUtil.java
│ │ │ │ ├── SSLSocketFactoryCompat.java
│ │ │ │ ├── UrlUtil.java
│ │ │ │ ├── encrypt/
│ │ │ │ │ ├── AES.java
│ │ │ │ │ ├── DES.java
│ │ │ │ │ ├── DESUtilWithIV.java
│ │ │ │ │ ├── EncryptFactory.java
│ │ │ │ │ ├── Encrypter.java
│ │ │ │ │ ├── IDataTrans.java
│ │ │ │ │ └── MD5.java
│ │ │ │ └── message/
│ │ │ │ ├── MessageConsumer.java
│ │ │ │ └── MessageSendBus.java
│ │ │ └── view/
│ │ │ ├── FileLogActivity.java
│ │ │ ├── FollowThirdAppActivity.java
│ │ │ ├── HelloFragment.java
│ │ │ ├── HomeFragmentsAdapter.java
│ │ │ ├── IllustrateDecryptActivity.java
│ │ │ ├── LogListAdapter.java
│ │ │ ├── LogListFragment.java
│ │ │ ├── MainActivity.java
│ │ │ ├── PreferenceActivity.java
│ │ │ ├── TestActiviy.java
│ │ │ └── UserAgreementActiviy.java
│ │ └── res/
│ │ ├── drawable/
│ │ │ └── ic_launcher_background.xml
│ │ ├── drawable-v24/
│ │ │ └── ic_launcher_foreground.xml
│ │ ├── layout/
│ │ │ ├── activity_followthirdapp.xml
│ │ │ ├── activity_illustratedecrypt.xml
│ │ │ ├── activity_log.xml
│ │ │ ├── activity_main.xml
│ │ │ ├── activity_test.xml
│ │ │ ├── activity_useragreement.xml
│ │ │ ├── fragment_hello.xml
│ │ │ ├── fragment_loglist.xml
│ │ │ ├── item_home_viewpage_fragment.xml
│ │ │ └── item_log_text.xml
│ │ ├── menu/
│ │ │ ├── log.xml
│ │ │ └── main.xml
│ │ ├── mipmap-anydpi-v26/
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── values/
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── styles.xml
│ │ ├── values-zh/
│ │ │ └── strings.xml
│ │ └── xml/
│ │ ├── network_security_config.xml
│ │ ├── pref_general.xml
│ │ ├── pref_headers.xml
│ │ └── receiptnoticeaccessibilityservice_config.xml
│ └── test/
│ └── java/
│ └── com/
│ └── weihuagu/
│ └── receiptnotice/
│ ├── TestBankDistinguisher.java
│ ├── TestDES.java
│ ├── TestExternalInfoUtil.java
│ └── TestOneFileUtil.java
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
app/build.gradle merge=ours
================================================
FILE: .github/FUNDING.yml
================================================
custom: ['https://weihuagu.github.io/donate/']
================================================
FILE: .github/file_to_push_get_new_build
================================================
2023/01/28
================================================
FILE: .github/workflows/android.yml
================================================
name: Android CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew assembleDebug
- name: Upload debug APK
uses: actions/upload-artifact@v1
with:
name: app
path: app/build/outputs/apk/debug/app-debug.apk
================================================
FILE: .gitignore
================================================
*.iml
.*.swp
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
/app/key.properties
================================================
FILE: .idea/codeStyles/Project.xml
================================================
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<codeStyleSettings language="XML">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
</code_scheme>
</component>
================================================
FILE: .idea/gradle.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="testRunner" value="PLATFORM" />
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
</GradleProjectSettings>
</option>
</component>
</project>
================================================
FILE: .idea/misc.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
================================================
FILE: .idea/modules.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" group="receiptnotice/app" />
<module fileurl="file://$PROJECT_DIR$/receiptnotice.iml" filepath="$PROJECT_DIR$/receiptnotice.iml" group="receiptnotice" />
</modules>
</component>
</project>
================================================
FILE: .idea/runConfigurations.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RunConfigurationProducerService">
<option name="ignoredProducers">
<set>
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
</set>
</option>
</component>
</project>
================================================
FILE: .idea/vcs.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
================================================
FILE: LICENSE
================================================
Copyright (c) 2019-2030
modified part
内容
1.每个人都可以逐字复制并且分发此协议,但不允许更改任何内容.
2.此部分所叙述之内容高于以下部分,如果和之下的原基本参考协议有所冲突,采用本部分,即modified part部分
3.禁止将本项目用于任何商业行为,任何盈利活动都属于商业用途
4.使用,分发,修改该项目,即等同同意该协议
免责声明
1.由于使用造成的损失,原项目不负法律责任
2.由于使用本项目而造成的外部损失,原项目不负担责任
Apache License part
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: README-zh.md
================================================
### 提示
- `很感谢你的使用`
- `本软件是开源不盈利软件,没有所谓的定制版,不存在任何的收费QQ群,望周知`
#### 软件规范及适用范围
- 该软件的适用范围只限于帮助个人用户获取、收集自己的收款信息,它等效于您手工的获取过程。
- 如您没有上述手工获取的权限,您将无法使用该软件。
- 不能将本项目用于商业用途。
#### 应用工作原理
- 手机安装一个app,然后这个服务监听手机收到的通知,如果是想要获取的通知,就把信息推送到指定的url去。
#### 本软件使用方法
- 安装后先将软件加入系统白名单,各个安卓系统的方法各有不同
- 打开软件自动跳转到获取通知权限页面,允许本应用监控通知
- 返回到软件主页,填写你要接受收款信息通知的url,软件在接到收款通知后,会用post的方法,发送json信息.
- 详细使用方法,参考[wiki](https://github.com/WeihuaGu/receiptnotice/wiki)
#### 这个可搭配服务端项目
|getreceipt-server |
|:-|
|[getreceipt-server](https://github.com/WeihuaGu/getreceipt-server)|
##### 捐助
[](https://donate.indiv.dynv6.net/)
##### 引用项目
| ||
|-|-|
|本软件从NLservice修改而来| [NLservice](https://github.com/WHD597312/NLservice)|
|实时logcat | [Lynx](https://github.com/pedrovgs/Lynx) |
##### 开源许可
本项目的代码,wiki等资源基于一个修改版的apache2.0 license协议发布,这意味着你可以拷贝、再发行本项目的内容, 但是你将必须:
不能将本项目用于商业用途,任何盈利活动都属于商业用途。
在延伸的代码中(修改和有源代码衍生的代码中)需要带有原来代码中的协议,商标,专利声明和其他原来作者规定需要包含的说明。
================================================
FILE: README.md
================================================
# receiptnotice
*This software is open source and not profitable software. There is no so-called customized version.There are no paid QQ groups, hope you know
*
#### Application range and specifications
- The scope of the software is limited to helping individual users to obtain and collect their own collection information, which is equivalent to your manual acquisition process.
- If you do not have the above-mentioned manual permission, you will not be able to use the software.
- This project cannot be used for commercial purposes.
#### How the software works
- Install an app on the phone, and then this service listens to the notifications received by the phone. If it receives a notification of receipt, it pushes the information to the specified URL.
#### How to use this software
- Add the software to the system whitelist after installation, each Android method is different
- Open the software to automatically jump to the Get notification permission page, allowing the app to monitor notifications
- Return to the software homepage, fill in the url you want to accept the payment information notification. After receiving the payment notification, the software will use the post method to send json information.
- For detailed usage, refer to [wiki](https://github.com/WeihuaGu/receiptnotice/wiki)
#### This works with server projects
| getreceipt-server |
|:-|
| [getreceipt-server](https://github.com/WeihuaGu/getreceipt-server) |
#### Donate
[](https://donate.indiv.dynv6.net/)
##### Reference project
| ||
|-|-|
| This software is modified from NLservice | [NLservice](https://github.com/WHD597312/NLservice) |
| Real-time logcat | [Lynx](https://github.com/pedrovgs/Lynx) |
##### Open source license
The code, wiki and other resources of this project are released under a modified version of the apache2.0 license agreement, which means that you can copy and redistribute the content of this project, but you will have to:
*This project cannot be used for commercial purposes. Any profit-making activities are commercial purposes.*
*In the extended code (modified and source code-derived code), the agreement, trademarks, patent notices, and other original author specifications need to be included in the original code.*
##### [Chinese README](https://github.com/WeihuaGu/receiptnotice/blob/master/README-zh.md)
================================================
FILE: app/.gitignore
================================================
/build
================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.weihuagu.receiptnotice"
minSdkVersion 19
targetSdkVersion 28
versionCode 16
versionName "1.5"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
signingConfigs{
debug {
}
release {
}
}
buildTypes {
debug {
}
release {
}
}
lintOptions {
abortOnError false
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.viewpager2:viewpager2:1.0.0-beta04"
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.github.wangjintao:TLog:v1.0.1'
implementation 'com.github.pedrovgs:lynx:1.1.0'
implementation 'io.socket:socket.io-client:1.0.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.jeremyliao:live-event-bus-x:1.5.7'
testImplementation 'junit:junit:4.12'
testImplementation "org.mockito:mockito-core:3.+"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation 'org.mockito:mockito-android:+'
}
================================================
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/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.weihuagu.receiptnotice">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<application
android:name=".MainApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light.NoActionBar">
<meta-data
android:name="com.google.android.actions"
android:resource="@xml/receiptnoticeaccessibilityservice_config" />
<activity android:name=".view.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".view.FileLogActivity"
android:label="@string/filelog_title">
<intent-filter>
<action android:name="com.weihuagu.receiptnotice.showfilelog" />
</intent-filter>
</activity>
<activity
android:name=".view.IllustrateDecryptActivity"
android:label="@string/illustratedecrypt_title">
<intent-filter>
<action android:name="com.weihuagu.receiptnotice.illustratedecryptmethod" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name="com.github.pedrovgs.lynx.LynxActivity" />
<activity android:name=".view.PreferenceActivity" />
<activity android:name=".view.UserAgreementActiviy" />
<activity android:name=".view.FollowThirdAppActivity">
<intent-filter>
<action android:name="com.weihuagu.receiptnotice.followthirdapp" />
</intent-filter>
</activity>
<service
android:name=".NLService"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">
<intent-filter>
<action android:name="android.service.notification.NotificationListenerService" />
</intent-filter>
</service>
<service
android:label="@string/accessibilityservicename"
android:name=".ReceiptnoticeAccessibilityService"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />
</intent-filter>
<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/receiptnoticeaccessibilityservice_config" />
</service>
<service android:name=".NotificationCollectorMonitorService" />
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
</application>
</manifest>
================================================
FILE: app/src/main/assets/web/useragreement.html
================================================
<html>
<head>
<title>用户协议</title>
</head>
<body>
<h4>软件规范及适用范围</h4>
<p>
- 该软件的适用范围只限于帮助个人用户获取、收集自己的收款信息,它等效于您手工的获取过程。
</p>
<p>
- 如您没有上述手工获取的权限,您将无法使用该软件。
</p>
<p>
- 不能将本项目用于商业用途。
</p>
</body>
</html>
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/DatabaseHelper.java
================================================
package com.weihuagu.receiptnotice;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import androidx.annotation.Nullable;
public class DatabaseHelper extends SQLiteOpenHelper {
//数据库版本号
private static Integer Version = 1;
public DatabaseHelper(@Nullable Context context, @Nullable String name, @Nullable SQLiteDatabase.CursorFactory factory, int version) {
super(context, name, factory, version);
}
@Override
public void onCreate(SQLiteDatabase db) {
String plat = "create table plat(id integer primary key autoincrement,name varchar(64),address varchar(64))";
String pushrecord = "create table pushrecord(id integer primary key autoincrement,type varchar(64),time varchar(64),title varchar(64),money varchar(64),content varchar(64))";
db.execSQL(plat);
db.execSQL(pushrecord);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/ForTest.java
================================================
package com.weihuagu.receiptnotice;
import android.app.Application;
import android.app.Notification;
import android.content.Intent;
import android.content.Context.*;
import android.app.PendingIntent;
import android.app.Notification.Builder;
import android.app.NotificationManager;
import android.widget.Toast;
import com.weihuagu.receiptnotice.action.HandlePost;
import com.weihuagu.receiptnotice.view.MainActivity;
public class ForTest {
public void makeAPostTest(String pkg, Notification notification){
//接受推送处理
NotificationHandle notihandle =new NotificationHandleFactory().getNotificationHandle(pkg,notification,new HandlePost());
if(notihandle!=null){
notihandle.printNotify();
notihandle.handleNotification();
notihandle.removeNotification();
return;
}
}
private void GenerateNotification() {
Intent intent = new Intent(MainApplication.getAppContext(), MainActivity.class);
PendingIntent pintent = PendingIntent.getActivity(MainApplication.getAppContext(), 0, intent, 0);
Builder builder = new Builder(MainApplication.getAppContext());
builder.setSmallIcon(R.drawable.ic_launcher);
builder.setTicker("这是手记状态栏提示");
builder.setWhen(System.currentTimeMillis());
builder.setContentTitle("woshi biaoti");
builder.setContentText("标题内容我是");
builder.setContentIntent(pintent);
builder.setDefaults(Notification.DEFAULT_SOUND);
builder.setDefaults(Notification.DEFAULT_LIGHTS);
// builder.getNotification();//4.0以及以下版本用这个获取notification
Notification notification = builder.build();// 4.1以及以上版本用这个
Toast.makeText(MainApplication.getAppContext(), "生成通知", 50).show();
NotificationManager manager = (NotificationManager) MainApplication.getAppContext()
.getSystemService(android.content.Context.NOTIFICATION_SERVICE);
manager.notify(23, notification);// 发出通知
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/MainApplication.java
================================================
package com.weihuagu.receiptnotice;
import android.app.Application;
import android.content.Intent;
import android.content.Context;
import android.content.IntentFilter;
import android.content.BroadcastReceiver;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.tao.admin.loglib.TLogApplication;
import com.tao.admin.loglib.IConfig;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.message.MessageSendBus;
public class MainApplication extends Application {
public static Context mContext;
private BroadcastReceiver timereceiver;
@Override
public void onCreate() {
super.onCreate();
startNotificationService();
initLogConfig();
setSomeGlobal();
setMessageBus();
setSomeThingWaitMessage();
}
private void initLogConfig(){
TLogApplication.initialize(this);
IConfig.getInstance().isShowLog(false)//是否在logcat中打印log,默认不打印
.isWriteLog(true)//是否在文件中记录,默认不记录
.tag("GoFileService");//logcat 日志过滤tag
}
private void startNotificationService(){
startService(new Intent(this, NotificationCollectorMonitorService.class));
}
private void setSomeGlobal(){
mContext = getApplicationContext();
}
public void setMessageBus(){
LiveEventBus
.config()
.supportBroadcast(this)
.lifecycleObserverAlwaysActive(true);
}
public static Context getAppContext(){
return mContext;
}
public void timeInterval(){
IntentFilter filter=new IntentFilter();
filter.addAction(Intent.ACTION_TIME_TICK);
registerReceiver(timereceiver,filter);
}
public void setSomeThingWaitMessage(){
timeInterval();
timereceiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action = intent.getAction();
if (action.equals(Intent.ACTION_TIME_TICK)) {
LogUtil.debugLog("接受到一分钟广播action_time_tick事件");
MessageSendBus.postBaseTimeInterval();
}
}
};
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/NLService.java
================================================
package com.weihuagu.receiptnotice;
import android.content.Intent;
import android.service.notification.NotificationListenerService;
import android.app.Notification;
import android.service.notification.StatusBarNotification;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import android.os.Bundle;
import android.content.SharedPreferences;
import android.content.Context;
import android.os.Build;
import android.widget.Toast;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.weihuagu.receiptnotice.action.ActionStatusBarNotification;
import com.weihuagu.receiptnotice.action.HandlePost;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.NotificationUtil;
import com.weihuagu.receiptnotice.util.PreferenceUtil;
import com.weihuagu.receiptnotice.util.message.MessageConsumer;
public class NLService extends NotificationListenerService implements ActionStatusBarNotification, MessageConsumer {
private String TAG="NLService";
private String posturl=null;
private Context context=null;
private String getPostUrl(){
PreferenceUtil preference=new PreferenceUtil(getBaseContext());
return preference.getPostUrl();
}
@Override
public void onNotificationPosted(StatusBarNotification sbn) {
// super.onNotificationPosted(sbn);
//这里只是获取了包名和通知提示信息,其他数据可根据需求取,注意空指针就行
if(getPostUrl()==null)
return;
Notification notification = sbn.getNotification();
String pkg = sbn.getPackageName();
if (notification == null) {
return;
}
Bundle extras = notification.extras;
if(extras==null)
return;
//接受推送处理
NotificationHandle notihandle =new NotificationHandleFactory().getNotificationHandle(pkg,notification,new HandlePost());
if(notihandle!=null){
notihandle.setStatusBarNotification(sbn);
notihandle.setActionStatusbar(this);
notihandle.printNotify();
notihandle.handleNotification();
notihandle.removeNotification();
return;
}
LogUtil.debugLog("-----------------");
LogUtil.debugLog("接受到通知消息");
LogUtil.debugLog("这是检测之外的其它通知");
LogUtil.debugLog("包名是"+pkg);
NotificationUtil.printNotify(notification);
LogUtil.debugLog("**********************");
}
@Override
public void onNotificationRemoved(StatusBarNotification sbn) {
if (Build.VERSION.SDK_INT >19)
super.onNotificationRemoved(sbn);
}
public void removeNotification(StatusBarNotification sbn){
PreferenceUtil preference=new PreferenceUtil(getBaseContext());
if(preference.isRemoveNotification()){
if (Build.VERSION.SDK_INT >=21)
cancelNotification(sbn.getKey());
else
cancelNotification(sbn.getPackageName(), sbn.getTag(), sbn.getId());
sendToast("receiptnotice移除了包名为"+sbn.getPackageName()+"的通知");
}
}
private void sendBroadcast(String msg) {
Intent intent = new Intent(getPackageName());
intent.putExtra("text", msg);
LocalBroadcastManager.getInstance(this).sendBroadcast(intent);
}
private void sendToast(String msg){
Toast.makeText(getApplicationContext(),msg,Toast.LENGTH_LONG).show();
}
//因为通知监听服务会长期一直运行,借助它进行一些消息的监听
public void subMessage() {
LiveEventBus
.get("get_alipay_transfer_money", TestBeanWithPostFullInformationMap.class)
.observeForever( new Observer<TestBeanWithPostFullInformationMap>() {
@Override
public void onChanged(@Nullable TestBeanWithPostFullInformationMap testpostbean) {
}
});
LiveEventBus
.get("message_finished_one_post",String[].class)
.observeForever(new Observer<String[]>() {
@Override
public void onChanged(@Nullable String[] testpostbean) {
PreferenceUtil preference=new PreferenceUtil(getBaseContext());
preference.setNumOfPush("add");
}
});
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/NotificationCollectorMonitorService.java
================================================
package com.weihuagu.receiptnotice;;
import android.app.ActivityManager;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.IBinder;
import android.os.Process;
import android.os.Build;
import android.util.Log;
import android.os.PowerManager.WakeLock;
import android.os.PowerManager;
import io.socket.client.IO;
import io.socket.client.Socket;
import java.lang.reflect.Field;
import java.util.HashMap;
import java.util.List;
import java.util.Date;
import java.util.ArrayList;
import java.util.Map;
import java.util.Random;
import java.lang.System;
import java.lang.Thread;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.net.URISyntaxException;
import java.text.SimpleDateFormat;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLSocketFactory;
import com.google.gson.Gson;
import com.weihuagu.receiptnotice.util.DeviceInfoUtil;
import com.weihuagu.receiptnotice.util.ExternalInfoUtil;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.PreferenceUtil;
import com.weihuagu.receiptnotice.util.SSLSocketFactoryCompat;
import io.socket.emitter.Emitter;
import java.util.Timer;
import java.util.TimerTask;
import okhttp3.OkHttpClient;
import okhttp3.TlsVersion;
import okhttp3.ConnectionSpec;
/**
* Created by xinghui on 9/20/16.
* <p>
* calling this in your Application's onCreate
* startService(new Intent(this, NotificationCollectorMonitorService.class));
* <p>
* BY THE WAY Don't Forget to Add the Service to the AndroidManifest.xml File.
* <service android:name=".NotificationCollectorMonitorService"/>
*/
public class NotificationCollectorMonitorService extends Service {
/**
* {@link Log#isLoggable(String, int)}
* <p>
* IllegalArgumentException is thrown if the tag.length() > 23.
*/
private static final String TAG = "NotifiCollectorMonitor";
private Timer timer=null;
private String echointerval=null;
private TimerTask echotimertask =null;
private WakeLock wl=null;
private void setWakelock() {
PreferenceUtil preference=new PreferenceUtil(getBaseContext());
if(preference.isWakelock())
obtainWakelock();
}
private void obtainWakelock() {
PowerManager pm = (PowerManager)getSystemService(
Context.POWER_SERVICE);
wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
"receiptnotice:NotificationCollectorMonitorServicewakelock");
wl.acquire();
}
private void releaseWakelock() {
if(wl!=null)
wl.release();
else
return;
}
@Override
public void onCreate() {
super.onCreate();
ensureCollectorRunning();
startEchoTimer();
setWakelock();
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return START_STICKY;
}
private boolean echoServerBySocketio(String echourl,String echojson){
Socket mSocket= EchoSocket.getInstance(echourl);
mSocket.connect();
mSocket.emit("echo",echojson);
mSocket.on(Socket.EVENT_DISCONNECT, new Emitter.Listener() {
@Override
public void call(Object... args) {
LogUtil.infoLog("socket disconnected,try start echo in 5 secend");
try{
Thread.sleep(5000);
}catch(InterruptedException e){
e.printStackTrace();
}
echoServer();
}
});
return true;
}
private String getDefaultEchoInterval(){
if (Build.VERSION.SDK_INT >= 22 )
return "300";
else
return "100";
}
private void startEchoTimer(){
PreferenceUtil preference=new PreferenceUtil(getBaseContext());
String interval=preference.getEchoInterval();
this.echointerval=(!interval.equals("") ? interval:getDefaultEchoInterval());
this.echotimertask=returnEchoTimerTask();
this.timer=new Timer();
int intervalmilliseconds = Integer.parseInt(this.echointerval)*1000;
LogUtil.infoLog("now socketio timer milliseconds:"+intervalmilliseconds);
timer.schedule(echotimertask,5*1000,intervalmilliseconds);
}
private TimerTask returnEchoTimerTask(){
return new TimerTask() {
@Override
public void run() {
if(!isIntervalMatchPreference()){
restartEchoTimer();
return;
}
LogUtil.debugLog("once socketio timer task run");
boolean flag= echoServer();
if(!flag)
LogUtil.debugLog("socketio timer task not have a server");
}
};
}
private void restartEchoTimer(){
if (this.timer != null) {
this.timer.cancel();
this.timer = null;
}
if (echotimertask != null) {
echotimertask.cancel();
echotimertask = null;
}
LogUtil.debugLog("restart echo timer task");
startEchoTimer();
}
private boolean isIntervalMatchPreference(){
PreferenceUtil preference=new PreferenceUtil(getBaseContext());
String interval=preference.getEchoInterval();
if(interval.equals(""))
return true;
if(interval.equals(this.echointerval))
return true;
return false;
}
private boolean echoServer(){
PreferenceUtil preference=new PreferenceUtil(getBaseContext());
Gson gson = new Gson();
if(preference. isEcho()&&(preference.getEchoServer()!=null)){
Date date = new Date(System.currentTimeMillis());
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String time = format.format(date);
DeviceBean device = new DeviceBean();
String deviceid = preference.getDeviceid();
deviceid = (!deviceid.equals("") ? deviceid : DeviceInfoUtil.getUniquePsuedoID());
device.setDeviceid(deviceid);
device.setTime(time);
LogUtil.debugLog("start connect socketio");
//////////////
Map devicemap = DeviceBeanReflect(device);
if(devicemap==null)
return false;
if (preference.getEchoCustomOption().equals("") == false) {
Map custompostoption = ExternalInfoUtil.getCustomOption(preference.getEchoCustomOption());
if (custompostoption != null) {
LogUtil.debugLogWithJava("echo custom option map"+custompostoption.toString());
if(custompostoption.size()>0)
devicemap.putAll(custompostoption);
}
}
echoServerBySocketio(preference.getEchoServer(), gson.toJson(devicemap));
LogUtil.debugLog(gson.toJson(devicemap));
return true;
}
else
return false;
}
private void ensureCollectorRunning() {
ComponentName collectorComponent = new ComponentName(this, /*NotificationListenerService Inheritance*/ NLService.class);
Log.v(TAG, "ensureCollectorRunning collectorComponent: " + collectorComponent);
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
boolean collectorRunning = false;
List<ActivityManager.RunningServiceInfo> runningServices = manager.getRunningServices(Integer.MAX_VALUE);
if (runningServices == null ) {
Log.w(TAG, "ensureCollectorRunning() runningServices is NULL");
return;
}
for (ActivityManager.RunningServiceInfo service : runningServices) {
if (service.service.equals(collectorComponent)) {
Log.w(TAG, "ensureCollectorRunning service - pid: " + service.pid + ", currentPID: " + Process.myPid() + ", clientPackage: " + service.clientPackage + ", clientCount: " + service.clientCount
+ ", clientLabel: " + ((service.clientLabel == 0) ? "0" : "(" + getResources().getString(service.clientLabel) + ")"));
if (service.pid == Process.myPid() /*&& service.clientCount > 0 && !TextUtils.isEmpty(service.clientPackage)*/) {
collectorRunning = true;
}
}
}
if (collectorRunning) {
Log.d(TAG, "ensureCollectorRunning: collector is running");
return;
}
Log.d(TAG, "ensureCollectorRunning: collector not running, reviving...");
toggleNotificationListenerService();
}
private void toggleNotificationListenerService() {
Log.d(TAG, "toggleNotificationListenerService() called");
ComponentName thisComponent = new ComponentName(this, /*getClass()*/ NLService.class);
PackageManager pm = getPackageManager();
pm.setComponentEnabledSetting(thisComponent, PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
pm.setComponentEnabledSetting(thisComponent, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
}
@Override
public IBinder onBind(Intent intent) {
return null;
}
public class DeviceBean{
public String deviceid;
public String connectedtime;
public void setDeviceid(String deviceid){
this.deviceid=deviceid;
}
public void setTime(String time){
this.connectedtime=time;
}
}
public Map DeviceBeanReflect(DeviceBean e){
Class cls = e.getClass();
Field[] fields = cls.getDeclaredFields();
Map<String, String> devicebeanmap = new HashMap<String, String>();
for(int i=0; i<fields.length; i++){
Field f = fields[i];
f.setAccessible(true);
try {
devicebeanmap.put((String) f.getName(), (String) f.get(e));
//System.out.println("属性名:" + f.getName() + " 属性值:" + f.get(e));
}catch (Exception ee){
//LogUtil.debugLogWithJava(ee.getStackTrace().toString());
return devicebeanmap;
}
}
return devicebeanmap;
}
public static class EchoSocket{
private static Socket instance1=null;
private static Socket instance2=null;
private static Socket instance3=null;
private static final int maxCount = 3;
private EchoSocket(){
}
public static Socket getThisInstance(int i){
if(i==1)
return EchoSocket.instance1;
if(i==2)
return EchoSocket.instance2;
if(i==3)
return EchoSocket.instance3;
else
return null;
}
public static Socket getInstance(String socketserverurl){
Random random = new Random();
int current = random.nextInt(maxCount)+1;
if(getThisInstance(current)==null){
synchronized(EchoSocket.class){
if(current==1)
instance1=getIOSocket(socketserverurl);
if(current==2)
instance2=getIOSocket(socketserverurl);
if(current==3)
instance3=getIOSocket(socketserverurl);
}
}
return getThisInstance(current);
}
public static Socket getIOSocket(String socketserverurl){
try{
if (Build.VERSION.SDK_INT >= 22 ){
return IO.socket(socketserverurl);
}
else{
SSLSocketFactory factory = new SSLSocketFactoryCompat();
ConnectionSpec cs = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.tlsVersions(TlsVersion.TLS_1_2)
.build();
List<ConnectionSpec> specs = new ArrayList<>();
specs.add(cs);
specs.add(ConnectionSpec.COMPATIBLE_TLS);
specs.add(ConnectionSpec.CLEARTEXT);
OkHttpClient client = new OkHttpClient.Builder()
.sslSocketFactory(factory)
.connectionSpecs(specs)
.build();
IO.setDefaultOkHttpWebSocketFactory(client);
IO.setDefaultOkHttpCallFactory(client);
// set as an option
IO.Options opts = new IO.Options();
opts.callFactory = client;
opts.webSocketFactory = client;
return IO.socket(socketserverurl, opts);
}
}catch(URISyntaxException e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
LogUtil.debugLog(sw.toString());
return null;
}catch (KeyManagementException e) {
e.printStackTrace();
return null;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
}
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/NotificationHandle.java
================================================
package com.weihuagu.receiptnotice;
import android.app.Notification;
import android.app.PendingIntent;
import android.os.Bundle;
import android.service.notification.StatusBarNotification;
import com.weihuagu.receiptnotice.action.ActionStatusBarNotification;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.NotificationUtil;
import java.text.SimpleDateFormat;
import java.util.Date;
public abstract class NotificationHandle {
protected String pkgtype;
protected Notification notification;
protected Bundle extras;
protected String title;
protected String content;
protected String notitime;
protected IDoPost postpush;
protected ActionStatusBarNotification actionstatusbar;
public StatusBarNotification sbn;
public NotificationHandle(String rawpkgtype, Notification rawnotification, IDoPost rawpostpush){
pkgtype=rawpkgtype;
notification=rawnotification;
postpush=rawpostpush;
extras=notification.extras;
// 获取通知标题
title = extras.getString(Notification.EXTRA_TITLE, "");
// 获取通知内容
content = extras.getString(Notification.EXTRA_TEXT, "");
long when=notification.when;
Date date=new Date(when);
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
notitime=format.format(date);
}
public void setStatusBarNotification(StatusBarNotification sbn){
this.sbn=sbn;
}
public void setActionStatusbar(ActionStatusBarNotification actionstatusbar){
this.actionstatusbar=actionstatusbar;
}
public abstract void handleNotification();
protected void removeNotification(){
if(actionstatusbar==null|sbn==null)
return ;
actionstatusbar.removeNotification(sbn);
}
protected void printNotify(){
LogUtil.debugLog("-----------------");
LogUtil.debugLog("接受到app消息");
LogUtil.debugLog("包名是"+this.pkgtype);
NotificationUtil.printNotify(notification);
LogUtil.debugLog("**********************");
}
protected void openNotify(){
PendingIntent pendingIntent = notification.contentIntent;
try{
pendingIntent.send();
}catch(PendingIntent.CanceledException e){
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/NotificationHandleFactory.java
================================================
package com.weihuagu.receiptnotice;
import android.app.Notification;
import android.provider.Telephony.Sms;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.pushclassification.pmentay.AlipayPmentayNotificationHandle;
import com.weihuagu.receiptnotice.pushclassification.pmentay.BanksProxy;
import com.weihuagu.receiptnotice.pushclassification.pmentay.CashbarPmentayNotificationHandle;
import com.weihuagu.receiptnotice.pushclassification.pmentay.IcbcelifePmentayNotificationHandle;
import com.weihuagu.receiptnotice.pushclassification.pmentay.MipushPmentayNotificationHandle;
import com.weihuagu.receiptnotice.pushclassification.pmentay.UnionpayPmentayNotificationHandle;
import com.weihuagu.receiptnotice.pushclassification.pmentay.WechatPmentayNotificationHandle;
import com.weihuagu.receiptnotice.pushclassification.pmentay.XposedmodulePmentayNotificationHandle;
public class NotificationHandleFactory{
public PmentayNotificationHandle getNotificationHandle(String pkg, Notification notification, IDoPost postpush){
//mipush
if("com.xiaomi.xmsf".equals(pkg)){
return new MipushPmentayNotificationHandle("com.xiaomi.xmsf",notification,postpush);
}
//支付宝
if("com.eg.android.AlipayGphone".equals(pkg)){
return new AlipayPmentayNotificationHandle("com.eg.android.AlipayGphone",notification,postpush);
}
//应用管理GCM代收
if("android".equals(pkg)){
return new XposedmodulePmentayNotificationHandle("github.tornaco.xposedmoduletest",notification,postpush);
}
//微信
if("com.tencent.mm".equals(pkg)){
return new WechatPmentayNotificationHandle("com.tencent.mm",notification,postpush);
}
//收钱吧
if("com.wosai.cashbar".equals(pkg)){
return new CashbarPmentayNotificationHandle("com.wosai.cashbar",notification,postpush);
}
//云闪付
if("com.unionpay".equals(pkg)){
return new UnionpayPmentayNotificationHandle("com.unionpay",notification,postpush);
}
//工银商户之家
if("com.icbc.biz.elife".equals(pkg)){
return new IcbcelifePmentayNotificationHandle("com.icbc.biz.elife",notification,postpush);
}
//接到短信
if(getMessageAppPkg().equals(pkg)){
return new BanksProxy(getMessageAppPkg(),notification,postpush);
}
return null;
}
private String getMessageAppPkg(){
return Sms.getDefaultSmsPackage(MainApplication.getAppContext());
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/OnlyWriteToDateBase.java
================================================
package com.weihuagu.receiptnotice;
import java.util.Map;
import com.weihuagu.receiptnotice.util.DataBaseHolder;
import com.google.gson.Gson;
public class OnlyWriteToDateBase {
DataBaseHolder database = DataBaseHolder.getInstance();
public void onePostWriteToDateBase(String postjson){
Gson gson=new Gson();
Map<String,String> postmap=gson.fromJson(postjson,Map.class);
String type=postmap.get("type");
String time=postmap.get("time");
String title=postmap.get("title");
String money=postmap.get("money");
String content=postmap.get("content");
checkHavePlatName(type);
}
public boolean checkHavePlatName(String plattype){
database.sqliteDatabase.query("plat",new String[]{"name"},plattype,null,null,null,null);
return false;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/PmentayNotificationHandle.java
================================================
package com.weihuagu.receiptnotice;
import android.app.Notification;
import android.service.notification.StatusBarNotification;
import com.weihuagu.receiptnotice.action.ActionStatusBarNotification;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.NotificationUtil;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public abstract class PmentayNotificationHandle extends NotificationHandle{
protected ActionStatusBarNotification actionstatusbar;
public StatusBarNotification sbn;
public PmentayNotificationHandle(String pkgtype, Notification notification, IDoPost postpush){
super(pkgtype, notification, postpush);
}
public void setStatusBarNotification(StatusBarNotification sbn){
this.sbn=sbn;
}
public void setActionStatusbar(ActionStatusBarNotification actionstatusbar){
this.actionstatusbar=actionstatusbar;
}
protected String extractMoney(String content){
Pattern pattern = Pattern.compile("(收款|收款¥|向你付款|向您付款|入账|到帐)(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?元");
Matcher matcher = pattern.matcher(content);
List<String> list = new ArrayList<>();
while(matcher.find()){
list.add(matcher.group());
}
if(list.size()>0){
String tmp=list.get(list.size()-1);
System.out.println(tmp);
Pattern patternnum = Pattern.compile("(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?");
Matcher matchernum = patternnum.matcher(tmp);
if(matchernum.find())
return matchernum.group();
return null;
}else
return null;
}
protected boolean predictIsPost(String content){
Pattern pattern = Pattern.compile("(收到|收款|向你付款|向您付款|入账)(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?元");
Matcher matcher = pattern.matcher(content);
if(matcher.find())
return true;
else
return false;
}
protected void removeNotification(){
if(actionstatusbar==null|sbn==null)
return ;
if(predictIsPost(content))
actionstatusbar.removeNotification(sbn);
}
protected void printNotify(){
LogUtil.debugLog("-----------------");
LogUtil.debugLog("接受到支付类app消息");
LogUtil.debugLog("包名是"+this.pkgtype);
NotificationUtil.printNotify(this.notification);
LogUtil.debugLog("**********************");
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/ReceiptnoticeAccessibilityService.java
================================================
package com.weihuagu.receiptnotice;
import android.accessibilityservice.AccessibilityService;
import android.accessibilityservice.GestureDescription;
import android.app.KeyguardManager;
import android.content.Context;
import android.graphics.Path;
import android.os.Build;
import android.os.PowerManager;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.WindowManager;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityNodeInfo;
import android.view.accessibility.AccessibilityWindowInfo;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.weihuagu.receiptnotice.filteringmiddleware.AlipayTransferBean;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.message.MessageConsumer;
import com.weihuagu.receiptnotice.util.message.MessageSendBus;
import java.util.LinkedList;
import java.util.List;
import java.util.Queue;
public class ReceiptnoticeAccessibilityService extends AccessibilityService implements MessageConsumer {
PowerManager pm=null;
String TAG="onAccessibilityEvent";
private PowerManager.WakeLock mWakeLock = null;
private KeyguardManager mKeyguardManager;
private KeyguardManager.KeyguardLock kl;
private String lastpoststr = "";
private String lastnotistr = "";
private Queue<String> poststrqueue = new LinkedList<String>();
private void setLastPostStr(String str){
lastpoststr=str;
}
private void setLastNotiStr(String str){
lastnotistr=str;
}
@Override
public void onServiceConnected(){
debugLogWithDeveloper("accessibility service connected");
subMessage();
pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mKeyguardManager = (KeyguardManager) getSystemService(Context.KEYGUARD_SERVICE);
kl = mKeyguardManager.newKeyguardLock("myapp:kllock");
}
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
debugLogWithDeveloper( event.toString());
final int eventType = event.getEventType();
//根据事件回调类型进行处理
switch (eventType) {
//当通知栏发生改变时
case AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED:
break;
//当窗口的状态发生改变时
case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
String className = event.getClassName().toString();
getAlipayTransferInfo(className);
break;
}
}
@Override
public void onInterrupt() {
debugLogWithDeveloper( "oninterrupt");
}
private void mockSwipe(){
if(Build.VERSION.SDK_INT >= 24) {
//获取屏幕中心点坐标
WindowManager wm = (WindowManager) MainApplication.getAppContext()
.getSystemService(Context.WINDOW_SERVICE);
DisplayMetrics dm = new DisplayMetrics();
wm.getDefaultDisplay().getMetrics(dm);
int width = dm.widthPixels;
int height = dm.heightPixels;
int cx = width/2;
int cy = height / 2;
final Path path = new Path();
path.moveTo(cx, cy); //滑动的起始位置,例如屏幕的中心点X、Y
path.lineTo(cx, 0); //需要滑动的位置,如从中心点滑到屏幕的顶部
GestureDescription.Builder builder = new GestureDescription.Builder();
GestureDescription gestureDescription = builder.addStroke(
new GestureDescription.StrokeDescription(path, 100, 400)
).build(); //移动到中心点,100ms后开始滑动,滑动的时间持续400ms,可以调整
dispatchGesture(gestureDescription, new GestureResultCallback() {
@Override
//如果滑动成功,会回调如下函数,可以在下面记录是否滑动成功,滑动成功或失败都要关闭该路径笔画
public void onCompleted(GestureDescription gestureDescription) {
super.onCompleted(gestureDescription);
Log.d(TAG, "swipe success.");
path.close();
}
@Override
public void onCancelled(GestureDescription gestureDescription) {
super.onCancelled(gestureDescription);
Log.d(TAG, " swipe fail.");
path.close();
}
},null);
}
}
public void subMessage(){
LiveEventBus
.get("action_request_return", String.class)
.observeForever( new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
LogUtil.debugLog("收到订阅消息:action_request_return " + s);
if(s.equals("return")){
performGlobalAction(GLOBAL_ACTION_BACK);
}
}
});
LiveEventBus
.get("action_request_home", String.class)
.observeForever( new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
LogUtil.debugLog("收到订阅消息:action_request_home " + s);
if(s.equals("home")){
performGlobalAction(GLOBAL_ACTION_HOME);
}
}
});
LiveEventBus
.get("message_noti_alipay_transfer_arrive", String.class)
.observeForever( new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
LogUtil.debugLog("收到订阅消息:message_noti_alipay_transfer_arrive " + s);
wakeAndUnlock(true);
setLastNotiStr(s);
}
});
LiveEventBus
.get("update_laststr", String.class)
.observeForever( new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
LogUtil.debugLog("收到订阅消息:update_laststr " + s);
poststrqueue.offer(s);
setLastPostStr(s);
}
});
}
public void getAlipayTransferInfo(String classname){
String transnumid="com.alipay.mobile.chatapp:id/biz_desc";
String transremarkid="com.alipay.mobile.chatapp:id/biz_title";
debugLogWithDeveloper( ":窗口状态改变,类名为"+classname);
if(classname.equals("com.alipay.mobile.chatapp.ui.PersonalChatMsgActivity_")){
mockSwipe();
AccessibilityNodeInfo nodepersonalchat=null;
AccessibilityWindowInfo windowInfopersonalchat=null;
if(pm.isScreenOn()) {
nodepersonalchat= getRootInActiveWindow();
}else {
if(Build.VERSION.SDK_INT >= 21) {
windowInfopersonalchat = getWindows().get(1);
nodepersonalchat=windowInfopersonalchat.getRoot();
}
}
if (nodepersonalchat== null) {
return;
}
// 找到领取红包的点击事件
try {
List<AccessibilityNodeInfo> list = nodepersonalchat.findAccessibilityNodeInfosByViewId(transnumid);
AccessibilityNodeInfo thelastnode= list.get(list.size() - 1);
String transnum = thelastnode.getText().toString();
List<AccessibilityNodeInfo> remarklist=thelastnode.getParent().findAccessibilityNodeInfosByViewId(transremarkid);
String transremark=remarklist.get(remarklist.size()-1).getText().toString();
debugLogWithDeveloper(":金额为" + transnum);
debugLogWithDeveloper(":备注为" + transremark);
AlipayTransferBean transferbean=new AlipayTransferBean();
transferbean.setNum(transnum);
transferbean.setRemark(transremark);
if(!poststrqueue.poll().equals(lastnotistr))
MessageSendBus.postMessageWithget_alipay_transfer_money(transferbean);
}catch (ArrayIndexOutOfBoundsException e){
}
}
}
public void debugLogWithDeveloper(String info){
Log.d(TAG,info);
}
/**
* 唤醒屏幕和解锁
* @param unLock 是否点亮屏幕
*/
private void wakeAndUnlock(boolean unLock)
{
if(unLock)
{
//若为黑屏状态则唤醒屏幕
if(!pm.isScreenOn()) {
//获取电源管理器对象,ACQUIRE_CAUSES_WAKEUP这个参数能从黑屏唤醒屏幕
mWakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "myapp:bright");
//点亮屏幕
mWakeLock.acquire();
kl.disableKeyguard();
Log.i("QHB", "亮屏");
}
}
else
{
//若之前唤醒过屏幕则释放使屏幕不保持常亮
if(mWakeLock != null) {
mWakeLock.release();
mWakeLock = null;
Log.i("QHB", "锁屏");
}
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/TestBeanWithPostFullInformationMap.java
================================================
package com.weihuagu.receiptnotice;
import java.util.Map;
public class TestBeanWithPostFullInformationMap {
private String posturl;
private Map<String,String> infomap;
private String pkg;
public String getPosturl() {
return posturl;
}
public void setPosturl(String posturl) {
this.posturl = posturl;
}
public Map<String, String> getInfomap() {
return infomap;
}
public void setInfomap(Map<String, String> infomap) {
this.infomap = infomap;
}
public String getPkg() {
return pkg;
}
public void setPkg(String pkg) {
this.pkg = pkg;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/ActionStatusBarNotification.java
================================================
package com.weihuagu.receiptnotice.action;
import android.service.notification.StatusBarNotification;
public interface ActionStatusBarNotification{
public void removeNotification(StatusBarNotification sbn);
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/AsyncResponse.java
================================================
package com.weihuagu.receiptnotice.action;
import java.util.List;
import java.util.Map;
public interface AsyncResponse {
public void onDataReceivedSuccess(String[] returnstr);
public void onDataReceivedFailed(String[] returnstr,Map<String ,String> postedmap);
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/HandlePost.java
================================================
package com.weihuagu.receiptnotice.action;
import android.content.SharedPreferences;
import com.weihuagu.receiptnotice.MainApplication;
import com.weihuagu.receiptnotice.OnlyWriteToDateBase;
import com.weihuagu.receiptnotice.filteringmiddleware.PostMapFilter;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.PreferenceUtil;
import com.weihuagu.receiptnotice.util.RandomUtil;
import com.weihuagu.receiptnotice.util.message.MessageSendBus;
import java.util.Map;
public class HandlePost implements IDoPost, AsyncResponse {
protected String posturl=null;
public HandlePost() {
getPostUrl();
}
protected String getPostUrl(){
PreferenceUtil preference=new PreferenceUtil(MainApplication.getAppContext());
posturl=preference.getPostUrl();
return posturl;
}
@Override
public void doPost(Map<String, String> params) {
if(this.posturl==null|params==null)
return;
LogUtil.debugLog("开始准备进行post");
if(params.get("repeatnum")!=null){
doPostTask(params,null);
return;
}
PreferenceUtil preference=new PreferenceUtil(MainApplication.getAppContext());
PostMapFilter mapfilter=new PostMapFilter(preference,params,this.posturl);
Map<String, String> recordmap=mapfilter.getLogMap();
Map<String, String> postmap=mapfilter.getPostMap();
doPostTask(postmap,recordmap);
}
protected void doPostTask(Map<String, String> postmap,Map<String, String> recordmap){
PostTask mtask = new PostTask();
String tasknum= RandomUtil.getRandomTaskNum();
mtask.setRandomTaskNum(tasknum);
mtask.setOnAsyncResponse(this);
if(recordmap!=null)
LogUtil.postRecordLog(tasknum,recordmap.toString());
else
LogUtil.postRecordLog(tasknum,postmap.toString());
mtask.execute(postmap);
}
@Override
public void onDataReceivedSuccess(String[] returnstr) {
LogUtil.debugLog("Post Receive-returned post string");
LogUtil.debugLog(returnstr[2]);
LogUtil.postResultLog(returnstr[0],returnstr[1],returnstr[2]);
MessageSendBus.postMessageWithFinishedonePost(returnstr);
new OnlyWriteToDateBase().onePostWriteToDateBase(returnstr[2]);
}
@Override
public void onDataReceivedFailed(String[] returnstr, Map<String, String> postedmap) {
// TODO Auto-generated method stub
LogUtil.debugLog("Post Receive-post error");
LogUtil.postResultLog(returnstr[0],returnstr[1],returnstr[2]);
PreferenceUtil preference=new PreferenceUtil(MainApplication.getAppContext());
if(preference.isPostRepeat()){
String repeatlimit=preference.getPostRepeatNum();
int limitnum=Integer.parseInt(repeatlimit);
String repeatnumstr=postedmap.get("repeatnum");
int repeatnum=Integer.parseInt(repeatnumstr);
if(repeatnum<=limitnum)
doPost(postedmap);
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/IDoPost.java
================================================
package com.weihuagu.receiptnotice.action;
import java.util.Map;
public interface IDoPost{
public void doPost(Map<String, String> params);
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/PostTask.java
================================================
package com.weihuagu.receiptnotice.action;
import android.os.AsyncTask;
import java.util.Map;
import java.util.HashMap;
import java.io.IOException;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import java.util.Iterator;
import android.util.Log;
import com.weihuagu.receiptnotice.util.NetUtil;
import com.weihuagu.receiptnotice.util.UrlUtil;
public class PostTask extends AsyncTask<Map<String, String>, Void, String[]> {
public AsyncResponse asyncResponse;
public static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
public String TAG="NLService";
public String randomtasknum;
public Map<String ,String> recordpostmap;
private NetUtil netutil=new NetUtil();
public void setRandomTaskNum(String num){
this.randomtasknum=num;
}
OkHttpClient client = new OkHttpClient();
//fuck 竟然不导包找不到个好的map转json的
public String map2Json(Map<String,String> map){
String mapjson="";
Iterator<Map.Entry<String, String>> entries = map.entrySet().iterator();
while (entries.hasNext()) {
Map.Entry<String, String> entry = entries.next();
mapjson=mapjson+'"'+entry.getKey()+'"' + ":"+'"'+entry.getValue()+'"'+",";
}
int strlength=(int)mapjson.length();
mapjson=mapjson.substring(0,(strlength-1));
mapjson="{"+mapjson+"}";
return mapjson;
}
public void setOnAsyncResponse(AsyncResponse asyncResponse)
{
this.asyncResponse = asyncResponse;
}
@Override
protected String[] doInBackground(Map<String,String> ... key) {
recordpostmap=key[0];
Map<String ,String> postmap=new HashMap<String,String>();
postmap.putAll(key[0]);
if(postmap==null)
return null;
String url = postmap.get("url");
if(url==null)
return null;
String[] resultstr=new String[3];
resultstr[0]=this.randomtasknum;
postmap.remove("url");
String protocol= UrlUtil.httpOrHttps(url);
String postjson=map2Json(postmap);
if("http".equals(protocol)){
try{
Log.d(TAG,"post task url:"+url);
Log.d(TAG,"post task postjson:"+postjson);
String returnstr=netutil.httppost(url,postjson);
resultstr[1]="true";
resultstr[2]=returnstr;
return resultstr;
}catch(IOException e){}
}
if("https".equals(protocol)){
try{
Log.d(TAG,"post task url:"+url);
Log.d(TAG,"post task postjson:"+postjson);
String returnstr=netutil.httpspost(url,postjson);
resultstr[1]="true";
resultstr[2]=returnstr;
return resultstr;
}catch(IOException e){}
}
return null;
}
@Override
protected void onPostExecute(String[] resultstr) {
super.onPostExecute(resultstr);
if (resultstr != null)
{
asyncResponse.onDataReceivedSuccess(resultstr);//将结果传给回调接口中的函数
}
else {
String [] errstr=new String[3];
errstr[0]=this.randomtasknum;
errstr[1]="false";
errstr[2]="";
if(recordpostmap.get("repeatnum")!=null){
String repeatnumstr=recordpostmap.get("repeatnum");
int num=Integer.parseInt(repeatnumstr)+1;
recordpostmap.put("repeatnum",String.valueOf(num));
//key 存在
}
else
recordpostmap.put("repeatnum","1");
asyncResponse.onDataReceivedFailed(errstr,recordpostmap);
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/audiorecognize/AudioHub.java
================================================
package com.weihuagu.receiptnotice.audiorecognize;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.HashSet;
import android.media.AudioFormat;
import android.media.AudioRecord;
import android.media.MediaRecorder.AudioSource;
public class AudioHub {
private boolean isRecord = false;
private final static int sampleRate = 8000;
private static int channelConfig = AudioFormat.CHANNEL_IN_STEREO;
private int bufferSize = 0;
private int bufferSizeInBytes =AudioRecord.getMinBufferSize(sampleRate,
channelConfig, AudioFormat.ENCODING_PCM_16BIT);
private final AudioRecord recorder;
public AudioHub() throws IOException{
bufferSize=bufferSizeInBytes;
recorder = new AudioRecord(
AudioSource.VOICE_RECOGNITION, sampleRate,
AudioFormat.CHANNEL_IN_MONO,
AudioFormat.ENCODING_PCM_16BIT, bufferSizeInBytes);
if (recorder.getState() == AudioRecord.STATE_UNINITIALIZED) {
recorder.release();
throw new IOException(
"Failed to initialize recorder. Microphone might be already in use.");
}
}
private void startRecord() {
recorder.startRecording();
// 让录制状态为true
isRecord = true;
// 开启音频文件写入线程
new Thread(new AudioRecordThread()).start();
}
private void stopRecord() {
close();
}
private void close() {
if (recorder != null) {
System.out.println("stopRecord");
isRecord = false;
recorder.stop();
recorder.release();//释放资源
}
}
private void getRecordData(){
short[] buffer = new short[bufferSize];
recorder.read(buffer, 0, buffer.length); // Skip the first buffer, usually zeroes
}
class AudioRecordThread implements Runnable {
@Override
public void run() {
getRecordData();//往文件中写入裸数据
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/audiorecognize/RecordService.java
================================================
package com.weihuagu.receiptnotice.audiorecognize;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;;import androidx.annotation.Nullable;
public class RecordService extends Service {
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
try {
AudioHub hub=new AudioHub();
}catch (Exception e){
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/filteringmiddleware/AlipayTransferBean.java
================================================
package com.weihuagu.receiptnotice.filteringmiddleware;
public class AlipayTransferBean {
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
private String num;
private String remark;
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/filteringmiddleware/PostMapFilter.java
================================================
package com.weihuagu.receiptnotice.filteringmiddleware;
import com.weihuagu.receiptnotice.util.DeviceInfoUtil;
import com.weihuagu.receiptnotice.util.ExternalInfoUtil;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.PreferenceUtil;
import com.weihuagu.receiptnotice.util.encrypt.EncryptFactory;
import com.weihuagu.receiptnotice.util.encrypt.Encrypter;
import com.weihuagu.receiptnotice.util.encrypt.MD5;
import java.util.HashMap;
import java.util.Map;
public class PostMapFilter {
private Map<String, String> unmodifiedmap;
private PreferenceUtil preference;
private String posturl;
public PostMapFilter(PreferenceUtil preference, Map<String, String> unmodifiedmap, String posturl) {
this.preference = preference;
this.unmodifiedmap = unmodifiedmap;
this.posturl = posturl;
}
public String getDeviceid() {
String deviceid = preference.getDeviceid();
if (deviceid.equals(""))
deviceid = DeviceInfoUtil.getUniquePsuedoID();
else if (preference.isAppendDeviceiduuid())
deviceid = deviceid + '-' + DeviceInfoUtil.getUniquePsuedoID();
else
deviceid = deviceid;
return deviceid;
}
public Map getPostMap() {
Map<String, String> postmap = new HashMap<String, String>();
postmap.putAll(getLogMap());
postmap.put("sign",new MD5().getSignMd5(postmap.get("type"),postmap.get("money")));
if (preference.isEncrypt()) {
String encrypt_type = preference.getEncryptMethod();
if (encrypt_type != null) {
String key = preference.getPasswd();
EncryptFactory encryptfactory = new EncryptFactory(key);
LogUtil.debugLog("加密方法" + encrypt_type);
LogUtil.debugLog("加密秘钥" + key);
Encrypter encrypter = encryptfactory.getEncrypter(encrypt_type);
if (encrypter != null && key != null) {
postmap = encrypter.transferMapValue(postmap);
postmap.put("url", this.posturl);
if (preference.isSkipEncryptDeviceid())
postmap.put("deviceid", getDeviceid());
}
}
} else
postmap.put("encrypt", "0");
return postmap;
}
public Map getLogMap() {
Map<String, String> recordmap = new HashMap<String, String>();
recordmap.putAll(this.unmodifiedmap);
recordmap.put("url", this.posturl);
recordmap.put("deviceid", getDeviceid());
if (preference.getCustomOption().equals("") == false) {
Map custompostoption = ExternalInfoUtil.getCustomPostOption(preference.getCustomOption());
if (custompostoption != null)
recordmap.putAll(custompostoption);
}
return recordmap;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/AlipayPmentayNotificationHandle.java
================================================
package com.weihuagu.receiptnotice.pushclassification.pmentay;
import android.app.Notification;
import androidx.annotation.Nullable;
import androidx.lifecycle.Observer;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.weihuagu.receiptnotice.filteringmiddleware.AlipayTransferBean;
import com.weihuagu.receiptnotice.util.AuthorityUtil;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.MainApplication;
import com.weihuagu.receiptnotice.util.message.MessageConsumer;
import com.weihuagu.receiptnotice.util.message.MessageSendBus;
import com.weihuagu.receiptnotice.PmentayNotificationHandle;
import java.util.Map;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class AlipayPmentayNotificationHandle extends PmentayNotificationHandle implements MessageConsumer {
Map<String,String> tmppostmap=new HashMap<String,String>();
public AlipayPmentayNotificationHandle(String pkgtype, Notification notification, IDoPost postpush){
super(pkgtype,notification,postpush);
}
public void handleNotification(){
if(title.contains("支付宝") | title.contains("收钱码") | title.contains("收款通知")){
//不可将转账判断延后放,以防止通过昵称虚构金额
if(content.contains("向你转了1笔钱")){
transfercodePush();
return ;
}
if(content.contains("成功收款") | content.contains("向你付款")){
collectioncodePush(true);
return ;
}
}
if(isInfoHideInTitle()){
collectioncodePush(false);
return ;
}
}
private void transfercodePush(){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type","alipay-transfer");
postmap.put("time",notitime);
postmap.put("title","转账");
postmap.put("money","-0.00");
postmap.put("content",content);
postmap.put("transferor",whoTransferred(content));
//use acceesbility service to get info
if (AuthorityUtil.isAccessibilitySettingsOn(MainApplication.getAppContext())) {
tmppostmap.putAll(postmap);
subMessage();
//open notify
MessageSendBus.postMessageWithReceiptAlipayTransfer(tmppostmap.get("time")+tmppostmap.get("content"));
this.openNotify();
return ;
}
postpush.doPost(postmap);
return ;
}
private void collectioncodePush(boolean isinfoincontent){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type","alipay");
postmap.put("time",notitime);
postmap.put("title","支付宝支付");
if(isinfoincontent){
postmap.put("money",extractMoney(content));
postmap.put("content",content);
}else
{
postmap.put("money",extractMoney(title));
postmap.put("content",title);
}
postpush.doPost(postmap);
return ;
}
private boolean isInfoHideInTitle(){
if(title.contains("成功收款")&&content.contains("立即查看"))
return true;
return false;
}
private String whoTransferred(String content){
Pattern pattern = Pattern.compile("(.*)(已成功向你转了)");
Matcher matcher = pattern.matcher(content);
if(matcher.find()){
String tmp=matcher.group(1);
return tmp;
}
else
return "";
}
public void subMessage() {
LiveEventBus
.get("get_alipay_transfer_money", AlipayTransferBean.class)
.observeForever( new Observer<AlipayTransferBean>() {
@Override
public void onChanged(@Nullable AlipayTransferBean transfer) {
if(tmppostmap.size()==0)
return;
LogUtil.debugLog("收到订阅消息:get_alipay_transfer_money " + "money"+transfer.getNum()+"备注"+transfer.getRemark());
MessageSendBus.postActionRequestWithReturn();
MessageSendBus.postActionRequestWithHome();
tmppostmap.put("money",transfer.getNum());
tmppostmap.put("remark",transfer.getRemark());
MessageSendBus.postMessageWithUpdateTheLastPostString(tmppostmap.get("time")+tmppostmap.get("content"));
postpush.doPost(tmppostmap);
tmppostmap=new HashMap<String,String>();
return;
}
});
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/BankDistinguisher.java
================================================
package com.weihuagu.receiptnotice.pushclassification.pmentay;
import com.weihuagu.receiptnotice.util.ExternalInfoUtil;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Stack;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.text.ParseException;
import java.util.Date;
public class BankDistinguisher{
public BankDistinguisher(){
}
public String distinguishByNum(String num){
Map <String, String> map= ExternalInfoUtil.getBanksMessageNum();
String whatsback=map.get(num);
if(whatsback!=null)
return whatsback;
else
return "";
}
public String distinguishByMessageContent(String content){
if(content.contains("银行")&&ExternalInfoUtil.containsBankmessageFeature(content))
{
Stack<String> alternativebank = new Stack<String>();
Map <String,String> map=ExternalInfoUtil.getAllBanksNameMap();
for (String key : map.keySet()) {
if(content.contains(key))
alternativebank.push(key);
}
if(alternativebank.isEmpty())
return "";
else
return map.get(alternativebank.peek());
}
else
return null;
}
public String extractMoney(String content){
Pattern pattern = Pattern.compile("(收入|存入|转入|入账)(\\(.*\\))?(\\d{1,3}(,\\d{2,3})*(\\.\\d{0,2})?)元?");
Matcher matcher = pattern.matcher(content);
if(matcher.find()){
String tmp=matcher.group();
Pattern patternnum = Pattern.compile("((\\d{1,3}(,\\d{2,3})*(\\.\\d{0,2})?))");
Matcher matchernum = patternnum.matcher(tmp);
if(matchernum.find())
return matchernum.group();
return null;
}else
return null;
}
public String extractCardNum(String content){
String pattern = "(尾号\\d{4}的?(卡|账号|账户))";
Pattern r = Pattern.compile(pattern);
Matcher m = r.matcher(content);
if(m.find())
return m.group();
else
return "";
}
public String extractTime(String content,String time){
Pattern pattern = Pattern.compile("([0-9]|0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])");
Matcher matcher = pattern.matcher(content);
if(matcher.find()){
try {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm");
Date date = df.parse(time);
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY,Integer.parseInt(matcher.group(1)));
calendar.set(Calendar.MINUTE,Integer.parseInt(matcher.group(2)));
return df.format(calendar.getTime());
} catch (ParseException e) {
return time;
}
}else
return time;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/BanksProxy.java
================================================
package com.weihuagu.receiptnotice.pushclassification.pmentay;
import android.app.Notification;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.PmentayNotificationHandle;
import java.util.Map;
import java.util.HashMap;
public class BanksProxy extends PmentayNotificationHandle {
private BankDistinguisher onedistinguisher=new BankDistinguisher();
public BanksProxy(String pkgtype, Notification notification, IDoPost postpush){
super(pkgtype,notification,postpush);
}
private String getBankType(){
return onedistinguisher.distinguishByMessageContent(content);
}
public void handleNotification(){
String banktype=getBankType();
if(banktype==null)
return;
String type=null;
if(banktype=="")
type="message-bank";
else
type="message-bank-"+banktype;
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type",type);
postmap.put("time",onedistinguisher.extractTime(content,notitime));
postmap.put("title","短信银行卡入账");
postmap.put("phonenum",title);
postmap.put("money",onedistinguisher.extractMoney(content));
postmap.put("cardnum",onedistinguisher.extractCardNum(content));
postmap.put("content",content);
postpush.doPost(postmap);
return ;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/CashbarPmentayNotificationHandle.java
================================================
package com.weihuagu.receiptnotice.pushclassification.pmentay;
import android.app.Notification;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.PmentayNotificationHandle;
import java.util.Map;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CashbarPmentayNotificationHandle extends PmentayNotificationHandle {
public CashbarPmentayNotificationHandle(String pkgtype, Notification notification, IDoPost postpush){
super(pkgtype,notification,postpush);
}
public void handleNotification(){
if(title.contains("收钱吧")){
if(content.contains("成功收款") | content.contains("向你付款")){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type",getCashbarType(content));
postmap.put("time",notitime);
postmap.put("title","支付宝支付");
postmap.put("money",extractMoney(content));
postmap.put("content",content);
postpush.doPost(postmap);
return ;
}
}
}
private String getCashbarType(String content){
Pattern pattern = Pattern.compile("(来自)(微信|支付宝|.*)");
Matcher matcher = pattern.matcher(content);
if(matcher.find()){
String tmp=matcher.group(2);
return "cashbar-"+transType(tmp);
}else
return "";
}
private String transType(String chinesetype){
if(chinesetype.equals("微信"))
return "wechat";
if(chinesetype.equals("支付宝"))
return "alipay";
else return chinesetype;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/IcbcelifePmentayNotificationHandle.java
================================================
package com.weihuagu.receiptnotice.pushclassification.pmentay;
import android.app.Notification;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.PmentayNotificationHandle;
import java.util.Map;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class IcbcelifePmentayNotificationHandle extends PmentayNotificationHandle {
public IcbcelifePmentayNotificationHandle(String pkgtype, Notification notification, IDoPost postpush){
super(pkgtype,notification,postpush);
}
public void handleNotification(){
if(title.contains("工银商户")){
if(content.contains("已收到")&&content.contains("元")){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type","icbcelife");
postmap.put("time",notitime);
postmap.put("title","工银商户之家");
postmap.put("money",extractMoney(content));
postmap.put("content",content);
postpush.doPost(postmap);
return ;
}
}
}
@Override
protected String extractMoney(String content){
Pattern pattern = Pattern.compile("(收到|收款|向你付款)(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?元");
Matcher matcher = pattern.matcher(content);
if(matcher.find()){
String tmp=matcher.group();
Pattern patternnum = Pattern.compile("(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?");
Matcher matchernum = patternnum.matcher(tmp);
if(matchernum.find())
return matchernum.group();
return null;
}else
return null;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/MipushPmentayNotificationHandle.java
================================================
package com.weihuagu.receiptnotice.pushclassification.pmentay;
import android.app.Notification;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.PmentayNotificationHandle;
import java.util.Map;
import java.util.HashMap;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MipushPmentayNotificationHandle extends PmentayNotificationHandle {
public MipushPmentayNotificationHandle(String pkgtype, Notification notification, IDoPost postpush){
super(pkgtype,notification,postpush);
}
public void handleNotification(){
if(title.contains("支付宝")){
if(content.contains("成功收款")){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type","alipay");
postmap.put("time",notitime);
postmap.put("title","支付宝支付");
postmap.put("money",extractMoney(content));
postmap.put("content",content);
postpush.doPost(postmap);
return ;
}
if(content.contains("向你转了1笔钱")){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type","alipay-transfer");
postmap.put("time",notitime);
postmap.put("title","转账");
postmap.put("money","-0.00");
postmap.put("content",content);
postmap.put("transferor",whoTransferred(content));
postpush.doPost(postmap);
return ;
}
}
if(title.contains("动账通知")){
if(content.contains("入账")&&content.contains("尾号为")){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type","unionpay");
postmap.put("time",notitime);
postmap.put("title","云闪付扫码收款");
postmap.put("money",extractMoney(content));
postmap.put("content",content);
//postmap.put("payer",getPayer(content));
postpush.doPost(postmap);
return ;
}
}
}
private String getPayer(String content){
Pattern pattern = Pattern.compile("(.*)(通过扫码向您付款)");
Matcher matcher = pattern.matcher(content);
if(matcher.find()){
String tmp=matcher.group(2);
return tmp;
}else
return "";
}
private String whoTransferred(String content){
Pattern pattern = Pattern.compile("(.*)(已成功向你转了)");
Matcher matcher = pattern.matcher(content);
if(matcher.find()){
String tmp=matcher.group(1);
return tmp;
}
else
return "";
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/UnionpayPmentayNotificationHandle.java
================================================
package com.weihuagu.receiptnotice.pushclassification.pmentay;
import android.app.Notification;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.PmentayNotificationHandle;
import java.util.Map;
import java.util.HashMap;
public class UnionpayPmentayNotificationHandle extends PmentayNotificationHandle {
public UnionpayPmentayNotificationHandle(String pkgtype, Notification notification, IDoPost postpush){
super(pkgtype,notification,postpush);
}
public void handleNotification(){
if(title.contains("消息推送")&&content.contains("云闪付收款")){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type","unionpay");
postmap.put("time",notitime);
postmap.put("title",title);
postmap.put("money",extractMoney(content));
postmap.put("content",content);
postpush.doPost(postmap);
return ;
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/WechatPmentayNotificationHandle.java
================================================
package com.weihuagu.receiptnotice.pushclassification.pmentay;
import android.app.Notification;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.PmentayNotificationHandle;
import java.util.Map;
import java.util.HashMap;
public class WechatPmentayNotificationHandle extends PmentayNotificationHandle {
public WechatPmentayNotificationHandle(String pkgtype, Notification notification, IDoPost postpush){
super(pkgtype,notification,postpush);
}
public void handleNotification(){
if(title.contains("微信支付")|title.contains("微信收款")){
if(content.contains("收款")){
Map<String, String> postmap = new HashMap<String, String>();
postmap.put("type", "wechat");
postmap.put("time", notitime);
postmap.put("title", title);
postmap.put("money", extractMoney(content));
postmap.put("content", content);
postpush.doPost(postmap);
return;
}
if(content.contains("二维码赞赏")){
Map<String, String> postmap = new HashMap<String, String>();
postmap.put("type", "wechat-sponsor");
postmap.put("time", notitime);
postmap.put("title", title);
postmap.put("money", extractMoney(content));
postmap.put("content", content);
postpush.doPost(postmap);
return;
}
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/XposedmodulePmentayNotificationHandle.java
================================================
package com.weihuagu.receiptnotice.pushclassification.pmentay;
import android.app.Notification;
import com.weihuagu.receiptnotice.action.IDoPost;
import com.weihuagu.receiptnotice.PmentayNotificationHandle;
import java.util.Map;
import java.util.HashMap;
public class XposedmodulePmentayNotificationHandle extends PmentayNotificationHandle {
public XposedmodulePmentayNotificationHandle(String pkgtype, Notification notification, IDoPost postpush){
super(pkgtype,notification,postpush);
}
public void handleNotification(){
if(content.contains("微信支付")&&content.contains("收款")){
Map<String,String> postmap=new HashMap<String,String>();
postmap.put("type","wechat");
postmap.put("time",notitime);
postmap.put("title","微信支付");
postmap.put("money",extractMoney(content));
postmap.put("content",content);
postpush.doPost(postmap);
return ;
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/AuthorityUtil.java
================================================
package com.weihuagu.receiptnotice.util;
import android.content.Context;
import android.provider.Settings;
import android.text.TextUtils;
public class AuthorityUtil {
public static boolean isAccessibilitySettingsOn(Context mContext) {
int accessibilityEnabled = 0;
final String service = "com.weihuagu.receiptnotice/com.weihuagu.receiptnotice.ReceiptnoticeAccessibilityService";
boolean accessibilityFound = false;
try {
accessibilityEnabled = Settings.Secure.getInt(
mContext.getApplicationContext().getContentResolver(),
android.provider.Settings.Secure.ACCESSIBILITY_ENABLED);
} catch (Settings.SettingNotFoundException e) {
}
TextUtils.SimpleStringSplitter mStringColonSplitter = new TextUtils.SimpleStringSplitter(':');
if (accessibilityEnabled == 1) {
LogUtil.debugLog("***ACCESSIBILIY IS ENABLED*** -----------------");
String settingValue = Settings.Secure.getString(
mContext.getApplicationContext().getContentResolver(),
Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
if (settingValue != null) {
TextUtils.SimpleStringSplitter splitter = mStringColonSplitter;
splitter.setString(settingValue);
while (splitter.hasNext()) {
String accessabilityService = splitter.next();
LogUtil.debugLog("绑定的accessabilityService :: " + accessabilityService);
if (accessabilityService.equalsIgnoreCase(service)) {
return true;
}
}
}
} else {
LogUtil.debugLog("***ACCESSIBILIY IS DISABLED***");
}
return accessibilityFound;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/ByteUtil.java
================================================
/*
*下面两个自己字节的函数源自GcsSloop
*GitHub: https://github.com/GcsSloop
*/
package com.weihuagu.receiptnotice.util;
public class ByteUtil {
/**
* 二进位组转十六进制字符串
*
* @param buf 二进位组
* @return 十六进制字符串
*/
public static String parseByte2HexStr(byte buf[]) {
StringBuilder sb = new StringBuilder();
for (byte b : buf) {
String hex = Integer.toHexString(b & 0xFF);
if (hex.length() == 1) {
hex = '0' + hex;
}
sb.append(hex.toUpperCase());
}
return sb.toString();
}
/**
* 十六进制字符串转二进位组
*
* @param hexStr 十六进制字符串
* @return 二进位组
*/
public static byte[] parseHexStr2Byte(String hexStr) {
if (hexStr.length() < 1) return null;
byte[] result = new byte[hexStr.length() / 2];
for (int i = 0; i < hexStr.length() / 2; i++) {
int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16);
int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), 16);
result[i] = (byte) (high * 16 + low);
}
return result;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/Constants.java
================================================
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
* Copyright (c) 2017
* All right reserved.
*/
package com.weihuagu.receiptnotice.util;
public class Constants {
/**
* Actions.
*/
public static final String ACTION_BROWSER_CONTEXT_MENU = "ACTION_BROWSER_OPEN";
/**
* Extras.
*/
public static final String EXTRA_ID = "EXTRA_ID";
public static final String EXTRA_ACTION_ID = "EXTRA_ACTION_ID";
public static final String EXTRA_NEW_TAB = "EXTRA_NEW_TAB";
public static final String EXTRA_LABEL = "EXTRA_LABEL";
public static final String EXTRA_URL = "EXTRA_URL";
public static final String EXTRA_FOLDER_ID = "EXTRA_FOLDER_ID";
public static final String EXTRA_HIT_TEST_RESULT = "EXTRA_HIT_TEST_RESULT";
public static final String EXTRA_INCOGNITO = "EXTRA_INCOGNITO";
/**
* Specials urls.
*/
public static final String URL_ABOUT_BLANK = "about:blank";
public static final String URL_ABOUT_START = "about:start";
public static final String URL_ABOUT_TUTORIAL = "about:tutorial";
/**
* User agents
*/
public static final String USER_AGENT_ANDROID = "";
public static final String USER_AGENT_DESKTOP = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24";
/**
* Preferences.
*/
public static final String PREFERENCE_HOME_PAGE = "PREFERENCE_HOME_PAGE";
public static final String PREFERENCE_SEARCH_URL = "PREFERENCE_SEARCH_URL";
public static final String PREFERENCE_START_PAGE_LIMIT = "PREFERENCE_START_PAGE_LIMIT";
public static final String PREFERENCE_BUBBLE_POSITION = "PREFERENCE_BUBBLE_POSITION";
public static final String PREFERENCE_TOOLBARS_AUTOHIDE_DURATION = "PREFERENCE_TOOLBARS_AUTOHIDE_DURATION";
public static final String PREFERENCES_SWITCH_TABS_METHOD = "PREFERENCES_SWITCH_TABS_METHOD";
public static final String PREFERENCE_ENABLE_JAVASCRIPT = "PREFERENCE_ENABLE_JAVASCRIPT";
public static final String PREFERENCE_ENABLE_IMAGES = "PREFERENCE_ENABLE_IMAGES";
public static final String PREFERENCE_USE_WIDE_VIEWPORT = "PREFERENCE_USE_WIDE_VIEWPORT";
public static final String PREFERENCE_LOAD_WITH_OVERVIEW = "PREFERENCE_LOAD_WITH_OVERVIEW";
public static final String PREFERENCE_USER_AGENT = "PREFERENCE_USER_AGENT";
public static final String PREFERENCE_PLUGINS = "PREFERENCE_PLUGINS";
public static final String PREFERENCE_ACCEPT_COOKIES = "PREFERENCE_ACCEPT_COOKIES";
public static final String PREFERENCE_ENABLE_GEOLOCATION = "PREFERENCE_ENABLE_GEOLOCATION";
public static final String PREFERENCE_REMEMBER_FORM_DATA = "PREFERENCE_REMEMBER_FORM_DATA";
public static final String PREFERENCE_REMEMBER_PASSWORDS = "PREFERENCE_REMEMBER_PASSWORDS";
public static final String PREFERENCE_HISTORY_SIZE = "PREFERENCE_HISTORY_SIZE";
public static final String PREFERENCE_CLEAR_CACHE = "PREFERENCE_CLEAR_CACHE";
public static final String PREFERENCE_WEBSITES_SETTINGS = "PREFERENCE_WEBSITES_SETTINGS";
public static final String PREFERENCE_SSL_EXCEPTIONS = "PREFERENCE_SSL_EXCEPTIONS";
public static final String PREFERENCE_CLEAR_HISTORY = "PREFERENCE_CLEAR_HISTORY";
public static final String PREFERENCE_CLEAR_COOKIES = "PREFERENCE_CLEAR_COOKIES";
public static final String PREFERENCE_CLEAR_GEOLOCATION = "PREFERENCE_CLEAR_GEOLOCATION";
public static final String PREFERENCE_CLEAR_FORM_DATA = "PREFERENCE_CLEAR_FORM_DATA";
public static final String PREFERENCE_CLEAR_PASSWORDS = "PREFERENCE_CLEAR_PASSWORDS";
public static final String PREFERENCE_INCOGNITO_BY_DEFAULT = "PREFERENCE_INCOGNITO_BY_DEFAULT";
public static final String PREFERENCE_TEXT_SCALING = "PREFERENCE_TEXT_SCALING";
public static final String PREFERENCE_MINIMUM_FONT_SIZE = "PREFERENCE_MINIMUM_FONT_SIZE";
public static final String PREFERENCE_INVERTED_DISPLAY = "PREFERENCE_INVERTED_DISPLAY";
public static final String PREFERENCE_INVERTED_DISPLAY_CONTRAST = "PREFERENCE_INVERTED_DISPLAY_CONTRAST";
public static final String PREFERENCE_BOOKMARKS_SORT_MODE = "PREFERENCE_BOOKMARKS_SORT_MODE";
public static final String PREFERENCE_FULL_SCREEN = "PREFERENCE_FULL_SCREEN";
public static final String PREFERENCE_RESTORE_TABS = "PREFERENCE_RESTORE_TABS";
public static final String PREFERENCE_UI_TYPE = "PREFERENCE_UI_TYPE";
public static final String PREFERENCE_CLOSE_PANEL_ON_NEW_TAB = "PREFERENCE_CLOSE_PANEL_ON_NEW_TAB";
public static final String PREFERENCE_JS_LOG_ON_LOGCAT = "PREFERENCE_JS_LOG_ON_LOGCAT";
/**
* Technical preferences.
*/
public static final String TECHNICAL_PREFERENCE_LAST_HISTORY_TRUNCATION = "TECHNICAL_PREFERENCE_LAST_HISTORY_TRUNCATION";
public static final String TECHNICAL_PREFERENCE_FIRST_RUN = "TECHNICAL_PREFERENCE_FIRST_RUN";
public static final String TECHNICAL_PREFERENCE_LAST_RUN_VERSION_CODE = "TECHNICAL_PREFERENCE_LAST_RUN_VERSION_CODE";
public static final String TECHNICAL_PREFERENCE_ADDON_ENABLED = "TECHNICAL_PREFERENCE_ADDON_ENABLED_";
public static final String TECHNICAL_PREFERENCE_SAVED_TABS = "TECHNICAL_PREFERENCE_SAVED_TABS";
public static final String TECHNICAL_PREFERENCE_HOMEPAGE_URL_UPDATE_NEEDED = "TECHNICAL_PREFERENCE_HOMEPAGE_URL_UPDATE_NEEDED";
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/DataBaseHolder.java
================================================
package com.weihuagu.receiptnotice.util;
import android.database.sqlite.SQLiteDatabase;
import com.weihuagu.receiptnotice.DatabaseHelper;
import com.weihuagu.receiptnotice.MainApplication;
public class DataBaseHolder {
//创建 SingleObject 的一个对象
private static DataBaseHolder instance = new DataBaseHolder();
public DatabaseHelper dbHelper;
public SQLiteDatabase sqliteDatabase;
//让构造函数为 private,这样该类就不会被实例化
private DataBaseHolder(){
createDataBase();
}
//获取唯一可用的对象
public static DataBaseHolder getInstance(){
return instance;
}
private void createDataBase(){
dbHelper = new DatabaseHelper(MainApplication.getAppContext(),"receiptnotice",null,1);
sqliteDatabase = dbHelper.getWritableDatabase();
}
public SQLiteDatabase getDateBase(){
return sqliteDatabase;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/DeviceInfoUtil.java
================================================
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
*/
package com.weihuagu.receiptnotice.util;
import android.os.Build;
import java.util.UUID;
public class DeviceInfoUtil {
/**
* Return pseudo unique ID
* @return ID
*/
public static String getUniquePsuedoID() {
// If all else fails, if the user does have lower than API 9 (lower
// than Gingerbread), has reset their device or 'Secure.ANDROID_ID'
// returns 'null', then simply the ID returned will be solely based
// off their Android device information. This is where the collisions
// can happen.
// Thanks http://www.pocketmagic.net/?p=1662!
// Try not to use DISPLAY, HOST or ID - these items could change.
// If there are collisions, there will be overlapping data
String m_szDevIDShort = "35" + (Build.BOARD.length() % 10) + (Build.BRAND.length() % 10) + (Build.CPU_ABI.length() % 10) + (Build.DEVICE.length() % 10) + (Build.MANUFACTURER.length() % 10) + (Build.MODEL.length() % 10) + (Build.PRODUCT.length() % 10);
// Thanks to @Roman SL!
// http://stackoverflow.com/a/4789483/950427
// Only devices with API >= 9 have android.os.Build.SERIAL
// http://developer.android.com/reference/android/os/Build.html#SERIAL
// If a user upgrades software or roots their device, there will be a duplicate entry
String serial = null;
try {
serial = android.os.Build.class.getField("SERIAL").get(null).toString();
// Go ahead and return the serial for api => 9
return new UUID(m_szDevIDShort.hashCode(), serial.hashCode()).toString();
} catch (Exception exception) {
// String needs to be initialized
serial = "serial"; // some value
}
// Thanks @Joe!
// http://stackoverflow.com/a/2853253/950427
// Finally, combine the values we have found by using the UUID class to create a unique identifier
return new UUID(m_szDevIDShort.hashCode(), serial.hashCode()).toString();
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/ExternalInfoUtil.java
================================================
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
* Copyright (c) 2017
* All right reserved.
*/
package com.weihuagu.receiptnotice.util;
import java.util.Map;
import java.util.HashMap;
public class ExternalInfoUtil {
/**
*
* 中国银行:106573095566、777795566;
招商银行:1065795555、10657559555、1065502010095555;
建设银行:106573095533、80095533;
工商银行:95588;62019558;010095588;
民生银行:10657109095568000、1069088895568;
农业银行:106366695599、6201395599;
华夏银行:1065800895577、1069088895577;
交通银行:106573095559、777795559、555595559000、80095559、
788895559、797995559
*
* */
public final static Map bankmessagenum = new HashMap() {{
put("95588", "icbc");
put("62019558", "icbc");
put("010095588", "icbc");
put("106573095566", "boc");
put("777795566", "boc");
put("1065795555", "cmb");
put("10657559555", "cmb");
put("1065502010095555", "cmb");
put("106573095533", "ccb");
put("80095533", "ccb");
put("10657109095568000", "cmbc");
put("1069088895568", "cmbc");
}};
public final static Map banksname = new HashMap() {{
put("工商银行", "icbc");
put("农业银行", "abc");
put("中国银行", "boc");
put("建设银行", "ccb");
put("邮政储蓄银行", "psbc");
put("招商银行", "cbm");
put("浦发银行", "spdb");
put("兴业银行", "cib");
put("民生银行", "cmbc");
put("光大银行", "ceb");
put("网商银行", "my");
put("北京银行", "bob");
}};
public final static String [] maybankmessagefeature = new String[]{
"收入",
"存入",
"转入",
"入账",
"来帐"
};
public static Map getBanksMessageNum(){
return bankmessagenum;
}
public static Map getAllBanksNameMap(){
return banksname;
}
public static String[] getBankmessageFeature(){
return maybankmessagefeature;
}
public static boolean containsBankmessageFeature(String content){
for(String x : maybankmessagefeature){
if(content.contains(x))
return true;
}
return false;
}
public static Map getCustomPostOption(String custom){
return getCustomOption(custom);
}
public static Map getCustomOption(String custom){
String s[] = custom.split(";");
Map customoption = new HashMap();
for(String x : s){
String ss[] = getOneitemKeyandValue(x);
if(ss!=null){
customoption.put(ss[0],ss[1]);
}
}
if(customoption.size()>0)
return customoption;
else
return null;
}
public static String[] getOneitemKeyandValue(String item){
String s[] = item.split(":");
if(s.length==2)
return s;
else
return null;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/FileLogUtil.java
================================================
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
* Copyright (c) 2017
* All right reserved.
*/
package com.weihuagu.receiptnotice.util;
import com.tao.admin.loglib.FileUtils;
import com.tao.admin.loglib.TLogApplication;
import com.tao.admin.loglib.IConfig;
import com.weihuagu.receiptnotice.util.OneFileUtil;
import java.io.File;
import java.util.ArrayList;
public class FileLogUtil extends FileUtils{
public static boolean clearLogFile() {
try {
File file = new File(TLogApplication.getAPP().getFilesDir(), IConfig.fileName);
if(file.delete())
return true;
else
return false;
} catch(Exception e) {
e.printStackTrace();
return false;
}
}
public static ArrayList getLogList(){
File file = new File(TLogApplication.getAPP().getFilesDir(), IConfig.fileName);
if (!file.exists())
return null;
OneFileUtil fileutil = new OneFileUtil(file);
ArrayList filelist=fileutil.getFileList();
String startflag="*********************************";
String endflag="------------------------------------------";
ArrayList filemergelist=fileutil.mergeByFlagline(startflag,endflag,filelist);
return filemergelist;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/LogUtil.java
================================================
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
* Copyright (c) 2017
* All right reserved.
*/
package com.weihuagu.receiptnotice.util;
import android.util.Log;
import com.tao.admin.loglib.Logger;
import com.weihuagu.receiptnotice.util.message.MessageSendBus;
public class LogUtil {
public static String TAG="NLService";
public static String DEBUGTAG="NLDebugService";
public static String EXCEPTIONTAG="NLExceptionService";
public static void infoLog(String info){
Log.i(TAG,info);
}
public static void debugLog(String info){
Log.d(TAG,info);
}
public static void debugLogWithDeveloper(String info){
Log.d(DEBUGTAG,info);
}
public static void debugLogWithJava(String info){
System.out.println(DEBUGTAG+":"+info);
}
public static void postRecordLog(String tasknum,String post){
Logger.i("*********************************");
Logger.i("开始推送", "随机序列号:"+tasknum);
Logger.i(post);
}
public static void postResultLog(String tasknum,String result,String returnstr){
Logger.i("推送结果","随机序列号:"+tasknum);
Logger.i("推送结果",result);
Logger.i("返回内容",returnstr);
Logger.i("------------------------------------------");
MessageSendBus.postInterfaceMessageWithUpdateTheRecordlist();
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/NetUtil.java
================================================
package com.weihuagu.receiptnotice.util;
import android.os.Build;
import com.weihuagu.receiptnotice.MainApplication;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import okhttp3.ConnectionSpec;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import okhttp3.TlsVersion;
public class NetUtil {
public static final MediaType JSON = MediaType.get("application/json; charset=utf-8");
OkHttpClient client = new OkHttpClient();
PreferenceUtil preferceutil = new PreferenceUtil(MainApplication.getAppContext());
public String httppost(String url, String json) throws IOException {
RequestBody body = RequestBody.create(JSON, json);
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)//设置连接超时时间
.readTimeout(20, TimeUnit.SECONDS)//设置读取超时时间
.build();
Request.Builder request = new Request.Builder()
.url(url)
.post(body);
try (Response response = client.newCall(request.build()).execute()) {
return response.body().string();
}
}
public String httpspost(String url, String json) throws IOException {
if (Build.VERSION.SDK_INT >= 21) {
if (!preferceutil.isTrustAllCertificates())
return httppost(url, json);
else {
RequestBody body = RequestBody.create(JSON, json);
OkHttpClient clientwithtrustallcertificates = getHttpsClientWithTrustAllCertificates();
Request.Builder request = new Request.Builder()
.url(url)
.post(body);
try (Response response = clientwithtrustallcertificates.newCall(request.build()).execute()) {
return response.body().string();
}
}
} else
return doHttpsWithApi19(url, json);
}
public String doHttpsWithApi19(String url, String json) {
try {
RequestBody body = RequestBody.create(JSON, json);
SSLSocketFactory factory = new SSLSocketFactoryCompat();
ConnectionSpec cs = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS)
.tlsVersions(TlsVersion.TLS_1_2)
.build();
List<ConnectionSpec> specs = new ArrayList<>();
specs.add(cs);
specs.add(ConnectionSpec.COMPATIBLE_TLS);
specs.add(ConnectionSpec.CLEARTEXT);
OkHttpClient client = new OkHttpClient.Builder()
.connectTimeout(10, TimeUnit.SECONDS)//设置连接超时时间
.readTimeout(20, TimeUnit.SECONDS)//设置读取超时时间
.sslSocketFactory(factory)
.connectionSpecs(specs)
.build();
Request.Builder request = new Request.Builder()
.url(url)
.post(body);
Response response = client.newCall(request.build()).execute();
return response.body().string();
} catch (IOException e) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
LogUtil.debugLog(sw.toString());
return null;
} catch (KeyManagementException e) {
e.printStackTrace();
return null;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
return null;
}
}
private OkHttpClient getHttpsClientWithTrustAllCertificates() {
OkHttpClient.Builder okhttpClient = new OkHttpClient().newBuilder();
//信任所有服务器地址
okhttpClient. connectTimeout(10, TimeUnit.SECONDS)//设置连接超时时间
.readTimeout(20, TimeUnit.SECONDS);//设置读取超时时间
okhttpClient.hostnameVerifier(new HostnameVerifier() {
@Override
public boolean verify(String s, SSLSession sslSession) {
//设置为true
return true;
}
});
//创建管理器
TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
@Override
public void checkClientTrusted(
java.security.cert.X509Certificate[] x509Certificates,
String s) throws java.security.cert.CertificateException {
}
@Override
public void checkServerTrusted(
java.security.cert.X509Certificate[] x509Certificates,
String s) throws java.security.cert.CertificateException {
}
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return new java.security.cert.X509Certificate[]{};
}
}};
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, trustAllCerts, new java.security.SecureRandom());
//为OkHttpClient设置sslSocketFactory
okhttpClient.sslSocketFactory(sslContext.getSocketFactory());
} catch (Exception e) {
e.printStackTrace();
}
return okhttpClient.build();
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/NotificationUtil.java
================================================
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
* Copyright (c) 2017
* All right reserved.
*/
package com.weihuagu.receiptnotice.util;
import android.app.Notification;
import android.os.Bundle;
import com.weihuagu.receiptnotice.util.LogUtil;
import java.text.SimpleDateFormat;
import java.util.Date;
public class NotificationUtil {
private static String getNotitime(Notification notification){
long when=notification.when;
Date date=new Date(when);
SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd HH:mm");
String notitime=format.format(date);
return notitime;
}
private static String getNotiTitle(Bundle extras){
String title=null;
// 获取通知标题
title = extras.getString(Notification.EXTRA_TITLE, "");
return title;
}
private static String getNotiContent(Bundle extras){
String content=null;
// 获取通知内容
content = extras.getString(Notification.EXTRA_TEXT, "");
return content;
}
public static void printNotify(Notification notification){
if(notification==null){
LogUtil.debugLog("notificationutil report: notification is null");
return;
}
LogUtil.debugLog(getNotitime(notification));
LogUtil.debugLog(getNotiTitle(notification.extras));
LogUtil.debugLog(getNotiContent(notification.extras));
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/OneFileLogItem.java
================================================
package com.weihuagu.receiptnotice.util;
public class OneFileLogItem {
public String getPlatName(){
return null;
}
public String getMoney(){
return null;
}
public String getReply(){
return null;
}
public boolean isRandomSequenceNumberMatches(){
return true;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/OneFileUtil.java
================================================
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
* Copyright (c) 2017
* All right reserved.
*/
package com.weihuagu.receiptnotice.util;
import java.io.File;
import java.io.FileReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.util.Iterator;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Deque;
public class OneFileUtil{
private File file;
public OneFileUtil(File file){
this.file=file;
}
private String clearOnegroup(Deque<String> onegroup){
String tmp="";
while(onegroup.size()>0){
String first=onegroup.pollFirst();
tmp=tmp+"\n"+first;
}
return tmp;
}
public ArrayList mergeByFlagline(String startflagline,String endflagline,ArrayList filelist){
if(filelist.size()==0)
return null;
ArrayList<String> merge=new ArrayList<String>();
Iterator fileiterator = filelist.iterator();
Deque<String> onegroup = new LinkedList<String>();
while (fileiterator.hasNext()) {
String o = (String)fileiterator.next();
onegroup.offerLast(o);
if(onegroup.peekFirst().contains(startflagline)&&onegroup.peekLast().contains(endflagline)){
merge.add(clearOnegroup(onegroup));
}
}
return merge;
}
public ArrayList getFileList(){
ArrayList<String> arrayList = new ArrayList<String>();
FileReader fr = null;
try{
if (!file.exists())
return null;
fr = new FileReader(file);
BufferedReader bf = new BufferedReader(fr);
String str;
while ((str = bf.readLine()) != null) {
//按行处理
arrayList.add(str);
}
if(arrayList.size()==0)
return null;
else
return arrayList;
} catch (Throwable ex) {
ex.printStackTrace();
} finally {
try {
if (fr != null)
fr.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return null;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/PreferenceUtil.java
================================================
package com.weihuagu.receiptnotice.util;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.widget.Toast;
public class PreferenceUtil {
SharedPreferences sharedPref = null;
Context context = null;
public PreferenceUtil(Context context) {
this.context = context;
init();
}
public void init() {
sharedPref = PreferenceManager.getDefaultSharedPreferences(this.context);
}
public String getDeviceid() {
return this.sharedPref.getString("deviceid", "");
}
public boolean isEncrypt() {
return this.sharedPref.getBoolean("isencrypt", false);
}
public boolean isEcho() {
return this.sharedPref.getBoolean("isecho", false);
}
public boolean isWakelock() {
return this.sharedPref.getBoolean("iswakelock", false);
}
public boolean isAppendDeviceiduuid() {
return this.sharedPref.getBoolean("isappenddeviceiduuid", false);
}
public boolean isSkipEncryptDeviceid() {
return this.sharedPref.getBoolean("isskipencryptdeviceid", false);
}
public boolean isTrustAllCertificates() {
return this.sharedPref.getBoolean("istrustallcertificates", false);
}
public boolean isAccessibilityService() {
return this.sharedPref.getBoolean("isaccessibilityservice", false);
}
public boolean isAgreeUserAgreement(){
return this.sharedPref.getBoolean("isagreeuseragreement", false);
}
public void setAgreeUserAgreement(boolean flag){
SharedPreferences.Editor edit = this.sharedPref.edit();
//通过editor对象写入数据
edit.putBoolean("isagreeuseragreement",flag);
//提交数据存入到xml文件中
edit.apply();
}
public void setNumOfPush(String op){
SharedPreferences.Editor edit = this.sharedPref.edit();
if(op.equals("add")){
int currentnum=getNumOfPush();
edit.putInt("numofpush",currentnum++);
//提交数据存入到xml文件中
edit.apply();
}
}
public void setPostUrl(String url) {
SharedPreferences.Editor edit = this.sharedPref.edit();
edit.putString("posturl", url);
//提交数据存入到xml文件中
edit.apply();
}
public String getPostUrl(){
return this.sharedPref.getString("posturl",null);
}
public int getNumOfPush(){
return this.sharedPref.getInt("numofpush",0);
}
public String getEchoServer() {
return this.sharedPref.getString("echoserver", null);
}
public String getEchoInterval() {
return this.sharedPref.getString("echointerval", "");
}
public String getEncryptMethod() {
return this.sharedPref.getString("encryptmethod", null);
}
public String getPasswd() {
return this.sharedPref.getString("passwd", null);
}
public boolean isRemoveNotification() {
return this.sharedPref.getBoolean("isremovenotification", false);
}
public boolean isPostRepeat() {
return this.sharedPref.getBoolean("ispostrepeat", false);
}
public String getPostRepeatNum() {
return this.sharedPref.getString("postrepeatnum", "3");
}
public String getCustomOption() {
return this.sharedPref.getString("custom_option", "");
}
public String getEchoCustomOption() {
return this.sharedPref.getString("echo_custom_option", "");
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/RandomUtil.java
================================================
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
* Copyright (c) 2017
* All right reserved.
*/
package com.weihuagu.receiptnotice.util;
import java.util.Random;
public class RandomUtil {
public static String getRandomTaskNum(){
Random rand = new Random();
return String.valueOf(rand.nextInt(9000) + 1000);
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/SSLSocketFactoryCompat.java
================================================
package com.weihuagu.receiptnotice.util;
import android.os.Build;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
public class SSLSocketFactoryCompat extends SSLSocketFactory{
private static final String[] TLS_V12_ONLY = {"TLSv1.2"};
private final SSLSocketFactory delegate;
public SSLSocketFactoryCompat() throws KeyManagementException, NoSuchAlgorithmException {
SSLContext sc = SSLContext.getInstance("TLS");
sc.init(null, null, null);
delegate = sc.getSocketFactory();
}
public SSLSocketFactoryCompat(SSLSocketFactory delegate) {
if (delegate == null) {
throw new NullPointerException();
}
this.delegate = delegate;
}
@Override
public String[] getDefaultCipherSuites() {
return delegate.getDefaultCipherSuites();
}
@Override
public String[] getSupportedCipherSuites() {
return delegate.getSupportedCipherSuites();
}
private Socket enableTls12(Socket socket) {
if (Build.VERSION.SDK_INT >= 16 && Build.VERSION.SDK_INT < 20) {
if (socket instanceof SSLSocket) {
((SSLSocket) socket).setEnabledProtocols(TLS_V12_ONLY);
}
}
return socket;
}
@Override
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {
return enableTls12(delegate.createSocket(s, host, port, autoClose));
}
@Override
public Socket createSocket(String host, int port) throws IOException {
return enableTls12(delegate.createSocket(host, port));
}
@Override
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
return enableTls12(delegate.createSocket(host, port, localHost, localPort));
}
@Override
public Socket createSocket(InetAddress host, int port) throws IOException {
return enableTls12(delegate.createSocket(host, port));
}
@Override
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
return enableTls12(delegate.createSocket(address, port, localAddress, localPort));
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/UrlUtil.java
================================================
/*
* Created By WeihuaGu (email:weihuagu_work@163.com)
* Copyright (c) 2017
* All right reserved.
*/
package com.weihuagu.receiptnotice.util;
public class UrlUtil {
public static String [] commonusedurls={"m.baidu.com","www.baidu.com","cn.bing.com","Jd.com","weibo.com","weibo.cn","sina.cn","www.tmall.com","www.taobao.com","tianya.cn","github.com","news.163.com","mail.163.com","image.baidu.com","wwww.zhihu.com","www.huanqiu.com","www.ifeng.com","www.jianshu.com","www.xueqiu.com"};
public static String [] getCommonlyUsedUrls(){
return commonusedurls;
}
public static boolean isUrl(String url) {
return
url.contains(".") ||
url.equals(Constants.URL_ABOUT_BLANK) ||
url.equals(Constants.URL_ABOUT_START) ||
url.equals(Constants.URL_ABOUT_TUTORIAL);
}
public static String getSearchUrl(String searchurl,String serchcontent) {
return searchurl.replaceAll("\\{searchTerms\\}", serchcontent);
}
public static String httpOrHttps(String address){
if(address.startsWith("http://")){
return "http";
}
if(address.startsWith("https://"))
return "https";
return null;
}
public static String addressMatch(String address){
if(address.startsWith("jian://")){
return address;
}
if(address.startsWith("alipay://")){
return address;
}
if(address.startsWith("wechat://")){
return address;
}
if(address.startsWith("http://")){
return address;
}
if(address.startsWith("https://"))
return address;
if(!address.startsWith("http://")|!address.startsWith("https://")) {
address = "http://" + address;
} // 如果不以http://开头,识别不了,所以判断
return address;
}
public static String addressMatchInHttps(String address){
if(address.startsWith("https://")){
return address;
}
if(address.startsWith("http://")){
return address.replaceAll("http","https");
}
else{
return "https://"+address;
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/AES.java
================================================
package com.weihuagu.receiptnotice.util.encrypt;
import com.weihuagu.receiptnotice.util.encrypt.Encrypter;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
public class AES extends Encrypter {
public AES(String key){
super(key);
}
public Map<String,String> transferMapValue(Map<String, String> params){
Map<String,String> postmap=new HashMap<String,String>();
Iterator entries = params.entrySet().iterator();
while (entries.hasNext()) {
Map.Entry entry = (Map.Entry) entries.next();
String paramkey = (String)entry.getKey();
String paramvalue = (String)entry.getValue();
//String aesStr = AESUtil.aes(paramvalue, key, Cipher.ENCRYPT_MODE);
String aesStr=null;
postmap.put(paramkey,aesStr);
}
postmap.put("encrypt","1");
return postmap;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/DES.java
================================================
package com.weihuagu.receiptnotice.util.encrypt;
import com.weihuagu.receiptnotice.util.LogUtil;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import javax.crypto.Cipher;
public class DES extends Encrypter{
public DES(String key){
super(key);
}
public Map<String,String> transferMapValue(Map<String, String> params){
Map<String,String> postmap=new HashMap<String,String>();
Iterator entries = params.entrySet().iterator();
while (entries.hasNext()) {
Map.Entry entry = (Map.Entry) entries.next();
String paramkey = (String)entry.getKey();
String paramvalue = (String)entry.getValue();
String desStr = DESUtilWithIV.des(paramvalue, key, Cipher.ENCRYPT_MODE);
postmap.put(paramkey,desStr);
}
postmap.put("encrypt","1");
LogUtil.debugLogWithJava("调试,开始加密字符串");
LogUtil.debugLogWithJava("加密后的map");
LogUtil.debugLogWithJava(postmap.toString());
return postmap;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/DESUtilWithIV.java
================================================
package com.weihuagu.receiptnotice.util.encrypt;
import android.annotation.SuppressLint;
import androidx.annotation.IntDef;
import com.weihuagu.receiptnotice.util.ByteUtil;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import javax.crypto.Cipher;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.security.InvalidAlgorithmParameterException;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
import javax.crypto.spec.IvParameterSpec;
public class DESUtilWithIV{
@IntDef({Cipher.ENCRYPT_MODE, Cipher.DECRYPT_MODE})
@interface DESType {}
/**
* Des加密/解密
*
* @param content 字符串内容
* @param password 密钥
* @param type 加密:{@link Cipher#ENCRYPT_MODE},解密:{@link Cipher#DECRYPT_MODE}
* @return 加密/解密结果
*/
public static String des(String content, String password, int type) {
try {
IvParameterSpec iv = new IvParameterSpec(password.getBytes());
DESKeySpec desKey = new DESKeySpec(password.getBytes());
SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES");
@SuppressLint("GetInstance") Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
cipher.init(type, keyFactory.generateSecret(desKey), iv);
if (type == Cipher.ENCRYPT_MODE) {
byte[] byteContent = content.getBytes("utf-8");
return ByteUtil.parseByte2HexStr(cipher.doFinal(byteContent));
} else {
byte[] byteContent = ByteUtil.parseHexStr2Byte(content);
return new String(cipher.doFinal(byteContent));
}
} catch (InvalidAlgorithmParameterException | NoSuchAlgorithmException | BadPaddingException | IllegalBlockSizeException |
UnsupportedEncodingException | InvalidKeyException | NoSuchPaddingException |
InvalidKeySpecException e) {
e.printStackTrace();
}
return null;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/EncryptFactory.java
================================================
package com.weihuagu.receiptnotice.util.encrypt;
import com.weihuagu.receiptnotice.util.LogUtil;
public class EncryptFactory{
private String key;
public EncryptFactory(String key){
this.key=key;
}
public Encrypter getEncrypter(String encrypt_type){
if(encrypt_type.equals("des"))
return new DES(key);
if(encrypt_type.equals("aes"))
return new AES(key);
if(encrypt_type.equals("md5"))
return new MD5(key);
LogUtil.debugLog("没有匹配到合适的Encrypter");
return null;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/Encrypter.java
================================================
package com.weihuagu.receiptnotice.util.encrypt;
import java.util.Map;
public abstract class Encrypter implements IDataTrans {
protected String key;
public Encrypter(String key){
this.key=key;
}
public Encrypter(){}
public abstract Map<String,String> transferMapValue(Map<String, String> params);
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/IDataTrans.java
================================================
package com.weihuagu.receiptnotice.util.encrypt;
import java.util.Map;
public interface IDataTrans{
public Map<String,String> transferMapValue(Map<String, String> params);
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/MD5.java
================================================
package com.weihuagu.receiptnotice.util.encrypt;
import com.weihuagu.receiptnotice.util.ByteUtil;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.encrypt.Encrypter;
import java.security.MessageDigest;
import java.util.HashMap;
import java.util.Map;
public class MD5 extends Encrypter {
public MD5(String key) {
super(key);
}
public MD5(){
}
public Map<String, String> transferMapValue(Map<String, String> params) {
if(params.get("type")!=null&¶ms.get("money")!=null&&key!=null) {
Map<String, String> postmap = new HashMap<String, String>();
postmap.putAll(params);
postmap.put("sign", getSignMd5WithSecretkey(params.get("type"), params.get("money"), key));
LogUtil.debugLogWithJava("调试,sign md5");
return postmap;
}else
return params;
}
public String getMd5String(String str) {
try {
byte[] bytesOfMessage = str.getBytes("UTF-8");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] thedigest = md.digest(bytesOfMessage);
return ByteUtil.parseByte2HexStr(thedigest);
} catch (java.io.UnsupportedEncodingException exception) {
return null;
} catch (java.security.NoSuchAlgorithmException exception) {
return null;
}
}
public String getSignMd5(String type, String price) {
String md5str=getMd5String(getMd5String(type+price));
LogUtil.debugLog("md5 string: type is"+type+" price is "+ price + " md5str:"+md5str);
return md5str;
}
public String getSignMd5WithSecretkey(String type, String price, String secretkey) {
String md5str=getMd5String(getMd5String(type+price)+secretkey);
return md5str;
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/message/MessageConsumer.java
================================================
package com.weihuagu.receiptnotice.util.message;
public interface MessageConsumer {
public void subMessage();
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/message/MessageSendBus.java
================================================
package com.weihuagu.receiptnotice.util.message;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.weihuagu.receiptnotice.filteringmiddleware.AlipayTransferBean;
import com.weihuagu.receiptnotice.TestBeanWithPostFullInformationMap;
public class MessageSendBus {
//请求硬件模拟类
public static void postActionRequestWithReturn(){
LiveEventBus
.get("action_request_return")
.post("return");
}
public static void postActionRequestWithHome(){
LiveEventBus
.get("action_request_home")
.post("home");
}
//收到活动改变等检测信息
public static void postMessageWithCommonAccessibilityEvent(String event){
LiveEventBus.get("get_new_accessibilityevent").post(event);
}
//消息发送类
public static void postMessageWithFinishedonePost(String[] returnstr){
LiveEventBus
.get("message_finished_one_post")
.post(returnstr);
}
public static void postMessageWithReceiptAlipayTransfer(String transferinfo){
LiveEventBus
.get("message_noti_alipay_transfer_arrive")
.post(transferinfo);
}
public static void postMessageWithUpdateTheLastPostString(String str){
LiveEventBus.get("update_laststr").post(str);
}
public static void postMessageWithget_alipay_transfer_money(AlipayTransferBean transferbean){
LiveEventBus
.get("get_alipay_transfer_money")
.post(transferbean);
}
//模型改变通知界面类
public static void postInterfaceMessageWithUpdateTheRecordlist(){
LiveEventBus
.get("update_recordlist")
.post("update");
}
//用户点击类消息
public static void userMessageWithSetPostUrl(String url){
LiveEventBus
.get("user_set_posturl")
.post(url);
}
//测试消息类
public static void postTestMessageWithPostFullInformationMap(TestBeanWithPostFullInformationMap bean){
LiveEventBus
.get("testmessage_post_full_information_map")
.post(bean);
}
//时间心跳类
//默认以一定时间发送一次的时间间隔消息.时间间隔是一分钟.
public static void postBaseTimeInterval(){
LiveEventBus
.get("time_interval")
.post("base_time_interval");
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/FileLogActivity.java
================================================
package com.weihuagu.receiptnotice.view;
import java.util.ArrayList;
import java.util.Collections;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.widget.TextView;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.LinearLayoutManager;
import android.view.MenuItem;
import android.view.Menu;
import android.view.MenuInflater;
import android.widget.Toast;
import com.weihuagu.receiptnotice.util.FileLogUtil;
import com.weihuagu.receiptnotice.R;
public class FileLogActivity extends AppCompatActivity {
private RecyclerView recyclerView;
private LogListAdapter mAdapter;
private RecyclerView.LayoutManager layoutManager;
private TextView mTextView;
private Toolbar myToolbar;
private boolean loglist_is_a_wholetext=true;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_log);
initView();
setLogText();
}
private void initView(){
myToolbar= (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
mTextView = (TextView) findViewById(R.id.tv_log);
}
private void initLoglistView(boolean reverseorder){
recyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
//recyclerView.setHasFixedSize(true);
// use a linear layout manager
layoutManager = new LinearLayoutManager(this);
recyclerView.setLayoutManager(layoutManager);
// specify an adapter (see also next example)
mAdapter = new LogListAdapter(getApplicationContext());
ArrayList loglist= FileLogUtil.getLogList();
//LogUtil.debugLogWithDeveloper("打印通过filelogutil获取到的file log list");
if(loglist!=null&&loglist.size()>0){
loglist_is_a_wholetext=false;
if(reverseorder)
Collections.reverse(loglist);
}
else{
loglist_is_a_wholetext=true;
return;
}
mAdapter.setLoglist(loglist);
recyclerView.setAdapter(mAdapter);
}
private void setLogText(){
initLoglistView(false);
if(loglist_is_a_wholetext){
String log = FileLogUtil.readLogText();
mTextView.setText(log);
}
}
private void clearLog(){
FileLogUtil.clearLogFile();
setLogText();
Toast.makeText(getApplicationContext(), "已经清空日志",Toast.LENGTH_SHORT).show();
}
private void showReverse(){
initLoglistView(true);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.log, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_clearlog:
// User chose the "Settings" item, show the app settings UI...
clearLog();
return true;
case R.id.action_reverseshow:
showReverse();
return true;
default:
// If we got here, the user's action was not recognized.
// Invoke the superclass to handle it.
return super.onOptionsItemSelected(item);
}
}
@Override
protected void onResume() {
super.onResume();
setLogText();
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/FollowThirdAppActivity.java
================================================
package com.weihuagu.receiptnotice.view;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.weihuagu.receiptnotice.R;
public class FollowThirdAppActivity extends AppCompatActivity {
private EditText pkg;
private EditText keyword;
private EditText type;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_followthirdapp);
}
private void initView() {
pkg=(EditText)findViewById(R.id.pkg);
keyword=(EditText)findViewById(R.id.pkg);
type=(EditText)findViewById(R.id.pkg);
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/HelloFragment.java
================================================
package com.weihuagu.receiptnotice.view;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.lifecycle.Observer;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.weihuagu.receiptnotice.MainApplication;
import com.weihuagu.receiptnotice.R;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.util.PreferenceUtil;
public class HelloFragment extends Fragment {
private TextView numofpush;
private TextView posturl;
private View rootview;
private PreferenceUtil preference;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
rootview=inflater.inflate(R.layout.fragment_hello,container, false);
return rootview;
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
initView();
subMessage();
}
private void initView(){
preference=new PreferenceUtil(getContext());
numofpush=(TextView)rootview.findViewById(R.id.numofpush);
setTextWithNumofpush();
posturl=(TextView)rootview.findViewById(R.id.posturl);
setTextWithPosturl();
}
private void setTextWithNumofpush(){
numofpush.setText("推送次数"+preference.getNumOfPush());
}
private void setTextWithPosturl(){
if(preference.getPostUrl()!=null)
posturl.setText("目前的推送地址:"+preference.getPostUrl());
}
private void resetText(){
setTextWithPosturl();
setTextWithNumofpush();
}
private void subMessage(){
LiveEventBus
.get("message_finished_one_post",String[].class)
.observeForever(new Observer<String[]>() {
@Override
public void onChanged(@Nullable String[] testpostbean) {
resetText();
}
});
LiveEventBus
.get("user_set_posturl",String.class)
.observeForever(new Observer<String>() {
@Override
public void onChanged(@Nullable String url) {
resetText();
}
});
LiveEventBus
.get("time_interval",String.class)
.observeForever(new Observer<String>() {
@Override
public void onChanged(@Nullable String baseinterval) {
Toast.makeText(MainApplication.getAppContext(), "接受到一分钟间隔事件,更新推送次数",
Toast.LENGTH_SHORT).show();
LogUtil.debugLog("接受到一分钟一次的时间间隔事件");
resetText();
}
});
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/HomeFragmentsAdapter.java
================================================
package com.weihuagu.receiptnotice.view;
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.viewpager2.adapter.FragmentStateAdapter;
import java.util.ArrayList;
public class HomeFragmentsAdapter extends FragmentStateAdapter {
private ArrayList<Fragment> fragmentslist = new ArrayList<>();
public HomeFragmentsAdapter(@NonNull FragmentActivity fragmentActivity) {
super(fragmentActivity);
fragmentslist.add(new HelloFragment());
fragmentslist.add(new LogListFragment());
}
@NonNull
@Override
public Fragment createFragment(int position) {
return fragmentslist.get(position);
}
@Override
public int getItemCount() {
return fragmentslist.size();
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/IllustrateDecryptActivity.java
================================================
package com.weihuagu.receiptnotice.view;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import android.widget.TextView;
import com.weihuagu.receiptnotice.util.PreferenceUtil;
import com.weihuagu.receiptnotice.R;
public class IllustrateDecryptActivity extends AppCompatActivity {
private TextView text_method;
private TextView text_passwd;
private TextView text_iv;
private PreferenceUtil preference;
private void initView() {
text_method = (TextView) findViewById(R.id.info_text_method);
text_passwd = (TextView) findViewById(R.id.info_text_passwd);
text_iv = (TextView) findViewById(R.id.info_text_iv);
preference=new PreferenceUtil(getBaseContext());
}
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_illustratedecrypt);
initView();
setText();
}
private void setText(){
String encrypt_type=preference.getEncryptMethod();
if(encrypt_type==null){
text_method.setText("您没有设置加密方法");
return;
}
if(encrypt_type.equals("des")){
String method="DES/CBC/PKCS5Padding";
text_method.setText("解密的方法为:"+method);
String key=preference.getPasswd();
if(key!=null){
text_passwd.setText("解密秘钥为:"+key+"(des秘钥必须为8位,如果你设置的不是8位,请修改)");
text_iv.setText("解密的初始化向量为:"+key);
}
}
if(encrypt_type.equals("md5")){
text_method.setText("解密的方法为:"+"md5校验");
String key=preference.getPasswd();
if(key!=null){
text_passwd.setText("md5加密方法为md5(md5(price + type) + secretkey)");
}
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/LogListAdapter.java
================================================
package com.weihuagu.receiptnotice.view;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.RecyclerView.Adapter;
import android.view.LayoutInflater;
import android.widget.TextView;
import android.content.Context;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.R;
import java.util.ArrayList;
public class LogListAdapter extends Adapter<LogListAdapter.RecyclerHolder>{
private final LayoutInflater mLayoutInflater;
private ArrayList loglist;
LogListAdapter(Context context){
mLayoutInflater = LayoutInflater.from(context);
}
public void setLoglist(ArrayList loglist){
this.loglist=loglist;
}
@Override
public int getItemCount() {
return loglist == null ? 0 : loglist.size();
}
@Override
public void onBindViewHolder(RecyclerHolder holder, int position) {
String onerecord=(String)loglist.get(position);
if(holder.recordtext==null)
return;
if(onerecord!=null)
holder.recordtext.setText(onerecord);
else
LogUtil.debugLogWithDeveloper("获取到的loglist 的item text为空");
}
@Override
public RecyclerHolder onCreateViewHolder(ViewGroup parent, int viewType) {
return new RecyclerHolder(mLayoutInflater.inflate(R.layout.item_log_text, parent, false));
}
class RecyclerHolder extends RecyclerView.ViewHolder {
private TextView recordtext;
RecyclerHolder(View view){
super(view);
recordtext=view.findViewById(R.id.text_view);
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/LogListFragment.java
================================================
package com.weihuagu.receiptnotice.view;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.lifecycle.Observer;
import com.jeremyliao.liveeventbus.LiveEventBus;
import com.weihuagu.receiptnotice.util.FileLogUtil;
import com.weihuagu.receiptnotice.util.LogUtil;
import com.weihuagu.receiptnotice.MainApplication;
import com.weihuagu.receiptnotice.util.message.MessageConsumer;
import com.weihuagu.receiptnotice.R;
import java.util.ArrayList;
import java.util.Collections;
public class LogListFragment extends Fragment implements MessageConsumer {
private RecyclerView recyclerView;
private LogListAdapter mAdapter;
private ArrayList loglist;
private RecyclerView.LayoutManager layoutManager;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_loglist, container, false);
}
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
initLoglistView(false);
subMessage();
}
private void initLoglistView(boolean reverseorder) {
recyclerView = (RecyclerView) getView().findViewById(R.id.my_recycler_view);
layoutManager = new LinearLayoutManager(getContext());
recyclerView.setLayoutManager(layoutManager);
mAdapter = new LogListAdapter(getContext());
loglist = FileLogUtil.getLogList();
if (loglist == null) {
loglist = new ArrayList<String>();
loglist.add("推送记录为空");
}
//LogUtil.debugLogWithDeveloper("打印通过filelogutil获取到的file log list");
if(reverseorder)
Collections.reverse(loglist);
mAdapter.setLoglist(loglist);
recyclerView.setAdapter(mAdapter);
}
private void clearLog() {
FileLogUtil.clearLogFile();
loglist.clear();
mAdapter.notifyDataSetChanged();
Toast.makeText(MainApplication.getAppContext(), "已经清空日志", Toast.LENGTH_SHORT).show();
}
private void showReverse() {
initLoglistView(true);
}
private void updateList() {
loglist.clear();
loglist.addAll(FileLogUtil.getLogList());
mAdapter.notifyDataSetChanged();
LogUtil.debugLog("更新Loglist in Fragment列表:");
}
public void subMessage() {
LiveEventBus
.get("update_recordlist", String.class)
.observe(this, new Observer<String>() {
@Override
public void onChanged(@Nullable String s) {
LogUtil.debugLog("收到订阅消息:update_recordlist " + s);
updateList();
}
});
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/MainActivity.java
================================================
package com.weihuagu.receiptnotice.view;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.DialogInterface;
import android.view.MenuItem;
import android.view.Menu;
import android.content.SharedPreferences;
import android.widget.Toast;
import android.content.Intent;
import android.os.Bundle;
import androidx.core.app.NotificationManagerCompat;
import android.view.View;
import android.widget.Button;
import android.widget.AutoCompleteTextView;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import androidx.appcompat.widget.Toolbar;
import android.view.MenuInflater;
import android.widget.ArrayAdapter;
import androidx.viewpager2.widget.ViewPager2;
import com.github.pedrovgs.lynx.LynxConfig;
import com.github.pedrovgs.lynx.LynxActivity;
import com.weihuagu.receiptnotice.MainApplication;
import com.weihuagu.receiptnotice.util.PreferenceUtil;
import com.weihuagu.receiptnotice.R;
import com.weihuagu.receiptnotice.util.message.MessageSendBus;
public class MainActivity extends AppCompatActivity implements View.OnClickListener {
private static final String TAG = "MainActivity";
private Toolbar myToolbar;
private ViewPager2 viewpage;
private Button btnsetposturl;
private FloatingActionButton btnshowlog;
private AutoCompleteTextView posturltextview;
private SharedPreferences sp;
public PreferenceUtil preference ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
initView();
posturlSuggestion();
}
private void initView() {
preference = new PreferenceUtil(this);
sp = getSharedPreferences("url", Context.MODE_PRIVATE);
myToolbar = (Toolbar) findViewById(R.id.my_toolbar);
setSupportActionBar(myToolbar);
ViewPager2 viewpage = findViewById(R.id.viewpager);
HomeFragmentsAdapter viewpageadapter = new HomeFragmentsAdapter(this);
viewpage.setAdapter(viewpageadapter);
btnsetposturl = (Button) findViewById(R.id.btnsetposturl);
btnsetposturl.setOnClickListener(this);
btnshowlog = (FloatingActionButton) findViewById(R.id.floatingshowlog);
btnshowlog.setOnClickListener(this);
posturltextview = (AutoCompleteTextView) findViewById(R.id.posturl);
if (getPostUrl() != null)
posturltextview.setHint(getPostUrl());
}
private void setListerner() {
}
@Override
protected void onResume() {
super.onResume();
boolean isAuthor = isNotificationServiceEnable();
if (!preference.isAgreeUserAgreement()) {
jumpUserAgreement();
}
if (!isAuthor) {
//直接跳转通知授权界面
//android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS是API 22才加入到Settings里,这里直接写死
startActivity(new Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"));
}
}
@Override
protected void onDestroy() {
super.onDestroy();
}
/**
* 是否已授权
*
* @return
*/
private boolean isNotificationServiceEnable() {
return NotificationManagerCompat.getEnabledListenerPackages(this).contains(getPackageName());
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btnsetposturl:
posturltextview.setHint(null);
setPostUrl();
break;
case R.id.floatingshowlog:
showLog();
break;
}
}
private void setPostUrl() {
PreferenceUtil preference=new PreferenceUtil(getBaseContext());
preference.setPostUrl(posturltextview.getText().toString());
MessageSendBus.userMessageWithSetPostUrl(posturltextview.getText().toString());
Toast.makeText(getApplicationContext(), "已经设置posturl为:" + preference.getPostUrl(),
Toast.LENGTH_SHORT).show();
}
private String getPostUrl() {
PreferenceUtil preference=new PreferenceUtil(MainApplication.getAppContext());
return preference.getPostUrl();
}
private void jumpUserAgreement() {
showAgreeMentDialog();
}
private void posturlSuggestion() {
String[] str = new String[2];
str[0] = "";
if(getPostUrl()!=null)
str[1] = getPostUrl();
else str[1] = "";
posturltextview.setThreshold(0);
ArrayAdapter adapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1, str);
posturltextview.setAdapter(adapter);
posturltextview.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override
public void onFocusChange(View v, boolean hasFocus) {
AutoCompleteTextView view = (AutoCompleteTextView) v;
if (hasFocus) {
view.showDropDown();
}
}
});
//Toast.makeText(getApplicationContext(), str[0], Toast.LENGTH_SHORT).show();
}
private void showLog() {
//startActivity(new Intent(this, LogActivity.class));
openLynxActivity();
}
private void openLynxActivity() {
LynxConfig lynxConfig = new LynxConfig();
lynxConfig.setMaxNumberOfTracesToShow(4000)
.setFilter("NLService");
Intent lynxActivityIntent = LynxActivity.getIntent(this, lynxConfig);
startActivity(lynxActivityIntent);
}
private void openSettingActivity() {
Intent intent = new Intent(MainActivity.this, PreferenceActivity.class);
startActivity(intent);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// TODO Auto-generated method stub
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.action_settings:
// User chose the "Settings" item, show the app settings UI...
openSettingActivity();
return true;
default:
// If we got here, the user's action was not recognized.
// Invoke the superclass to handle it.
return super.onOptionsItemSelected(item);
}
}
private void showAgreeMentDialog() {
AlertDialog.Builder normalDialog =
new AlertDialog.Builder(MainActivity.this);
normalDialog.setTitle("用户协议").setMessage("您必须同意该用户协议才能使用该应用。点击下方的按钮以查看完整的用户协议");
normalDialog.setPositiveButton("查看用户协议",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// ...To-do
Intent intent = new Intent(getBaseContext(), UserAgreementActiviy.class);
startActivity(intent);
}
});
normalDialog.setNeutralButton("同意",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// ...To-do
preference.setAgreeUserAgreement(true);
}
});
normalDialog.setNegativeButton("退出", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// ...To-do
finish();
}
});
// 创建实例并显示
normalDialog.show();
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/PreferenceActivity.java
================================================
package com.weihuagu.receiptnotice.view;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.provider.Settings;
import androidx.appcompat.app.AppCompatActivity;
import com.weihuagu.receiptnotice.util.AuthorityUtil;
import com.weihuagu.receiptnotice.MainApplication;
import com.weihuagu.receiptnotice.R;
public class PreferenceActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFragmentManager().beginTransaction().replace(android.R.id.content, new GeneralPreferenceFragment()).commit();
}
public static class GeneralPreferenceFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref_general);
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String s) {
if (s.equals("isaccessibilityservice") && sharedPreferences.getBoolean(s, false) == true) {
if (! AuthorityUtil.isAccessibilitySettingsOn(MainApplication.getAppContext()))
startActivity(new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS));
}
}
@Override
public void onResume() {
super.onResume();
// Set up a listener whenever a key changes
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
}
@Override
public void onPause() {
super.onPause();
// Set up a listener whenever a key changes
getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/TestActiviy.java
================================================
package com.weihuagu.receiptnotice.view;
import android.os.Bundle;
import android.webkit.WebView;
import android.widget.TextView;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.weihuagu.receiptnotice.R;
import com.weihuagu.receiptnotice.ForTest;
import org.w3c.dom.Text;
import android.widget.Button;
import android.view.View;
public class TestActiviy extends AppCompatActivity implements View.OnClickListener{
private TextView money;
private Button button;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test);
money = (TextView) findViewById(R.id.money);
button = (Button) findViewById(R.id.action_nitification);
button.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.action_nitification:
new ForTest();
break;
}
}
}
================================================
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/UserAgreementActiviy.java
================================================
package com.weihuagu.receiptnotice.view;
import android.os.Bundle;
import andr
gitextract_8bhqj9sl/ ├── .gitattributes ├── .github/ │ ├── FUNDING.yml │ ├── file_to_push_get_new_build │ └── workflows/ │ └── android.yml ├── .gitignore ├── .idea/ │ ├── caches/ │ │ └── build_file_checksums.ser │ ├── codeStyles/ │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ ├── modules.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── LICENSE ├── README-zh.md ├── README.md ├── app/ │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src/ │ ├── main/ │ │ ├── AndroidManifest.xml │ │ ├── assets/ │ │ │ └── web/ │ │ │ └── useragreement.html │ │ ├── java/ │ │ │ └── com/ │ │ │ └── weihuagu/ │ │ │ └── receiptnotice/ │ │ │ ├── DatabaseHelper.java │ │ │ ├── ForTest.java │ │ │ ├── MainApplication.java │ │ │ ├── NLService.java │ │ │ ├── NotificationCollectorMonitorService.java │ │ │ ├── NotificationHandle.java │ │ │ ├── NotificationHandleFactory.java │ │ │ ├── OnlyWriteToDateBase.java │ │ │ ├── PmentayNotificationHandle.java │ │ │ ├── ReceiptnoticeAccessibilityService.java │ │ │ ├── TestBeanWithPostFullInformationMap.java │ │ │ ├── action/ │ │ │ │ ├── ActionStatusBarNotification.java │ │ │ │ ├── AsyncResponse.java │ │ │ │ ├── HandlePost.java │ │ │ │ ├── IDoPost.java │ │ │ │ └── PostTask.java │ │ │ ├── audiorecognize/ │ │ │ │ ├── AudioHub.java │ │ │ │ └── RecordService.java │ │ │ ├── filteringmiddleware/ │ │ │ │ ├── AlipayTransferBean.java │ │ │ │ └── PostMapFilter.java │ │ │ ├── pushclassification/ │ │ │ │ └── pmentay/ │ │ │ │ ├── AlipayPmentayNotificationHandle.java │ │ │ │ ├── BankDistinguisher.java │ │ │ │ ├── BanksProxy.java │ │ │ │ ├── CashbarPmentayNotificationHandle.java │ │ │ │ ├── IcbcelifePmentayNotificationHandle.java │ │ │ │ ├── MipushPmentayNotificationHandle.java │ │ │ │ ├── UnionpayPmentayNotificationHandle.java │ │ │ │ ├── WechatPmentayNotificationHandle.java │ │ │ │ └── XposedmodulePmentayNotificationHandle.java │ │ │ ├── util/ │ │ │ │ ├── AuthorityUtil.java │ │ │ │ ├── ByteUtil.java │ │ │ │ ├── Constants.java │ │ │ │ ├── DataBaseHolder.java │ │ │ │ ├── DeviceInfoUtil.java │ │ │ │ ├── ExternalInfoUtil.java │ │ │ │ ├── FileLogUtil.java │ │ │ │ ├── LogUtil.java │ │ │ │ ├── NetUtil.java │ │ │ │ ├── NotificationUtil.java │ │ │ │ ├── OneFileLogItem.java │ │ │ │ ├── OneFileUtil.java │ │ │ │ ├── PreferenceUtil.java │ │ │ │ ├── RandomUtil.java │ │ │ │ ├── SSLSocketFactoryCompat.java │ │ │ │ ├── UrlUtil.java │ │ │ │ ├── encrypt/ │ │ │ │ │ ├── AES.java │ │ │ │ │ ├── DES.java │ │ │ │ │ ├── DESUtilWithIV.java │ │ │ │ │ ├── EncryptFactory.java │ │ │ │ │ ├── Encrypter.java │ │ │ │ │ ├── IDataTrans.java │ │ │ │ │ └── MD5.java │ │ │ │ └── message/ │ │ │ │ ├── MessageConsumer.java │ │ │ │ └── MessageSendBus.java │ │ │ └── view/ │ │ │ ├── FileLogActivity.java │ │ │ ├── FollowThirdAppActivity.java │ │ │ ├── HelloFragment.java │ │ │ ├── HomeFragmentsAdapter.java │ │ │ ├── IllustrateDecryptActivity.java │ │ │ ├── LogListAdapter.java │ │ │ ├── LogListFragment.java │ │ │ ├── MainActivity.java │ │ │ ├── PreferenceActivity.java │ │ │ ├── TestActiviy.java │ │ │ └── UserAgreementActiviy.java │ │ └── res/ │ │ ├── drawable/ │ │ │ └── ic_launcher_background.xml │ │ ├── drawable-v24/ │ │ │ └── ic_launcher_foreground.xml │ │ ├── layout/ │ │ │ ├── activity_followthirdapp.xml │ │ │ ├── activity_illustratedecrypt.xml │ │ │ ├── activity_log.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_test.xml │ │ │ ├── activity_useragreement.xml │ │ │ ├── fragment_hello.xml │ │ │ ├── fragment_loglist.xml │ │ │ ├── item_home_viewpage_fragment.xml │ │ │ └── item_log_text.xml │ │ ├── menu/ │ │ │ ├── log.xml │ │ │ └── main.xml │ │ ├── mipmap-anydpi-v26/ │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ ├── values/ │ │ │ ├── colors.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ ├── values-zh/ │ │ │ └── strings.xml │ │ └── xml/ │ │ ├── network_security_config.xml │ │ ├── pref_general.xml │ │ ├── pref_headers.xml │ │ └── receiptnoticeaccessibilityservice_config.xml │ └── test/ │ └── java/ │ └── com/ │ └── weihuagu/ │ └── receiptnotice/ │ ├── TestBankDistinguisher.java │ ├── TestDES.java │ ├── TestExternalInfoUtil.java │ └── TestOneFileUtil.java ├── build.gradle ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat └── settings.gradle
SYMBOL INDEX (397 symbols across 69 files)
FILE: app/src/main/java/com/weihuagu/receiptnotice/DatabaseHelper.java
class DatabaseHelper (line 9) | public class DatabaseHelper extends SQLiteOpenHelper {
method DatabaseHelper (line 13) | public DatabaseHelper(@Nullable Context context, @Nullable String name...
method onCreate (line 17) | @Override
method onUpgrade (line 27) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/ForTest.java
class ForTest (line 16) | public class ForTest {
method makeAPostTest (line 17) | public void makeAPostTest(String pkg, Notification notification){
method GenerateNotification (line 27) | private void GenerateNotification() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/MainApplication.java
class MainApplication (line 14) | public class MainApplication extends Application {
method onCreate (line 18) | @Override
method initLogConfig (line 29) | private void initLogConfig(){
method startNotificationService (line 35) | private void startNotificationService(){
method setSomeGlobal (line 38) | private void setSomeGlobal(){
method setMessageBus (line 41) | public void setMessageBus(){
method getAppContext (line 47) | public static Context getAppContext(){
method timeInterval (line 50) | public void timeInterval(){
method setSomeThingWaitMessage (line 56) | public void setSomeThingWaitMessage(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/NLService.java
class NLService (line 28) | public class NLService extends NotificationListenerService implements A...
method getPostUrl (line 32) | private String getPostUrl(){
method onNotificationPosted (line 38) | @Override
method onNotificationRemoved (line 77) | @Override
method removeNotification (line 83) | public void removeNotification(StatusBarNotification sbn){
method sendBroadcast (line 94) | private void sendBroadcast(String msg) {
method sendToast (line 100) | private void sendToast(String msg){
method subMessage (line 106) | public void subMessage() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/NotificationCollectorMonitorService.java
class NotificationCollectorMonitorService (line 60) | public class NotificationCollectorMonitorService extends Service {
method setWakelock (line 72) | private void setWakelock() {
method obtainWakelock (line 78) | private void obtainWakelock() {
method releaseWakelock (line 86) | private void releaseWakelock() {
method onCreate (line 95) | @Override
method onStartCommand (line 103) | @Override
method echoServerBySocketio (line 107) | private boolean echoServerBySocketio(String echourl,String echojson){
method getDefaultEchoInterval (line 125) | private String getDefaultEchoInterval(){
method startEchoTimer (line 131) | private void startEchoTimer(){
method returnEchoTimerTask (line 141) | private TimerTask returnEchoTimerTask(){
method restartEchoTimer (line 156) | private void restartEchoTimer(){
method isIntervalMatchPreference (line 168) | private boolean isIntervalMatchPreference(){
method echoServer (line 177) | private boolean echoServer(){
method ensureCollectorRunning (line 214) | private void ensureCollectorRunning() {
method toggleNotificationListenerService (line 241) | private void toggleNotificationListenerService() {
method onBind (line 250) | @Override
class DeviceBean (line 255) | public class DeviceBean{
method setDeviceid (line 258) | public void setDeviceid(String deviceid){
method setTime (line 261) | public void setTime(String time){
method DeviceBeanReflect (line 266) | public Map DeviceBeanReflect(DeviceBean e){
class EchoSocket (line 284) | public static class EchoSocket{
method EchoSocket (line 289) | private EchoSocket(){
method getThisInstance (line 291) | public static Socket getThisInstance(int i){
method getInstance (line 302) | public static Socket getInstance(String socketserverurl){
method getIOSocket (line 320) | public static Socket getIOSocket(String socketserverurl){
FILE: app/src/main/java/com/weihuagu/receiptnotice/NotificationHandle.java
class NotificationHandle (line 17) | public abstract class NotificationHandle {
method NotificationHandle (line 27) | public NotificationHandle(String rawpkgtype, Notification rawnotificat...
method setStatusBarNotification (line 45) | public void setStatusBarNotification(StatusBarNotification sbn){
method setActionStatusbar (line 48) | public void setActionStatusbar(ActionStatusBarNotification actionstatu...
method handleNotification (line 51) | public abstract void handleNotification();
method removeNotification (line 55) | protected void removeNotification(){
method printNotify (line 61) | protected void printNotify(){
method openNotify (line 71) | protected void openNotify(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/NotificationHandleFactory.java
class NotificationHandleFactory (line 15) | public class NotificationHandleFactory{
method getNotificationHandle (line 16) | public PmentayNotificationHandle getNotificationHandle(String pkg, Not...
method getMessageAppPkg (line 56) | private String getMessageAppPkg(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/OnlyWriteToDateBase.java
class OnlyWriteToDateBase (line 7) | public class OnlyWriteToDateBase {
method onePostWriteToDateBase (line 9) | public void onePostWriteToDateBase(String postjson){
method checkHavePlatName (line 22) | public boolean checkHavePlatName(String plattype){
FILE: app/src/main/java/com/weihuagu/receiptnotice/PmentayNotificationHandle.java
class PmentayNotificationHandle (line 17) | public abstract class PmentayNotificationHandle extends NotificationHandle{
method PmentayNotificationHandle (line 20) | public PmentayNotificationHandle(String pkgtype, Notification notifica...
method setStatusBarNotification (line 25) | public void setStatusBarNotification(StatusBarNotification sbn){
method setActionStatusbar (line 28) | public void setActionStatusbar(ActionStatusBarNotification actionstatu...
method extractMoney (line 32) | protected String extractMoney(String content){
method predictIsPost (line 52) | protected boolean predictIsPost(String content){
method removeNotification (line 62) | protected void removeNotification(){
method printNotify (line 68) | protected void printNotify(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/ReceiptnoticeAccessibilityService.java
class ReceiptnoticeAccessibilityService (line 30) | public class ReceiptnoticeAccessibilityService extends AccessibilityServ...
method setLastPostStr (line 39) | private void setLastPostStr(String str){
method setLastNotiStr (line 43) | private void setLastNotiStr(String str){
method onServiceConnected (line 46) | @Override
method onAccessibilityEvent (line 57) | @Override
method onInterrupt (line 78) | @Override
method mockSwipe (line 83) | private void mockSwipe(){
method subMessage (line 122) | public void subMessage(){
method getAlipayTransferInfo (line 172) | public void getAlipayTransferInfo(String classname){
method debugLogWithDeveloper (line 213) | public void debugLogWithDeveloper(String info){
method wakeAndUnlock (line 221) | private void wakeAndUnlock(boolean unLock)
FILE: app/src/main/java/com/weihuagu/receiptnotice/TestBeanWithPostFullInformationMap.java
class TestBeanWithPostFullInformationMap (line 5) | public class TestBeanWithPostFullInformationMap {
method getPosturl (line 10) | public String getPosturl() {
method setPosturl (line 14) | public void setPosturl(String posturl) {
method getInfomap (line 18) | public Map<String, String> getInfomap() {
method setInfomap (line 22) | public void setInfomap(Map<String, String> infomap) {
method getPkg (line 26) | public String getPkg() {
method setPkg (line 30) | public void setPkg(String pkg) {
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/ActionStatusBarNotification.java
type ActionStatusBarNotification (line 4) | public interface ActionStatusBarNotification{
method removeNotification (line 5) | public void removeNotification(StatusBarNotification sbn);
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/AsyncResponse.java
type AsyncResponse (line 6) | public interface AsyncResponse {
method onDataReceivedSuccess (line 7) | public void onDataReceivedSuccess(String[] returnstr);
method onDataReceivedFailed (line 8) | public void onDataReceivedFailed(String[] returnstr,Map<String ,String...
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/HandlePost.java
class HandlePost (line 17) | public class HandlePost implements IDoPost, AsyncResponse {
method HandlePost (line 20) | public HandlePost() {
method getPostUrl (line 24) | protected String getPostUrl(){
method doPost (line 29) | @Override
method doPostTask (line 48) | protected void doPostTask(Map<String, String> postmap,Map<String, Stri...
method onDataReceivedSuccess (line 64) | @Override
method onDataReceivedFailed (line 74) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/IDoPost.java
type IDoPost (line 4) | public interface IDoPost{
method doPost (line 5) | public void doPost(Map<String, String> params);
FILE: app/src/main/java/com/weihuagu/receiptnotice/action/PostTask.java
class PostTask (line 15) | public class PostTask extends AsyncTask<Map<String, String>, Void, Strin...
method setRandomTaskNum (line 23) | public void setRandomTaskNum(String num){
method map2Json (line 28) | public String map2Json(Map<String,String> map){
method setOnAsyncResponse (line 40) | public void setOnAsyncResponse(AsyncResponse asyncResponse)
method doInBackground (line 45) | @Override
method onPostExecute (line 86) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/audiorecognize/AudioHub.java
class AudioHub (line 11) | public class AudioHub {
method AudioHub (line 21) | public AudioHub() throws IOException{
method startRecord (line 34) | private void startRecord() {
method stopRecord (line 41) | private void stopRecord() {
method close (line 45) | private void close() {
method getRecordData (line 54) | private void getRecordData(){
class AudioRecordThread (line 60) | class AudioRecordThread implements Runnable {
method run (line 61) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/audiorecognize/RecordService.java
class RecordService (line 7) | public class RecordService extends Service {
method onBind (line 8) | @Nullable
method onCreate (line 13) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/filteringmiddleware/AlipayTransferBean.java
class AlipayTransferBean (line 3) | public class AlipayTransferBean {
method getNum (line 4) | public String getNum() {
method setNum (line 8) | public void setNum(String num) {
method getRemark (line 12) | public String getRemark() {
method setRemark (line 16) | public void setRemark(String remark) {
FILE: app/src/main/java/com/weihuagu/receiptnotice/filteringmiddleware/PostMapFilter.java
class PostMapFilter (line 14) | public class PostMapFilter {
method PostMapFilter (line 19) | public PostMapFilter(PreferenceUtil preference, Map<String, String> un...
method getDeviceid (line 25) | public String getDeviceid() {
method getPostMap (line 37) | public Map getPostMap() {
method getLogMap (line 63) | public Map getLogMap() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/AlipayPmentayNotificationHandle.java
class AlipayPmentayNotificationHandle (line 23) | public class AlipayPmentayNotificationHandle extends PmentayNotification...
method AlipayPmentayNotificationHandle (line 25) | public AlipayPmentayNotificationHandle(String pkgtype, Notification no...
method handleNotification (line 29) | public void handleNotification(){
method transfercodePush (line 52) | private void transfercodePush(){
method collectioncodePush (line 76) | private void collectioncodePush(boolean isinfoincontent){
method isInfoHideInTitle (line 94) | private boolean isInfoHideInTitle(){
method whoTransferred (line 100) | private String whoTransferred(String content){
method subMessage (line 113) | public void subMessage() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/BankDistinguisher.java
class BankDistinguisher (line 17) | public class BankDistinguisher{
method BankDistinguisher (line 18) | public BankDistinguisher(){
method distinguishByNum (line 20) | public String distinguishByNum(String num){
method distinguishByMessageContent (line 30) | public String distinguishByMessageContent(String content){
method extractMoney (line 51) | public String extractMoney(String content){
method extractCardNum (line 67) | public String extractCardNum(String content){
method extractTime (line 79) | public String extractTime(String content,String time){
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/BanksProxy.java
class BanksProxy (line 11) | public class BanksProxy extends PmentayNotificationHandle {
method BanksProxy (line 14) | public BanksProxy(String pkgtype, Notification notification, IDoPost p...
method getBankType (line 18) | private String getBankType(){
method handleNotification (line 23) | public void handleNotification(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/CashbarPmentayNotificationHandle.java
class CashbarPmentayNotificationHandle (line 13) | public class CashbarPmentayNotificationHandle extends PmentayNotificatio...
method CashbarPmentayNotificationHandle (line 14) | public CashbarPmentayNotificationHandle(String pkgtype, Notification n...
method handleNotification (line 18) | public void handleNotification(){
method getCashbarType (line 38) | private String getCashbarType(String content){
method transType (line 50) | private String transType(String chinesetype){
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/IcbcelifePmentayNotificationHandle.java
class IcbcelifePmentayNotificationHandle (line 14) | public class IcbcelifePmentayNotificationHandle extends PmentayNotificat...
method IcbcelifePmentayNotificationHandle (line 15) | public IcbcelifePmentayNotificationHandle(String pkgtype, Notification...
method handleNotification (line 19) | public void handleNotification(){
method extractMoney (line 39) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/MipushPmentayNotificationHandle.java
class MipushPmentayNotificationHandle (line 14) | public class MipushPmentayNotificationHandle extends PmentayNotification...
method MipushPmentayNotificationHandle (line 15) | public MipushPmentayNotificationHandle(String pkgtype, Notification no...
method handleNotification (line 19) | public void handleNotification(){
method getPayer (line 65) | private String getPayer(String content){
method whoTransferred (line 76) | private String whoTransferred(String content){
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/UnionpayPmentayNotificationHandle.java
class UnionpayPmentayNotificationHandle (line 11) | public class UnionpayPmentayNotificationHandle extends PmentayNotificati...
method UnionpayPmentayNotificationHandle (line 12) | public UnionpayPmentayNotificationHandle(String pkgtype, Notification ...
method handleNotification (line 16) | public void handleNotification(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/WechatPmentayNotificationHandle.java
class WechatPmentayNotificationHandle (line 11) | public class WechatPmentayNotificationHandle extends PmentayNotification...
method WechatPmentayNotificationHandle (line 12) | public WechatPmentayNotificationHandle(String pkgtype, Notification no...
method handleNotification (line 16) | public void handleNotification(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/XposedmodulePmentayNotificationHandle.java
class XposedmodulePmentayNotificationHandle (line 11) | public class XposedmodulePmentayNotificationHandle extends PmentayNotifi...
method XposedmodulePmentayNotificationHandle (line 12) | public XposedmodulePmentayNotificationHandle(String pkgtype, Notificat...
method handleNotification (line 16) | public void handleNotification(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/AuthorityUtil.java
class AuthorityUtil (line 7) | public class AuthorityUtil {
method isAccessibilitySettingsOn (line 8) | public static boolean isAccessibilitySettingsOn(Context mContext) {
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/ByteUtil.java
class ByteUtil (line 6) | public class ByteUtil {
method parseByte2HexStr (line 13) | public static String parseByte2HexStr(byte buf[]) {
method parseHexStr2Byte (line 31) | public static byte[] parseHexStr2Byte(String hexStr) {
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/Constants.java
class Constants (line 9) | public class Constants {
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/DataBaseHolder.java
class DataBaseHolder (line 8) | public class DataBaseHolder {
method DataBaseHolder (line 15) | private DataBaseHolder(){
method getInstance (line 20) | public static DataBaseHolder getInstance(){
method createDataBase (line 24) | private void createDataBase(){
method getDateBase (line 29) | public SQLiteDatabase getDateBase(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/DeviceInfoUtil.java
class DeviceInfoUtil (line 9) | public class DeviceInfoUtil {
method getUniquePsuedoID (line 14) | public static String getUniquePsuedoID() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/ExternalInfoUtil.java
class ExternalInfoUtil (line 11) | public class ExternalInfoUtil {
method getBanksMessageNum (line 72) | public static Map getBanksMessageNum(){
method getAllBanksNameMap (line 75) | public static Map getAllBanksNameMap(){
method getBankmessageFeature (line 78) | public static String[] getBankmessageFeature(){
method containsBankmessageFeature (line 81) | public static boolean containsBankmessageFeature(String content){
method getCustomPostOption (line 88) | public static Map getCustomPostOption(String custom){
method getCustomOption (line 93) | public static Map getCustomOption(String custom){
method getOneitemKeyandValue (line 108) | public static String[] getOneitemKeyandValue(String item){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/FileLogUtil.java
class FileLogUtil (line 16) | public class FileLogUtil extends FileUtils{
method clearLogFile (line 17) | public static boolean clearLogFile() {
method getLogList (line 34) | public static ArrayList getLogList(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/LogUtil.java
class LogUtil (line 13) | public class LogUtil {
method infoLog (line 17) | public static void infoLog(String info){
method debugLog (line 21) | public static void debugLog(String info){
method debugLogWithDeveloper (line 25) | public static void debugLogWithDeveloper(String info){
method debugLogWithJava (line 29) | public static void debugLogWithJava(String info){
method postRecordLog (line 33) | public static void postRecordLog(String tasknum,String post){
method postResultLog (line 39) | public static void postResultLog(String tasknum,String result,String r...
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/NetUtil.java
class NetUtil (line 31) | public class NetUtil {
method httppost (line 36) | public String httppost(String url, String json) throws IOException {
method httpspost (line 50) | public String httpspost(String url, String json) throws IOException {
method doHttpsWithApi19 (line 71) | public String doHttpsWithApi19(String url, String json) {
method getHttpsClientWithTrustAllCertificates (line 112) | private OkHttpClient getHttpsClientWithTrustAllCertificates() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/NotificationUtil.java
class NotificationUtil (line 18) | public class NotificationUtil {
method getNotitime (line 19) | private static String getNotitime(Notification notification){
method getNotiTitle (line 29) | private static String getNotiTitle(Bundle extras){
method getNotiContent (line 36) | private static String getNotiContent(Bundle extras){
method printNotify (line 43) | public static void printNotify(Notification notification){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/OneFileLogItem.java
class OneFileLogItem (line 3) | public class OneFileLogItem {
method getPlatName (line 4) | public String getPlatName(){
method getMoney (line 7) | public String getMoney(){
method getReply (line 10) | public String getReply(){
method isRandomSequenceNumberMatches (line 13) | public boolean isRandomSequenceNumberMatches(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/OneFileUtil.java
class OneFileUtil (line 17) | public class OneFileUtil{
method OneFileUtil (line 19) | public OneFileUtil(File file){
method clearOnegroup (line 22) | private String clearOnegroup(Deque<String> onegroup){
method mergeByFlagline (line 31) | public ArrayList mergeByFlagline(String startflagline,String endflagl...
method getFileList (line 52) | public ArrayList getFileList(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/PreferenceUtil.java
class PreferenceUtil (line 8) | public class PreferenceUtil {
method PreferenceUtil (line 12) | public PreferenceUtil(Context context) {
method init (line 17) | public void init() {
method getDeviceid (line 22) | public String getDeviceid() {
method isEncrypt (line 26) | public boolean isEncrypt() {
method isEcho (line 30) | public boolean isEcho() {
method isWakelock (line 34) | public boolean isWakelock() {
method isAppendDeviceiduuid (line 38) | public boolean isAppendDeviceiduuid() {
method isSkipEncryptDeviceid (line 42) | public boolean isSkipEncryptDeviceid() {
method isTrustAllCertificates (line 46) | public boolean isTrustAllCertificates() {
method isAccessibilityService (line 49) | public boolean isAccessibilityService() {
method isAgreeUserAgreement (line 52) | public boolean isAgreeUserAgreement(){
method setAgreeUserAgreement (line 55) | public void setAgreeUserAgreement(boolean flag){
method setNumOfPush (line 62) | public void setNumOfPush(String op){
method setPostUrl (line 73) | public void setPostUrl(String url) {
method getPostUrl (line 80) | public String getPostUrl(){
method getNumOfPush (line 83) | public int getNumOfPush(){
method getEchoServer (line 86) | public String getEchoServer() {
method getEchoInterval (line 90) | public String getEchoInterval() {
method getEncryptMethod (line 94) | public String getEncryptMethod() {
method getPasswd (line 98) | public String getPasswd() {
method isRemoveNotification (line 102) | public boolean isRemoveNotification() {
method isPostRepeat (line 106) | public boolean isPostRepeat() {
method getPostRepeatNum (line 110) | public String getPostRepeatNum() {
method getCustomOption (line 114) | public String getCustomOption() {
method getEchoCustomOption (line 117) | public String getEchoCustomOption() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/RandomUtil.java
class RandomUtil (line 10) | public class RandomUtil {
method getRandomTaskNum (line 11) | public static String getRandomTaskNum(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/SSLSocketFactoryCompat.java
class SSLSocketFactoryCompat (line 14) | public class SSLSocketFactoryCompat extends SSLSocketFactory{
method SSLSocketFactoryCompat (line 19) | public SSLSocketFactoryCompat() throws KeyManagementException, NoSuchA...
method SSLSocketFactoryCompat (line 25) | public SSLSocketFactoryCompat(SSLSocketFactory delegate) {
method getDefaultCipherSuites (line 32) | @Override
method getSupportedCipherSuites (line 37) | @Override
method enableTls12 (line 42) | private Socket enableTls12(Socket socket) {
method createSocket (line 51) | @Override
method createSocket (line 56) | @Override
method createSocket (line 61) | @Override
method createSocket (line 66) | @Override
method createSocket (line 71) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/UrlUtil.java
class UrlUtil (line 9) | public class UrlUtil {
method getCommonlyUsedUrls (line 11) | public static String [] getCommonlyUsedUrls(){
method isUrl (line 15) | public static boolean isUrl(String url) {
method getSearchUrl (line 24) | public static String getSearchUrl(String searchurl,String serchcontent) {
method httpOrHttps (line 28) | public static String httpOrHttps(String address){
method addressMatch (line 38) | public static String addressMatch(String address){
method addressMatchInHttps (line 67) | public static String addressMatchInHttps(String address){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/AES.java
class AES (line 8) | public class AES extends Encrypter {
method AES (line 9) | public AES(String key){
method transferMapValue (line 12) | public Map<String,String> transferMapValue(Map<String, String> params){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/DES.java
class DES (line 9) | public class DES extends Encrypter{
method DES (line 10) | public DES(String key){
method transferMapValue (line 14) | public Map<String,String> transferMapValue(Map<String, String> params){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/DESUtilWithIV.java
class DESUtilWithIV (line 19) | public class DESUtilWithIV{
method des (line 31) | public static String des(String content, String password, int type) {
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/EncryptFactory.java
class EncryptFactory (line 5) | public class EncryptFactory{
method EncryptFactory (line 7) | public EncryptFactory(String key){
method getEncrypter (line 10) | public Encrypter getEncrypter(String encrypt_type){
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/Encrypter.java
class Encrypter (line 4) | public abstract class Encrypter implements IDataTrans {
method Encrypter (line 6) | public Encrypter(String key){
method Encrypter (line 9) | public Encrypter(){}
method transferMapValue (line 10) | public abstract Map<String,String> transferMapValue(Map<String, String...
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/IDataTrans.java
type IDataTrans (line 3) | public interface IDataTrans{
method transferMapValue (line 4) | public Map<String,String> transferMapValue(Map<String, String> params);
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/MD5.java
class MD5 (line 11) | public class MD5 extends Encrypter {
method MD5 (line 12) | public MD5(String key) {
method MD5 (line 15) | public MD5(){
method transferMapValue (line 19) | public Map<String, String> transferMapValue(Map<String, String> params) {
method getMd5String (line 33) | public String getMd5String(String str) {
method getSignMd5 (line 48) | public String getSignMd5(String type, String price) {
method getSignMd5WithSecretkey (line 54) | public String getSignMd5WithSecretkey(String type, String price, Strin...
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/message/MessageConsumer.java
type MessageConsumer (line 3) | public interface MessageConsumer {
method subMessage (line 4) | public void subMessage();
FILE: app/src/main/java/com/weihuagu/receiptnotice/util/message/MessageSendBus.java
class MessageSendBus (line 7) | public class MessageSendBus {
method postActionRequestWithReturn (line 9) | public static void postActionRequestWithReturn(){
method postActionRequestWithHome (line 15) | public static void postActionRequestWithHome(){
method postMessageWithCommonAccessibilityEvent (line 21) | public static void postMessageWithCommonAccessibilityEvent(String event){
method postMessageWithFinishedonePost (line 26) | public static void postMessageWithFinishedonePost(String[] returnstr){
method postMessageWithReceiptAlipayTransfer (line 31) | public static void postMessageWithReceiptAlipayTransfer(String transfe...
method postMessageWithUpdateTheLastPostString (line 37) | public static void postMessageWithUpdateTheLastPostString(String str){
method postMessageWithget_alipay_transfer_money (line 41) | public static void postMessageWithget_alipay_transfer_money(AlipayTran...
method postInterfaceMessageWithUpdateTheRecordlist (line 48) | public static void postInterfaceMessageWithUpdateTheRecordlist(){
method userMessageWithSetPostUrl (line 55) | public static void userMessageWithSetPostUrl(String url){
method postTestMessageWithPostFullInformationMap (line 62) | public static void postTestMessageWithPostFullInformationMap(TestBean...
method postBaseTimeInterval (line 71) | public static void postBaseTimeInterval(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/FileLogActivity.java
class FileLogActivity (line 20) | public class FileLogActivity extends AppCompatActivity {
method onCreate (line 29) | @Override
method initView (line 37) | private void initView(){
method initLoglistView (line 44) | private void initLoglistView(boolean reverseorder){
method setLogText (line 68) | private void setLogText(){
method clearLog (line 77) | private void clearLog(){
method showReverse (line 82) | private void showReverse(){
method onCreateOptionsMenu (line 85) | @Override
method onOptionsItemSelected (line 93) | @Override
method onResume (line 111) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/FollowThirdAppActivity.java
class FollowThirdAppActivity (line 12) | public class FollowThirdAppActivity extends AppCompatActivity {
method onCreate (line 16) | @Override
method initView (line 21) | private void initView() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/HelloFragment.java
class HelloFragment (line 20) | public class HelloFragment extends Fragment {
method onCreateView (line 26) | @Override
method onActivityCreated (line 32) | @Override
method initView (line 39) | private void initView(){
method setTextWithNumofpush (line 46) | private void setTextWithNumofpush(){
method setTextWithPosturl (line 49) | private void setTextWithPosturl(){
method resetText (line 54) | private void resetText(){
method subMessage (line 58) | private void subMessage(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/HomeFragmentsAdapter.java
class HomeFragmentsAdapter (line 11) | public class HomeFragmentsAdapter extends FragmentStateAdapter {
method HomeFragmentsAdapter (line 14) | public HomeFragmentsAdapter(@NonNull FragmentActivity fragmentActivity) {
method createFragment (line 20) | @NonNull
method getItemCount (line 26) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/IllustrateDecryptActivity.java
class IllustrateDecryptActivity (line 11) | public class IllustrateDecryptActivity extends AppCompatActivity {
method initView (line 16) | private void initView() {
method onCreate (line 23) | @Override
method setText (line 31) | private void setText(){
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/LogListAdapter.java
class LogListAdapter (line 14) | public class LogListAdapter extends Adapter<LogListAdapter.RecyclerHolder>{
method LogListAdapter (line 18) | LogListAdapter(Context context){
method setLoglist (line 21) | public void setLoglist(ArrayList loglist){
method getItemCount (line 24) | @Override
method onBindViewHolder (line 30) | @Override
method onCreateViewHolder (line 42) | @Override
class RecyclerHolder (line 52) | class RecyclerHolder extends RecyclerView.ViewHolder {
method RecyclerHolder (line 54) | RecyclerHolder(View view){
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/LogListFragment.java
class LogListFragment (line 25) | public class LogListFragment extends Fragment implements MessageConsumer {
method onCreateView (line 31) | @Override
method onActivityCreated (line 36) | @Override
method initLoglistView (line 43) | private void initLoglistView(boolean reverseorder) {
method clearLog (line 60) | private void clearLog() {
method showReverse (line 67) | private void showReverse() {
method updateList (line 71) | private void updateList() {
method subMessage (line 78) | public void subMessage() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/MainActivity.java
class MainActivity (line 37) | public class MainActivity extends AppCompatActivity implements View.OnCl...
method onCreate (line 49) | @Override
method initView (line 59) | private void initView() {
method setListerner (line 79) | private void setListerner() {
method onResume (line 83) | @Override
method onDestroy (line 100) | @Override
method isNotificationServiceEnable (line 110) | private boolean isNotificationServiceEnable() {
method onClick (line 114) | @Override
method setPostUrl (line 127) | private void setPostUrl() {
method getPostUrl (line 135) | private String getPostUrl() {
method jumpUserAgreement (line 140) | private void jumpUserAgreement() {
method posturlSuggestion (line 146) | private void posturlSuggestion() {
method showLog (line 170) | private void showLog() {
method openLynxActivity (line 175) | private void openLynxActivity() {
method openSettingActivity (line 184) | private void openSettingActivity() {
method onCreateOptionsMenu (line 189) | @Override
method onOptionsItemSelected (line 197) | @Override
method showAgreeMentDialog (line 213) | private void showAgreeMentDialog() {
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/PreferenceActivity.java
class PreferenceActivity (line 14) | public class PreferenceActivity extends AppCompatActivity {
method onCreate (line 16) | @Override
class GeneralPreferenceFragment (line 23) | public static class GeneralPreferenceFragment extends PreferenceFragme...
method onCreate (line 24) | @Override
method onSharedPreferenceChanged (line 30) | @Override
method onResume (line 39) | @Override
method onPause (line 46) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/TestActiviy.java
class TestActiviy (line 18) | public class TestActiviy extends AppCompatActivity implements View.OnCli...
method onCreate (line 22) | @Override
method onClick (line 32) | @Override
FILE: app/src/main/java/com/weihuagu/receiptnotice/view/UserAgreementActiviy.java
class UserAgreementActiviy (line 11) | public class UserAgreementActiviy extends AppCompatActivity {
method onCreate (line 14) | @Override
FILE: app/src/test/java/com/weihuagu/receiptnotice/TestBankDistinguisher.java
class TestBankDistinguisher (line 8) | public class TestBankDistinguisher extends TestCase{
method setUp (line 10) | protected void setUp() throws Exception {
method testDistinguishByMessageContent (line 15) | @Test
method testExtractMoney (line 55) | @Test
method testExtractCardNum (line 65) | @Test
method testExtractTime (line 72) | @Test
FILE: app/src/test/java/com/weihuagu/receiptnotice/TestDES.java
class TestDES (line 10) | public class TestDES extends TestCase{
method setUp (line 12) | protected void setUp() throws Exception {
method testTransferMapValue (line 17) | @Test
FILE: app/src/test/java/com/weihuagu/receiptnotice/TestExternalInfoUtil.java
class TestExternalInfoUtil (line 11) | public class TestExternalInfoUtil extends TestCase{
method setUp (line 12) | protected void setUp() throws Exception {
method testGetCustomPostOption (line 16) | @Test
FILE: app/src/test/java/com/weihuagu/receiptnotice/TestOneFileUtil.java
class TestOneFileUtil (line 8) | public class TestOneFileUtil extends TestCase{
method setUp (line 10) | protected void setUp() throws Exception {
method testGetFileList (line 16) | @Test
Condensed preview — 120 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (266K chars).
[
{
"path": ".gitattributes",
"chars": 28,
"preview": "app/build.gradle merge=ours\n"
},
{
"path": ".github/FUNDING.yml",
"chars": 47,
"preview": "custom: ['https://weihuagu.github.io/donate/']\n"
},
{
"path": ".github/file_to_push_get_new_build",
"chars": 11,
"preview": "2023/01/28\n"
},
{
"path": ".github/workflows/android.yml",
"chars": 502,
"preview": "name: Android CI\n\non:\n push:\n branches: [ master ]\n pull_request:\n branches: [ master ]\n\njobs:\n build:\n\n run"
},
{
"path": ".gitignore",
"chars": 146,
"preview": "*.iml\n.*.swp\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeB"
},
{
"path": ".idea/codeStyles/Project.xml",
"chars": 3309,
"preview": "<component name=\"ProjectCodeStyleConfiguration\">\n <code_scheme name=\"Project\" version=\"173\">\n <codeStyleSettings lan"
},
{
"path": ".idea/gradle.xml",
"chars": 748,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"GradleMigrationSettings\" migrationVersio"
},
{
"path": ".idea/misc.xml",
"chars": 357,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"ProjectRootManager\" version=\"2\" language"
},
{
"path": ".idea/modules.xml",
"chars": 411,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"ProjectModuleManager\">\n <modules>\n "
},
{
"path": ".idea/runConfigurations.xml",
"chars": 564,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"RunConfigurationProducerService\">\n <o"
},
{
"path": ".idea/vcs.xml",
"chars": 167,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"VcsDirectoryMappings\">\n <mapping dire"
},
{
"path": "LICENSE",
"chars": 11605,
"preview": "Copyright (c) 2019-2030 \n\nmodified part\n\n内容\n1.每个人都可以逐字复制并且分发此协议,但不允许更改任何内容.\n2.此部分所叙述之内容高于以下部分,如果和之下的原基本参考协议有所冲突,采用本部分,即m"
},
{
"path": "README-zh.md",
"chars": 1048,
"preview": "### 提示\n- `很感谢你的使用`\n- `本软件是开源不盈利软件,没有所谓的定制版,不存在任何的收费QQ群,望周知`\n\n\n\n#### 软件规范及适用范围\n\n- 该软件的适用范围只限于帮助个人用户获取、收集自己的收款信息,它等效于您手工的获"
},
{
"path": "README.md",
"chars": 2431,
"preview": "# receiptnotice\n\n*This software is open source and not profitable software. There is no so-called customized version.The"
},
{
"path": "app/.gitignore",
"chars": 7,
"preview": "/build\n"
},
{
"path": "app/build.gradle",
"chars": 2095,
"preview": "apply plugin: 'com.android.application'\nandroid {\n compileSdkVersion 28\n defaultConfig {\n "
},
{
"path": "app/proguard-rules.pro",
"chars": 751,
"preview": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguar"
},
{
"path": "app/src/main/AndroidManifest.xml",
"chars": 3585,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n package="
},
{
"path": "app/src/main/assets/web/useragreement.html",
"chars": 215,
"preview": "<html>\n<head>\n <title>用户协议</title>\n</head>\n<body>\n<h4>软件规范及适用范围</h4>\n<p>\n - 该软件的适用范围只限于帮助个人用户获取、收集自己的收款信息,它等效于您手工的"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/DatabaseHelper.java",
"chars": 1037,
"preview": "package com.weihuagu.receiptnotice;\n\nimport android.content.Context;\nimport android.database.sqlite.SQLiteDatabase;\nimpo"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/ForTest.java",
"chars": 1999,
"preview": "package com.weihuagu.receiptnotice;\n\nimport android.app.Application;\nimport android.app.Notification;\nimport android.con"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/MainApplication.java",
"chars": 2491,
"preview": "package com.weihuagu.receiptnotice;\nimport android.app.Application;\nimport android.content.Intent;\nimport android.conten"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/NLService.java",
"chars": 5000,
"preview": "package com.weihuagu.receiptnotice;\nimport android.content.Intent;\nimport android.service.notification.NotificationListe"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/NotificationCollectorMonitorService.java",
"chars": 16799,
"preview": "package com.weihuagu.receiptnotice;;\n\nimport android.app.ActivityManager;\nimport android.app.Service;\nimport android.con"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/NotificationHandle.java",
"chars": 2700,
"preview": "package com.weihuagu.receiptnotice;\n\nimport android.app.Notification;\nimport android.app.PendingIntent;\nimport android.o"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/NotificationHandleFactory.java",
"chars": 2886,
"preview": "package com.weihuagu.receiptnotice;\nimport android.app.Notification;\nimport android.provider.Telephony.Sms;\n\nimport com."
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/OnlyWriteToDateBase.java",
"chars": 836,
"preview": "package com.weihuagu.receiptnotice;\n\nimport java.util.Map;\nimport com.weihuagu.receiptnotice.util.DataBaseHolder;\nimport"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/PmentayNotificationHandle.java",
"chars": 3005,
"preview": "package com.weihuagu.receiptnotice;\n\nimport android.app.Notification;\nimport android.service.notification.StatusBarNotif"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/ReceiptnoticeAccessibilityService.java",
"chars": 9115,
"preview": "package com.weihuagu.receiptnotice;\n\nimport android.accessibilityservice.AccessibilityService;\nimport android.accessibil"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/TestBeanWithPostFullInformationMap.java",
"chars": 650,
"preview": "package com.weihuagu.receiptnotice;\n\nimport java.util.Map;\n\npublic class TestBeanWithPostFullInformationMap {\n privat"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/action/ActionStatusBarNotification.java",
"chars": 218,
"preview": "package com.weihuagu.receiptnotice.action;\nimport android.service.notification.StatusBarNotification;\n\npublic interface "
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/action/AsyncResponse.java",
"chars": 269,
"preview": "package com.weihuagu.receiptnotice.action;\n\nimport java.util.List;\nimport java.util.Map;\n\npublic interface AsyncResponse"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/action/HandlePost.java",
"chars": 3066,
"preview": "package com.weihuagu.receiptnotice.action;\n\nimport android.content.SharedPreferences;\n\n\nimport com.weihuagu.receiptnotic"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/action/IDoPost.java",
"chars": 151,
"preview": "package com.weihuagu.receiptnotice.action;\nimport java.util.Map;\n\npublic interface IDoPost{\n public void doPost("
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/action/PostTask.java",
"chars": 4518,
"preview": "package com.weihuagu.receiptnotice.action;\n\nimport android.os.AsyncTask;\nimport java.util.Map;\nimport java.util.HashMap;"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/audiorecognize/AudioHub.java",
"chars": 2005,
"preview": "package com.weihuagu.receiptnotice.audiorecognize;\nimport java.io.File;\nimport java.io.IOException;\nimport java.util.Col"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/audiorecognize/RecordService.java",
"chars": 492,
"preview": "package com.weihuagu.receiptnotice.audiorecognize;\n\nimport android.app.Service;\nimport android.content.Intent;\nimport an"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/filteringmiddleware/AlipayTransferBean.java",
"chars": 411,
"preview": "package com.weihuagu.receiptnotice.filteringmiddleware;\n\npublic class AlipayTransferBean {\n public String getNum() {"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/filteringmiddleware/PostMapFilter.java",
"chars": 2903,
"preview": "package com.weihuagu.receiptnotice.filteringmiddleware;\n\nimport com.weihuagu.receiptnotice.util.DeviceInfoUtil;\nimport c"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/AlipayPmentayNotificationHandle.java",
"chars": 5584,
"preview": "package com.weihuagu.receiptnotice.pushclassification.pmentay;\nimport android.app.Notification;\nimport androidx.annotati"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/BankDistinguisher.java",
"chars": 3725,
"preview": "package com.weihuagu.receiptnotice.pushclassification.pmentay;\n\nimport com.weihuagu.receiptnotice.util.ExternalInfoUtil;"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/BanksProxy.java",
"chars": 1637,
"preview": "package com.weihuagu.receiptnotice.pushclassification.pmentay;\nimport android.app.Notification;\n\nimport com.weihuagu.rec"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/CashbarPmentayNotificationHandle.java",
"chars": 2052,
"preview": "package com.weihuagu.receiptnotice.pushclassification.pmentay;\nimport android.app.Notification;\n\nimport com.weihuagu.rec"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/IcbcelifePmentayNotificationHandle.java",
"chars": 2064,
"preview": "package com.weihuagu.receiptnotice.pushclassification.pmentay;\nimport android.app.Notification;\n\nimport com.weihuagu.rec"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/MipushPmentayNotificationHandle.java",
"chars": 3500,
"preview": "package com.weihuagu.receiptnotice.pushclassification.pmentay;\nimport android.app.Notification;\n\nimport com.weihuagu.rec"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/UnionpayPmentayNotificationHandle.java",
"chars": 1183,
"preview": "package com.weihuagu.receiptnotice.pushclassification.pmentay;\nimport android.app.Notification;\n\nimport com.weihuagu.rec"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/WechatPmentayNotificationHandle.java",
"chars": 1876,
"preview": "package com.weihuagu.receiptnotice.pushclassification.pmentay;\nimport android.app.Notification;\n\nimport com.weihuagu.rec"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/pushclassification/pmentay/XposedmodulePmentayNotificationHandle.java",
"chars": 1190,
"preview": "package com.weihuagu.receiptnotice.pushclassification.pmentay;\nimport android.app.Notification;\n\nimport com.weihuagu.rec"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/AuthorityUtil.java",
"chars": 1843,
"preview": "package com.weihuagu.receiptnotice.util;\n\nimport android.content.Context;\nimport android.provider.Settings;\nimport andro"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/ByteUtil.java",
"chars": 1386,
"preview": "/*\n *下面两个自己字节的函数源自GcsSloop\n *GitHub: https://github.com/GcsSloop\n */\npackage com.weihuagu.receiptnotice.util;\npublic cla"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/Constants.java",
"chars": 5365,
"preview": "/*\n * Created By WeihuaGu (email:weihuagu_work@163.com)\n * Copyright (c) 2017\n * All right reserved.\n */\n\npackage com.we"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/DataBaseHolder.java",
"chars": 862,
"preview": "package com.weihuagu.receiptnotice.util;\n\nimport android.database.sqlite.SQLiteDatabase;\n\nimport com.weihuagu.receiptnot"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/DeviceInfoUtil.java",
"chars": 2357,
"preview": "/*\n * Created By WeihuaGu (email:weihuagu_work@163.com)\n */\n\npackage com.weihuagu.receiptnotice.util;\nimport android.os"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/ExternalInfoUtil.java",
"chars": 3504,
"preview": "/*\n * Created By WeihuaGu (email:weihuagu_work@163.com)\n * Copyright (c) 2017\n * All right reserved.\n */\n\npackage com.we"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/FileLogUtil.java",
"chars": 1607,
"preview": "/*\n * Created By WeihuaGu (email:weihuagu_work@163.com)\n * Copyright (c) 2017\n * All right reserved.\n */\n\npackage com.we"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/LogUtil.java",
"chars": 1511,
"preview": "/*\n * Created By WeihuaGu (email:weihuagu_work@163.com)\n * Copyright (c) 2017\n * All right reserved.\n */\n\npackage com.we"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/NetUtil.java",
"chars": 5741,
"preview": "package com.weihuagu.receiptnotice.util;\n\nimport android.os.Build;\n\nimport com.weihuagu.receiptnotice.MainApplication;\n\n"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/NotificationUtil.java",
"chars": 1623,
"preview": "/*\n * Created By WeihuaGu (email:weihuagu_work@163.com)\n * Copyright (c) 2017\n * All right reserved.\n */\n\npackage com.we"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/OneFileLogItem.java",
"chars": 327,
"preview": "package com.weihuagu.receiptnotice.util;\n\npublic class OneFileLogItem {\n public String getPlatName(){\n return "
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/OneFileUtil.java",
"chars": 2839,
"preview": "/*\n * Created By WeihuaGu (email:weihuagu_work@163.com)\n * Copyright (c) 2017\n * All right reserved.\n */\n\npackage com.we"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/PreferenceUtil.java",
"chars": 3466,
"preview": "package com.weihuagu.receiptnotice.util;\n\nimport android.content.Context;\nimport android.content.SharedPreferences;\nimpo"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/RandomUtil.java",
"chars": 355,
"preview": "/*\n * Created By WeihuaGu (email:weihuagu_work@163.com)\n * Copyright (c) 2017\n * All right reserved.\n */\n\npackage com.we"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/SSLSocketFactoryCompat.java",
"chars": 2461,
"preview": "package com.weihuagu.receiptnotice.util;\nimport android.os.Build;\n\nimport java.io.IOException;\nimport java.net.InetAddre"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/UrlUtil.java",
"chars": 2245,
"preview": "/*\n * Created By WeihuaGu (email:weihuagu_work@163.com)\n * Copyright (c) 2017\n * All right reserved.\n */\n\npackage com.we"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/AES.java",
"chars": 1077,
"preview": "package com.weihuagu.receiptnotice.util.encrypt;\nimport com.weihuagu.receiptnotice.util.encrypt.Encrypter;\n\nimport java."
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/DES.java",
"chars": 934,
"preview": "package com.weihuagu.receiptnotice.util.encrypt;\nimport com.weihuagu.receiptnotice.util.LogUtil;\n\nimport java.util.Map;\n"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/DESUtilWithIV.java",
"chars": 2197,
"preview": "package com.weihuagu.receiptnotice.util.encrypt;\nimport android.annotation.SuppressLint;\nimport androidx.annotation.IntD"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/EncryptFactory.java",
"chars": 674,
"preview": "package com.weihuagu.receiptnotice.util.encrypt;\n\nimport com.weihuagu.receiptnotice.util.LogUtil;\n\npublic class EncryptF"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/Encrypter.java",
"chars": 304,
"preview": "package com.weihuagu.receiptnotice.util.encrypt;\n\nimport java.util.Map;\npublic abstract class Encrypter implements IData"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/IDataTrans.java",
"chars": 213,
"preview": "package com.weihuagu.receiptnotice.util.encrypt;\nimport java.util.Map; \npublic interfac"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/encrypt/MD5.java",
"chars": 1848,
"preview": "package com.weihuagu.receiptnotice.util.encrypt;\n\nimport com.weihuagu.receiptnotice.util.ByteUtil;\nimport com.weihuagu.r"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/message/MessageConsumer.java",
"chars": 117,
"preview": "package com.weihuagu.receiptnotice.util.message;\n\npublic interface MessageConsumer {\n public void subMessage();\n}\n"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/util/message/MessageSendBus.java",
"chars": 2322,
"preview": "package com.weihuagu.receiptnotice.util.message;\n\nimport com.jeremyliao.liveeventbus.LiveEventBus;\nimport com.weihuagu.r"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/FileLogActivity.java",
"chars": 4287,
"preview": "package com.weihuagu.receiptnotice.view;\n\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport android.os.Bu"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/FollowThirdAppActivity.java",
"chars": 775,
"preview": "package com.weihuagu.receiptnotice.view;\n\nimport android.os.Bundle;\nimport android.widget.EditText;\nimport android.widge"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/HelloFragment.java",
"chars": 3012,
"preview": "package com.weihuagu.receiptnotice.view;\n\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.v"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/HomeFragmentsAdapter.java",
"chars": 901,
"preview": "package com.weihuagu.receiptnotice.view;\n\n\nimport androidx.annotation.NonNull;\nimport androidx.fragment.app.Fragment;\nim"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/IllustrateDecryptActivity.java",
"chars": 2207,
"preview": "package com.weihuagu.receiptnotice.view;\n\nimport android.os.Bundle;\nimport androidx.annotation.Nullable;\nimport androidx"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/LogListAdapter.java",
"chars": 1896,
"preview": "package com.weihuagu.receiptnotice.view;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport androidx.recycl"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/LogListFragment.java",
"chars": 3058,
"preview": "package com.weihuagu.receiptnotice.view;\n\nimport android.os.Bundle;\nimport android.view.LayoutInflater;\nimport android.v"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/MainActivity.java",
"chars": 7883,
"preview": "package com.weihuagu.receiptnotice.view;\n\nimport androidx.appcompat.app.AlertDialog;\nimport androidx.appcompat.app.AppCo"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/PreferenceActivity.java",
"chars": 1998,
"preview": "package com.weihuagu.receiptnotice.view;\nimport android.content.Intent;\nimport android.content.SharedPreferences;\nimport"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/TestActiviy.java",
"chars": 1057,
"preview": "package com.weihuagu.receiptnotice.view;\n\nimport android.os.Bundle;\nimport android.webkit.WebView;\nimport android.widget"
},
{
"path": "app/src/main/java/com/weihuagu/receiptnotice/view/UserAgreementActiviy.java",
"chars": 634,
"preview": "package com.weihuagu.receiptnotice.view;\n\nimport android.os.Bundle;\nimport android.webkit.WebView;\n\nimport androidx.anno"
},
{
"path": "app/src/main/res/drawable/ic_launcher_background.xml",
"chars": 5606,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:wi"
},
{
"path": "app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
"chars": 1880,
"preview": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:aapt=\"http://schemas.android.com/aapt\"\n "
},
{
"path": "app/src/main/res/layout/activity_followthirdapp.xml",
"chars": 2792,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas."
},
{
"path": "app/src/main/res/layout/activity_illustratedecrypt.xml",
"chars": 3659,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout\n xmlns:android=\"http://"
},
{
"path": "app/src/main/res/layout/activity_log.xml",
"chars": 1643,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout\n xmlns:android=\"http://"
},
{
"path": "app/src/main/res/layout/activity_main.xml",
"chars": 2728,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas."
},
{
"path": "app/src/main/res/layout/activity_test.xml",
"chars": 2680,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas."
},
{
"path": "app/src/main/res/layout/activity_useragreement.xml",
"chars": 647,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas."
},
{
"path": "app/src/main/res/layout/fragment_hello.xml",
"chars": 2430,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas."
},
{
"path": "app/src/main/res/layout/fragment_loglist.xml",
"chars": 732,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout\n xmlns:android=\"http://sche"
},
{
"path": "app/src/main/res/layout/item_home_viewpage_fragment.xml",
"chars": 623,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.cardview.widget.CardView\n xmlns:card_view=\"http://schemas.android.co"
},
{
"path": "app/src/main/res/layout/item_log_text.xml",
"chars": 623,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.cardview.widget.CardView\n xmlns:card_view=\"http://schemas.android.co"
},
{
"path": "app/src/main/res/menu/log.xml",
"chars": 299,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item andro"
},
{
"path": "app/src/main/res/menu/main.xml",
"chars": 211,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<menu xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <item andro"
},
{
"path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
"chars": 272,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <b"
},
{
"path": "app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
"chars": 272,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <b"
},
{
"path": "app/src/main/res/values/colors.xml",
"chars": 208,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <color name=\"colorPrimary\">#3F51B5</color>\n <color name=\"color"
},
{
"path": "app/src/main/res/values/strings.xml",
"chars": 1172,
"preview": "<resources>\n <string name=\"app_name\">receiptnotice</string>\n <string name=\"text_setting\">Setting</string>\n"
},
{
"path": "app/src/main/res/values/styles.xml",
"chars": 383,
"preview": "<resources>\n\n <!-- Base application theme. -->\n <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
},
{
"path": "app/src/main/res/values-zh/strings.xml",
"chars": 760,
"preview": "<resources>\n <string name=\"app_name\">接收推送</string>\n <string name=\"filelog_title\">推送记录</string>\n <st"
},
{
"path": "app/src/main/res/xml/network_security_config.xml",
"chars": 148,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<network-security-config>\n <base-config cleartextTrafficPermitted=\"true\" /"
},
{
"path": "app/src/main/res/xml/pref_general.xml",
"chars": 6748,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<PreferenceScreen xmlns:android=\"http://schemas.android.com/apk/res/android\" >\n "
},
{
"path": "app/src/main/res/xml/pref_headers.xml",
"chars": 266,
"preview": "<preference-headers xmlns:android=\"http://schemas.android.com/apk/res/android\">\n <!--启动指定PreferenceFragment-->\n <h"
},
{
"path": "app/src/main/res/xml/receiptnoticeaccessibilityservice_config.xml",
"chars": 581,
"preview": "<?xml version =\"1.0\" encoding =\"utf-8\"?>\n<accessibility-service xmlns:android=\"http://schemas.android.com/apk/res/androi"
},
{
"path": "app/src/test/java/com/weihuagu/receiptnotice/TestBankDistinguisher.java",
"chars": 3971,
"preview": "package com.weihuagu.receiptnotice;\nimport com.weihuagu.receiptnotice.pushclassification.pmentay.BankDistinguisher;\n\nimp"
},
{
"path": "app/src/test/java/com/weihuagu/receiptnotice/TestDES.java",
"chars": 806,
"preview": "package com.weihuagu.receiptnotice;\nimport com.weihuagu.receiptnotice.util.encrypt.DES;\n\nimport junit.framework.TestCase"
},
{
"path": "app/src/test/java/com/weihuagu/receiptnotice/TestExternalInfoUtil.java",
"chars": 893,
"preview": "package com.weihuagu.receiptnotice;\nimport com.weihuagu.receiptnotice.util.ExternalInfoUtil;\n\nimport junit.framework.Tes"
},
{
"path": "app/src/test/java/com/weihuagu/receiptnotice/TestOneFileUtil.java",
"chars": 863,
"preview": "package com.weihuagu.receiptnotice;\nimport com.weihuagu.receiptnotice.util.OneFileUtil;\n\nimport junit.framework.TestCase"
},
{
"path": "build.gradle",
"chars": 907,
"preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n \n"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 232,
"preview": "#Thu Dec 05 09:29:01 CST 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_"
},
{
"path": "gradle.properties",
"chars": 846,
"preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
},
{
"path": "gradlew",
"chars": 4971,
"preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n## Gradle start "
},
{
"path": "gradlew.bat",
"chars": 2314,
"preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
},
{
"path": "settings.gradle",
"chars": 15,
"preview": "include ':app'\n"
}
]
// ... and 2 more files (download for full content)
About this extraction
This page contains the full source code of the c-kzxvldkhX/receiptnotice GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 120 files (233.8 KB), approximately 55.3k tokens, and a symbol index with 397 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.