[Q] How to implement Admob into App Inventor Apps - Android Q&A, Help & Troubleshooting

Hello All
I have tried using App2Market to let the Eclipse read the app but it can't :|
is there any way to make this done ?
Thanks and Best Regards..

Any Ideas ?

Use APKTOOL to Decompile App Inventor App
first put a copy of your ai app in the windows directory
Once you Download and extract the APKTOOL to your (i use windows) directory, open command prompt.
cd to the directory you extracted the apktool into. cd\Windows)
enter this line of command:
apktool d -s c:\windows\YOURAPPNAME.apk
it will take a sec to decompile the app. but once it does, your app will show up as a folder in windows dir.
from here, you can go into eclipse and create new android project from existing source. and navigate to the extracted version of your app. you will find the APK tool on here if you search for it. and the instructions there are better.

Related

how to view edit Smalli codes any android app hacking

hacking or cracking an android app is a easy part with XDA AUTO TOOL ..
search and download and install this tool ..
Process
Step One – Decompiling The APK File
Open the xdaAutoTool folder and run the program. It will prompt you to install a file called “framework-res.apk.” Ignore this. Close the program.
In the xdaAutoTool folder you we see a bunch of folders appear after the program ran. Look for one called “_INPUT_APK.” Put your APK file in the folder and run the program again. Press “Decompile All” located on the left side of the program window.
xdaAutoTool will decompile the APK file and create a new directory in the _INPUT_APK folder.
Step Two – Finding Your Target
Are you ready to be introduced to Smali code? Don’t worry! It isn’t too difficult once you realize what’s going on in the code. Java can’t be decompiled back into the original source code, it can, however, be decompiled into something called Smali code.
Navigate back to the _INPUT_APK directory and open the new folder (it will have the same name as the APK file). Once there, you will see a directory named “smali.” This is your target. Depending on your intentions, you will need to sift through the various files and folders in the smali directory until you locate the code you would like to modify.
For example, if you are trying to increase the firepower of a turret in an Android game, you will need to find the file for that turret. These directories are structured. You will probably see quite a few directories containing files used for advertisements, etc. One you discover the actual game directory, everything you need to alter will be in there.
How to change smalli code
now again open xda auto tool after edit changes and recompile and build your changes
You done ..........

[Q] Apktool problem

I want to decompile some system apps and I can't even get apktool to work. I installed java jre and jdk both and I get the following error in cmd:
Java is not recognized as an internal or external command
So I set my environmental system variables for Java on my windows xp computer as shown below:
View attachment 2825945
But I still get the same error as before! I need someone to please help me figure this out before I get even more frustrated!
Make sure you have installed apktool correctly
Windows:
Download The Following From Here
apktool1.5.2.tar.bz2
apktool-install-windows-r05-ibot.tar.bz2
Unzip both files with winrar and put the contents (there should be 3 files) in C:\Windows
if you have java jdk installed you should be able to type apktool and hit enter at the command prompt and if installed it will give you all the options for apkool
Linux:
Download apktool-install-linux-* file
Download apktool-* file
Unpack both to /usr/local/bin directory (you must have root permissions)
Mac OS X:
Download apktool-install-macos-* file
Download apktool-* file
Unpack both to /usr/local/bin directory (you must have root permissions)
did everything still not working
I Followed this guide here which is very similiar: http://androidforums.com/esteem-all-things-root/520917-guide-how-properly-decompile-recompile-apks-apktool.html
I stopped at installing framework because CMD would not let me be able to do so!
Any other advice?
I really need to get this working!
Thanks for your help!
JT1510365 said:
I Followed this guide here which is very similiar: http://androidforums.com/esteem-all-things-root/520917-guide-how-properly-decompile-recompile-apks-apktool.html
I stopped at installing framework because CMD would not let me be able to do so!
Any other advice?
I really need to get this working!
Thanks for your help!
Click to expand...
Click to collapse
what version of apktool are you using? maybe the apktool doesn't support it.. download de jar and the appt http://forum.xda-developers.com/showthread.php?t=1755243 , open the cmd window holding shift+ right button where the apktool is placed

Apktool fix for windows PC

We all suffer a lot for apktool error.....
This is so annoying isn't it !!:crying::crying::crying:
Most of us canrt recompile successfully
I am going to give the fix for this:cyclops::cyclops::cyclops:
Download this apktool in attachment
Now extract is to your windows pc C;//users/(your name)/apktool
Now download JDK from java.com and remove all java softs you used before!!!:silly:
Now take these from your ROMS system/framework framework-res.apk,semcgenericuxpres.apk and mediatek-res.apk(if you have ).
Copy jre(whole folder) from programme files java to C;//users/user/apktool
THen open control panel > java > go to java tab > now click view > then click find > now take it to the apktool folder and then click next and minimize it dont maximize.
Not open command promt from the apktool folder and type apktool if framework-res.apk , apktool if semcgenericuxpres.apk and all other frameworks you have :laugh::laugh::laugh::laugh:
Code:
apktool if framework-res.apk
You have to chose chose frameworks with your brain :good::good::good::good:
Now take any thing from that rom like settings.apk
To decompile type apktool d settings.apk
Code:
apktool d settings.apk
Then do your works and then to recompile type
Code:
apktool b settings
The command for signing is given in the apktool use that for signing the apk :victory::victory::victory::victory:
You are done ! Any problem comment here !!!!:fingers-crossed::fingers-crossed::fingers-crossed:
Yasinarefin said:
We all suffer a lot for apktool error.....
This is so annoying isn't it !!:crying::crying::crying:
Most of us canrt recompile successfully
I am going to give the fix for this:cyclops::cyclops::cyclops:
Download this apktool in attachment
Now extract is to your windows pc C;//users/(your name)/apktool
Now download JDK from java.com and remove all java softs you used before!!!:silly:
Now take these from your ROMS system/framework framework-res.apk,semcgenericuxpres.apk and mediatek-res.apk(if you have ).
Copy jre(whole folder) from programme files java to C;//users/user/apktool
THen open control panel > java > go to java tab > now click view > then click find > now take it to the apktool folder and then click next and minimize it dont maximize.
Not open command promt from the apktool folder and type apktool if framework-res.apk , apktool if semcgenericuxpres.apk and all other frameworks you have :laugh::laugh::laugh::laugh:
Code:
apktool if framework-res.apk
You have to chose chose frameworks with your brain :good::good::good::good:
Now take any thing from that rom like settings.apk
To decompile type apktool d settings.apk
Code:
apktool d settings.apk
Then do your works and then to recompile type
Code:
apktool b settings
The command for signing is given in the apktool use that for signing the apk :victory::victory::victory::victory:
You are done ! Any problem comment here !!!!:fingers-crossed::fingers-crossed::fingers-crossed:
Click to expand...
Click to collapse
No idea what issues your having as many of us here have no issues with apktool
zelendel said:
No idea what issues your having as many of us here have no issues with apktool
Click to expand...
Click to collapse
Use the Bangladeshi phones like symphony walton ! Then you will understand !
Yasinarefin said:
Use the Bangladeshi phones like symphony walton ! Then you will understand !
Click to expand...
Click to collapse
Not likely as there is no access to those devices in most places in the world. I also searched for the device and it seems like it is a china based import which now makes sense.,

How to use Autosign with Linux ?

Hello,
I`m trying to edit the WhatsApp app in my android phone using Autosign ( a windows executable).
I followed all the steps until i executed the sign.bat (with Wine) and i cant keep on.
The problem is that it doesn´t recognize the other files that are needed to create the new apk.
Here you can see what appeared in the screen.
Auto-Sign Created by Dave Da illest 1 Edited to be easier to use with APK files by mixpix405 Make sure the APK you want signed is the only APK inside this folder Pulse cualquier tecla para continuar... .apk is now being signed. The signed version be named your_app_signed.apk Can't recognize 'java -jar signapk.jar testkey.x509.pem testkey.pk8 *.apk your_app_signed.apk' as an internal or external command, or batch script.
anyone knows how i can make it work ?
Just curious, why dont you use native linux tools for dis/assembling/signing etc. APKs?

[GUIDE] Modifying apk/jar files on the Axon 7

So I decided to write up a little guide on how to modify apk and jar files on the Axon 7 for those of you who do not know how and would like to make some modifications such as the ones in my guides.
Prerequisites
A Windows/Linux/Mac computer
A rooted device with TWRP Recovery
USB cable
ADB installed and USB debugging enabled
Java JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html
APKTool: https://ibotpeaches.github.io/Apktool/install/ (Follow all the instructions)
Baksmali: https://bitbucket.org/JesusFreke/smali/downloads/baksmali-2.2.0.jar
7-Zip or another archive manager
1. Install the frameworks to your computer
Open a command window in your working directory and connect your device to your computer with the USB-C cable.
Pull the framework files with
Code:
adb pull /system/framework/framework-res.apk
adb pull /system/framework/framework-zte-res.apk
Install them
Code:
apktool if framework-res.apk
apktool if framework-zte-res.apk
Depending on which ROM you are on you may need to install other frameworks. The above is for the stock ROM.
2. Decompile the apk/jar file.
Pull the apk/jar you want to decompile with
Code:
adb pull path_to_apk_or_jar
Here are paths for some commonly modified apk/jars:
SystemUI: /system/priv-app/SystemUI_ZTE/SystemUI_ZTE.apk
Settings: /system/priv-app/Settings_ZTE/Settings_ZTE.apk
services.jar: /system/framework/services.jar
Decompile the apk with
Code:
apktool d <apk/jar>
If you did everything correctly, a folder should now exist with the name of your apk/jar.
3. Decompile the .odex file
You can skip this step if your apk/jar does not have an .odex associated with it or you only need to modify res and not smali.
Pull the odex file
Code:
adb pull path_to_odex
For example if you want to pull the odex file for SystemUI you would do
Code:
adb pull /system/priv-app/SystemUI_ZTE/oat/arm64/SystemUI_ZTE.odex
Create a folder called "smali" in the directory of your decompiled apk/jar. Then go back to your working directory.
Pull all boot oat files from your device with
Code:
adb pull /system/framework/arm64
Move all the oat files inside the arm64 folder on your PC to your working directory.
Using baksmali, decompile the odex file to smali
Code:
java -jar baksmali.jar deodex -a <api> filename.odex
where api is 23 for Android 6.0, 24 for Android 7.0, and 25 for Android 7.1
A new folder should now be created called "out". Cut and paste the files and folders inside this folder into the "smali" folder you created earlier.
4. Make your modifications.
5. Recompile the apk/jar
From the working directory (not the directory of the decompiled apk/jar) Recompile the apk/jar with
Code:
apktool b name_of_folder
where name_of_folder is the name of the directory of the decompiled apk/jar.
The complied apk/jar should now exist in the "dist" folder in the directory of the decompiled apk/jar.
6. Sign the apk.
Using 7-zip or another archive manager, copy the res folder, resources.arsc file, and the classes.dex file (if you modified smali in steps 3 and 4) from the NEW apk to the ORIGINAL apk.
7. Replace the apk/jar on your device.
Reboot your device into TWRP recovery with
Code:
adb reboot recovery
For user apps: Make sure data is mounted in TWRP's mount menu. If you have encryption turned on you must enter your password otherwise data will not be mounted!
For system apps and framework files: Make sure system is mounted in TWRP's mount menu. Uncheck "Mount system read-only" if it is checked.
Push the ORIGINAL apk/jar to the correct directory on your device
Code:
adb push <apk/jar> path_to_apk_or_jar
Set correct permissions on the apk/jar
Code:
adb shell chmod 0644 path_to_apk_or_jar
If you did step 3, use TWRP's file manager in Advanced<File Manager to navigate to the apk/jar file's directory and delete the existing .oat or .odex file associated with it.
You did it
No go
Hi,
Tried it with the SystemUI_ZTE.apk (and odex) from the 2017G B08 ROM. I ended up with a folder named SystemUI_ZTE. I created a smali folder in that folder and moved the android, com and cn folders (that I got using the "java -jar oat2dex.jar smali SystemUI_ZTE.odex" command) to that smali folder. But when I try the apktool b command I get the following error:
Code:
C:\Users\Blub\ZTE>apktool b SystemUI_ZTE
I: Using Apktool 2.3.0
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
SystemUI_ZTE\smali\android\support\v17\leanback\app\BackgroundManager.smali[102,4] iput-wide-volatile is an odexed instruction. You cannot reassemble a disassembled odex file unless it has been deodexed.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: android/support/v17/leanback/app/BackgroundManager.smali
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:75)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:59)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:36)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:412)
at brut.androlib.Androlib.buildSources(Androlib.java:343)
at brut.androlib.Androlib.build(Androlib.java:299)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.apktool.Main.cmdBuild(Main.java:224)
at brut.apktool.Main.main(Main.java:75)
Any idea what I am doing wrong?
TIA,
Cheers,
/Cacti
le_cactus said:
Hi,
Tried it with the SystemUI_ZTE.apk (and odex) from the 2017G B08 ROM. I ended up with a folder named SystemUI_ZTE. I created a smali folder in that folder and moved the android, com and cn folders (that I got using the "java -jar oat2dex.jar smali SystemUI_ZTE.odex" command) to that smali folder. But when I try the apktool b command I get the following error:
Any idea what I am doing wrong?
TIA,
Cheers,
/Cacti
Click to expand...
Click to collapse
I updated the OP with a different tool for the odex file. Try it now.
Hi,
Thanks,but "java -jar baksmali-2.2.0.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" gives me this error
Code:
Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got -a
at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
at com.beust.jcommander.JCommander.parse(JCommander.java:304)
at com.beust.jcommander.JCommander.parse(JCommander.java:287)
at org.jf.baksmali.Main.main(Main.java:90)
Cheers,
/Cacti
le_cactus said:
Hi,
Thanks,but "java -jar baksmali-2.2.0.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" gives me this error
Cheers,
/Cacti
Click to expand...
Click to collapse
Try it without any arguments: "java -jar baksmali-2.2.0.jar SystemUI_ZTE.odex"
Hi,
The command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex"gives me
Code:
Error occurred while loading class path files. Aborting.
org.jf.dexlib2.analysis.ClassPathResolver$ResolveException: Error while loading oat file boot.oat
at org.jf.dexlib2.analysis.ClassPathResolver.loadEntry(ClassPathResolver.java:250)
at org.jf.dexlib2.analysis.ClassPathResolver.loadLocalClassPathEntry(ClassPathResolver.java:179)
at org.jf.dexlib2.analysis.ClassPathResolver.loadLocalOrDeviceBootClassPathEntry(ClassPathResolver.java:191)
at org.jf.dexlib2.analysis.ClassPathResolver.<init>(ClassPathResolver.java:120)
at org.jf.dexlib2.analysis.ClassPathResolver.<init>(ClassPathResolver.java:105)
at org.jf.baksmali.AnalysisArguments.loadClassPathForDexFile(AnalysisArguments.java:129)
at org.jf.baksmali.AnalysisArguments.loadClassPathForDexFile(AnalysisArguments.java:86)
at org.jf.baksmali.DisassembleCommand.getOptions(DisassembleCommand.java:203)
at org.jf.baksmali.DeodexCommand.getOptions(DeodexCommand.java:71)
at org.jf.baksmali.DisassembleCommand.run(DisassembleCommand.java:177)
at org.jf.baksmali.Main.main(Main.java:102)
Caused by: org.jf.dexlib2.analysis.ClassPathResolver$NotFoundException: Cannot find dependency boot-core-libart.oat in null
at org.jf.dexlib2.analysis.ClassPathResolver.loadOatDependencies(ClassPathResolver.java:270)
at org.jf.dexlib2.analysis.ClassPathResolver.loadEntry(ClassPathResolver.java:248)
... 10 more
Cheers,
/Cacti
le_cactus said:
Hi,
The command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex"gives me
Cheers,
/Cacti
Click to expand...
Click to collapse
pull boot-core-libart.oat from /system/framework/arm64/boot-core-libart.oat and try again
Muchas gracias
Hi,
Had to pull all the .oat files from the /system/framework/arm64/ folder, only then I didn't get an error any more using the command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex". The "command "java -jar baksmali.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" still gave an error, you might wanna change that in the OP.
Now apktool b SystemUI_ZTE didn't give me any errors anymore. Executed the other steps, and bingo! Everthing seems to work. And byy replacing the charging.ogg, my device charges silently.
Thanks from my wife as she now doesn't wake up when I go to bed (and connect the charger). Many thanks for your patience and your excelent guide! I guess I'll bemodding some more APK's now
Cheers,
/Cacti
le_cactus said:
Hi,
Had to pull all the .oat files from the /system/framework/arm64/ folder, only then I didn't get an error any more using the command "java -jar baksmali.jar deodex -a 25 SystemUI_ZTE.odex". The "command "java -jar baksmali.jar -a 25 -x SystemUI_ZTE.odex -d %CD%" still gave an error, you might wanna change that in the OP.
Now apktool b SystemUI_ZTE didn't give me any errors anymore. Executed the other steps, and bingo! Everthing seems to work. And byy replacing the charging.ogg, my device charges silently.
Thanks from my wife as she now doesn't wake up when I go to bed (and connect the charger). Many thanks for your patience and your excelent guide! I guess I'll bemodding some more APK's now
Cheers,
/Cacti
Click to expand...
Click to collapse
Great! I'll add that to the OP! Thanks for helping me out!
Updated the OP with a new signing method that should fix boot hang issues with some apks (aka Settings_ZTE)
bkores said:
Updated the OP with a new signing method that should fix boot hang issues with some apks (aka Settings_ZTE)
Click to expand...
Click to collapse
IMO it was just the same as your previous method (under 5.)was saying : move META-INF ( and manifest but not necessary imo) from original apk into the new apk (in dist folder).
Now you're saying : put res, resources and classes from new apk into new apk...that's just the same, no ? Only more files to move imo.
Since res, resources and classes are indeed changing by compile, wouldn't it be better by just saying : put META-INF from original apk into new apk, like you first wrote in OP ? Easier no ?
ALSO : under 6. you say : Open a command window in the "dist" folder and push the ORIGINAL apk/jar to the correct directory on your device
Shouldn't that be : push ORIGINAL (since you copied files under 5 from NEW(in "dist") to ORIGINAL(in working folder) ) FROM WORKING FOLDER ? Since there is no original apk in DIST folder, only our new apk. Imo you make things a bit confusing here, no ? :cyclops:
raystef66 said:
IMO it was just the same as your previous method (under 5.)was saying : move META-INF ( and manifest but not necessary imo) from original apk into the new apk (in dist folder).
Now you're saying : put res, resources and classes from new apk into new apk...that's just the same, no ? Only more files to move imo.
Since res, resources and classes are indeed changing by compile, wouldn't it be better by just saying : put META-INF from original apk into new apk, like you first wrote in OP ? Easier no ?
ALSO : under 6. you say : Open a command window in the "dist" folder and push the ORIGINAL apk/jar to the correct directory on your device
Shouldn't that be : push ORIGINAL (since you copied files under 5 from NEW(in "dist") to ORIGINAL(in working folder) ) FROM WORKING FOLDER ? Since there is no original apk in DIST folder, only our new apk. Imo you make things a bit confusing here, no ? :cyclops:
Click to expand...
Click to collapse
Fixed!
bkores said:
Fixed!
Click to expand...
Click to collapse
Thnx Mate ! Appreciate all your work :good:
i have some problem with framework.jar, it doesn't have classes.dex in jar but it also doesn't have odex file in /system/framework/oat/arm64 (also arm). Because of it i can't decompile it using smali/baksmali tool. I want to make more volume steps mode like VolumeSteps+ but without Xposed. Hope someone can help.

Categories

Resources