Use apktool jar file in my android project?












7
















  1. Put in the .apk file which you want to decode

  2. Download the latest version of apktool AND apktool install window (both can be downloaded from the same link) and place them in the same folder

  3. Now run a command like apktool if framework-res.apk and next
    apktool d myApp.apk (where myApp.apk denotes the filename that you want to decode)


Can I perform the above steps of apktool in an android project? Let me know if anyone can help me. I want to make an application similar to apkEditor.










share|improve this question




















  • 1





    Maybe you should make your question / requirements be much more clear so that it will be easier to offer help.

    – shizhen
    Nov 27 '18 at 7:48
















7
















  1. Put in the .apk file which you want to decode

  2. Download the latest version of apktool AND apktool install window (both can be downloaded from the same link) and place them in the same folder

  3. Now run a command like apktool if framework-res.apk and next
    apktool d myApp.apk (where myApp.apk denotes the filename that you want to decode)


Can I perform the above steps of apktool in an android project? Let me know if anyone can help me. I want to make an application similar to apkEditor.










share|improve this question




















  • 1





    Maybe you should make your question / requirements be much more clear so that it will be easier to offer help.

    – shizhen
    Nov 27 '18 at 7:48














7












7








7









  1. Put in the .apk file which you want to decode

  2. Download the latest version of apktool AND apktool install window (both can be downloaded from the same link) and place them in the same folder

  3. Now run a command like apktool if framework-res.apk and next
    apktool d myApp.apk (where myApp.apk denotes the filename that you want to decode)


Can I perform the above steps of apktool in an android project? Let me know if anyone can help me. I want to make an application similar to apkEditor.










share|improve this question

















  1. Put in the .apk file which you want to decode

  2. Download the latest version of apktool AND apktool install window (both can be downloaded from the same link) and place them in the same folder

  3. Now run a command like apktool if framework-res.apk and next
    apktool d myApp.apk (where myApp.apk denotes the filename that you want to decode)


Can I perform the above steps of apktool in an android project? Let me know if anyone can help me. I want to make an application similar to apkEditor.







android reverse-engineering decompiling apktool






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 18:48









W.Ambrozic

901212




901212










asked Jan 22 '18 at 7:45









Deepak SahuDeepak Sahu

735




735








  • 1





    Maybe you should make your question / requirements be much more clear so that it will be easier to offer help.

    – shizhen
    Nov 27 '18 at 7:48














  • 1





    Maybe you should make your question / requirements be much more clear so that it will be easier to offer help.

    – shizhen
    Nov 27 '18 at 7:48








1




1





Maybe you should make your question / requirements be much more clear so that it will be easier to offer help.

– shizhen
Nov 27 '18 at 7:48





Maybe you should make your question / requirements be much more clear so that it will be easier to offer help.

– shizhen
Nov 27 '18 at 7:48












1 Answer
1






active

oldest

votes


















1














The answer is yes, you can perform the steps you mentioned.



I'm not going to write the application for you but here are some guidelines. First, apktool is written in Java so you can download the latest release packaged from here. Make sure you read the license first. Then import it into you Android studio project. There is a specific class that is called Main with a main method that is responsible for the CLI. For example:



import brut.apktool.Main;
try {
Main.main(new String{"if", "/sdcard/...your_path.../framework-res.apk"});
Main.main(new String{"d", "myApp.apk"});
} catch (IOException | InterruptedException | BrutException e) {
e.printStackTrace();
}


PS: In case I misunderstood your question. If you want every time the program runs to download the newest version of apktool jar from Github you can use JarURLConnection to fetch the remote jar file and reflection to invoke the Main.main() with your parameterers. A comprehensive example of which can be found here.






share|improve this answer


























  • if I want to build that file again, then?

    – Akash Mishra
    Nov 29 '18 at 7:09











  • If I understand your question, after decompilation you ll have the source code, not an Android Studio project. You can try importing it into Android Studio via "Import from existing sources" but probably errors will still exist.

    – JAAAY
    Nov 29 '18 at 8:19











  • not that, I am asking to build that source again in a apk. When I decompiled the source by using the code provided by you, I want to build that source again in a apk from that app.

    – Akash Mishra
    Nov 29 '18 at 10:01











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48376764%2fuse-apktool-jar-file-in-my-android-project%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














The answer is yes, you can perform the steps you mentioned.



I'm not going to write the application for you but here are some guidelines. First, apktool is written in Java so you can download the latest release packaged from here. Make sure you read the license first. Then import it into you Android studio project. There is a specific class that is called Main with a main method that is responsible for the CLI. For example:



import brut.apktool.Main;
try {
Main.main(new String{"if", "/sdcard/...your_path.../framework-res.apk"});
Main.main(new String{"d", "myApp.apk"});
} catch (IOException | InterruptedException | BrutException e) {
e.printStackTrace();
}


PS: In case I misunderstood your question. If you want every time the program runs to download the newest version of apktool jar from Github you can use JarURLConnection to fetch the remote jar file and reflection to invoke the Main.main() with your parameterers. A comprehensive example of which can be found here.






share|improve this answer


























  • if I want to build that file again, then?

    – Akash Mishra
    Nov 29 '18 at 7:09











  • If I understand your question, after decompilation you ll have the source code, not an Android Studio project. You can try importing it into Android Studio via "Import from existing sources" but probably errors will still exist.

    – JAAAY
    Nov 29 '18 at 8:19











  • not that, I am asking to build that source again in a apk. When I decompiled the source by using the code provided by you, I want to build that source again in a apk from that app.

    – Akash Mishra
    Nov 29 '18 at 10:01
















1














The answer is yes, you can perform the steps you mentioned.



I'm not going to write the application for you but here are some guidelines. First, apktool is written in Java so you can download the latest release packaged from here. Make sure you read the license first. Then import it into you Android studio project. There is a specific class that is called Main with a main method that is responsible for the CLI. For example:



import brut.apktool.Main;
try {
Main.main(new String{"if", "/sdcard/...your_path.../framework-res.apk"});
Main.main(new String{"d", "myApp.apk"});
} catch (IOException | InterruptedException | BrutException e) {
e.printStackTrace();
}


PS: In case I misunderstood your question. If you want every time the program runs to download the newest version of apktool jar from Github you can use JarURLConnection to fetch the remote jar file and reflection to invoke the Main.main() with your parameterers. A comprehensive example of which can be found here.






share|improve this answer


























  • if I want to build that file again, then?

    – Akash Mishra
    Nov 29 '18 at 7:09











  • If I understand your question, after decompilation you ll have the source code, not an Android Studio project. You can try importing it into Android Studio via "Import from existing sources" but probably errors will still exist.

    – JAAAY
    Nov 29 '18 at 8:19











  • not that, I am asking to build that source again in a apk. When I decompiled the source by using the code provided by you, I want to build that source again in a apk from that app.

    – Akash Mishra
    Nov 29 '18 at 10:01














1












1








1







The answer is yes, you can perform the steps you mentioned.



I'm not going to write the application for you but here are some guidelines. First, apktool is written in Java so you can download the latest release packaged from here. Make sure you read the license first. Then import it into you Android studio project. There is a specific class that is called Main with a main method that is responsible for the CLI. For example:



import brut.apktool.Main;
try {
Main.main(new String{"if", "/sdcard/...your_path.../framework-res.apk"});
Main.main(new String{"d", "myApp.apk"});
} catch (IOException | InterruptedException | BrutException e) {
e.printStackTrace();
}


PS: In case I misunderstood your question. If you want every time the program runs to download the newest version of apktool jar from Github you can use JarURLConnection to fetch the remote jar file and reflection to invoke the Main.main() with your parameterers. A comprehensive example of which can be found here.






share|improve this answer















The answer is yes, you can perform the steps you mentioned.



I'm not going to write the application for you but here are some guidelines. First, apktool is written in Java so you can download the latest release packaged from here. Make sure you read the license first. Then import it into you Android studio project. There is a specific class that is called Main with a main method that is responsible for the CLI. For example:



import brut.apktool.Main;
try {
Main.main(new String{"if", "/sdcard/...your_path.../framework-res.apk"});
Main.main(new String{"d", "myApp.apk"});
} catch (IOException | InterruptedException | BrutException e) {
e.printStackTrace();
}


PS: In case I misunderstood your question. If you want every time the program runs to download the newest version of apktool jar from Github you can use JarURLConnection to fetch the remote jar file and reflection to invoke the Main.main() with your parameterers. A comprehensive example of which can be found here.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 28 '18 at 0:38

























answered Nov 28 '18 at 0:31









JAAAYJAAAY

173213




173213













  • if I want to build that file again, then?

    – Akash Mishra
    Nov 29 '18 at 7:09











  • If I understand your question, after decompilation you ll have the source code, not an Android Studio project. You can try importing it into Android Studio via "Import from existing sources" but probably errors will still exist.

    – JAAAY
    Nov 29 '18 at 8:19











  • not that, I am asking to build that source again in a apk. When I decompiled the source by using the code provided by you, I want to build that source again in a apk from that app.

    – Akash Mishra
    Nov 29 '18 at 10:01



















  • if I want to build that file again, then?

    – Akash Mishra
    Nov 29 '18 at 7:09











  • If I understand your question, after decompilation you ll have the source code, not an Android Studio project. You can try importing it into Android Studio via "Import from existing sources" but probably errors will still exist.

    – JAAAY
    Nov 29 '18 at 8:19











  • not that, I am asking to build that source again in a apk. When I decompiled the source by using the code provided by you, I want to build that source again in a apk from that app.

    – Akash Mishra
    Nov 29 '18 at 10:01

















if I want to build that file again, then?

– Akash Mishra
Nov 29 '18 at 7:09





if I want to build that file again, then?

– Akash Mishra
Nov 29 '18 at 7:09













If I understand your question, after decompilation you ll have the source code, not an Android Studio project. You can try importing it into Android Studio via "Import from existing sources" but probably errors will still exist.

– JAAAY
Nov 29 '18 at 8:19





If I understand your question, after decompilation you ll have the source code, not an Android Studio project. You can try importing it into Android Studio via "Import from existing sources" but probably errors will still exist.

– JAAAY
Nov 29 '18 at 8:19













not that, I am asking to build that source again in a apk. When I decompiled the source by using the code provided by you, I want to build that source again in a apk from that app.

– Akash Mishra
Nov 29 '18 at 10:01





not that, I am asking to build that source again in a apk. When I decompiled the source by using the code provided by you, I want to build that source again in a apk from that app.

– Akash Mishra
Nov 29 '18 at 10:01




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f48376764%2fuse-apktool-jar-file-in-my-android-project%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Contact image not getting when fetch all contact list from iPhone by CNContact

count number of partitions of a set with n elements into k subsets

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks