Skip to content

Commit

Permalink
feat(android): provide sdk version information
Browse files Browse the repository at this point in the history
  • Loading branch information
iPel authored and zoomchan-cxj committed Oct 11, 2022
1 parent d2810d2 commit a9a9f40
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions android/sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ android {
consumerProguardFiles 'proguard-rules.pro'

buildConfigField("boolean", "ENABLE_SO_DOWNLOAD", ENABLE_SO_DOWNLOAD)
buildConfigField("String", "LIBRARY_VERSION", "\"$VERSION_NAME\"")

packagingOptions {
if (!INCLUDE_ABI_ARMEABI.toBoolean()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import android.text.TextUtils;

import androidx.annotation.Nullable;

import com.tencent.mtt.hippy.BuildConfig;
import com.tencent.mtt.hippy.HippyEngine;
import com.tencent.mtt.hippy.HippyEngine.BridgeTransferType;
import com.tencent.mtt.hippy.HippyEngine.ModuleLoadStatus;
Expand Down Expand Up @@ -659,6 +661,7 @@ String getGlobalConfigs() {
platformParams.pushString("VersionName", (versionName == null) ? "" : versionName);
platformParams.pushInt("APILevel", Build.VERSION.SDK_INT);
platformParams.pushBoolean("NightMode", getNightMode());
platformParams.pushString("SDKVersion", BuildConfig.LIBRARY_VERSION);

HippyMap Localization = new HippyMap();
Localization.pushString("language", I18nUtil.getLanguage());
Expand Down
1 change: 1 addition & 0 deletions core/js/global/Platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ if (typeof __HIPPYNATIVEGLOBAL__ !== 'undefined') {
} else {
Hippy.device.platform.OS = __HIPPYNATIVEGLOBAL__.Platform.OS;
Hippy.device.platform.APILevel = __HIPPYNATIVEGLOBAL__.Platform.APILevel;
Hippy.device.platform.SDKVersion = __HIPPYNATIVEGLOBAL__.SDKVersion;
Hippy.device.platform.Localization = __HIPPYNATIVEGLOBAL__.Platform.Localization || Localization;
}
}

0 comments on commit a9a9f40

Please sign in to comment.