[Xperia Z Q&A, Help & Troubleshooting] PhilAd:
Hi,

I'm trying to port AOSPA to the Xperia Z ... for my own usage, but I'd also share it to the community.

I've never done this before and after days of trying and editing files I'm getting a bit tired at the moment.

It would be great if someone could help me to get into it. All Porting Guides are different and most of them are using already precompiled files.

At the moment I get the error

Traceback (most recent call last):
File "../../base/android/jni_generator/jni_generator.py", line 1065, in <module>
sys.exit(main(sys.argv))
File "../../base/android/jni_generator/jni_generator.py", line 1061, in main
options.optimize_generation)
File "../../base/android/jni_generator/jni_generator.py", line 996, in GenerateJNIHeader
jni_from_javap = JNIFromJavaP.CreateFromClass(input_file, namespace)
File "../../base/android/jni_generator/jni_generator.py", line 507, in CreateFromClass
stderr=subprocess.PIPE)
File "/usr/lib/python2.7/subprocess.py", line 709, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1326, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
make: *** [/home/pa/git/aospa/out/target/product/c6603/obj/GYP/shared_intermediates/ui/gl/jni/Surface_jni.h] Fehler 1
make: *** Warte auf noch nicht beendete Prozesse...
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Is this helpful? I can provide some more information if needed.

Some of the steps I did so far:

repo init -u git://github.com/AOSPA/manifest.git -b kitkat

repo sync -j48

Followed this Guide to add Sony BLOBS and edited '.repo/local_manifests/sonyxperiadev.xml' to the following (Deleted some 'remove-project' lines because they have been not present)

<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="sony" fetch="git://github.com/sonyxperiadev/" />

<remove-project name="platform/hardware/invensense" />
<remove-project name="platform/hardware/akm" />

<project path="device/sony/lagan" name="device-sony-lagan" groups="device" remote="sony" revision="master" />
<project path="device/sony/c6603" name="device-sony-c6603" groups="device" remote="sony" revision="master" />
<project path="device/sony/sgp321" name="device-sony-sgp321" groups="device" remote="sony" revision="master" />
<project path="vendor/sony/dash" name="DASH.git" groups="device" revision="master" remote="sony" />
</manifest>

I also commented the following lines from 'device/sony/c6603/full_c6603.mk'

#TARGET_PREBUILT_KERNEL ?= kernel
#PRODUCT_COPY_FILES += $(LOCAL_PATH)/$(TARGET_PREBUILT_KERNEL):kernel

Compiling did not work with this lines. So i tried it without kernel. My idea would be to add other kernel sources like cm11 kernel. For my understanding this would mean, that I have to add 'device/sony/c6603/kernel' folder and insert the files from 'github.com/CyanogenMod/android_kernel_sony_apq8064/tree/cm-11.0'. After that I would edit the commented lines to

TARGET_KERNEL_SOURCE ?= kernel
PRODUCT_COPY_FILES += $(LOCAL_PATH)/$(TARGET_KERNEL_SOURCE):kernel

And uncomment them. Is this correct?

After that I copied 'vendor/pa/products/pa_mako.mk' to 'vendor/pa/products/pa_yuga.mk' and edited it to the following:

# Copyright (C) 2013 ParanoidAndroid Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Check for target product

ifeq (pa_yuga,$(TARGET_PRODUCT))

# Define PA bootanimation size
PARANOID_BOOTANIMATION_NAME := XHDPI

# OVERLAY_TARGET adds overlay asset source
OVERLAY_TARGET := pa_xhdpi

# Build paprefs from sources
PREFS_FROM_SOURCE ?= true

# Include ParanoidAndroid common configuration
include vendor/pa/main.mk

# Inherit AOSP device configuration
$(call inherit-product, device/sony/c6603/full_c6603.mk)

# Override AOSP build properties
PRODUCT_NAME := pa_yuga
PRODUCT_BRAND := Sony
PRODUCT_MODEL := C6603
PRODUCT_MANUFACTURER := Sony
PRODUCT_BUILD_PROP_OVERRIDES += PRODUCT_NAME=yuga BUILD_FINGERPRINT="Sony/C6603_1270-6697/C6603:42.2/10.3.A.0.423/WP5_rg:user/release-keys" PRIVATE_BUILD_DESC="C6603-user 4.2.2 10.3.A.0.423 WP5_rg test-keys"

endif

Now I added

add_lunch_combo pa_yuga-userdebug

to 'vendor/pa/vendorsetup.sh'

using make -j8 gives me:

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.4
TARGET_PRODUCT=pa_yuga
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
[COLOR="Red"]TARGET_ARCH_VARIANT=armv7-a-neon[/COLOR]
TARGET_CPU_VARIANT=krait
HOST_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.11.0-13-generic-x86_64-with-Ubuntu-13.10-saucy
HOST_BUILD_TYPE=release
BUILD_ID=KRT16S
OUT_DIR=/home/pa/git/aospa/out
============================================

I think the red line should be a bit different?