Building your own ROM

Hey Jerry, I ran into an error last night that I couldn't for the life of me get past.
So, doing what every great developer doesn't do, I deleted my ~/android/system file. ;) (thinking that now because I've set up my repo, I can just sync from that and get everything back to the way it was.
But, an odd thing, when I had my repo, I edited a file that wouldn't let me make bacon, so that it would. Then I pushed that change to github, and I saw it go in successfully.
When I built from my repo today, it gave me the same error that I recieved before, even though I changed it. It wasn't so hard to change it again, but it got to me a little. How come I edited a file and it didn't go through in a repo sync?

Hopefully this was specific enough. I'm a git noob, in case you haven't noticed yet.. :)

Did you ever push your changes to your github?

Code:
<make some changes>
git commit -a -m "Commit message here"
git push origin

If you don't, then they won't be there when you sync.
 
And one more question while I'm at it.. (this is going to sound real stupid, lol)
How do you delete an apk from being in your build anymore?
I tried deleting it from /out/target/product/thunderc/system/app, but it just keeps showing up after make bacon.
I do realize that there is a directory that tells the terminal to put the apk in there, (hence the word "out")
but I can't find that directory for the life of me.
This will save a lot of my time with the process :)

The out directory is created in the build process. All files that end up there are referenced in the various make files. The main ones are /device/lge/thunderc/device_thunderc.mk and the common.mk and thunderc.mk files in the vendor tree.

Notice in some make files, they pull in other make files, so you have to work your up/down the chain to be sure a file wasn't included elsewhere (ex: livewallpapers I believe are referenced more than once).

Look for PRODUCT_COPY_PACKAGES and PRODUCT_COPY_FILES, those are the points of entry you need to edit.
 
  • Like
Reactions: rukin5197
Hey, I was wondering about the second bootlogo that comes up during boot, in this case, the Sprint logo on my LS670. How would I go about changing that to something else?
 
You have to extract the ramdisk, edit/replace the initlogo.rle, then repack the ramdisk, and finally use flash_image or pack it into an update zip to place it on your phone.

Asadullah has some video tutorials, should be easy to google. ;)
 
I made a few changes to the notification dropdown background chooser. I finally figured out how to use the built in cropping intent. Now users can choose an image via any app that supports the appropriate intent, ie gallery, filemanagers, and other apps. I also fully incorporated the code into CMParts rather than use a helper app. Changes will be pushed to github after a bit of testing. ;)

Here's the major code change to CMParts/src/com/cyanogenmod/cmparts/activities/UIStatusBarActivity.java:
Code:
 // begins at line 281 in my repo, yours will differ
       } else if (preference == mTransparentNotificationBackgroundPref) {
            int transparentNotificationBackgroundPref = Integer.parseInt(String.valueOf(newValue));
            if (transparentNotificationBackgroundPref == 5) {
                Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);
                intent.setType("image/*");
                intent.putExtra("crop", "true");
                intent.putExtra("scale", true);
                intent.putExtra("scaleUpIfNeeded", false);
                intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
                int width = getWindowManager().getDefaultDisplay().getWidth();
                int height = getWindowManager().getDefaultDisplay().getHeight();
                Rect rect = new Rect();
                Window window = getWindow();
                window.getDecorView().getWindowVisibleDisplayFrame(rect);
                int statusBarHeight = rect.top;
                int contentViewTop = window.findViewById(Window.ID_ANDROID_CONTENT).getTop();
                int titleBarHeight = contentViewTop - statusBarHeight;
                boolean isPortrait = getResources().getConfiguration().orientation ==
                    Configuration.ORIENTATION_PORTRAIT;
                intent.putExtra("aspectX", isPortrait ? width : height - titleBarHeight);
                intent.putExtra("aspectY", isPortrait ? height - titleBarHeight : width);
                try {
                    notificationBackgroundImage.createNewFile();  // this is set above to /data/data/com.cyanogenmod.cmparts/files/nb_background
                    notificationBackgroundImage.setReadable(true, false);
                    notificationBackgroundImage.setWritable(true, false);
                    intent.putExtra(MediaStore.EXTRA_OUTPUT,Uri.fromFile(notificationBackgroundImage));
                    intent.putExtra("return-data", false);
                    startActivityForResult(intent,REQUEST_CODE_PICK_FILE);
                } catch (IOException e) {
                    Log.e("Picker", "IOException: ", e);
                } catch (ActivityNotFoundException e) {
                    Log.e("Picker", "ActivityNotFoundException: ", e);
                }
            }
            mNotificationBackgroundColor.setEnabled(transparentNotificationBackgroundPref == 2);
            Settings.System.putInt(getContentResolver(), Settings.System.TRANSPARENT_NOTIFICATION_BACKGROUND,
                    transparentNotificationBackgroundPref);
            return true;
note- I cribbed a lot of this from the lockscreen background chooser ;)
 
Last edited:
  • Like
Reactions: cmerlyn
So I'm trying to fix the camera by using the liboemcamera.so from the VM670 folder for the LS670...

I know it worked for thekraven...but i'm getting an error on the make.

here it is:

Code:
packages/apps/Settings/src/com/android/settings/ConfirmLockFinger.java:181: cannot find symbol
symbol  : variable AuthentecHelper
location: class com.android.settings.ConfirmLockFinger.VerifyRunner
                    case AuthentecHelper.eAM_STATUS_LIBRARY_NOT_AVAILABLE:
                         ^
packages/apps/Settings/src/com/android/settings/ConfirmLockFinger.java:188: cannot find symbol
symbol  : variable AuthentecHelper
location: class com.android.settings.ConfirmLockFinger.VerifyRunner
                    case AuthentecHelper.eAM_STATUS_USER_CANCELED:
                         ^
packages/apps/Settings/src/com/android/settings/ConfirmLockFinger.java:195: cannot find symbol
symbol  : variable AuthentecHelper
location: class com.android.settings.ConfirmLockFinger.VerifyRunner
                    case AuthentecHelper.eAM_STATUS_UI_TIMEOUT:
                         ^
packages/apps/Settings/src/com/android/settings/ConfirmLockFinger.java:207: cannot find symbol
symbol  : variable AuthentecHelper
location: class com.android.settings.ConfirmLockFinger.VerifyRunner
                    case AuthentecHelper.eAM_STATUS_CREDENTIAL_LOCKED:
                         ^
packages/apps/Settings/src/com/android/settings/GfxEngineRelayService.java:62: incompatible types
found   : com.android.settings.GfxEngineRelayService.RelayReceiverServiceImpl
required: android.os.IBinder
        return new RelayReceiverServiceImpl();
               ^
packages/apps/Settings/src/com/android/settings/SecuritySettings.java:219: cannot find symbol
symbol  : variable PASSWORD_QUALITY_FINGER
location: class android.app.admin.DevicePolicyManager
                case DevicePolicyManager.PASSWORD_QUALITY_FINGER:
                                        ^
packages/apps/Settings/src/com/android/settings/SecuritySettings.java:410: cannot find symbol
symbol  : variable AuthentecHelper
location: class com.android.settings.SecuritySettings
                    case AuthentecHelper.eAM_STATUS_OK:
                         ^
packages/apps/Settings/src/com/android/settings/SecuritySettings.java:412: cannot find symbol
symbol  : method savedFingerExists()
location: class com.android.internal.widget.LockPatternUtils
                        if (!mLockPatternUtils.savedFingerExists()) {
                                              ^
packages/apps/Settings/src/com/android/settings/SecuritySettings.java:413: cannot find symbol
symbol  : method setLockFingerEnabled(boolean)
location: class com.android.internal.widget.LockPatternUtils
                            mLockPatternUtils.setLockFingerEnabled(false);
                                             ^
packages/apps/Settings/src/com/android/settings/SecuritySettings.java:417: cannot find symbol
symbol  : variable AuthentecHelper
location: class com.android.settings.SecuritySettings
                    case AuthentecHelper.eAM_STATUS_LIBRARY_NOT_AVAILABLE:
                         ^
packages/apps/Settings/src/com/android/settings/SecuritySettings.java:421: cannot find symbol
symbol  : variable AuthentecHelper
location: class com.android.settings.SecuritySettings
                    case AuthentecHelper.eAM_STATUS_USER_CANCELED:
                         ^
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.
42 errors
make: *** [out/target/common/obj/APPS/Settings_intermediates/classes-full-debug.jar] Error 41

Thats all I could get out of the terminal window.
 
Have you synced your repo recently?

The AuthentecHelper is a part of the new fingerprint unlock features they are slowly rolling in.
 
If you have set your android/default.xml with projects you forked from CM, then you need to pull the changes in manually from CM.

1st time only:
cd PACKAGE_DIRECTORY
git branch gingerbread
git checkout gingerbread
git remote add cyanogen git://github.com/CyanogenMod/PACKAGE_NAME_HERE.git
git pull cyanogen gingerbread

After you have done this once, you can just fetch/merge or pull from then on.

If you get conflict, go into the files listed and search for <<<<<<, there will be two sections, the code as it was before the merge, and the way it would be after the merge, you have to decide which code is what you need. Then you commit the resolved conflicts.

git commit -a -m "Synced with CM and resolved conflicts in frameworks/base"
(or some such message ;))
 
If you have set your android/default.xml with projects you forked from CM, then you need to pull the changes in manually from CM.

1st time only:
cd PACKAGE_DIRECTORY
git branch gingerbread
git checkout gingerbread
git remote add cyanogen git://github.com/CyanogenMod/PACKAGE_NAME_HERE.git
git pull cyanogen gingerbread

After you have done this once, you can just fetch/merge or pull from then on.

If you get conflict, go into the files listed and search for <<<<<<, there will be two sections, the code as it was before the merge, and the way it would be after the merge, you have to decide which code is what you need. Then you commit the resolved conflicts.

git commit -a -m "Synced with CM and resolved conflicts in frameworks/base"
(or some such message ;))

I forked the repos from IHO...so shouldn't I be syncing with your repo?

And also, will this fix my issue?
 
Even if you forked them from IHO, or my github, to get the changes from CM, you have to add the cyanogenmod remote and pull the changes in.

Blarf doesn't pull in changes more than once a week or two, so you have do do it manually in order to keep all projects in sync with CM. I sometimes have working chnges I haven't committed and so I put off syncing till I'm ready.

Notice that some projects are synced from CM by repo sync (default.xml) while others are synced from IHO or yours if you edited anything. Those not automatically synced from CM must be synced manually if their parent (IHO) repository hasn't already synced. ;)
 
Hey there, just wondering if anyone knows how to change the MOD Version to your own..I can't seem to figure it out...
 
Last edited:
vendor/cyanogen/products/cyanogen_thunderc.mk

Look near the bottom for PRODUCT_RELEASE_NAME

Alright, I found it, and it said IHO, changed it to something15525....

Made another zip...and for some reason it says thunderc_LS670 now instead of IHO before.

Doesn't say something15525...

Any ideas?

*EDIT* I'm trying a "make clean" and then another make bacon. Wish me luck!
 
Last edited:
Only way that can happen is if you accidentally select 5 after running lunch. ;)

Re-run . build/envsetup.sh, then lunch, and be sure to choose 4, then make clean, then make bacon, profit. ;)
 
Only way that can happen is if you accidentally select 5 after running lunch. ;)

Accidently? Which one should I have selected?

BTW, if this helps, i'm developing for and LG LS670 (Sprint Optimus S).

*EDIT* I think that the "make clean" should do it. I'll let you know.
 
Accidently? Which one should I have selected?

BTW, if this helps, i'm developing for and LG LS670 (Sprint Optimus S).

*EDIT* I think that the "make clean" should do it. I'll let you know.

Ohhh, I didn't realize that, 5 is correct for the LS670.

Here's the last four lines of device_thunderc.mk in mine:
Code:
#CYANOGEN_NIGHTLY := true
PRODUCT_RELEASE_NAME := BACKside-IHO
PRODUCT_VERSION_DEVICE_SPECIFIC :=
-include vendor/cyanogen/products/common_versions.mk
This produces a zip file with the following name after running make bacon:
update-cm-7.2.0-RC0-BACKside-IHO-KANG-signed.zip
 
Ohhh, I didn't realize that, 5 is correct for the LS670.

Here's the last four lines of device_thunderc.mk in mine:
Code:
#CYANOGEN_NIGHTLY := true
PRODUCT_RELEASE_NAME := BACKside-IHO
PRODUCT_VERSION_DEVICE_SPECIFIC :=
-include vendor/cyanogen/products/common_versions.mk
This produces a zip file with the following name after running make bacon:
update-cm-7.2.0-RC0-BACKside-IHO-KANG-signed.zip

What exactly does the

Code:
#CYANOGEN_NIGHTLY := true

do?
 
That's mainly for use with ROM Manager to determine the type of build being used.

IHO doesn't use ROM Manager, but you are free to build it in if you care to take the risks associated with it. ;)
 

Trending Posts

Forum statistics

Threads
956,694
Messages
6,969,526
Members
3,163,600
Latest member
Marabishi