Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

check motorola licence on start on Android

  • Loading branch information...
commit d09c4be0484efb995a33c67d07b00e39ae1a2372 1 parent 2b97112
@dmitrys dmitrys authored
View
2  Rakefile
@@ -80,7 +80,7 @@ namespace "framework" do
end
-$application_build_configs_keys = ['security_token', 'encrypt_database', 'android_title', 'iphone_db_in_approot', 'iphone_set_approot', 'iphone_userpath_in_approot', "motorola_license", "motorola_license_company"]
+$application_build_configs_keys = ['security_token', 'encrypt_database', 'android_title', 'iphone_db_in_approot', 'iphone_set_approot', 'iphone_userpath_in_approot', "motorola_licence", "motorola_licence_company"]
def make_application_build_config_header_file
f = StringIO.new("", "w+")
View
8 platform/android/Rhodes/jni/src/rhodesapp.cpp
@@ -234,6 +234,14 @@ RHO_GLOBAL jboolean JNICALL Java_com_rhomobile_rhodes_RhodesService_isOnStartPag
}
+RHO_GLOBAL jboolean JNICALL Java_com_rhomobile_rhodes_RhodesService_isMotorolaLicencePassed
+(JNIEnv *env, jclass)
+{
+ bool res = (rho_can_app_started_with_current_licence() == 1);
+ return (jboolean)res;
+}
+
+
RHO_GLOBAL jboolean JNICALL Java_com_rhomobile_rhodes_RhodesService_isTitleEnabled
(JNIEnv *, jclass)
{
View
31 platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesActivity.java
@@ -44,8 +44,10 @@
import com.rhomobile.rhodes.webview.IRhoWebView;
import android.app.Dialog;
+import android.app.AlertDialog;
import android.content.ComponentName;
import android.content.Context;
+import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
@@ -512,6 +514,25 @@ public void onClick(DialogInterface arg0, int arg1) {
*/
return;
}
+ if (!isPassMotoLicence()) {
+ AlertDialog.Builder b = new AlertDialog.Builder(this);
+ b.setCancelable(true);
+ b.setOnCancelListener( new DialogInterface.OnCancelListener() {
+ public void onCancel(DialogInterface dialog) {
+ RhodesService.exit();
+ }
+ });
+ AlertDialog securityAlert = b.create();
+ securityAlert.setMessage("Your Motorola licence key is invalid !");
+ securityAlert.setButton("OK", new DialogInterface.OnClickListener(){
+ public void onClick(DialogInterface arg0, int arg1) {
+ RhodesService.exit();
+ }
+
+ });
+ securityAlert.show();
+ return;
+ }
// String urlStart = uri.getPath();
// if (urlStart != null) {
@@ -522,6 +543,16 @@ public void onClick(DialogInterface arg0, int arg1) {
// }
// }
}
+
+ private boolean isPassMotoLicence() {
+ if (Capabilities.MOTOROLA_ENABLED) {
+ return true;
+ }
+ if (Capabilities.MOTOROLA_BROWSER_ENABLED) {
+ return true;
+ }
+ return RhodesService.isMotorolaLicencePassed();
+ }
public static Context getContext() {
RhodesActivity ra = RhodesActivity.getInstance();
View
2  platform/android/Rhodes/src/com/rhomobile/rhodes/RhodesService.java
@@ -250,6 +250,8 @@ public boolean handleUrlLoading(String url) {
public static native void resetHttpLogging(String http_log_url);
+ public static native boolean isMotorolaLicencePassed();
+
public static RhodesService getInstance() {
return sInstance;
Please sign in to comment.
Something went wrong with that request. Please try again.