Skip to content

Commit c156796

Browse files
DidaAhMyth
andcommitted
Fixed "Building Failed"
If your current logged user on name has space in it, the program will never work. Because https://github.com/AhMyth/AhMyth-Android-RAT/blob/master/AhMyth-Server/app/app/assets/js/controllers/AppCtrl.js#L129 execute the command without quotes on folder argument and it will return an error. Example. My pc ("Lara Vel") has space on its name, so this is the folder for AhMyth basepath : C:\Users\Lara Vel\AppData\Local\Programs\AhMyth Since my user is "Lara Vel", AhMyth would exec build command like this `java -jar apktool.jar b C:\Users\**Lara Vel**\AppData\Local\Programs\AhMyth\resources\app.asar.unpacked\app\Factory\Ahmyth -o C:\Users\**Lara Vel**\AppData\Local\Programs\AhMyth\resources\app.asar.unpacked\app\Factory\ahmyth.apk` SOLUTION: For next update, @AhMyth Simply by giving double quotes between apkFolder and its output folder. This solutions must be implemented in every exec function with directory argument. exec('java -jar ' + CONSTANTS.apktoolJar + ' b "' + apkFolder + '" -o "' + path.join(outputPath, CONSTANTS.apkName + '"') Co-Authored-By: ahmyth <ahmyth@users.noreply.github.com>
1 parent 5d82ffc commit c156796

File tree

2 files changed

+94
-3
lines changed

2 files changed

+94
-3
lines changed

.gitignore

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
# Created by https://www.gitignore.io/api/node
3+
# Edit at https://www.gitignore.io/?templates=node
4+
5+
### Node ###
6+
# Logs
7+
logs
8+
*.log
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# Diagnostic reports (https://nodejs.org/api/report.html)
15+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
16+
17+
# Runtime data
18+
pids
19+
*.pid
20+
*.seed
21+
*.pid.lock
22+
23+
# Directory for instrumented libs generated by jscoverage/JSCover
24+
lib-cov
25+
26+
# Coverage directory used by tools like istanbul
27+
coverage
28+
29+
# nyc test coverage
30+
.nyc_output
31+
32+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33+
.grunt
34+
35+
# Bower dependency directory (https://bower.io/)
36+
bower_components
37+
38+
# node-waf configuration
39+
.lock-wscript
40+
41+
# Compiled binary addons (https://nodejs.org/api/addons.html)
42+
build/Release
43+
44+
# Dependency directories
45+
node_modules/
46+
jspm_packages/
47+
48+
# TypeScript v1 declaration files
49+
typings/
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional REPL history
58+
.node_repl_history
59+
60+
# Output of 'npm pack'
61+
*.tgz
62+
63+
# Yarn Integrity file
64+
.yarn-integrity
65+
66+
# dotenv environment variables file
67+
.env
68+
.env.test
69+
70+
# parcel-bundler cache (https://parceljs.org/)
71+
.cache
72+
73+
# next.js build output
74+
.next
75+
76+
# nuxt.js build output
77+
.nuxt
78+
79+
# vuepress build output
80+
.vuepress/dist
81+
82+
# Serverless directories
83+
.serverless/
84+
85+
# FuseBox cache
86+
.fusebox/
87+
88+
# DynamoDB Local files
89+
.dynamodb/
90+
91+
# End of https://www.gitignore.io/api/node

AhMyth-Server/app/app/assets/js/controllers/AppCtrl.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ app.controller("AppCtrl", ($scope) => {
126126
$appCtrl.GenerateApk = (apkFolder) => {
127127

128128
$appCtrl.Log('Building ' + CONSTANTS.apkName + '...');
129-
var createApk = exec('java -jar ' + CONSTANTS.apktoolJar + ' b ' + apkFolder + ' -o ' + path.join(outputPath, CONSTANTS.apkName),
129+
var createApk = exec('java -jar "' + CONSTANTS.apktoolJar + '" b "' + apkFolder + '" -o "' + path.join(outputPath, CONSTANTS.apkName) + '"',
130130
(error, stdout, stderr) => {
131131
if (error !== null) {
132132
$appCtrl.Log('Building Failed', CONSTANTS.logStatus.FAIL);
133133
return;
134134
}
135135

136136
$appCtrl.Log('Signing ' + CONSTANTS.apkName + '...');
137-
var signApk = exec('java -jar ' + CONSTANTS.signApkJar + ' ' + path.join(outputPath, CONSTANTS.apkName),
137+
var signApk = exec('java -jar "' + CONSTANTS.signApkJar + '" "' + path.join(outputPath, CONSTANTS.apkName) + '"',
138138
(error, stdout, stderr) => {
139139
if (error !== null) {
140140
$appCtrl.Log('Signing Failed', CONSTANTS.logStatus.FAIL);
@@ -335,7 +335,7 @@ app.controller("AppCtrl", ($scope) => {
335335

336336
var apkFolder = filePath.substring(0, filePath.indexOf(".apk"));
337337
$appCtrl.Log('Decompiling ' + filePath + "...");
338-
var decompileApk = exec('java -jar ' + CONSTANTS.apktoolJar + ' d ' + filePath + ' -f -o ' + apkFolder,
338+
var decompileApk = exec('java -jar "' + CONSTANTS.apktoolJar + '" d "' + filePath + '" -f -o "' + apkFolder + '"',
339339
(error, stdout, stderr) => {
340340
if (error !== null) {
341341
$appCtrl.Log('Decompilation Failed', CONSTANTS.logStatus.FAIL);

0 commit comments

Comments
 (0)