Closed didldum closed 2 years ago
Some snippets of the dex2jar code of the compiled app (not from the sample project, but the enterprise application we would like make compatible with intune). We think this snippets might related to the issue.
public class QtActivity extends MAMActivity {
...
@Override // com.microsoft.intune.mam.client.app.MAMActivity, com.microsoft.intune.mam.client.app.HookedActivity
public void onMAMActivityResult(int i, int i2, Intent intent) {
if (QtApplication.m_delegateObject == null || QtApplication.onActivityResult == null) {
if (i == 62446) {
this.m_loader.startApp(false);
}
super.onMAMActivityResult(i, i2, intent);
return;
}
QtApplication.invokeDelegateMethod(QtApplication.onActivityResult, Integer.valueOf(i), Integer.valueOf(i2), intent);
}
...
public void super_onActivityResult(int i, int i2, Intent intent) {
super.onMAMActivityResult(i, i2, intent);
}
public abstract class MAMActivity extends Activity implements HookedActivity {
...
/* access modifiers changed from: protected */
public final void onActivityResult(int i, int i2, Intent intent) {
this.mBehavior.onActivityResult(i, i2, intent);
}
...
@Override // com.microsoft.intune.mam.client.app.HookedActivity
public final void onActivityResultReal(int i, int i2, Intent intent) {
super.onActivityResult(i, i2, intent);
}
...
@Override // com.microsoft.intune.mam.client.app.HookedActivity
public void onMAMActivityResult(int i, int i2, Intent intent) {
this.mBehavior.onMAMActivityResult(i, i2, intent);
}
Hi @didldum, does this issue occur even without the keyboard? I tested the sent apk and skipped steps 2 and 3 and still got a black screen. The issue with the keyboard not appearing may be different than the black screen
Yes they occur unrelated, the cause is probably the same.
Can you send logs from an enrolled app?
If I am understanding correctly, it looks like Qt is calling some delegate function through invokeDelegateMethod(). There may be some reflection hidden within native libraries that MAM does not currently have a way to handle. Depending on how the delegate is defined, there may be a way to work around this to restore the functionality
@didldum can you share details on this delegate? Is this something the you provide as the app developer or is it part of Qt?
@didldum Can you share the details requested by my teammates?
@rygo-msft @meghandaly @Archit-Pikle This is the log from an enrolled device with the production app (not the minimal demo I included to showcase the issue). enrolled.log
@rygo-msft @meghandaly @Archit-Pikle Have you been able to reproduce the problem with the included sample project? Is this something you might address with a fix or change?
We're tracking this internally (bug 15188646), no other details to share currently
We do not currently have plans to support the Qt framework. The Intune SDK has been tested with native Android applications. We know that partners have incorporated the native Intune libraries into third party Android platforms, but this is not something we test. Some platforms may be trying to integrate with the same Android APIs we use, and this may make them incompatible.
Describe the bug: When integrating the intune SDK into a Qt android application, the keyboard isn't working, and the screen is black when resuming the app after sending it to the background.
To Reproduce Steps to reproduce the behavior:
Expected behavior: The keyboard should work, and the app should resume properly.
Screenshots and logs:
Smartphone (please complete the following information):
Intune App SDK for Android (please complete the following information):
Current intune version, 8.3.0
What platform is your app based in (Java, Xamarin based, Cordova, etc)? Qt
For errors during build, does the app build without Intune SDK integration? yes
For errors post build, does the app launch without being Intune SDK integrated? yes
Who is the customer? Industrial manufacturing company, please contact me for details.
Do you see a trend with it only being reproduced on a specific device? no
Additional context: Our guess on the cause: The intune SDK is rewriting classes, in a similar way Qt is structured and this seems to prevent Qt from working (Qt's invokeDelegateMethod fails because methods have been moved to Intune's parent classes - QtActivity extends MAMActivity).
We are aware this is an issue only occurring in combination with Qt, and one could argue this is something to be changed on Qt's side. Since this would probably require a major rewrite on Qt's side, we think it would be good for intune to support Qt applications the way there are.
We even managed to solve the keyboard and black screen by changing the intune configuration, and excluding some classes from intune rewriting. But this is a trial and error approach, we fear might break with future updates. Also maybe some other features besides keyboard and resume might not work which we have not noticed yet.
In the attached demo, uncomment excludeClasses to make the keyboard work again.
A more verbose exclude setting with also solves the black screen is: excludeClasses = ['org.qtproject.qt.android.bindings.QtActivity','org.qtproject.qt.android.QtLayout','org.qtproject.qt.android.bindings.QtService','org.qtproject.qt.android.bindings.QtApplication','org.qtproject.qt.android.EditContextView$ContextButton','org.qtproject.qt5.android.bindings.QtActivity']
Also when the Qt project doesn't come with a custom activity (therefore intune rewriting QtActivity itself, instead of it's "App" extension), the resume usecase works fine. Only the keyboard issue exists.