MyungjunChae

Obfuscator

Showing 104 changed files with 2820 additions and 0 deletions
obfuscator/build/
obfuscator/.gradle/
#Fri Apr 10 12:46:33 KST 2020
gradle.version=5.2.1
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="/usr/local/Cellar/gradle/6.3/libexec" />
<option name="gradleJvm" value="11" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_13" project-jdk-name="13" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="3e580ba3-add3-4012-a557-2fe613477d9f" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/obfuscator/src/main/kotlin/cached/Code.kt" beforeDir="false" afterPath="$PROJECT_DIR$/obfuscator/src/main/kotlin/cached/Code.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/obfuscator/src/main/kotlin/util/syntax/ClassUtil.kt" beforeDir="false" afterPath="$PROJECT_DIR$/obfuscator/src/main/kotlin/util/syntax/ClassUtil.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test_app_java/app/src/main/AndroidManifest.xml" beforeDir="false" afterPath="$PROJECT_DIR$/test_app_java/app/src/main/AndroidManifest.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test_app_java/app/src/main/java/com/ono/test_app/AndroidRsaCipherHelper.kt" beforeDir="false" afterPath="$PROJECT_DIR$/test_app_java/app/src/main/java/com/ono/test_app/cache/AndroidRsaCipherHelper.kt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test_app_java/app/src/main/java/com/ono/test_app/MainActivity.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/test_app_java/app/src/main/java/com/ono/test_app/SecureSharedPreference.kt" beforeDir="false" afterPath="$PROJECT_DIR$/test_app_java/app/src/main/java/com/ono/test_app/cache/SecureSharedPreference.kt" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="ExternalProjectsData">
<projectState path="$PROJECT_DIR$">
<ProjectState />
</projectState>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Kotlin Class" />
<option value="Kotlin File" />
<option value="Class" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1aKhdS3cO6wtvAt8bFDZIe6HMz9" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showExcludedFiles" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
</component>
<component name="RecentsManager">
<key name="MoveKotlinTopLevelDeclarationsDialog.RECENTS_KEY">
<recent name="util" />
</key>
</component>
<component name="RunManager">
<configuration name="MainKt" type="JetRunConfigurationType" temporary="true" nameIsGenerated="true">
<module name="obfuscator.main" />
<option name="VM_PARAMETERS" />
<option name="PROGRAM_PARAMETERS" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="MAIN_CLASS_NAME" value="MainKt" />
<option name="WORKING_DIRECTORY" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<recent_temporary>
<list>
<item itemvalue="Kotlin.MainKt" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="3e580ba3-add3-4012-a557-2fe613477d9f" name="Default Changelist" comment="" />
<created>1586490279278</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1586490279278</updated>
</task>
<servers />
</component>
<component name="WindowStateProjectService">
<state x="440" y="159" key="#Project_Structure" timestamp="1586490643113">
<screen x="0" y="23" width="1680" height="942" />
</state>
<state x="440" y="159" key="#Project_Structure/0.23.1680.942@0.23.1680.942" timestamp="1586490643113" />
<state x="304" y="155" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1592124907973">
<screen x="0" y="23" width="1680" height="941" />
</state>
<state x="304" y="155" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.23.1680.941@0.23.1680.941" timestamp="1592124907973" />
<state x="622" y="217" key="#com.intellij.ide.util.MemberChooser" timestamp="1586596110190">
<screen x="0" y="23" width="1680" height="942" />
</state>
<state x="622" y="217" key="#com.intellij.ide.util.MemberChooser/1680.23.2560.1057/0.23.1680.942@0.23.1680.942" timestamp="1586596110190" />
<state x="606" y="153" key="#org.jetbrains.kotlin.idea.refactoring.move.moveDeclarations.ui.MoveKotlinTopLevelDeclarationsDialog" timestamp="1586617500367">
<screen x="0" y="23" width="1680" height="942" />
</state>
<state x="606" y="153" key="#org.jetbrains.kotlin.idea.refactoring.move.moveDeclarations.ui.MoveKotlinTopLevelDeclarationsDialog/0.23.1680.942@0.23.1680.942" timestamp="1586617500367" />
<state width="1638" height="150" key="GridCell.Tab.0.bottom" timestamp="1587297728312">
<screen x="0" y="23" width="1680" height="942" />
</state>
<state width="1638" height="150" key="GridCell.Tab.0.bottom/0.23.1680.942@0.23.1680.942" timestamp="1587297728312" />
<state width="1638" height="150" key="GridCell.Tab.0.bottom/1680.23.2560.1057/0.23.1680.942@0.23.1680.942" timestamp="1587135448911" />
<state width="1638" height="150" key="GridCell.Tab.0.center" timestamp="1587297728312">
<screen x="0" y="23" width="1680" height="942" />
</state>
<state width="1638" height="150" key="GridCell.Tab.0.center/0.23.1680.942@0.23.1680.942" timestamp="1587297728312" />
<state width="1638" height="150" key="GridCell.Tab.0.center/1680.23.2560.1057/0.23.1680.942@0.23.1680.942" timestamp="1587135448910" />
<state width="1638" height="150" key="GridCell.Tab.0.left" timestamp="1587297728311">
<screen x="0" y="23" width="1680" height="942" />
</state>
<state width="1638" height="150" key="GridCell.Tab.0.left/0.23.1680.942@0.23.1680.942" timestamp="1587297728311" />
<state width="1638" height="150" key="GridCell.Tab.0.left/1680.23.2560.1057/0.23.1680.942@0.23.1680.942" timestamp="1587135448909" />
<state width="1638" height="150" key="GridCell.Tab.0.right" timestamp="1587297728312">
<screen x="0" y="23" width="1680" height="942" />
</state>
<state width="1638" height="150" key="GridCell.Tab.0.right/0.23.1680.942@0.23.1680.942" timestamp="1587297728312" />
<state width="1638" height="150" key="GridCell.Tab.0.right/1680.23.2560.1057/0.23.1680.942@0.23.1680.942" timestamp="1587135448911" />
<state x="517" y="326" key="com.intellij.ide.util.TipDialog" timestamp="1592377934451">
<screen x="0" y="23" width="1680" height="941" />
</state>
<state x="517" y="326" key="com.intellij.ide.util.TipDialog/0.23.1680.941@0.23.1680.941" timestamp="1592262533146" />
<state x="517" y="326" key="com.intellij.ide.util.TipDialog/0.23.1680.942@0.23.1680.942" timestamp="1587300634809" />
<state x="517" y="327" key="com.intellij.ide.util.TipDialog/0.23.1680.945@0.23.1680.945" timestamp="1589277203659" />
<state x="517" y="326" key="com.intellij.ide.util.TipDialog/1680.23.2560.1057/0.23.1680.941@0.23.1680.941" timestamp="1592377934451" />
<state x="517" y="326" key="com.intellij.ide.util.TipDialog/1680.23.2560.1057/0.23.1680.942@0.23.1680.942" timestamp="1587130133930" />
<state x="619" y="228" key="org.jetbrains.kotlin.idea.testIntegration.KotlinCreateTestDialog" timestamp="1586614244552">
<screen x="0" y="23" width="1680" height="942" />
</state>
<state x="619" y="228" key="org.jetbrains.kotlin.idea.testIntegration.KotlinCreateTestDialog/0.23.1680.942@0.23.1680.942" timestamp="1586614244552" />
<state x="505" y="229" width="670" height="676" key="search.everywhere.popup" timestamp="1587134509023">
<screen x="0" y="23" width="1680" height="942" />
</state>
<state x="505" y="229" width="670" height="676" key="search.everywhere.popup/1680.23.2560.1057/0.23.1680.942@0.23.1680.942" timestamp="1587134509023" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.javaparser/javaparser-core/3.15.17/51e2e979c7d248c959f03a45c1862f248c8a4c6e/javaparser-core-3.15.17-sources.jar!/com/github/javaparser/ast/nodeTypes/NodeWithRange.java</url>
<option name="timeStamp" value="5" />
</line-breakpoint>
<line-breakpoint enabled="true" type="kotlin-line">
<url>file://$PROJECT_DIR$/obfuscator/src/main/kotlin/main.kt</url>
<line>4</line>
<option name="timeStamp" value="7" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>
\ No newline at end of file
# AppObfuscator
본 프로젝트는 경희대학교 컴퓨터공학과 캡스톤디자인1의 일환으로 작성되었습니다.
# Default ignored files
/workspace.xml
\ No newline at end of file
modifier.obfuscator
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
</code_scheme>
</component>
\ No newline at end of file
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleHome" value="/usr/local/Cellar/gradle/6.3/libexec" />
<option name="gradleJvm" value="11" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RemoteRepositoriesConfiguration">
<remote-repository>
<option name="id" value="central" />
<option name="name" value="Maven Central repository" />
<option name="url" value="https://repo1.maven.org/maven2" />
</remote-repository>
<remote-repository>
<option name="id" value="jboss.community" />
<option name="name" value="JBoss Community repository" />
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
</remote-repository>
<remote-repository>
<option name="id" value="MavenRepo" />
<option name="name" value="MavenRepo" />
<option name="url" value="https://repo.maven.apache.org/maven2/" />
</remote-repository>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalStorageConfigurationManager" enabled="true" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK" />
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.3.61'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation 'com.github.javaparser:javaparser-core:3.15.17'
implementation 'com.googlecode.json-simple:json-simple:1.1.1'
testImplementation 'junit:junit:4.13'
}
compileKotlin {
kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
kotlinOptions.jvmTarget = "1.8"
}
\ No newline at end of file
kotlin.code.style=official
\ No newline at end of file
#Sun Apr 19 20:59:09 KST 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
#!/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='"-Xmx64m"'
# 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" "$@"
@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="-Xmx64m"
@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
rootProject.name = 'modifier.obfuscator'
package cached
fun classify(method: String) = "class foo{$method}"
val CACHED_APPLICATION = "" +
"package com.ono.test_app;\n" +
"\n" +
"import android.app.Application;\n" +
"import android.content.Context;\n" +
"import com.ono.test_app.cache.SecureSharedPreferences;\n" +
"import android.content.SharedPreferences;\n" +
"import androidx.preference.PreferenceManager;\n" +
"import org.json.JSONObject;\n" +
"import java.io.InputStream;\n" +
"import java.util.Iterator;\n" +
"\n" +
"public class MyApplication extends Application {\n" +
"\n" +
" static SecureSharedPreferences pref = null;\n" +
"\n" +
" @Override\n" +
" public void onCreate() {\n" +
" encryption();\n" +
" super.onCreate();\n" +
" }\n" +
"\n" +
" private void encryption() {\n" +
" SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(this);\n" +
" pref = new SecureSharedPreferences(p);\n" +
" loadJSONFromAsset(this);\n" +
" try {\n" +
" JSONObject jsonObject = new JSONObject(loadJSONFromAsset(this));\n" +
" Iterator<String> keys = jsonObject.keys();\n" +
" while (keys.hasNext()) {\n" +
" String key = keys.next();\n" +
" pref.put(key, jsonObject.get(key).toString());\n" +
" }\n" +
" } catch (Exception e) {\n" +
" e.printStackTrace();\n" +
" }\n" +
" }\n" +
"\n" +
" public String loadJSONFromAsset(Context context) {\n" +
" String json = null;\n" +
" try {\n" +
" InputStream is = context.getAssets().open(\"encryption.json\");\n" +
" int size = is.available();\n" +
" byte[] buffer = new byte[size];\n" +
" is.read(buffer);\n" +
" is.close();\n" +
" json = new String(buffer, \"UTF-8\");\n" +
" } catch (Exception e) {\n" +
" e.printStackTrace();\n" +
" }\n" +
" return json;\n" +
" }\n" +
"}\n"
val FUNCTION_ENCRPTION = " private void encryption() {\n" +
" SharedPreferences p = PreferenceManager.getDefaultSharedPreferences(this);\n" +
" pref = new SecureSharedPreferences(p);\n" +
"\n" +
" loadJSONFromAsset(this);\n" +
" try {\n" +
" JSONObject jsonObject = new JSONObject(loadJSONFromAsset(this));\n" +
" Iterator<String> keys = jsonObject.keys();\n" +
" while (keys.hasNext()) {\n" +
" String key = keys.next();\n" +
" pref.put(key, jsonObject.get(key).toString());\n" +
" }\n" +
" } catch (Exception e) {\n" +
" e.printStackTrace();\n" +
" }\n" +
" }"
val FUNCTION_LOAD_JSON = " public String loadJSONFromAsset(Context context) {\n" +
" String json = null;\n" +
" try {\n" +
" InputStream is = context.getAssets().open(\"encryption.json\");\n" +
" int size = is.available();\n" +
" byte[] buffer = new byte[size];\n" +
" is.read(buffer);\n" +
" is.close();\n" +
" json = new String(buffer, \"UTF-8\");\n" +
" } catch (Exception e) {\n" +
" e.printStackTrace();\n" +
" }\n" +
" return json;\n" +
" }"
val CLASS_APPLICATION = "import android.app.Application;\n" +
"\n" +
"public class MyApplication extends Application {\n" +
" static SecureSharedPreferences pref = null;\n" +
"}\n"
import modifier.encryptor.Encryptor
import modifier.obfuscator.Obfuscator
fun main() {
val TEST_APP_NAME = "test_app_java"
/**
* #순서
* #암호화
*
* #난독화
* 변수 사용, 파라미터 사용
* 변수 선언, 파라미터 선언, 클래스 선언
**/
Encryptor.build(TEST_APP_NAME).run()
Obfuscator.build(TEST_APP_NAME).run()
}
package modifier
import com.github.javaparser.StaticJavaParser
import com.github.javaparser.ast.CompilationUnit
import util.file.FileUtil
import java.io.File
abstract class AbstractModifier : BaseModifier {
protected lateinit var targetAppName: String
protected val mainFolder by lazy { FileUtil.getMainFolder(targetAppName) }
protected val codeFolder by lazy { File("${mainFolder}/java/${FileUtil.getPackageName(mainFolder)?.replace(".","/")}") }
protected val javaFiles: List<File> by lazy { FileUtil.getJavaFiles(mainFolder) }
protected fun parse(file : File) : CompilationUnit{
return StaticJavaParser.parse(file)
}
protected fun parse(code : String) : CompilationUnit{
return StaticJavaParser.parse(code)
}
}
\ No newline at end of file
package modifier
interface BaseModifier {
fun run()
}
\ No newline at end of file
package modifier.encryptor
import cached.CACHED_APPLICATION
import cached.FUNCTION_ENCRPTION
import cached.FUNCTION_LOAD_JSON
import cached.classify
import modifier.AbstractModifier
import util.file.CompilationUtil.saveCompilationUnit
import util.json.JsonFactory
import util.syntax.ClassUtil
import util.syntax.MethodDeclUtil
import util.syntax.StringLiteralUtil
import java.io.File
class Encryptor private constructor() : AbstractModifier() {
companion object {
fun build(targetAppName: String): Encryptor {
return Encryptor().apply { this.targetAppName = targetAppName }
}
}
private class MakeJson(targetAppName: String) : AbstractModifier() {
init {
this.targetAppName = targetAppName
}
private fun makeJson(file: File) {
val cu = parse(file)
StringLiteralUtil(cu).also { util ->
val jsonObject = JsonFactory.build(mainFolder)
util.get().map { it.value.toString() }.forEach {
jsonObject.add(it)
}
jsonObject.save()
}
}
override fun run() {
javaFiles.forEach {
makeJson(it)
}
}
}
@Deprecated("Replaced by InjectApplication")
private class InjectMethodDecl(targetAppName: String) : AbstractModifier() {
init {
this.targetAppName = targetAppName
}
private fun injectCode(file: File) {
val cu = parse(file)
ClassUtil(cu).also { util ->
util.get().forEach {
val name = it.name.toString()
val condition = util.getExtends(name)?.contains("AppCompatActivity") ?: false
if (condition) {
util.addMethod(null, classify(FUNCTION_ENCRPTION))
util.addMethod(null, classify(FUNCTION_LOAD_JSON))
}
}
}
saveCompilationUnit(file, cu)
}
override fun run() {
javaFiles.forEach {
injectCode(it)
}
}
}
@Deprecated("Replaced by InjectApplication")
private class InjectMethodCall(targetAppName: String) : AbstractModifier() {
init {
this.targetAppName = targetAppName
}
private fun injectCode(file: File) {
val cu = parse(file)
ClassUtil(cu).also { util ->
util.get().forEach {
val name = it.name.toString()
val condition = util.getExtends(name)?.contains("Application") ?: false
if (condition) {
MethodDeclUtil(cu).also { util ->
util.get("onCreate").also {
util.injectMethod("onCreate", "encryption")
}
}
}
}
}
saveCompilationUnit(file, cu)
}
override fun run() {
javaFiles.forEach {
injectCode(it)
}
}
}
private class ReplaceLiteral(targetAppName: String) : AbstractModifier() {
init {
this.targetAppName = targetAppName
}
private fun replace(file: File) {
val cu = parse(file)
StringLiteralUtil(cu).replace("MyApplication.pref.get")
saveCompilationUnit(file, cu)
}
override fun run() {
javaFiles.forEach {
replace(it)
}
}
}
private class InjectApplication(targetAppName: String) : AbstractModifier() {
init {
this.targetAppName = targetAppName
}
private fun inject() {
val cu = parse(CACHED_APPLICATION)
saveCompilationUnit("$codeFolder/MyApplication.java", cu)
}
override fun run() {
inject()
}
}
override fun run() {
/**
* string literal json 생성
* string literal -> securePref.get() 치환
* application class 생성
*/
MakeJson(targetAppName).run()
ReplaceLiteral(targetAppName).run()
InjectApplication(targetAppName).run()
}
}
\ No newline at end of file
package modifier.obfuscator
import com.github.javaparser.ast.expr.FieldAccessExpr
import com.github.javaparser.ast.expr.Name
import modifier.AbstractModifier
import util.cipher.CipherHelper.SHA256
import util.file.CompilationUtil.saveCompilationUnit
import util.file.FileUtil
import util.file.FileUtil.changeFileName
import util.file.XMLUtil
import util.syntax.*
import java.io.File
class Obfuscator private constructor() : AbstractModifier() {
companion object {
fun build(targetAppName: String): Obfuscator {
return Obfuscator().apply { this.targetAppName = targetAppName }
}
}
private class XMLObfuscator(targetAppName: String) : AbstractModifier() {
val XMLFile by lazy { FileUtil.getManifestXML(mainFolder) }
init {
this.targetAppName = targetAppName
}
override fun run() {
applyToActivity()
applyToApplication()
}
private fun applyToActivity() {
XMLUtil.obfuscateActivityName(XMLFile)
}
private fun applyToApplication() {
XMLUtil.obfuscateApplicationName(XMLFile)
}
}
private class DeclarationObfuscator(targetAppName: String) : AbstractModifier() {
init {
this.targetAppName = targetAppName
}
override fun run() {
javaFiles.forEach {
applyToVariable(it)
applyToParameter(it)
applyToMethod(it)
applyToClass(it)
}
}
private fun applyToClass(file: File) {
val cu = parse(file)
val util = ClassUtil(cu)
val classNameList = mutableListOf<String>()
val obfuscatedClassNameList = mutableListOf<String>()
util.get().forEach {
classNameList.add(it.name.toString())
}
classNameList.forEach { default ->
SHA256(default)?.let {
obfuscatedClassNameList.add(it)
util.setName(default, it)
}
}
saveCompilationUnit(file, cu)
changeFileName(file, obfuscatedClassNameList[0])
}
private fun applyToVariable(file: File) {
println("----$file----")
val cu = parse(file)
VariableDeclUtil(cu).also { util ->
util.get().forEach {
val name = it.name.toString()
println(name)
with(SHA256(name), {
util.setName(name, this!!)
})
}
}
saveCompilationUnit(file, cu)
}
private fun applyToParameter(file: File) {
val cu = parse(file)
ParameterUtil(cu).also { util ->
util.get().forEach {
val name = it.name.toString()
if (name[0].isLowerCase()) {
println(name)
with(SHA256(name), {
util.setName(name, this!!)
})
}
}
}
saveCompilationUnit(file, cu)
}
private fun applyToMethod(file: File) {
val cu = parse(file)
MethodDeclUtil(cu).also { util ->
util.get().filter { it.annotations.size == 0 }.forEach {
val name = it.name.toString()
with(SHA256(name), {
util.setName(name, this!!)
})
}
}
saveCompilationUnit(file, cu)
}
}
private class CallingObfuscator(targetAppName: String, private val userDefCode: List<String>) : AbstractModifier() {
init {
this.targetAppName = targetAppName
}
override fun run() {
javaFiles.forEach {
applyToInstanceVariable(it)
applyToVariable(it)
applyToMethodCall(it)
}
}
private fun applyToVariable(file: File) {
val cu = parse(file)
NameUtil(cu).also { util ->
util.get().forEach {
val name = it.name.toString()
if (userDefCode.contains(name) || name[0].isLowerCase()) {
with(SHA256(name), {
util.setName(name, this!!)
})
}
}
}
saveCompilationUnit(file, cu)
}
private fun applyToInstanceVariable(file: File){
val cu = parse(file)
FieldAccessUtil(cu).also{ util ->
util.get().filter{"R" !in it.toString()}.forEach {
val name = it.name.toString()
with(SHA256(name), {
util.setName(name, this!!)
})
}
}
saveCompilationUnit(file, cu)
}
private fun applyToMethodCall(file: File){
val cu = parse(file)
MethodCallUtil(cu).also{ util ->
util.get().forEach {
val name = it.name.toString()
if (userDefCode.contains(name)) {
with(SHA256(name), {
util.setName(name, this!!)
})
}
}
}
saveCompilationUnit(file, cu)
}
}
private fun getUserDefCode(): List<String> {
val userDefine = mutableListOf<String>()
javaFiles.forEach {
val cu = parse(it)
ClassUtil(cu).get().forEach {
userDefine.add(it.name.toString())
}
MethodDeclUtil(cu).get().filter { it.annotations.size == 0 }.forEach {
userDefine.add(it.name.toString())
}
}
return userDefine
}
override fun run() {
val userDefCode = getUserDefCode()
XMLObfuscator(targetAppName).run()
CallingObfuscator(targetAppName, userDefCode).run()
DeclarationObfuscator(targetAppName).run()
}
}
/**
* FieldAccess -> 클래스 인스턴스 변수 접근 난독화
* Name -> 변수 사용 난독화
* Parameter -> 파라미터 선언 난독화
* Class -> 클래스 선언 난독화
* VariableDecl -> 변수 선언 난독화
* MethodDecl -> 메소드 선언 난독화
* MethodCall -> 메소드 사용 난독화
**/
\ No newline at end of file
package util;
public class Generator {
}
package util.cipher
import java.math.BigInteger
import java.security.MessageDigest
object CipherHelper{
//WITH_DROP_INT_PREFIX
fun SHA256(input: String): String? {
var toReturn: String? = null
try {
val digest = MessageDigest.getInstance("SHA-256")
digest.reset()
digest.update(input.toByteArray(charset("utf8")))
toReturn = String.format("%064x", BigInteger(1, digest.digest()))
} catch (e: Exception) {
e.printStackTrace()
}
for(i in toReturn?.indices!!){
if(!toReturn[i].isDigit()){
toReturn = toReturn.substring(i) + toReturn.substring(0,i)
break
}
}
return toReturn
}
}
package util.file
import com.github.javaparser.ast.CompilationUnit
import java.io.File
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
object CompilationUtil {
fun saveCompilationUnit(path: Path, cu: CompilationUnit) {
Files.write(path, cu.toString().toByteArray())
}
fun saveCompilationUnit(uri: String, cu: CompilationUnit) {
saveCompilationUnit(Paths.get(uri), cu)
}
fun saveCompilationUnit(file: File, cu: CompilationUnit) {
saveCompilationUnit(Paths.get(file.absolutePath), cu)
}
}
\ No newline at end of file
package util.file
import java.io.File
import java.nio.file.Files
import java.nio.file.Path
object FileUtil {
private val filterFiles = listOf(
"ExampleInstrumentedTest.java",
"ExampleUnitTest.java",
"BuildConfig.java",
"R.java"
)
fun getMainFolder(name: String): File {
return File(getAppPath(name))
}
fun getPackageName(folder: File) : String?{
return XMLUtil.getPackageName(getManifestXML(folder))
}
fun getAppPath(name: String): String {
return joinDir(getRoot(), "$name/app/src/main")
}
fun getRoot(): String {
return getForwardDir(getCurrentDir())
}
fun getJavaFiles(folder: File): List<File> {
return getFilesByCondition(folder) { it.name.endsWith(".java") && !filterFiles.contains(it.name) }
}
fun getManifestXML(folder: File): File{
return getFilesByCondition(folder) { it.name == "AndroidManifest.xml" }[0]
}
private fun getFilesByCondition(folder: File, condition: ((File) -> Boolean)): List<File> {
val files = mutableListOf<File>()
for (fileEntry in folder.listFiles()) {
if (fileEntry.isDirectory) {
files += getFilesByCondition(fileEntry, condition)
} else {
if (condition(fileEntry)) {
files.add(fileEntry)
}
}
}
return files
}
fun getCurrentDir(): String {
return System.getProperty("user.dir")
}
fun getForwardDir(dir: String): String {
return dir.split('/').dropLast(1).joinToString("/")
}
fun joinDir(main: String, sub: String): String {
return if (main.last() == '/' && sub.first() == '/') main.dropLast(1) + sub
else if (main.last() == '/' || sub.first() == '/') main + sub
else "$main/$sub"
}
fun changeFileName(target : File, change : String){
changeFileName(target.toPath(), change)
}
fun changeFileName(target : Path, change : String){
Files.move(target,target.resolveSibling("$change.java"))
}
}
\ No newline at end of file
package util.file
import org.w3c.dom.Attr
import org.w3c.dom.NamedNodeMap
import org.w3c.dom.Node
import util.cipher.CipherHelper
import java.io.File
import javax.xml.parsers.DocumentBuilderFactory
import javax.xml.transform.TransformerFactory
import javax.xml.transform.dom.DOMSource
import javax.xml.transform.stream.StreamResult
object XMLUtil {
fun obfuscateActivityName(xml: File) {
val documentBuilder = DocumentBuilderFactory.newDefaultInstance().newDocumentBuilder()
val document = documentBuilder.parse(xml)
val activityList = document.getElementsByTagName("activity")
for(i in 0 until activityList.length){
val activity = activityList.item(i)
var nameTag = activity.attributes.getNamedItem("android:name")
nameTag.textContent = CipherHelper.SHA256(nameTag.textContent)
}
val transformer = TransformerFactory.newInstance().newTransformer()
val domSource = DOMSource(document)
val streamResult = StreamResult(File(xml.absolutePath));
transformer.transform(domSource, streamResult);
}
fun obfuscateApplicationName(xml: File) {
injectApplicationName(xml)
val documentBuilder = DocumentBuilderFactory.newDefaultInstance().newDocumentBuilder()
val document = documentBuilder.parse(xml)
val activityList = document.getElementsByTagName("application")
for(i in 0 until activityList.length){
val activity = activityList.item(i)
var nameTag = activity.attributes.getNamedItem("android:name")
nameTag.textContent = CipherHelper.SHA256(nameTag.textContent)
}
val transformer = TransformerFactory.newInstance().newTransformer()
val domSource = DOMSource(document)
val streamResult = StreamResult(File(xml.absolutePath));
transformer.transform(domSource, streamResult);
}
fun injectApplicationName(xml: File) {
val documentBuilder = DocumentBuilderFactory.newDefaultInstance().newDocumentBuilder()
val document = documentBuilder.parse(xml)
val activityList = document.getElementsByTagName("application")
for(i in 0 until activityList.length){
val activity = activityList.item(i)
var nameTag = activity.attributes.getNamedItem("android:name")
if(nameTag == null){
val attr: Attr = document.createAttribute("android:name")
attr.nodeValue = "MyApplication"
activity.attributes.setNamedItem(attr)
}else{
nameTag.textContent = "MyApplication"
}
}
val transformer = TransformerFactory.newInstance().newTransformer()
val domSource = DOMSource(document)
val streamResult = StreamResult(File(xml.absolutePath));
transformer.transform(domSource, streamResult);
}
fun getPackageName(xml: File) : String?{
val documentBuilder = DocumentBuilderFactory.newDefaultInstance().newDocumentBuilder()
val document = documentBuilder.parse(xml)
val manifestList = document.getElementsByTagName("manifest")
var packageName : String? = null
for(i in 0 until manifestList.length){
val activity = manifestList.item(i)
packageName = activity.attributes.getNamedItem("package").nodeValue.toString()
}
return packageName
}
}
\ No newline at end of file
package util.json
import org.json.simple.JSONObject
import java.io.File
import java.io.FileWriter
import java.io.IOException
class JsonFactory private constructor() {
companion object {
private val jsonObject = JSONObject()
private var count = 0
private val assetPath by lazy { "$folder/assets/" }
private val assetFile by lazy { File(assetPath) }
private val jsonPath by lazy{ "${assetPath}/encryption.json"}
private lateinit var folder: File
fun build(f: File): JsonFactory {
this.folder = f
return JsonFactory()
}
}
fun add(value: String) {
jsonObject[count.toString()] = value
count++
}
fun save() {
if (!assetFile.exists()) {
assetFile.mkdir()
}
println(jsonObject.toJSONString())
try {
FileWriter(jsonPath).use { file ->
file.write(jsonObject.toJSONString())
file.flush()
}
} catch (e: IOException) {
e.printStackTrace()
}
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.StaticJavaParser
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.expr.AssignExpr
import com.github.javaparser.ast.expr.Expression
class AssignUtil(override var cu: CompilationUnit) : BaseUtil<AssignExpr>(AssignExpr::class.java) {
fun setName(name: String?, value: String) {
val t = StaticJavaParser.parseExpression<Expression>(value)
looper(name) { it.target = t }
}
fun setValue(name: String?, value: String) {
val t = StaticJavaParser.parseExpression<Expression>(value)
looper(name) { it.value = t }
}
override fun isNameSame(node: AssignExpr, comp: String): Boolean {
return node.target.toString() == comp
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.Node
import com.github.javaparser.ast.body.MethodDeclaration
import com.github.javaparser.ast.expr.AssignExpr
import java.lang.Exception
abstract class BaseUtil<T : Node>(private val clazz : Class<T>) {
abstract var cu: CompilationUnit
fun get(): List<T> {
val list = mutableListOf<T>()
looper(null) { list.add(it) }
return list.toSet().toList()
}
fun get(name: String): T? {
return try{
get().filter { isNameSame(it, name) }[0]
}catch (except: Exception){
null
}
}
abstract fun isNameSame(node: T, comp:String): Boolean
protected fun looper(name: String?, block: (T) -> Unit) {
cu.findAll(clazz).filter {
if (name.isNullOrEmpty()) {
true
} else {
isNameSame(it, name)
}
}.forEach {
block(it)
}
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.StaticJavaParser
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.NodeList
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration
import com.github.javaparser.ast.body.MethodDeclaration
import com.github.javaparser.ast.expr.MethodCallExpr
import com.github.javaparser.ast.stmt.BlockStmt
import com.github.javaparser.ast.type.ClassOrInterfaceType
import java.lang.Exception
class ClassUtil(override var cu: CompilationUnit) :
BaseUtil<ClassOrInterfaceDeclaration>(ClassOrInterfaceDeclaration::class.java) {
fun setName(name: String?, value: String) {
looper(name) { it.setName(value) }
}
fun addMethod(name: String?, code: String) {
val cu = StaticJavaParser.parse(code)
val method = cu.findAll(MethodDeclaration::class.java)[0]
val blockStmt = BlockStmt()
looper(name) { it.addMember(method) }
}
fun getExtends(name: String): List<String>? {
return try{
cu.findAll(ClassOrInterfaceDeclaration::class.java)
.filter {isNameSame(it,name)}[0].extendedTypes.map{it.name.toString()}
}catch(except : Exception) {
null
}
}
override fun isNameSame(node: ClassOrInterfaceDeclaration, comp: String): Boolean {
return node.name.toString() == comp
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.body.ClassOrInterfaceDeclaration
import com.github.javaparser.ast.expr.FieldAccessExpr
class FieldAccessUtil(override var cu: CompilationUnit) : BaseUtil<FieldAccessExpr>(FieldAccessExpr::class.java) {
fun setName(name: String?, value: String) {
looper(name) { it.setName(value) }
}
override fun isNameSame(node: FieldAccessExpr, comp: String): Boolean {
return node.name.toString() == comp
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.body.MethodDeclaration
import com.github.javaparser.ast.expr.MethodCallExpr
import com.github.javaparser.ast.stmt.BlockStmt
class MethodCallUtil(override var cu: CompilationUnit) : BaseUtil<MethodCallExpr>(MethodCallExpr::class.java) {
fun setName(name: String?, value: String) {
looper(name) { it.setName(value) }
}
override fun isNameSame(node: MethodCallExpr, comp: String): Boolean {
return node.name.toString() == comp
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.body.MethodDeclaration
import com.github.javaparser.ast.expr.MethodCallExpr
import com.github.javaparser.ast.stmt.BlockStmt
import java.lang.Exception
import java.lang.reflect.Method
class MethodDeclUtil(override var cu: CompilationUnit) : BaseUtil<MethodDeclaration>(MethodDeclaration::class.java) {
fun setType(name: String?, value: String) {
looper(name) { it.setType(value) }
}
fun setName(name: String?, value: String) {
looper(name) { it.setName(value) }
}
fun setBody(name: String?, blockStmt: BlockStmt) {
looper(name) { it.setBody(blockStmt) }
}
fun injectMethod(name: String, method: String, parameter: List<String>? = null, index: Int = 0) {
val method = MethodCallExpr(method)
parameter?.forEach {
method.addArgument(it)
}
looper(name) {
it.findFirst(BlockStmt::class.java).get().apply {
this.addStatement(index, method)
}
}
}
override fun isNameSame(node: MethodDeclaration, comp: String): Boolean {
return node.name.toString() == comp
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.expr.NameExpr
class NameUtil(override var cu: CompilationUnit) : BaseUtil<NameExpr>(NameExpr::class.java){
fun setName(name: String?, value: String){
looper(name) {it.setName(value)}
}
override fun isNameSame(node: NameExpr, comp: String): Boolean {
return node.name.toString() == comp
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.body.Parameter
class ParameterUtil(override var cu: CompilationUnit) : BaseUtil<Parameter>(Parameter::class.java) {
fun setName(name: String?, value: String) {
looper(name) { it.setName(value) }
}
override fun isNameSame(node: Parameter, comp: String): Boolean {
return node.name.toString() == comp
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.expr.*
import com.github.javaparser.ast.stmt.BlockStmt
import com.github.javaparser.ast.stmt.ExpressionStmt
class StringLiteralUtil(override var cu: CompilationUnit) : BaseUtil<StringLiteralExpr>(StringLiteralExpr::class.java) {
fun replace(method: String) {
get().forEachIndexed { i, it ->
val method = MethodCallExpr(method).apply {
addArgument(stringify(i.toString()))
addArgument(stringify(""))
}
it.replace(method)
}
}
private fun stringify(value: String): String = "\"$value\""
override fun isNameSame(node: StringLiteralExpr, comp: String): Boolean {
return node.value.toString() == comp
}
}
\ No newline at end of file
package util.syntax
import com.github.javaparser.ast.CompilationUnit
import com.github.javaparser.ast.body.VariableDeclarator
import com.github.javaparser.ast.expr.AssignExpr
class VariableDeclUtil(override var cu: CompilationUnit) : BaseUtil<VariableDeclarator>(VariableDeclarator::class.java){
fun setValue(name: String?, value: String) {
looper(name) { it.setInitializer(value) }
}
fun setName(name: String?, value: String) {
looper(name) { it.setName(value) }
}
override fun isNameSame(node: VariableDeclarator, comp: String): Boolean {
return node.name.toString() == comp
}
}
\ No newline at end of file
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
test_app
\ No newline at end of file
<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>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<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" />
<option name="testRunner" value="PLATFORM" />
</GradleProjectSettings>
</option>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
<option name="id" value="Android" />
</component>
</project>
\ No newline at end of file
<?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>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.ono.test_app"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.jakewharton.timber:timber:4.7.1'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation "androidx.preference:preference:1.1.1"
implementation 'androidx.core:core-ktx:1.2.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories {
mavenCentral()
}
# 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
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1,"versionName":"1.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
package com.ono.test_app;
import android.content.Context;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
assertEquals("com.ono.test_app", appContext.getPackageName());
}
}
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ono.test_app">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:name="bbf24e1ea6e9832bbb2a745f80bf9e637e97df2603837aeb1d8e65385f554123" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
<activity android:name="fde94312239df6837d838778b655f7f215a16570150d6bd72a1c6ae5f28a5c53">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
\ No newline at end of file
{"0":"test","1":"테스트1","2":"테스트2","3":"테스트3"}
\ No newline at end of file
package com.ono.test_app;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Iterator;
public class MainActivity extends AppCompatActivity {
private String test = "test";
@Override
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
this.setContentView(R.layout.activity_main);
TextView textView = findViewById(R.id.textView);
textView.setText(test);
fTest("테스트1");
}
void fTest(String test) {
test = "테스트2";
String t = "테스트3";
}
}
\ No newline at end of file
package com.ono.test_app;
import android.app.Application;
import android.content.Context;
import com.ono.test_app.cache.SecureSharedPreferences;
import android.content.SharedPreferences;
import androidx.preference.PreferenceManager;
import org.json.JSONObject;
import java.io.InputStream;
import java.util.Iterator;
public class bbf24e1ea6e9832bbb2a745f80bf9e637e97df2603837aeb1d8e65385f554123 extends Application {
static SecureSharedPreferences a46a15e810034f80d4bef61772990ec9895e961d767fe9635485ace95826b266 = null;
@Override
public void onCreate() {
bf86075ceab2af34c4bf04695936f6522b383cee6b0d377a410b470499ab5485();
super.onCreate();
}
private void bf86075ceab2af34c4bf04695936f6522b383cee6b0d377a410b470499ab5485() {
SharedPreferences de9c5a7a44d19e56cd9ae1a554bf67847afb0c58f6e12fa29ac7ddfca9940148 = PreferenceManager.getDefaultSharedPreferences(this);
a46a15e810034f80d4bef61772990ec9895e961d767fe9635485ace95826b266 = new SecureSharedPreferences(de9c5a7a44d19e56cd9ae1a554bf67847afb0c58f6e12fa29ac7ddfca9940148);
b7f8fa0aa628d3ab67838133ac702fb1dfc8d712d7cc9672311ff78b8a73dc76(this);
try {
JSONObject cbf2b2ea5e035f9d878ad9d2001f041da2b92217fd1e91abea0c4c8383743025 = new JSONObject(b7f8fa0aa628d3ab67838133ac702fb1dfc8d712d7cc9672311ff78b8a73dc76(this));
Iterator<String> a53f0774c8ceff574a1fdcb0d470dbd382b3db273cff4344b6d39d5379c92348 = cbf2b2ea5e035f9d878ad9d2001f041da2b92217fd1e91abea0c4c8383743025.keys();
while (a53f0774c8ceff574a1fdcb0d470dbd382b3db273cff4344b6d39d5379c92348.hasNext()) {
String c70e12b7a0646f92279f427c7b38e7334d8e5389cff167a1dc30e73f826b6832 = a53f0774c8ceff574a1fdcb0d470dbd382b3db273cff4344b6d39d5379c92348.next();
a46a15e810034f80d4bef61772990ec9895e961d767fe9635485ace95826b266.put(c70e12b7a0646f92279f427c7b38e7334d8e5389cff167a1dc30e73f826b6832, cbf2b2ea5e035f9d878ad9d2001f041da2b92217fd1e91abea0c4c8383743025.get(c70e12b7a0646f92279f427c7b38e7334d8e5389cff167a1dc30e73f826b6832).toString());
}
} catch (Exception f79bb7b435b05321651daefd374cdc681dc06faa65e374e38337b88ca046dea3) {
f79bb7b435b05321651daefd374cdc681dc06faa65e374e38337b88ca046dea3.printStackTrace();
}
}
public String b7f8fa0aa628d3ab67838133ac702fb1dfc8d712d7cc9672311ff78b8a73dc76(Context ea7792a26f405e2ae9c6f49ca93bbe6076ceac0a1fc53d83426c7d7f2d9377e4) {
String bd175f329720378ce83dd56a1b6b1f5291a60182d6c54b5e0d1e8d248a267a02 = null;
try {
InputStream fa51fd49abf67705d6a35d18218c115ff5633aec1f9ebfdc9d5d4956416f57f6 = ea7792a26f405e2ae9c6f49ca93bbe6076ceac0a1fc53d83426c7d7f2d9377e4.getAssets().open("encryption.json");
int ccdcbe846f3da4eb044fbdf64bf6b57902388ab72fb0c852ba72280f8d478b40 = fa51fd49abf67705d6a35d18218c115ff5633aec1f9ebfdc9d5d4956416f57f6.available();
byte[] d0ca8c2ac0dab879bf27bfb58227b301db17f5ca716d065e7c884253d3ab99e4 = new byte[ccdcbe846f3da4eb044fbdf64bf6b57902388ab72fb0c852ba72280f8d478b40];
fa51fd49abf67705d6a35d18218c115ff5633aec1f9ebfdc9d5d4956416f57f6.read(d0ca8c2ac0dab879bf27bfb58227b301db17f5ca716d065e7c884253d3ab99e4);
fa51fd49abf67705d6a35d18218c115ff5633aec1f9ebfdc9d5d4956416f57f6.close();
bd175f329720378ce83dd56a1b6b1f5291a60182d6c54b5e0d1e8d248a267a02 = new String(d0ca8c2ac0dab879bf27bfb58227b301db17f5ca716d065e7c884253d3ab99e4, "UTF-8");
} catch (Exception f79bb7b435b05321651daefd374cdc681dc06faa65e374e38337b88ca046dea3) {
f79bb7b435b05321651daefd374cdc681dc06faa65e374e38337b88ca046dea3.printStackTrace();
}
return bd175f329720378ce83dd56a1b6b1f5291a60182d6c54b5e0d1e8d248a267a02;
}
}
package com.ono.test_app.cache
import android.annotation.TargetApi
import android.content.Context
import android.os.Build
import android.security.KeyPairGeneratorSpec
import android.security.keystore.KeyGenParameterSpec
import android.security.keystore.KeyProperties
import android.util.Base64
import timber.log.Timber
import java.math.BigInteger
import java.security.GeneralSecurityException
import java.security.KeyPairGenerator
import java.security.KeyStore
import java.security.spec.RSAKeyGenParameterSpec
import java.security.spec.RSAKeyGenParameterSpec.F4
import java.util.*
import javax.crypto.Cipher
import javax.security.auth.x500.X500Principal
object AndroidRsaCipherHelper {
private const val KEY_LENGTH_BIT = 2048
private const val VALIDITY_YEARS = 25
private const val KEY_PROVIDER_NAME = "AndroidKeyStore"
private const val CIPHER_ALGORITHM =
"${KeyProperties.KEY_ALGORITHM_RSA}/" +
"${KeyProperties.BLOCK_MODE_ECB}/" +
KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1
private lateinit var keyEntry: KeyStore.Entry
@Suppress("ObjectPropertyName")
private var _isSupported = false
val isSupported: Boolean
get() = _isSupported
private lateinit var appContext: Context
internal fun init(applicationContext: Context) {
if (isSupported) {
Timber.w("Already initialised - Do not attempt to initialise this twice")
return
}
appContext = applicationContext
val alias = "${appContext.packageName}.rsakeypairs"
val keyStore = KeyStore.getInstance("AndroidKeyStore").apply {
load(null)
}
val result: Boolean = if (keyStore.containsAlias(alias)) {
true
} else {
Timber.v("No keypair for %s, creating a new one", alias)
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1 && initAndroidM(alias)) {
true
} else {
initAndroidL(alias)
}
}
keyEntry = keyStore.getEntry(alias, null)
_isSupported = result
}
@TargetApi(Build.VERSION_CODES.M)
private fun initAndroidM(alias: String): Boolean {
try {
with(KeyPairGenerator.getInstance(KeyProperties.KEY_ALGORITHM_RSA, KEY_PROVIDER_NAME), {
val spec = KeyGenParameterSpec.Builder(alias,
KeyProperties.PURPOSE_ENCRYPT or KeyProperties.PURPOSE_DECRYPT)
.setAlgorithmParameterSpec(RSAKeyGenParameterSpec(KEY_LENGTH_BIT, F4))
.setBlockModes(KeyProperties.BLOCK_MODE_CBC)
.setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1)
.setDigests(KeyProperties.DIGEST_SHA512,
KeyProperties.DIGEST_SHA384,
KeyProperties.DIGEST_SHA256)
/*
* Setting true only permit the private key to be used if the user authenticated
* within the last five minutes.
*/
.setUserAuthenticationRequired(false)
.build()
initialize(spec)
generateKeyPair()
})
Timber.i("Random keypair with %s/%s/%s is created.", KeyProperties.KEY_ALGORITHM_RSA,
KeyProperties.BLOCK_MODE_CBC, KeyProperties.ENCRYPTION_PADDING_RSA_PKCS1)
return true
} catch (e: GeneralSecurityException) {
/*
* Nonsense, but some devices manufactured by developing countries have actual problem
* Consider using JCE substitutes like Spongy castle(Bouncy castle for android)
*/
Timber.w(e, "It seems that this device does not support RSA algorithm!!")
return false
}
}
private fun initAndroidL(alias: String): Boolean {
try {
with(KeyPairGenerator.getInstance("RSA", KEY_PROVIDER_NAME), {
val start = Calendar.getInstance(Locale.ENGLISH)
val end = Calendar.getInstance(Locale.ENGLISH).apply { add(Calendar.YEAR, VALIDITY_YEARS) }
val spec = KeyPairGeneratorSpec.Builder(appContext)
.setKeySize(KEY_LENGTH_BIT)
.setAlias(alias)
.setSubject(X500Principal("CN=francescojo.github.com, OU=Android dev, O=Francesco Jo, L=Chiyoda, ST=Tokyo, C=JP"))
.setSerialNumber(BigInteger.ONE)
.setStartDate(start.time)
.setEndDate(end.time)
.build()
initialize(spec)
generateKeyPair()
})
Timber.i("Random RSA algorithm keypair is created.")
return true
} catch (e: GeneralSecurityException) {
Timber.w(e, "It seems that this device does not support encryption!!")
return false
}
}
fun encrypt(plainText: String): String {
if (!_isSupported) {
return plainText
}
val cipher = Cipher.getInstance(CIPHER_ALGORITHM).apply({
init(Cipher.ENCRYPT_MODE, (keyEntry as KeyStore.PrivateKeyEntry).certificate.publicKey)
})
val bytes = plainText.toByteArray(Charsets.UTF_8)
val encryptedBytes = cipher.doFinal(bytes)
val base64EncryptedBytes = Base64.encode(encryptedBytes, Base64.DEFAULT)
return String(base64EncryptedBytes)
}
fun decrypt(base64EncryptedCipherText: String): String {
if (!_isSupported) {
return base64EncryptedCipherText
}
val cipher = Cipher.getInstance(CIPHER_ALGORITHM).apply({
init(Cipher.DECRYPT_MODE, (keyEntry as KeyStore.PrivateKeyEntry).privateKey)
})
val base64EncryptedBytes = base64EncryptedCipherText.toByteArray(Charsets.UTF_8)
val encryptedBytes = Base64.decode(base64EncryptedBytes, Base64.DEFAULT)
val decryptedBytes = cipher.doFinal(encryptedBytes)
return String(decryptedBytes)
}
}
\ No newline at end of file
package com.ono.test_app.cache
import android.content.SharedPreferences
class SecureSharedPreferences(private val sharedPref: SharedPreferences) {
fun contains(key: String) = sharedPref.contains(key)
fun get(key: String, defaultValue: Boolean): Boolean = getInternal(key, defaultValue)
fun get(key: String, defaultValue: Int): Int = getInternal(key, defaultValue)
fun get(key: String, defaultValue: Long): Long = getInternal(key, defaultValue)
fun get(key: String, defaultValue: String): String = getInternal(key, defaultValue)
private fun <T : Any> getInternal(key: String, defaultValue: T): T {
val str = sharedPref.getString(key, "")
if (str.isNullOrEmpty()) {
return defaultValue
}
val value = AndroidRsaCipherHelper.decrypt(str)
@Suppress("PlatformExtensionReceiverOfInline", "UNCHECKED_CAST", "IMPLICIT_CAST_TO_ANY")
return when(defaultValue) {
is Boolean -> value.toBoolean()
is Int -> value.toInt()
is Long -> value.toLong()
is String -> value
else -> throw IllegalArgumentException("defaultValue only could be one of these types: Boolean, Int, Long, String")
} as T
}
fun put(key: String, value: Boolean) = putInternal(key, value)
fun put(key: String, value: Int) = putInternal(key, value)
fun put(key: String, value: Long) = putInternal(key, value)
fun put(key: String, value: String) = putInternal(key, value)
private fun putInternal(key: String, value: Any?) {
try {
sharedPref.edit().run {
if (value == null) {
remove(key)
} else {
putString(key, AndroidRsaCipherHelper.encrypt(value.toString()))
}
apply()
}
} catch (e: Throwable) {
e.printStackTrace()
}
}
companion object {
fun wrap(sharedPref: SharedPreferences) = SecureSharedPreferences(sharedPref)
}
}
\ No newline at end of file
package com.ono.test_app;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.widget.TextView;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Iterator;
public class fde94312239df6837d838778b655f7f215a16570150d6bd72a1c6ae5f28a5c53 extends AppCompatActivity {
private String f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a089
= bbf24e1ea6e9832bbb2a745f80bf9e637e97df2603837aeb1d8e65385f554123
.a46a15e810034f80d4bef61772990ec9895e961d767fe9635485ace95826b266
.get("0", "");
@Override
protected void onCreate(Bundle e6ed65d77d6364eeaed5a745ba5c4985ae2b700dd85d7cf7f027bdf294a33fc1) {
super.onCreate(e6ed65d77d6364eeaed5a745ba5c4985ae2b700dd85d7cf7f027bdf294a33fc1);
this.setContentView(R.layout.activity_main);
TextView b27a6a0d519ce361947681b6887f6eb0e9b4bb620d22ad404b23aa1e0e465d47 = findViewById(R.id.textView);
b27a6a0d519ce361947681b6887f6eb0e9b4bb620d22ad404b23aa1e0e465d47
.setText(f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a089);
d131faf9dc50392ca68b2a3cde6ab848e98771849dcfce95b9401f6ebee26c2c(
bbf24e1ea6e9832bbb2a745f80bf9e637e97df2603837aeb1d8e65385f554123
.a46a15e810034f80d4bef61772990ec9895e961d767fe9635485ace95826b266
.get("1", ""));
}
void d131faf9dc50392ca68b2a3cde6ab848e98771849dcfce95b9401f6ebee26c2c(String f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a089) {
f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a089
= bbf24e1ea6e9832bbb2a745f80bf9e637e97df2603837aeb1d8e65385f554123
.a46a15e810034f80d4bef61772990ec9895e961d767fe9635485ace95826b266
.get("2", "");
String e3b98a4da31a127d4bde6e43033f66ba274cab0eb7eb1c70ec41402bf6273dd8
= bbf24e1ea6e9832bbb2a745f80bf9e637e97df2603837aeb1d8e65385f554123
.a46a15e810034f80d4bef61772990ec9895e961d767fe9635485ace95826b266
.get("3", "");
}
}
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillType="evenOdd"
android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
android:strokeWidth="1"
android:strokeColor="#00000000">
<aapt:attr name="android:fillColor">
<gradient
android:endX="78.5885"
android:endY="90.9159"
android:startX="48.7653"
android:startY="61.0927"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#008577"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:textSize="25sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintHorizontal_bias="0.498"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.387" />
<ImageView
android:id="@+id/imageView"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/test"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#008577</color>
<color name="colorPrimaryDark">#00574B</color>
<color name="colorAccent">#D81B60</color>
</resources>
<resources>
<string name="app_name">test_app</string>
</resources>
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
package com.ono.test_app;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
# 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=-Xmx1536m
# 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=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
#Sun Apr 19 19:51:11 KST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
#!/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" "$@"
@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
include ':app'
rootProject.name='test_app'
No preview for this file type