Decompile an apk created with MIT App Inventor

1,335 views
Skip to first unread message

BEGOÑA CARRASCO GONZÁLEZ

unread,
Jan 22, 2018, 3:57:32 AM1/22/18
to MIT App Inventor Forum
Hi,
I am doing a projet in which I have to decompile the apk in order to have values files in XML. I have insert text block in App Inventor because I think they would appear as values files, but when I decompile the apk, I can't found these text blocks in XML.
Anybody knows why and what can I do? 

TimAI2

unread,
Jan 22, 2018, 4:17:27 AM1/22/18
to MIT App Inventor Forum
After decompiling the apk, look in the /res folder, this contains files of all the strings in xml format.

Hopefully, this is what you are after ? 

BEGOÑA CARRASCO GONZÁLEZ

unread,
Jan 22, 2018, 4:28:02 AM1/22/18
to MIT App Inventor Forum
No. I have already look in /res folder where I have found the values folders, but in these XML I can't found the text I am looking for.
<resources>
    <string name="abc_action_bar_home_description">Navigate home</string>
    <string name="abc_action_bar_up_description">Navigate up</string>
    <string name="abc_action_menu_overflow_description">More options</string>
    <string name="abc_action_mode_done">Finished</string>
    <string name="abc_activity_chooser_view_see_all">See all</string>
    <string name="abc_activitychooserview_choose_application">Choose an app</string>
    <string name="abc_searchview_description_clear">Clear query</string>
    <string name="abc_searchview_description_query">Search query</string>
    <string name="abc_searchview_description_search">Search</string>
    <string name="abc_searchview_description_submit">Submit query</string>
    <string name="abc_searchview_description_voice">Voice search</string>
    <string name="abc_shareactionprovider_share_with">Share with</string>
    <string name="abc_shareactionprovider_share_with_application">Share with %s</string>
</resources>
These are the strings that appears. Not the strings I create in the MIT App Inventor.

TimAI2

unread,
Jan 22, 2018, 5:43:37 AM1/22/18
to MIT App Inventor Forum
Data you input to the app is stored on the device in a special area for AI2, not usually accessible outside of the app. The apk content will be just as you installed it.

If you want to retrieve all entered data, you will need to export it to a file saved to a readable directory

BEGOÑA CARRASCO GONZÁLEZ

unread,
Jan 22, 2018, 1:14:18 PM1/22/18
to MIT App Inventor Forum
Ok, but the problem is I am trying to localize the app. The projet is to localize the app into Spanish. So I need the stirngs in English in XML in order to translate them and put them in the /values-es folder.

So, what can I do?

TimAI2

unread,
Jan 22, 2018, 1:43:25 PM1/22/18
to MIT App Inventor Forum
I am a bit confused as to what "values" you want. Could you please give an more detailed example?

BEGOÑA CARRASCO GONZÁLEZ

unread,
Jan 22, 2018, 2:43:28 PM1/22/18
to MIT App Inventor Forum
I mean these folders.


So I want to put in the values-es folder the strings I have added in App Inventor. It's a projet of localization and I have create the apk in English. Now, I wanted to localize it in Spanish. I learned that the strings that can be localized can be found in those folders. But, in those folders, there aren't the strings I create with App Inventor. 
So where are these strings? and how can I localize the apk?+

Juan Antonio

unread,
Jan 22, 2018, 2:44:51 PM1/22/18
to MIT App Inventor Forum
Hola Begoña, how decompile .apk, perhaps with apktool?

BEGOÑA CARRASCO GONZÁLEZ

unread,
Jan 22, 2018, 3:26:38 PM1/22/18
to MIT App Inventor Forum
I did it with APKTool and that's the result. 

Abraham Getzler

unread,
Jan 22, 2018, 3:32:22 PM1/22/18
to MIT App Inventor Forum
There's a YouTube video taking a different approach in the Internationalization section of FAQ
ABG

SteveJG

unread,
Jan 22, 2018, 5:32:48 PM1/22/18
to MIT App Inventor Forum
You real issue is how to do localization with App Inventor.

You need a 'dictionary' for localization / internationalization with App Inventor  .... here is a very simple example of App Inventor localization   https://groups.google.com/forum/#!category-topic/mitappinventortest/0lwvBv7o3rE  

The dictionary is created for two languages using two Lists ... The same technique can be used for your six languages.    If you have a csv file for each language in your media, you can use the File control to select among the files necessary for the required localization.    There is an extension that can determine the 'language of the phone'; use that along with a more elaborate 'dictionary'--you need to look for the extension if that is needed too.

Regards,
Steve

BEGOÑA CARRASCO GONZÁLEZ

unread,
Jan 23, 2018, 4:15:53 AM1/23/18
to MIT App Inventor Forum
There is any way to do it outside AppInventor?

Thank you so much for the information.

SteveJG

unread,
Jan 23, 2018, 9:04:10 AM1/23/18
to MIT App Inventor Forum
Do what outside App Inventor?  Do you mean can you provided the 'dictionaries' as a text file and store that separately from the App?    Yes, that can be done.  Use the File component and possibly Taifun's File extension on a sdCard  to store and retrieve the dictionary files. Alternatively, the dictionaries could be stored in a FusionTable ( or other dadtabase in the cloud or a Google Drive Spreadsheet and retrieved as a List in the localization part of the app.

If you want to do something else, then do not program using App Inventor; use the professional Java based Android Studio and you can make use of localization libraries and other methods not available to App Inventor.  App Inventor is a compiler intended primarily for creating and teaching educational issues.  It is not designed or intended as a compiler to build commercial apps though some professional programmers use it as a prototyping tool because it has some powerful features.   If you need additional functionality, perhaps it is time to graduate to a professional compiler.

Regards,
Steve

Juan Antonio

unread,
Jan 23, 2018, 10:16:03 AM1/23/18
to MIT App Inventor Forum
I you need find a text, decompress .aia file, and read this file:

...\src\appinventor\ai_yourname\yourapp\Screen1.bky

if you need find a text in an .apk file, decomplie with apktool and then edit this file:

folder_app/smali/appinventor/ai_yourname/yourapp/Screen1.smali


Reply all
Reply to author
Forward
0 new messages