diff options
author | wsnipex <wsnipex@a1.net> | 2014-09-25 11:10:24 +0200 |
---|---|---|
committer | Memphiz <memphis@machzwo.de> | 2014-10-19 21:34:59 +0200 |
commit | 45a93df4ca1dc64ea46185e5d6828260d823e15f (patch) | |
tree | 2facea60bfe5e79c45b2069f570921ee9fddd5f0 | |
parent | f84a1347bbdef93d7ab7f6afcaae5cc214e78ce5 (diff) |
[rebrand/android] use dynamic application name
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | docs/README.android | 6 | ||||
-rw-r--r-- | tools/android/packaging/Makefile.in (renamed from tools/android/packaging/Makefile) | 40 | ||||
-rw-r--r-- | tools/android/packaging/xbmc/AndroidManifest.xml.in | 2 | ||||
-rw-r--r-- | tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java.in (renamed from tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java) | 18 | ||||
-rw-r--r-- | tools/buildsteps/android/package | 4 | ||||
-rw-r--r-- | tools/buildsteps/androidx86/package | 4 | ||||
-rw-r--r-- | tools/depends/target/dummy-libxbmc/Makefile | 12 | ||||
-rw-r--r-- | tools/depends/target/xbmc/Makefile | 7 | ||||
-rw-r--r-- | xbmc/android/loader/AndroidDyload.cpp | 9 | ||||
-rw-r--r-- | xbmc/cores/DllLoader/exports/Makefile.in | 2 | ||||
-rw-r--r-- | xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/Makefile.in | 2 |
12 files changed, 60 insertions, 48 deletions
diff --git a/configure.in b/configure.in index 40bfa3430a..2ffaadff01 100644 --- a/configure.in +++ b/configure.in @@ -2500,6 +2500,8 @@ OUTPUT_FILES="Makefile \ xbmc/osx/atv2/XBMCATV2-Info.plist \ project/cmake/xbmc-config.cmake \ tools/android/packaging/xbmc/AndroidManifest.xml \ + tools/android/packaging/Makefile \ + tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java \ addons/xbmc.addon/addon.xml" if test "$use_wayland" = "yes"; then diff --git a/docs/README.android b/docs/README.android index 48701d7396..2f8908c112 100644 --- a/docs/README.android +++ b/docs/README.android @@ -265,10 +265,10 @@ ignored as we have setup the appropriate paths already. -------------------------------------------------------------------- During the early days of the android port, xbmc was launched via a stub lib -that then dlopen'd libxbmc. This was done to get around bionic's poor handling -of shared libs. We now compile everything into libxbmc itself so that it has +that then dlopen'd libkodi. This was done to get around bionic's poor handling +of shared libs. We now compile everything into libkodi itself so that it has no runtime dependencies beyond system libs. Done this way, we're able to launch -into libxbmc directly. +into libkodi directly. But we still hit Bionic's loader's deficiencies when we dlopen a lib. There are two main issues to overcome for loading: diff --git a/tools/android/packaging/Makefile b/tools/android/packaging/Makefile.in index c54578a942..2c0efa4b90 100644 --- a/tools/android/packaging/Makefile +++ b/tools/android/packaging/Makefile.in @@ -43,32 +43,32 @@ endif all: package SRCLIBS = $(addprefix $(PREFIX)/lib/,$(OBJS)) $(addprefix $(PREFIX)/lib/$(SDK_PLATFORM)/,$(PLATFORM_OBJS)) -DSTLIBS = $(CPU)/lib/libxbmc.so $(addprefix $(CPU)/lib/,$(OBJS)) $(addprefix $(CPU)/lib/,$(PLATFORM_OBJS)) +DSTLIBS = $(CPU)/lib/lib@APP_NAME_LC@.so $(addprefix $(CPU)/lib/,$(OBJS)) $(addprefix $(CPU)/lib/,$(PLATFORM_OBJS)) libs= $(DSTLIBS) multi: x86 arm - @cp images/xbmcapp-debug-skeleton.apk images/xbmcapp-debug-multi-unaligned.apk - @cd xbmc; zip -r -q ../images/xbmcapp-debug-multi-unaligned.apk lib/ assets - @jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore ~/.android/debug.keystore -storepass android images/xbmcapp-debug-multi-unaligned.apk androiddebugkey - @$(ZIPALIGN) -f 4 images/xbmcapp-debug-multi-unaligned.apk $(XBMCROOT)/xbmcapp-multi-debug.apk - @rm images/xbmcapp-debug-multi-unaligned.apk - @echo "$(XBMCROOT)/xbmcapp-multi-debug.apk created" + @cp images/@APP_NAME_LC@app-debug-skeleton.apk images/@APP_NAME_LC@app-debug-multi-unaligned.apk + @cd xbmc; zip -r -q ../images/@APP_NAME_LC@app-debug-multi-unaligned.apk lib/ assets + @jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore ~/.android/debug.keystore -storepass android images/@APP_NAME_LC@app-debug-multi-unaligned.apk androiddebugkey + @$(ZIPALIGN) -f 4 images/@APP_NAME_LC@app-debug-multi-unaligned.apk $(XBMCROOT)/@APP_NAME_LC@app-multi-debug.apk + @rm images/@APP_NAME_LC@app-debug-multi-unaligned.apk + @echo "$(XBMCROOT)/@APP_NAME_LC@app-multi-debug.apk created" package: extras - @cp images/xbmcapp-debug-skeleton.apk images/xbmcapp-debug-$(CPU)-unaligned.apk + @cp images/@APP_NAME_LC@app-debug-skeleton.apk images/@APP_NAME_LC@app-debug-$(CPU)-unaligned.apk @javac -classpath $(SDKROOT)/platforms/$(SDK_PLATFORM)/android.jar:xbmc/obj -d xbmc/obj -sourcepath xbmc/src xbmc/src/*.java @javac -classpath $(SDKROOT)/platforms/$(SDK_PLATFORM)/android.jar:xbmc/obj -d xbmc/obj -sourcepath xbmc/src xbmc/src/org/xbmc/xbmc/*.java @$(DX) --dex --output=xbmc/classes.dex xbmc/obj - @cd xbmc; zip -r -q ../images/xbmcapp-debug-$(CPU)-unaligned.apk lib/$(CPU) assets classes.dex - @jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore ~/.android/debug.keystore -storepass android images/xbmcapp-debug-$(CPU)-unaligned.apk androiddebugkey - @$(ZIPALIGN) -f 4 images/xbmcapp-debug-$(CPU)-unaligned.apk $(XBMCROOT)/xbmcapp-$(CPU)-debug.apk - @rm images/xbmcapp-debug-$(CPU)-unaligned.apk - @echo "$(XBMCROOT)/xbmcapp-$(CPU)-debug.apk created" + @cd xbmc; zip -r -q ../images/@APP_NAME_LC@app-debug-$(CPU)-unaligned.apk lib/$(CPU) assets classes.dex + @jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore ~/.android/debug.keystore -storepass android images/@APP_NAME_LC@app-debug-$(CPU)-unaligned.apk androiddebugkey + @$(ZIPALIGN) -f 4 images/@APP_NAME_LC@app-debug-$(CPU)-unaligned.apk $(XBMCROOT)/@APP_NAME_LC@app-$(CPU)-debug.apk + @rm images/@APP_NAME_LC@app-debug-$(CPU)-unaligned.apk + @echo "$(XBMCROOT)/@APP_NAME_LC@app-$(CPU)-debug.apk created" extras: libs rm -rf xbmc/assets mkdir -p xbmc/assets xbmc/res xbmc/res/raw xbmc/assets/python2.6/lib/ - cp -rfp $(PREFIX)/share/xbmc/* ./xbmc/assets + cp -rfp $(PREFIX)/share/@APP_NAME_LC@/* ./xbmc/assets find `pwd`/xbmc/assets/ -depth -name ".git" -exec rm -rf {} \; find `pwd`/xbmc/assets/system/ -name "*.so" -exec rm {} \; find `pwd`/xbmc/assets/addons/skin.*/media/* -depth -not -iname "Textures.xbt" -exec rm -rf {} \; @@ -85,16 +85,16 @@ extras: libs cp -fp media/drawable-xxhdpi/ic_launcher.png xbmc/res/drawable-xxhdpi/ic_launcher.png cd xbmc/assets/python2.6/lib/python2.6/; rm -rf test config lib-dynload mkdir -p tmp/res; $(AAPT) c -S xbmc/res -C tmp/res; cp -r -n xbmc/res tmp/ || true - $(AAPT) p -f -I $(SDKROOT)/platforms/$(SDK_PLATFORM)/android.jar -S tmp/res/ -M xbmc/AndroidManifest.xml -F images/xbmcapp-debug-skeleton.apk -J xbmc/src + $(AAPT) p -f -I $(SDKROOT)/platforms/$(SDK_PLATFORM)/android.jar -S tmp/res/ -M xbmc/AndroidManifest.xml -F images/@APP_NAME_LC@app-debug-skeleton.apk -J xbmc/src @rm -rf tmp/ -libs: $(PREFIX)/lib/xbmc/libxbmc.so +libs: $(PREFIX)/lib/@APP_NAME_LC@/lib@APP_NAME_LC@.so rm -rf xbmc/lib/$(CPU) xbmc/libs/$(CPU) xbmc/obj/local/$(CPU) mkdir -p xbmc/lib/$(CPU) images xbmc/assets/python2.6/lib/ xbmc/libs/$(CPU) xbmc/obj/local/$(CPU) cp -fp $(SRCLIBS) xbmc/obj/local/$(CPU)/ - cp -fp $(PREFIX)/lib/xbmc/libxbmc.so xbmc/obj/local/$(CPU)/ - find $(PREFIX)/lib/xbmc/addons -name "*.so" -exec cp -fp {} xbmc/obj/local/$(CPU)/ \; - find $(PREFIX)/lib/xbmc/system -name "*.so" -exec cp -fp {} xbmc/obj/local/$(CPU)/ \; + cp -fp $(PREFIX)/lib/@APP_NAME_LC@/lib@APP_NAME_LC@.so xbmc/obj/local/$(CPU)/ + find $(PREFIX)/lib/@APP_NAME_LC@/addons -name "*.so" -exec cp -fp {} xbmc/obj/local/$(CPU)/ \; + find $(PREFIX)/lib/@APP_NAME_LC@/system -name "*.so" -exec cp -fp {} xbmc/obj/local/$(CPU)/ \; cd xbmc/obj/local/$(CPU)/; find . -name "*.so" -not -name "lib*.so" | sed "s/\.\///" | xargs -I@ mv @ lib@ cp -fp xbmc/obj/local/$(CPU)/*.so xbmc/lib/$(CPU)/ $(STRIP) --strip-unneeded xbmc/lib/$(CPU)/*.so @@ -104,7 +104,7 @@ libs: $(PREFIX)/lib/xbmc/libxbmc.so "$(NDKROOT)/sources/cxx-stl/gnu-libstdc++/$(GCC_VERSION)/include $(XBMCROOT) $(PREFIX)/include jni" >> ./xbmc/libs/$(CPU)/gdb.setup cp -fp xbmc/libs/$(CPU)/* xbmc/lib/$(CPU) -$(PREFIX)/lib/xbmc/libxbmc.so: $(SRCLIBS) +$(PREFIX)/lib/xbmc/lib@APP_NAME_LC@.so: $(SRCLIBS) $(MAKE) -C ../../depends/target/xbmc $(SRCLIBS): diff --git a/tools/android/packaging/xbmc/AndroidManifest.xml.in b/tools/android/packaging/xbmc/AndroidManifest.xml.in index 0eaa2cdee3..37b5d9b21c 100644 --- a/tools/android/packaging/xbmc/AndroidManifest.xml.in +++ b/tools/android/packaging/xbmc/AndroidManifest.xml.in @@ -71,7 +71,7 @@ <!-- Tell NativeActivity the name of or .so --> <meta-data android:name="android.app.lib_name" - android:value="xbmc" /> + android:value="@APP_NAME_LC@" /> </activity> </application> diff --git a/tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java b/tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java.in index b1e3189686..9578a6b925 100644 --- a/tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java +++ b/tools/android/packaging/xbmc/src/org/xbmc/xbmc/Splash.java.in @@ -57,7 +57,7 @@ public class Splash extends Activity { private static final int StorageChecked = 8; private static final int StartingXBMC = 99; - private static final String TAG = "XBMC"; + private static final String TAG = "@APP_NAME@"; private String mCpuinfo = ""; private ArrayList<String> mMounts = new ArrayList<String>(); @@ -132,7 +132,7 @@ public class Splash extends Activity { break; case StartingXBMC: - mSplash.mTextView.setText("Starting XBMC..."); + mSplash.mTextView.setText("Starting @APP_NAME@..."); mSplash.mProgress.setVisibility(View.INVISIBLE); mSplash.startXBMC(); break; @@ -466,11 +466,11 @@ public class Splash extends Activity { } protected void startXBMC() { - // NB: We only preload libxbmc to be able to get info on missing symbols. + // NB: We only preload lib@APP_NAME_LC@ to be able to get info on missing symbols. // This is not normally needed - System.loadLibrary("xbmc"); + System.loadLibrary("@APP_NAME_LC@"); - // Run XBMC + // Run @APP_NAME@ Intent intent = getIntent(); intent.setClass(this, org.xbmc.xbmc.Main.class); intent.addFlags(Intent.FLAG_ACTIVITY_PREVIOUS_IS_TOP); @@ -482,7 +482,7 @@ public class Splash extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - // Check if XBMC is not already running + // Check if @APP_NAME@ is not already running ActivityManager activityManager = (ActivityManager) getBaseContext() .getSystemService(Context.ACTIVITY_SERVICE); List<RunningTaskInfo> tasks = activityManager @@ -490,7 +490,7 @@ public class Splash extends Activity { for (RunningTaskInfo task : tasks) if (task.topActivity.toString().equalsIgnoreCase( "ComponentInfo{org.xbmc.xbmc/org.xbmc.xbmc.Main}")) { - // XBMC already running; just activate it + // @APP_NAME@ already running; just activate it startXBMC(); return; } @@ -517,7 +517,7 @@ public class Splash extends Activity { properties.load(xbmcprop); if (!curArch.equalsIgnoreCase(properties.getProperty("native_arch"))) { - mErrorMsg = "This XBMC package is not compatible with your device (" + curArch + " vs. " + properties.getProperty("native_arch") +").\nPlease check the <a href=\"http://wiki.xbmc.org/index.php?title=XBMC_for_Android_specific_FAQ\">XBMC Android wiki</a> for more information."; + mErrorMsg = "This @APP_NAME@ package is not compatible with your device (" + curArch + " vs. " + properties.getProperty("native_arch") +").\nPlease check the <a href=\"http://wiki.xbmc.org/index.php?title=XBMC_for_Android_specific_FAQ\">XBMC Android wiki</a> for more information."; Log.e(TAG, mErrorMsg); mState = InError; } @@ -543,7 +543,7 @@ public class Splash extends Activity { } else { ret = CheckCpuFeature("neon"); if (!ret) { - mErrorMsg = "This XBMC package is not compatible with your device (NEON).\nPlease check the <a href=\"http://wiki.xbmc.org/index.php?title=XBMC_for_Android_specific_FAQ\">XBMC Android wiki</a> for more information."; + mErrorMsg = "This @APP_NAME@ package is not compatible with your device (NEON).\nPlease check the <a href=\"http://wiki.xbmc.org/index.php?title=XBMC_for_Android_specific_FAQ\">XBMC Android wiki</a> for more information."; Log.e(TAG, mErrorMsg); mState = InError; } diff --git a/tools/buildsteps/android/package b/tools/buildsteps/android/package index 4708d969bb..282ea3237b 100644 --- a/tools/buildsteps/android/package +++ b/tools/buildsteps/android/package @@ -6,5 +6,5 @@ cd $WORKSPACE;make apk #rename for upload #e.x. xbmc-20130314-8c2fb31-Frodo-armeabi-v7a.apk -UPLOAD_FILENAME="xbmc-$(getBuildRevDateStr)-armeabi-v7a.apk" -mv xbmcapp-armeabi-*.apk $UPLOAD_FILENAME +UPLOAD_FILENAME="kodi-$(getBuildRevDateStr)-armeabi-v7a.apk" +mv kodiapp-armeabi-*.apk $UPLOAD_FILENAME diff --git a/tools/buildsteps/androidx86/package b/tools/buildsteps/androidx86/package index d95392bed3..3be57031da 100644 --- a/tools/buildsteps/androidx86/package +++ b/tools/buildsteps/androidx86/package @@ -6,5 +6,5 @@ cd $WORKSPACE;make apk #rename for upload #e.x. xbmc-20130314-8c2fb31-Frodo-x86.apk -UPLOAD_FILENAME="xbmc-$(getBuildRevDateStr)-x86.apk" -mv xbmcapp-x86-*.apk $UPLOAD_FILENAME +UPLOAD_FILENAME="kodi-$(getBuildRevDateStr)-x86.apk" +mv kodiapp-x86-*.apk $UPLOAD_FILENAME diff --git a/tools/depends/target/dummy-libxbmc/Makefile b/tools/depends/target/dummy-libxbmc/Makefile index 203dfa1477..d65537aad6 100644 --- a/tools/depends/target/dummy-libxbmc/Makefile +++ b/tools/depends/target/dummy-libxbmc/Makefile @@ -1,7 +1,9 @@ include ../../Makefile.include -DEPS= ../../Makefile.include Makefile dummy-libxbmc.c +VERSION.TXT := $(XBMCROOT)/version.txt +DEPS= ../../Makefile.include Makefile dummy-libxbmc.c $(VERSION.TXT) +APP_NAME=$(shell awk '/APP_NAME/ {print tolower($$2)}' $(VERSION.TXT)) -LIBDYLIB=libxbmc.so +LIBDYLIB=lib$(APP_NAME).so all: $(PLATFORM)/$(LIBDYLIB) .installed-$(PLATFORM) @@ -9,11 +11,11 @@ $(PLATFORM): mkdir -p $(PLATFORM) $(PLATFORM)/$(LIBDYLIB): $(PLATFORM) $(DEPS) - $(CC) -shared -o $(PLATFORM)/libxbmc.so dummy-libxbmc.c + $(CC) -shared -o $(PLATFORM)/lib$(APP_NAME).so dummy-libxbmc.c .installed-$(PLATFORM): $(PLATFORM)/$(LIBDYLIB) - mkdir -p $(PREFIX)/lib/dummy-libxbmc - cp $(PLATFORM)/libxbmc.so $(PREFIX)/lib/dummy-libxbmc + mkdir -p $(PREFIX)/lib/dummy-lib$(APP_NAME) + cp $(PLATFORM)/lib$(APP_NAME).so $(PREFIX)/lib/dummy-lib$(APP_NAME) touch $@ clean: diff --git a/tools/depends/target/xbmc/Makefile b/tools/depends/target/xbmc/Makefile index fb65398013..ad531a0980 100644 --- a/tools/depends/target/xbmc/Makefile +++ b/tools/depends/target/xbmc/Makefile @@ -1,5 +1,8 @@ -include ../../Makefile.include +VERSION.TXT := $(XBMCROOT)/version.txt +APP_NAME=$(shell awk '/APP_NAME/ {print tolower($$2)}' $(VERSION.TXT)) + SOURCE=../../../../ export CXXFLAGS+=-O3 @@ -15,10 +18,10 @@ endif CONFIGURE += $(CONFIG_EXTRA) -all: $(SOURCE)/libxbmc.so +all: $(SOURCE)/lib$(APP_NAME).so -$(SOURCE)/libxbmc.so: +$(SOURCE)/lib$(APP_NAME).so: cd $(SOURCE); BOOTSTRAP_FROM_DEPENDS=yes ./bootstrap cd $(SOURCE); $(CONFIGURE) diff --git a/xbmc/android/loader/AndroidDyload.cpp b/xbmc/android/loader/AndroidDyload.cpp index 594562c22c..7e36d6fabe 100644 --- a/xbmc/android/loader/AndroidDyload.cpp +++ b/xbmc/android/loader/AndroidDyload.cpp @@ -8,6 +8,8 @@ #include <fcntl.h> #include "android/activity/XBMCApp.h" #include "AndroidDyload.h" +#include "utils/StringUtils.h" +#include "CompileInfo.h" using namespace std; //#define DEBUG_SPEW @@ -246,8 +248,11 @@ void* CAndroidDyload::Open_Internal(string filename, bool checkSystem) for (strings::iterator j = deps.begin(); j != deps.end(); ++j) { - // Don't traverse into libxbmc's deps, they're guaranteed to be loaded. - if (*j == "libxbmc.so") + std::string appName = CCompileInfo::GetAppName(); + std::string libName = "lib" + appName + ".so"; + StringUtils::ToLower(libName); + // Don't traverse into libkodi's deps, they're guaranteed to be loaded. + if (*j == libName.c_str()) continue; if (FindInDeps(*j)) diff --git a/xbmc/cores/DllLoader/exports/Makefile.in b/xbmc/cores/DllLoader/exports/Makefile.in index ce920ce736..db31666278 100644 --- a/xbmc/cores/DllLoader/exports/Makefile.in +++ b/xbmc/cores/DllLoader/exports/Makefile.in @@ -19,5 +19,5 @@ exports_python_linux.o : exports_python_linux.cpp wrapper.def : wrapper.o nm wrapper.o | grep __wrap | awk '{printf("%s ", $$3);}' | sed "s/___wrap_/__wrap_/g" | sed "s/__wrap_/-Wl,-wrap,/g" > $@ ifeq (@USE_ANDROID@,1) - echo "-L$(prefix)/lib/dummy-libxbmc/ -lxbmc" >> $@ + echo "-L$(prefix)/lib/dummy-lib@APP_NAME_LC@/ -l@APP_NAME_LC@" >> $@ endif diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/Makefile.in b/xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/Makefile.in index 81d7b6ed4e..29ee0808ab 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/Makefile.in +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/Makefile.in @@ -16,7 +16,7 @@ INCLUDES += -I${prefix}/opt/android-source/libhardware/include LIBNAME=libXBMCvcodec_stagefrightICS LIB_SHARED=@abs_top_srcdir@/system/players/dvdplayer/$(LIBNAME)-$(ARCH).so -LIBS += -landroid -lEGL -lGLESv2 -L${prefix}/opt/android-libs -lstdc++ -lutils -lcutils -lstagefright -lbinder -lui -lgui -L@abs_top_srcdir@ -lxbmc +LIBS += -landroid -lEGL -lGLESv2 -L${prefix}/opt/android-libs -lstdc++ -lutils -lcutils -lstagefright -lbinder -lui -lgui -L@abs_top_srcdir@ -l@APP_NAME_LC@ all: $(LIB_SHARED) |