mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
fix(BuildHelper): get package name from ApplicationInfo (#1575)
This commit is contained in:
parent
5b546a27e6
commit
7efe90faac
@ -51,7 +51,8 @@ public class BuildHelper {
|
|||||||
{
|
{
|
||||||
try
|
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);
|
Field field = clazz.getField(key);
|
||||||
return field.get(null);
|
return field.get(null);
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user