diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3543521 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/build diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..7248fd5 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,26 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 29 + buildToolsVersion "29.0.3" + + defaultConfig { + applicationId "com.easy.tgPlus" + minSdkVersion 19 + targetSdkVersion 23 + versionCode 1 + versionName "1.0" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } +} + +dependencies { + compile files('libs/XposedBridgeAPI-89.jar') + //implementation fileTree(dir: "libs", include: ["*.jar"]) +} diff --git a/app/libs/XposedBridgeAPI-89.jar b/app/libs/XposedBridgeAPI-89.jar new file mode 100644 index 0000000..21be1c6 Binary files /dev/null and b/app/libs/XposedBridgeAPI-89.jar differ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..64b4a05 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# 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 \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..c7316fd --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/assets/xposed_init b/app/src/main/assets/xposed_init new file mode 100644 index 0000000..d815782 --- /dev/null +++ b/app/src/main/assets/xposed_init @@ -0,0 +1 @@ +com.easy.tgPlus.Leader diff --git a/app/src/main/java/com/easy/tgPlus/Leader.java b/app/src/main/java/com/easy/tgPlus/Leader.java new file mode 100644 index 0000000..c13943f --- /dev/null +++ b/app/src/main/java/com/easy/tgPlus/Leader.java @@ -0,0 +1,179 @@ +package com.easy.tgPlus; + +import de.robv.android.xposed.IXposedHookInitPackageResources; +import de.robv.android.xposed.IXposedHookLoadPackage; +import de.robv.android.xposed.XposedBridge; +import de.robv.android.xposed.XposedHelpers; +import de.robv.android.xposed.callbacks.XC_InitPackageResources; +import de.robv.android.xposed.callbacks.XC_LoadPackage; +import android.content.res.XModuleResources; +import android.content.res.XResources; +import de.robv.android.xposed.XC_MethodHook; +import java.lang.reflect.Field; +import java.util.HashMap; +import java.text.SimpleDateFormat; +import de.robv.android.xposed.XC_MethodReplacement; +import java.util.List; +import java.util.Arrays; +import android.widget.LinearLayout; +import android.view.View; +import android.content.Context; +import android.widget.Toast; +import android.view.ViewGroup; +import android.text.SpannableStringBuilder; +import java.util.ArrayList; + +public class Leader implements IXposedHookLoadPackage,IXposedHookInitPackageResources { + + public static final List hookPackages = Arrays.asList("org.telegram.messenger", "org.telegram.messenger.web", "org.telegram.messenger.beta", "nekox.messenger", "com.cool2645.nekolite", "org.telegram.plus", "com.iMe.android", "org.telegram.BifToGram", "ua.itaysonlab.messenger", "org.forkclient.messenger", "org.forkclient.messenger.beta", "org.aka.messenger", "ellipi.messenger", "org.nift4.catox", "it.owlgram.android"); + + boolean isTargetPackage; + + int res_msg_send_Id = 0; + + //Context con = AndroidAppHelper.currentApplication(); + + @Override + public void handleInitPackageResources(XC_InitPackageResources.InitPackageResourcesParam resparam) throws Throwable { + + if (!hookPackages.contains(resparam.packageName))return; + + String resPackageName = resparam.res.getPackageName(); + XposedBridge.log("资源包:" + resPackageName + "已处理"); + int delete = resparam.res.getIdentifier("Delete", "string", resPackageName); + String rawStr = resparam.res.getString(delete); + resparam.res.setReplacement(delete, "(删除)"); + logStringResHook(delete, rawStr); + + int en = resparam.res.getIdentifier("EditName", "string", resPackageName); + rawStr = resparam.res.getString(en); + resparam.res.setReplacement(en, "(编辑名称)"); + logStringResHook(en, rawStr); + + res_msg_send_Id = resparam.res.getIdentifier("msg_send", "drawable", resPackageName); + + if (resparam.packageName.equals("org.telegram.messenger.web")) { + int id = resparam.res.getIdentifier("AppName", "string", resPackageName); + rawStr = resparam.res.getString(id); + resparam.res.setReplacement(en, "Telegram(Web)"); + logStringResHook(id, rawStr); + + id = resparam.res.getIdentifier("Page1Title", "string", resPackageName); + rawStr = resparam.res.getString(id); + resparam.res.setReplacement(en, "Telegram(Web)"); + logStringResHook(id, rawStr); + return; + } + + } + + + @Override + public void handleLoadPackage(final XC_LoadPackage.LoadPackageParam lpparam) throws Throwable { + if (lpparam.packageName.equals("com.easy.tgPlus")) { + Class mainActivity = lpparam.classLoader.loadClass("com.easy.tgPlus.MainActivity"); + XposedHelpers.findAndHookMethod(mainActivity, "isActivate", XC_MethodReplacement.returnConstant(true)); + return; + } + + if (!hookPackages.contains(lpparam.packageName))return; + + final boolean isWebPackage = lpparam.packageName.equals("org.telegram.messenger.web"); + + XposedBridge.log(isWebPackage ?"TG(Web)运行~": "TG运行~" + new SimpleDateFormat("yyyy年MM月dd日 a hh:mm:ss").format(System.currentTimeMillis()) + "\n"); + XposedBridge.log("Hook~\n"); + XposedHelpers.findAndHookConstructor("org.telegram.messenger.LocaleController", lpparam.classLoader, new XC_MethodHook(){ + @Override + protected void afterHookedMethod(MethodHookParam param) throws Throwable { + //实例化之后执行 + Object mLocaleController = param.thisObject; + HashMap mlocaleValues = (HashMap)XposedHelpers.getObjectField(mLocaleController, "localeValues"); + mlocaleValues.put("Delete", "(删除)"); + if (isWebPackage) { + mlocaleValues.put("AppName", "Telegram(Web)"); + mlocaleValues.put("Page1Title", "Telegram(Web)"); + } + } + }); + + //解锁复制保存 + XposedHelpers.findAndHookMethod("org.telegram.messenger.MessagesController", lpparam.classLoader, "isChatNoForwards", lpparam.classLoader.loadClass("org.telegram.tgnet.TLRPC$Chat"), XC_MethodReplacement.returnConstant(false)); + + //if(true)return; + + //复读机 + final Class AndroidUtilities = lpparam.classLoader.loadClass("org.telegram.messenger.AndroidUtilities"); + final Class abm = lpparam.classLoader.loadClass("org.telegram.ui.ActionBar.ActionBarMenuSubItem"); + XposedHelpers.findAndHookMethod("org.telegram.ui.Components.ChatScrimPopupContainerLayout", lpparam.classLoader, "setPopupWindowLayout", lpparam.classLoader.loadClass("org.telegram.ui.ActionBar.ActionBarPopupWindow$ActionBarPopupWindowLayout"), new XC_MethodHook(){ + @Override + protected void beforeHookedMethod(MethodHookParam param) { + Object t = param.thisObject; + XposedBridge.log(t.toString()); + final Object main = XposedHelpers.getObjectField(t, "this$0"); + final Context con = (Context)XposedHelpers.callMethod(main, "getParentActivity"); + Object popupLayout = param.args[0]; + Object fd = XposedHelpers.newInstance(abm, new Class[]{Context.class,boolean.class,boolean.class}, new Object[]{con,false,false}); + //如果dp函数在回调外面调用,emoji会缩成一坨 + int dp200 = XposedHelpers.callStaticMethod(AndroidUtilities, "dp", new Class[]{float.class}, new Object[]{200f}); + XposedHelpers.callMethod(fd, "setMinimumWidth", new Class[]{int.class}, new Object[]{dp200}); + XposedHelpers.callMethod(fd, "setTextAndIcon", new Class[]{String.class,int.class}, new Object[]{"+1",res_msg_send_Id}); + XposedHelpers.callMethod(fd, "setOnClickListener", new Class[]{View.OnClickListener.class}, new Object[]{new View.OnClickListener(){ + + @Override + public void onClick(View v) { + XposedHelpers.callMethod(main, "closeMenu", new Class[]{boolean.class}, new Object[]{true}); + Object selectedObject = XposedHelpers.getObjectField(main,"selectedObject"); + Object selectedObjectGroup = XposedHelpers.getObjectField(main,"selectedObjectGroup"); + SpannableStringBuilder content = (SpannableStringBuilder)XposedHelpers.callMethod(main,"getMessageContent",new Class[]{selectedObject.getClass(),long.class,boolean.class},new Object[]{selectedObject,0,false}); + Object sendMsgHelper = XposedHelpers.callMethod(main,"getSendMessagesHelper"); + + try { + Class msgObj = lpparam.classLoader.loadClass("org.telegram.messenger.MessageObject"); + Class rpcWebPage = lpparam.classLoader.loadClass("org.telegram.tgnet.TLRPC$WebPage"); + Class rpcReplyMarkup = lpparam.classLoader.loadClass("org.telegram.tgnet.TLRPC$ReplyMarkup"); + Class msgObjSendData = lpparam.classLoader.loadClass("org.telegram.messenger.MessageObject$SendAnimationData"); + //这里还需要判断消息类型调用对应的send方法 + XposedHelpers.callMethod(sendMsgHelper, "sendMessage", new Class[]{String.class,long.class,msgObj,msgObj,rpcWebPage,boolean.class,ArrayList.class,rpcReplyMarkup,HashMap.class,boolean.class,int.class,msgObjSendData,boolean.class}, new Object[]{content.toString(),XposedHelpers.getObjectField(main,"dialog_id"),null, null, null, false, null, null, null, true, 0, null, false}); + Toast.makeText(con, "复读机:"+content.toString() ,Toast.LENGTH_SHORT).show(); + } catch (ClassNotFoundException e) { + XposedBridge.log(e); + } + + } + }}); + XposedHelpers.callMethod(popupLayout, "addView", new Class[]{View.class}, new Object[]{fd}); + } + }); + + //debug + if (isWebPackage) { + //打印getString调用堆栈 + XposedHelpers.findAndHookMethod("org.telegram.messenger.LocaleController", lpparam.classLoader, "getString", String.class , int.class, new XC_MethodHook(){ + @Override + protected void beforeHookedMethod(MethodHookParam param) throws Throwable { + if ((int)param.args[1] == res_msg_send_Id) { + // 获取调用堆栈信息 + StringBuilder sb = new StringBuilder(); + StackTraceElement[] stackElements = Thread.currentThread().getStackTrace(); + if (stackElements != null) { + for (int i = 0; i < stackElements.length; i++) { + sb.append("\tat "); + sb.append(stackElements[i].getClassName()).append("."); + sb.append(stackElements[i].getMethodName()); + sb.append("(").append(stackElements[i].getFileName()).append(":"); + sb.append(stackElements[i].getLineNumber()).append(")\n"); + } + } + XposedBridge.log(sb.toString()); + } + } + }); + } + + } + + public static void logStringResHook(int id, String rawStr) { + XposedBridge.log("资源id:" + Integer.toHexString(id) + "(\"" + rawStr + "\")hook成功~\n"); + } + +} diff --git a/app/src/main/java/com/easy/tgPlus/MainActivity.java b/app/src/main/java/com/easy/tgPlus/MainActivity.java new file mode 100644 index 0000000..e613784 --- /dev/null +++ b/app/src/main/java/com/easy/tgPlus/MainActivity.java @@ -0,0 +1,71 @@ +package com.easy.tgPlus; + +import android.app.Activity; +import android.os.Bundle; +import android.widget.LinearLayout; +import android.widget.Button; +import android.view.Gravity; +import android.view.View; +import android.widget.Toast; +import android.widget.TextView; + +public class MainActivity extends Activity { + + private View.OnClickListener myOnclick = new View.OnClickListener(){ + + @Override + public void onClick(View v) { + int oid = v.getId(); + + if (oid == R.id.Btn_start) { + + } else if (oid == R.id.Btn_stop) { + Toast.makeText(MainActivity.this, "测试" + getApplicationContext().getPackageResourcePath() + 10 / 0, Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(MainActivity.this, "此ID(" + oid + ")事件未注册", Toast.LENGTH_SHORT).show(); + } + } + + }; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + LinearLayout rootlayout = new LinearLayout(this); + + TextView info = new TextView(MainActivity.this); + info.setText(isActivate()?"模块已激活":"模块未激活"); + rootlayout.addView(info); + + Button btn = new Button(MainActivity.this); + btn.setAllCaps(false); + btn.setText("Start"); + btn.setId(R.id.Btn_start); + btn.setOnClickListener(myOnclick); + rootlayout.addView(btn); + + btn = new Button(MainActivity.this); + btn.setText("stop"); + btn.setId(R.id.Btn_stop); + btn.setOnClickListener(myOnclick); + rootlayout.addView(btn); + + Button untest = new Button(MainActivity.this); + untest.setText("未注册的按钮"); + untest.setId(3); + untest.setOnClickListener(myOnclick); + rootlayout.addView(untest); + + rootlayout.setGravity(Gravity.CENTER); + rootlayout.setOrientation(LinearLayout.VERTICAL); + rootlayout.setBackgroundColor(0xFF545454); + + setContentView(rootlayout); + } + + private static boolean isActivate(){ + return false; + } + +} diff --git a/app/src/main/res/drawable/ic_launcher.png b/app/src/main/res/drawable/ic_launcher.png new file mode 100644 index 0000000..b824ebd Binary files /dev/null and b/app/src/main/res/drawable/ic_launcher.png differ diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..04b7637 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,5 @@ + + + diff --git a/app/src/main/res/values-v21/styles.xml b/app/src/main/res/values-v21/styles.xml new file mode 100644 index 0000000..0aed032 --- /dev/null +++ b/app/src/main/res/values-v21/styles.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/values/AuthScope.xml b/app/src/main/res/values/AuthScope.xml new file mode 100644 index 0000000..8c899b4 --- /dev/null +++ b/app/src/main/res/values/AuthScope.xml @@ -0,0 +1,9 @@ + + + + + org.telegram.messenger + + org.telegram.messenger.web + + diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..40bdc35 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,6 @@ + + + #6200EE + #3700B3 + #03DAC5 + \ No newline at end of file diff --git a/app/src/main/res/values/ids.xml b/app/src/main/res/values/ids.xml new file mode 100644 index 0000000..1f4c882 --- /dev/null +++ b/app/src/main/res/values/ids.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..3d8c6b3 --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,4 @@ + + + TG++ + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..6799c28 --- /dev/null +++ b/app/src/main/res/values/styles.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..e610239 --- /dev/null +++ b/build.gradle @@ -0,0 +1,41 @@ +buildscript { + ext.build_gradle_version = '4.1.2' + + repositories { + maven { url 'https://maven.aliyun.com/repository/public/' } + maven { url 'https://maven.aliyun.com/repository/google/' } + maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' } + maven { url 'https://dl.bintray.com/ppartisan/maven/' } + maven { url "https://clojars.org/repo/" } + maven { url "https://jitpack.io" } + google() + mavenLocal() + mavenCentral() + } + dependencies { + classpath "com.android.tools.build:gradle:$build_gradle_version" + + } + +} +allprojects { + repositories { + maven { url 'https://maven.aliyun.com/repository/public/' } + maven { url 'https://maven.aliyun.com/repository/google/' } + maven { url 'https://maven.aliyun.com/repository/gradle-plugin/' } + maven { url 'https://dl.bintray.com/ppartisan/maven/' } + maven { url "https://clojars.org/repo/" } + maven { url "https://jitpack.io" } + mavenLocal() + mavenCentral() + google() + } + + + + +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 0000000..ebd6922 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,19 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app"s APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=false +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=false \ No newline at end of file diff --git a/gradlew b/gradlew new file mode 100644 index 0000000..cccdd3d --- /dev/null +++ b/gradlew @@ -0,0 +1,172 @@ +#!/usr/bin/env sh + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=$(save "$@") + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then + cd "$(dirname "$0")" +fi + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 0000000..e95643d --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,84 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windows variants + +if not "%OS%" == "Windows_NT" goto win9xME_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/local.properties b/local.properties new file mode 100644 index 0000000..f4fcdb0 --- /dev/null +++ b/local.properties @@ -0,0 +1,10 @@ +## This file is automatically generated by Android Studio. +# Do not modify this file -- YOUR CHANGES WILL BE ERASED! +# +# This file should *NOT* be checked into Version Control Systems, +# as it contains information specific to your local configuration. +# +# Location of the SDK. This is only used by Gradle. +# For customization when using a Version Control System, please read the +# header note. +#sdk.dir= \ No newline at end of file diff --git a/settings.gradle b/settings.gradle new file mode 100644 index 0000000..0f102c9 --- /dev/null +++ b/settings.gradle @@ -0,0 +1,2 @@ +include ':app' +rootProject.name = "TG++"