This repository has been archived by the owner on Sep 17, 2021. It is now read-only.
forked from vaibhavpandeyvpz/apkstudio
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
798ef0b
commit 801ad97
Showing
12 changed files
with
128 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#ifndef UBERAPKSIGNER_H | ||
#define UBERAPKSIGNER_H | ||
|
||
#include <QStringList> | ||
#include "macros.h" | ||
#include "java.h" | ||
|
||
APP_NAMESPACE_START | ||
|
||
class UberApkSigner : public Java | ||
{ | ||
private: | ||
QString _jar; | ||
static UberApkSigner *_self; | ||
private: | ||
explicit UberApkSigner(QObject *parent = 0); | ||
public: | ||
// Result build(const QString &project, const QString &apk); | ||
// Result decode(const QString &apk, const QString &project, const QString &framework, const bool sources, const bool resources); | ||
Result sign(const QString &src, const QString &keystore, const QString &keystorePass, const QString &key, const QString &keyPass = QString()); | ||
Result signDebug(const QString &src); | ||
inline Result exec(const QString &arg) { return exec(QStringList(arg)); } | ||
Result exec(const QStringList &args = QStringList()); | ||
static UberApkSigner *get(); | ||
QString getVersion(); | ||
}; | ||
|
||
APP_NAMESPACE_END | ||
|
||
#endif // UBERAPKSIGNER_H | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
#include "include/uberapksigner.h" | ||
#include "include/constants.h" | ||
#include "include/pathutils.h" | ||
#include "include/textutils.h" | ||
|
||
APP_NAMESPACE_START | ||
|
||
UberApkSigner* UberApkSigner::_self = NULL; | ||
|
||
UberApkSigner::UberApkSigner(QObject *parent) | ||
: Java(parent) | ||
{ | ||
_jar = PathUtils::find("uber-apk-signer.jar"); | ||
} | ||
|
||
Process::Result UberApkSigner::sign(const QString &s, const QString &ks, const QString &ksp, const QString &k, const QString &kp) | ||
{ | ||
QStringList args("--debug"); | ||
args << "-ks" << ks << "--ksPass" << ksp; | ||
if (!kp.isEmpty()) | ||
{ | ||
args << "--ksKeyPass" << kp; | ||
} | ||
return exec(args << "-a" << s << "--ksAlias" << k << "--overwrite" << "--allowResign"); | ||
} | ||
|
||
Process::Result UberApkSigner::signDebug(const QString &s) | ||
This comment has been minimized.
Sorry, something went wrong. |
||
{ | ||
QStringList args("--debug"); | ||
return exec(args << "-a" << s << "--overwrite" << "--allowResign"); | ||
} | ||
|
||
UberApkSigner *UberApkSigner::get() | ||
{ | ||
if (!_self) | ||
{ | ||
_self = new UberApkSigner(); | ||
} | ||
return _self; | ||
} | ||
|
||
Process::Result UberApkSigner::exec(const QStringList &a) | ||
{ | ||
return Java::exec(QStringList("-jar") << _jar << a); | ||
} | ||
|
||
|
||
QString UberApkSigner::getVersion() | ||
{ | ||
Process::Result r = exec("-version"); | ||
QRegularExpression rgx(REGEX_UBERAPKTOOL_VERSION); | ||
foreach (const QString &l, r.output) | ||
{ | ||
QRegularExpressionMatch m = rgx.match(l); | ||
if (m.hasMatch()) | ||
{ | ||
QString v("%1.%2.%3"); | ||
for (int i = 1; i <= 3; i++) | ||
{ v = v.arg(m.captured(i)); } | ||
return v; | ||
} | ||
} | ||
return QString(); | ||
} | ||
|
||
APP_NAMESPACE_END | ||
|
This file was deleted.
Oops, something went wrong.
1 comment
on commit 801ad97
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Removed
jarsigner
andzipalign
class files - Added class for
uber-apk-signer
- Added
uber-apk-signer
version in status bar
If a ketstore isn't provided,
uber-apk-tool
uses its own debugKeyStore for signing app