Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenMushroomNew committed Feb 19, 2021
1 parent 5509fbb commit c75a73b
Show file tree
Hide file tree
Showing 269 changed files with 46,762 additions and 23 deletions.
29 changes: 6 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
# Compiled class file
*.class

# Log file
*.log

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.gradle
.idea
build
local.properties
app/.cxx
app/gm.jks
67 changes: 67 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apply plugin: 'com.android.application'

android {
signingConfigs {
release {
storeFile file('C:/Users/ASUS/Documents/GitHub/TiebaTS/app/gm.jks')
storePassword 'gmgmgm'
keyAlias 'key0'
keyPassword '123456'
}
}
compileSdkVersion 30

defaultConfig {
applicationId 'gm.tieba.tabswitch'
minSdkVersion 23
targetSdkVersion 30
versionCode 8
versionName "2.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
multiDexEnabled false
ndk{
abiFilters 'armeabi-v7a'
}
}
buildTypes {
debug {
signingConfig signingConfigs.release
}
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
externalNativeBuild {
buildToolsVersion '30.0.2'
cmake {
path file('/src/main/cpp/CMakeLists.txt')
}
}
buildFeatures {
viewBinding true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
compileOnly files('libs/XposedBridgeApi-89.jar')
implementation files('libs/apksigner.jar')
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: '5.0.0-alpha.2'
implementation group: 'com.alibaba', name: 'fastjson', version: '1.2.75'
}
Binary file added app/libs/XposedBridgeApi-89.jar
Binary file not shown.
Binary file added app/libs/apksigner.jar
Binary file not shown.
4 changes: 4 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-repackageclasses "gm.tieba.tabswitch"
-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*,!code/allocation/variable
-keepclassmembers class gm.tieba.tabswitch.ui.MainActivity {public static boolean isModuleActive();}
-keep class gm.tieba.tabswitch.Hook
70 changes: 70 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="gm.tieba.tabswitch">

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission
android:name="android.permission.QUERY_ALL_PACKAGES"
tools:ignore="QueryAllPackagesPermission" />

<queries>
<package android:name="io.github.lsposed.manager" />
<package android:name="com.baidu.tieba" />
<package android:name="com.eg.android.AlipayGphone" />
<package android:name="com.tencent.mm" />
<package android:name="bin.mt.plus" />
</queries>
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.TS">
<activity
android:name="gm.tieba.tabswitch.ui.MainActivity"
android:enabled="false"
android:theme="@style/Theme.Launch">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity-alias
android:name=".MainActivityAlias"
android:targetActivity=".ui.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="de.robv.android.xposed.category.MODULE_SETTINGS" />
</intent-filter>
</activity-alias>

<activity android:name="gm.tieba.tabswitch.ui.LicenseActivity" />
<activity android:name="gm.tieba.tabswitch.ui.DonationActivity" />

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="gm.FileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths" />
</provider>

<meta-data
android:name="xposedmodule"
android:value="true" />
<meta-data
android:name="xposeddescription"
android:value="@string/description" />
<meta-data
android:name="xposedminversion"
android:value="53" />
<meta-data
android:name="xposedscope"
android:resource="@array/recommend_package" />
</application>
</manifest>
Binary file added app/src/main/assets/android.keystore
Binary file not shown.
Binary file added app/src/main/assets/arm64-v8a/libsandhook.so
Binary file not shown.
Binary file added app/src/main/assets/armeabi-v7a/libsandhook.so
Binary file not shown.
Binary file added app/src/main/assets/classes.dex
Binary file not shown.
1 change: 1 addition & 0 deletions app/src/main/assets/xposed_init
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
gm.tieba.tabswitch.Hook
23 changes: 23 additions & 0 deletions app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 3.10.2)
project("TiebaTS")

add_library(crust SHARED crust.cpp)


find_library( # Sets the name of the path variable.
log-lib

# Specifies the name of the NDK library that
# you want CMake to locate.
log )

# Specifies libraries CMake should link to your target library. You
# can link multiple libraries, such as libraries you define in this
# build script, prebuilt third-party libraries, or system libraries.

target_link_libraries( # Specifies the target library.
crust

# Links the target library to the log library
# included in the NDK.
${log-lib} )
33 changes: 33 additions & 0 deletions app/src/main/cpp/crust.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <android/log.h>
#include <string>
#include <cstring>
#include <jni.h>

#define LOGINFO(...) ((void)__android_log_print(ANDROID_LOG_INFO, "security", __VA_ARGS__))
#define LOGERROR(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "security", __VA_ARGS__))

jint JNI_OnLoad(JavaVM *vm, void *reserved) {
JNIEnv *env = nullptr;
if (vm->GetEnv((void **) &env, JNI_VERSION_1_4) != JNI_OK) {
return JNI_ERR;
}
return JNI_OK;
}

static jobject getApplication(JNIEnv *env) {
jobject application = nullptr;
jclass activity_thread_clz = env->FindClass("android/app/ActivityThread");
if (activity_thread_clz != nullptr) {
jmethodID currentApplication = env->GetStaticMethodID(
activity_thread_clz, "currentApplication", "()Landroid/app/Application;");
if (currentApplication != nullptr) {
application = env->CallStaticObjectMethod(activity_thread_clz, currentApplication);
} else {
LOGERROR("Cannot find method: currentApplication() in ActivityThread.");
}
env->DeleteLocalRef(activity_thread_clz);
} else {
LOGERROR("Cannot find class: android.app.ActivityThread");
}
return application;
}
14 changes: 14 additions & 0 deletions app/src/main/cpp/crust.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// Created by ASUS on 2021/2/11.
//

#ifndef 贴吧TS_CRUST_H
#define 贴吧TS_CRUST_H


class crust {

};


#endif //贴吧TS_CRUST_H
Loading

0 comments on commit c75a73b

Please sign in to comment.