Related
Part 4. A noob's Hope.
or, A noobs Kernel building guide for noobs by a noob.
Linux Gurus and Master Dev's, please feel free to point out any mistakes i make.
We've got lots of ROMs available and frankly, i think we've reached the limit of what could be done. Ofcourse, i could be wrong. we might have a special guy/girl out there who's just finishing off a port of icescream sandwich for the X8.
As it stands, instead of waiting for the latest ROM build, just choose what was best in your experience and stick to it, nothing would change much. I still use the old GX8 ;-)
But, first: let's take our hats off and and humbly give our thanks to those that have paved the way, the dev's that we've bugged (pun), cajoled, bribed (?) and outright threatened to put in into their (ROMs, Kernels,Modules etc) works what we like to have running on our X8's.
in Alphabetical order: (BTW, incase i miss anybody, pls point it out. we don't want any disrespect)
alfsamsung
AnDyx
Blagus
Dare-Devil Inside
Doixanh
DoomLoRd
FrogyFurnetal
FXP team
Master Shpit
Nobodyatall
Ponanovn
Racht
Velnens123
Well on with this simple tutorial:
What's a Kernel? (or, its KERNEL and NOT KERNAL) Simply put, it's the Software Layer in between the ROM and the Hardware. In this case it's Linux 2.6.29. The ROM "Android 'whatever'" is the interface between us users and our beloved X8.
Why 2.6.29 and not a more later kernel? since the Kernel is the go between hardware and the UI, ther drivers for the hardware are there. An analogy will be like Windows 98 drivers will not work (well, sometimes they do) on Windows7 and vice versa. Couple that idea with Google, hence Android, is branched off of the main Linux kernel. Infact, the entire Android kernel code was deleted from the main linux kernel tree.
Besides, look at the title, it's for noobs by a noob. as soon as i figure out how to go to Kernel 2.6.32 or something, i'll update.
Why build your own Kernel? because it's fun!
What you need:
1. Crash Helmet.
2. A desire to possibly brick your X8
3. A fast computer with atleast 20 GB of HD space
4. since you're a noob, you must be using a Windows OS of some sort. If it's still Win3.1 or even Win95 consider upgrading to a faster computer and a more modern OS.i use both a 3.2 Ghz Hexcore AMD with 8Gb of RAM and 2TB HD and a 3.0Ghz Intel Core2 4GB RAM and 500GB HD Both worked fine. I also used a 2.6Ghz Core2, 500GB HD 2GB RAM Laptop and that worked fine as well.
5. Linux based OS. You can have this loaded in your computer a myrad ways, but for us noobs, the easiest will be using Virtual Box (VirtualBox-4.1.6-74713-Win). And, for this tutorial, i set up virtual box with Ubuntu (ubuntu-11.10-desktop-i386). SO, go ahead and download both and install. If you don't know how to find those... you being a noob can only go so far... remember, google is your friend.
7. FXP Kernel Source. It's always a good idea to ask permission first and don't forget to say thanks. > https://github.com/freexperia/semc-kernel-msm7x27. click on the button which says zip.
8. Download this >> https://sourcery.mentor.com/sgpp/li...-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
9. and this, http://dl-www.sonyericsson.com/cws/download/1/103/126/1/1316518401/E15i_eclair_2.1.1.A.0.6.tar.gz
So, see you Saturday.
Reserved
Part 5: The code strikes back!
What are those files we downloaded:
1. FXP Kernel Source for MSM7227
2. Linux-GNU compiler
3. SE 2.1.1.A.0.6 Kernel Source.
What do we do with it?
Assuming you've got your VMBox Ubuntu running,
1. Open Home. This is like windows File Explorer.
2. Make a Folder and call it "Kernel".
3. Copy all your downloaded files into the Kernel Folder.
4. Extract those 3 files by right clicking on the archive and select "Open with Archive Manager".
5. Select "Extract" in the upper part of the Archive Manager window. Click "extract" again on the lower right of the window that appears.
are you done extracting? well, if you are then:
6. let's make our lives a bit easier: Rename the arm-2010q1-202-arn-none-linux-gnueabi-i686-pc folder into just arm-2010q1.
7-8 do the same thing with the other two.... No, not the same name as arm2919q1(noob!) but, for the FXP kernel source folder just rename it to FXP and the original SE Kernel Source folder to SeX8.
9. OK. crash helmets ready? Open up Terminal....
(hint: see that wierd symbol above the Home icon in the taskbar? click on it and in the search space type "terminal")
(hint: you can click and drag the Terminal Icon into the task bar for easier use.)
10. type this in exactly but without the double qoutes, Linux is picky about cases. "sudo apt-get install git unrar libncurses5-dev qt3-dev-tools"
remember your homework?
sudo is a command that basically says "hey, i'ma supauser, do what i tell you!" which in this case is to download and install, git, unrar, ncurse libraries and QT3. To be honest, i haven't found much use for Qmake (QT3).
You might be wondering (especially the command line experts) as to why i switch back and forth between the command line and the Home browser. Well, for us noobs, i find it easier to go with the familiar and spend as little time as possible in a super user terminal. Lot's of things can go wrong with a mis-typed command. As for now twiddle your fingers while we wait for the download and install to finish.
Done?
11. OK. since we're gonna be doing kernel stuff lets get super user access. again enter this with no qoutes: sudo /bin/bash
enter your password. don't worry it won't show those loveable asterisks. press enter. if everything's ok we'll see the command prompt again with a difference of root access ;-)
12. next. let's get to our Kernel directory by : "cd ~/Kernel/FXP" (thanks to dioxanh for the correction)
13. Heres where the fun begins:
we set up the environment by entering the following in Termial(NO QOUTES):
"export ARCH=arm"
"export CROSS_COMPILE=/home/viper001/Kernel/arm-2010q1/bin/arm-none-linux-gnueabi- "
BTW, change viper001 in the crosscompile to your user name
14. configuration definitions. this tells the compiler for what machine, what drivers to include, machine configuration etc to include into your kernel build.
so, if you want to see all the machines, for those with any machine with the MSM7227, (HEY, you with the E16) it is possible to compile a kernel for it also.
in this case, lets use the Home Folder explorer. and double-click on the following folders: Kernel >> FXP>> arch>> arm >> configs.
now we're in FXP's archive for the configuration of arm based machines. isn't it nicely logical.
of interest are two configs. fxp_shakira_defconfig and semc_shakira_defconfig. You can view them in gedit by double clicking. but please do not edit.
15. Back to the terminal. type in: "make fxp_shakira_defconfig"
did you see this after it was done? "# configuration written to .config". that means, so far so good.
16. let's see what we've got. This was the reason we downloaded ncurses. enter "make menuconfig"
Explore a bit, and see the settings, don't change any for now. once your done exit back to the terminal prompt.
17. type in: "make" and depending on your PC, it will take from 10 to 30 minutes. give or take a few hours on a pentium 1. (DIDn't i tell you to upgrade?)
18. If all went well, then in the Kernel >> FXP>> arch>> arm >> boot folder, you'll find the image and zimage files. congratulations, you've compiled your first kernel.
So, in summary once you've got all the stuff together you've got to:
sudo /bin/bash
to get superuser access
export ARCH=arm
ready your environment to compile for the arm based machione
export CROSS_COMPILE=/home/viper001/Kernel/arm-2010q1/bin/arm-none-linux-gnueabi-
ready your environment by specifying the location of your compiler
make "defconfig, menuconfig, oldconfig"
make "defconfig": where defconfig is the default configuration file of a specific machine base on the archive as specified by ARCH.
make menuconfig: give us a pseudo graphical user interface. best used after a make defconfig to do those tweaks.
make oldconfig: you don't want to know. but if your curious just enter it and take a look and waste between 15 to 30 minutes of your life.
make: the final command to get your kernel image.
Here's a few helpfull commands after a failed compile:
make clean
make mrproper
Reserved
Part 6. Return of the Kernel Builder.
You now have the Kernel Image file. so, What do you do next?
Get the IMAGE file in the aforemention folder.
In windows:
Go to Blagus thread on Kernel building. >> http://forum.xda-developers.com/showthread.php?t=1254525
download the unlocking tool if you still don't have it. Don't forget to say Thanks.
download the attached FXPramdisk.zip and extract the ramdisk file inside.
put the image and the ramdisk file into the */sinTools folder of Blagus's utility. note: there's already an existing image and ramdisk in that folder. delete those or save them in another folder.
doubleclick on example_build.cmd and you'll get a result.zip file.
extract the result.elf.sin and rename to kernel.sin. YAY
Now, this is the dirty but most convenient way to wrap things up.
1. make a copy of a working kernel.ftf file.
2. in Blagus's utily, there is a folder called loader with a file inside called loader.sin
3. open up the kernel.ftf file with your favorite archiver. i use 7zip. delete the kernel.sin and loader.sin and then drag and drop your own kernel.sin and Blagus's loader.sin in that kernel.ftf and close.
4. use the flashtool utilty to flash into the X8.
After the flash and powering on, it is always a good idea to clear cache, dalvik cache and the battery stats.
If everything went well and booted to your ROM then you've got yourself the latest build of the FXP ROM.
BUT, HOLD ON!!!!
Don't get that far away look in your eyes as you whisper to yourself "then i am a kernel builder...."
I'll try to say this in my best yoda imitation. "hmmm, hehehehe *cough* *wheeez*.... WiFi, you must compile WiFi.... only then, a Kernel Builder will you be..."
.....
"There are also.... the modules...ramdisk editing..."
See you in Part 1. The Phantom Modules.
It will be very interesting
Thank you!
is there a E16i W8 firmware?
amnher said:
is there a E16i W8 firmware?
Click to expand...
Click to collapse
Check the se developer site. You might get lucky.
EDIT: I actually checked. And there is one for the E16i. The difference between the i and a versions is cdma or GSM. It could just be a matter of using the correct definitions during compile. Let's hope that a kind guru could shed light on this.
Oops. It is an i you're asking for. So go and download this http://developer.sonyericsson.com/wportal/devworld/downloads/download/e16ieclair211a46targz?cc=gb&lc=en
Sent from my TI99 4A
updated.
Part 1. The Phantom Modules
The the early days of the X8 rooting scene. we had two ROM Devs/Porters that gave us an option of going the CM route through MiniCM or the HTC/Motorla route. Now qui-gon and obi... urmm, Racht and Ponanovn did a splendid job in porting these ROMS, especialy since it freed us from Eclair.
But the users wanted more... we wanted multi-touch, we wanted overclock, we wanted netfilters.... heck, lets just say for the price of the X8, we wanted an X10.
Out of the SE deserted android scene, Dioxahn came out with back to back modules that enabled, empowered and brought balance to our X8. (too cheesy?)
But with the advent of X8 Kernel Building, where did these module go? we have to delete the modules from our lib/modules..,.. what happened?
Well, the code they had just went to where they're supposed to be.
It's a frustration that can heard in Dioxanhs words when people asks stuff like dual/multitouch on a synaptics X8 or overvoltage and the like when we can't understand his genius.
to be clear, first and foremost, the modules he made, hijacks and takes over the code built in kernel. Ex. the Kernel might need to know what speed the cpu should be, and there is a code for that, to simplify, as it ask for this code, the OC module intercepts this request and sends its own modified code as an alternative. confused? GOOD.
Overclock:
In ubuntu, go to Kernel >> FXP >> arch >> arm >> mach-msm
double click on acpuclock.c, you will not find the following code as is, since the FXP team disabled the OC from the Kernel. but do a search of :
static void acpuclk_set_div
and you should find a code similar to the OC code that follows but without the items in bold.
DO not modify anything yet. Unless you know what you're doing.
The code below is what enables overclock and is the same instructions inserted by the OC module, it is also the same as in the Google nexus, and alfasamsungs kernel.
static void acpuclk_set_div(const struct clkctl_acpu_speed *hunt_s) {
uint32_t reg_clkctl, reg_clksel, clk_div, src_sel, a11_div;
reg_clksel = readl(A11S_CLK_SEL_ADDR);
/* AHB_CLK_DIV */
clk_div = (reg_clksel >> 1) & 0x03;
/* CLK_SEL_SRC1NO */
src_sel = reg_clksel & 1;
// Perform overclocking if requested
a11_div=hunt_s->a11clk_src_div;
if(hunt_s->a11clk_khz>600000) {
a11_div=0;
writel(hunt_s->a11clk_khz/19200, MSM_CLK_CTL_BASE+0x33C);
udelay(50);
}
src_sel = reg_clksel & 1;
/*
* If the new clock divider is higher than the previous, then
* program the divider before switching the clock
*/
if (hunt_s->ahbclk_div > clk_div) {
reg_clksel &= ~(0x3 << 1);
reg_clksel |= (hunt_s->ahbclk_div << 1);
writel(reg_clksel, A11S_CLK_SEL_ADDR);
}
Over and under voltage:
Now, this is what im busy of at the moment. i'm trying to find the best PLL clock ratio for GPU to CPU stable speeds within the constraints of the voltage. the bold numbers are the voltage identifiers. since the MSM7227 has a range of 1.2 to 1.35 V operating voltage hence the values from 1 to 7. NO OVERVOLTAGE.
BTW, the part is located in the same file acpuclock.c and is at the begining and is also required to set the maximum CPU clock. The values after the 600Mhz are the values i'm playing with since i think FXP has already "tuned" the stock speed perfectly. In alfasamsungs kernel, he didn't include the scales between 600 and 729. which is very logical. why overclock if you ain't going to max,
/* 7x27 normal with GSM capable modem - PLL0 and PLL1 swapped */
static struct clkctl_acpu_speed pll0_960_pll1_245_pll2_1200[] = {
{ 0, 19200, ACPU_PLL_TCXO, 0, 0, 19200, 0, 0, 30720 },
{ 0, 120000, ACPU_PLL_0, 4, 7, 60000, 1, 3, 61440 },
{ 1, 122880, ACPU_PLL_1, 1, 1, 61440, 1, 3, 61440 },
{ 0, 200000, ACPU_PLL_2, 2, 5, 66667, 2, 4, 61440 },
{ 1, 245760, ACPU_PLL_1, 1, 0, 122880, 1, 4, 61440 },
{ 1, 320000, ACPU_PLL_0, 4, 2, 160000, 1, 5, 160000 },
{ 0, 400000, ACPU_PLL_2, 2, 2, 133333, 2, 5, 160000 },
{ 1, 480000, ACPU_PLL_0, 4, 1, 160000, 2, 5, 160000 },
{ 1, 600000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 652800, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 691200, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 710400, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 729600, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 748800, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 768000, ACPU_PLL_2, 2, 1, 200000, 2, 7, 160000 },
{ 1, 787200, ACPU_PLL_2, 2, 2, 160000, 2, 7, 160000 },
{ 1, 806400, ACPU_PLL_2, 2, 2, 160000, 2, 7, 160000 },
// { 1, 825600, ACPU_PLL_0, 4, 0, 206400, 3, 7, 122880 },
// { 1, 844800, ACPU_PLL_0, 4, 0, 211200, 3, 7, 122880 },
// { 1, 864000, ACPU_PLL_0, 4, 0, 216000, 3, 7, 122880 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0, 0}, {0, 0, 0} }
};
One of the best things about this is that you can code and configure your "overclock" in acpuclock.c, set the default minmax speed to 122/600 in the defconfig during compile gaining a stock profile and go as high (or low) as you want in the ROM through the CM settings, SetCPU etc. You don't even have to "enable" overclock in the CMsettings.
At any rate, take a break and think about what our devs are doing before you noob them out. ok?
As a guide, i've included my acpuclock.c for your review and comparison to the original se Kernel.
Next. we'll tackle part 2. Touch Screen Wars.
or, they're on the same machine, they look the same... but, (gasps) they're not!!!
Part 2. Touchscreen Wars.
One of the silliest things you'll see on the X8 is the inconsistency in Hardware. We don't know whether it's for cost or different paces of manufacture or maybe parts availability. We even have 4 types of essentially the same machines the E15i and the cdma version E15a. then lately we have the W8 or E16i and E16a. to further compound the issue we even have different touchscreen controllers. And this is what we're gonna look at today.
So, you had fun compiling, played around with the defconfig yet?
well, if not let's take a look at one particular section:
# Input Device Drivers
#
# CONFIG_INPUT_KEYBOARD is not set
# CONFIG_INPUT_MOUSE is not set
# CONFIG_INPUT_JOYSTICK is not set
# CONFIG_INPUT_TABLET is not set
CONFIG_INPUT_TOUCHSCREEN=y
# CONFIG_TOUCHSCREEN_FUJITSU is not set
# CONFIG_TOUCHSCREEN_GUNZE is not set
# CONFIG_TOUCHSCREEN_ELAN_I2C_8232 is not set
# CONFIG_TOUCHSCREEN_ELO is not set
# CONFIG_TOUCHSCREEN_WACOM_W8001 is not set
# CONFIG_TOUCHSCREEN_MTOUCH is not set
# CONFIG_TOUCHSCREEN_INEXIO is not set
# CONFIG_TOUCHSCREEN_MK712 is not set
# CONFIG_TOUCHSCREEN_PENMOUNT is not set
CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI=y
CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI_4X=y
# CONFIG_TOUCHSCREEN_TOUCHRIGHT is not set
# CONFIG_TOUCHSCREEN_TOUCHWIN is not set
# CONFIG_TOUCHSCREEN_USB_COMPOSITE is not set
# CONFIG_TOUCHSCREEN_TOUCHIT213 is not set
# CONFIG_TOUCHSCREEN_TSC2007 is not set
# CONFIG_TOUCHSCREEN_MSM_LEGACY is not set
# CONFIG_TOUCHSCREEN_CY8CTMA300 is not set
# CONFIG_TOUCHSCREEN_CY8CTMA300_SER is not set
CONFIG_TOUCHSCREEN_CYTTSP_I2C=y
CONFIG_TOUCHSCREEN_CYTTSP_CORE=y
CONFIG_INPUT_MISC=y
# CONFIG_INPUT_ATI_REMOTE is not set
# CONFIG_INPUT_ATI_REMOTE2 is not set
# CONFIG_INPUT_KEYSPAN_REMOTE is not set
# CONFIG_INPUT_POWERMATE is not set
# CONFIG_INPUT_YEALINK is not set
# CONFIG_INPUT_CM109 is not set
CONFIG_INPUT_UINPUT=y
CONFIG_INPUT_GPIO=y
CONFIG_INPUT_KEYCHORD=y
# CONFIG_BMA150 is not set
I've extracted this from the semc_shakira_defconfig and you'll see that the synaptics and cyprus are enabled.
The question that comes to mind is why the cyprus have true dual while the synaptics X8 user stuck with only a fake? well, sadly the answer is in hardware. NO, it is not the controller... it is the screen, the touch screen sensor itself. like the synaptic advert says, the clearpad 1000 has 1touch + pinch.
What we can do however, especially if you're not planning to distribute your Kernel, is to disable the support for the driver you're not using.... think of it as payback.
To anybody interested to take a look. the touch screen drivers are located at (if you're using the format from the beginning of this tutorial) */FXP/drivers/input/touchscreen.
Files of interest are:
synaptics_i2c_rmi4.c
cyttsp_i2c.c
Well, it isn't much of a war...
Bring out the droids. or, semi-automating the process.
are you tired yet of entering those exports and stuff? well there's and easier way...
I've attached a file for your convenience (never say i didn't do you guys
favors.) called fxp2.txt. rename it to fxp2.bash and copy this into your Work directory. Which in this tutorial's case would be
/home/(your username/Kernel/FXP/
now, double click on this file from the home folders or type gedit fxp2.bash from terminal (be sure your in the working directory).
edit this file so that the paths are correct. save and close.
enter in terminal: "bash fxp2.bash"
cool, huh.
what did it do? first it cleaned up all the mess from previous compiles, then it set up the environment, then it made the .config and opened up the semi-GUI config editor. you can edit the configs as you want and when you exit the GUI, all you have to do is type in "make" et voila!!!
Speaking of the Configs. i'm sure that by now you've disregarded my warnings of not to change anything yet, and i'm very sure that by now you would have found that you can enable swap, setup support for ext234, set up driver support, net filters. etc. Heck, you might have even figured out how to make a kernel for the W8 by now.
But for the guys who did follow my warnings.... Why did you? That's why you want to compile the kernel... you want to be in charge, you want to be the boss of your own X8... the only thing stopping you is you didn't know how... NOW, YOU DO!!!
on the last chapter we'll be dealing with the Code's Revenge... the ramdisk.
part 3. Revenge of the Code
or that "insert profanity here" ramdisk!!!
Never before in the history of Noobiness has anything been more complicatedly crazy than the ramdisk. i mean, compiling the base kernel image is easy compared to this monster.
But we'll not let this stop us! Crash Helmets ON!!!!
What's the Ramdisk?
A ramdisk is basically a small filesystem containing the core files needed to initialize the system. It includes the critical init process, as well as init.rc, which is where you can set many system-wide properties. This is also where the chargemon (off-line charging) and the recovery systems are located.
we built our kernels using Blagus's ramdisk which is included with the bootloader unlock. so let's start with that:
1. get back to your Home folder. make a working folder for the ramdisk. lets call it "ramdisk" for the sake of this tutorial.
2. in the terminal, type "exit". it's a good idea now to get out of root access or we'll run into trouble later by having different access priorities as we switch between the GUI Home folder explorer and the Terminal based command line.
3. still in terminal, get into the ramdisk folder.
(hint: cd /home/(your username)/ramdisk)
4. copy Blagus's ramdisk into the ramdisk folder. you can rename it to ramdisk.cpio.gz or leave it as is.
5. let's upack the ramdisk by: gunzip -c ramdiskfilename | cpio -i
6. YAY!. now you can edit the ramdisk as you like it. I'll not go into this since it would take another tutorial in itself.
7. once you're done messing around with it. remove all the other stuff from the directory that you don't need, like the original ramdisk file.
re-pack the ramdisk with: find . | cpio -o -H newc | gzip > ../ramdisk.cpio.gz
you'll find the packed ramdisk.cpio.gz file in /Home.
8. rename this as ramdisk again and use as your ramdisk along with the kernel image you've compiled and make a kernel.sin as explained earlier in the tutorial.
We've now come full circle. Thank you for your time. i'll post more as i discover more and update the tutorial as i learn more.
Better yet, it would be great if you guys post something that would benefit all of us.
Additional Stuff that's good to know/have:
Well, that covers the basics of the kernel. but there's a few more things you might need. you know just in case.
Update your JAVA: you need these if your compiling for Froyo or later.
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
If your planning to build android rom, you'll need these:
(As noted by Dioxanh: for froyo and below, use a 32 bit system and a 64 bit system for gingerbread and above.)
32-bit linux installations:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
libxml2-utils
64-bit linux installation:
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs \
x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev \
libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
libxml2-utils
Tried to compile it but after make it says:
/bin/sh: /home/root/Kernel/arm-2010q1/bin/arm-none-linux-gnueabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
It's because Root home folder is not in /home/root/ it's in /root/
Great tutorial!
Sticky!
Megakaban_ said:
Tried to compile it but after make it says:
/bin/sh: /home/root/Kernel/arm-2010q1/bin/arm-none-linux-gnueabi-gcc: not found
make[1]: *** [kernel/bounds.s] Error 127
make: *** [prepare0] Error 2
Click to expand...
Click to collapse
It simply mean that your crosscompile path is wrong. Check the location of arm-2010q1 via home folders explorer.
make mrproper
And start again from
export ARCH=arm
Sent from my TI99 4A
Now kernel compiled successfully and i tried to change initlogo.
As written here: http://forum.xda-developers.com/showpost.php?p=6775233&postcount=5 i've converted .rle to .bmp and edited it. Now when i converted back to .rle, i got just colour strips.
Megakaban_ said:
Now kernel compiled successfully and i tried to change initlogo.
As written here: http://forum.xda-developers.com/showpost.php?p=6775233&postcount=5 i've converted .rle to .bmp and edited it. Now when i converted back to .rle, i got just colour strips.
Click to expand...
Click to collapse
It's like the OP said, you're bound to lose something in the conversion. Try to search for superangga's init logo conversion thread in Google.
Sent from my TI99 4A
My nick is velnens123! I hate when people spell my nick wrong!
---------- Post added at 03:20 PM ---------- Previous post was at 03:08 PM ----------
Anyway good tutorial, will try it tommorow!
velnens123 said:
My nick is velnens123! I hate when people spell my nick wrong!
---------- Post added at 03:20 PM ---------- Previous post was at 03:08 PM ----------
Anyway good tutorial, will try it tommorow!
Click to expand...
Click to collapse
Oops. Sorry. Can I blame it on the x8 spell checker?
Corrected. ;-)
Sent from my TI99 4A
i've updated post #9, it's a simple look at the defconfig and a tip to make life a bit more easy. pretty sure some guys are already sick and tired of typing and retyping the same code. But hey, doing things repeatedly is a great way to learn. it also turns you into a zombie....
viper001, does your thread realy fits in General forum? I think not...
And your thread needs to be sticky!
velnens123 said:
viper001, does your thread realy fits in General forum? I think not...
And your thread needs to be sticky!
Click to expand...
Click to collapse
Actually, I couldn't decide between gen or dev. But, I'm not developing anything nor is it a question. Lol.
A sticky would be nice. ;-)
Sent from my TI99 4A
BuildBox
The main intend of this application is to provide an easy to use, but powerful way to serve updates and addons for developers to their users, but it doesn't stop there, it also can be used by the user itself as batch flashing tool for files on the internal or external sd (openrecoveryscript supporting recovery and root are prerequisite).
But please keep in mind, this is still beta stage, so far all is stable, but the code itself needs refactoring still and some additional features i want to add are still missing, also the included images are far from being great.
Why i built this?
The current alternatives public available seemed not as powerful as they could be, because of the fact that they are closed source i started to build something similar myself from scratch.
What does it serve?
Tabbed UI
Nested lists within the tabs (in theory infinite levels of nesting [but for usability i wouldn't recommend more than 5 steps])
Detail views with many optional fields, like description, changelog, developers, images,...
Completely remotly configured content using json
Optional Md5 verfification
Download queue
Changelist of added, removed, updated & downgraded items
Sorting of download queue by drag & drop
Concurrent downloads to achieve full use of bandwidth (configurable amount)
Backup and restore of download queues
Support of every host with direct link capabilities
Support of hosts with up to 5 redirects (note: still direct link redirects, download webpages don't get handled)
Internal retry or resume (if supported by the server) functionality to avoid broken downloads because of unstable connections (up to 5 retries)
Direct install of apks
"External" link handling
Direct flash capabilities (if an openrecoveryscript supporting recovery is installed)
Adding of zips from storage to the queue
Backup/wipe options before flashing
Queue filter to only flash Successful/Done (Successful=downloaded+md5sum correct, Done=donwloaded+no md5sum provided) downloads (md5mismatches can optional be taken in as well)
OTA updates
Configurable interval for update check
Update version filter to avoid multiple notifications per version
New version check on startup
Image recycling and scaling (if an image is used more than once [identified by it's url], it will be downloaded only once and simply reused, also it will be scaled to the fitting size of the view to take as less bandwidth and ram as possible)
more to come...
Why json and not xml?
Xml is pretty good for local configuration, but json is the way to go when it comes to remote content.
It is highly mutable, lightweight and easy to use. Also the possibility for typos and errors is much less than with xml, because simple brackets and key value pairs are used instead of tags.
Last but not least, json files are about half of the sice of xml files if the same content is provided and the possible use of a webservice to provide it is pretty simple.
How to use as rom developer?
The application uses build.prop properties to configure rom update url, content url, rom version and default download directoy.
For update and content url there are also string resources present (to be able to publish the app to the play store to provide the rom itself with it e.g.).
All of this properties are optional (if they are not provided default values are taken).
Build.prop sample
Code:
buildbox.downloaddir=/storage/sdcard0/TestRom
buildbox.version=1.0.3c1
buildbox.updateurl=http://www.test.com/Rom.json
buildbox.contenturl=http://www.test.com/Content.json
Common content description
At the content json all root items will be shown as tabs, everything inside them are listitems.
Every item containing another list of items must contain the "children" property.
Every item containing a detail item must contain the "detail" property instead.
Key Value pair description
Common properties:
Code:
"title": "some value" -> this is the title of the chapter/listitem/detailitem (depends on the item type) (if the detailview doesn't contain a title property it will be taken from it's parent)
"device": "GT-I9300" -> this value is used to filter content which is only available for specific devices, it is compared with the ro.product.model build.prop property (because it is almost untouched by moders)
"thumbnailurl": "some url" -> this is the thumbnail shown at a listitem, it will be loaded asynchronous
"children": [ { some child items } ] -> this property is used to identify that this item contains another list
"detail" : { some detail properties } -> this property is used to identify this item as last item before a detail view is shown
Additional detail properties:
Code:
"version": "some version" -> sets the version (must not be inside the detail item, can also be inside his parent)
"description": "some text" -> sets the description (basic html notation can be used for formating)
"type": "zip" -> possible values are zip, apk, web, other, this will override the basic behaviour of parsing the mime type and will directly threaten it as the provided type [if external is used and the url property is given the url property will be taken for opening instead of the first webpages link])
"md5": "a md5sum" -> sets the md5sum of the package (only used for download verification if provided)
"url": "some url" -> the url where the item can be downloaded from
"webpages": [ "some url",
"some other url",
....
] -> if no url provided the first item of this array will be taken as external link, but in common provided as hyperlinks on the detail view to support pages
"images": [ "some url",
"some other url",
....
] -> used to show screenshots,... within the detail view (also loaded asynchronous)
"changelog": [ "a change",
"another change",
......
] -> to show a changelog, also supports html notation
"developers": [ { "some developer name": "" },
{ "another developer name": "some donation or profile page" },
......
] -> used to show the realted developers, if a donation or profile url is given the name will be shown as hyperlink, if it's empty as plain text
Server File Samples
Content.json:
Code:
[{
"title":"Apps",
"device":"GT-I9300", [B]//optional, compared with the ro.product.model build.prop property, to shows items for specific devices only (can be put at every level inside the nesting of an item, except inside a detail item)[/B]
"thumbnailurl":"http://ms-team-hd.tectas.eu/images/Apps.png",
"children": [
{"title":"4.2 Camera/Gallery",
"detail":
{"description":"Aosp Camera from android 4.2 with sphere photo feature",
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Apps/4.2Camera_App.zip",
"md5":"10cfc3983156d42a9dbafe7bc8265257"
}
},
{"title":"4.2 Clock",
"detail": {
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Apps/4.2-Clock_App.zip",
"md5":"8334f1ed2ec79efbe4199a86fda7ee58"
}
},
{"title":"4.2 Keyboard",
"detail": {
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Apps/4.2Keyboard_App.zip",
"md5":"de0d134795217b21ccbeb0f1b7dd3cdd"
}
}
]
},{
"title":"Bloat",
"thumbnailurl":"http://ms-team-hd.tectas.eu/images/Bloat.png",
"children": [
{"title":"Calculator",
"detail":
{"webpages": [
"http://ms-team-hd.tectas.eu/download.php?file=Addons/Bloat/Calculator_App.zip"
],
"md5":"6adbc0077f7aac1f25ed584cff5c4d0e"
}
},
{"title":"SPlanner",
"detail": {
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Bloat/SPlanner_App.zip",
"md5":"2949654d704a59cdbd17b7227b825d37"
}
}
]
},{
"title":"Themes",
"thumbnailurl":"http://ms-team-hd.tectas.eu/images/Themes.png",
"children": [{
"title":"Battery Mods",
"thumbnailurl":"http://ms-team-hd.tectas.eu/images/Battery.png",
"children": [
{"title":"Blue Battery",
"thumbnailurl":"http://ms-team-hd.tectas.eu/Addons/Battery/Images/BlueBattery.png",
"detail":
{"description":"Stock battery icon in blue made by raubkatze",
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Battery/BlueBattery_Mod.zip",
"md5":"f1bc5f90dc284df34fb0c8d2d9044330"
}
},
{"title":"Blue Battery Percentage",
"thumbnailurl":"http://ms-team-hd.tectas.eu/Addons/Battery/Images/BlueBatteryPercentage.png",
"detail": {
"description":"Stock battery icon in blue with percentage made by thisiskindacrap",
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Battery/BlueBatteryPercentage_Mod.zip"
}
},
{"title":"Blue Battery Circle",
"thumbnailurl":"http://ms-team-hd.tectas.eu/Addons/Battery/Images/BlueCircle.png",
"detail": {
"description":"Blue circle battericon with percentage in the center made by raubkatze",
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Battery/BlueCircle_Mod.apk", //apk extension will be read and the install dialog will pop up
"md5":"c43c2734846ced3db5ed5987d5647bae"
}
}
]
},{
"title":"Framework Themes",
"thumbnailurl":"http://ms-team-hd.tectas.eu/images/Apps.png",
"children": [{
"title":"Elegant Theme",
"detail": {
"describtion":"Eye-Candy Theme by ThilinaC",
"url":"https://docs.google.com/uc?export=download&confirm=no_antivirus&id=0B8AYcerB14i3YVBmTEM4b0tzOVU",
"md5":"5e0d5a4578f01cfa8b357e79193f070b"
}
},{
"title":"MS Team Blackbean Theme",
"detail": {
"description":"Black and white theme made by alvin551",
"url":"https://docs.google.com/uc?export=download&confirm=no_antivirus&id=0B8AYcerB14i3VmUwWTVKdWZ6UWM",
"md5":"93442e1fb4197e554ebdb1c8ff9c52a1"
}
},{
"title":"MS Team HD Theme",
"detail": {
"description":"Holo style theme. The theme is not originally created by MS Team HD, it uses parts of many other themes. All credits to the creators of the themes this is based on.",
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Themes/MS-Team-HD_Theme.zip",
"md5":"15eec7c80db7acbaccd939f827d806e9"
}
}
]
},{
"title":"Multiwondow Themes",
"children": [{
"title":"Multiwindow Blackbean",
"detail": {
"description":"Multiwindow theme made by alvin551",
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Themes/Flashbar-BlackBean_Mod.zip",
"md5":"4be1c0da1d77121de9627dd2570fee00"
}
},{
"title":"Multiwindow Black Glass",
"detail": {
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Themes/Flashbar-Glass-Black_Mod.zip",
"md5":"b8befba0558fdd954c8c73563761565c"
}
},{
"title":"Multiwindow Blue Glass",
"detail": {
"url":"http://ms-team-hd.tectas.eu/download.php?file=Addons/Themes/Flashbar-Glass-Blue_Mod.zip",
"md5":"d98c0cd04fc3240b372a78911a09c865"
}
}
]
}
]
}
]
Rom.json (which contains basically nothing less than a detailitem, means all optional properties used here can also be used at detail items within the Content.json):
Code:
{
"title": "MS Team HD", [B]//optional if parent item is present[/B]
"version": "9.0.1", [B]//optional[/B]
"description": "test", [B]//optional[/B]
"type": "zip", [B]//optional[/B]
"md5": "75a3a73d3ac941cc83f90dd80d000477", [B]//optional[/B]
"url": "http://ms-team-hd.tectas.eu/download.php?file=Rom/MS-Team-HD_9.0.1_XXEMA2.7z", [B]//optional[/B]
"webpages" : [
"http://forum.xda-developers.com/showthread.php?t=1886332",
"http://ms-team-hd.tectas.eu"
], [B]//optional[/B]
"images": [
"http://ms-team-hd.tectas.eu/Winscp-Screenshot.png"
], [B] //optional[/B]
"changelog": [
"change1",
"change2"
], [B]//optional[/B]
"developers": [
{ "tester": "" },
{ "tester2": "http://test" }
] [B]//optional[/B]
}
NOTE: if you simply want to take and alter this examples, remove the comments (everthing starting with //) they are not supported within json.
Is it open source?
Yes, the java packges are licensed under lgpl, which means they can be integrated within every other application without publishing the source, only if the code inside the packages themself is altered the code has to be published. I have chosen this approach in the open sense of android, everyone is allowed to fork/clone my github repository and do whatever he likes with the code, i just want possible fixes or enhancements to be public available for everyone (also fell free to send me pull requests if you like), that's at least my view of what open source means, all should work together to make the best out of something, if they like to, otherwise, take what is already served or find someone able to do the needed changes.
Wait, two repositories? Why the hell...
Well, it's pretty simple, the library part already includes everything which is needed to get the work done, except of one thing, the main activity. It "only" includes an generic abstract activity which serves the fitting implementations to get it's job done without taking into account how the main activity is build up (be it tabed, with lists or whatever). To make your own UI set up on this activity it serves abstract methods you have to implement to handle e.g. viewing the download queue, updating it while downloading,...
But that's as well only a nice to have and should give you more possibilities if you want to use them, if your fine with the tabed UI I built, simply take the application repository, override the resources you like (if you want to) and your already done. I also splitted it up for easier maintenance, the library part is generic and if something needs to be done another way you're able to by simply deriving from the given interfaces or classes itself within your application, the application itself is always specific (even when the differences can be close to none), so i would have to integrate the changes of the library part allover again to the different branches, if it would be included in one single repository, that way all is detached and much easier to maintain.
Common Information
The source itself can be found here (Application), here (library) and here (gradle base for android studio), feel free to send me pull requests
The generic apk is also available at the play store (NOTE: don't flash files from it unless you use a GT-I9300, also note the broken downloads are intended to show the different states).
Changelog
The full list of commits can be viewed here (application) and here (library)
1.0:
Changelist support (listing of updated, added, removed and downgraded packages at startup)
no additional file or work needed, except the present version property at items which should be able to show as downgraded or updated, everything else is done by the app itself
0.9.7.1:
Fixed Index out of bounds crash
Fixed 2 nullpointer crashes
Started to add changelist of content support (changelist of added or removed items from the remoterepository)
0.9.7:
Improved install logic
Improved build.prop property reading
Fixed wrong finished state at service while downloads still processing
0.9.6:
Fixed showing of restore menu item directly after backup;
Fixed caching/loading of download queue onStop/onRestart;
Fixed removing of cached queue onDestroy;
Fixed crash at add file dialog if it is closed before choosing an activity;
Fixed wrong "all finished respond" of service while still processing;
0.9.5:
Completely revised the structure of buildbox (is now splitted into 2 repositories, one for the library [includes the whole logic, main views,...] and one for the implementation of the main activity and for resource overriding [MainActivity, TabAdapter, ...)
Added device filter property (can be applied at every level except at the detail items) (uses the ro.product.model build.prop property for comparsion)
Many fixes and enhancements
0.9.3:
Fixed adding files from storage
Fixed crash at startup without internet connection available
0.9.2:
Apk handling fix
Recovery script fix
0.9.1:
Revised Install procedure for apks (thx to lowveld for the hint)
Fixed root shell command execution (sry)
small additional changes
Android Studio Guide
Get the Code
Get base repository
Code:
mkdir BuildBox && cd BuildBox
git clone https://github.com/tectas/buildbox-gradle-base.git .
Get Library
Code:
mkdir BuildBoxLib && cd BuildBoxLib
git clone https://github.com/tectas/buildbox-lib . && cd ..
Get App
Code:
[SIZE="3"]mkdir BuildBoxApp && cd BuildBoxApp
git clone [url]https://github.com/tectas/buildbox[/url] . && cd ..[/SIZE]
Import into android studio
Prerequesits:
Android Studio (obviously)
Android SDK Build-Tools rev. 18.1.1
Android SDK Platform Api lvl 14 & 18
If the prerequesits are met, simply open android studio, choose import project, go to the path you cloned the base repository in, choose the build.gradle file within the base repository folder, confirm and do the same at the next screen and your done.
The only thing needed to build BuildBox is to choose the BuildBoxApp directory within the project view and make or run it.
Update and screenshots attached to the first post, changelog at second.
Update also published to play store, will be available in some hours.
For those wanting to see an real life implementation of this app check this: https://play.google.com/store/apps/details?id=at.tectas.buildbox.msteam
(that's the implementation for the ms team hd rom for the i9300, additional content/tabs will be added within the next days [just to avoid confusion, at the server, app updates [if they happen and probably will] got nothing to do with the content itself], but you already get a pretty good feeling how it is).
Any feedback appreciated.
Gesendet von meinem GT-I9300 mit Tapatalk 2
Update to 0.9.7
Update published, attached and changelog updated.
0.9.7.1 Bugfix update
Bumped the version to 0.9.7.1, it's just a small bugfix update, but there is already a big update in the pipeline, stay tuned.
Changelog as always in second post or directly at github.
Oh, and sry for my long absence.
1.0 is here
I finally made it to the first major revision!
1.0 is here and brings changelist support with it. Almost nothing needed to use it, simply add the version property at items you like to be shown as up or downgraded, that's it, everything else is done internally and more important localy. The versions items,... are stored at an local sqlite database, when the server file has been retrieved the database content get's updated and compared with the old content to determine which items got removed, added, updated or downgraded.
What next, well, even while it is out of beta, it still isn't 100% bugfree, but at least about 95% (and the missing bug is view related, download,... work fine) and there are still additional features i like to add, so stay tuned.
Android Studio setup
Small change:
Added a base repository for the gradle files to build the apk with android studio, respectively at the terminal.
NOTE: the base repository takes BuildBoxApp and BuildBoxLib as the 2 subfolders for the library and application, if you like to use different ones, you have to change the names within the settings.gradle.
I also added the needed gradle files to the library and app repository.
Last but not least added a small guide on how to check out the repository for simple import to android studio.
why is this thread soooooo dead?
hisname said:
why is this thread soooooo dead?
Click to expand...
Click to collapse
Because no-one seems to be really interested to use it unfortunately and i got other things to do currently^^
Gesendet von meinem GT-I9300 mit Tapatalk
THis should have been on the front page of xda. I never knew this app existed.
Thread closed by OP Request.
Please see the continuation of the project here: http://forum.xda-developers.com/showthread.php?t=2543806
hello guys i need help with an apk i want to add a link in my apk for example "if u dont have ****launcher installed press here" and to redirect him to the specified web page
sorry if is a wrong thread
sorry for my bad english
cheers
Laurentiu27 said:
hello guys i need help with an apk i want to add a link in my apk for example "if u dont have ****launcher installed press here" and to redirect him to the specified web page
sorry if is a wrong thread
sorry for my bad english
cheers
Click to expand...
Click to collapse
Intents are used in Android to share or link across to other apps, including URLs. If you want to link to a Play Store page, read this documentation. Otherwise, consider implicit intents here.
This is what I would do. The below code is a function that you would call to determine if a certain apk(package) is installed. What is in bold is where you would place the package name to search for. You could take it a step further and and a String to pass to the function and it would make the function more useful by being able to check for multiple package names.
Code:
/**
* Determine whether the APK is installed.
* /
public boolean isApkInstalled(Context myContext) {
PackageManager myPackageMgr = myContext.getPackageManager();
try {
myPackageMgr.getPackageInfo("[B]com.apps.whatever[/B]", PackageManager.GET_ACTIVITIES);
}
catch (PackageManager.NameNotFoundException e) {
return (false);
}
return (true);
}
This code would be used to install a package. So in theory, you could call your isApkInstalled() function and if it returns false, then call this and present the option for the user to download. The bold is where you would change the package name to whatever package you are looking for.
Code:
/**
* Install the APK through the market: URI scheme.
* /
public void goToMarket(Context myContext) {
Uri marketUri = Uri.parse("market://details?id=[B]com.apps.whatever[/B]");
Intent myIntent = new Intent(Intent.ACTION_VIEW, marketUri);
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
myContext.startActivity(myIntent);
return;
}
zalez said:
This is what I would do. The below code is a function that you would call to determine if a certain apk(package) is installed. What is in bold is where you would place the package name to search for. You could take it a step further and and a String to pass to the function and it would make the function more useful by being able to check for multiple package names.
Code:
/**
* Determine whether the APK is installed.
* /
public boolean isApkInstalled(Context myContext) {
PackageManager myPackageMgr = myContext.getPackageManager();
try {
myPackageMgr.getPackageInfo("[B]com.apps.whatever[/B]", PackageManager.GET_ACTIVITIES);
}
catch (PackageManager.NameNotFoundException e) {
return (false);
}
return (true);
}
This code would be used to install a package. So in theory, you could call your isApkInstalled() function and if it returns false, then call this and present the option for the user to download. The bold is where you would change the package name to whatever package you are looking for.
Code:
/**
* Install the APK through the market: URI scheme.
* /
public void goToMarket(Context myContext) {
Uri marketUri = Uri.parse("market://details?id=[B]com.apps.whatever[/B]");
Intent myIntent = new Intent(Intent.ACTION_VIEW, marketUri);
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
myContext.startActivity(myIntent);
return;
}
Click to expand...
Click to collapse
thank u for your help
SimplicityApks said:
Intents are used in Android to share or link across to other apps, including URLs. If you want to link to a Play Store page, read this documentation. Otherwise, consider implicit intents here.
Click to expand...
Click to collapse
thank you
Hello again,
while I´m still working on my PDF to Office app I found out how to use <Capability Name="ID_CAP_OEM_DEPLOYMENT" />.
Using this capability lets you launch any deployed app within another app or lets you get the applist of all deployed apps (sadly less system apps like Office) including appname, uri, appicon and so on.
1. add
Code:
<Capability Name="ID_CAP_OEM_DEPLOYMENT" />
to your WMAppManifestXML
Add to your *xaml.cs file:
2.
Code:
using Windows.ApplicationModel;
using Windows.Phone.Management.Deployment;
3.
Code:
public Package GetPackageByID(string id)
{
return InstallationManager.FindPackages().FirstOrDefault(p => p.Id.ProductId.ToLower().Equals(id.ToLower()));
}
=> the code will return the package (app) you want to launch if it exists
4.
Code:
private void LaunchAR_Click(object sender, System.Windows.Input.GestureEventArgs e)
{
Package packageById = GetPackageByID("{134E363E-8811-44BE-B1E3-D8A0C60D4692}");
if (packageById != null)
{
packageById.Launch(string.Empty);
}
else
{
// do something if the app doesn´t exist
}
}
=> this sample code will launch Adobe Reader if the app is present on your device
With some simple modifications of the above code you will easyly be able to make visible the whole applist in a ScrollistViewer or Listbox.
=> this could be useful for coding a new AppData backup app for interop-unlocked devices.
Cheers
contable
contable said:
Hello again,
while I´m still working on my PDF to Office app I found out how to use <Capability Name="ID_CAP_OEM_DEPLOYMENT" />.
Using this capability lets you launch any deployed app within another app or lets you get the applist of all deployed apps (sadly less system apps like Office) including appname, uri, appicon and so on.
1. add
Code:
<Capability Name="ID_CAP_OEM_DEPLOYMENT" />
to your WMAppManifestXML
Add to your *xaml.cs file:
2.
Code:
using Windows.ApplicationModel;
using Windows.Phone.Management.Deployment;
3.
Code:
public Package GetPackageByID(string id)
{
using (List<Package>.Enumerator enumerator = new List<Package>(InstallationManager.FindPackages()).GetEnumerator())
{
while (enumerator.MoveNext())
{
Package current = enumerator.Current;
try
{
if (current.Id.ProductId.Contains(id))
return current;
}
catch (Exception ex)
{
}
}
}
return (Package)null;
}
=> the code will return the package (app) you want to launch if it exists
4.
Code:
private void LaunchAR_Click(object sender, System.Windows.Input.GestureEventArgs e)
{
Package packageById = GetPackageByID("{134E363E-8811-44BE-B1E3-D8A0C60D4692}");
if (packageById != null)
{
packageById.Launch(string.Empty);
}
else
{
// do something if the app doesn´t exist
}
}
=> this sample code will launch Adobe Reader if the app is present on your device
With some simple modifications of the above code you will easyly be able to make visible the whole applist in a ScrollistViewer or Listbox.
=> this could be useful for coding a new AppData backup app for interop-unlocked devices.
Cheers
contable
Click to expand...
Click to collapse
Yep! This is used in Samsung AppFolder
-W_O_L_F- said:
Yep! This is used in Samsung AppFolder
Click to expand...
Click to collapse
Exactly.
Do you you know how "InstallationManager.AddPackageAsync" works ?
contable said:
Exactly.
Do you you know how "InstallationManager.AddPackageAsync" works ?
Click to expand...
Click to collapse
I am hoping to learn that myself. I know that Nokia's "Extras & Info" app uses this API for their "SilentInstaller". Nokia's "SilentInstaller" has the ability to install interop-unlocked apps as long as they are fully and properly signed with the appropriate license.xml and wmprheader.xml.
Microsoft has some documentation about this API at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207248(v=vs.105).aspx
**EDIT**
Found it! (I think)
we can deploy apps with InstallationManager.AddPackageAsync(String title, Uri sourceLocation, String instanceId, String offerId, Uri license)
This info matches EVERYTHING that is included with a valid xap signed by Microsoft. All the data is contained in the xap's provxml, too (albeit in the wrong order)
Info about this "undocumented" api is at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662948(v=vs.105).aspx
The million-dollar questions are what privileges are required to access this API, and can we use it without interop unlock?
Really wishing I had my phone back! (won't be here until tomorrow)
Very nice, thanks for publishing! I was going to pull apart App Folder and see how it works myself; thanks for taking the time to do that for me and share it with us all!
For what it's worth, a foreach loop will read more cleanly than explicitly calling GetEnumerator() and then iterating over it, but the basic structure of the code is fine (and I think the MSIL is the same anyhow - foreach being just syntactic sugar - so they probably did it that way when actually writing the app and your decompiler just produced the more verbose version from the MSIL).
Note that this can also, of course, be used to create launcher apps. An alternative to the Start screen, potentially, even (with some other hackery to hook it in where needed). To use it in Backup apps, though, we'll need access to the app's storage folder too (or a way to activate the SeBackup privilege in the app's token...)
Well... already known when I decompiled samsung's app folder app.
---------- Post added at 12:37 PM ---------- Previous post was at 12:29 PM ----------
compu829 said:
I am hoping to learn that myself. I know that Nokia's "Extras & Info" app uses this API for their "SilentInstaller". Nokia's "SilentInstaller" has the ability to install interop-unlocked apps as long as they are fully and properly signed with the appropriate license.xml and wmprheader.xml.
Microsoft has some documentation about this API at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207248(v=vs.105).aspx
**EDIT**
Found it! (I think)
we can deploy apps with InstallationManager.AddPackageAsync(String title, Uri sourceLocation, String instanceId, String offerId, Uri license)
This info matches EVERYTHING that is included with a valid xap signed by Microsoft. All the data is contained in the xap's provxml, too (albeit in the wrong order)
Info about this "undocumented" api is at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662948(v=vs.105).aspx
The million-dollar questions are what privileges are required to access this API, and can we use it without interop unlock?
Really wishing I had my phone back! (won't be here until tomorrow)
Click to expand...
Click to collapse
see nokia extra+info app's capability
You can use Shell Chrome API directly to launch any URI, just 2 lines code
reker said:
You can use Shell Chrome API directly to launch any URI, just 2 lines code
Click to expand...
Click to collapse
So please post the two lines of code so that I can launch any URI without using a Toast.
DELETED
GoodDayToDie said:
Very nice, thanks for publishing! I was going to pull apart App Folder and see how it works myself; thanks for taking the time to do that for me and share it with us all!
For what it's worth, a foreach loop will read more cleanly than explicitly calling GetEnumerator() and then iterating over it, but the basic structure of the code is fine (and I think the MSIL is the same anyhow - foreach being just syntactic sugar - so they probably did it that way when actually writing the app and your decompiler just produced the more verbose version from the MSIL).
Note that this can also, of course, be used to create launcher apps. An alternative to the Start screen, potentially, even (with some other hackery to hook it in where needed). To use it in Backup apps, though, we'll need access to the app's storage folder too (or a way to activate the SeBackup privilege in the app's token...)
Click to expand...
Click to collapse
Here an improved code:
Code:
public Package GetPackageByID(string id)
{
List<Package> packages = new List<Package>(InstallationManager.FindPackages());
foreach (var cpackage in packages)
{
if (cpackage.Id.ProductId.Contains(id))
return cpackage;
}
return (Package)null;
}
Indeed to create an AppData Backup app we need access to the app´s storage folder first. Atm we only can copy files from the app´s storage folder with another RPCComponent discovered by -W_O_L_F-. But when the time comes a Backup app can be created in a few hours...
Oneliner (untested)
Code:
public Package LinqGetPackageByID(string id)
{
return InstallationManager.FindPackages().FirstOrDefault(p => p.Id.ProductId.ToLower().Equals(id.ToLower()));
}
jessenic said:
Oneliner (untested)
Code:
public Package LinqGetPackageByID(string id)
{
return InstallationManager.FindPackages().FirstOrDefault(p => p.Id.ProductId.ToLower().Equals(id.ToLower()));
}
Click to expand...
Click to collapse
Thanks. The oneliner works fine. :good:
Edit:
post #1 updated with the oneliner....
jessenic said:
Oneliner (untested)
Code:
public Package LinqGetPackageByID(string id)
{
return InstallationManager.FindPackages().FirstOrDefault(p => p.Id.ProductId.ToLower().Equals(id.ToLower()));
}
Click to expand...
Click to collapse
Is it also possible to check if an app is installed and if yes, which version? that would be nice...
gipfelgoas said:
Is it also possible to check if an app is installed and if yes, which version? that would be nice...
Click to expand...
Click to collapse
Yes. With this method you can get all informations about an installed package: version, publisher and so on...
I try to get shared preferences in the exposed class.
This is a straight forward issue in android java. I do not know whether the permissions are the problem but things are not as straight with Xposed.
Xposed asks to provide the name of the file and the package at init Zigote. I have tried many versions and none of them seems to work. Also, the file which I make may not be available when init Zygote is called, however, I take XposedBridge wants to just register the name of the file and, probably, to prepare to override some permissions when the file is created.
I also try to double the call to the Xposed Shared Method inside the hooked method. I check for the existence of the shared preference file before. Everything is there but the reload method does not seem to reload and the file is not read but defaults are loaded by getInt and getFloat.
There is probably something more to be done, although the examples I have seen do not do anything, yet they override other methods inside init Zygote which I do not need to do.
All I need is to read a simple file from an Xposed Module.
PLEASE, INFORM.
Here is what I have tried :
I have tried many different variation and XposedBridge methods for 4 hours. I have also
tried many name variations with and without .xml.
In the standard Java for Android, there is just one get method to read a shared
preferences file. This does not seem to be the case with exposed.
I do have :
@override
public void initZygote(StartupParam startupParam) throws Throwable {
MODULE_PATH = startupParam.modulePath;
prefs = new XSharedPreferences("PackageName", "SharedPreferenceFileNameWithotDotXml");
}
MODULE_PATH is not used, although I have tried many other methods where was.
Because the file changes on the fly, I called :
prefs.reload();
before I read the data. I tried without this call too. I also tried to get another
prefs before the reload :
prefs = new XSharedPreferences("PackageName", "SharedPreferenceFileNameWithotDotXml");
prefs.reload();
Then I try to read the data from the file :
theStart=prefs.getInt("Start", 2);
theValue=prefs.getFloat("Value", 102.0f);
I always get the defaults 2 and 102.0 although the file is there and the values of the
file are different. I have read the file.
In standard java for android philosophy, just the initialisation in init zygote and
prefs.reload() are sufficient to load the changing values of the shared preferences
file into prefs and then into the variables.
Xposed seems to be different.
I have been told there is a way to read the data from the file. I have tried most
anything and cannot. What is the way to do so. Must be simple and straight as in the
standard java for android. I must not do everything necessary.
Please, inform.
I have also tried to read the file manually from the Xposed class. Access denied. Tried
just in cases. Access denied, again.
Tried to make the shared preferences file with Activity.MODE_WORLD_READABLE. Still
access denied to be read manually.
Even with Activity.MODE_WORLD_READABLE, Xposed cannot read the file as previously
explained.
Tried :
@override
public void initZygote(StartupParam startupParam) throws Throwable {
prefs = new XSharedPreferences(TheNameOfTheXposedClass.class.getPackage().getName
());
prefs.makeWorldReadable();
}
Then, in the hooked method :
prefs.reload();
theStart = prefs.getInt("Start", 2);
theValue = prefs.getFloat("Value", 102.0f);
Still returns only the default, although the file is there. I think, in all attempts,
XSharedPreferences() cannot get the name of the package and or or the name of the file.
The file is in /data/data/NameOfPackage/shared_prefs/NameOfFile.xml
Tried :
@override
public void initZygote(StartupParam startupParam) throws Throwable {
prefs = new XSharedPreferences
("/data/data/NameOfPackage/shared_prefs/NameOfFile.xml");
prefs.makeWorldReadable();
}
with and without .xml
Still nothing.
PROBLEM SOLVED.
Thank you for your reply. Everything was WORLD READABLE : in the non Xposed class and in the Xposed class on a number of occasions.
Also, I have used the hard values for the package and path.
The problem was not related to Java and Android but to Android arrangements and how much Xposed can cope with. The Android permissions for to access the file from the Xposed class had to be elevated which is unusual but this is what solved the problem, I think. Someone also reported the same problem and the same solution : http://forum.xda-developers.com/xposed/development-xsharedpreferences-issue-t2931396
In the non Xposed class, I have used the same solution just with a hard coded path and file. After I make the shared preferences file in the non Xposed class, I gave more permissions by :
File theSharedPrefsFile;
theSharedPrefsFile = new File("/data/data/PackageName/shared_prefs/FileName.xml");
theSharedPrefsFile.setReadable(true, false);
This seems to have solved the problem.
I am not sure of how reliable the solution is, though. I still check in the Xposed class whethere there is such a file or not. I have not tested what happens when the file is not there initially. Must do.
theXposedCommunicationPreferenceFile = new File("/data/data/PackageName/shared_prefs/FileName.xml");
if (theXposedCommunicationPreferenceFile.exists() == false) XposedBridge.log("Check in hooked method cannot find the file");
Hope everything would be OK.
Even though everything should be OK, I am not sure how reliable the dependence of permissions is.
I have also tried the secure reload :
StrictMode.ThreadPolicy oldPolicy;
oldPolicy = StrictMode.allowThreadDiskReads();
try {
prefs.reload();
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
I am not sure how reliable this is either so I put another simple reload on top :
prefs.reload();
StrictMode.ThreadPolicy oldPolicy;
oldPolicy = StrictMode.allowThreadDiskReads();
try {
prefs.reload();
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
I think, neither of these has made any difference and the real solution was the higher permissions to access the shared preference file given in the non Xposed class, again :
File theSharedPrefsFile;
theSharedPrefsFile = new File("/data/data/PackageName/shared_prefs/FileName.xml");
theSharedPrefsFile.setReadable(true, false);
Pretty nasty problem and difficult to find solution although published in the XDA Forum the searchability of post in the said forum is not very good.
Yet another sleepless night.
StevenStanleyBayes said:
I think, neither of these has made any difference and the real solution was the higher permissions to access the shared preference file given in the non Xposed class, again :
Click to expand...
Click to collapse
I know this is a pretty old thread but I have elevated the permission level to 777 of both the dir and preferences file and yet cannot access the file from the xposedClass is there any chance you are still developing xposed modules and can help