Skip to content

Commit

Permalink
fix(BuildHelper): get package name from ApplicationInfo (#1575)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhiqiang1993 authored Apr 14, 2023
1 parent 5b546a2 commit 7efe90f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/src/org/apache/cordova/BuildHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public static Object getBuildConfigValue(Context ctx, String key)
{
try
{
Class<?> clazz = Class.forName(ctx.getClass().getPackage().getName() + ".BuildConfig");
String packageName = ctx.getApplicationInfo().packageName;
Class<?> clazz = Class.forName(packageName + ".BuildConfig");
Field field = clazz.getField(key);
return field.get(null);
} catch (ClassNotFoundException e) {
Expand Down

0 comments on commit 7efe90f

Please sign in to comment.