Skip to content

Commit f7d76c5

Browse files
committed
init multiSignTool
0 parents  commit f7d76c5

18 files changed

+1286
-0
lines changed

MultiSignTool.iml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>
12+

apksigner

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/bin/bash
2+
#
3+
# Copyright (C) 2016 The Android Open Source Project
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# Set up prog to be the path of this script, including following symlinks,
18+
# and set up progdir to be the fully-qualified pathname of its directory.
19+
prog="$0"
20+
while [ -h "${prog}" ]; do
21+
newProg=`/bin/ls -ld "${prog}"`
22+
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
23+
if expr "x${newProg}" : 'x/' >/dev/null; then
24+
prog="${newProg}"
25+
else
26+
progdir=`dirname "${prog}"`
27+
prog="${progdir}/${newProg}"
28+
fi
29+
done
30+
oldwd=`pwd`
31+
progdir=`dirname "${prog}"`
32+
cd "${progdir}"
33+
progdir=`pwd`
34+
prog="${progdir}"/`basename "${prog}"`
35+
cd "${oldwd}"
36+
37+
jarfile=apksigner.jar
38+
libdir="$progdir"
39+
40+
if [ ! -r "$libdir/$jarfile" ]; then
41+
# set apksigner.jar location for the SDK case
42+
libdir="$libdir/lib"
43+
fi
44+
45+
46+
if [ ! -r "$libdir/$jarfile" ]; then
47+
# set apksigner.jar location for the Android tree case
48+
libdir=`dirname "$progdir"`/framework
49+
fi
50+
51+
if [ ! -r "$libdir/$jarfile" ]; then
52+
echo `basename "$prog"`": can't find $jarfile"
53+
exit 1
54+
fi
55+
56+
# By default, give apksigner a max heap size of 1 gig. This can be overridden
57+
# by using a "-J" option (see below).
58+
defaultMx="-Xmx1024M"
59+
60+
# The following will extract any initial parameters of the form
61+
# "-J<stuff>" from the command line and pass them to the Java
62+
# invocation (instead of to apksigner). This makes it possible for you to add
63+
# a command-line parameter such as "-JXmx256M" in your scripts, for
64+
# example. "java" (with no args) and "java -X" give a summary of
65+
# available options.
66+
67+
javaOpts=""
68+
69+
while expr "x$1" : 'x-J' >/dev/null; do
70+
opt=`expr "x$1" : 'x-J\(.*\)'`
71+
javaOpts="${javaOpts} -${opt}"
72+
if expr "x${opt}" : "xXmx[0-9]" >/dev/null; then
73+
defaultMx="no"
74+
fi
75+
shift
76+
done
77+
78+
if [ "${defaultMx}" != "no" ]; then
79+
javaOpts="${javaOpts} ${defaultMx}"
80+
fi
81+
82+
if [ "$OSTYPE" = "cygwin" ]; then
83+
# For Cygwin, convert the jarfile path into native Windows style.
84+
jarpath=`cygpath -w "$libdir/$jarfile"`
85+
else
86+
jarpath="$libdir/$jarfile"
87+
fi
88+
89+
exec java $javaOpts -jar "$jarpath" "$@"

apksigner_windows.bat

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
@echo off
2+
REM Copyright (C) 2016 The Android Open Source Project
3+
REM
4+
REM Licensed under the Apache License, Version 2.0 (the "License");
5+
REM you may not use this file except in compliance with the License.
6+
REM You may obtain a copy of the License at
7+
REM
8+
REM http://www.apache.org/licenses/LICENSE-2.0
9+
REM
10+
REM Unless required by applicable law or agreed to in writing, software
11+
REM distributed under the License is distributed on an "AS IS" BASIS,
12+
REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
REM See the License for the specific language governing permissions and
14+
REM limitations under the License.
15+
16+
REM don't modify the caller's environment
17+
setlocal
18+
19+
REM Locate apksigner.jar in the directory where apksigner.bat was found and start it.
20+
21+
REM Set up prog to be the path of this script, including following symlinks,
22+
REM and set up progdir to be the fully-qualified pathname of its directory.
23+
set prog=%~f0
24+
25+
rem Check we have a valid Java.exe in the path.
26+
set java_exe=
27+
if exist "%~dp0 lib\find_java.bat" call "%~dp0 lib\find_java.bat"
28+
if exist "%~dp0\lib\find_java.bat" call "%~dp0\lib\find_java.bat"
29+
if not defined java_exe goto :EOF
30+
31+
set jarfile=apksigner.jar
32+
set "frameworkdir=%~dp0"
33+
rem frameworkdir must not end with a dir sep.
34+
set "frameworkdir=%frameworkdir:~0,-1%"
35+
36+
if exist "%frameworkdir%\%jarfile%" goto JarFileOk
37+
set "frameworkdir=%~dp0lib"
38+
39+
if exist "%frameworkdir%\%jarfile%" goto JarFileOk
40+
set "frameworkdir=%~dp0..\framework"
41+
42+
:JarFileOk
43+
44+
set "jarpath=%frameworkdir%\%jarfile%"
45+
46+
set javaOpts=
47+
set args=
48+
49+
REM By default, give apksigner a max heap size of 1 gig and a stack size of 1meg.
50+
rem This can be overridden by using "-JXmx..." and "-JXss..." options below.
51+
set defaultXmx=-Xmx1024M
52+
set defaultXss=-Xss1m
53+
54+
REM Capture all arguments that are not -J options.
55+
REM Note that when reading the input arguments with %1, the cmd.exe
56+
REM automagically converts --name=value arguments into 2 arguments "--name"
57+
REM followed by "value". apksigner has been changed to know how to deal with that.
58+
set params=
59+
60+
:firstArg
61+
if [%1]==[] goto endArgs
62+
set a=%~1
63+
64+
if [%defaultXmx%]==[] goto notXmx
65+
if %a:~0,5% NEQ -JXmx goto notXmx
66+
set defaultXmx=
67+
:notXmx
68+
69+
if [%defaultXss%]==[] goto notXss
70+
if %a:~0,5% NEQ -JXss goto notXss
71+
set defaultXss=
72+
:notXss
73+
74+
if %a:~0,2% NEQ -J goto notJ
75+
set javaOpts=%javaOpts% -%a:~2%
76+
shift /1
77+
goto firstArg
78+
79+
:notJ
80+
set params=%params% %1
81+
shift /1
82+
goto firstArg
83+
84+
:endArgs
85+
86+
set javaOpts=%javaOpts% %defaultXmx% %defaultXss%
87+
call "%java_exe%" %javaOpts% -Djava.ext.dirs="%frameworkdir%" -jar "%jarpath%" %params%
88+

lib/apksigner.jar

201 KB
Binary file not shown.

lib/find_java.bat

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
@echo off
2+
rem Copyright (C) 2007 The Android Open Source Project
3+
rem
4+
rem Licensed under the Apache License, Version 2.0 (the "License");
5+
rem you may not use this file except in compliance with the License.
6+
rem You may obtain a copy of the License at
7+
rem
8+
rem http://www.apache.org/licenses/LICENSE-2.0
9+
rem
10+
rem Unless required by applicable law or agreed to in writing, software
11+
rem distributed under the License is distributed on an "AS IS" BASIS,
12+
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
rem See the License for the specific language governing permissions and
14+
rem limitations under the License.
15+
16+
rem This script is called by the other batch files to find a suitable Java.exe
17+
rem to use. The script changes the "java_exe" env variable. The variable
18+
rem is left unset if Java.exe was not found.
19+
20+
rem Useful links:
21+
rem Command-line reference:
22+
rem http://technet.microsoft.com/en-us/library/bb490890.aspx
23+
24+
rem Query whether this system is 32-bit or 64-bit
25+
rem Note: Some users report that reg.exe is missing on their machine, so we
26+
rem check for that first, as we'd like to use it if we can.
27+
set sys_32=%SYSTEMROOT%\system32
28+
if exist %sys_32%\reg.exe (
29+
rem This first-pass solution returns the correct architecture even if you
30+
rem call this .bat file from a 32-bit process.
31+
rem See also: http://stackoverflow.com/a/24590583/1299302
32+
%sys_32%\reg query "HKLM\Hardware\Description\System\CentralProcessor\0"^
33+
| %sys_32%\find /i "x86" > NUL && set arch_ext=32|| set arch_ext=64
34+
) else (
35+
rem This fallback approach is simpler, but may misreport your architecture as
36+
rem 32-bit if running from a 32-bit process. Still, it should serve to help
37+
rem our users without reg.exe, at least.
38+
if "%PROCESSOR_ARCHITECTURE%" == "x86" (set arch_ext=32) else (set arch_ext=64)
39+
)
40+
41+
rem Check we have a valid Java.exe in the path. The return code will
42+
rem be 0 if the command worked or 1 if the exec failed (program not found).
43+
for /f "delims=" %%a in ('"%~dps0\find_java%arch_ext%.exe" -s') do set java_exe=%%a
44+
if not defined java_exe goto :CheckFailed
45+
46+
:SearchJavaW
47+
rem Check if we can find a javaw.exe at the same location than java.exe.
48+
rem If that doesn't work, just fall back on the java.exe we just found.
49+
for /f "delims=" %%a in ('"%~dps0\find_java%arch_ext%.exe" -s -w') do set javaw_exe=%%a
50+
if not exist "%javaw_exe%" set javaw_exe=%java_exe%
51+
goto :EOF
52+
53+
54+
:CheckFailed
55+
echo.
56+
echo ERROR: No suitable Java found. In order to properly use the Android Developer
57+
echo Tools, you need a suitable version of Java JDK installed on your system.
58+
echo We recommend that you install the JDK version of JavaSE, available here:
59+
echo http://www.oracle.com/technetwork/java/javase/downloads
60+
echo.
61+
echo If you already have Java installed, you can define the JAVA_HOME environment
62+
echo variable in Control Panel / System / Avanced System Settings to point to the
63+
echo JDK folder.
64+
echo.
65+
echo You can find the complete Android SDK requirements here:
66+
echo http://developer.android.com/sdk/requirements.html
67+
echo.
68+
goto :EOF

lib/find_java32.exe

709 KB
Binary file not shown.

lib/find_java64.exe

932 KB
Binary file not shown.

lib/shrinkedAndroid.jar

28.9 KB
Binary file not shown.

multi_sign_info.xml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<multiInfo>
3+
<apkPath>/Volumes/CoderFile/MultiSignTool/e袋洗_V5.3.0_20161221105449.apk</apkPath>
4+
<channelPath>/Volumes/CoderFile/工作天地/打包发布平台/PythonTool/info/channel.txt</channelPath>
5+
<userName>@edaixi.com</userName>
6+
<userPwd></userPwd>
7+
<aliasString>edaixi</aliasString>
8+
<keystorePath>/Volumes/CoderFile/MultiSignTool/edaixisign</keystorePath>
9+
<keystorePwd>edaixi.com</keystorePwd>
10+
</multiInfo>

multisigntool.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
path.variable.kotlin_bundled=/Applications/IntelliJ IDEA CE.app/Contents/plugins/Kotlin/kotlinc
2+
path.variable.maven_repository=/Users/wei_spring/.m2/repository
3+
jdk.home.1.8=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home
4+
javac2.instrumentation.includeJavaRuntime=false
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package com.edaixi.signtool;
2+
3+
import javafx.scene.control.Alert;
4+
5+
/**
6+
* Created by wei_spring on 2016/12/23.
7+
* <p>
8+
* <a href="http://code.makery.ch/blog/javafx-dialogs-official/"> from </a>
9+
* <p>
10+
* Alert工具类
11+
*/
12+
public class AlertUtil {
13+
14+
private static Alert alert = new Alert(Alert.AlertType.INFORMATION);
15+
16+
private AlertUtil() {
17+
}
18+
19+
public static void showAlert(String title, String header, String content) {
20+
21+
alert.setTitle(title);
22+
alert.setHeaderText(header.isEmpty() ? null : header);
23+
alert.setContentText(content);
24+
alert.showAndWait();
25+
}
26+
27+
public static void hideAlert() {
28+
if (alert != null) {
29+
alert.hide();
30+
}
31+
}
32+
}

0 commit comments

Comments
 (0)