How can I compile MITAI2Companion.asc?

98 views
Skip to first unread message

Yong Tang

unread,
Jun 4, 2018, 9:28:55 PM6/4/18
to App Inventor Open Source Development
Thanks for every one.

Jose Dominguez

unread,
Jun 5, 2018, 5:01:44 AM6/5/18
to app-inventor-open-source-dev
Hi there, what do you mean by asc?

The companion is compiled with the rest of the system when you run
"ant". If you look for an apk file in your build directory, it should
be there.

cheers,
José



On 5 June 2018 at 02:28, Yong Tang <fsy...@gmail.com> wrote:
> Thanks for every one.
>
> --
> You received this message because you are subscribed to the Google Groups
> "App Inventor Open Source Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to app-inventor-open-so...@googlegroups.com.
> To post to this group, send email to
> app-inventor-o...@googlegroups.com.
> Visit this group at
> https://groups.google.com/group/app-inventor-open-source-dev.
> For more options, visit https://groups.google.com/d/optout.

Evan Patton

unread,
Jun 5, 2018, 9:55:16 AM6/5/18
to App Inventor Open Source Development
MITAI2Companion.asc is a Base64-encoded copy of MITAI2Companion.apk, which José describes how to build. On *nix like systems, there is typically a program called base64 that you can use to encode/decode content. You can also use the openssl base64 command. Not sure about Windows.

Evan

Yong Tang

unread,
Jun 7, 2018, 11:04:21 AM6/7/18
to App Inventor Open Source Development
appinventor/components/src/com/google/appinventor/components/common/YaVersion.java


public static final String COMPANION_UPDATE_URL = "/companions/MITAI2Companion.asc";
public static final String COMPANION_UPDATE_URL1 = "/companions/MITAI2Companion.apk";


So i need MITAI2Companion.asc.


在 2018年6月5日星期二 UTC+8上午9:28:55,Yong Tang写道:
Thanks for every one.

Evan Patton

unread,
Jun 7, 2018, 11:24:13 AM6/7/18
to App Inventor Open Source Development
Hi Yong,

Please see my previous post in this thread. MITAI2Companion.asc is just a base64-encoded copy of MITAI2Companion.apk. You will need to use a platform-specific utility to base64 encode the APK file. For example, on Mac I would run base64 MITAI2Companion.apk > MITAI2Companion.asc to convert the app.

Regards,
Evan

Yong Tang

unread,
Jun 7, 2018, 11:31:24 AM6/7/18
to App Inventor Open Source Development
Thank you 
i test 

openssl base64 -in  ./MITAI2Companion.apk -out ./MITAI2Companion.asc 


在 2018年6月7日星期四 UTC+8下午11:24:13,Evan Patton写道:

Evan Patton

unread,
Jun 7, 2018, 11:46:51 AM6/7/18
to App Inventor Open Source Development
That should work, yes.

Evan

Yong Tang

unread,
Jun 10, 2018, 9:35:57 PM6/10/18
to App Inventor Open Source Development
The update package does not match the signature of the installed application.



在 2018年6月7日星期四 UTC+8下午11:46:51,Evan Patton写道:

Evan Patton

unread,
Jun 11, 2018, 1:31:20 PM6/11/18
to App Inventor Open Source Development
Assuming the version you currently have is the version published by MIT via the Google Play Store, this is correct. You will need to uninstall the MIT version and install your custom version. You will not be able to upgrade from the MIT companion to your custom companion (or vice versa) for security reasons. This is enforced by Android.

Regards,
Evan
Message has been deleted

Yong Tang

unread,
Jun 11, 2018, 11:13:37 PM6/11/18
to App Inventor Open Source Development
Does the signature of apk(MITAI2Companion.asc  MITAI2Companion.apk) change every time after ant clean && ant?
After the version is found to be upgraded, it cannot be upgraded on its own compiled version.

like this:
git pull
git submodule update
cd appinventor
ant clean
ant


在 2018年6月12日星期二 UTC+8上午1:31:20,Evan Patton写道:

Evan Patton

unread,
Jun 12, 2018, 1:45:16 PM6/12/18
to App Inventor Open Source Development
The companion you build is signed by the keystore located in the .appinventor folder in your user home directory. If you are somehow deleting this file, then the key footprint will change every time. This file persists across "ant clean" invocations, so you should be fine. You may need to bump the version code in aiplayapp/youngandroidproperties/project.properties for your phone to recognize it as a valid upgrade. Another thing that I have seen is that sometimes the .asc file contains a newline and the Base64 decoded in Android doesn't seem to appreciate that, so you may want to check the file and ensure that it does not contain additional whitespace.

Evan

Yong Tang

unread,
Jun 12, 2018, 9:17:32 PM6/12/18
to App Inventor Open Source Development
The .appinventor/debug.keystore was copied to a different computer and the ant PlayApp had the same signature.
Thank you.

在 2018年6月13日星期三 UTC+8上午1:45:16,Evan Patton写道:

Yong Tang

unread,
Jan 4, 2019, 2:36:36 AM1/4/19
to App Inventor Open Source Development
  
  public static final String COMPANION_UPDATE_URL = "";
  public static final String COMPANION_UPDATE_URL1 = "";
  public static final String COMPANION_UPDATE_EMULATOR_URL = "";

How to set the newly added COMPANION_UPDATE_EMULATOR_URL?

MIT AI2 Companion 2.49 can't be installed in emulator(MIT_App_Inventor_Tools_2.3.0_win_setup.exe), how to solve it?

Thanks for every one.

在 2018年6月7日星期四 UTC+8下午11:04:21,Yong Tang写道:

Evan Patton

unread,
Jan 4, 2019, 9:43:15 AM1/4/19
to App Inventor Open Source Development
Emulator.apk is just MITAI2Companion.apk with the lib and META-INF directories stripped out and resigned (at least, that's how I make it... Jeff might have a different process).

Regards,
Evan

Jeffrey Schiller

unread,
Jan 4, 2019, 10:36:13 AM1/4/19
to app-inventor-o...@googlegroups.com
Assuming you are using our package name (edu.mit.appinventor.aicompanion3):

Build your new Companion. As Evan has said, remove the android.sf and android.rsa files as well as everything under lib (the large files that end in ".so").

You can sign it in two different ways:

1. Jarsigner: Use the java jarsigner tool using your android.keystore file to sign the edited Companion. Then use the "zipalign" tool from Google to align the file.
2. apksigner: *first* use the "zipalign" tools to align the file and then use Google's "apksigner" tool to sign the Companion

After you have done one of the two steps above, start the emulator (you can do this from App Inventor itself). Make sure you have the Google "adb" tool installed. Then once the emulator is running do:

"adb uninstall edu.mit.appinventor.aicompanion3"

This will uninstall our version that comes with the setup tools and is signed with our key.

Then "adb install <whereeveryournewversionis>"

This should install your version of the Comapnion. Then restart the emulator and you should be running.

-Jeff

--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-so...@googlegroups.com.
To post to this group, send email to app-inventor-o...@googlegroups.com.
Visit this group at https://groups.google.com/group/app-inventor-open-source-dev.
For more options, visit https://groups.google.com/d/optout.


--
_______________________________________________________________________
Jeffrey I. Schiller
Information Systems and Technology – MIT App Inventor
Massachusetts Institute of Technology
77 Massachusetts Avenue  Room 32G-530
Cambridge, MA 02139-4307
617.910.0259 - Voice
_______________________________________________________________________

Yong Tang

unread,
Jan 4, 2019, 10:12:14 PM1/4/19
to App Inventor Open Source Development

MAI2.49.png

Thank you Evan and Jeffrey.
Successful.
unzip MIT AI2 Companion.apk delete lib and META-INF , zip back
jarsigner.exe -keystore debug.keystore -digestalg SHA1 -sigalg SHA1withRSA "MIT AI2 Companion.apk" AndroidKey  
password :android
zipalign.exe -v  4 "MIT AI2 Companion.apk" "emulator.apk"

在 2019年1月4日星期五 UTC+8下午11:36:13,j...@mit.edu写道:
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-source-dev+unsub...@googlegroups.com.

To post to this group, send email to app-inventor-o...@googlegroups.com.
Visit this group at https://groups.google.com/group/app-inventor-open-source-dev.
For more options, visit https://groups.google.com/d/optout.

Yong Tang

unread,
Jan 7, 2019, 10:06:25 AM1/7/19
to App Inventor Open Source Development
MIT AI2 Companion 2.50 can't run in emulator

在 2019年1月5日星期六 UTC+8上午11:12:14,Yong Tang写道:

Evan Patton

unread,
Jan 7, 2019, 10:45:13 AM1/7/19
to App Inventor Open Source Development
I tested on both macOS 10.14 and Windows 10, and in both emulators I was able to load 2.50. Are you making sure to strip out the shared libraries for WebRTC?

Regards,
Evan

Yong Tang

unread,
Jan 8, 2019, 1:50:34 AM1/8/19
to App Inventor Open Source Development
It is normal to reinstall MIT APP Inventor Tools 2.3.0.

在 2019年1月7日星期一 UTC+8下午11:45:13,Evan Patton写道:
Reply all
Reply to author
Forward
0 new messages