How to add Flash Player prebuilt application to the system.img in android? - build-process

I am trying to customize my android system by adding Flash Player to the default system applications.
I added the .apk file to packages/apps/FlashPlayer, with the Android.mk file
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := FlashPlayer
LOCAL_SRC_FILES := FlashPlayer.apk
LOCAL_MODULE_SUFFIX := .apk
LOCAL_MODULE_CLASS := APPS
LOCAL_CERTIFICATE := PRESIGNED
include $(BUILD_PREBUILT)
This apk also uses some libraries: libflashplayer.so libstagefright_froyo.so. libstagefright_honeycomb.so and libysshared.so.
I created a module for each one and added them to generic.mk in the variable
PRODUCT_PACKAGES
PRODUCT_PACKAGES:= libflashplayer \
libstagefright_froyo \
libstagefright_honeycomb \
libysshared \
FlashPlayer \
I tested with adb shell, the apk is in /system/app and the libs are present in /system/lib
but when I try to play a movie from a browser, it says that the flash player is not installed.
However if I manually install FlashPlayer with adb install command the movie can be played from browser.
Can you help with this issue?

Libs should be in /system/lib/plugins/com.adobe.flashplayer, according to PluginManager.java.

I got the very same problem. For some reason, WebKit is unable to load plugins that are installed by adding them into PRODUCT_PACKAGES list. However, WebKit will load them if you install them with adb install. I still did not find other way for installing them. Only adb install will make them work. Please, update your post here if You got any progress on this.

Related

How to use add-on "QtFtp"?

I want to use FTP in my current project, but since Qt5 ftp isn't available (only as add-on).
I downloaded the sources from here: https://github.com/qt/qtftp
In Qt's forum, I found a instruction how to use it:
Open Console in the qtftp-folder
Generate the headers: cd qtftp, <QTDIR>/bin/syncqt.pl -version 5.2.0
Run qmake
Run make (mingw32-make)
Run make install (mingw32-make install)
Add QT += ftp in my .pro-file
Run qmake on my project
compile my project.
(https://forum.qt.io/topic/23904/qtftp-and-qthttp-compatibility-add-ons-for-qhttp-and-qftp-classes-in-qt-5)
So, I wanted to try these steps, but it fails on the first step, because the syncqt.pl cant be found, but I looked in the Qt-directory, and the file is there.
Anybody has an idea, how to fix/solve this? I am using Qt5.9.1
If you have downloaded the portable version of strawberry-perl like me, just extract .zip somewhere on your disk. After that, open the portableshell.bat (it should open a command prompt window)
After that, you can type in the code of step 2, and don't forget to add the -version argument.
Then you can continue with step 3, and everything should work without any problems.

How to debug a Meteor plugin file?

I've followed Meteor Doc to register a plug-in package.
Created a plug-in file in the package/plugin/ folder
Added a debugger; in that file.
ran $ meteor debug;
Problem: debugger; directive is ignored. How to debug the plug-in file?
Thx!
plugin/compile-atscript.js:
Plugin.registerSourceHandler(
'ats'
, function (compileStep) {
var source = compileStep.read().toString('utf8');
console.log('source: ' + source);
debugger;
console.log('compiled source: ' + source);
});
The Meteor tool runs build plugins in-process, so you just need to run it under the debugger. On Linux and Mac OS X, the launcher script supports a TOOL_NODE_FLAGS variable that can be used to pass arguments to the Node.js runtime to enable debugging. See the instructions for debugging the Meteor tool, although these are geared toward use with a git checkout of Meteor. A hacky shortcut:
METEOR_INSTALLATION=~/.meteor/packages/meteor-tool/$(meteor --long-version | sed -ne 's/^meteor-tool#//p')/mt-$(meteor --arch)
TOOL_NODE_FLAGS=$METEOR_INSTALLATION/dev_bundle/lib/node_modules/node-inspector/bin/node-debug.js $METEOR_INSTALLATION/meteor
(Note, using just meteor on the last line may not work because when the default version of the Meteor tool executes the proper version for the app, the debugger would be started a second time.)
On Windows, support for TOOL_NODE_FLAGS was added to the launcher script in Meteor 1.4.4. If the app is using an older version of Meteor, one could manually edit the launcher script. The commands to start debugging would look like:
set METEOR_INSTALLATION=%LOCALAPPDATA%\.meteor\packages\meteor-tool\TOOL_VERSION\mt-os.windows.x86_32
set TOOL_NODE_FLAGS=%METEOR_INSTALLATION%\dev_bundle\lib\node_modules\node-inspector\bin\node-debug.js
%METEOR_INSTALLATION%\meteor.bat
(Someone else is welcome to add copy-and-pasteable code to figure out the correct TOOL_VERSION!)
On macOS
Set Environment variable
export TOOL_NODE_FLAGS="--inspect-brk"
List env vars
printenv
Run meteor
meteor
Debugger will be listening and will get attached to Chrome dev tools on opening the Chrome Browser.

Setting Version of iOS simulator from Command line

Context: Running automated scripts using Xcode's UIAutomation with simulators 6.1 and 5.1
Xcode version is 4.6.1
Problem: When running a shell script from the Terminal, UIAutomation ALWAYS opens up 6.1, even though i've set the app path to 5.1.
I've tried building and running on 5.1, also if i run the test from Instruments, I'm able to choose the target for 5.1 and it works fine. The problem is only when i run it from the command line.
I checked the iphonesimulator.plist and the currentSDKRoot points to the 5.1 path, but as soon as the shell script runs, it changes to 6.1. Is there anyway I can force it to use 5.1?
After hours of searching (including the most apt one - Launch a specific Hardware version of iOS simulator using instruments command line utility) , there seems to be no solution to this.
There is a way to set the device using defaults write com.apple.iphonesimulator \ "SimulateDevice" '"iPad"'
I need something like defaults write com.apple.iphonesimulator \ "Version" '"5.1"'
though obviously that doesn't work.
Any pointers will be much appreciated. Thank You!
EDIT: I was hoping this would be resolved with XCode 5, but I still have the same issue and iOS7 simulator ALWAYS opens up! Btw,is there a way to circumvent this issue - I'm sure there are many out there running multiple simulator versions.
This isn't elegant, but it is a work around that we have been able to get to work on our automation setup:
Install Xcode 5 from the App Store
Install Xcode 4.6.3 or from the developer portal's "Old Versions of Xcode page"
Repeat with older versions of Xcode where the max sim version == the one you want to run
Use "sudo xcode-select -switch /path/to/Xcode.app" to pick the version of Xcode
Hope that helps!
I also ran into this issue while running my automation tests on my Jenkins box and I did the following to test my app with ver 6.1 simulator and not 7.0 simulator:
Using Jenkins:
STEP 1 = I create one job that builds my ios app with the 6.1 sdk version.
===========================================
STEP 2 = I create a 2nd job using a bash script that downstreams from the 1st job which does the following:
[Go inside the Xcode app location to get to the iphone simulator sdk directory]
cd '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/'
[Move the 'iPhoneSimulator7.0.sdk' directory to another location (I chose the desktop)]
echo [ENTER ADMIN PASSWORD HERE] | sudo -S mv iPhoneSimulator7.0.sdk/ ${HOME}/Desktop
[Rename the 'iPhoneSimulator6.1.sdk' to 'iPhoneSimulator7.0.sdk']
echo [ENTER ADMIN PASSWORD HERE] | sudo -S mv iPhoneSimulator6.1.sdk/ iPhoneSimulator7.0.sdk/
===========================================
STEP 3 = I create 3rd job that executes my tests. The 3rd job downstreams from my 2nd job.
===========================================
STEP 4 = I create a 4th job that downstreams from the 3rd job. The 4th job uses a bash script which does the following:
[Go inside the Xcode app location to get to the iphone simulator sdk directory]
cd '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/'
[Rename the 'iPhoneSimulator7.0.sdk' back to 'iPhoneSimulator6.1.sdk']
echo [ENTER ADMIN PASSWORD HERE] | sudo -S mv iPhoneSimulator7.0.sdk/ iPhoneSimulator6.1.sdk/
[Go to directory where you moved the 'iPhoneSimulator7.0.sdk' (in my case I moved the 'iPhoneSimulator7.0.sdk' to the desktop)]
cd ${HOME}/Desktop
[Move the 'iPhoneSimulator7.0.sdk' directory back to the Xcode app sdk directory]
echo [ENTER ADMIN PASSWORD HERE] | sudo -S mv iPhoneSimulator7.0.sdk/ '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/'
[I kill any lingering processes related to the automation]
ps ax|grep [b]ash|awk '{print $1}'|xargs kill -9
ps ax|grep [i]nstruments|awk '{print $1}'|xargs kill -9
===========================================
I probably need to make this process more foolproof however I think its better than having multiple instances of xcode on the automation machine.

How to use XULRunner to run SQLite Manager outside of Firefox in Mac OS X Lion?

I have installed XULRunner 11.0 (xr) from here:
Downloads - sqlite-manager - Extension for Firefox and other apps to manage any sqlite database - Google Project Hosting
I have followed the steps listed here:
kiveo - Mac SQLite Manager Standalone App
I have read and tried the suggestions here (though they're for version 6.0):
stackoverflow: How to Install and run a XulRunner Application on Mac OS X?
I am able to get the help listing with this command:
/Library/Frameworks/XUL.framework/xulrunner-bin -h
I am able to run the app from Firefox using this command (after changing the max version in sqlitemanager-xr-0/application.ini to 11.0 from 11.0a1):
/Applications/Firefox.app/Contents/MacOS/firefox --app ~/Downloads/sqlitemanager-xr-0/application.ini
Here are the contents of the application.ini file:
[App]
Name=sqlite-manager
ID=SQLiteManager#mrinalkant.blogspot.com
Version=0.7.7
BuildID=201111132204
Vendor=lazierthanthou
Copyright=Copyright (c) 2008 - 2011 lazierthanthou
[Gecko]
MinVersion=2.0
MaxVersion=11.0
[XRE]
EnableExtensionManager=1
When I run the following command in Terminal, with or without sudo, it just immediately returns to the command prompt. There are no error messages. No application appears under Applications. Nothing seems to happen at all. (And, despite the stackoverflow page above noting that --install-app may not really be supported, it is in the XULRunner help listing - which I guess doesn't necessarily mean it'll work ;)
/Library/Frameworks/XUL.framework/xulrunner-bin --install-app Downloads/sqlitemanager-xr-0/ /Applications
Following a suggestion below, I checked for an exit code. The line above is returning 2.
Help?
Just like you did with Firefox, this command should run your app:
/Library/Frameworks/XUL.framework/xulrunner-bin --app ~/Downloads/sqlitemanager-xr-0/application.ini
Also, the --app switch is optional within XULRunner.
Here's how you can make a self-contained application you can run from the Dock.
Use the xulrunner --install-app command to create the application and then copy all contents of XUL.framework/Versions/Current into the generated application at /Applications/sqlite-manager.app/Contents/MacOS.
You can then create a wrapper script that runs the xulrunner within the generated app with the application.ini file as described here.
For example, put the following into sqlite-manager.app/Contents/MacOS/sqlite-manager and make it executable.
#!/usr/bin/env bash
APP_PATH="/Applications/sqlite-manager.app"
"$APP_PATH/Contents/MacOS/xulrunner" --app "$APP_PATH/Contents/Resources/application.ini"
Now you have to tell OS X to run sqlite-manager instead of xulrunner. You can do that by editing sqlite-manager.app/Contents/info.plist and setting CFBundleExecutable to sqlite-manager like this:
<key>CFBundleExecutable</key>
<string>sqlite-manager</string>
The only limitation of this approach is that it breaks when you move the application or rename it. I'd love suggestions on how to get rid of the absolute path within the sqlite-manager script.
try this:
firefox -chrome chrome://sqlitemanager/content/sqlitemanager.xul
or on OS X
/Applications/Firefox.app/Contents/MacOS/firefox -chrome chrome://sqlitemanager/content/sqlitemanager.xul
(found on http://www.egeek.me/2013/09/07/how-to-run-sqlite-manager-with-a-single-command/)
works fine for me on UBUNTU 12.04 to start sqlite manager without starting firefox first
If the install was successful, I think the app should be available in some usual place for your system (which wasn't mentioned, but I'm guessing OSX :). Have you looked under /Applications?
To see whether the command failed quietly, you could check its return value. Is there a verbose switch?
$ cd narnia
bash: cd: narnia: No such file or directory
$ echo $?
1
$ cd .
$ echo $?
0
$ cd narnia && echo "success"
bash: cd: narnia: No such file or directory
$ cd . && echo "success"
success

Trouble building sqlite 3.7.4 on CentOS 5.5 to include readline support

The readline library allows the CLI for sqlite to accept arrow keys to recall previously typed commands. I can build without this and sqlite works, it's just a hassle not having this nice capability. I've installed readline-devel from yum and /usr/lib64/libreadline.so.5 is present as well as it's header files. When I run ./configure to build sqlite, I see these lines:
checking for library containing readline... no
checking for readline... no
The library path is set to the correct path:
LD_LIBRARY_PATH="/usr/lib64:/usr/local/lib:/lib:/usr/lib"
By default, ./configure does try to include readline support so there are no special "--with-XXXX" options needed.
Anyone every seen this problem? I need to use this newer version to get latest foreign key support. It's hassle running on CentOS as is bundles pretty old versions of apps but we don't have a choice right now and I cannot find an updated RPM with newer version of sqlite.
=== UPDATE ===
Ok, I found a solution but I don't completely like it...
First, I tried with this option:
./configure CPPFLAGS="-I/usr/include/ -DHAVE_READLINE"
That causes the readline functionality to get compiled into shell.c which is what is needed for starters. But, the linking fails because it cannot find libreadline. The only 'kludgy' way I could figure out to get it to link was to manually edit the Makefile after running the above ./configure command. I changed this line:
LIBS = -ldl -lpthread
to this:
LIBS = -ldl -lpthread -lreadline -ltermcap
Then I ran "make clean all" and "make install" and the readline functionality works in the CLI.
I tried every way I could think of to pass in the extra libraries including exporting using LIBS, exporting using READLINE_LIBS, exporting using LDFLAGS, nothing would work. If you set LIBS to anything, like "export LIBS="-lreadline", it causes configure to fail. The --help on configure about using LIBS seems to contradict what happens when you actually set it to any value.
Anyway, this works so I can live with it - but I don't particularly like it! :(
==== THE RIGHT SOLUTION ====
Well, wouldn't you know it. Spend hours trying to figure it out, then stumble onto the right tip on Google. Just needed to install ncurses-devel first. So, to summarize all that is needed to built it 'unkludgily':
yum install ncurses ncurses-devel
yum install readline readline-devel
yum install libtermcap libtermcap-devel
./configure
make
make install
No special command line options or exports or Makefile edits needed! Readline support is automatically built in by default now.

Resources