broodROM RC5 UsbSettings force close - General Questions and Answers

Hi to everyone,
I would like to reply to this post about a force close entering the UsbSettings in broodRom RC5 rev 1 & 2(prerelease).
Specifically the exception is this: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.UsbSettings}: java.lang.NumberFormatException: unable to parse '' as integer
Unfortunately I'm not able to post there since I've just registered my accout; I hope this is the best section to post and that someone will notice it anyway.
After a couple of hours of serious digging I found that the problem depends on the fact that build prop lacks:
Code:
persist.service.usb.setting=0
which sets the default mode (kies) for usb.
that value is requested by com.android.settings.UsbSettings.onCreate of Settings.apk
Code:
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
int i = Integer.parseInt(SystemProperties.get("persist.service.usb.setting"));
this.mUSB_mode = i;
---cut---
restoring the above line in build prop fixes the issue!

yota73 said:
Hi to everyone,
I would like to reply to this post about a force close entering the UsbSettings in broodRom RC5 rev 1 & 2(prerelease).
Specifically the exception is this: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.settings/com.android.settings.UsbSettings}: java.lang.NumberFormatException: unable to parse '' as integer
Unfortunately I'm not able to post there since I've just registered my accout; I hope this is the best section to post and that someone will notice it anyway.
After a couple of hours of serious digging I found that the problem depends on the fact that build prop lacks:
Code:
persist.service.usb.setting=0
which sets the default mode (kies) for usb.
that value is requested by com.android.settings.UsbSettings.onCreate of Settings.apk
Code:
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
int i = Integer.parseInt(SystemProperties.get("persist.service.usb.setting"));
this.mUSB_mode = i;
---cut---
restoring the above line in build prop fixes the issue!
Click to expand...
Click to collapse
Thanks! , I saw it before but didn't knew if this was the right fix^^

thanks for the solution..im sorry but im newbie but where to locate that in the script manager?im still learning about this android..thanks

The file is /system/build.prop, you need to be root to edit it and to mount /system read write.
Both things are enabled by default in broodrom, and any detail can be easily found by searching the forum.
Please note that this has nothing to do with scriptmanager and is best achieved though ADB.
If you have not the android SDK installed, maybe it would be better if you just wait Rev 2, which hopefully will integrate the fix

Colors fixes
Hi brood,
still posting here until I (if ever) reach 10 posts.
I've managed to fix color-issue (at least for most colors) in your rom by editing the twframework-res.apk.
It seems that samsung apps are using it instead of framework-res.apk.
The quickest way to improve the situation is modify .xmls that are using tw_color002 to use tw_color001 instead.
As you can see in /res/values/colors.xml tw_color002 is black while tw_color001 is white.
Obviously there is not one unique solution, but is more a matter of choosing the right palette to fit with the dark theme, either by changing color reference in each xml or by changing them all at once in /res/values/colors.xml
I hope this can help!

Related

[Q]c# / development questions (background-img, checkbox)

Hi
i work on my first app, the info-part is finished. now i want add a simple question/answer-part. the first part with button for answers and questions works fine, but with the checkboxes i have some problems.
i want two or three solutions for one question, wich can be choose if i am click on one of these checkboxes. the answer is showing up in MessageBox and work so far, but the checkbox don't be cleared!?
What i have to do, to clear the checkbox. please help me! i don't know so much about the source-code c#, so every explanation will help me! Thanks!
xaml.cs
Code:
private void checkBox6_Checked(object sender, RoutedEventArgs e)
{
MessageBox.Show("Richtig!");
checkBox6.?? = checkBox6.??;
}
private void checkBox7_Checked(object sender, RoutedEventArgs e)
{
MessageBox.Show("Richtig!");
checkBox7.?? = checkBox7.??;
}
xaml
Code:
<TextBlock Height="73" HorizontalAlignment="Left" Margin="13,489,0,0" Name="DerTextblock13" VerticalAlignment="Top" TextWrapping="Wrap" Width="436" FontSize="22">Question?</TextBlock>
<CheckBox Content="YES" Height="72" HorizontalAlignment="Left" Margin="5,518,0,0" Name="checkBox6" VerticalAlignment="Top" Checked="checkBox6_Checked" />
<CheckBox Content="NO" Height="72" HorizontalAlignment="Right" Margin="0,518,18,0" Name="checkBox7" VerticalAlignment="Top" Checked="checkBox7_Checked" />
Just need to change the IsChecked property.
checkbox6.IsChecked = false;
hi
thanks for your comment.. i have read and search about "checkbox6.IsChecked = false;" and test it, but it doesn't work. i got this error in attached image.. checkbox6 is in content not available, but there is in content the checkbox6 (Name="checkbox6" and Checked="checkBox6_Checked")..
so i still don't know, why i get this error.. sorry for my stupid question..
Control names are case sensitive. It should be checkBox6.IsChecked = false;
oh man, what a stupid error.. thanks, case sensitive was the right keyword!
how can i change background-image for other xaml-site
hi
i don`t want open a new thread, so i ask here.
new problem! how can i change the background-image for an other xaml-site?
i searched a lot and find a lot, but nothing show me exactly how i can realize this.
in the source-code below, you see that i can change the background-image for example on mainpage.xaml.
Now i want integrate in my setting.xaml and settings.xaml.cs the same checkboxes to change the background-image on the mainpage.xaml.
What i have to do? Thanks for help!
xaml.cs
Code:
private void checkBox2_Checked(object sender, RoutedEventArgs e)
{
Uri uriR = new Uri("image/angler.png", UriKind.Relative);
BitmapImage imgSource = new BitmapImage(uriR);
this.imagechange.Source = imgSource;
checkBox1.IsChecked = false;
}
private void checkBox1_Checked(object sender, RoutedEventArgs e)
{
Uri uriR = new Uri("image/new-background.png", UriKind.Relative);
BitmapImage imgSource = new BitmapImage(uriR);
this.imagechange.Source = imgSource;
checkBox2.IsChecked = false;
}
xaml
Code:
<CheckBox Content="Hintergrund" Height="72" Margin="54,-33,0,0" Name="checkBox2" Checked="checkBox2_Checked" Width="163" FontSize="18" />
<CheckBox Content="Hintergrund 2" Height="72" Margin="0,-33,49,0" Name="checkBox1" Checked="checkBox1_Checked" Width="187" FontSize="18" />
Well done very good
Not sure if it's the best way, but one option would be to store the value you want to use in IsolatedStorageSettings. Then, when the page loads, it checks the value in ISS and applies that background (in its OnNavigatedTo event handler is probably best).
GoodDayToDie said:
Not sure if it's the best way, but one option would be to store the value you want to use in IsolatedStorageSettings. Then, when the page loads, it checks the value in ISS and applies that background (in its OnNavigatedTo event handler is probably best).
Click to expand...
Click to collapse
thanks, i have found a code to read an image in IsolatedStorage.. see below..
but i got a error.. i found a example-project, all works fine and i can read a image-file from IsolatedStorage. but in my app it doesn't work and i got these error..
also i had added the namespaces in xaml.cs
using System.IO.IsolatedStorage;
using System.IO;
xaml.cs
xaml-code
Code:
<Image x:Name="imagechange" Margin="30,62,38,204" Stretch="Fill" />
<Button Content="lesen" Height="72" HorizontalAlignment="Left" Margin="269,533,0,0" x:Name="lesen" VerticalAlignment="Top" Width="160" FontSize="19" Click="lesen_Click" />
vs 2010 are showing no faults in debugmodus! But if i click on button "lesen", i got the attached error. Please, where is the fault or what i have to do now?
does anyone has a idea about my described problem. sorry for my stupid questions, but that's all new for me and i want to learn it..
Do you have actual file "logo.jpg" on your ISF? Insert before opening:
if (myIsolatedStorage.FileExists("logo.jpg"))
{
... your code ...
sensboston said:
Do you have actual file "logo.jpg" on your ISF? Insert before opening:
if (myIsolatedStorage.FileExists("logo.jpg"))
{
... your code ...
Click to expand...
Click to collapse
hi
i had added your comment to source-code.. now, nothing happen, if i click on the button for reading the file from isolated storage..
how can i add the file "logo.jpg" to isolated storage?? i thought, i only have to put the file to my current project, like i did it with other images and then i can save or read the file to isolated storage.
I think this must be the fault. How can manage it? thanks..
Code:
private void lesen_Click(object sender, RoutedEventArgs e)
{
BitmapImage bi = new BitmapImage();
using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
if (myIsolatedStorage.FileExists("logo.jpg"))
using (IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile("logo.jpg", FileMode.Open, FileAccess.Read))
{
bi.SetSource(fileStream);
this.imagechange.Height = bi.PixelHeight;
this.imagechange.Width = bi.PixelWidth;
}
}
this.imagechange.Source = bi;
}
jayjojayson said:
i had added your code in comment to source-code.. now, nothing happen, if i click on the button for reading the file from isolated storage..
how can i add the file "logo.jpg" to isolated storage??
Click to expand...
Click to collapse
You may try to:
- download image from network and save to isf;
- copy from resource stream to isf;
- manually upload file to the app ISF using ISETool.exe or third-party tool.
jayjojayson said:
i thought, i only have to put the file to my current project, like i did it with other images and then i can save or read the file to isolated storage.
Click to expand...
Click to collapse
Wrong assumption.
P.S. Try this (btw, it's a first google link!): http://technodave.wordpress.com/201...ge-for-local-html-content-on-windows-phone-7/
hi
thanks a lot, it works... the first comment you have written are right..
i only have to save it first to isolated storage, before i can read the file.
thanks for your explanation to add files to ISF.. i have serach for that topic, but found nothing that describe how to added to ISF.. thanks for the link... i will read this in the evening...
now i have to find out, how i can change a image on a other site(xaml). than i can change for example in my setting.xaml the background in the mainpage.xaml
every day i learn new things, that's really exciting...
jayjojayson said:
now i have to find out, how i can change a image on a other site(xaml). than i can change for example in my setting.xaml the background in the mainpage.xaml
Click to expand...
Click to collapse
Sorry, I didn't read the whole thread before answering; seems like you are digging in the wrong direction. You don't need to use ISF (but it was a good practice for you), all you need is just a dynamical binding.
I'm too lazy to type code sample for you but (he-he!), our good friend google.com returned a good link for you http://www.eugenedotnet.com/2011/05...-property-in-silverlight-and-windows-phone-7/
P.S. Experience to use google should be "the must" in developer's experience.
entry Text in new line
Hi
i use google, my best friend, for a lot of my questions. but sometimes i don't know the right searchkeywords to do what i want to do (like image binding).
i have a new small problem. in my app i have 4 textboxes, that i use to write in some data. These 4 textboxes, i write to isolated storage in a textfile and let them summarized showing up in a textblock. This works fine.
Now, if i want write a new entry, these entry is written directly after the first entry.
example like is insert in textblock
Code:
▷Text - Text - Text - Text| ▷Text - Text - Text - Text|
But i want that the entry is written in a new line? How can i do this?
example like i want it
Code:
▷Text - Text - Text - Text|
▷Text - Text - Text - Text|
i know that i can create new lines with \n , \r\n and Environment.NewLine.
Code:
IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
//create new file
using (StreamWriter writeFile = new StreamWriter(new IsolatedStorageFileStream("fangbuch.txt", FileMode.Create, FileAccess.Write, myIsolatedStorage)))
{
string someTextData = text.Text + "▷" + datum.Text + " - " + fisch.Text + " - " + größe.Text + "cm" + " - " + gewicht.Text + "Kg" + " | " + "\r\n";
writeFile.WriteLine(someTextData);
writeFile.Close();
}
if i use one of the elements to create a new line, like is showing in code above, the new (second) entry overwrite the first entry. What can i do now? thanks for your help.
You're using FileMode.Create, which will overwrite an existing file. You need to either use FileMode.OpenOrCreate and then seek to the end of the file, or you need to use FileMode.Append (this is the preferred approach).
Additionally, the StreamWriter.WriteFile function automatically appends a newline for you. There's no need to have them manually placed at the end of your text string.
http://msdn.microsoft.com/en-us/library/system.io.filemode.aspx

Detection of key-pressing at boot-time.

Hi good people of N7 land,
I wanted to ask if it's possible to make keys get detected at boot-time so that a certain function is carried out. If so how?
For example:
The N7 is booting up. I press the Vol + key, and due to a script executed by the init.delta.rc, /system is mounted to a IMG file in the sdcard. A dual-boot mod.
I also ask if this is the best way to do this, and please for the love of God, don't point me to MultiROM. I want to work on my own mod.
I expect helpful answers. And if you can't answer my question, don't even bother posting here.
Although this is a question, this is more dev-related than anything I've encountered in the Q/A section. So I thought of posting it here.
Please move this if this is not the right place, and accept my apologies.
sgt. meow
I don't think this is possible using just some script - init has no way to get input events from keys, so you would have to either edit the init binary or use exec init command.
You could use it to run another binary, which would check if volwhatever is pressed and either did nothing or did the dual-boot stuff.
It depends on when you want to check for the keypress, because if it is after the /system partition is mounted, you could use busybox and run bash script, otherwise it would have to be real binary, because when init is started, you have pretty much "just" kernel running and no userspace.
Or you could pack busybox to boot.img, but if you can code, the binary is pretty easy to make.
@up
Exactly the kind of answer I was hoping to find. Sucks to realize that I still don't know a lot of coding. But I'm willing to learn if you could point me to the right direction.
sgt. meow said:
Hi good people of N7 land,
I wanted to ask if it's possible to make keys get detected at boot-time so that a certain function is carried out. If so how?
For example:
The N7 is booting up. I press the Vol + key, and due to a script executed by the init.delta.rc, /system is mounted to a IMG file in the sdcard. A dual-boot mod.
I also ask if this is the best way to do this, and please for the love of God, don't point me to MultiROM. I want to work on my own mod.
I expect helpful answers. And if you can't answer my question, don't even bother posting here.
Although this is a question, this is more dev-related than anything I've encountered in the Q/A section. So I thought of posting it here.
Please move this if this is not the right place, and accept my apologies.
sgt. meow
Click to expand...
Click to collapse
The first idea that comes to my mind would be to code a simple no-UI app which would use a Service executed by a BroadCastReceiver set to BOOT_COMPLETED.
Then, when triggered (=at boot-time), the service would wait for the user to press a defined key (i.e : volume up). When the service receives the key press, it would mount /system or whatever you wanna do, then stop running (so that other volume up presses don't trigger this event again).
The code could be something like :
Your AndroidManifest.xml :
Code:
< ?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sgtmeow.boot.service"
android:versionCode="1"
android:versionName="1.0">
< uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
< application android:icon="@drawable/icon" android:label="@string/app_name">
< service android:name=".BootService">
< intent-filter>
< action
android:name = "com.sgtmeow.boot.service.BootService">
< /action>
< /intent-filter>
< /service>
< receiver android:name=".BootReceiver">
< intent-filter>
< action
android:name ="android.intent.action.BOOT_COMPLETED">
< /action>
< /intent-filter>
< /receiver>
< /application>
< uses-sdk android:minSdkVersion="8"
android:targetSdkVersion="17"android:targetSdkVersion="17" />
< /manifest>
BootReceiver.java :
Code:
package com.sgtmeow.boot.service;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
public class BootDemoReceiver extends BroadcastReceiver {
@Override
public void onReceive(final Context context, final Intent bootintent) {
Intent mServiceIntent = new Intent();
mServiceIntent.setAction("com.sgtmeow.boot.service.BootService");
context.startService(mServiceIntent);
}
}
BootService.java
Code:
package com.sgtmeow.boot.service;
import java.io.DataOutputStream;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
import android.view.KeyEvent;
import com.sgtmeow.boot.service.BootReceiver;
public class BootService extends Service {
Runtime mRuntime;
Process mProcess = null;
DataOutputStream mOutput = null;
@Override
public IBinder onBind(final Intent intent) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
}
public boolean onKeyDown(int keyCode, KeyEvent event) {
super.onKeyDown(keyCode, event);
if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {
mountSystem();
Log.w("SGT.MEOW", "Volume Up has been pressed");
return true;
}
return true;
}
public void onStartCommand(final Intent intent, final int startId) {
super.onStartCommand(intent, startId, startId);
mountSystem();
}
private void mountSystem() {
Runtime.getRuntime();
// The service is now started, ask for root and mount /system using
// busybox (or not)
try {
mProcess = mRuntime.exec("su");
mOutput = new DataOutputStream(mProcess.getOutputStream());
mOutput.writeBytes("busybox mount -o remount,rw /system");
mOutput.flush();
stopService(new Intent(BootService.this, BootReceiver.class));
} catch (Exception e) {
Log.e("SGT.MEOW", "An Error Has Occured", e);
e.printStackTrace();
}
}
}
EDIT : unfortunately after some research I found out that Services cannot act as an onKeyListener, you'll have to call an activity to actually listen to the keypress so maybe just a dialog or something, but you won't be able to do it completely UI-less this way, my bad.
This is not something i would attempt to if you dont know what your doing due to the chance of bricks. but your best bet would be to luanch a binary from early init in the ram disk
aaronpoweruser said:
This is not something i would attempt to if you dont know what your doing due to the chance of bricks. but your best bet would be to luanch a binary from early init in the ram disk
Click to expand...
Click to collapse
I know how to launch the binary during init. The binary is the problem I am running into.
Thanks though.
You might want to take a look at how custom recoveries on the Xperia T handles the initial recovery vs. boot selection. On that device, there is no recovery partition, so a single kernel image must support both recovery and normal operation. The bootloader doesn't support an "enter recovery" poweron keycombo, so on the T there are some tricks so that at boot, it:
Sets the LED to purple
Waits 3 seconds or so
If the VolUp key is pressed during those 3 seconds, boot to recovery
Otherwise, boot normally
I believe the same approach is also used on the Xperia Z.
Maybe you could have a custom recovery that allows this? TWRP and CWM Touch both have source code available that you can check out so you can make your own recovery, which could allow booting of separate ROMS. Recoveries generally boot faster than full ROMs.
That's not what I was aiming to achieve. If I can manage to map the keys and find a way to detect them at boot-time, the rest is easy as pie. . Thanks though.
Entropy512 said:
You might want to take a look at how custom recoveries on the Xperia T handles the initial recovery vs. boot selection. On that device, there is no recovery partition, so a single kernel image must support both recovery and normal operation. The bootloader doesn't support an "enter recovery" poweron keycombo, so on the T there are some tricks so that at boot, it:
Sets the LED to purple
Waits 3 seconds or so
If the VolUp key is pressed during those 3 seconds, boot to recovery
Otherwise, boot normally
I believe the same approach is also used on the Xperia Z.
Click to expand...
Click to collapse
sgt. meow said:
That's not what I was aiming to achieve. If I can manage to map the keys and find a way to detect them at boot-time, the rest is easy as pie. . Thanks though.
Click to expand...
Click to collapse
None of the phones made by Sony have a recovery partition so they have to use a work around to detect keys on boot up. This is what all Xperia devices do to get into recovery: on boot check to see if the desired key is being pressed and if it is unzip the recovery, if it isn't being pressed unzip the normal ramdisk. (I'll post the ramdisk here for you to see how everything works yourself) So with the Xperia Play CyanogenMod kernel that I have how it works is it has two .cpio files. One for the ramdisk and one for the recovery. It uses a .sh file in the sbin to check if keys are being pressed by using /dev/input/event# which in most cases is event1 for volume down (on Nexus 7 the is event0, event1, and event2. My guess is 0 = power button and one and two are vol + and vol -). It then has a link to the init.sh in the root of the ramdisk called init so that when the kernel starts and calls init it starts the script. So what you could do is the same but instead of having two .cpio files you could rename the init file to something else then place the script and link in your ramdisk so that when the key is pressed it calls both what you want to do and the rename init executable. (Not sure how well this would work this is just an idea, if not depending on what you want to do you can keep the compressed ramdisk idea...)
Here is a ramdisk of what I've been talking about that is pulled from my kernel (extracted from an already compiled kernel to make it easy read.):
Link
It's made for the Xperia Play so it also tries to start the LED and vibrator to tell you when to click the Vol - key so how you would tell people to click it on the Nexus 7 I'm not sure...probably just have to have people will just have to spam the key. If you have any questions feel free to ask or if this didn't help I'm sorry just an idea.
Also what it seems like you want to do with the dual boot mod being with the SDCard sounds a lot like what a guy named CosmicDan did on the Xperia Play. You had to change the updater-script in your flashable zip but it worked. Here is the thread: Turbo Kernel and the source code to his kernel: GitHub
I know what he did with his kernel. I am working on something similar to the HD2 dual boot method. Haven't had any success yet.
Sent from my Nexus 7 using xda app-developers app
sgt. meow said:
I know what he did with his kernel. I am working on something similar to the HD2 dual boot method. Haven't had any success yet.
Sent from my Nexus 7 using xda app-developers app
Click to expand...
Click to collapse
hi! were you able to solve this?
thanks!

[GUIDE][4.4][rooted] How to force enable low RAM mode and status bar transparent

I've heard somebody told that they had to disable low RAM function in Kitkat to enable status bar transparent. So in this post, I'll show you how to enable low Ram but the status bar still can be transparent when you're in launcher or lockscreen
First, we need:
- your phone rooted, deodexed running android 4.4+
- Nandroid backup (very important)
- Apktool and you know how to use it
- Notepad++
Ok, so let's start:
Step 1: copy these file from your phone to your computer:
/system/framework/framework.jar
/system/priv-app/SystemUI.apk
/system/build.prop
Step 2: open build.prop in notepad++, find this line:
Code:
ro.config.low_ram=
if it say "true", skip to step 4
if it say "false", just change to "true" and reboot your phone
if you can not find this line, or nothing change after you changed it to "true" and reboot, follow step 3
Step 3: (force enable low Ram)
Add this line to your build.prop
Code:
ro.config.low_ram.mod=true
Now use apktool to decompile your framework.jar
Navigate to \framework.jar.out\smali\android\app\ActivityManager.smali, open it in notepad++
Find this line:
Code:
ro.config.low_ram
And change it to
Code:
ro.config.low_ram.mod
Compile, push it back to your phone and reboot
Wait until your phone booted up
Step 4: (force enable status bar transparent)
Decompile SystemUI.apk
Navigate to \SystemUI\smali\com\android\systemui\statusbar\phone\BarTransitions.smali
find these line:
Code:
invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z
move-result v0
Change it to
Code:
const/4 v0, 0x1
Compile and push it back to your phone
Done :highfive:
Sorry for my bad english. This is my first post since I used xda. Hope you like it!
Thank you for your post
Bro I'd love to have this, but my de-recompiling skills are next to 0. If I upload the files, would you mind doing it for me? Thanks ?
Inviato dal mio Xperia U utilizzando Tapatalk
Bert98 said:
Bro I'd love to have this, but my de-recompiling skills are next to 0. If I upload the files, would you mind doing it for me? Thanks ?
Inviato dal mio Xperia U utilizzando Tapatalk
Click to expand...
Click to collapse
Please check your code again. You saw that error when you compile framework-res or SystemUI?
I was able to do the changes up to the framework.jar and also edited systemui.apk but got systemui force close at boot. One question though I got odexed systemui.apk that has a systemui.odex do I need to deodex them at a single systemui.apk? either way I tried them both but same, results to force close hoping for help in this one :good:
For those on Lollipop or above:
I was poking around in the Android Source when i found these two functions
Code:
/**
* Used by persistent processes to determine if they are running on a
* higher-end device so should be okay using hardware drawing acceleration
* (which tends to consume a lot more RAM).
* @hide
*/
static public boolean isHighEndGfx() {
return (!isLowRamDeviceStatic() &&
!Resources.getSystem().getBoolean(com.android.internal.R.bool.config_avoidGfxAccel))
|| isForcedHighEndGfx();
}
/**
* @hide
*/
public static boolean isForcedHighEndGfx() {
return SystemProperties.getBoolean("persist.sys.force_highendgfx", false);
}
So, to enable high end graphics, all you have to do is set a new property "persist.sys.force_highendgfx" to true and it should work
Tried and working
Cheers!
Technohacker
If the original code of the option is "ro.config=low_ram" why add a ".mod" in the end of the code when adding it to build.prop? Will that still have any effects? Sincr i dont have that option available in build.prop
And in what part of the build.prop should i put the code?
What other .jar files or other files contain the code? Only framework.jar? What about the services.jar??
Bootloop on Android 11

How to Port Samsung Rom to other Samsung devices (Small Update as of 10/13/2018)

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
(Success Stories)
jonathanmohamed said:
I have successfully ported s7 and n7 firmware using this guide.
Awesome guide!. 9/10
Click to expand...
Click to collapse
corsicanu said:
@malbert16442 this is pure GOLD. Gave you all my thanks for today. I'll try it myself today. Also waiting patiently for updates [emoji28] . Cheers!
Click to expand...
Click to collapse
armaowl said:
is the reason i was allowed me to port my own Rom!
Click to expand...
Click to collapse
1. Kernel is second most important because it determines if rom boots or whether
we could access a log.
2. Since we are trying to boot a rom not meant to be on our device, it could be alittle hard getting this thing to run.
3 Contact a kernel dev and ask them for adb insecure kernel or a kernel with usb debugging enabled at boot. This will help us obtain those logs at boot.
4. In some rare cases Logs might show that specific kernel services are not accessible.
In this case we only change the init.environ.rc. Which has the frameworks needed to boot.
5. If you can't get kernel logging at boot use this in recovery after 2 mins of booting.
Code:
adb pull /data/tombstones
6.Update
DaKillaz98 said:
Hello All! I am posting this fix because on my Note Edge, I wasn't able to get logcat or adb access at boot, no matter what property I set, it didn't work. I finally figured out a way to get true logcat right as the boot animation comes up.
First off, you NEED Notepad++ if you don't want garbage clumped up editing.
1. In Android Image Kitchen, depack the Boot image.
2. Then, go to split image and modify boot.img-cmdline and add
Code:
buildvariant=userdebug
.
3. Save that file, then go to the ramdisk folder and edit your default.prop. change these values.
Code:
ro.secure=1 > ro.secure=0
ro.adb.secure=1 > ro.adb.secure=0
ro.debuggable=0 > ro.debuggable=1
4. Save that file, then go to init.rc, and use find to search for adbd to jump to this.
Code:
# adbd is controlled via property triggers in init.<platform>.usb.rc
5. Change the original code from
Code:
service adbd /sbin/adbd --root_seclabel=u:r:su:s0
class core
socket adbd stream 660 system system
disabled
seclabel u:r:adbd:s0
TO:
service adbd /sbin/adbd --root_seclabel=u:r:su:s0
disabled
socket adbd stream 660 system system
seclabel u:r:adbd:s0
6. Change this to new code.
Code:
# adbd on at boot in emulator
on property:ro.kernel.qemu=1
start adbd
TO:
# allows adbd at boot with property trigger below
on property:ro.debuggable=1
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 04E8
write /sys/class/android_usb/android0/idProduct 6860
write /sys/class/android_usb/android0/functions adb
write /sys/class/android_usb/android0/enable 1
start adbd
7. Rebuild the kernel and install in TWRP or however you install kernels, ADB will be accessible right at boot so nothing is lost during logging. If your kernel doesn't need this, don't bother, but if like me, you couldn't get anything, this will fix your issues.
In some cases, you will still need to push adb_keys to /data/misc/adb/, however.
@malbert16442 Please consider putting this in OP for those who have issues getting logcat at boot.
Click to expand...
Click to collapse
Part 2
Adb is key in any port. Adb is the secret. It gives us the ability to access logs be able to debug issues in our ROM.
1. Download adb drivers
http://forum.xda-developers.com/showthread.php?p=48915118#post48915118
Thanks Member @Snoop05
2. Test adb by using 'adb devices" in cmd
You should see online
3. If offline try using adb kill-server and repeat step 2.
4. When making a loging for these ports we use the phrase adb logcat *:E > filename
this ensures that we filter the logs by errors and remove the long set of lines like thermal updates ...etc
Part 3
In order to port firmware
1. Download Stock firmware extract it with tool
Websites to get stock firmware are
http://updato.com/firmware-archive-select-model
or https://forum.xda-developers.com/galaxy-tab-s/general/tool-samfirm-samsung-firmware-t2988647
2.We will deodex our rom using Fulmics or similar deodexer
Either a kitchen like "http://forum.xda-developers.com/chef-central/android/kitchen-superrs-kitchen-t3202296/page26" or similar.
Thanks @SuperR
https://forum.xda-developers.com/android/software-hacking/tooll-03-12-fulmics-deodexer-1-0-t3512081
Thanks @xpirt
3. Learn how to use APK DECOMPILE TOOLS SUCH AS TICKLEMEANDRIOD
http://forum.xda-developers.com/showthread.php?t=1633333
Thanks @Ticklefish
4. Remove Apps Priv-app and Framework of base. In a new folder use Fulmics to deodex this. Store somewhere safe.
5. Deodex Port and copy the Apps, Framework and Priv-app into the Base of stock rom.
6. In Ticklemeandriod you notice we have 6 work Areas. For our Roms we will only need two. The most common files we will use are services.jar, and framework.jar.
7. Take the services and framework our our Port and decompile in work area 1.
8. Take the services and framework of our Base and decompile in work area 2.
9. We will Perform a quick Step to help if App signatures become corrupt or cannot be read.
Follow this guide by @ikrom
http://forum.xda-developers.com/showpost.php?p=62496153&postcount=2957
10. After this lets move to debugging our apps and frameworks.
Part 4 (Tools and debugging)
My favorite tools to use include WinMerge and FileSeek
1. Winmerge enables us to compare two files. For example a stock jar and one of our port.
2. File seek allows us to search for a specific references.
I use file seek to search for weird terminology I see on my log.
3. Terminology
Part 5 ( Terminology)
1. In a logcat we are looking for three things when debugging. "E JavaBinder:", "E art", "E AndroidRuntime: FATAL EXCEPTION:"
2. The order to debug we search in logcat. When beginning it is not specific but, I usually search for Art errors first.
3. So for example if I get in my logcat
Code:
"01-01 01:26:25.169 5599 7183 E JavaBinder: java.lang.NoSuchMethodError: No virtual method activityPauseTrigger(Landroid/content/Intent;Landroid/content/pm/ActivityInfo;Landroid/content/pm/ApplicationInfo;)V in class Lcom/android/internal/app/ActivityTrigger; or its super classes (declaration of 'com.android.internal.app.ActivityTrigger' appears in /system/framework/framework.jar:classes2.dex)"
I got the location which is framework jar Class2
Code:
activityPauseTrigger(Landroid/content/Intent;Landroid/content/pm/ActivityInfo;Landroid/content/pm/ApplicationInfo;)V is the missing info in the port smalis and
log says it is somewhere in
Code:
Lcom/android/internal/app/ActivityTrigger; or the files with idential names to Activity trigger
4. In this case missing method could be found in stock smali. This is where we use win merge to cleanly copy new method from stock to port.
5. But Mike what if The logcat doesnt tell me location. We will then use fileseek in this instance.
Example: Log tells me
Code:
"01-01 00:24:17.509 7524 7539 E JavaBinder: java.lang.UnsatisfiedLinkError: No implementation found for void com.android.internal.app.ActivityTrigger.native_at_pauseActivity(java.lang.String) (tried Java_com_android_internal_app_ActivityTrigger_native_1at_1pauseActivity and Java_com_android_internal_app_ActivityTrigger_native_1at_1pauseActivity__Ljava_lang_String_2)
"
No implementation means that we must remove this file as it is not found in the libs. What location? We dont know yet ?
Code:
com.android.internal.app.ActivityTrigger.native_at_pauseActivity(java.lang.String
is what we are looking for
According to fileseek I would look for pauseActivity because it is a keyword
According to file seek I may get 100 references but I see one that says
Code:
.method ActivityTrigger.native_at_pauseActivity
I would then use winmerge to cleanly delete/copy the file from my stock smali to the new one. From the location I found in Fileseek.
6. Let me give a example of a Runtime error.
Code:
"07-25 09:17:08.975 16379 16379 E AndroidRuntime: java.lang.NoSuchMethodError: No interface method setDataFromNSFLP(ILandroid/os/Bundle;)V in class Landroid/location/ILocationManager; or its super classes (declaration of 'android.location.ILocationManager' appears in /system/framework/framework.jar)
So log told us to look in framework for a file with
Code:
setDataFromNSFLP(ILandroid/os/Bundle;)V
Boot up file seek and repeat steps above.
Part 6
So we booted now what.
Lets now work on fixing local errors.
Use logcat to possible fcs and reboots.
All firmware edits are different so this guide will help if you are learning the way android works.
What to look out for
Remember the Base folder we deodexed. We will use this to help fix issues in our rom.
1. Take the McRegistry Folder and ffffffff0000000 File move this to our booted rom.
2. Now in the Ported firmware copy the Fonts folder and the files named font in /etc to our booted rom.
3. Delete these folders - " preloadedmdm ", " sipdb " and " tts from booted rom and replace with that from ported firmware.
4. Open " Media " folder in booted rom
Delete Audio folder
Replace with Ported firmware audio folder.
5. In /etc/permission add the missing software permissions not hardware like slocation or camera-flash.
6. In build-prop
Replace these values with that of port.
Code:
ro.build.scafe.size=
ro.build.scafe.shot=
ro.build.scafe.cream=
ro.build.scafe.version=
ro.com.google.gmsversion=
ro.build.version.sdl=
ro.config.ringtone=
ro.config.notification_sound=
ro.config.alarm_alert=
ro.config.media_sound=
ro.config.ringtone_2=
ro.config.notification_sound_2=
7. Add this code to build-prop
Code:
wlan.wfd.hdcp=disable
Let's Fix Messages and Phone FCS on first boot
1. From ported from take the libselinux.so to fix message fcs
2. To fix Phone fcs take the mapconprovider.xml from port
64 bit firmware to 32bit
1. Replace 64 bit libs with 32 bit alternatives.
2. You could find 32 bit libs in 32 bit firmware.
32bit all that could be found will be attached here for all users
Fix location problems in Rom
With our services.jar decompiled take these smalis from base and use Winmerge to copy to Port jar.
Code:
services.jar\smali\com\android\server\location folder to that of port
also take the
Code:
services.jar\smali\com\android\server\LocationManagerService$xxx
Smalis and move from base to port location.
1. Take NFC.apk and Bluetooth.apk from base and move to new Rom folder.
OR A more complex NFC fix would be to look in PackageManagerService.smali
of services.jar
look for the NFC model of the device you are porting from
1. So use FileSeeker
to search for method with "supportNfc"
2. Replace it with your model number.
Example the NFC number of Note 7 is S3FWRN5
I would replace it with the NFC number of S5 which is NXP_PN547C2
Blur
https://forum.xda-developers.com/showpost.php?p=69547250&postcount=10031
AOD FRAMEWORK FIX
Credits :
@Patrick.H (NX Team)
@karkasss (NX Team)
@Develoid ALT and F4 (AOD touch / Bluelight filter fix)
@asc1977, @DaOldMan (AOD brightness control)
(Please copy & paste when you add our credits)
Download this file extract to services.jar
https://mega.nz/#!KgMxwQDR!g0yy7a6Izk8U8szRsggaZAXLaF4pjSMYAc8p6kOjIs4
Compare the PowerManagerService Smails.
then recompile
OR
thanks @oluwaponmile
follow this guide
https://forum.xda-developers.com/showpost.php?p=69594939&postcount=8139
Lets fix ported Cameras
Code:
[SIZE="3"]GUIDE IS IN PROGRESS[/SIZE]
Debug solution not fix:
This will be a hard thing to accomplish. Also make sure that Camera is recompiled using New signatures.
First lets find the native resolutions of your camera. For this we look in native camera apk.
Find the native resolutions in arrays or strings xml.
Save resolutions found in port apk for later reference. These are the values we are going to replace with stock hexadecimal values.
Use a Decimal to Hexadecimal Converter to find the values for the resolutions in smali.
For example 1080 would be 438 and 1920 would be 780.
For this value we will intrepid the hexadecimal value as 0x438 and 0x780 respectively in andriod.
When we are looking for the resolutions in port apk we grep the values based on the hexadecimal.
So in an example if resolution of port camera is 1920x1080 and stock is 1080x1920, then in smali we might get a value of 0x438, 0x780 in assortment. Simply replace 0x438 with 0x780 and 0x780 with 0x438.
Replace these values in port apk with the stock equivalent. Recompile.
Keep this open in one window.
Now open up camera and take log.
Most likely you would get a error saying missing resolution
KNOX STATUS REVERT (Kernel)
@topjohnwu for reset prop
The reset prop source was removed from topjohnwu thread however you could use the prebuilt binary in his magisk release zips.
1. Pick your device arch and remove binary from zip
2. Now download a tool to extract boot images.
3. Navigate to sbin and drop your resetprop binary.
4. Get back to root directory and add this file http://www106.zippyshare.com/v/AzldZO7A/file.html
5. Now in init.rc add this code
Code:
# Call Knox Reset
service knox-daemon /system/bin/sh /init.knox.sh
class main
user root
oneshot
Device Specific Section
(Section will detail device specific edits for particular devices once users post.)
mitko7411 said:
So I haven't really made a new list of smalis for porting roms, but here's the ones just to boot ANY 6.0.1 firmware on J5 2015.
Debug
GpsLocationProvider
KnoxVpnPacProcessor
TADriver
SchedPolicyManager
Click to expand...
Click to collapse
No Pm type message below.
Also I will post below all the logs I used to boot Note 7 firmware on my s5
All the edits used to boot Note 7 firmware on S5 it is different for every device.
https://mega.nz/#!8ZtzWCJR!rqTrvD5K3pUvHOAMq_540L_z7Hx0LFZawSzpobFDF98
Thanks for this guide..
A nice guide. Thanks! :highfive:
Ticklefish said:
A nice guide. Thanks! :highfive:
Click to expand...
Click to collapse
Thanks
Sent from my SM-A810S using Tapatalk
Great Extremely helpful, time for noobs to port now
Thanks mate you finally did it big help
Thanks manYou helped me.
Well ,,
Malbert , im sure 100% , too much things missed in ur guide mate , this way how u do it isn't an how to ported rom from different devices , or high end to previous years device's , sorry to say this but this isn't a full guide & its just a point for drop app/prev/fram to ur stock base then try to booted then with bootloop logcat u will got what's the missing things well ,
Sorry to say it but this isn't a Full guide for HOW TO PORT Roms , ....
Edit ::
Next time try to be more specific & gives more details & which files / jars / smali / apks / libs / xml / config & which we can use & got from ported base to stock base ,
thereassaad said:
Well ,,
Malbert , im sure 100% , too much things missed in ur guide mate , this way how u do it isn't an how to ported rom from different devices , or high end to previous years device's , sorry to say this but this isn't a full guide & its just a point for drop app/prev/fram to ur stock base then try to booted then with bootloop logcat u will got what's the missing things well ,
Sorry to say it but this isn't a Full guide for HOW TO PORT Roms , ....
Edit ::
Next time try to be more specific & gives more details & which files / jars / smali / apks / libs / xml / config & which we can use & got from ported base to stock base ,
Click to expand...
Click to collapse
Thanks assaad will fix when I get time I get what you are saying but this is a intro. I can't explicitly state which jars apks or libs are needed because they are all different for different devices. XML and permissions I could elaborate on but you can't expect me to possibly give a overview of everything right. Hope you understand thanks. I never explicitly stated this was a full guide and you shouldn't treat it as such.
Sent from my SM-A810S using Tapatalk
Well my friend , i never do ,,
For example without editing systemserver.smali the rom will never booted & u know this very well , i just means to be very static for some useful tips for such framework / & well known smali that need to be our eyes on them .. that's all my point means ..
Good luck my friend
thereassaad said:
Well my friend , i never do ,,
For example without editing systemserver.smali the rom will never booted & u know this very well , i just means to be very static for some useful tips for such framework / & well known smali that need to be our eyes on them .. that's all my point means ..
Good luck my friend
Click to expand...
Click to collapse
Ohh I understand what you are saying. I will expand on this guide when I get time hopefully you also could help support and add to this guide as XDA is a community. ? Over time we could help many users thanks for your advice.
Sent from my SM-A810S using Tapatalk
@malbert16442 Can you help me with my S5 which is G9008V China Mobile variant?
I can't boot on Thunderbolt A8 rom...
What should I Fix?
I have successfully ported s7 and n7 firmware using this guide.
Awesome guide!. 9/10
I have one small issue, in your log n79 you have "E SQLiteDatabase: " How did you fix this error? I am having the same issue, with one of my builds.
Solved:
FileSeek ftw!
jonathanmohamed said:
I have successfully ported s7 and n7 firmware using this guide.
Awesome guide!. 9/10
I have one small issue, in your log n79 you have "E SQLiteDatabase: " How did you fix this error? I am having the same issue, with one of my builds.
Solved:
FileSeek ftw!
Click to expand...
Click to collapse
Thanks happy for you. How would you rate your level of expertise so I could set a difficulty level for this
Sent from my Pixel XL using Tapatalk
Learned new debug problems in Sammy Roms updating guide soon, making it more appealing too. Happy that one person actually made a port from this guide.
thnx alot @malbert16442 .... but i have 2 bugs i didnt manage to fix
1-wifi work and i can see available network but when i try to connect i get 'failed to connect' .. I tried to use my stock wifi-service.jar but the device not boot)
2-Camera work (back and front) and i can take photos...but when i try to record video i get 'Recording faield' fixed
Allooosh98 said:
thnx alot @malbert16442 ...using this guide i ported S7e, G532F to j7.....but i have 2 bugs i didnt manage to fix
1-wifi work and i can see available network but when i try to connect i get 'failed to connect' .. I tried to use my stock wifi-service.jar but the device not boot)
2-Camera work (back and front) and i can take photos...but when i try to record video i get 'Recording faield' fixed
Click to expand...
Click to collapse
When you add wifi serivce jar you have edits to make in framework you will see in your log
But don't work I have a fix for stock files too. I work on this guide this weekend make it look better
Okay so alot of people are pming me about fixing camera will post solution or debug solutions here soon
hey @malbert16442 bro can u help me to fix the problem?? there is a E art error in logcat that i cant fix it :
E art : No implementation found for int android.os.storage.sensitive.SecureStorageLSM.lsmInitialize() (tried Java_android_os_storage_sensitive_SecureStorageLSM_lsmInitialize and Java_android_os_storage_sensitive_SecureStorageLSM_lsmInitialize__)
i checked smali files but its as same as stock,i attached the log,if its ok look at it and tell me what should i do

Question [ROOT] A52 device setup for TS.43 testing

I want to test the TS.43 flow by changing some of the carrier configuration (cc) parameters as described in: IMS Service Entitlement | Android Open Source Project
For that, I use:
Samsung Galaxy A52
AP: A525FXXS4BVE1
CP: A525FXXU4BVC2
CSC: A525FOXM4BVC3
Model: SM-A525F/DS
According to documentation, for that, I require the root access and I actually managed to set this up with Magisk and Odin (following this guide: https://www.samsungsfour.com/tutorials/root-galaxy-a52.html , except for some minor deviations like downloading Magisk from official github page).
However, I would still get the error message “cc: Permission denied.” when running the cc command in shellin mode.
I have tried to find information about it but the best I could find was the following:
https://android.googlesource.com/pl.../com/android/phone/TelephonyShellCommand.java
Here on lines 908 and 1481, I can see the check for whether we are running in root mode AND also validation for whether we have a non-"user" build type.
From TelephonyUtils - boolean IS_USER = “user”.equals(android.os.Build.Type);
From Build.TYPE - /** The type of build, like “user” or “eng”. */
public static final String TYPE = getString(“ro.build.type”);
I am not too familiar with Android development, so I would like to ask the following.
How do I get the ro.build.type as something other than “user”?
As I understand, I would need to download the Samsung firmware for my phone which has the ro.build.type=eng OR ro.build.type=userdebug ? Where can I get such ROM? As eng and userdebug are for testing, does Samsung even provides such firmware?
If I am mistaken, could you please generally advise me on such issues and propose some possible solutions?
Note: I understand that what I do might void my phone of warranty and block some applications. This device is for testing purposes only and it is not going to be used in common user activities.
P.S. And yes I decided to try (out of desperation rather than sane mind) and change the build props with BuildProp Editor app (had to reset to factory, I'm not the brightest man around)

Categories

Resources