aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris "Koying" Browet <cbro@semperpax.com>2017-03-21 09:44:18 +0100
committerChris Koying Browet <cbro@semperpax.com>2017-04-03 16:48:43 +0200
commit3889b2c2699cb766de538c257335fce88f649e31 (patch)
tree52a485f64024d4f311d8343d796f185afc2a3726
parent53679095350d015bc923b7c3bf453174a3f00497 (diff)
CHG: [droid] specify package name fully in version.txt
Remove hardcoded "org.xbmc" package name prefix across the source tree
-rw-r--r--cmake/KodiConfig.cmake.in1
-rw-r--r--cmake/scripts/common/Macros.cmake4
-rw-r--r--tools/android/packaging/xbmc/AndroidManifest.xml.in2
-rw-r--r--tools/android/packaging/xbmc/activity_main.xml.in2
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in4
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in6
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCBroadcastReceiver.java.in2
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCInputDeviceListener.java.in2
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnAudioFocusChangeListener.java.in2
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnFrameAvailableListener.java.in2
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCSettingsContentObserver.java.in2
-rw-r--r--tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in2
-rw-r--r--version.txt1
-rw-r--r--xbmc/CompileInfo.cpp.in5
-rw-r--r--xbmc/CompileInfo.h1
-rw-r--r--xbmc/filesystem/AndroidAppDirectory.cpp2
-rw-r--r--xbmc/gen-compileinfo.mk3
-rw-r--r--xbmc/platform/android/activity/XBMCApp.cpp4
-rw-r--r--xbmc/platform/android/activity/android_main.cpp16
19 files changed, 37 insertions, 26 deletions
diff --git a/cmake/KodiConfig.cmake.in b/cmake/KodiConfig.cmake.in
index c02a68085a..58dfc40efa 100644
--- a/cmake/KodiConfig.cmake.in
+++ b/cmake/KodiConfig.cmake.in
@@ -1,6 +1,7 @@
set(APP_NAME @APP_NAME@)
set(APP_NAME_LC @APP_NAME_LC@)
set(APP_NAME_UC @APP_NAME_UC@)
+set(APP_PACKAGE @APP_PACKAGE@)
set(APP_VERSION_MAJOR @APP_VERSION_MAJOR@)
set(APP_VERSION_MINOR @APP_VERSION_MINOR@)
if(NOT @APP_NAME_UC@_PREFIX)
diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake
index 189bd61ee0..b3f51dc147 100644
--- a/cmake/scripts/common/Macros.cmake
+++ b/cmake/scripts/common/Macros.cmake
@@ -590,6 +590,7 @@ endfunction()
# APP_NAME - app name
# APP_NAME_LC - lowercased app name
# APP_NAME_UC - uppercased app name
+# APP_PACKAGE - Android full package name
# COMPANY_NAME - company name
# APP_VERSION_MAJOR - the app version major
# APP_VERSION_MINOR - the app version minor
@@ -615,13 +616,14 @@ macro(core_find_versions)
include(CMakeParseArguments)
core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt)
string(REPLACE " " ";" version_list "${version_list}")
- cmake_parse_arguments(APP "" "APP_NAME;COMPANY_NAME;WEBSITE;VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API" "" ${version_list})
+ cmake_parse_arguments(APP "" "APP_NAME;COMPANY_NAME;WEBSITE;VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API;APP_PACKAGE" "" ${version_list})
set(APP_NAME ${APP_APP_NAME}) # inconsistency but APP_APP_NAME looks weird
string(TOLOWER ${APP_APP_NAME} APP_NAME_LC)
string(TOUPPER ${APP_APP_NAME} APP_NAME_UC)
set(COMPANY_NAME ${APP_COMPANY_NAME})
set(APP_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR})
+ set(APP_PACKAGE ${APP_APP_PACKAGE})
if(APP_VERSION_TAG)
set(APP_VERSION ${APP_VERSION}-${APP_VERSION_TAG})
string(TOLOWER ${APP_VERSION_TAG} APP_VERSION_TAG_LC)
diff --git a/tools/android/packaging/xbmc/AndroidManifest.xml.in b/tools/android/packaging/xbmc/AndroidManifest.xml.in
index 829add3398..b473225d61 100644
--- a/tools/android/packaging/xbmc/AndroidManifest.xml.in
+++ b/tools/android/packaging/xbmc/AndroidManifest.xml.in
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- BEGIN_INCLUDE(manifest) -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="org.xbmc.@APP_NAME_LC@"
+ package="@APP_PACKAGE@"
android:versionCode="@APP_VERSION_CODE@"
android:versionName="@APP_VERSION@" >
diff --git a/tools/android/packaging/xbmc/activity_main.xml.in b/tools/android/packaging/xbmc/activity_main.xml.in
index eb5003d519..7f29b6c487 100644
--- a/tools/android/packaging/xbmc/activity_main.xml.in
+++ b/tools/android/packaging/xbmc/activity_main.xml.in
@@ -4,7 +4,7 @@
android:layout_height="match_parent"
android:background="@android:color/transparent" >
- <org.xbmc.@APP_NAME_LC@.XBMCVideoView
+ <@APP_PACKAGE@.XBMCVideoView
android:id="@+id/VideoView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in
index fe2822c043..a5b69a3cf2 100644
--- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in
+++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Main.java.in
@@ -1,4 +1,4 @@
-package org.xbmc.@APP_NAME_LC@;
+package @APP_PACKAGE@;
import android.app.NativeActivity;
import android.content.ComponentName;
@@ -15,7 +15,7 @@ import android.widget.RelativeLayout;
import android.graphics.Color;
import android.graphics.PixelFormat;
import android.os.Handler;
-import org.xbmc.@APP_NAME_LC@.XBMCVideoView;
+import @APP_PACKAGE@.XBMCVideoView;
public class Main extends NativeActivity implements Choreographer.FrameCallback
{
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in
index 943a79657c..497de7f58d 100644
--- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in
+++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/Splash.java.in
@@ -1,4 +1,4 @@
-package org.xbmc.@APP_NAME_LC@;
+package @APP_PACKAGE@;
import java.io.BufferedOutputStream;
import java.io.File;
@@ -657,7 +657,7 @@ public class Splash extends Activity {
protected void startXBMC() {
// Run @APP_NAME@
Intent intent = getIntent();
- intent.setClass(this, org.xbmc.@APP_NAME_LC@.Main.class);
+ intent.setClass(this, @APP_PACKAGE@.Main.class);
intent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP);
startActivity(intent);
finish();
@@ -674,7 +674,7 @@ public class Splash extends Activity {
.getRunningTasks(Integer.MAX_VALUE);
for (RunningTaskInfo task : tasks)
if (task.topActivity.toString().equalsIgnoreCase(
- "ComponentInfo{org.xbmc.@APP_NAME_LC@/org.xbmc.@APP_NAME_LC@.Main}")) {
+ "ComponentInfo{@APP_PACKAGE@/@APP_PACKAGE@.Main}")) {
// @APP_NAME@ already running; just activate it
startXBMC();
return;
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCBroadcastReceiver.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCBroadcastReceiver.java.in
index 2909644f62..0fbdf70035 100644
--- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCBroadcastReceiver.java.in
+++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCBroadcastReceiver.java.in
@@ -1,4 +1,4 @@
-package org.xbmc.@APP_NAME_LC@;
+package @APP_PACKAGE@;
import android.content.BroadcastReceiver;
import android.content.Context;
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCInputDeviceListener.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCInputDeviceListener.java.in
index 4e044f84a1..2890ecda4d 100644
--- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCInputDeviceListener.java.in
+++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCInputDeviceListener.java.in
@@ -1,4 +1,4 @@
-package org.xbmc.@APP_NAME_LC@;
+package @APP_PACKAGE@;
import android.hardware.input.InputManager.InputDeviceListener;
import android.util.Log;
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnAudioFocusChangeListener.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnAudioFocusChangeListener.java.in
index df33b17810..bb9f5149fd 100644
--- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnAudioFocusChangeListener.java.in
+++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnAudioFocusChangeListener.java.in
@@ -1,4 +1,4 @@
-package org.xbmc.@APP_NAME_LC@;
+package @APP_PACKAGE@;
import android.media.AudioManager.OnAudioFocusChangeListener;
import android.util.Log;
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnFrameAvailableListener.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnFrameAvailableListener.java.in
index 9778ed35e1..c98686da17 100644
--- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnFrameAvailableListener.java.in
+++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCOnFrameAvailableListener.java.in
@@ -1,4 +1,4 @@
-package org.xbmc.@APP_NAME_LC@;
+package @APP_PACKAGE@;
import android.graphics.SurfaceTexture;
import android.graphics.SurfaceTexture.OnFrameAvailableListener;
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCSettingsContentObserver.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCSettingsContentObserver.java.in
index 1e48e3fd05..fc90a853e1 100644
--- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCSettingsContentObserver.java.in
+++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCSettingsContentObserver.java.in
@@ -1,4 +1,4 @@
-package org.xbmc.@APP_NAME_LC@;
+package @APP_PACKAGE@;
import android.content.Context;
import android.database.ContentObserver;
diff --git a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in
index 5012d4c23c..9dac31b813 100644
--- a/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in
+++ b/tools/android/packaging/xbmc/src/org/xbmc/kodi/XBMCVideoView.java.in
@@ -1,4 +1,4 @@
-package org.xbmc.@APP_NAME_LC@;
+package @APP_PACKAGE@;
import javax.microedition.khronos.egl.EGL10;
import javax.microedition.khronos.egl.EGLConfig;
diff --git a/version.txt b/version.txt
index a27c1bd8e8..aeafffa3f0 100644
--- a/version.txt
+++ b/version.txt
@@ -6,6 +6,7 @@ VERSION_MINOR 0
VERSION_TAG ALPHA1
VERSION_CODE 179701
ADDON_API 17.9.701
+APP_PACKAGE org.xbmc.kodi
# Notes:
# Change AC_INIT in configure.ac
diff --git a/xbmc/CompileInfo.cpp.in b/xbmc/CompileInfo.cpp.in
index 40c396c852..462c6017d4 100644
--- a/xbmc/CompileInfo.cpp.in
+++ b/xbmc/CompileInfo.cpp.in
@@ -32,6 +32,11 @@ int CCompileInfo::GetMinor()
return @APP_VERSION_MINOR@;
}
+const char* CCompileInfo::GetPackage()
+{
+ return "@APP_PACKAGE@";
+}
+
const char* CCompileInfo::GetAppName()
{
return "@APP_NAME@";
diff --git a/xbmc/CompileInfo.h b/xbmc/CompileInfo.h
index a1d31df0d1..4b8c23dc06 100644
--- a/xbmc/CompileInfo.h
+++ b/xbmc/CompileInfo.h
@@ -25,6 +25,7 @@ class CCompileInfo
public:
static int GetMajor();
static int GetMinor();
+ static const char* GetPackage();
static const char* GetAppName();
static const char *GetSuffix(); // Git "Tag", e.g. alpha1
static const char* GetSCMID(); // Git Revision
diff --git a/xbmc/filesystem/AndroidAppDirectory.cpp b/xbmc/filesystem/AndroidAppDirectory.cpp
index b87286c00d..987d574fd1 100644
--- a/xbmc/filesystem/AndroidAppDirectory.cpp
+++ b/xbmc/filesystem/AndroidAppDirectory.cpp
@@ -49,7 +49,7 @@ bool CAndroidAppDirectory::GetDirectory(const CURL& url, CFileItemList &items)
CLog::Log(LOGDEBUG, "CAndroidAppDirectory::GetDirectory: %s",dirname.c_str());
std::string appName = CCompileInfo::GetAppName();
StringUtils::ToLower(appName);
- std::string className = "org.xbmc." + appName;
+ std::string className = CCompileInfo::GetPackage();
if (dirname == "apps")
{
diff --git a/xbmc/gen-compileinfo.mk b/xbmc/gen-compileinfo.mk
index 11ded2a142..df0b0e7625 100644
--- a/xbmc/gen-compileinfo.mk
+++ b/xbmc/gen-compileinfo.mk
@@ -37,5 +37,6 @@ $(FILEPATH)/CompileInfo.cpp: $(VERSION.TXT) $(FILEPATH)/CompileInfo.cpp.in $(FIL
MAJOR=$$(awk '/VERSION_MAJOR/ {print $$2}' $(VERSION.TXT)) ;\
MINOR=$$(awk '/VERSION_MINOR/ {print $$2}' $(VERSION.TXT)) ;\
TAG=$$(awk '/VERSION_TAG/ {print $$2}' $(VERSION.TXT)) ;\
- sed -e "s/\@APP_NAME\@/$$APP_NAME/" -e "s/\@APP_VERSION_MAJOR\@/$$MAJOR/" -e "s/\@APP_VERSION_MINOR\@/$$MINOR/" -e "s/\@APP_VERSION_TAG\@/$$TAG/" -e "s/\@APP_SCMID\@/$$GITREV/" $@.in > $@
+ APP_PACKAGE=$$(awk '/APP_PACKAGE/ {print $$2}' $(VERSION.TXT)) ;\
+ sed -e "s/\@APP_NAME\@/$$APP_NAME/" -e "s/\@APP_VERSION_MAJOR\@/$$MAJOR/" -e "s/\@APP_VERSION_MINOR\@/$$MINOR/" -e "s/\@APP_VERSION_TAG\@/$$TAG/" -e "s/\@APP_SCMID\@/$$GITREV/" -e "s/\@APP_PACKAGE\@/$$APP_PACKAGE/" $@.in > $@
diff --git a/xbmc/platform/android/activity/XBMCApp.cpp b/xbmc/platform/android/activity/XBMCApp.cpp
index db99f75b65..22591e6f13 100644
--- a/xbmc/platform/android/activity/XBMCApp.cpp
+++ b/xbmc/platform/android/activity/XBMCApp.cpp
@@ -290,7 +290,7 @@ bool CXBMCApp::EnableWakeLock(bool on)
{
std::string appName = CCompileInfo::GetAppName();
StringUtils::ToLower(appName);
- std::string className = "org.xbmc." + appName;
+ std::string className = CCompileInfo::GetPackage();
// SCREEN_BRIGHT_WAKE_LOCK is marked as deprecated but there is no real alternatives for now
m_wakeLock = new CJNIWakeLock(CJNIPowerManager(getSystemService("power")).newWakeLock(CJNIPowerManager::SCREEN_BRIGHT_WAKE_LOCK, className.c_str()));
if (m_wakeLock)
@@ -894,7 +894,7 @@ void CXBMCApp::SetupEnv()
std::string appName = CCompileInfo::GetAppName();
StringUtils::ToLower(appName);
- std::string className = "org.xbmc." + appName;
+ std::string className = CCompileInfo::GetPackage();
std::string xbmcHome = CJNISystem::getProperty("xbmc.home", "");
if (xbmcHome.empty())
diff --git a/xbmc/platform/android/activity/android_main.cpp b/xbmc/platform/android/activity/android_main.cpp
index b4e01d7c2a..ec0ebd9301 100644
--- a/xbmc/platform/android/activity/android_main.cpp
+++ b/xbmc/platform/android/activity/android_main.cpp
@@ -134,14 +134,14 @@ extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *reserved)
if (vm->GetEnv(reinterpret_cast<void**>(&env), version) != JNI_OK)
return -1;
- std::string appName = CCompileInfo::GetAppName();
- StringUtils::ToLower(appName);
- std::string mainClass = "org/xbmc/" + appName + "/Main";
- std::string bcReceiver = "org/xbmc/" + appName + "/XBMCBroadcastReceiver";
- std::string frameListener = "org/xbmc/" + appName + "/XBMCOnFrameAvailableListener";
- std::string settingsObserver = "org/xbmc/" + appName + "/XBMCSettingsContentObserver";
- std::string audioFocusChangeListener = "org/xbmc/" + appName + "/XBMCOnAudioFocusChangeListener";
- std::string inputDeviceListener = "org/xbmc/" + appName + "/XBMCInputDeviceListener";
+ std::string pkgRoot = CCompileInfo::GetPackage();
+ StringUtils::Replace(pkgRoot, '.', '/');
+ std::string mainClass = pkgRoot + "/Main";
+ std::string bcReceiver = pkgRoot + "/XBMCBroadcastReceiver";
+ std::string frameListener = pkgRoot + "/XBMCOnFrameAvailableListener";
+ std::string settingsObserver = pkgRoot + "/XBMCSettingsContentObserver";
+ std::string audioFocusChangeListener = pkgRoot + "/XBMCOnAudioFocusChangeListener";
+ std::string inputDeviceListener = pkgRoot + "/XBMCInputDeviceListener";
jclass cMain = env->FindClass(mainClass.c_str());
if(cMain)